@dubusoft/toodo-linux-arm64 1.7.1-dev.98 → 1.8.0
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 +1 -1
- package/bin/toodo +0 -0
- package/bin/toodo-server +0 -0
- package/package.json +3 -3
- package/web/assets/{details-sheet-CHYs1lgO.js → details-sheet-CaLyr9FF.js} +1 -1
- package/web/assets/{index-D0fVr31E.js → index-BRv6buGr.js} +4 -4
- package/web/assets/index-cxBzER5r.css +2 -0
- package/web/assets/{offline-screen-wqm_r2Vb.js → offline-screen-h2o9Tj2z.js} +1 -1
- package/web/assets/{review-BdO8tzWH.js → review-BJQCyyBb.js} +1 -1
- package/web/assets/{server-access-BGKgv-lg.js → server-access-DDsyuORf.js} +1 -1
- package/web/assets/{task-details-S81PKtIo.js → task-details-Bdwlw6-2.js} +1 -1
- package/web/assets/{task-graph-S1xlbcq-.js → task-graph-DERVr57J.js} +1 -1
- package/web/index.html +3 -3
- package/web/sw.js +2 -2
- package/web/version.json +1 -1
- package/web/assets/index-DIzkUeDh.css +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-akFj_lY_.js","assets/dist-ZmB2kPfR.js","assets/opener-DWhHPoCL.js","assets/task-details-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markdown-akFj_lY_.js","assets/dist-ZmB2kPfR.js","assets/opener-DWhHPoCL.js","assets/task-details-Bdwlw6-2.js","assets/queries-BX_TBXN8.js","assets/event-DMqRNLc_.js","assets/workspace-list-BQnVlSgX.js","assets/details-sheet-CaLyr9FF.js","assets/task-graph-DERVr57J.js","assets/task-graph-DLioOiRN.css","assets/review-BJQCyyBb.js","assets/server-access-DDsyuORf.js","assets/offline-screen-h2o9Tj2z.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,i as t,n,r,s as i,t as a}from"./dist-ZmB2kPfR.js";import{$ as o,$t as s,At as c,Bt as l,C as u,Ct as d,D as f,Dt as p,E as m,Et as h,Ft as g,G as _,Gt as v,H as y,Ht as b,It as x,J as S,Jt as C,Kt as w,Lt as T,M as E,Mt as D,N as O,Nt as k,O as A,Ot as j,P as M,Pt as N,Q as P,Qt as F,Rt as I,S as L,St as R,T as z,Tt as B,Ut as V,V as ee,Vt as H,W as U,Wt as te,X as ne,Xt as re,Y as ie,Yt as W,Z as G,Zt as ae,_t as oe,an as se,at as ce,b as le,bt as K,c as ue,cn as de,ct as fe,d as pe,dn as me,dt as he,en as ge,et as _e,f as ve,fn as ye,ft as be,g as xe,gt as Se,h as Ce,ht as we,i as Te,in as Ee,it as De,j as Oe,jt as ke,k as Ae,kt as je,l as Me,ln as Ne,lt as Pe,mn as Fe,mt as Ie,n as Le,nn as Re,nt as ze,o as Be,on as Ve,ot as He,p as Ue,pn as We,pt as q,q as Ge,qt as Ke,r as qe,rn as Je,rt as Ye,s as Xe,sn as Ze,st as Qe,tn as $e,tt as et,un as tt,ut as nt,v as rt,vt as it,w as at,wt as ot,x as st,xt as ct,yt as lt,z as ut,zt as dt}from"./queries-BX_TBXN8.js";import{a as ft,c as pt,i as mt,n as ht,o as gt,r as _t,s as vt,t as yt}from"./workspace-list-BQnVlSgX.js";import{_ as bt,a as xt,c as St,d as Ct,g as wt,i as Tt,l as Et,m as Dt,p as Ot,r as kt,s as At,u as jt}from"./event-DMqRNLc_.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Mt(e){let t;if(e.then(e=>(t=e,e),Ne)?.catch?.(Ne),t!==void 0)return{data:t}}function Nt(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function Pt(e,t,n){let r=e.promise?.then(t).catch(e=>n?.(e)===!1?Promise.reject(e):Promise.reject(Error(`redacted`)));return r?.catch(Ne),r}function Ft(e,t,n){return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t?t(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:Pt(e,t,n)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function It(e){return e.state.isPaused}function Lt(e){return e.state.status===`success`}function Rt(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??It,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[Nt(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??Lt,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[Ft(e,o,a)]:[])}}function zt(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?Mt(c):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a?a(f):f,m=i.get(o),h=m?.state.status===`pending`,g=m?.state.fetchStatus===`fetching`;if(m){let e=d&&l>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p,...r.status===`pending`&&p!==void 0&&{status:`success`,dataUpdatedAt:l,...!g&&{fetchStatus:`idle`}}})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:p,fetchStatus:`idle`,status:r.status===`pending`&&p!==void 0?`success`:r.status,...r.status===`pending`&&p!==void 0&&{dataUpdatedAt:l}});c&&!d&&!h&&!g&&l>m.state.dataUpdatedAt&&m.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(Ne)})}var Bt=class extends Je{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new F({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Vt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Vt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Vt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Vt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){$e.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ze(t,e))}findAll(e={}){return this.getAll().filter(t=>Ze(e,t))}notify(e){$e.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return $e.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ne))))}};function Vt(e){return e.options.scope?.id}var Ht=class extends Je{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Ve(r,t),a=this.get(i);return a||(a=new s({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){$e.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>de(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>de(e,t)):t}notify(e){$e.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){$e.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){$e.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ut=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ht,this.#t=e.mutationCache||new Bt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Re.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ge.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(me(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ee(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return $e.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;$e.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return $e.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=$e.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ne).catch(Ne)}invalidateQueries(e,t={}){return $e.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=$e.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ne)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ne)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(me(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(me(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ne).catch(Ne)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ne).catch(Ne)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return ge.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(se(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{tt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(se(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{tt(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ve(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ye&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Wt=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Gt=e(((e,t)=>{t.exports=Wt()})),Kt=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),qt=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Kt()})),Jt=e((e=>{var n=Gt(),r=t(),i=qt();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),A=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),F=Symbol.for(`react.suspense`),I=Symbol.for(`react.suspense_list`),L=Symbol.for(`react.memo`),R=Symbol.for(`react.lazy`),z=Symbol.for(`react.activity`),B=Symbol.for(`react.legacy_hidden`),V=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.for(`react.view_transition`),H=Symbol.for(`react.recoverable`),U=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=U&&e[U]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case j:return`Profiler`;case A:return`StrictMode`;case F:return`Suspense`;case I:return`SuspenseList`;case z:return`Activity`;case ee:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case N:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case L:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case R:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,W=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},oe=[],se=-1;function ce(e){return{current:e}}function le(e){0>se||(e.current=oe[se],oe[se]=null,se--)}function K(e,t){se++,oe[se]=e.current,e.current=t}var ue=ce(null),de=ce(null),fe=ce(null),pe=ce(null);function me(e,t){switch(K(fe,t),K(de,e),K(ue,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(ue),K(ue,e)}function he(){le(ue),le(de),le(fe)}function ge(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,K(pe,e)),t=ue.current;var n=dp(t,e.type);t!==n&&(K(de,e),K(ue,n))}function _e(e){de.current===e&&(le(ue),le(de)),pe.current===e&&(le(pe),sh._currentValue=ae)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+ve+e+ye}var xe=!1;function Se(e,t){if(!e||xe)return``;xe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -7,6 +7,6 @@ import{a as e,i as t,n,r,s as i,t as a}from"./dist-ZmB2kPfR.js";import{$ as o,$t
|
|
|
7
7
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);case 30:return be(`ViewTransition`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
8
|
Error generating stack: `+e.message+`
|
|
9
9
|
`+e.stack}}var Te=Object.prototype.hasOwnProperty,Ee=n.unstable_scheduleCallback,De=n.unstable_cancelCallback,Oe=n.unstable_shouldYield,ke=n.unstable_requestPaint,Ae=n.unstable_now,je=n.unstable_getCurrentPriorityLevel,Me=n.unstable_ImmediatePriority,Ne=n.unstable_UserBlockingPriority,Pe=n.unstable_NormalPriority,Fe=n.unstable_LowPriority,Ie=n.unstable_IdlePriority,Le=n.log,Re=n.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:q,Ue=Math.log,We=Math.LN2;function q(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ge=256,Ke=262144,qe=4194304;function Je(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ye(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Je(n))):i=Je(o):i=Je(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Je(n))):i=Je(o)):i=Je(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Xe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ze(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-He(n),i=1<<r;t|=e[r],n&=~i}return t}function Qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $e(){var e=qe;return qe<<=1,!(qe&62914560)&&(qe=4194304),e}function et(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-He(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&rt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function rt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function it(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function at(e,t){var n=t&-t;return n=n&42?1:ot(n),(n&(e.suspendedLanes|t))===0?n:0}function ot(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function st(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ct(){var e=G.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function lt(e,t){var n=G.p;try{return G.p=e,t()}finally{G.p=n}}var ut=Math.random().toString(36).slice(2),dt=`__reactFiber$`+ut,ft=`__reactProps$`+ut,pt=`__reactContainer$`+ut,mt=`__reactEvents$`+ut,ht=`__reactListeners$`+ut,gt=`__reactHandles$`+ut,_t=`__reactResources$`+ut,vt=`__reactMarker$`+ut,yt=`__reactLoad$`+ut;function bt(e){delete e[dt],delete e[ft],delete e[ht],delete e[gt]}function xt(e){var t;if(t=e[dt])return t;for(var n=e.parentNode;n;){if(t=n[pt]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[dt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function St(e){if(e=e[dt]||e[pt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function wt(e){var t=e[_t];return t||=e[_t]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Tt(e){e[vt]=!0}function Et(e){e[yt]=void 0}var Dt=new Set,Ot={};function kt(e,t){At(e,t),At(e+`Capture`,t)}function At(e,t){for(Ot[e]=t,e=0;e<t.length;e++)Dt.add(t[e])}var jt=RegExp(`^[: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]*$`),Mt={},Nt={};function Pt(e){return Te.call(Nt,e)?!0:Te.call(Mt,e)?!1:jt.test(e)?Nt[e]=!0:(Mt[e]=!0,!1)}var Ft=!1;function It(){var e=Ft;return Ft=!1,e}function Lt(e,t,n){if(Pt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Rt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function zt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Bt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Vt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ht(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ut(e){if(!e._valueTracker){var t=Vt(e)?`checked`:`value`;e._valueTracker=Ht(e,t,``+e[t])}}function Wt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Vt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Kt=/[\n"\\]/g;function Jt(e){return e.replace(Kt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Yt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Bt(t)):e.value!==``+Bt(t)&&(e.value=``+Bt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Zt(e,Bt(n)):o===`number`&&e.value==t?Zt(e,Bt(e.value)):Zt(e,Bt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Bt(s):e.removeAttribute(`name`)}function Xt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ut(e);return}n=n==null?``:``+Bt(n),t=t==null?n:``+Bt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ut(e)}function Zt(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function Qt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Bt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function $t(e,t,n){t!=null&&(t=``+Bt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Bt(n)}function en(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ie(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Bt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ut(e)}function tn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var nn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function rn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||nn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function an(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Ft=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(rn(e,i,r),Ft=!0)}else for(var o in t)t.hasOwnProperty(o)&&rn(e,o,t[o])}function on(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 sn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),cn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ln(e){return cn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function un(){}var dn=null;function fn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pn=null,mn=null;function hn(e){var t=St(e);if(t&&(e=t.stateNode)){var n=e[ft]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Yt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ft]||null;if(!i)throw Error(a(90));Yt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Wt(r)}break a;case`textarea`:$t(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Qt(e,!!n.multiple,t,!1)}}}var gn=!1;function _n(e,t,n){if(gn)return e(t,n);gn=!0;try{return e(t)}finally{if(gn=!1,(pn!==null||mn!==null)&&(Id(),pn&&(t=pn,e=mn,mn=pn=null,hn(t),e)))for(t=0;t<e.length;t++)hn(e[t])}}function vn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ft]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var yn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,bn=!1;if(yn)try{var xn={};Object.defineProperty(xn,"passive",{get:function(){bn=!0}}),window.addEventListener(`test`,xn,xn),window.removeEventListener(`test`,xn,xn)}catch{bn=!1}var Sn=null,Cn=null,wn=null;function Tn(){if(wn)return wn;var e,t=Cn,n=t.length,r,i=`value`in Sn?Sn.value:Sn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return wn=i.slice(e,1<r?1-r:void 0)}function En(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Dn(){return!0}function On(){return!1}function kn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Dn:On,this.isPropagationStopped=On,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Dn)},persist:function(){},isPersistent:Dn}),t}var An={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jn=kn(An),Mn=T({},An,{view:0,detail:0}),Nn=kn(Mn),Pn,Fn,In,Ln=T({},Mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==In&&(In&&e.type===`mousemove`?(Pn=e.screenX-In.screenX,Fn=e.screenY-In.screenY):Fn=Pn=0,In=e),Pn)},movementY:function(e){return`movementY`in e?e.movementY:Fn}}),Rn=kn(Ln),zn=kn(T({},Ln,{dataTransfer:0})),Bn=kn(T({},Mn,{relatedTarget:0})),Vn=kn(T({},An,{animationName:0,elapsedTime:0,pseudoElement:0})),Hn=kn(T({},An,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Un=kn(T({},An,{data:0})),Wn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Gn={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`},Kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kn[e])?!!t[e]:!1}function Jn(){return qn}var Yn=kn(T({},Mn,{key:function(e){if(e.key){var t=Wn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=En(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Gn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jn,charCode:function(e){return e.type===`keypress`?En(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?En(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Xn=kn(T({},Ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Zn=kn(T({},An,{submitter:0})),Qn=kn(T({},Mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jn})),$n=kn(T({},An,{propertyName:0,elapsedTime:0,pseudoElement:0})),er=kn(T({},Ln,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),tr=kn(T({},An,{newState:0,oldState:0,source:0})),nr=[9,13,27,32],rr=yn&&`CompositionEvent`in window,ir=null;yn&&`documentMode`in document&&(ir=document.documentMode);var ar=yn&&`TextEvent`in window&&!ir,or=yn&&(!rr||ir&&8<ir&&11>=ir),sr=` `,cr=!1;function lr(e,t){switch(e){case`keyup`:return nr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ur(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var dr=!1;function fr(e,t){switch(e){case`compositionend`:return ur(t);case`keypress`:return t.which===32?(cr=!0,sr):null;case`textInput`:return e=t.data,e===sr&&cr?null:e;default:return null}}function pr(e,t){if(dr)return e===`compositionend`||!rr&&lr(e,t)?(e=Tn(),wn=Cn=Sn=null,dr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return or&&t.locale!==`ko`?null:t.data;default:return null}}var mr={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 hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!mr[e.type]:t===`textarea`}function gr(e,t,n,r){pn?mn?mn.push(r):mn=[r]:pn=r,t=qf(t,`onChange`),0<t.length&&(n=new jn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var _r=null,vr=null;function yr(e){zf(e,0)}function br(e){if(Wt(Ct(e)))return e}function xr(e,t){if(e===`change`)return t}var Sr=!1;if(yn){var Cr;if(yn){var wr=`oninput`in document;if(!wr){var Tr=document.createElement(`div`);Tr.setAttribute(`oninput`,`return;`),wr=typeof Tr.oninput==`function`}Cr=wr}else Cr=!1;Sr=Cr&&(!document.documentMode||9<document.documentMode)}function Er(){_r&&(_r.detachEvent(`onpropertychange`,Dr),vr=_r=null)}function Dr(e){if(e.propertyName===`value`&&br(vr)){var t=[];gr(t,vr,e,fn(e)),_n(yr,t)}}function Or(e,t,n){e===`focusin`?(Er(),_r=t,vr=n,_r.attachEvent(`onpropertychange`,Dr)):e===`focusout`&&Er()}function kr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return br(vr)}function Ar(e,t){if(e===`click`)return br(t)}function jr(e,t){if(e===`input`||e===`change`)return br(t)}function Mr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Nr=typeof Object.is==`function`?Object.is:Mr;function Pr(e,t){if(Nr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Te.call(t,i)||!Nr(e[i],t[i]))return!1}return!0}function Fr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Ir(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lr(e,t){var n=Ir(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ir(n)}}function J(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?J(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Fr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fr(e.document)}return t}function zr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Br=yn&&`documentMode`in document&&11>=document.documentMode,Vr=null,Hr=null,Ur=null,Wr=!1;function Gr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wr||Vr==null||Vr!==Fr(r)||(r=Vr,`selectionStart`in r&&zr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ur&&Pr(Ur,r)||(Ur=r,r=qf(Hr,`onSelect`),0<r.length&&(t=new jn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Vr)))}function Kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var qr={animationend:Kr(`Animation`,`AnimationEnd`),animationiteration:Kr(`Animation`,`AnimationIteration`),animationstart:Kr(`Animation`,`AnimationStart`),transitionrun:Kr(`Transition`,`TransitionRun`),transitionstart:Kr(`Transition`,`TransitionStart`),transitioncancel:Kr(`Transition`,`TransitionCancel`),transitionend:Kr(`Transition`,`TransitionEnd`)},Jr={},Yr={};yn&&(Yr=document.createElement(`div`).style,`AnimationEvent`in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),`TransitionEvent`in window||delete qr.transitionend.transition);function Xr(e){if(Jr[e])return Jr[e];if(!qr[e])return e;var t=qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yr)return Jr[e]=t[n];return e}var Zr=Xr(`animationend`),Qr=Xr(`animationiteration`),$r=Xr(`animationstart`),ei=Xr(`transitionrun`),ti=Xr(`transitionstart`),ni=Xr(`transitioncancel`),ri=Xr(`transitionend`),ii=new Map,ai=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ai.push(`scrollEnd`);function oi(e,t){ii.set(e,t),kt(t,[e])}var si=0;function Y(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=_d.identifierPrefix;var n=si++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function ci(e){if(e==null||typeof e==`string`)return e;var t=null,n=Td;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function li(e,t){return e=ci(e),t=ci(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var ui=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},di=[],fi=0,pi=0;function mi(){for(var e=fi,t=pi=fi=0;t<e;){var n=di[t];di[t++]=null;var r=di[t];di[t++]=null;var i=di[t];di[t++]=null;var a=di[t];if(di[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&vi(n,i,a)}}function hi(e,t,n,r){di[fi++]=e,di[fi++]=t,di[fi++]=n,di[fi++]=r,pi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function gi(e,t,n,r){return hi(e,t,n,r),yi(e)}function _i(e,t){return hi(e,null,null,t),yi(e)}function vi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-He(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function yi(e){if(50<Ed)throw Ed=0,Dd=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bi={};function xi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Si(e,t,n,r){return new xi(e,t,n,r)}function Ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wi(e,t){var n=e.alternate;return n===null?(n=Si(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ti(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ei(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Ci(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,ue.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case z:return e=Si(31,n,t,i),e.elementType=z,e.lanes=o,e;case k:return Di(n.children,i,o,t);case A:s=8,i|=24;break;case j:return e=Si(12,n,t,i|2),e.elementType=j,e.lanes=o,e;case F:return e=Si(13,n,t,i),e.elementType=F,e.lanes=o,e;case I:return e=Si(19,n,t,i),e.elementType=I,e.lanes=o,e;case B:case ee:return e=i|32,e=Si(30,n,t,e),e.elementType=ee,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case P:s=11;break a;case L:s=14;break a;case R:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Si(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Di(e,t,n,r){return e=Si(7,e,r,t),e.lanes=n,e}function Oi(e,t,n){return e=Si(6,e,null,t),e.lanes=n,e}function ki(e){var t=Si(18,null,null,0);return t.stateNode=e,t}function Ai(e,t,n){return t=Si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ji=new WeakMap;function Mi(e,t){if(typeof e==`object`&&e){var n=ji.get(e);return n===void 0?(t={value:e,source:t,stack:we(t)},ji.set(e,t),t):n}return{value:e,source:t,stack:we(t)}}var Ni=[],Pi=0,Fi=null,Ii=0,Li=[],Ri=0,zi=null,Bi=1,Vi=``;function Hi(e,t){Ni[Pi++]=Ii,Ni[Pi++]=Fi,Fi=e,Ii=t}function Ui(e,t,n){Li[Ri++]=Bi,Li[Ri++]=Vi,Li[Ri++]=zi,zi=e;var r=Bi;e=Vi;var i=32-He(r)-1;r&=~(1<<i),n+=1;var a=32-He(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Bi=1<<32-He(t)+i|n<<i|r,Vi=a+e}else Bi=1<<a|n<<i|r,Vi=e}function Wi(e){e.return!==null&&(Hi(e,1),Ui(e,1,0))}function Gi(e){for(;e===Fi;)Fi=Ni[--Pi],Ni[Pi]=null,Ii=Ni[--Pi],Ni[Pi]=null;for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Vi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null}function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=Vi,Li[Ri++]=zi,Bi=t.id,Vi=t.overflow,zi=e}var qi=null,Ji=null,X=!1,Yi=null,Xi=!1,Zi=Error(a(519));function Qi(e){throw ia(Mi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Zi}function $i(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[dt]=e,t[ft]=r,n){case`dialog`:Bf(`cancel`,t),Bf(`close`,t);break;case`iframe`:case`object`:case`embed`:Bf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Lf.length;n++)Bf(Lf[n],t);break;case`source`:Bf(`error`,t);break;case`img`:case`image`:case`link`:Bf(`error`,t),Bf(`load`,t);break;case`details`:Bf(`toggle`,t);break;case`input`:Bf(`invalid`,t),Xt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Bf(`invalid`,t);break;case`textarea`:Bf(`invalid`,t),en(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&(Bf(`beforetoggle`,t),Bf(`toggle`,t)),r.onScroll!=null&&Bf(`scroll`,t),r.onScrollEnd!=null&&Bf(`scrollend`,t),r.onClick!=null&&(t.onclick=un),t=!0):t=!1,t||Qi(e,!0)}function ea(e){for(qi=e.return;qi;)switch(qi.tag){case 5:case 31:case 13:Xi=!1;return;case 27:case 3:Xi=!0;return;default:qi=qi.return}}function ta(e){if(e!==qi)return!1;if(!X)return ea(e),X=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Ji&&Qi(e),ea(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ji=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ji=dm(e)}else t===27?(t=Ji,Sp(e.type)?(e=um,um=null,Ji=e):Ji=t):Ji=qi?lm(e.stateNode.nextSibling):null;return!0}function na(){Ji=qi=null,X=!1}function ra(){var e=Yi;return e!==null&&(ld===null?ld=e:ld.push.apply(ld,e),Yi=null),e}function ia(e){Yi===null?Yi=[e]:Yi.push(e)}var aa=ce(null),oa=null,sa=null;function ca(e,t,n){K(aa,t._currentValue),t._currentValue=n}function la(e){e._currentValue=aa.current,le(aa)}function ua(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function da(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ua(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ua(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ua(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function fa(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Nr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===pe.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&da(t,e,n,r),t.flags|=262144,e!==null}function pa(e){for(e=e.firstContext;e!==null;){if(!Nr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ma(e){oa=e,sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ha(e){return _a(oa,e)}function ga(e,t){return oa===null&&ma(e),_a(e,t)}function _a(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},sa===null){if(e===null)throw Error(a(308));sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else sa=sa.next=t;return n}var va=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ya=n.unstable_scheduleCallback,ba=n.unstable_NormalPriority,xa={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sa(){return{controller:new va,data:new Map,refCount:0}}function Ca(e){e.refCount--,e.refCount===0&&ya(ba,function(){e.controller.abort()})}function wa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ta=null;function Ea(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Da=null,Oa=0,ka=0,Aa=null;function ja(e,t){if(Da===null){var n=Da=[];Oa=0,ka=Mf(),Aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Oa++,t.then(Ma,Ma),t}function Ma(){if(--Oa===0&&(Ta=null,Da!==null)){Aa!==null&&(Aa.status=`fulfilled`);var e=Da;Da=null,ka=0,Aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Na(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Pa=W.S;W.S=function(e,t){if(fd=Ae(),typeof t==`object`&&t&&typeof t.then==`function`&&ja(e,t),Ta!==null)for(var n=vf;n!==null;)wa(n,Ta),n=n.next;if(n=e.types,n!==null){for(var r=vf;r!==null;)wa(r,n),r=r.next;if(ka!==0){r=Ta,r===null&&(r=Ta=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Pa!==null&&Pa(e,t)};var Fa=ce(null);function Ia(){var e=Fa.current;return e===null?qu.pooledCache:e}function La(e,t){t===null?K(Fa,Fa.current):K(Fa,t.pool)}function Ra(){var e=Ia();return e===null?null:{parent:xa._currentValue,pool:e}}var za=Error(a(460)),Ba=Error(a(474)),Va=Error(a(542)),Ha={then:function(){}};function Ua(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(un,un),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ja(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(un,un);else{if(e=qu,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ja(e),e}throw Ka=t,za}}function Ga(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ka=e,za):e}}var Ka=null;function qa(){if(Ka===null)throw Error(a(459));var e=Ka;return Ka=null,e}function Ja(e){if(e===za||e===Va)throw Error(a(483))}var Ya=null,Xa=0;function Za(e){var t=Xa;return Xa+=1,Ya===null&&(Ya=[]),Wa(Ya,e,t)}function Qa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function $a(e,t){throw t.$$typeof===E?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function eo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=wi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Oi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===k?(e=d(e,t,n.props.children,r,n.key),Qa(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===R&&Ga(a)===t.type)?(t=i(t,n.props),Qa(t,n),t.return=e,t):(t=Ei(n.type,n.key,n.props,null,e.mode,r),Qa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ai(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Di(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Oi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Ei(t.type,t.key,t.props,null,e.mode,n),Qa(n,t),n.return=e,n;case O:return t=Ai(t,e.mode,n),t.return=e,t;case R:return t=Ga(t),f(e,t,n)}if(ie(t)||te(t))return t=Di(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Za(t),n);if(t.$$typeof===N)return f(e,ga(e,t),n);$a(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case R:return n=Ga(n),p(e,t,n,r)}if(ie(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Za(n),r);if(n.$$typeof===N)return p(e,t,ga(e,n),r);$a(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case R:return r=Ga(r),m(e,t,n,r,i)}if(ie(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Za(r),i);if(r.$$typeof===N)return m(e,t,n,ga(t,r),i);$a(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),X&&Hi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return X&&Hi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),X&&Hi(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),X&&Hi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return X&&Hi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),X&&Hi(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),Qa(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===R&&Ga(l)===r.type){n(e,r.sibling),c=i(r,o.props),Qa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Di(o.props.children,e.mode,c,o.key),Qa(c,o),c.return=e,e=c):(c=Ei(o.type,o.key,o.props,null,e.mode,c),Qa(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ai(o,e.mode,c),c.return=e,e=c}return s(e);case R:return o=Ga(o),_(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,Za(o),c);if(o.$$typeof===N)return _(e,r,ga(e,o),c);$a(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=Oi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Xa=0;var i=_(e,t,n,r);return Ya=null,i}catch(t){if(t===za||t===Va)throw t;var a=Si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var to=eo(!0),no=eo(!1),ro=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ao(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function oo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function so(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ku&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=yi(e),vi(e,null,n),t}return hi(e,r,t,n),yi(e)}function co(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}function lo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var uo=!1;function fo(){if(uo){var e=Aa;if(e!==null)throw e}}function po(e,t,n,r){uo=!1;var i=e.updateQueue;ro=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Yu&f)===f:(r&f)===f){f!==0&&f===ka&&(uo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:ro=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),rd|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function ho(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)mo(n[e],t)}var go=ce(null),_o=ce(0);function vo(e,t){e=td,K(_o,e),K(go,t),td=e|t.baseLanes}function yo(){K(_o,td),K(go,go.current)}function bo(){td=_o.current,le(go),le(_o)}var xo=ce(null),So=null;function Co(e){var t=e.alternate;K(Oo,Oo.current&1),K(xo,e),So===null&&(t===null||go.current!==null||t.memoizedState!==null)&&(So=e)}function wo(e){K(Oo,Oo.current),K(xo,e),So===null&&(So=e)}function To(e){e.tag===22?(K(Oo,Oo.current),K(xo,e),So===null&&(So=e)):Eo()}function Eo(){K(Oo,Oo.current),K(xo,xo.current)}function Do(e){le(xo),So===e&&(So=null),le(Oo)}var Oo=ce(0);function ko(e,t){K(xo,xo.current),K(Oo,t)}function Ao(e){le(Oo),le(xo),So===e&&(So=null)}function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Mo=0,Z=null,No=null,Po=null,Fo=!1,Io=!1,Lo=!1,Ro=0,zo=0,Bo=null,Vo=0;function Ho(){throw Error(a(321))}function Uo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Nr(e[n],t[n]))return!1;return!0}function Wo(e,t,n,r,i,a){return Mo=a,Z=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?oc:sc,Lo=!1,a=n(r,i),Lo=!1,Io&&(a=Ko(t,n,r,i)),Go(e),a}function Go(e){W.H=ac;var t=No!==null&&No.next!==null;if(Mo=0,Po=No=Z=null,Fo=!1,zo=0,Bo=null,t)throw Error(a(300));e===null||$||(e=e.dependencies,e!==null&&pa(e)&&($=!0))}function Ko(e,t,n,r){Z=e;var i=0;do{if(Io&&(Bo=null),zo=0,Io=!1,25<=i)throw Error(a(301));if(i+=1,Po=No=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}W.H=cc,o=t(n,r)}while(Io);return o}function qo(){var e=W.H,t=e.useState()[0];return t=typeof t.then==`function`?es(t):t,e=e.useState()[0],(No===null?null:No.memoizedState)!==e&&(Z.flags|=1024),t}function Jo(){var e=Ro!==0;return Ro=0,e}function Yo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Xo(e){if(Fo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Fo=!1}Mo=0,Po=No=Z=null,Io=!1,zo=Ro=0,Bo=null}function Zo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Po===null?Z.memoizedState=Po=e:Po=Po.next=e,Po}function Qo(){if(No===null){var e=Z.alternate;e=e===null?null:e.memoizedState}else e=No.next;var t=Po===null?Z.memoizedState:Po.next;if(t!==null)Po=t,No=e;else{if(e===null)throw Z.alternate===null?Error(a(467)):Error(a(310));No=e,e={memoizedState:No.memoizedState,baseState:No.baseState,baseQueue:No.baseQueue,queue:No.queue,next:null},Po===null?Z.memoizedState=Po=e:Po=Po.next=e}return Po}function $o(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function es(e){var t=zo;return zo+=1,Bo===null&&(Bo=[]),e=Wa(Bo,e,t),t=Z,(Po===null?t.memoizedState:Po.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?oc:sc),e}function ts(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return es(e);if(e.$$typeof===H)return;if(e.$$typeof===N)return ha(e)}throw Error(a(438,String(e)))}function ns(e){var t=null,n=Z.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Z.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=$o(),Z.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=V;return t.index++,n}function rs(e,t){return typeof t==`function`?t(e):t}function is(e){return as(Qo(),No,e)}function as(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Mo&f)===f:(Yu&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ka&&(d=!0);else if((Mo&p)===p){u=u.next,p===ka&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Z.lanes|=p,rd|=p;f=u.action,Lo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Z.lanes|=f,rd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Nr(o,e.memoizedState)&&($=!0,d&&(n=Aa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function os(e){var t=Qo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Nr(o,t.memoizedState)||($=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ss(e,t,n){var r=Z,i=Qo(),o=X;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Nr((No||i).memoizedState,n);if(s&&(i.memoizedState=n,$=!0),i=i.queue,Ms(us.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Po!==null&&!!(Po.memoizedState.tag&1),Ds(e?9:8,{destroy:void 0},ls.bind(null,r,i,n,t),null),e){if(r.flags|=2048,qu===null)throw Error(a(349));o||Mo&127||cs(r,t,n)}return n}function cs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Z.updateQueue,t===null?(t=$o(),Z.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ls(e,t,n,r){t.value=n,t.getSnapshot=r,ds(t)&&fs(e)}function us(e,t,n){return n(function(){ds(t)&&fs(e)})}function ds(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Nr(e,n)}catch{return!0}}function fs(e){var t=_i(e,2);t!==null&&jd(t,e,2)}function ps(e){var t=Zo();if(typeof e==`function`){var n=e;if(e=n(),Lo){Ve(!0);try{n()}finally{Ve(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:e},t}function ms(e,t,n,r){return e.baseState=n,as(e,No,typeof r==`function`?r:rs)}function hs(e,t,n,r,i){if(nc(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};W.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,gs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function gs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=W.T,o={};o.types=a===null?null:a.types,W.T=o;try{var s=n(i,r),c=W.S;c!==null&&c(o,s),_s(e,t,s)}catch(n){ys(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),W.T=a}}else try{a=n(i,r),_s(e,t,a)}catch(n){ys(e,t,n)}}function _s(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){vs(e,t,n)},function(n){return ys(e,t,n)}):vs(e,t,n)}function vs(e,t,n){t.status=`fulfilled`,t.value=n,bs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,gs(e,n)))}function ys(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,bs(t),t=t.next;while(t!==r)}e.action=null}function bs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function xs(e,t){return t}function Ss(e,t){if(X){var n=qu.formState;if(n!==null){a:{var r=Z;if(X){if(Ji){b:{for(var i=Ji,a=Xi;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ji=lm(i.nextSibling),r=i.data===`F!`;break a}}Qi(r)}r=!1}r&&(t=n[0])}}return n=Zo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:t},n.queue=r,n=ec.bind(null,Z,r),r.dispatch=n,r=ps(!1),a=Q.bind(null,Z,!1,r.queue),r=Zo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=hs.bind(null,Z,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Cs(e){return ws(Qo(),No,e)}function ws(e,t,n){if(t=as(e,t,xs)[0],e=is(rs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=es(t)}catch(e){throw e===za?Va:e}else r=t;t=Qo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Z.flags|=2048,Ds(9,{destroy:void 0},Ts.bind(null,i,n),null)),[r,a,e]}function Ts(e,t){e.action=t}function Es(e){var t=Qo(),n=No;if(n!==null)return ws(t,n,e);Qo(),t=t.memoizedState,n=Qo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ds(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Z.updateQueue,t===null&&(t=$o(),Z.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Os(){return Qo().memoizedState}function ks(e,t,n,r){var i=Zo();Z.flags|=e,i.memoizedState=Ds(1|t,{destroy:void 0},n,r===void 0?null:r)}function As(e,t,n,r){var i=Qo();r=r===void 0?null:r;var a=i.memoizedState.inst;No!==null&&r!==null&&Uo(r,No.memoizedState.deps)?i.memoizedState=Ds(t,a,n,r):(Z.flags|=e,i.memoizedState=Ds(1|t,a,n,r))}function js(e,t){ks(8390656,8,e,t)}function Ms(e,t){As(2048,8,e,t)}function Ns(e){Z.flags|=4;var t=Z.updateQueue;if(t===null)t=$o(),Z.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ps(e){var t=Qo().memoizedState;return Ns({ref:t,nextImpl:e}),function(){if(Ku&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Fs(e,t){return As(4,2,e,t)}function Is(e,t){return As(4,4,e,t)}function Ls(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Rs(e,t,n){n=n==null?null:n.concat([e]),As(4,4,Ls.bind(null,t,e),n)}function zs(){}function Bs(e,t){var n=Qo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Uo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vs(e,t){var n=Qo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Uo(t,r[1]))return r[0];if(r=e(),Lo){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r}function Hs(e,t,n){return n===void 0||Mo&1073741824&&!(Yu&261930)?e.memoizedState=t:(e.memoizedState=n,e=kd(),Z.lanes|=e,rd|=e,n)}function Us(e,t,n,r){return Nr(n,t)?n:go.current===null?!(Mo&106)||Mo&1073741824&&!(Yu&261930)?($=!0,e.memoizedState=n):(e=kd(),Z.lanes|=e,rd|=e,t):(e=Hs(e,n,r),Nr(e,t)||($=!0),e)}function Ws(e,t,n,r,i){var a=G.p;G.p=a!==0&&8>a?a:8;var o=W.T,s={};s.types=o===null?null:o.types,W.T=s,Q(e,!1,t,n);try{var c=i(),l=W.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?tc(e,t,Na(c,r),Od(e)):tc(e,t,r,Od(e))}catch(n){tc(e,t,{then:function(){},status:`rejected`,reason:n},Od())}finally{G.p=a,o!==null&&s.types!==null&&(o.types=s.types),W.T=o}}function Gs(){}function Ks(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=qs(e).queue;Ws(e,i,t,ae,n===null?Gs:function(){return Js(e),n(r)})}function qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Js(e){var t=qs(e);t.next===null&&(t=e.alternate.memoizedState),tc(e,t.next.queue,{},Od())}function Ys(){return ha(sh)}function Xs(){return Qo().memoizedState}function Zs(){return Qo().memoizedState}function Qs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Od();e=oo(n);var r=so(t,e,n);r!==null&&(jd(r,t,n),co(r,t,n)),t={cache:Sa()},e.payload=t;return}t=t.return}}function $s(e,t,n){var r=Od();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},nc(e)?rc(t,n):(n=gi(e,t,n,r),n!==null&&(jd(n,e,r),ic(n,t,r)))}function ec(e,t,n){tc(e,t,n,Od())}function tc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(nc(e))rc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Nr(s,o))return hi(e,t,i,0),qu===null&&mi(),!1}catch{}if(n=gi(e,t,i,r),n!==null)return jd(n,e,r),ic(n,t,r),!0}return!1}function Q(e,t,n,r){if(r={lane:2,revertLane:Mf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},nc(e)){if(t)throw Error(a(479))}else t=gi(e,n,r,2),t!==null&&jd(t,e,2)}function nc(e){var t=e.alternate;return e===Z||t!==null&&t===Z}function rc(e,t){Io=Fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ic(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}var ac={readContext:ha,use:ts,useCallback:Ho,useContext:Ho,useEffect:Ho,useImperativeHandle:Ho,useLayoutEffect:Ho,useInsertionEffect:Ho,useMemo:Ho,useReducer:Ho,useRef:Ho,useState:Ho,useDebugValue:Ho,useDeferredValue:Ho,useTransition:Ho,useSyncExternalStore:Ho,useId:Ho,useHostTransitionStatus:Ho,useFormState:Ho,useActionState:Ho,useOptimistic:Ho,useMemoCache:Ho,useCacheRefresh:Ho,useEffectEvent:Ho},oc={readContext:ha,use:ts,useCallback:function(e,t){return Zo().memoizedState=[e,t===void 0?null:t],e},useContext:ha,useEffect:js,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ks(4194308,4,Ls.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){ks(4,2,e,t)},useMemo:function(e,t){var n=Zo();t=t===void 0?null:t;var r=e();if(Lo){Ve(!0);try{e()}finally{Ve(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Zo();if(n!==void 0){var i=n(t);if(Lo){Ve(!0);try{n(t)}finally{Ve(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=$s.bind(null,Z,e),[r.memoizedState,e]},useRef:function(e){var t=Zo();return e={current:e},t.memoizedState=e},useState:function(e){e=ps(e);var t=e.queue,n=ec.bind(null,Z,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:zs,useDeferredValue:function(e,t){return Hs(Zo(),e,t)},useTransition:function(){var e=ps(!1);return e=Ws.bind(null,Z,e.queue,!0,!1),Zo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Z,i=Zo();if(X){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),qu===null)throw Error(a(349));Yu&127||cs(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,js(us.bind(null,r,o,e),[e]),r.flags|=2048,Ds(9,{destroy:void 0},ls.bind(null,r,o,n,t),null),n},useId:function(){var e=Zo(),t=qu.identifierPrefix;if(X){var n=Vi,r=Bi;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Ro++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Vo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ys,useFormState:Ss,useActionState:Ss,useOptimistic:function(e){var t=Zo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Q.bind(null,Z,!0,n),n.dispatch=t,[e,t]},useMemoCache:ns,useCacheRefresh:function(){return Zo().memoizedState=Qs.bind(null,Z)},useEffectEvent:function(e){var t=Zo(),n={impl:e};return t.memoizedState=n,function(){if(Ku&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},sc={readContext:ha,use:ts,useCallback:Bs,useContext:ha,useEffect:Ms,useImperativeHandle:Rs,useInsertionEffect:Fs,useLayoutEffect:Is,useMemo:Vs,useReducer:is,useRef:Os,useState:function(){return is(rs)},useDebugValue:zs,useDeferredValue:function(e,t){return Us(Qo(),No.memoizedState,e,t)},useTransition:function(){var e=is(rs)[0],t=Qo().memoizedState;return[typeof e==`boolean`?e:es(e),t]},useSyncExternalStore:ss,useId:Xs,useHostTransitionStatus:Ys,useFormState:Cs,useActionState:Cs,useOptimistic:function(e,t){return ms(Qo(),No,e,t)},useMemoCache:ns,useCacheRefresh:Zs,useEffectEvent:Ps},cc={readContext:ha,use:ts,useCallback:Bs,useContext:ha,useEffect:Ms,useImperativeHandle:Rs,useInsertionEffect:Fs,useLayoutEffect:Is,useMemo:Vs,useReducer:os,useRef:Os,useState:function(){return os(rs)},useDebugValue:zs,useDeferredValue:function(e,t){var n=Qo();return No===null?Hs(n,e,t):Us(n,No.memoizedState,e,t)},useTransition:function(){var e=os(rs)[0],t=Qo().memoizedState;return[typeof e==`boolean`?e:es(e),t]},useSyncExternalStore:ss,useId:Xs,useHostTransitionStatus:Ys,useFormState:Es,useActionState:Es,useOptimistic:function(e,t){var n=Qo();return No===null?(n.baseState=e,[e,n.queue.dispatch]):ms(n,No,e,t)},useMemoCache:ns,useCacheRefresh:Zs,useEffectEvent:Ps};function lc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var uc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Od(),i=oo(r);i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(jd(t,e,r),co(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Od(),i=oo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=so(e,i,r),t!==null&&(jd(t,e,r),co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Od(),r=oo(n);r.tag=2,t!=null&&(r.callback=t),t=so(e,r,n),t!==null&&(jd(t,e,n),co(t,e,n))}};function dc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Pr(n,r)||!Pr(i,a):!0}function fc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&uc.enqueueReplaceState(t,t.state,null)}function pc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function mc(e){ui(e)}function hc(e){console.error(e)}function gc(e){ui(e)}function _c(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function vc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function yc(e,t,n){return n=oo(n),n.tag=3,n.payload={element:null},n.callback=function(){_c(e,t)},n}function bc(e){return e=oo(e),e.tag=3,e}function xc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){vc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){vc(t,n,r),typeof i!=`function`&&(hd===null?hd=new Set([this]):hd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Sc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&fa(t,n,i,!0),n=xo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return So===null?Ud():n.alternate===null&&nd===0&&(nd=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ff(e,r,i)),!1;case 22:return n.flags|=65536,r===Ha?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ff(e,r,i)),!1}throw Error(a(435,n.tag))}return ff(e,r,i),Ud(),!1}if(X)return t=xo.current,t===null?(r!==Zi&&(t=Error(a(423),{cause:r}),ia(Mi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Mi(r,n),i=yc(e.stateNode,r,i),lo(e,i),nd!==4&&(nd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Zi&&(e=Error(a(422),{cause:r}),ia(Mi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Mi(o,n),cd===null?cd=[o]:cd.push(o),nd!==4&&(nd=2),t===null)return!0;r=Mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=yc(n.stateNode,r,e),lo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(hd===null||!hd.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=bc(i),xc(i,e,n,r),lo(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Cc=Error(a(461)),$=!1;function wc(e,t,n,r){t.child=e===null?no(t,null,n,r):to(t,e.child,n,r)}function Tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ma(t),r=Wo(e,t,n,o,a,i),s=Jo(),e!==null&&!$?(Yo(e,t,i),$c(e,t,i)):(X&&s&&Wi(t),t.flags|=1,wc(e,t,r,i),t.child)}function Ec(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Dc(e,t,a,r,i)):(e=Ei(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!el(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Pr:n,n(o,r)&&e.ref===t.ref)return $c(e,t,i)}return t.flags|=1,e=wi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Dc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Pr(a,r)&&e.ref===t.ref){if($=!1,t.pendingProps=r=a,el(e,i))e.flags&131072&&($=!0);else return t.lanes=e.lanes,$c(e,t,i)}}return Fc(e,t,n,r,i)}function Oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Ac(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&La(t,a===null?null:a.cachePool),a===null?yo():vo(t,a),To(t);else return r=t.lanes=536870912,Ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&La(t,null),yo(),Eo()):(La(t,a.cachePool),vo(t,a),Eo(),t.memoizedState=null);return wc(e,t,i,n),t.child}function kc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ac(e,t,n,r,i){var a=Ia();return a=a===null?null:{parent:xa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&La(t,null),yo(),To(t),e!==null&&fa(e,t,r,!0),t.childLanes=i,null}function jc(e,t){return t=Wc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Mc(e,t,n){return to(t,e.child,null,n),e=jc(t,t.pendingProps),e.flags|=2,Do(t),t.memoizedState=null,e}function Nc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(X){if(r.mode===`hidden`)return e=jc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},kc(null,e);if(wo(t),(e=Ji)?(e=am(e,Xi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zi===null?null:{id:Bi,overflow:Vi},retryLane:536870912,hydrationErrors:null},n=ki(e),n.return=t,t.child=n,qi=t,Ji=null)):e=null,e===null)throw Qi(t);return t.lanes=536870912,null}return jc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(wo(t),i){if(t.flags&256)t.flags&=-257,t=Mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if($||fa(e,t,n,!1),i=(n&e.childLanes)!==0,$||i){if(go.current===null){if(r=qu,r!==null&&(s=at(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,_i(e,s),jd(r,e,s),Cc;Ud()}t=Mc(e,t,n)}else e=o.treeContext,Ji=lm(s.nextSibling),qi=t,X=!0,Yi=null,Xi=!1,e!==null&&Ki(t,e),t=jc(t,r),t.flags|=134221824;return t}return e=wi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Pc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Fc(e,t,n,r,i){return ma(t),n=Wo(e,t,n,r,void 0,i),r=Jo(),e!==null&&!$?(Yo(e,t,i),$c(e,t,i)):(X&&r&&Wi(t),t.flags|=1,wc(e,t,n,i),t.child)}function Ic(e,t,n,r,i,a){return ma(t),t.updateQueue=null,n=Ko(t,r,n,i),Go(e),r=Jo(),e!==null&&!$?(Yo(e,t,a),$c(e,t,a)):(X&&r&&Wi(t),t.flags|=1,wc(e,t,n,a),t.child)}function Lc(e,t,n,r,i){if(ma(t),t.stateNode===null){var a=bi,o=n.contextType;typeof o==`object`&&o&&(a=ha(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=uc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},io(t),o=n.contextType,a.context=typeof o==`object`&&o?ha(o):bi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(lc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&uc.enqueueReplaceState(a,a.state,null),po(t,r,a,i),fo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=pc(n,s);a.props=c;var l=a.context,u=n.contextType;o=bi,typeof u==`object`&&u&&(o=ha(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&fc(t,a,r,o),ro=!1;var f=t.memoizedState;a.state=f,po(t,r,a,i),fo(),l=t.memoizedState,s||f!==l||ro?(typeof d==`function`&&(lc(t,n,d,r),l=t.memoizedState),(c=ro||dc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ao(e,t),o=t.memoizedProps,u=pc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=bi,typeof l==`object`&&l&&(c=ha(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&fc(t,a,r,c),ro=!1,f=t.memoizedState,a.state=f,po(t,r,a,i),fo();var p=t.memoizedState;o!==d||f!==p||ro||e!==null&&e.dependencies!==null&&pa(e.dependencies)?(typeof s==`function`&&(lc(t,n,s,r),p=t.memoizedState),(u=ro||dc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&pa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Pc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=to(t,e.child,null,i),t.child=to(t,null,n,i)):wc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=$c(e,t,i),e}function Rc(e,t,n,r){return na(),t.flags|=256,wc(e,t,n,r),t.child}var zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bc(e){return{baseLanes:e,cachePool:Ra()}}function Vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=od),e}function Hc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Oo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(X){if(i?Co(t):Eo(),(e=Ji)?(e=am(e,Xi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:zi===null?null:{id:Bi,overflow:Vi},retryLane:536870912,hydrationErrors:null},n=ki(e),n.return=t,t.child=n,qi=t,Ji=null)):e=null,e===null)throw Qi(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Eo(),i=t.mode,a=Wc({mode:`hidden`,children:a},i),r=Di(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Bc(n),r.childLanes=Vc(e,o,n),t.memoizedState=zc,kc(null,r)):(Co(t),Uc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Kc(e,t,a,o,r,c,s,n)}return i?(Eo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=wi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Di(i,a,n,null),i.flags|=2):i=wi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,kc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Bc(n):(a=i.cachePool,a===null?a=Ra():(s=xa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Vc(e,o,n),t.memoizedState=zc,kc(e.child,r)):(Co(t),n=e.child,e=n.sibling,n=wi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Uc(e,t){return t=Wc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Wc(e,t){return e=Si(22,e,null,t),e.lanes=0,e}function Gc(e,t,n){return to(t,e.child,null,n),e=Uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Kc(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(Co(t),t.flags&=-257,Gc(e,t,c)):t.memoizedState===null?(Eo(),o=i.fallback,s=t.mode,i=Wc({mode:`visible`,children:i.children},s),o=Di(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,to(t,e.child,null,c),i=t.child,i.memoizedState=Bc(c),i.childLanes=Vc(e,r,c),t.memoizedState=zc,kc(null,i)):(Eo(),t.child=e.child,t.flags|=128,null);if(Co(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(a(419)),i.stack=``,i.digest=r,ia({value:i,source:null,stack:null})),Gc(e,t,c)}if($||fa(e,t,c,!1),r=(c&e.childLanes)!==0,$||r){if(go.current!==null)return Gc(e,t,c);if(r=qu,r!==null&&(i=at(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,_i(e,i),jd(r,e,i),Cc;return om(o)||Ud(),Gc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Ji=lm(o.nextSibling),qi=t,X=!0,Yi=null,Xi=!1,e!==null&&Ki(t,e),t=Uc(t,i.children),t.flags|=134221824,t)}function qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ua(e.return,t,n)}function Jc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&jo(n)===null&&(t=e),e=e.sibling}return t}function Yc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Xc(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function Zc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Oo.current;if(t.flags&128)return ko(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,ko(t,o),i===`backwards`&&e!==null?(Xc(e),wc(e,t,r,n),Xc(e)):wc(e,t,r,n),r=X?Ii:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&qc(e,n,t);else if(e.tag===19)qc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=Jc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,Xc(t)),Yc(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Yc(t,!0,n,null,a,r);break;case`together`:Yc(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Jc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Yc(t,!1,i,n,a,r)}return t.child}function Qc(e,t,n){var r=t.pendingProps;return ca(t,t.type,r.value),wc(e,t,r.children,n),t.child}function $c(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),rd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(fa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function el(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&pa(e)))}function tl(e,t,n){switch(t.tag){case 3:me(t,t.stateNode.containerInfo),ca(t,xa,e.memoizedState.cache),na();break;case 27:case 5:ge(t);break;case 4:me(t,t.stateNode.containerInfo);break;case 10:ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Co(t),t.flags|=128,null;r=fa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Hc(e,t,n):(Co(t),e=$c(e,t,n),e===null?null:e.sibling)}Co(t);break;case 19:if(t.flags&128)return Zc(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(fa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Zc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ko(t,Oo.current),r)break;return null;case 22:return t.lanes=0,Oc(e,t,n,t.pendingProps);case 24:ca(t,xa,e.memoizedState.cache)}return $c(e,t,n)}function nl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)$=!0;else{if(!el(e,n)&&!(t.flags&128))return $=!1,tl(e,t,n);$=!!(e.flags&131072)}}else $=!1,X&&t.flags&1048576&&Ui(t,Ii,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ga(t.elementType),t.type=e,typeof e==`function`)Ci(e)?(r=pc(e,r),t.tag=1,t=Lc(null,t,e,r,n)):(t.tag=0,t=Fc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===P){t.tag=11,t=Tc(null,t,e,r,n);break a}if(i===L){t.tag=14,t=Ec(null,t,e,r,n);break a}if(i===N){t.tag=10,t.type=e,t=Qc(null,t,n);break a}}throw t=re(e)||e,Error(a(306,t,``))}}return t;case 0:return Fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=pc(r,t.pendingProps),Lc(e,t,r,i,n);case 3:a:{if(me(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,ao(e,t),po(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ca(t,xa,r),r!==o.cache&&da(t,[xa],n,!0),fo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Rc(e,t,r,n);break a}if(r!==i){i=Mi(Error(a(424)),t),ia(i),t=Rc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ji=lm(e.firstChild),qi=t,X=!0,Yi=null,Xi=!0,n=no(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(na(),r===i){t=$c(e,t,n);break a}wc(e,t,r,n)}t=t.child}return t;case 26:return Pc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:X||(t.stateNode=fp(t.type,t.pendingProps,fe.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ge(t),e===null&&X&&(r=t.stateNode=hm(t.type,t.pendingProps,fe.current),qi=t,Xi=!0,i=Ji,Sp(t.type)?(um=i,Ji=lm(r.firstChild)):Ji=i),wc(e,t,t.pendingProps.children,n),Pc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&X&&((i=r=Ji)&&(r=rm(r,t.type,t.pendingProps,Xi),r===null?i=!1:(t.stateNode=r,qi=t,Ji=lm(r.firstChild),Xi=!1,i=!0)),i||Qi(t)),ge(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(i,o)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Wo(e,t,qo,null,null,n),sh._currentValue=i),Pc(e,t),wc(e,t,r,n),t.child;case 6:return e===null&&X&&((e=n=Ji)&&(n=im(n,t.pendingProps,Xi),n===null?e=!1:(t.stateNode=n,qi=t,Ji=null,e=!0)),e||Qi(t)),null;case 13:return Hc(e,t,n);case 4:return me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=to(t,null,r,n):wc(e,t,r,n),t.child;case 11:return Tc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Pc(e,t),wc(e,t,r,n),t.child;case 8:return wc(e,t,t.pendingProps.children,n),t.child;case 12:return wc(e,t,t.pendingProps.children,n),t.child;case 10:return Qc(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,ma(t),i=ha(i),r=r(i),t.flags|=1,wc(e,t,r,n),t.child;case 14:return Ec(e,t,t.type,t.pendingProps,n);case 15:return Dc(e,t,t.type,t.pendingProps,n);case 19:return Zc(e,t,n);case 31:return Nc(e,t,n);case 22:return Oc(e,t,n,t.pendingProps);case 24:return ma(t),r=ha(xa),e===null?(i=Ia(),i===null&&(i=qu,o=Sa(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},io(t),ca(t,xa,i)):((e.lanes&n)!==0&&(ao(e,t),po(t,null,null,n),fo()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,ca(t,xa,r),r!==i.cache&&da(t,[xa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ca(t,xa,r))),wc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:X&&Wi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Pc(e,t),wc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function rl(e){e.flags|=4}function il(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Bd())e.flags|=8192;else throw Ka=Ha,Ba}}else e.flags&=-16777217}function al(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Bd())e.flags|=8192;else throw Ka=Ha,Ba}}function ol(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:$e(),e.lanes|=t,sd|=t)}function sl(e,t){if(!X)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function cl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ll(e,t,n){var r=t.pendingProps;switch(Gi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cl(t),null;case 1:return cl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),la(xa),he(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ta(t)?rl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ra())),cl(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(rl(t),o===null?(cl(t),il(t,i,null,r,n)):(cl(t),al(t,o))):o?o===e.memoizedState?(cl(t),t.flags&=-16777217):(rl(t),cl(t),al(t,o)):(e=e.memoizedProps,e!==r&&rl(t),cl(t),il(t,i,e,r,n)),null;case 27:if(_e(t),n=fe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&rl(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return cl(t),t.subtreeFlags&=-33554433,null}e=ue.current,ta(t)?$i(t,e):(e=hm(i,r,n),t.stateNode=e,rl(t))}return cl(t),t.subtreeFlags&=-33554433,null;case 5:if(_e(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&rl(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return cl(t),t.subtreeFlags&=-33554433,null}if(o=ue.current,ta(t))$i(t,o);else{var s=lp(fe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[dt]=t,o[ft]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&rl(t)}}return cl(t),t.subtreeFlags&=-33554433,il(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&rl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=fe.current,ta(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=qi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||Qi(t,!0)}else e=lp(e).createTextNode(r),e[dt]=t,t.stateNode=e}return cl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ta(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[dt]=t}else na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;cl(t),e=!1}else n=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Do(t),t):(Do(t),null);if(t.flags&128)throw Error(a(558))}return cl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ta(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[dt]=t}else na(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;cl(t),i=!1}else i=ra(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Do(t),t):(Do(t),null)}return Do(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ol(t,t.updateQueue),cl(t),null);case 4:return he(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,cl(t),null;case 10:return la(t.type),cl(t),null;case 19:if(Ao(t),r=t.memoizedState,r===null)return cl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)sl(r,!1);else{if(nd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jo(e),o!==null){for(t.flags|=128,sl(r,!1),e=o.updateQueue,t.updateQueue=e,ol(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ti(n,e),n=n.sibling;return ko(t,Oo.current&1|2),X&&Hi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>pd&&(t.flags|=128,i=!0,sl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=jo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ol(t,e),sl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!X)return cl(t),null}else 2*Ae()-r.renderingStartTime>pd&&n!==536870912&&(t.flags|=128,i=!0,sl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,o=Oo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||X?ko(t,o):(n=o,K(xo,t),K(Oo,n),So===null&&(So=t)),X&&Hi(t,r.treeForkCount),e}return cl(t),null;case 22:case 23:return Do(t),bo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(cl(t),t.subtreeFlags&6&&(t.flags|=8192)):cl(t),n=t.updateQueue,n!==null&&ol(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&le(Fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),la(xa),cl(t),null;case 25:return null;case 30:return t.flags|=33554432,cl(t),null}throw Error(a(156,t.tag))}function ul(e,t){switch(Gi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return la(xa),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(Do(t),t.alternate===null)throw Error(a(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Do(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));na()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ao(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return he(),null;case 10:return la(t.type),null;case 22:case 23:return Do(t),bo(),e!==null&&le(Fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return la(xa),null;case 25:return null;default:return null}}function dl(e,t){switch(Gi(t),t.tag){case 3:la(xa),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&Do(t);break;case 13:Do(t);break;case 19:Ao(t);break;case 10:la(t.type);break;case 22:case 23:Do(t),bo(),e!==null&&le(Fa);break;case 24:la(xa)}}function fl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){df(t,t.return,e)}}function pl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){df(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){df(t,t.return,e)}}function ml(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ho(t,n)}catch(t){df(e,e.return,t)}}}function hl(e,t,n){n.props=pc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){df(e,t,n)}}function gl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Y(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);p(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){df(e,t,n)}}function _l(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){df(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){df(e,t,n)}else n.current=null}}function vl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function yl(e){for(var t=e.return;t!==null&&(Sl(t)&&em(e.stateNode,t.stateNode),!xl(t));)t=t.return}function bl(e){for(var t=e.return;t!==null&&(Sl(t)&&tm(e.stateNode,t.stateNode),!xl(t));)t=t.return}function xl(e){return e.tag===5||e.tag===3||e.tag===27}function Sl(e){return e&&e.tag===7&&e.stateNode!==null}function Cl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){df(e,e.return,t)}}function wl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[ft]=t}catch(t){df(e,e.return,t)}}function Tl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function El(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Tl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Dl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=un)),vl(e,r),Ft=!0;else if(i!==4&&(i===27&&(vl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Dl(e,t,n,r),e=e.sibling;e!==null;)Dl(e,t,n,r),e=e.sibling}function Ol(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),vl(e,r),Ft=!0;else if(i!==4&&(i===27&&(vl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ol(e,t,n,r),e=e.sibling;e!==null;)Ol(e,t,n,r),e=e.sibling}function kl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[dt]=e,t[ft]=n}catch(t){df(e,e.return,t)}}var Al=!1,jl=null;function Ml(e){(e.tag===30||e.subtreeFlags&33554432)&&(Al=!0)}var Nl=null;function Pl(){var e=Nl;return Nl=null,e}var Fl=0;function Il(e,t,n,r,i){return Fl=0,Ll(e.child,t,n,r,i)}function Ll(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Al=!0,Tp(o,Fl===0?t:t+`_`+Fl,n),Fl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Ll(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Rl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Rl(e.child,t)),e=e.sibling}function zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(zl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=li(t.default,t.share),t!==`none`&&(Il(e,n,t,null,!1)||Rl(e.child,!1))}e=e.sibling}}function Bl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Y(r,n),a=li(r.default,n.paired?r.share:r.enter);a===`none`?zl(e):Il(e,i,a,null,!1)?(zl(e),n.paired||t||Ad(e,r.onEnter)):Rl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Bl(e,t),e=e.sibling;else zl(e)}function Vl(e){if(jl!==null&&jl.size!==0){var t=jl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=li(n.default,n.share);if(a!==`none`&&(Il(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ad(e,n.onShare)):Rl(e.child,!1)),t.delete(r),t.size===0)break}}}Vl(e)}e=e.sibling}}}function Hl(e){if(e.tag===30){var t=e.memoizedProps,n=Y(t,e.stateNode),r=jl===null?void 0:jl.get(n),i=li(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Il(e,n,i,null,!1)?r===void 0?Ad(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,jl.delete(n),Ad(e,t.onShare)):Rl(e.child,!1)),jl!==null&&Vl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Hl(e),e=e.sibling;else jl!==null&&Vl(e)}function Ul(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Y(t,e.stateNode);t=li(t.default,t.update),e.flags&=-5,t!==`none`&&Il(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Ul(e);e=e.sibling}}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Rl(e.child,!1))}Wl(e)}e=e.sibling}}function Gl(e){if(e.tag===30)e.stateNode.paired=null,Rl(e.child,!1),Wl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e),e=e.sibling;else Wl(e)}function Kl(e){for(e=e.child;e!==null;)e.tag===30?Rl(e.child,!1):e.subtreeFlags&33554432&&Kl(e),e=e.sibling}function ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Fl<a.length){var l=a[Fl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Fl===0?n:n+`_`+Fl,i),s&&e.flags&4||(Nl===null&&(Nl=[]),Nl.push(c,Fl===0?r:r+`_`+Fl,t.memoizedProps)),Fl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Jl(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Y(n,r),a=li(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Fl=0,i=ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ad(e,n.onUpdate))}else e.subtreeFlags&33554432&&Jl(e,t);e=e.sibling}}var Yl=!1,Xl=!1,Zl=!1,Ql=!1,$l=typeof WeakSet==`function`?WeakSet:Set,eu=null,tu=!1,nu=!1,ru=!1,iu=!1;function au(e,t,n){if(e=e.containerInfo,sp=gh,e=Rr(e),zr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,eu=t,t=n?9270:1024;eu!==null;){if(e=eu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Hl(r[a]);if(e.alternate===null&&e.flags&2)n&&Ml(e),ou(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Hl(r),ou(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ml(e),ou(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,eu=r):(n&&Ul(e),ou(n))}}jl=null}function ou(e){for(;eu!==null;){var t=eu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=pc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){df(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Y(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=li(i.default,i.update),i!==`none`&&Il(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,eu=r;break}eu=t.return}}function su(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Du(e,n),r&4&&fl(5,n);break;case 1:if(Du(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){df(n,n.return,e)}else{var i=pc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){df(n,n.return,e)}}}r&64&&ml(n),r&512&&gl(n,n.return);break;case 3:if(Du(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ho(e,t)}catch(e){df(n,n.return,e)}}break;case 27:t===null&&r&4&&kl(n);case 26:case 5:Du(e,n),t===null&&r&4&&Cl(n),r&512&&gl(n,n.return);break;case 12:Du(e,n);break;case 31:Du(e,n),r&4&&gu(e,n);break;case 13:Du(e,n),r&4&&_u(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=hf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||Yl,!r){var a=t!==null&&t.memoizedState!==null||Xl;t=Yl,i=Xl,Yl=r,(Xl=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),ku(e,n,r)):Du(e,n),Yl=t,Xl=i}break;case 30:Du(e,n),r&512&&gl(n,n.return);break;case 7:r&512&&gl(n,n.return);default:Du(e,n)}}function cu(e,t){for(e=e.child;e!==null;)lu(e,t),e=e.sibling}function lu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){df(e,e.return,t)}uu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Ft=!0}catch(t){df(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){df(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&cu(e,t);break;default:cu(e,t)}}function uu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:lu(n,r);break a;case 22:n.memoizedState===null&&uu(n,r);break a;default:uu(n,r)}}e=e.sibling}}function du(e){var t=e.alternate;t!==null&&(e.alternate=null,du(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&bt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var fu=null,pu=!1;function mu(e,t,n){for(n=n.child;n!==null;)hu(e,t,n),n=n.sibling}function hu(e,t,n){if(Be&&typeof Be.onCommitFiberUnmount==`function`)try{Be.onCommitFiberUnmount(ze,n)}catch{}switch(n.tag){case 26:Xl||_l(n,t),mu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Xl&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xl||_l(n,t),bl(n);var r=fu,i=pu;Sp(n.type)&&(fu=n.stateNode,pu=!1),mu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),fu=r,pu=i;break;case 5:Xl||_l(n,t),bl(n);case 6:if(n.tag===6&&bl(n),r=fu,i=pu,fu=null,mu(e,t,n),fu=r,pu=i,fu!==null){if(pu)try{(fu.nodeType===9?fu.body:fu.nodeName===`HTML`?fu.ownerDocument.body:fu).removeChild(n.stateNode),Ft=!0}catch(e){df(n,t,e)}else try{fu.removeChild(n.stateNode),Ft=!0}catch(e){df(n,t,e)}}break;case 18:fu!==null&&(pu?(e=fu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(fu,n.stateNode));break;case 4:r=fu,i=pu,fu=n.stateNode.containerInfo,pu=!0,mu(e,t,n),fu=r,pu=i;break;case 0:case 11:case 14:case 15:pl(2,n,t),Xl||pl(4,n,t),mu(e,t,n);break;case 1:Xl||(_l(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&hl(n,t,r)),mu(e,t,n);break;case 21:mu(e,t,n);break;case 22:Xl=(r=Xl)||n.memoizedState!==null,mu(e,t,n),Xl=r;break;case 30:_l(n,t),mu(e,t,n);break;case 7:Xl||_l(n,t),mu(e,t,n);break;default:mu(e,t,n)}}function gu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){df(t,t.return,e)}}}function _u(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){df(t,t.return,e)}}function vu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $l),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $l),t;default:throw Error(a(435,e.tag))}}function yu(e,t){var n=vu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=gf.bind(null,e,t);t.then(r,r)}})}function bu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){fu=l.stateNode,pu=!1;break a}break;case 5:fu=l.stateNode,pu=!1;break a;case 3:case 4:fu=l.stateNode.containerInfo,pu=!0;break a}l=l.return}if(fu===null)throw Error(a(160));hu(s,c,o),fu=null,pu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Su(t,e,n),t=t.sibling}var xu=null;function Su(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}bu(t,e,n),Cu(e),i&4&&(pl(3,e,e.return),fl(3,e),pl(5,e,e.return));break;case 1:bu(t,e,n),Cu(e),i&512&&(Xl||r===null||_l(r,r.return)),i&64&&Yl&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=xu,bu(t,e,n),Cu(e),i&512&&(Xl||r===null||_l(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(Yl)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[vt]||r[dt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[dt]=e,Tt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[dt]=e,Tt(r),t=r}e.stateNode=t}}else Yl||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&wl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||Xl||t.parentNode.removeChild(t)):i.count--,n===null?Yl||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:bu(t,e,n),Cu(e),i&512&&(Xl||r===null||_l(r,r.return)),r!==null&&i&4&&wl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=Zl,Zl=!1,bu(t,e,n),Zl=o,Cu(e),i&512&&(Xl||r===null||_l(r,r.return)),e.flags&32){t=e.stateNode;try{tn(t,``),Ft=!0}catch(t){df(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,wl(e,t,r===null?t:r.memoizedProps)),i&1024&&(Ql=!0);break;case 6:if(bu(t,e,n),Cu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ft=!0}catch(t){df(e,e.return,t)}}break;case 3:if(Ft=!1,Wm=null,o=xu,xu=bm(t.containerInfo),bu(t,e,n),xu=o,Cu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){df(e,e.return,t)}Ql&&(Ql=!1,wu(e)),Ft=!1;break;case 4:i=Zl,Zl=Yl,r=It(),o=xu,xu=bm(e.stateNode.containerInfo),bu(t,e,n),Cu(e),xu=o,Ft&&nu&&(ru=!0),Ft=r,Zl=i;break;case 12:bu(t,e,n),Cu(e);break;case 31:bu(t,e,n),Cu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 13:bu(t,e,n),Cu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(dd=Ae()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=Yl,l=Xl,u=Zl;Yl=c||o,Zl=u||o,Xl=l||s,bu(t,e,n),Xl=l,Zl=u,Yl=c,Cu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||Yl||Xl||(t=s||Xl,n=Yl,r=Xl,Yl=o||Yl,Xl=t,Ou(e,2),Yl=n,Xl=r),!o&&Zl||cu(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,yu(e,n))));break;case 19:bu(t,e,n),Cu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,yu(e,t)));break;case 30:i&512&&(Xl||r===null||_l(r,r.return)),i=It(),o=nu,s=(n&335544064)===n,c=e.memoizedProps,nu=s&&li(c.default,c.update)!==`none`,bu(t,e,n),Cu(e),s&&r!==null&&Ft&&(e.flags|=4),nu=o,Ft=i;break;case 21:break;case 7:i&512&&(Xl||r===null||_l(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:bu(t,e,n),Cu(e)}}function Cu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Tl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Sl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(xl(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;Ol(e,El(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(tn(l,``),n.flags&=-33),Ol(e,El(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Dl(e,El(e),u,s);break;default:throw Error(a(161))}}catch(t){df(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Tu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Eu(t,e),t=t.sibling;else Jl(t,!1)}function Eu(e,t){var n=e.alternate;if(n===null)Bl(e,!1);else switch(e.tag){case 3:if(iu=tu=!1,Pl(),Tu(t,e),!tu&&!ru){if(e=Nl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),iu=!0}Nl=null;break;case 5:Tu(t,e);break;case 4:r=tu,tu=!1,Tu(t,e),tu&&(ru=!0),tu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Tu(t,e):Bl(e,!1));break;case 30:r=tu,i=Pl(),tu=!1,Tu(t,e),tu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Y(a,o),o=Y(n.memoizedProps,o);var s=li(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Fl=0,t=ql(e,n,t,o,s,a,!0),Fl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ad(e,e.memoizedProps.onUpdate),Nl=i):i!==null&&(i.push.apply(i,Nl),Nl=i),tu=e.flags&32?!0:r;break;default:Tu(t,e)}}function Du(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)su(e,t.alternate,t),t=t.sibling}function Ou(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:pl(4,n,n.return),Ou(n,r);break;case 1:_l(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&hl(n,n.return,i),Ou(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:_l(n,n.return),n.tag!==5&&n.tag!==27||bl(n),Ou(n,r);break;case 6:bl(n);break;case 26:_l(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Xl||i.parentNode.removeChild(i),Ou(n,r);break;case 22:n.memoizedState===null&&Ou(n,r);break;case 30:_l(n,n.return),Ou(n,r);break;case 7:_l(n,n.return);default:Ou(n,r)}e=e.sibling}}function ku(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:ku(i,a,n),fl(4,a);break;case 1:if(ku(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){df(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)mo(l[i],c)}catch(e){df(r,r.return,e)}}s&&o&64&&ml(a),gl(a,a.return);break;case 27:n&2&&kl(a);case 5:a.tag!==5&&a.tag!==27||yl(a),ku(i,a,n),s&&r===null&&o&4&&Cl(a),gl(a,a.return);break;case 6:yl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||Yl||Km(bm(c.ownerDocument),a.type,c),ku(i,a,n),s&&r===null&&o&4&&Cl(a),gl(a,a.return);break;case 12:ku(i,a,n);break;case 31:ku(i,a,n),s&&o&4&&gu(i,a);break;case 13:ku(i,a,n),s&&o&4&&_u(i,a);break;case 22:a.memoizedState===null&&ku(i,a,n),gl(a,a.return);break;case 30:ku(i,a,n),gl(a,a.return);break;case 7:gl(a,a.return);default:ku(i,a,n)}t=t.sibling}}function Au(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ca(n))}function ju(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ca(e))}function Mu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Nu(e,t,n,r),t=t.sibling;else i&&Kl(t)}function Nu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Gl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Mu(e,t,n,r),a&2048&&fl(9,t);break;case 1:Mu(e,t,n,r);break;case 3:Mu(e,t,n,r),i&&iu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ca(a)));break;case 12:if(a&2048){Mu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){df(t,t.return,e)}}else Mu(e,t,n,r);break;case 31:Mu(e,t,n,r);break;case 13:Mu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Gl(t),o._visibility&2?Mu(e,t,n,r):(o._visibility|=2,Pu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Gl(s),o._visibility&2?Mu(e,t,n,r):Fu(e,t)),a&2048&&Au(s,t);break;case 24:Mu(e,t,n,r),a&2048&&ju(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Rl(a.child,!0),Rl(t.child,!0))),Mu(e,t,n,r);break;default:Mu(e,t,n,r)}}function Pu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Pu(a,o,s,c,i),fl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Pu(a,o,s,c,i)):u._visibility&2?Pu(a,o,s,c,i):Fu(a,o),i&&l&2048&&Au(o.alternate,o);break;case 24:Pu(a,o,s,c,i),i&&l&2048&&ju(o.alternate,o);break;default:Pu(a,o,s,c,i)}t=t.sibling}}function Fu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Fu(n,r),i&2048&&Au(r.alternate,r);break;case 24:Fu(n,r),i&2048&&ju(r.alternate,r);break;default:Fu(n,r)}t=t.sibling}}var Iu=8192;function Lu(e,t,n){if(e.subtreeFlags&Iu)for(e=e.child;e!==null;)Ru(e,t,n),e=e.sibling}function Ru(e,t,n){switch(e.tag){case 26:Lu(e,t,n),e.flags&Iu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,xu,e.memoizedState,e.memoizedProps));break;case 5:Lu(e,t,n),e.flags&Iu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=xu;xu=bm(e.stateNode.containerInfo),Lu(e,t,n),xu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Iu,Iu=16777216,Lu(e,t,n),Iu=r):Lu(e,t,n));break;case 30:if((e.flags&Iu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,jl===null&&(jl=new Map),jl.set(r,i)}Lu(e,t,n);break;default:Lu(e,t,n)}}function zu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Bu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];eu=r,Uu(r,e)}zu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vu(e),e=e.sibling}function Vu(e){switch(e.tag){case 0:case 11:case 15:Bu(e),e.flags&2048&&pl(9,e,e.return);break;case 3:Bu(e);break;case 12:Bu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hu(e)):Bu(e);break;default:Bu(e)}}function Hu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];eu=r,Uu(r,e)}zu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pl(8,t,t.return),Hu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hu(t));break;default:Hu(t)}e=e.sibling}}function Uu(e,t){for(;eu!==null;){var n=eu;switch(n.tag){case 0:case 11:case 15:pl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,eu=r;else a:for(n=e;eu!==null;){r=eu;var i=r.sibling,a=r.return;if(du(r),r===n){eu=null;break a}if(i!==null){i.return=a,eu=i;break a}eu=a}}}var Wu={getCacheForType:function(e){var t=ha(xa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ha(xa).controller.signal}},Gu=typeof WeakMap==`function`?WeakMap:Map,Ku=0,qu=null,Ju=null,Yu=0,Xu=0,Zu=null,Qu=!1,$u=!1,ed=!1,td=0,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=null,ld=null,ud=!1,dd=0,fd=0,pd=1/0,md=null,hd=null,gd=0,_d=null,vd=null,yd=0,bd=0,xd=null,Sd=null,Cd=null,wd=null,Td=null,Ed=0,Dd=null;function Od(){return Ku&2&&Yu!==0?Yu&-Yu:W.T===null?ct():Mf()}function kd(){if(od===0){if(!(Yu&536870912)||X){var e=Ke;Ke<<=1,!(Ke&3932160)&&(Ke=262144),od=e}else od=536870912}return e=xo.current,e!==null&&(e.flags|=32),od}function Ad(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(Y(e.memoizedProps,n))),wd===null&&(wd=[]),wd.push(t.bind(null,r))}}function jd(e,t,n){(e===qu&&(Xu===2||Xu===9)||e.cancelPendingCommit!==null)&&(Rd(e,0),Fd(e,Yu,od,!1)),tt(e,n),(!(Ku&2)||e!==qu)&&(e===qu&&(!(Ku&2)&&(id|=n),nd===4&&Fd(e,Yu,od,!1)),wf(e))}function Md(e,t,n){if(Ku&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Xe(e,t),i=r?Kd(e,t):Wd(e,t,!0),o=r;do{if(i===0){$u&&!r&&Fd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Pd(n))i=Wd(e,t,!1),o=!1;else{if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=cd;var l=c.current.memoizedState.isDehydrated;if(l&&(Rd(c,s).flags|=256),s=Wd(c,s,!1),s!==2&&s!==6){if(ed&&!l){c.errorRecoveryDisabledLanes|=o,id|=o,i=4;break a}o=ld,ld=i,o!==null&&(ld===null?ld=o:ld.push.apply(ld,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Rd(e,0),Fd(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Fd(r,t,od,!Qu);break a;case 2:ld=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=dd+300-Ae(),10<i)){if(Fd(r,t,od,!Qu),Ye(r,0,!0)!==0)break a;yd=t,r.timeoutHandle=gp(Nd.bind(null,r,n,ld,md,ud,t,od,id,sd,Qu,o,`Throttled`,-0,0),i);break a}Nd(r,n,ld,md,ud,t,od,id,sd,Qu,o,null,-0,0)}break}}while(1);wf(e)}function Nd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:un},jl=null,Ru(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?dd-Ae():(a&4194048)===a?fd-Ae():0,m=eh(d,m),m!==null)?(yd=a,e.cancelPendingCommit=m($d.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Fd(e,a,o,!l)):$d(e,t,a,n,r,i,o,s,c,l,u,d)}function Pd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Nr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fd(e,t,n,r){t=Ze(e,t),t&=~ad,t&=~id,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-He(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&rt(e,n,t)}function Id(){return Ku&6?!0:(Tf(0,!1),!1)}function Ld(){if(Ju!==null){if(Xu===0)var e=Ju.return;else e=Ju,sa=oa=null,Xo(e),Ya=null,Xa=0,e=Ju;for(;e!==null;)dl(e.alternate,e),e=e.return;Ju=null}}function Rd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),yd=0,Ld(),qu=e,Ju=n=wi(e.current,null),Yu=t,Xu=0,Zu=null,Qu=!1,$u=Xe(e,t),ed=!1,sd=od=ad=id=rd=nd=0,ld=cd=null,ud=!1,td=Ze(e,t),mi(),n}function zd(e,t){Z=null,W.H=ac,t===za||t===Va?(t=qa(),Xu=3):t===Ba?(t=qa(),Xu=4):Xu=t===Cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Zu=t,Ju===null&&(nd=1,_c(e,Mi(t,e.current)))}function Bd(){var e=xo.current;return e===null?!0:(Yu&4194048)===Yu?So===null:(Yu&62914560)===Yu||Yu&536870912?e===So:!1}function Vd(){var e=W.H;return W.H=ac,e===null?ac:e}function Hd(){var e=W.A;return W.A=Wu,e}function Ud(){nd=4,Qu||(Yu&4194048)!==Yu&&xo.current!==null||($u=!0),!(rd&134217727)&&!(id&134217727)||qu===null||Fd(qu,Yu,od,!1)}function Wd(e,t,n){var r=Ku;Ku|=2;var i=Vd(),a=Hd();(qu!==e||Yu!==t)&&(md=null,Rd(e,t)),t=!1;var o=nd;a:do try{if(Xu!==0&&Ju!==null){var s=Ju,c=Zu;switch(Xu){case 8:Ld(),o=6;break a;case 3:case 2:case 9:case 6:xo.current===null&&(t=!0);var l=Xu;if(Xu=0,Zu=null,Xd(e,s,c,l),n&&$u){o=0;break a}break;default:l=Xu,Xu=0,Zu=null,Xd(e,s,c,l)}}Gd(),o=nd;break}catch(t){zd(e,t)}while(1);return t&&e.shellSuspendCounter++,sa=oa=null,Ku=r,W.H=i,W.A=a,Ju===null&&(qu=null,Yu=0,mi()),o}function Gd(){for(;Ju!==null;)Jd(Ju)}function Kd(e,t){var n=Ku;Ku|=2;var r=Vd(),i=Hd();qu!==e||Yu!==t?(md=null,pd=Ae()+500,Rd(e,t)):$u=Xe(e,t);a:do try{if(Xu!==0&&Ju!==null){t=Ju;var o=Zu;b:switch(Xu){case 1:Xu=0,Zu=null,Xd(e,t,o,1);break;case 2:case 9:if(Ua(o)){Xu=0,Zu=null,Yd(t);break}t=function(){Xu!==2&&Xu!==9||qu!==e||(Xu=7),wf(e)},o.then(t,t);break a;case 3:Xu=7;break a;case 4:Xu=5;break a;case 7:Ua(o)?(Xu=0,Zu=null,Yd(t)):(Xu=0,Zu=null,Xd(e,t,o,7));break;case 5:var s=null;switch(Ju.tag){case 26:s=Ju.memoizedState;case 5:case 27:var c=Ju;if(s?Ym(s):c.stateNode.complete){Xu=0,Zu=null;var l=c.sibling;if(l!==null)Ju=l;else{var u=c.return;u===null?Ju=null:(Ju=u,Zd(u))}break b}}Xu=0,Zu=null,Xd(e,t,o,5);break;case 6:Xu=0,Zu=null,Xd(e,t,o,6);break;case 8:Ld(),nd=6;break a;default:throw Error(a(462))}}qd();break}catch(t){zd(e,t)}while(1);return sa=oa=null,W.H=r,W.A=i,Ku=n,Ju===null?(qu=null,Yu=0,mi(),nd):0}function qd(){for(;Ju!==null&&!Oe();)Jd(Ju)}function Jd(e){var t=nl(e.alternate,e,td);e.memoizedProps=e.pendingProps,t===null?Zd(e):Ju=t}function Yd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ic(n,t,t.pendingProps,t.type,void 0,Yu);break;case 11:t=Ic(n,t,t.pendingProps,t.type.render,t.ref,Yu);break;case 5:Xo(t);var r=t;r===qi&&(X?(ea(r),r.tag===5&&r.stateNode!=null&&(Ji=r.stateNode)):(ea(r),X=!0));default:dl(n,t),t=Ju=Ti(t,td),t=nl(n,t,td)}e.memoizedProps=e.pendingProps,t===null?Zd(e):Ju=t}function Xd(e,t,n,r){sa=oa=null,Xo(t),Ya=null,Xa=0;var i=t.return;try{if(Sc(e,i,t,n,Yu)){nd=1,_c(e,Mi(n,e.current)),Ju=null;return}}catch(t){if(i!==null)throw Ju=i,t;nd=1,_c(e,Mi(n,e.current)),Ju=null;return}t.flags&32768?(X||r===1?e=!0:$u||Yu&536870912?e=!1:(Qu=e=!0,(r===2||r===9||r===3||r===6)&&(r=xo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Qd(t,e)):Zd(t)}function Zd(e){var t=e;do{if(t.flags&32768){Qd(t,Qu);return}e=t.return;var n=ll(t.alternate,t,td);if(n!==null){Ju=n;return}if(t=t.sibling,t!==null){Ju=t;return}Ju=t=e}while(t!==null);nd===0&&(nd=5)}function Qd(e,t){do{var n=ul(e.alternate,e);if(n!==null){n.flags&=32767,Ju=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ju=e;return}Ju=e=n}while(e!==null);nd=6,Ju=null}function $d(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do cf();while(gd!==0);if(Ku&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===qu&&(Ju=qu=null,Yu=0),vd=t,_d=e,yd=n,xd=i,Sd=r,ef(e,t,n,s,c,l,f)}}function ef(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(bd=s,s|=pi,nt(e,n,s,r,i,a),wd=null,(n&335544064)===n?(Td=Ea(e),r=10262):(Td=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,_f(Pe,function(){return lf(),null})):(e.callbackNode=null,e.callbackPriority=0),Al=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=W.T,W.T=null,i=G.p,G.p=2,a=Ku,Ku|=4;try{au(e,t,n)}finally{Ku=a,G.p=i,W.T=r}}gd=1,Al?Cd=Mp(o,e.containerInfo,Td,rf,af,nf,of,lf,tf,null,null):(rf(),af(),of())}function tf(e){if(gd!==0){var t=_d.onRecoverableError;t(e,{componentStack:null})}}function nf(){gd===3&&(gd=0,Eu(vd,_d),gd=4)}function rf(){if(gd===1){gd=0;var e=_d,t=vd,n=yd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=W.T,W.T=null;var i=G.p;G.p=2;var a=Ku;Ku|=4;try{nu=ru=!1,Su(t,e,n),n=cp;var o=Rr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&J(s.ownerDocument.documentElement,s)){if(c!==null&&zr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Lr(s,h),v=Lr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Ku=a,G.p=i,W.T=r}}e.current=t,gd=2}}function af(){if(gd===2){gd=0;var e=_d,t=vd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=W.T,W.T=null;var r=G.p;G.p=2;var i=Ku;Ku|=4;try{su(e,t.alternate,t)}finally{Ku=i,G.p=r,W.T=n}}gd=3}}function of(){if(gd===4||gd===3){gd=0;var e=Cd;Cd=null,ke();var t=_d,n=vd,r=yd,i=Sd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?gd=5:(gd=0,vd=_d=null,sf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(hd=null),st(r),n=n.stateNode,Be&&typeof Be.onCommitFiberRoot==`function`)try{Be.onCommitFiberRoot(ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=W.T,a=G.p,G.p=2,W.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{W.T=n,G.p=a}}if(i=wd,o=Td,Td=null,i!==null&&(wd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);yd&3&&cf(),wf(t),a=t.pendingLanes,r&261930&&a&42?t===Dd?Ed++:(Ed=0,Dd=t):(Ed=0,Dd=null),Tf(0,!1)}}function sf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ca(t)))}function cf(){return Cd!==null&&(Cd.skipTransition(),Cd=null),rf(),af(),of(),lf()}function lf(){if(gd!==5)return!1;var e=_d,t=bd;bd=0;var n=st(yd),r=W.T,i=G.p;try{G.p=32>n?32:n,W.T=null,n=xd,xd=null;var o=_d,s=yd;if(gd=0,vd=_d=null,yd=0,Ku&6)throw Error(a(331));var c=Ku;if(Ku|=4,Vu(o.current),Nu(o,o.current,s,n),Ku=c,Tf(0,!1),Be&&typeof Be.onPostCommitFiberRoot==`function`)try{Be.onPostCommitFiberRoot(ze,o)}catch{}return!0}finally{G.p=i,W.T=r,sf(e,t)}}function uf(e,t,n){t=Mi(n,t),t=yc(e.stateNode,t,2),e=so(e,t,2),e!==null&&(tt(e,2),wf(e))}function df(e,t,n){if(e.tag===3)uf(e,e,n);else for(;t!==null;){if(t.tag===3){uf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(hd===null||!hd.has(r))){e=Mi(n,e),n=bc(2),r=so(t,n,2),r!==null&&(xc(n,r,t,e),tt(r,2),wf(r));break}}t=t.return}}function ff(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Gu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ed=!0,i.add(n),e=pf.bind(null,e,t,n),t.then(e,e))}function pf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,qu===e&&(Yu&n)===n&&(nd===4||nd===3&&(Yu&62914560)===Yu&&300>Ae()-dd?Ku&2?ad|=n:Rd(e,0):ad|=n,sd===Yu&&(sd=0)),wf(e)}function mf(e,t){t===0&&(t=$e()),e=_i(e,t),e!==null&&(tt(e,t),wf(e))}function hf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mf(e,n)}function gf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),mf(e,n)}function _f(e,t){return Ee(e,t)}var vf=null,yf=null,bf=!1,xf=!1,Sf=!1,Cf=0;function wf(e){e!==yf&&e.next===null&&(yf===null?vf=yf=e:yf=yf.next=e),xf=!0,bf||(bf=!0,jf())}function Tf(e,t){if(!Sf&&xf){Sf=!0;do for(var n=!1,r=vf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-He(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Af(r,a))}else a=Yu,a=Ye(r,r===qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Xe(r,a)||(n=!0,Af(r,a))}r=r.next}while(n);Sf=!1}}function Ef(){Df()}function Df(){xf=bf=!1;var e=0;Cf!==0&&hp()&&(e=Cf);for(var t=Ae(),n=null,r=vf;r!==null;){var i=r.next,a=Of(r,t);a===0?(r.next=null,n===null?vf=i:n.next=i,i===null&&(yf=n)):(n=r,(e!==0||a&3)&&(xf=!0)),r=i}gd!==0&&gd!==5||Tf(e,!1),Cf!==0&&(Cf=0)}function Of(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-He(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=qu,n=Yu,n=Ye(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Xu===2||Xu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&De(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Xe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&De(r),st(n)){case 2:case 8:n=Ne;break;case 32:n=Pe;break;case 268435456:n=Ie;break;default:n=Pe}return r=kf.bind(null,e),n=Ee(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&De(r),e.callbackPriority=2,e.callbackNode=null,2}function kf(e,t){if(gd!==0&&gd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(cf()&&e.callbackNode!==n)return null;var r=Yu;return r=Ye(e,e===qu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Md(e,r,t),Of(e,Ae()),e.callbackNode!=null&&e.callbackNode===n?kf.bind(null,e):null)}function Af(e,t){if(cf())return null;Md(e,t,!0)}function jf(){bp(function(){Ku&6?Ee(Me,Ef):Df()})}function Mf(){if(Cf===0){var e=ka;e===0&&(e=Ge,Ge<<=1,!(Ge&261888)&&(Ge=256)),Cf=e}return Cf}function Nf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:ln(e)}function Pf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Nf((i[ft]||null).action),o=r.submitter;o&&(t=(t=o[ft]||null)?Nf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new jn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cf!==0){var e=new FormData(i,o);Ks(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Ks(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ff=0;Ff<ai.length;Ff++){var If=ai[Ff];oi(If.toLowerCase(),`on`+(If[0].toUpperCase()+If.slice(1)))}oi(Zr,`onAnimationEnd`),oi(Qr,`onAnimationIteration`),oi($r,`onAnimationStart`),oi(`dblclick`,`onDoubleClick`),oi(`focusin`,`onFocus`),oi(`focusout`,`onBlur`),oi(ei,`onTransitionRun`),oi(ti,`onTransitionStart`),oi(ni,`onTransitionCancel`),oi(ri,`onTransitionEnd`),At(`onMouseEnter`,[`mouseout`,`mouseover`]),At(`onMouseLeave`,[`mouseout`,`mouseover`]),At(`onPointerEnter`,[`pointerout`,`pointerover`]),At(`onPointerLeave`,[`pointerout`,`pointerover`]),kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Lf=`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(` `),Rf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Lf));function zf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ui(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ui(e)}i.currentTarget=null,a=c}}}}function Bf(e,t){var n=t[mt];n===void 0&&(n=t[mt]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(Rf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!bn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=xt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}_n(function(){var r=a,i=fn(n),o=[];a:{var c=ii.get(e);if(c!==void 0){var l=jn,u=e;switch(e){case`keypress`:if(En(n)===0)break a;case`keydown`:case`keyup`:l=Yn;break;case`focusin`:u=`focus`,l=Bn;break;case`focusout`:u=`blur`,l=Bn;break;case`beforeblur`:case`afterblur`:l=Bn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Rn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=zn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Qn;break;case Zr:case Qr:case $r:l=Vn;break;case ri:l=$n;break;case`scroll`:case`scrollend`:l=Nn;break;case`wheel`:l=er;break;case`copy`:case`cut`:case`paste`:l=Hn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Xn;break;case`submit`:l=Zn;break;case`toggle`:case`beforetoggle`:l=tr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=vn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==dn&&(u=n.relatedTarget||n.fromElement)&&(xt(u)||u[pt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?xt(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Rn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Xn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ct(c),h=l==null?u:Ct(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,xt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,Jf):null,c!==null&&Yf(o,u,c,d,!1),l!==null&&f!==null&&Yf(o,f,l,d,!0)))}a:{if(c=r?Ct(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=xr;else if(hr(c)){if(Sr)_=jr;else{_=kr;var v=Or}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&on(r.elementType)&&(_=xr):_=Ar;if(_&&=_(e,r)){gr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ct(r):window,e){case`focusin`:(hr(v)||v.contentEditable===`true`)&&(Vr=v,Hr=r,Ur=null);break;case`focusout`:Ur=Hr=Vr=null;break;case`mousedown`:Wr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Wr=!1,Gr(o,n,i);break;case`selectionchange`:if(Br)break;case`keydown`:case`keyup`:Gr(o,n,i)}var y;if(rr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else dr?lr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(or&&n.locale!==`ko`&&(dr||b!==`onCompositionStart`?b===`onCompositionEnd`&&dr&&(y=Tn()):(Sn=i,Cn=`value`in Sn?Sn.value:Sn.textContent,dr=!0)),v=qf(r,b),0<v.length&&(b=new Un(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=ur(n),y!==null&&(b.data=y)))),(y=ar?fr(e,n):pr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Un(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Pf(o,e,r,n,i)}zf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=vn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=vn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=vn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=vn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
|
|
10
|
-
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||tn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&tn(e,``+r);else return;break;case`className`:Rt(e,`class`,r);break;case`tabIndex`:Rt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Rt(e,n,r);break;case`style`:an(e,r,o);return;case`data`:if(t!==`object`){Rt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=ln(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=ln(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=un);return;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=ln(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Lt(e,`popover`,r);break;case`xlinkActuate`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Lt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=sn.get(n)||n,Lt(e,n,r);else return}Ft=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:an(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)tn(e,r);else if(typeof r==`number`||typeof r==`bigint`)tn(e,``+r);else return;break;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=un);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[ft]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}Ft=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Lt(e,n,r)}return}Ft=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bf(`error`,e),Bf(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,o,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:Bf(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:ep(e,t,r,d,n,null)}}Xt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Bf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Qt(e,!!r,n,!0):Qt(e,!!r,t,!1);return;case`textarea`:for(s in Bf(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:ep(e,t,s,c,n,null)}en(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Bf(`cancel`,e),Bf(`close`,e);break;case`iframe`:case`object`:Bf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Lf.length;r++)Bf(Lf[r],e);break;case`image`:Bf(`error`,e),Bf(`load`,e);break;case`details`:Bf(`toggle`,e);break;case`embed`:case`source`:case`link`:Bf(`error`,e),Bf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,u,r,n,null)}return;default:if(on(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Ft=!0),o=m;break;case`name`:m!==f&&(Ft=!0),i=m;break;case`checked`:m!==f&&(Ft=!0),u=m;break;case`defaultChecked`:m!==f&&(Ft=!0),d=m;break;case`value`:m!==f&&(Ft=!0),s=m;break;case`defaultValue`:m!==f&&(Ft=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}Yt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(Ft=!0),p=o;break;case`defaultValue`:o!==l&&(Ft=!0),c=o;break;case`multiple`:o!==l&&(Ft=!0),s=o;default:o!==l&&ep(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Qt(e,!!n,n?[]:``,!1):Qt(e,!!n,t,!0)):Qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(Ft=!0),p=i;break;case`defaultValue`:i!==o&&(Ft=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&ep(e,t,s,i,r,o)}$t(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Ft=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(on(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[dt]=r,n[ft]=t,np(n,e,t),Tt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[vt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=v(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=lp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=xt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Zp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=v(i),Zp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=v(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[vt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===un&&(e.onclick=null),bt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=G.d;G.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Id();return e||t}function Cm(e){var t=St(e);t!==null&&t.tag===5&&t.type===`form`?Js(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=Jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Jt(n.imageSizes)+`"]`)):i+=`[href="`+Jt(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[yt]=!0,o.onload=o.onerror=function(){Et(o)}),Tt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Jt(r)+`"][href="`+Jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=wt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Tt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=wt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Tt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=wt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Tt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=fe.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=wt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=wt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=wt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+Jt(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[yt]){r.loading=1;return}}else t=e.createElement(`link`),t[yt]=!0,t.onload=t.onerror=Et.bind(null,t),np(t,`link`,n),Tt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+Jt(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Jt(n.href)+`"]`);if(r)return t.instance=r,Tt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Tt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Tt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Tt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Tt(i),i):(r=n,(i=vm.get(o))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Tt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[vt]||a[dt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Tt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Tt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:N,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=et(0),this.hiddenUpdates=et(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Si(3,null,null,t),e.current=a,a.stateNode=e,t=Sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},io(a),e}function uh(e){return e?(e=bi,e):bi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=oo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=so(e,r,t),n!==null&&(jd(n,e,t),co(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=_i(e,67108864);t!==null&&jd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Od();t=ot(t);var n=_i(e,t);n!==null&&jd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=2,yh(e,t,n,r)}finally{G.p=a,W.T=i}}function vh(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=8,yh(e,t,n,r)}finally{G.p=a,W.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=St(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Je(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}wf(a),!(Ku&6)&&(pd=Ae()+500,Tf(0,!1))}}break;case 31:case 13:s=_i(a,2),s!==null&&jd(s,a,2),Id(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=fn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=xt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=St(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=xt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,lt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,lt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);dn=r,n.target.dispatchEvent(r),dn=null}else return t=St(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,t){e.blockedOn===t&&(e.blockedOn=null,wh||(wh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=St(n);a!==null&&(e.splice(t,3),t-=3,Ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ft]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ft]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;dh(n,Od(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Id(),t[pt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.0`)throw Error(a(527,Kh,`19.3.0`));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:W,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{ze=Jh.inject(qh),Be=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=mc,s=hc,c=gc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,s,c,Uh),e[pt]=t.current,Uf(e),new Wh(t)}})),Yt=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Jt()})),Xt={name:`alarm-clock-off`,size:24,node:[[`path`,{d:`M6.87 6.87a8 8 0 1 0 11.26 11.26`,key:`3on8tj`}],[`path`,{d:`M19.9 14.25a8 8 0 0 0-9.15-9.15`,key:`15ghsc`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.26 18.67 4 21`,key:`yzmioq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M4 4 2 6`,key:`1ycko6`}]]};Xt.node;var Zt=n(Xt),Qt={name:`alarm-clock`,size:24,node:[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]};Qt.node;var $t=n(Qt),en={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};en.node;var tn=n(en),nn={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};nn.node;var rn=n(nn),an={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};an.node;var on=n(an),sn={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};sn.node;var cn=n(sn),ln={name:`calendar-range`,size:24,node:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M17 13h-6`,key:`1qbiup`}],[`path`,{d:`M13 17H7`,key:`1x38vv`}],[`path`,{d:`M7 13h.01`,key:`1vezk1`}],[`path`,{d:`M17 17h.01`,key:`1sd3ek`}]]};ln.node;var un=n(ln),dn={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};dn.node;var fn=n(dn),pn={name:`chart-gantt`,size:24,node:[[`path`,{d:`M10 6h8`,key:`zvc2xc`}],[`path`,{d:`M12 16h6`,key:`yi5mkt`}],[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M8 11h7`,key:`wz2hg0`}]]};pn.node;var mn=n(pn),hn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};hn.node;var gn=n(hn),_n={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};_n.node;var vn=n(_n),yn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};yn.node;var bn=n(yn),xn={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};xn.node;var Sn=n(xn),Cn={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Cn.node;var wn=n(Cn),Tn={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};Tn.node;var En=n(Tn),Dn={name:`database-backup`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 12a9 3 0 0 0 5 2.69`,key:`1ui2ym`}],[`path`,{d:`M21 9.3V5`,key:`6k6cib`}],[`path`,{d:`M3 5v14a9 3 0 0 0 6.47 2.88`,key:`i62tjy`}],[`path`,{d:`M12 12v4h4`,key:`1bxaet`}],[`path`,{d:`M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16`,key:`1f4ei9`}]]};Dn.node;var On=n(Dn),kn={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};kn.node;var An=n(kn),jn={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};jn.node;var Mn=n(jn),Nn={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Nn.node;var Pn=n(Nn),Fn={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};Fn.node;var In=n(Fn),Ln={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Ln.node;var Rn=n(Ln),zn={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};zn.node;var Bn=n(zn),Vn={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};Vn.node;var Hn=n(Vn),Un={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Un.node;var Wn=n(Un),Gn={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Gn.node;var Kn=n(Gn),qn={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};qn.node;var Jn=n(qn),Yn={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};Yn.node;var Xn=n(Yn),Zn={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Zn.node;var Qn=n(Zn),$n={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};$n.node;var er=n($n),tr={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};tr.node;var nr=n(tr),rr={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};rr.node;var ir=n(rr),ar={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};ar.node;var or=n(ar),sr={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};sr.node;var cr=n(sr),lr={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};lr.node;var ur=n(lr),dr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};dr.node;var fr=n(dr),pr={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};pr.node;var mr=n(pr),hr={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};hr.node;var gr=n(hr),_r={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};_r.node;var vr=n(_r),yr={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};yr.node;var br=n(yr),xr={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};xr.node;var Sr=n(xr),Cr={name:`share`,size:24,node:[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]};Cr.node;var wr=n(Cr),Tr={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Tr.node;var Er=n(Tr),Dr={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};Dr.node;var Or=n(Dr),kr={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};kr.node;var Ar=n(kr),jr={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};jr.node;var Mr=n(jr),Nr={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Nr.node;var Pr=n(Nr),Fr={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Fr.node;var Ir=n(Fr);function Lr(e){return e?.ownerDocument||document}var J=i(t(),1),Rr=i(Yt(),1),zr={planned:`Blocked`,ready:`Ready`,paused:`Paused`,in_progress:`In progress`,in_review:`Awaiting completion`,done:`Done`,not_adopted:`Not adopted`},Br=`Planned on`,Vr={neutral:`bg-muted text-foreground/70`,info:`bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200`,progress:`bg-blue-100 text-blue-800 dark:bg-blue-950 dark:text-blue-200`,review:`bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200`,success:`bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200`,attention:`bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-200`,danger:`bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200`},Hr={neutral:`text-muted-foreground`,info:`text-sky-700 dark:text-sky-300`,progress:`text-blue-700 dark:text-blue-300`,review:`text-violet-700 dark:text-violet-300`,success:`text-emerald-700 dark:text-emerald-300`,attention:`text-amber-700 dark:text-amber-300`,danger:`text-rose-700 dark:text-rose-300`},Ur={neutral:`border-border text-muted-foreground`,info:`border-sky-300 text-sky-700 dark:border-sky-800 dark:text-sky-300`,progress:`border-blue-300 text-blue-700 dark:border-blue-800 dark:text-blue-300`,review:`border-violet-300 text-violet-700 dark:border-violet-800 dark:text-violet-300`,success:`border-emerald-300 text-emerald-700 dark:border-emerald-800 dark:text-emerald-300`,attention:`border-amber-300 text-amber-700 dark:border-amber-800 dark:text-amber-300`,danger:`border-rose-300 text-rose-700 dark:border-rose-800 dark:text-rose-300`},Wr=`border-input text-foreground/70`,Gr={info:`border border-sky-300 bg-sky-50 text-sky-900 dark:border-sky-800 dark:bg-sky-950 dark:text-sky-100`,attention:`border border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100`,danger:`border border-rose-300 bg-rose-50 text-rose-900 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-100`},Kr={neutral:`bg-neutral-400`,info:`bg-sky-500`,progress:`bg-blue-500`,review:`bg-violet-500`,success:`bg-emerald-500`,attention:`bg-amber-500`,danger:`bg-rose-500`},qr={neutral:`border-muted-foreground`,info:`border-sky-500`,progress:`border-blue-500`,review:`border-violet-500`,success:`border-emerald-500`,attention:`border-amber-500`,danger:`border-rose-500 dark:border-rose-400`},Jr={done:`border-emerald-500 bg-emerald-100 dark:bg-emerald-950`,ready:`border-amber-500 shadow-none`,blocked:`border-dashed border-muted-foreground shadow-none`,paused:`border-dashed border-muted-foreground bg-muted shadow-none`,behindDue:`border-2 border-rose-500 dark:border-rose-400`},Yr=`border-foreground/70`,Xr=`text-foreground`,Zr=[[`plannedAt`,`Planned`],[`startedAt`,`Started`],[`reviewAt`,zr.in_review],[`completedAt`,`Completed`],[`reopenedAt`,`Reopened`],[`pausedAt`,zr.paused]];function Qr(e){let t=new Date(e*1e3),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}var $r=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`,style:`short`}),ei=604800;function ti(e,t=Date.now()/1e3){let n=e-t,r=Math.abs(n);if(r<60)return`just now`;if(r<ei){let[e,t]=r<3600?[Math.trunc(n/60),`minute`]:r<86400?[Math.trunc(n/3600),`hour`]:[Math.trunc(n/86400),`day`];return $r.format(e,t)}let i=new Date(e*1e3),a=i.getFullYear()===new Date(t*1e3).getFullYear();return i.toLocaleDateString(`en`,{month:`short`,day:`numeric`,...a?{}:{year:`numeric`}})}function ni(e){return new Date(e*1e3).toLocaleString(`en`,{dateStyle:`medium`,timeStyle:`short`})}function ri(e){let t=[];for(let n of e){let e=t.at(-1);e!==void 0&&e.end===null&&(e.end=n.at),n.status!==`done`&&(n.status===`planned`?t.length>0&&t.push({state:`paused`,start:n.at,end:null,reason:n.reason}):t.push({state:n.status,start:n.at,end:null,reason:null}))}return t}function ii(e,t){return oi(e,t,e=>e!==`paused`)}function ai(e,t){return oi(e,t,e=>e===`paused`)}function oi(e,t,n){let r=ri(e);return r.length===0?null:r.filter(e=>n(e.state)).reduce((e,n)=>e+Math.max((n.end??t)-n.start,0),0)}function si(e){return Zr.flatMap(([t,n])=>{let r=e[t];return r===null?[]:[{label:n,at:r}]}).sort((e,t)=>e.at-t.at)}var Y=r();function ci({at:e,prefix:t=``,className:n}){return(0,Y.jsx)(`time`,{className:n,dateTime:new Date(e*1e3).toISOString(),title:ni(e),children:`${t}${ti(e)}`})}var li=`h-7 w-16 rounded-md border bg-background px-2 text-sm`;function ui(e){return e.split(/[\\/]/).pop()??e}function di(e){return e<1048576?`${Math.ceil(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}var fi={automatic:`Automatic`,preRestore:`Before restore`,preMigration:`Before update`};function pi(){return ue().data?.lastFailure?(0,Y.jsx)(`span`,{className:`text-destructive`,children:`Backup failed`}):null}function mi(){let e=ue().data?.lastFailure;return e?(0,Y.jsxs)(`p`,{role:`alert`,"aria-label":`Automatic backup failed`,className:`text-xs break-words text-destructive`,children:[`The automatic backup `,(0,Y.jsx)(ci,{at:e.at}),` failed: `,e.message]}):null}function hi(e){return e.kind===`upload`?e.file.name:ui(e.path)}function gi(){let e=Me(),t=L(),n=st(),r=E(),i=G(),a=(0,J.useRef)(null),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(null),u=t.isPending,d=r.isPending||i.isPending;function f(){l(null),t.mutate(void 0,{onSuccess:e=>l(`Downloaded ${e}`)})}function p(){l(null),a.current?.click()}function m(e){l(null);let t={onSuccess:t=>{s(null),l(`Restored ${hi(e)}. The previous data was saved as ${ui(t.path)}.`)}};e.kind===`upload`?i.mutate(e.file,t):r.mutate(ui(e.path),t)}let h=t.error??n.error??r.error??i.error??e.error;return(0,Y.jsxs)(`section`,{"aria-label":`Backups`,className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{size:`sm`,variant:`outline`,onClick:f,disabled:u,children:u?`Exporting...`:`Export...`}),(0,Y.jsx)(q,{size:`sm`,variant:`outline`,onClick:p,disabled:d,children:`Restore...`}),(0,Y.jsx)(`input`,{ref:a,type:`file`,accept:`.sqlite3,.db`,"aria-label":`Database file to restore`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&s({kind:`upload`,file:t})}})]}),o&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm restore`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,children:[(0,Y.jsxs)(`p`,{className:`text-xs break-words`,children:[`Replace all workspaces and tasks with `,(0,Y.jsx)(`span`,{className:`font-medium`,children:hi(o)}),`? The current data is backed up first.`]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{size:`xs`,variant:`destructive`,onClick:()=>m(o),disabled:d,children:d?`Restoring...`:`Replace data`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,onClick:()=>s(null),disabled:d,children:`Cancel`})]})]}),c&&(0,Y.jsx)(`p`,{role:`status`,className:`text-xs break-words text-muted-foreground`,children:c}),h&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs break-words text-destructive`,children:h.message}),(0,Y.jsx)(mi,{}),(0,Y.jsx)(_i,{}),(0,Y.jsxs)(`ul`,{"aria-label":`Saved backups`,className:`flex flex-col divide-y`,children:[e.data?.length===0&&(0,Y.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No backups yet.`}),e.data?.map(e=>(0,Y.jsxs)(`li`,{className:`flex flex-col gap-1 py-1.5 text-xs first:pt-0`,title:e.path,children:[(0,Y.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Y.jsx)(`time`,{className:`font-medium`,dateTime:new Date(e.createdAt*1e3).toISOString(),children:ni(e.createdAt)}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,Y.jsx)(ci,{at:e.createdAt}),` · `,fi[e.kind],` · `,di(e.sizeBytes)]})]}),(0,Y.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`outline`,"aria-label":`Download backup from ${ni(e.createdAt)}`,disabled:n.isPending,onClick:()=>{l(null),n.mutate(ui(e.path),{onSuccess:e=>l(`Downloaded ${e}`)})},children:`Download`}),(0,Y.jsx)(q,{size:`xs`,variant:`outline`,"aria-label":`Restore this backup from ${ni(e.createdAt)}`,onClick:()=>{l(null),s({kind:`backup`,path:e.path})},children:`Restore this backup`})]})]},e.path))]})]})}function _i(){let e=Xe();if(!e.data)return null;let{enabled:t,intervalHours:n,keep:r,directory:i}=e.data;return(0,Y.jsx)(vi,{initial:e.data},`${t}-${n}-${r}-${i??``}`)}function vi({initial:e}){let t=ut(),[n,r]=(0,J.useState)(e.enabled),[i,a]=(0,J.useState)(String(e.intervalHours)),[o,s]=(0,J.useState)(String(e.keep)),[c,l]=(0,J.useState)(e.directory??``);function u(e){e.preventDefault(),t.mutate({enabled:n,intervalHours:Number(i),keep:Number(o),directory:c.trim()||null})}return(0,Y.jsxs)(`form`,{onSubmit:u,"aria-label":`Automatic backups`,className:`flex flex-col gap-1 text-xs`,children:[(0,Y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>r(e.target.checked)}),`Back up automatically`]}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[`Every`,(0,Y.jsx)(`input`,{className:li,type:`number`,min:1,max:720,"aria-label":`Hours between backups`,value:i,onChange:e=>a(e.target.value),disabled:!n,required:!0}),`hours`]}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[`Keep`,(0,Y.jsx)(`input`,{className:li,type:`number`,min:1,max:100,"aria-label":`Backups to keep`,value:o,onChange:e=>s(e.target.value),disabled:!n,required:!0}),`latest`]}),(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Save backups in`,(0,Y.jsx)(`input`,{className:`h-7 w-full rounded-md border bg-background px-2 text-sm`,type:`text`,spellCheck:!1,"aria-label":`Backup directory`,placeholder:`the server's data directory`,value:c,onChange:e=>l(e.target.value)}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`An absolute path on the server, e.g. on another disk. Every backup goes there, including the one before an update.`})]}),t.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:t.error.message}),(0,Y.jsx)(q,{type:`submit`,size:`xs`,variant:`outline`,className:`self-start`,disabled:t.isPending,children:t.isPending?`Saving...`:`Save backup settings`})]})}var yi=[{keys:[`Ctrl+K`,`Cmd+K`],description:`Open the command palette: jump to a task or run an action`},{keys:[`j`,`k`],description:`Select the next or previous task in the list or on the timeline`},{keys:[`Enter`],description:`Open the details of the selected task`},{keys:[`Esc`],description:`Close the details, the palette, or a dialog`},{keys:[`/`],description:`Search tasks`},{keys:[`?`],description:`Show these shortcuts`},{keys:[`Up`,`Down`,`Home`,`End`],description:`On a timeline bar, move the selection between rows`}];function bi(e){return e instanceof HTMLElement&&(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true'], [contenteditable='']`)!==null)}function xi(e){return(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`}function Si(){return[...document.querySelectorAll(`[aria-modal='true'], [role=menu]`)].some(e=>e.closest(`[hidden]`)===null)}function Ci(e){return!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!bi(e.target)&&!Si()}function wi(e,t){let n=t.toLowerCase().split(/\s+/).filter(e=>e!==``);return e.filter(e=>{let t=`${e.label} ${e.keywords??``}`.toLowerCase();return n.every(e=>t.includes(e))})}function Ti({label:e,onClose:t,className:n,children:r}){let i=(0,J.useRef)(null),o=(0,J.useRef)(t);return o.current=t,(0,J.useLayoutEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=i.current;return()=>{let n=document.activeElement;(n===null||n===document.body||t?.contains(n))&&e?.isConnected&&e.focus({preventScroll:!0})}},[]),(0,J.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),o.current()),e.key===`Tab`&>(i.current,e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]),(0,Y.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center px-4 pt-[min(15vh,8rem)] max-md:pt-[max(1rem,env(safe-area-inset-top))]`,children:[(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-0 bg-black/40`,onClick:()=>t()}),(0,Y.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":!0,"aria-label":e,className:a(`relative flex max-h-[min(32rem,calc(100dvh-2rem))] w-full max-w-xl flex-col overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-xl`,n),children:r})]})}function Ei({commands:e,onClose:t}){let[n,r]=(0,J.useState)(``),[i,o]=(0,J.useState)(0),s=(0,J.useId)(),c=(0,J.useRef)(null),l=wi(e,n),u=Math.min(i,l.length-1),d=e=>`${s}-${e}`;(0,J.useEffect)(()=>{c.current?.querySelector(`[id="${d(u)}"]`)?.scrollIntoView?.({block:`nearest`})},[u,n]);let f=e=>{e!==void 0&&(t(),e.run())},p=e=>{let t=l.length-1,n=e.key===`ArrowDown`?Math.min(u+1,t):e.key===`ArrowUp`?Math.max(u-1,0):e.key===`Home`&&e.ctrlKey?0:e.key===`End`&&e.ctrlKey?t:null;n===null?e.key===`Enter`&&(e.preventDefault(),f(l[u])):(e.preventDefault(),o(n))},m=[`Actions`,`Tasks`].map(e=>({group:e,entries:l.map((e,t)=>({command:e,position:t})).filter(({command:t})=>t.group===e)})).filter(({entries:e})=>e.length>0);return(0,Y.jsxs)(Ti,{label:`Command palette`,onClose:t,children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b px-3`,children:[(0,Y.jsx)(br,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`input`,{autoFocus:!0,role:`combobox`,"aria-label":`Search actions and tasks`,"aria-expanded":!0,"aria-controls":s,"aria-autocomplete":`list`,"aria-activedescendant":l.length>0?d(u):void 0,placeholder:`Jump to a task or run an action...`,className:`h-11 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`,value:n,onChange:e=>{r(e.target.value),o(0)},onKeyDown:p}),(0,Y.jsx)(`kbd`,{className:`rounded border px-1.5 text-[0.625rem] text-muted-foreground max-md:hidden`,children:`Esc`})]}),(0,Y.jsxs)(`div`,{ref:c,id:s,role:`listbox`,"aria-label":`Actions and tasks`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-1`,children:[m.length===0&&(0,Y.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:`No actions or tasks match.`}),m.map(({group:e,entries:t})=>(0,Y.jsxs)(`div`,{role:`group`,"aria-label":e,className:`flex flex-col`,children:[(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground`,children:e}),t.map(({command:e,position:t})=>(0,Y.jsxs)(`div`,{id:d(t),role:`option`,"aria-selected":t===u,className:a(`flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm select-none max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground`,t===u&&`bg-muted`),onMouseMove:()=>t!==u&&o(t),onMouseDown:e=>e.preventDefault(),onClick:()=>f(e),children:[e.icon,(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.hint&&(0,Y.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.hint})]},e.id))]},e))]})]})}function Di({onClose:e}){let t=(0,J.useRef)(null);return(0,J.useLayoutEffect)(()=>t.current?.focus({preventScroll:!0}),[]),(0,Y.jsxs)(Ti,{label:`Keyboard shortcuts`,onClose:e,className:`max-w-md`,children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center border-b px-4 py-2`,children:[(0,Y.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Keyboard shortcuts`}),(0,Y.jsx)(q,{ref:t,variant:`ghost`,size:`icon-sm`,className:`ml-auto`,"aria-label":`Close shortcuts`,title:`Close (Esc)`,onClick:e,children:(0,Y.jsx)(vt,{})})]}),(0,Y.jsx)(`dl`,{className:`flex min-h-0 flex-col gap-2 overflow-y-auto p-4 text-sm`,children:yi.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,Y.jsx)(`dt`,{className:`flex w-32 shrink-0 flex-wrap gap-1`,children:e.keys.map(e=>(0,Y.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 font-mono text-xs`,children:e},e))}),(0,Y.jsx)(`dd`,{className:`text-muted-foreground`,children:e.description})]},e.description))}),(0,Y.jsx)(`p`,{className:`border-t px-4 py-2 text-xs text-muted-foreground`,children:`Letter shortcuts do nothing while you type in a field.`})]})}var Oi=class extends J.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}componentDidCatch(e,t){console.error(`Toodo: ${this.props.label} failed to render`,e,t.componentStack)}componentDidUpdate(e){this.state.error!==null&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){let{error:e}=this.state;if(e===null)return this.props.children;let t=this.props.as??`div`;return(0,Y.jsxs)(t,{role:`alert`,className:a(`flex flex-col items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/5 p-4 text-sm`,this.props.className),children:[(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 font-medium`,children:[(0,Y.jsx)(Ir,{"aria-hidden":!0,className:`size-4 shrink-0 text-destructive`}),ki(this.props.label),` could not be shown.`]}),(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Something went wrong while showing it. Try again, or reload the page if it keeps happening.`}),e.message&&(0,Y.jsx)(`p`,{className:`font-mono text-xs break-all text-muted-foreground`,children:e.message}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(q,{size:`sm`,variant:`outline`,onClick:()=>this.setState({error:null}),children:[(0,Y.jsx)(vr,{}),`Try again`]}),(0,Y.jsx)(q,{size:`sm`,variant:`ghost`,onClick:()=>window.location.reload(),children:`Reload page`})]})]})}};function ki(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ai(){let e=(0,J.useSyncExternalStore)(nt,Pe),[t,n]=(0,J.useState)(!1);return e===`none`?null:(0,Y.jsxs)(`div`,{role:`region`,"aria-label":`Install Toodo`,className:a(`mb-4 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg px-3 py-2`,Gr.info),children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-56 flex-col gap-0.5`,children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:`Install Toodo on this device`}),(0,Y.jsx)(`p`,{className:`text-xs break-words`,children:e===`prompt`?`It opens in its own window and can show notifications.`:(0,Y.jsxs)(Y.Fragment,{children:[`Tap `,(0,Y.jsx)(wr,{"aria-label":`Share`,className:`inline size-3.5 align-text-bottom`}),`, then`,` `,(0,Y.jsx)(`span`,{className:`font-medium`,children:`Add to Home Screen`}),`. Notifications need the installed app.`]})})]}),(0,Y.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[e===`prompt`&&(0,Y.jsxs)(q,{size:`sm`,disabled:t,onClick:()=>{n(!0),fe().finally(()=>n(!1))},children:[(0,Y.jsx)(An,{}),`Install`]}),(0,Y.jsx)(q,{size:`sm`,variant:`outline`,onClick:Qe,children:e===`prompt`?`Not now`:`Dismiss`})]})]})}var ji={on_time:`On time`,late:`Late`,overdue:`Overdue`,upcoming:`Due`};function Mi(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r+1).getTime()/1e3}function Ni(e,t){if(e.dueDate===null)return null;let n=Mi(e.dueDate);if(e.status===`done`){let{completedAt:t}=e.milestones;return t===null?null:t<n?`on_time`:`late`}return t>=n?`overdue`:`upcoming`}function Pi(e,t){if(e.dueDate===null)return 0;let n=e.status===`done`?e.milestones.completedAt??t:t;return Math.max(n-Mi(e.dueDate),0)}function Fi(e){return[...e.estimate===null?[`estimate`]:[],...e.dueDate===null?[`dueDate`]:[]]}function Ii(e){return e.length===0?null:`No ${e.map(e=>e===`estimate`?`estimate`:`due date`).join(` or `)}`}function Li(e){return String(Math.round(e*100)/100)}var Ri={hours:`h`,days:`d`,weeks:`w`,months:`mo`},zi={hours:3600,days:86400,weeks:604800,months:2592e3};function Bi(e){return`${Li(e.amount)}${Ri[e.unit]}`}function Vi(e){return e?e.amount*zi[e.unit]:null}function Hi(e){let t=e.trim();if(t===``)return null;let n=/^\d+(\.\d+)?$/.test(t)?Number(t):NaN;return n>0&&n<=1e4?n:NaN}function Ui(e){let t=e.split(`,`).map(e=>e.trim()).filter(e=>e!==``);return[...new Set(t)].sort()}function Wi(e){return e.join(`, `)}var Gi=[`planned`,`in_progress`,`in_review`];function Ki(e){return e?.resolution===`not_adopted`}function qi(e,t){return e.dependsOn.every(e=>{let n=t.get(e);return n?.status===`done`&&!Ki(n)})}function Ji(e,t){return e.status!==`planned`||e.dependsOn.some(e=>Ki(t.get(e)))?[]:e.dependsOn.filter(e=>t.get(e)?.status!==`done`)}function X(e){return e.status===`planned`&&e.milestones.startedAt!==null}function Yi(e,t){return e.notes.some(e=>e.kind===`blocker`&&e.at===t)}function Xi(e,t){let n=e.milestones.pausedAt;return X(e)&&n!==null&&qi(e,t)&&(Yi(e,n)||e.dependsOn.some(e=>(t.get(e)?.milestones.completedAt??-1/0)>=n))}function Zi(e){return e.status===`planned`&&!X(e)}function Qi(e,t){let n=e.dependsOn.map(e=>{let n=t.get(e);return Ki(n)?null:n?.milestones.completedAt??null});return n.length===0||n.includes(null)?null:Math.max(...n)}function $i(e,t){return`${e}->${t}`}function ea(e){let t=new Set(e.map(e=>e.id));return e.flatMap(e=>e.dependsOn.filter(e=>t.has(e)).map(t=>({id:$i(t,e.id),source:t,target:e.id})))}function ta(e,t,n){if(t===n)return!1;let r=new Map(e.map(e=>[e.id,e])),i=r.get(t),a=r.get(n);if(i===void 0||a===void 0||!Gi.includes(a.status)||a.dependsOn.includes(t))return!1;let o=[t],s=new Set(o);for(let e=o.pop();e!==void 0;e=o.pop())for(let t of r.get(e)?.dependsOn??[]){if(t===n)return!1;s.has(t)||(s.add(t),o.push(t))}return!0}function na(e,t){let n=new Set([t]),r=e=>{let r=[t],i=new Set([t]);for(let t=r.pop();t!==void 0;t=r.pop())for(let a of e(t))i.has(a)||(i.add(a),n.add(a),r.push(a))},i=new Map(e.map(e=>[e.id,e]));return r(e=>i.get(e)?.dependsOn.filter(e=>i.has(e))??[]),r(t=>e.filter(e=>e.dependsOn.includes(t)).map(e=>e.id)),n}var ra=[`hour`,`day`,`week`,`month`],ia={hour:960,day:48,week:12,month:3},aa=120;function oa(e,t,n){let r=e.x+8,i=t.x-8,a=t.y-n/2;return`M ${e.x} ${e.y} H ${r} V ${a} H ${i} V ${t.y} H ${t.x}`}var sa=86400;function ca(e,t){let{plannedAt:n,startedAt:r,reviewAt:i,completedAt:a,pausedAt:o}=e.milestones;if(Zi(e))return{start:t,end:t};let s=r??i;if(e.status===`in_progress`||e.status===`in_review`)return s===null?null:{start:Math.min(s,t),end:t};let c=[n,r,i].filter(e=>e!==null),l=(e.status===`done`?a:o)??(c.length>0?Math.max(...c):null);return l===null?null:{start:Math.min(s??l,l),end:l}}function la(e,{start:t,end:n}){let r=ri(e.timeline),{reviewAt:i}=e.milestones;return(r.length>0?r.map(e=>({phase:e.state,start:e.start,end:e.end??n})):[{phase:`in_progress`,start:t,end:i??n},{phase:`in_review`,start:i??n,end:n}]).map(e=>({...e,start:Math.max(e.start,t),end:Math.min(e.end,n)})).filter(e=>e.end>e.start)}function ua(e,t,n,r,i){let{plannedAt:a}=e.milestones;if(a===null||i(Math.max(a,r))>=n)return null;let o=i(Math.max(a,r)),s=t!==null&&t>a&&t>=r?i(t):null;return{x:o-n,planned:a>=r,readyX:s!==null&&s<n?s-n:null}}function da(e,t){let n=[],r=0;for(let i of t)i.x>r&&n.push({x:r,width:Math.min(i.x,e)-r}),r=Math.max(r,i.x+i.width);return r<e&&n.push({x:r,width:e-r}),n}function fa(e){let t=new Set(e.map(({task:e})=>e.id)),n=new Map(e.map(({task:e})=>[e.id,e.dependsOn.filter(e=>t.has(e)).length])),r=(e,t)=>e.interval.start-t.interval.start||e.task.id-t.task.id,i=new Set,a=[],o=e.filter(({task:e})=>n.get(e.id)===0);for(;a.length<e.length;){o.length===0&&(o=[e.filter(({task:e})=>!i.has(e.id)).sort(r)[0]]),o.sort(r);let t=o.shift();a.push(t),i.add(t.task.id);for(let r of e)if(!i.has(r.task.id)&&r.task.dependsOn.includes(t.task.id)){let e=n.get(r.task.id)-1;n.set(r.task.id,e),e===0&&o.push(r)}}return a}var pa=e=>String(e).padStart(2,`0`),ma={hour:{minor:`hour`,major:`day`},day:{minor:`day`,major:`month`},week:{minor:`week`,major:`month`},month:{minor:`month`,major:`year`}},ha={hour:e=>`${pa(e.getHours())}:00`,day:e=>`${pa(e.getMonth()+1)}-${pa(e.getDate())}`,week:e=>`${pa(e.getMonth()+1)}-${pa(e.getDate())}`,month:e=>`${e.getFullYear()}-${pa(e.getMonth()+1)}`,year:e=>String(e.getFullYear())},ga={...ha,day:e=>`${e.getFullYear()}-${pa(e.getMonth()+1)}-${pa(e.getDate())}`};function _a(e,t){let n=new Date(e*1e3);return n.setMinutes(0,0,0),t!==`hour`&&n.setHours(0),t===`week`?n.setDate(n.getDate()-(n.getDay()+6)%7):t===`month`?n.setDate(1):t===`year`&&n.setMonth(0,1),n}function va(e,t){t===`hour`?e.setHours(e.getHours()+1):t===`day`?e.setDate(e.getDate()+1):t===`week`?e.setDate(e.getDate()+7):t===`month`?e.setMonth(e.getMonth()+1):e.setFullYear(e.getFullYear()+1)}function ya(e,t,n){let r=[];for(let i=_a(e,n);i.getTime()/1e3<t;va(i,n))r.push(new Date(i));return r}function ba(e,t,n){let r=ia[e.scale],i=t=>(t-e.start)/sa*r,a=e.start+t/r*sa,o=e.start+n/r*sa;e.period!==null&&(a=Math.max(a,e.period.start),o=Math.min(o,e.period.end));let{minor:s,major:c}=ma[e.scale];return{ticks:ya(a,o,s).filter(e=>e.getTime()/1e3>=a).map(e=>({at:e.getTime()/1e3,x:i(e.getTime()/1e3),label:ha[s](e)})),majorTicks:ya(a,o,c).map(t=>{let n=new Date(t);va(n,c);let r=t.getTime()/1e3,a=n.getTime()/1e3;return e.period!==null&&(r=Math.max(r,e.period.start),a=Math.min(a,e.period.end)),{at:r,x:i(r),right:i(a),label:ga[c](t)}})}}function xa(e){return e.length*6+6}function Sa(e,t,n,r){let i=Math.max(e.x,n);return r!==null&&i<r.x+r.width&&i+t>r.x&&(i=r.x+r.width),i+t>e.right?null:i-e.x}function Ca(e,{now:t,scale:n,period:r}){let i=new Map(e.map(e=>[e.id,e])),a=[],o=[];for(let n of e){let e=ca(n,t);e===null?a.push(n):(r===null||e.start<r.end&&e.end>=r.start)&&o.push({task:n,interval:e})}let s,c;if(r!==null)({start:s,end:c}=r);else{let e=o.map(({task:e,interval:t})=>Math.min(t.start,e.milestones.plannedAt??t.start)),n=o.flatMap(({task:e})=>e.dueDate===null?[]:[Mi(e.dueDate)]);s=_a(Math.min(t,...e,...n.map(e=>e-sa)),`day`).getTime()/1e3;let r=_a(Math.max(t,...o.map(({interval:e})=>e.end),...n.map(e=>e-1)),`day`);va(r,`day`),c=r.getTime()/1e3}let l=e=>(e-s)/sa*ia[n],u=new Map,d=fa(o).map(({task:e,interval:r},a)=>{let o={start:Math.max(r.start,s),end:Math.min(r.end,c)},d=Zi(e),f,p,m=[],h=[];if(d){let t=e.dependsOn.flatMap(e=>{let t=i.get(e);if(t?.status===`done`&&!Ki(t))return[];let n=u.get(e);return n===void 0?[]:[n+16]});f=Math.max(l(o.start),...t);let r=Vi(e.estimate);p=Math.max(r===null?0:r/sa*ia[n],28)}else{f=l(o.start),p=Math.max(l(o.end)-f,4);for(let t of la(e,o)){let e={x:l(t.start)-f,width:l(t.end)-l(t.start)};t.phase===`paused`?e.width>=6&&h.push(e):m.push({phase:t.phase,...e})}let n=l(Math.min(t,c))-f;X(e)&&n-p>=6&&(h=[...h,{x:p,width:n-p}])}u.set(e.id,f+p);let g=e.dueDate===null?null:Mi(e.dueDate);return{task:e,row:a,x:f,width:p,pending:d,phases:m,blocks:da(p,h),pauses:h,lead:ua(e,Qi(e,i),f,s,l),dueX:g!==null&&g>=s&&g<=c?l(g)-f:null,dueState:Ni(e,t)}});return{bars:d,unplaced:a,rows:d.length,start:s,end:c,width:Math.max(l(c),...d.map(e=>e.x+Math.max(e.width,aa))),scale:n,period:r,nowX:t>=s&&t<=c?l(t):null}}function wa(e){return{start:new Date(e,0,1).getTime()/1e3,end:new Date(e+1,0,1).getTime()/1e3}}function Ta(e,t){let n=new Date(t*1e3).getFullYear(),r=e.flatMap(e=>e.milestones.plannedAt===null?[]:[e.milestones.plannedAt]),i=new Date(Math.min(t,...r)*1e3).getFullYear();return Array.from({length:n-i+1},(e,t)=>n-t)}function Ea(e,t){return e.scale!==`month`&&e.nowX!==null?{x:16-e.nowX,y:Math.min(0,t.panel-t.height-8),zoom:1}:{x:Math.min(16,t.visible-e.width-16),y:0,zoom:1}}function Da(e,t){let n=e.notes.at(-1);if(e.status===`done`||n?.kind!==`blocker`)return null;let r=e.timeline.some(e=>e.status===`in_progress`&&e.at>n.at),i=n.at===e.milestones.pausedAt&&Xi(e,t);return r||i?null:n}var Oa=[`blocker_note`,`stalled`];function ka(e){let t=[...e.milestones.startedAt===null?[]:[e.milestones.startedAt],...e.timeline.map(e=>e.at),...e.notes.map(e=>e.at)];return t.length===0?null:Math.max(...t)}function Aa(e,t,n=new Map(e.map(e=>[e.id,e]))){let r=e=>Oa.indexOf(e.reasons[0]);return e.flatMap(e=>{let r=Oa.filter(r=>{switch(r){case`blocker_note`:return Da(e,n)!==null;case`stalled`:{let n=ka(e);return e.status===`in_progress`&&n!==null&&t-n>604800}}});return r.length>0?[{task:e,reasons:r}]:[]}).sort((e,t)=>r(e)-r(t)||e.task.id-t.task.id)}var ja={blocker_note:`Blocker`,stalled:`Stalled`},Ma={blocker_note:Vr.attention,stalled:Vr.neutral};function Na({onShow:e}){let t=Aa(Ge().data??[],Date.now()/1e3);return t.length===0?null:(0,Y.jsxs)(`section`,{"aria-labelledby":`attention-heading`,className:`flex flex-col gap-1`,children:[(0,Y.jsxs)(`h2`,{id:`attention-heading`,className:a(`flex items-center gap-1.5 px-1 text-xs font-medium uppercase`,Hr.attention),children:[(0,Y.jsx)(rn,{"aria-hidden":!0,className:`size-3.5`}),`Needs attention`,(0,Y.jsx)(`span`,{className:a(`ml-auto rounded-full px-1.5 tabular-nums`,Vr.attention),children:t.length})]}),(0,Y.jsx)(`ul`,{"aria-label":`Tasks needing attention`,className:`flex max-h-60 flex-col gap-0.5 overflow-y-auto`,children:t.map(({task:t,reasons:n})=>(0,Y.jsx)(`li`,{className:`flex items-start gap-0.5 rounded-md hover:bg-sidebar-accent`,children:(0,Y.jsxs)(`button`,{type:`button`,title:`Show on the timeline`,className:`flex min-w-0 flex-1 flex-col gap-1 rounded-md px-1.5 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>e(t.id),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-xs`,children:[(0,Y.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`#`,t.id]}),(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:t.title})]}),(0,Y.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,Y.jsx)(`span`,{"data-reason":e,className:a(`rounded-full px-1.5 text-[11px] font-medium leading-4`,Ma[e]),children:ja[e]},e))})]})},t.id))})]})}var Pa=[`planned`,`ready`,`paused`,`in_progress`,`in_review`,`done`,`not_adopted`];function Fa(e,t){return Ki(e)?`not_adopted`:X(e)?Xi(e,t)?`ready`:`paused`:e.status===`planned`&&qi(e,t)?`ready`:e.status}var Ia=[`attention`,`in_progress`,`in_review`,`ready`,`planned`,`done`],La={attention:`Needs attention`,in_progress:`In progress`,in_review:`Awaiting completion`,ready:`Ready`,planned:`Planned`,done:`Done`};function Ra(e,t){switch(Fa(e,t)){case`in_progress`:return`in_progress`;case`in_review`:return`in_review`;case`ready`:return`ready`;case`planned`:case`paused`:return`planned`;case`done`:case`not_adopted`:return`done`}}function za(e,t,n){let r=e.filter(e=>n.includes(e.id)).sort((e,t)=>n.indexOf(e.id)-n.indexOf(t.id));return Ia.map(i=>({group:i,tasks:i===`attention`?r:e.filter(e=>!n.includes(e.id)&&Ra(e,t)===i)})).filter(e=>e.tasks.length>0)}var Ba={query:``,statuses:[],type:null},Va={...Ba,statuses:Pa.filter(e=>e!==`done`&&e!==`not_adopted`)};function Ha(e){return e.query.trim()!==``||e.statuses.length>0||e.type!==null}function Ua(e,t){return Pa.filter(n=>n===t!==e.includes(n))}function Wa(e){let t=/^#?(\d+)$/.exec(e.trim());return t===null?null:Number(t[1])}function Ga(e,t,n){if(t.statuses.length>0&&!t.statuses.includes(Fa(e,n))||t.type!==null&&e.taskType!==t.type)return!1;let r=`${e.title}\n${e.description}`.toLocaleLowerCase();return t.query.toLocaleLowerCase().split(/\s+/).filter(e=>e!==``).every(e=>r.includes(e))}var Ka=`modulepreload`,qa=function(e){return`/`+e},Ja={},Ya=function(e){return e.pathname.endsWith(`.css`)},Xa=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Za=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=qa(t,n);let r=s(t),i=Ya(r);return Xa(Ja,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ka,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Qa=(0,J.lazy)(()=>Za(()=>import(`./markdown-akFj_lY_.js`),__vite__mapDeps([0,1,2]))),$a=[`feat`,`fix`,`modify`,`refactor`,`docs`,`test`,`chore`,`rnd`];function eo(e,t){return e.status===`done`&&e.resolution===`completed`?`Completed`:zr[Fa(e,t)]}var to={planned:`neutral`,ready:`attention`,paused:`neutral`,in_progress:`progress`,in_review:`review`,done:`success`,not_adopted:`neutral`},no=a(Vr.neutral,`ring-1 ring-inset ring-muted-foreground/40`);function ro(e){return e===`not_adopted`?no:Vr[to[e]]}var io=a(ro(`done`),`border-transparent hover:bg-emerald-200 dark:hover:bg-emerald-900 disabled:bg-emerald-100 disabled:opacity-60 dark:disabled:bg-emerald-950`);function ao(e,t){return ro(Fa(e,t))}function oo(e,t,{byId:n,workspaceName:r}){let i=n.get(e);return i===void 0||i.workspaceId===t?`#${e}`:`${r(i.workspaceId)} #${e}`}function so({label:e,children:t}){return(0,Y.jsxs)(`section`,{"aria-label":e,className:`flex flex-col gap-0.5 text-xs`,children:[(0,Y.jsx)(`h4`,{className:`font-medium text-muted-foreground`,children:e}),t]})}function co({task:e}){let t=Ni(e,Date.now()/1e3);return(0,Y.jsxs)(`span`,{"data-due-state":t??void 0,className:a((t===`late`||t===`overdue`)&&a(`font-medium`,Hr.danger)),children:[t===null||t===`upcoming`?`Due`:ji[t],` `,e.dueDate]})}function lo({task:e,onEdit:t}){let n=Fi(e),r=Ii(n);return r===null?null:(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Edit plan of #${e.id}: ${r.toLowerCase()}`,title:`Reviews compare estimates and due dates with what happened; add them`,"data-missing-plan":n.join(` `),className:`cursor-pointer rounded-sm underline decoration-dotted underline-offset-2 outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>t(n[0]),children:r})}function uo(){let e=(0,J.useSyncExternalStore)(Dt,Ct);return e===`unreachable`||e===`retrying`}function fo({task:e,className:t}){return e.labels.length===0?null:(0,Y.jsx)(`ul`,{"aria-label":`Labels of #${e.id}`,className:a(`flex flex-wrap gap-1`,t),children:e.labels.map(e=>(0,Y.jsx)(`li`,{className:`rounded-full border px-2 py-0.5 text-xs text-muted-foreground`,children:e},e))})}function po({taskId:e,prerequisite:t,pending:n,onConfirm:r,onCancel:i}){return(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Confirm prerequisite of #${e}`,className:a(`flex flex-wrap items-center gap-2 rounded-md px-2 py-1.5 text-xs`,Gr.attention),onKeyDown:mt(i,n),children:[(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Adding `,t,` as a prerequisite pauses #`,e,` until `,t,` is done.`]}),(0,Y.jsxs)(q,{size:`xs`,variant:`destructive`,disabled:n,onClick:r,children:[(0,Y.jsx)(cr,{}),n?`Pausing...`:`Pause and add`]}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,disabled:n,onClick:i,children:`Back`})]})}function mo({type:e,className:t}){return(0,Y.jsx)(`span`,{"data-task-type":e,className:a(`shrink-0 rounded-md border px-1.5 font-mono text-xs`,Wr,t),children:e})}var ho=J.createContext(void 0);function go(e){let t=J.useContext(ho);if(t===void 0&&!e)throw Error(B(33));return t}var _o=J.createContext(void 0);function vo(e){let t=J.useContext(_o);if(t===void 0&&!e)throw Error(B(36));return t}var yo=`data-starting-style`,bo=`data-ending-style`,xo={[yo]:``},So={[bo]:``},Co={transitionStatus(e){return e===`starting`?xo:e===`ending`?So:null}},wo=`data-open`,To=`data-closed`,Eo=`data-anchor-hidden`,Do=`data-popup-open`,Oo=`data-pressed`,ko={[Do]:``,[Oo]:``},Ao={[wo]:``},jo={[To]:``},Mo={[Eo]:``},Z={open(e){return e?ko:null}},No={open(e){return e?Ao:jo},anchorHidden(e){return e?Mo:null}},Po={...No,...Co},Fo=J.createContext(void 0);function Io(e=!0){let t=J.useContext(Fo);if(t===void 0&&!e)throw Error(B(25));return t}var Lo=`none`,Ro=`trigger-press`,zo=`trigger-hover`,Bo=`trigger-focus`,Vo=`outside-press`,Ho=`item-press`,Uo=`focus-out`,Wo=`escape-key`,Go=`list-navigation`,Ko=`keyboard`,qo=`pointer`,Jo=`cancel-open`,Yo=`sibling-open`,Xo=`imperative-action`,Zo=J.createContext(null);function Qo(e=`root`){let t=J.useContext(Zo),n=J.useContext(_o);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var $o={visible:!0,ref:null};function es(){return $o}function ts(e,t,n=`root`){let r=Qo(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??es)({label:e.label,children:e.children,render:e.render}),a=ct(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function ns(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:rs,platform:is,maxTouchPoints:as}=ns(),os=rs.toLowerCase(),ss=is.toLowerCase(),cs=/^i(os$|p)/.test(ss)||ss===`macintel`&&as>1,ls=`android`,us=ss===ls||os.includes(ls),ds=!cs&&ss.startsWith(`mac`);ss.startsWith(`win`),!us&&/^(linux|chrome os)/.test(ss);var fs=ds||cs,ps=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ps&&os.includes(`firefox`),!ps&&os.includes(`chrom`);var ms=fs,hs=/jsdom|happydom/.test(os);function gs(e){e.preventDefault()}function _s(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=vo(),u=Io(!0),f=c.type===`submenu-trigger`,p=f?l.parentVirtualFocus:l.virtualFocus,m=(f&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:h}=a.useState(`floatingTreeRoot`),g=a.useState(`open`),_=u!==void 0,v=!p&&g&&n?0:-1;return J.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":m,onMouseDown:p?gs:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&h.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&h.emit(`close`,{domEvent:e.nativeEvent,reason:Ho})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,_&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||_&&!ds&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!_||e.button===2)&&c.type===`regular-item`&&d(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,h,i,a.context.allowMouseUpTriggerRef,o,s,u,_,c.type,m,p])}var vs={type:`regular-item`};function ys(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=J.useRef(null),{getButtonProps:d,buttonRef:f}=R({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=_s({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=J.useCallback(e=>h(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),g=ct(u,f);return J.useMemo(()=>({getItemProps:m,itemRef:g}),[m,g])}var bs=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function xs(){return J.useContext(bs)}function Ss(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=xs(),u=J.useRef(-1),[d,f]=J.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),m=a??d,h=J.useRef(null),g=J.useCallback(e=>{let t=h.current;t&&s(t),h.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return p(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:g,index:m}}function Cs(){let[,e]=J.useState({});return J.useCallback(()=>{e({})},[])}var ws=0;function Ts(e,t=`mui`){let n=J.useRef(void 0),r=Cs(),i=e??n.current;return J.useEffect(()=>{n.current??(ws+=1,n.current=`${t}-${ws}`,e??r())},[e,t,r]),i}var Es=c.useId;function Ds(e,t){if(Es!==void 0){let n=Es();return e??(t?`${t}-${n}`:n)}return Ts(e,t)}function Os(e){return Ds(e,`base-ui`)}function ks(e,t,n,r){let i=!1,a=!1,o=r??it;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function As(e,t,n){let r=n??it;return{reason:e,event:t??new Event(`base-ui`),...r}}function js(e){J.useEffect(e,oe)}var Ms=null;globalThis.requestAnimationFrame;var Ns=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Ps=class e{static create(){return new e}static request(e){return Ns.request(e)}static cancel(e){return Ns.cancel(e)}currentId=Ms;request(e){this.cancel(),this.currentId=Ns.request(()=>{this.currentId=Ms,e()})}cancel=()=>{this.currentId!==Ms&&(Ns.cancel(this.currentId),this.currentId=Ms)};disposeEffect=()=>this.cancel};function Fs(){let e=je(Ps.create).current;return js(e.disposeEffect),e}function Is(e,t=!1,n=!1,r=!1){let[i,a]=J.useState(e&&t?`idle`:void 0),[o,s]=J.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),p(()=>{if(!e&&o&&i!==`ending`&&n){let e=Ps.request(()=>{a(`ending`)});return()=>{Ps.cancel(e)}}},[e,o,i,n]),p(()=>{if(!e||t||i===void 0)return;let n=Ps.request(()=>{a(void 0)});return()=>{Ps.cancel(n)}},[t,e,i]),p(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Ps.request(()=>{a(`idle`)});return()=>{Ps.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Ls(e){return e==null?e:`current`in e?e.current:e}function Rs(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var zs=i(qt(),1),Bs=null;function Vs(e){if(!Bs){let e=[];Bs=e,queueMicrotask(()=>{Bs=null,zs.flushSync(()=>{for(let t of e)t()})})}Bs.push(e)}function Hs(e,t=!1,n=!1){let r=Fs();return j((i,a=null)=>{r.cancel();let o=Ls(e);if(o==null)return;let s=o,c=()=>{n?Vs(()=>{a?.aborted||i()}):zs.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Rs(s).map(e=>e.finished.then(lt))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Rs(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=yo;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Us(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=j(a),s=Hs(r,n,i);J.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var Ws=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=vo(),f=Ss({guess:!0,label:a}),p=Os(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=ys({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:vs});return Se(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Gs=J.forwardRef(function(e,t){let n=ts(e,t);return n.visible?(0,Y.jsx)(Ws,{...e,ref:n.ref}):null}),Ks=0,qs=class e{static create(){return new e}currentId=Ks;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ks,t()},e)}isStarted(){return this.currentId!==Ks}clear=()=>{this.currentId!==Ks&&(clearTimeout(this.currentId),this.currentId=Ks)};disposeEffect=()=>this.clear};function Js(){let e=je(qs.create).current;return js(e.disposeEffect),e}function Ys(e){e.preventDefault(),e.stopPropagation()}function Xs(e){return`nativeEvent`in e}function Zs(e){return e.pointerType===``&&e.isTrusted?!0:us&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Qs(e){return hs?!1:!us&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(us||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function $s(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ec(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function tc(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&w(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function nc(e,t){let n=e;for(;n;){if(H(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(w(n)?n.host:null)}return null}function rc(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var ic=`data-base-ui-focusable`,ac=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,oc=`ArrowLeft`,sc=`ArrowRight`,cc=`ArrowUp`,lc=`ArrowDown`,uc=`data-trigger-disabled`;function dc(e,t){if(!H(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(uc);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(uc);return!1}function fc(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function pc(e){return e.matches(`html,body`)}function mc(e){return b(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function hc(e){return nc(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ac}`)!=null}function gc(e){return e?e.getAttribute(`role`)===`combobox`&&mc(e):!1}function _c(e){if(!e||hs)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function vc(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function yc(e,t){return t!=null&&!$s(t)?0:typeof e==`function`?e():e}function bc(e,t,n){let r=yc(e,n);return typeof r==`number`?r:r?.[t]}function xc(e){return typeof e==`function`?e():e}function Sc(e,t){return t||e===`click`||e===`mousedown`}function Cc(e){return e?.includes(`mouse`)&&e!==`mousedown`}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function wc(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Tc(e){let t=je(Ec,e).current;return t.next=e,p(t.effect),t}function Ec(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Dc={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Oc={...Dc,position:`fixed`,margin:0,top:0,left:0};({...Dc});var kc=J.forwardRef(function(e,t){let[n,r]=J.useState();p(()=>{ms&&ps&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:Oc,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Ac=Math.min,jc=Math.max,Mc=Math.round,Nc=Math.floor,Pc=e=>({x:e,y:e}),Fc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ic(e,t,n){return jc(e,Ac(t,n))}function Lc(e,t){return typeof e==`function`?e(t):e}function Rc(e){return e.split(`-`)[0]}function zc(e){return e.split(`-`)[1]}function Bc(e){return e===`x`?`y`:`x`}function Vc(e){return e===`y`?`height`:`width`}function Hc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Uc(e){return Bc(Hc(e))}function Wc(e,t,n){n===void 0&&(n=!1);let r=zc(e),i=Uc(e),a=Vc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=$c(o)),[o,$c(o)]}function Gc(e){let t=$c(e);return[Kc(e),t,Kc(t)]}function Kc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var qc=[`left`,`right`],Jc=[`right`,`left`],Yc=[`top`,`bottom`],Xc=[`bottom`,`top`];function Zc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Jc:qc:t?qc:Jc;case`left`:case`right`:return t?Yc:Xc;default:return[]}}function Qc(e,t,n,r){let i=zc(e),a=Zc(Rc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Kc)))),a}function $c(e){let t=Rc(e);return Fc[t]+e.slice(t.length)}function el(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function tl(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:el(e)}function nl(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function rl(e,t){return t<0||t>=e.length}function il(e,t){return sl(e.current,{disabledIndices:t})}function al(e,t){return sl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ol(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>sl(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:rl(e,u)?-1:u,wrapped:d}}function sl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&cl(e,a,r));return a}function cl(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!ul(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function ll(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ul(e,t=e?ke(e):null){return!e||!e.isConnected||!t||ll(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var dl=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function fl(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return w(n)?n.host:null}function pl(e){for(let t of Array.from(e.children))if(g(t)===`summary`)return t;return null}function ml(e,t){let n=pl(t);return!!n&&(e===n||Q(n,e))}function hl(e){let t=e?g(e):``;return e!=null&&e.matches(dl)&&(t!==`summary`||e.parentElement!=null&&g(e.parentElement)===`details`&&pl(e.parentElement)===e)&&(t!==`details`||pl(e)==null)&&(t!==`input`||e.type!==`hidden`)}function gl(e){if(!hl(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=fl(t)){let n=t!==e,r=g(t)===`slot`;if(t.hasAttribute(`inert`)||n&&g(t)===`details`&&!t.open&&!ml(e,t)||t.hasAttribute(`hidden`)||!r&&!_l(t,n))return!1}return!0}function _l(e,t){let n=ke(e);return t?n.display!==`none`:ul(e,n)}function vl(e){let t=e.tabIndex;if(t<0){let t=g(e);if(t===`details`||t===`audio`||t===`video`||b(e)&&e.isContentEditable)return 0}return t}function yl(e){if(g(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function bl(e,t){let n=yl(e);if(!n)return!0;let r=t.find(e=>{let t=yl(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=yl(e);return t?.name===n.name&&t.form===n.form})===n}function xl(e){if(b(e)&&g(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return b(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Sl(e,t){xl(e).forEach(e=>{hl(e)&&t.push(e),Sl(e,t)})}function Cl(e,t,n){xl(e).forEach(e=>{b(e)&&e.matches(t)&&n.push(e),Cl(e,t,n)})}function wl(e){return gl(e)&&vl(e)>=0}function Tl(e){let t=[];return Sl(e,t),t.filter(gl)}function El(e){let t=Tl(e);return t.filter(e=>vl(e)>=0&&bl(e,t))}function Dl(e,t){let n=El(e),r=n.length;if(r===0)return;let i=tc(Lr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ol(e){return Dl(Lr(e).body,1)||e}function kl(e){return Dl(Lr(e).body,-1)||e}function Al(e,t,n){if(!e)return null;let r=[];Sl(Lr(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(gl);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&wl(o)&&bl(o,a))return o}return r[i]}function jl(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function Ml(e){El(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Nl(e){let t=[];Cl(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Pl(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Pl(e,t.id,n)])}function Fl(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Il(e){return`data-base-ui-${e}`}var Ll=0;function Rl(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ll);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),lt;let o=requestAnimationFrame(a);return Ll=o,()=>{Ll===o&&(cancelAnimationFrame(o),Ll=0)}}var zl=`data-base-ui-inert`,Bl=new WeakMap,Vl=new WeakSet,Hl=new WeakMap,Ul=0;function Wl(e){return e?w(e)?e.host:Wl(e.parentNode):null}var Gl=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Wl(t);return e.contains(n)?n:null}).filter(e=>e!=null),Kl=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},ql=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{g(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Jl(e,t,n,{mark:r=!0}){let i=Gl(t,e),a=r?ql(t,Kl(i),new Set(i)):[],o=[],s=[];if(n){let e=Gl(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);ql(t,Kl(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Bl.get(e)||0)+1;Bl.set(e,r),o.push(e),r===1&&n&&Vl.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Hl.get(e)||0)+1;Hl.set(e,t),s.push(e),t===1&&e.setAttribute(zl,``)}),Ul+=1,()=>{o.forEach(e=>{let t=(Bl.get(e)||0)-1;Bl.set(e,t),t||(Vl.has(e)||e.removeAttribute(`aria-hidden`),Vl.delete(e))}),r&&s.forEach(e=>{let t=(Hl.get(e)||0)-1;Hl.set(e,t),t||e.removeAttribute(zl)}),--Ul,Ul||(Bl=new WeakMap,Vl=new WeakSet,Hl=new WeakMap)}}function Yl(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Lr(e[0]).body;return Jl(e,i,n,{mark:r})}var Xl={style:{transition:`none`}},Zl={fallbackAxisSide:`none`},Ql={fallbackAxisSide:`end`},$l={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},eu=J.createContext(null),tu=()=>J.useContext(eu),nu=Il(`portal`);function ru(e={}){let{ref:t,container:n,componentProps:r=it,elementProps:i}=e,a=Ds(),o=tu()?.portalNode,[s,c]=J.useState(null),[l,u]=J.useState(null),d=j(e=>{e!==null&&u(e)}),f=J.useRef(null);p(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(te(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let m=Se(`div`,r,{ref:[t,d],props:[{id:a,[nu]:``},i]}),h=s&&m?zs.createPortal(m,s):null;return{node:l,nodeId:J.isValidElement(m)?m.props.id:void 0,subtree:h}}var iu=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ru({container:o,ref:t,componentProps:e,elementProps:c}),f=J.useRef(null),m=J.useRef(null),h=J.useRef(null),g=J.useRef(null),[_,v]=J.useState(null),y=J.useRef(!1),b=_?.modal,x=_?.open,S=!!_&&!_.modal&&_.open&&!!l;J.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&jl(e)&&(e.type===`focusin`?y.current&&=(Nl(l),!1):(Ml(l),y.current=!0))}return wc($(l,`focusin`,e,!0),$(l,`focusout`,e,!0))},[l,b]),p(()=>{l&&x===!0&&y.current&&(Nl(l),y.current=!1)},[x,l]);let C=J.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return(0,Y.jsxs)(J.Fragment,{children:[d,(0,Y.jsxs)(eu.Provider,{value:C,children:[S&&l&&(0,Y.jsx)(kc,{"data-type":`outside`,ref:f,onFocus:e=>{jl(e,l)?h.current?.focus():kl(_?_.domReference:null)?.focus()}}),S&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:$l}),l&&zs.createPortal(a,l),S&&l&&(0,Y.jsx)(kc,{"data-type":`outside`,ref:m,onFocus:e=>{jl(e,l)?g.current?.focus():(Ol(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,ks(`focus-out`,e.nativeEvent)))}})]})]})});function au(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ou=class{nodesRef={current:[]};events=au();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},su=J.createContext(null),cu=J.createContext(null),lu=()=>J.useContext(su)?.id||null,uu=e=>{let t=J.useContext(cu);return e??t};function du(e){let t=Ds(),n=uu(e),r=lu();return p(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fu(e){let{children:t,id:n}=e,r=lu();return(0,Y.jsx)(su.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function pu(e){let{children:t,externalTree:n}=e,r=je(()=>n??new ou).current;return(0,Y.jsx)(cu.Provider,{value:r,children:t})}function mu(e,t){let n=dt(rc(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Zs(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var hu=20,gu=[];function _u(){gu=gu.filter(e=>e.deref()?.isConnected)}function vu(e){_u(),e&&g(e)!==`body`&&(gu.push(new WeakRef(e)),gu.length>hu&&(gu=gu.slice(-20)))}function yu(){return _u(),gu[gu.length-1]?.deref()}function bu(e){return e?wl(e)?e:El(e)[0]||e:null}function xu(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Tl(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return wl(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Su(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:_}=e,v=t.useState(`open`),y=t.useState(`domReferenceElement`),x=t.useState(`floatingElement`),{events:S,dataRef:C}=t.context,w=j(()=>C.current.floatingContext?.nodeId),T=i===!1,E=gc(y)&&T,D=Tc(i),O=Tc(a),k=Tc(o),A=Tc(u),M=Tc(v),N=uu(h),P=tu(),F=J.useRef(!1),I=J.useRef(!1),L=J.useRef(!1),R=J.useRef(null),z=J.useRef(``),B=J.useRef(``),V=J.useRef(null),ee=J.useRef(null),H=ct(V,m,P?.beforeInsideRef),U=ct(ee,P?.afterInsideRef),te=Js(),ne=Js(),re=Fs(),ie=P!=null,W=vc(x),G=j((e=W)=>e?El(e):[]),ae=j(()=>_?.().filter(e=>e!=null)??[]);J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(W,tc(Lr(W)))&&G().length===0&&!E&&Ys(e)}return $(Lr(W),`keydown`,e)},[r,W,c,E,G]),J.useEffect(()=>{if(r||!v)return;let e=Lr(W);function t(){L.current=!1}function n(e){let t=rc(e),n=ae(),r=Q(x,t)||Q(y,t)||Q(P?.portalNode,t)||n.some(e=>e===t||Q(e,t));L.current=!r,B.current=e.pointerType||`keyboard`,nc(t,`[data-base-ui-click-trigger]`)&&(I.current=!0,ne.start(0,()=>{I.current=!1}))}function i(){B.current=`keyboard`}return wc($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,x,y,W,v,P,ne,ae]),J.useEffect(()=>{if(r||!l)return;let e=Lr(W);function n(){I.current=!0,ne.start(0,()=>{I.current=!1})}function i(e){let t=rc(e);wl(t)&&(R.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=rc(n);c&&r==null&&a!=null&&Q(x,a)&&vu(a),queueMicrotask(()=>{let o=w(),l=t.context.triggerElements,u=ae(),p=r?.hasAttribute(Il(`focus-guard`))&&[V.current,ee.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ls(f),Ls(d)].includes(r),m=!(Q(y,r)||Q(x,r)||Q(r,x)||Q(P?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||p||N&&(Pl(N.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||Fl(N.nodesRef.current,o).find(e=>[e.context?.elements.floating,vc(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===y&&W&&xu(W),s&&i!==y&&!ul(a)&&tc(e)===e.body){if(b(W)&&(W.focus(),s===`popup`)){re.request(()=>{W.focus()});return}let e=G(),t=R.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;b(n)&&n.focus()}C.current.insideReactTree?C.current.insideReactTree=!1:(E||!c)&&r&&m&&!I.current&&(E||r!==yu())&&(F.current=!0,t.setOpen(!1,ks(Uo,n)))})}function o(){L.current||(C.current.insideReactTree=!0,te.start(0,()=>{C.current.insideReactTree=!1}))}let u=b(y)?y:null;if(x||u)return wc(u&&$(u,`focusout`,a),u&&$(u,`pointerdown`,n),x&&$(x,`focusin`,i),x&&$(x,`focusout`,a),x&&P&&$(x,`focusout`,o,!0))},[r,y,x,W,c,N,P,t,l,s,G,E,w,C,te,ne,re,d,f,ae]),J.useEffect(()=>{if(r||!x||!v)return;let e=Array.from(P?.portalNode?.querySelectorAll(`[${Il(`portal`)}]`)||[]),t=(N?Fl(N.nodesRef.current,w()):[]).find(e=>gc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Yl([x,...e,V.current,ee.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...ae(),t,Ls(f),Ls(d),E?y:null].filter(e=>e!=null),{ariaHidden:c||E,mark:!1}),i=Yl([x,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,x,c,P,E,N,w,d,f,ae]),p(()=>{if(!v||r||!b(W))return;z.current=``,B.current=``;let e=Lr(W),t=tc(e);queueMicrotask(()=>{let n=D.current,r=typeof n==`function`?n(A.current||``):n;if(r===void 0||r===!1||Q(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():Ls(r),o||=a();let s=Q(W,tc(e)),c=C.current.openEvent,l=c?.type===`mousedown`&&Zs(c);Rl(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!M.current)return!1;if(s)return!0;let t=tc(e);return!(t!==o&&Q(W,t))}})})},[r,v,W,G,D,A,M,C]);let oe=J.useRef(null);p(()=>{if(r||!W){oe.current=null;return}oe.current&&=(oe.current.cancelled=!0,null);let e=Lr(W),t=tc(e),n=A.current==null;vu(t);function i(e){if(e.open||(z.current=mu(e.nativeEvent,B.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Il(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(F.current=!0),e.reason===`outside-press`){if(e.nested)F.current=!1;else if(Zs(e.nativeEvent)||Qs(e.nativeEvent))F.current=!1;else{let e=!1;Lr(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?F.current=!1:F.current=!0}}}S.on(`openchange`,i);function a(e){let r=O.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&g(t)!==`body`?t:null,s=n?o||a:a||o;return s||=yu()||null,typeof i==`boolean`?s:Ls(i)||s||null}return()=>{S.off(`openchange`,i);let t=tc(e),n=ae(),r=Q(x,t)||n.some(e=>e===t||Q(e,t))||N&&Pl(N.nodesRef.current,w(),!1).some(e=>Q(e.context?.elements.floating,t)),o=O.current,s=z.current,c=a(s),l={cancelled:!1};oe.current=l,queueMicrotask(()=>{oe.current===l&&(oe.current=null);let n=bu(c),i=k.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!F.current&&b(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}F.current=!1})}},[r,x,W,O,k,A,S,N,y,w,ae]),p(()=>{if(!ps||v||!x)return;let e=tc(Lr(x));b(e)&&mc(e)&&Q(x,e)&&e.blur()},[v,x]),p(()=>{if(!r&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:v,onOpenChange:t.setOpen,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,c,v,t,l,y]),p(()=>{if(!r&&W)return xu(W),()=>{queueMicrotask(_u)}},[r,W]);let se=!r&&(!c||!E)&&(ie||c);return(0,Y.jsxs)(J.Fragment,{children:[se&&(0,Y.jsx)(kc,{"data-type":`inside`,ref:H,onFocus:e=>{if(c){let e=G();Rl(e[e.length-1])}else P?.portalNode&&(F.current=!1,jl(e,P.portalNode)?Ol(y)?.focus():Ls(f??P.beforeOutsideRef)?.focus())}}),n,se&&(0,Y.jsx)(kc,{"data-type":`inside`,ref:U,onFocus:e=>{c?Rl(G()[0]):P?.portalNode&&(l&&(F.current=!0),jl(e,P.portalNode)?kl(y)?.focus():Ls(d??P.afterOutsideRef)?.focus())}})]})}function Cu(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Ro}=t,l=e.context.dataRef,u=J.useRef(void 0),d=Fs(),f=Js(),p=J.useMemo(()=>{function t(t,n,r,i){let a=ks(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=$s(e.pointerType,!0)&&Qs(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||$s(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=rc(s),p=mc(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:$s(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return J.useMemo(()=>n?{reference:p}:it,[n,p])}function wu(){return!1}function Tu(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Eu(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=wu,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=uu(c),m=j(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=j(()=>a),{escapeKey:v,outsidePress:y}=Tu(s),x=J.useRef(!1),S=J.useRef(!1),C=J.useRef(!1),T=J.useRef(!1),E=J.useRef(!1),D=J.useRef(``),O=J.useRef(null),k=Js(),A=Js(),M=Js(),N=j(()=>{A.clear(),d.current.insideReactTree=!1}),P=j(e=>{let t=d.current.floatingContext?.nodeId;return(p?Pl(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),F=j(t=>fc(t,e.select(`floatingElement`))||fc(t,e.select(`domReferenceElement`))),L=j(t=>{o()&&e.setOpen(!1,ks(Ro,t.nativeEvent))}),R=j(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Xs(t)?t.nativeEvent:t;if(E.current||i.isComposing||!v&&P(`__escapeKeyBubbles`))return;let a=ks(Wo,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),z=j(()=>{d.current.insideReactTree=!0,A.start(0,N)}),B=j(t=>{if(!l||!n||t.button!==0)return;let r=rc(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),ee=j(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});J.useEffect(()=>{function e(e){e.open||(T.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),J.useEffect(()=>N,[N]),J.useEffect(()=>{if(!l||!n)return l||(T.current=!1,E.current=!1,D.current=``,O.current=null),N;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new qs,i=Lr(u);function a(){M.clear(),E.current=!0}function o(){E.current=!0,M.start(ps?5:0,()=>{E.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=D.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function A(e){let t=d.current.floatingContext?.nodeId,n=p&&Pl(p.nodesRef.current,t).some(t=>fc(e,t.context?.elements.floating));return F(e)||n}function j(n){if(m(n)){n.type!==`click`&&!F(n)&&(t.clear(),C.current=!1),N();return}if(d.current.insideReactTree){N();return}let r=rc(n),i=`[${Il(`inert`)}]`,a=H(r)?r.getRootNode():null,o=Array.from((w(a)?a:Lr(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=H(r)?r:null;for(;c&&!V(c);){let e=I(c);if(V(e)||!H(e))break;c=e}if(!(o.length&&H(r)&&!pc(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(b(r)&&!(`touches`in n)){let e=V(r),t=ke(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!A(n)){if(f()===`intentional`){if(n.detail!==0&&!Zs(n)&&!T.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof h!=`function`||h(n))&&(P(`__outsidePressBubbles`)||(e.setOpen(!1,ks(Vo,n)),N()))}}}function L(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!F(t)&&j(t)}function z(t){if(f()!==`sloppy`||!e.select(`open`)||!n||F(t))return;let r=t.touches[0];r&&(O.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function B(e,t){let n=rc(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function ee(e){D.current=`touch`,B(e,z)}function U(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(T.current=!0),D.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&B(e,e=>{e.type===`pointerdown`?L(e):j(e)})}function te(e){if(e.type===`pointercancel`&&(T.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():A(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,N())))}function ne(e){if(f()!==`sloppy`||!O.current||F(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(j(e),k.clear(),O.current=null)}function re(e){B(e,ne)}function ie(e){f()===`sloppy`&&O.current&&!F(e)&&(O.current.dismissOnTouchEnd&&j(e),k.clear(),O.current=null)}function W(e){B(e,ie)}let G=wc(r&&wc($(i,`keydown`,R),$(i,`compositionstart`,a),$(i,`compositionend`,o)),g&&wc($(i,`click`,U,!0),$(i,`pointerdown`,U,!0),$(i,`pointerup`,te,!0),$(i,`pointercancel`,te,!0),$(i,`mousedown`,U,!0),$(i,`mouseup`,te,!0),$(i,`touchstart`,ee,{capture:!0,passive:!0}),$(i,`touchmove`,re,{capture:!0,passive:!0}),$(i,`touchend`,W,{capture:!0,passive:!0})));return()=>{G(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,v,y,R,N,_,P,F,p,e,k,M]);let U=J.useMemo(()=>({onKeyDown:R,onPointerDown:L,onClick:L}),[R,L]),te=J.useMemo(()=>({onKeyDown:R,onPointerDown:ee,onMouseDown:ee,onClickCapture:z,onMouseDownCapture(e){z(),B(e)},onPointerDownCapture(e){z(),B(e)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[R,z,B,ee]);return J.useMemo(()=>n?{reference:U,floating:te,trigger:U}:{},[n,U,te])}function Du(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),p(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};H(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Ou(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=j(i),{mounted:c,setMounted:l,transitionStatus:u}=Is(t,!1,!1,o),d=!t&&r;p(()=>{t&&s(!1)},[t,s]);let f=J.useRef(c),m=J.useRef(!1),h=Cs(),g=()=>{f.current=!1,l(!1),a()};p(()=>{f.current=c,m.current&&(m.current=!1,!t&&c&&g())});let _=j(()=>{f.current&&(t?(m.current=!0,h()):g())});return Us({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}var ku={tabIndex:-1,[ic]:``};function Au({handle:e,store:t}){return p(()=>e.attachStore(t),[e,t]),null}function ju(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Mu(e,t){let n=J.useRef(null);return j(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),ju(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),ju(t))})}function Nu(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Pu(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Fu(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Mu(e,n),o=j(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=j(e=>{a(e),e&&o(e)});return p(()=>(s(t.current),()=>s(null)),[s,t,n,e]),p(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Iu(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=J.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);p(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ks(Lo);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Lu(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Ou({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return je(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Ru(e,t){e.useSyncedValues(t),p(()=>()=>{e.update({activeTriggerProps:it,inactiveTriggerProps:it,popupProps:it})},[e])}var zu=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Bu=e((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Vu=e(((e,t)=>{t.exports=Bu()})),Hu=e((e=>{var n=t(),r=Vu();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Uu=e(((e,t)=>{t.exports=Hu()})),Wu=[],Gu=void 0;function Ku(){return Gu}function qu(e){Wu.push(e)}function Ju(e){let t=(t,n)=>{let r=je(Xu).current,i;try{Gu=r;for(let e of Wu)e.before(r);i=e(t,n);for(let e of Wu)e.after(r);r.didInitialize=!0}finally{Gu=void 0}return i};return t.displayName=e.displayName||e.name,t}function Yu(e){return J.forwardRef(Ju(e))}function Xu(){return{didInitialize:!1}}var Zu=Vu(),Qu=i(Uu(),1),$u=K(19)?nd:rd;function ed(e,t,n,r,i){return $u(e,t,n,r,i)}function td(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Zu.useSyncExternalStore)(e.subscribe,a,a)}qu({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Zu.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function nd(e,t,n,r,i){let a=Ku();if(!a)return td(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function rd(e,t,n,r,i){return(0,Qu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var id=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return ed(this,e,t,n,r)}},ad=class extends id{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){J.useDebugValue(e);let n=this;p(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;p(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);p(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){J.useDebugValue(e);let n=this,r=t!==void 0;p(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return J.useDebugValue(e),ed(this,this.selectors[e],t,n,r)}useContextCallback(e,t){J.useDebugValue(e);let n=j(t??lt);this.context[e]=n}useStateSetter(e){let t=J.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},od={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},sd=class extends ad{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:au(),nested:n,triggerElements:i},od),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&ec(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function cd(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new sd({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:it,inactiveTriggerProps:it,popupProps:it}}var ld=e=>e.triggerIdProp??e.activeTriggerId,ud=e=>e.openProp??e.open,dd=e=>(e.popupElement?.id??e.floatingId)||void 0;function fd(e,t){return t!==void 0&&ud(e)&&ld(e)===t}function pd(e,t){return fd(e,t)?!0:t!==void 0&&ud(e)&&ld(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var md={open:ud,mounted:e=>e.mounted,transitionStatus:e=>ud(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:ld,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:dd,isTriggerActive:(e,t)=>t!==void 0&&ld(e)===t,isOpenedByTrigger:(e,t)=>fd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&ld(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>pd(e,t)?dd(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function hd(e){let t=J.useCallback(t=>e===void 0?lt:e.subscribeStore(t),[e]),n=J.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Zu.useSyncExternalStore)(t,n,()=>e?.serverStore)}var gd=ds&&ps;function _d(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=J.useRef(!1),s=J.useRef(null),c=J.useRef(!0),l=Js();J.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=dt(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&b(t)&&t===tc(Lr(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return wc($(r,`blur`,i),gd&&$(r,`keydown`,a,!0),gd&&$(r,`pointerdown`,l,!0))},[e,n]),J.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);H(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=J.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=rc(n.nativeEvent);if(H(a)){if(gd&&!n.relatedTarget){if(!c.current&&!mc(a))return}else if(!_c(a))return}let u=dc(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,ks(Bo,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,ks(Bo,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=H(r)&&r.hasAttribute(Il(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=tc(Lr(t));(r||n!==t)&&(Q(a.current.floatingContext?.refs.floating.current,n)||Q(t,n)||o||dc(r??n,e.context.triggerElements)||e.setOpen(!1,ks(Bo,i)))})}}},[a,r,e,l]);return J.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var vd=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new qs;restTimeout=new qs;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},yd=new WeakMap;function bd(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&yd.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),yd.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function xd(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=yd.get(n);a&&a!==e&&bd(a),bd(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,yd.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Sd(e){let t=e.context.dataRef.current,n=je(()=>t.hoverInteractionState??vd.create()).current;return t.hoverInteractionState||=n,js(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Cd(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=uu(),u=lu(),d=Sd(e),f=Js(),m=j(()=>Sc(c.current.openEvent?.type,d.interactedInside)),h=j(()=>Cc(c.current.openEvent?.type)),g=j(()=>{bd(d)});p(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),J.useEffect(()=>g,[g]),p(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&h()&&H(s)&&o){let e=s,t=o,n=Lr(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??nc(e,`[data-rootownerid]`)??n.body;return xd(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,a,s,o,d,h,l,u,g]),J.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Pl(l.nodesRef.current,u).length>0)}function a(t){let n=bc(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,ks(zo,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=rc(e);hc(t)?d.interactedInside=nc(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function p(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),g()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(dc(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&H(o)&&Pl(l.nodesRef.current,r,!1).some(e=>Q(e.context?.elements.floating,o))||(d.handler?d.handler(n):(g(),h()&&!m()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,ks(zo,n)),l.events.emit(`floating.closed`,n)})}let y=o;return wc(y&&$(y,`mouseenter`,p),y&&$(y,`mouseleave`,_),y&&$(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,h,m,g,d,l,u,f])}var wd={current:null};function Td(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=wd,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=uu(l),v=Sd(e),y=J.useRef(!1),b=Tc(i),x=Tc(r),S=Tc(o),C=Tc(n),w=Tc(p),T=Tc(f),E=j(()=>Sc(h.current.openEvent?.type,v.interactedInside)),D=j(()=>w.current?.()!==!1),O=j((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Q(t,n);if(!H(r))return!1;let a=r;return i.hasMatchingElement(e=>Q(e,a))&&(!t||!Q(t,a))}),k=j(()=>{v.handler&&=(Lr(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=j(()=>{bd(v)});return u&&(v.handleCloseOptions=i?.__options),J.useEffect(()=>k,[k]),J.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===zo,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),J.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=bc(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,ks(zo,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,ks(zo,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!H(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!$s(v.pointerType))return;let n=xc(S.current),r=bc(x.current,`open`,v.pointerType),i=rc(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(H(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Q(t,i)){c=t;break}}H(o)&&H(s)&&!e.context.triggerElements.hasElement(o)&&Q(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&H(c)&&H(s)&&Q(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,ks(zo,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,ks(zo,t,c))}):g&&D()&&e.setOpen(!0,ks(zo,t,c)))}function o(n){if(E()){A();return}k();let r=Lr(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!dc(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else(v.pointerType!==`touch`||!Q(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){Q(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?$(r,`mouseout`,l):void 0;return s?wc($(r,`mousemove`,i,{once:!0}),$(r,`mouseenter`,i),$(r,`mouseleave`,o),f):wc($(r,`mouseenter`,i),$(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),J.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!$s(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;xd(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=xc(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,ks(zo,n,r))}v.pointerType===`touch`?zs.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function Ed(e){return ps&&e.movementX===0&&e.movementY===0}function Dd(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Od(e,t){return Dd(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function kd(e,t,n){return Dd(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Ad(e,t,n){return Dd(t,n?e===oc:e===sc,e===lc)}function jd(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Dd(t,n?e===sc:e===oc,e===cc)}function Md(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:x,resetOnPointerLeave:S=!0,externalTree:C,nestedReturnFocusRef:w,grid:T}=t,E=T!=null,D=e.useState(`open`),O=e.useState(`floatingElement`),k=e.useState(`domReferenceElement`),A=e.context.dataRef,M=vc(O),N=gc(k),P=Tc(M),F=lu(),I=uu(C),L=J.useRef(f),R=J.useRef(o??-1),z=J.useRef(null),B=J.useRef(!0),V=j(e=>{i(R.current===-1?null:R.current,e)}),ee=J.useRef(!!O),H=J.useRef(D),U=J.useRef(!1),te=J.useRef(!1),ne=J.useRef(null),re=Tc(g),ie=Tc(D),W=Tc(o),G=Tc(S),ae=Fs(),oe=Fs(),se=j(()=>{ae.cancel();function e(e){d||(ne.current=Rl(e,{sync:U.current,preventScroll:!0}))}let t=n.current[R.current],r=te.current;t&&e(t),(U.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[R.current]||t;i&&(t||e(i),fe&&(r||!B.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});p(()=>{A.current.orientation=_},[A,_]),p(()=>{D||(z.current=null),(!D||f!==`auto`)&&(L.current=f)},[D,f]),p(()=>{a&&(D&&O?(R.current=o??-1,L.current&&o!=null&&(te.current=!0,V())):ee.current&&(R.current=-1,V()))},[a,D,O,o,V]),p(()=>{if(a){if(!D)U.current=!1;else if(O){if(r==null){if(U.current=!1,W.current!=null)return;if(ee.current&&(R.current=-1,se()),(!H.current||!ee.current)&&L.current&&(z.current!=null||L.current===!0&&z.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(R.current=z.current==null||kd(z.current,v,u)||l?il(n):al(n),z.current=null,V())};t()}}else rl(n.current,r)||(R.current=r,se(),te.current=!1)}}},[a,D,O,r,W,l,n,v,u,V,se,oe]),p(()=>{if(!a||O||!I||d||!ee.current)return;let e=I.nodesRef.current,t=e.find(e=>e.id===F)?.context?.elements.floating,n=tc(Lr(k??t??null)),r=e.some(e=>e.context&&Q(e.context.elements.floating,n));t&&!r&&B.current&&t.focus({preventScroll:!0})},[a,O,k,I,F,d]),p(()=>{H.current=D,ee.current=!!O});let ce=r!=null,le=j(e=>{if(!ie.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(R.current!==t||r!==t)&&(R.current=t,V(e))}),K=j(()=>y??I?.nodesRef.current.find(e=>e.id===F)?.context?.dataRef?.current.orientation),ue=j(()=>il(n,re.current)),de=j(t=>{if(B.current=!1,U.current=!0,t.which===229||!ie.current&&t.currentTarget===P.current)return;if(l&&jd(t.key,_,u,E)){Od(t.key,K())||Ys(t),e.setOpen(!1,ks(Go,t.nativeEvent));let n=w?.current??k;b(n)&&n.focus();return}r!=null&&r!==R.current&&!rl(n.current,r)&&(R.current=r);let i=R.current,a=il(n,g),o=al(n,g);if(N||(t.key===`Home`&&(Ys(t),R.current=a,V(t)),t.key===`End`&&(Ys(t),R.current=o,V(t))),T!=null){let e=T(t,R.current,n,_,c,u,g,a,o);if(e!=null&&e!==R.current&&(R.current=e,V(t)),_===`both`)return}if(Od(t.key,_)){Ys(t);let e=tc(t.currentTarget.ownerDocument);if(D&&!d&&Q(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Q(t,e))){R.current=kd(t.key,_,u)?a:o,V(t),r===R.current&&se();return}let{index:l,wrapped:f}=ol(n.current,i,{decrement:!kd(t.key,_,u),loopFocus:c,allowEscape:s,disabledIndices:g,minIndex:a,maxIndex:o});f&&(U.current=!1),R.current=l,V(t)}}),fe=J.useMemo(()=>({onFocus(e){U.current=!0,le(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Ed(e)||(U.current=!0,te.current=!1,m&&le(e))},onPointerLeave(e){if(!ie.current||!B.current||e.pointerType===`touch`)return;U.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&G.current&&(ne.current?.(),ne.current=null,R.current=-1,V(e),!d)){let e=P.current,t=tc(Lr(e));e&&Q(e,t)&&e.focus({preventScroll:!0})}}}),[le,ie,P,m,n,V,G,d]),pe=J.useMemo(()=>d&&D&&ce&&{"aria-activedescendant":`${x}-${r}`},[d,D,ce,x,r]),me=J.useMemo(()=>({...N?{}:pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&D&&!d){let n=rc(t.nativeEvent);if(n&&!Q(P.current,n))return;Ys(t);let r=ks(Uo,t.nativeEvent);e.setOpen(!1,r);let i=w?.current??k;!r.isCanceled&&b(i)&&i.focus()}else de(t)},onPointerMove(e){Ed(e)||(B.current=!0)}}),[pe,de,P,N,e,D,d,k,w]),he=J.useMemo(()=>{function t(t){e.setOpen(!0,ks(Go,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Zs(e.nativeEvent)&&(L.current=!d)}function r(e){L.current=f,f===`auto`&&Qs(e.nativeEvent)&&(L.current=!0)}return{onKeyDown(n){let r=e.select(`open`);B.current=!1;let i=n.key.startsWith(`Arrow`),a=Ad(n.key,K(),u),o=Od(n.key,r?_:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||mc(n.currentTarget)))return de(n);if(r||h||!i){if(s){let e=Od(n.key,K());z.current=l&&e?null:n.key}l?a&&(Ys(n),r?(R.current=ue(),V(n),d&&P.current?.focus()):t(n)):o&&(W.current!=null&&(R.current=W.current),Ys(n),!r&&h?t(n):de(n),r&&V(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(R.current=-1,V(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[de,f,ue,l,V,e,h,_,v,K,u,W,d,P]),ge=J.useMemo(()=>({...pe,...he}),[pe,he]);return J.useMemo(()=>a?{reference:ge,floating:me,item:fe,trigger:he}:{},[a,ge,me,he,fe])}function Nd(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=j(s),f=e.useState(`open`),m=Js(),h=J.useRef(``),g=J.useRef(u??i??-1),_=J.useRef(null),v=j(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!ul(n)||n?.matches(`:disabled`)?!1:o==null||!cl(oe,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let p=n.current;if(h.current.length>0&&e.key===` `&&(Ys(e),d?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(p,h.current)===-1&&e.key!==` `&&d?.(!1),p==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Ys(e),d?.(!0));let v=h.current===``;v&&(g.current=u??i??-1),p.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(l,()=>{h.current=``,g.current=_.current,d?.(!1)});let y=((v?u??i??-1:g.current)??0)+1,b=c(p,h.current,y);b===-1?e.key!==` `&&(h.current=``,d?.(!1)):(a?.(b,e),_.current=b)}),y=j(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Q(r,n)||Q(i,n)||(m.clear(),h.current=``,g.current=_.current,d?.(!1))});p(()=>{(f||u===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,d?.(!1)))},[f,u,m,d]);let b=J.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return J.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Pd=.1,Fd=Pd*Pd,Id=.5;function Ld(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Rd(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ld(e,t,n,r,i,a)&&(u=!u),Ld(e,t,i,a,o,s)&&(u=!u),Ld(e,t,o,s,c,l)&&(u=!u),Ld(e,t,c,l,n,r)&&(u=!u),u}function zd(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Bd(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Vd(e={}){let{blockPointerEvents:t=!1}=e,n=new qs,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Fd;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=rc(r),g=r.type===`mouseleave`,_=Q(u,h),v=Q(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&H(r.relatedTarget)&&Q(u,r.relatedTarget))return;function y(){return!!(s&&Pl(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Bd(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Bd(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Bd(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Bd(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!zd(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Id/2:Id*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Id+1,o=C||T?S.bottom-Id:S.top,s=C?T?S.bottom-Id:S.top:S.bottom-Id;M=Rd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Id/2:Id*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Id,o=C||T?S.top+Id:S.bottom,s=C?T?S.top+Id:S.bottom:S.top+Id;M=Rd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Id/2:Id*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Id+1,o=w||E?S.right-Id:S.left,s=w?E?S.right-Id:S.left:S.right-Id;M=Rd(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Id/2:Id*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Id,o=w||E?S.left+Id:S.right,s=w?E?S.left+Id:S.right:S.left+Id;M=Rd(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Hd(e,t,n){let{reference:r,floating:i}=e,a=Hc(t),o=Uc(t),s=Vc(o),c=Rc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=zc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ud(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Lc(t,e),p=tl(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=nl(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=nl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Wd=50,Gd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ud},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Hd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Wd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Hd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Kd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Lc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Rc(r),_=Hc(o),v=Rc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[$c(o)]:Gc(o)),x=p!==`none`;!d&&x&&b.push(...Qc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Wc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Hc(t)||T.every(e=>Hc(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Hc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},qd=new Set([`left`,`top`]);async function Jd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rc(n),s=zc(n),c=Hc(n)===`y`,l=qd.has(o)?-1:1,u=a&&c?-1:1,d=Lc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Yd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Jd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Xd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Hc(i),p=Bc(f),m=u[p],h=u[f],g=(e,t)=>Ic(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Zd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Lc(e,t),u={x:n,y:r},d=Hc(i),f=Bc(d),p=u[f],m=u[d],h=Lc(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=qd.has(Rc(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Qd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Lc(e,t),c=await i.detectOverflow(t,s),l=Rc(n),u=zc(n),d=Hc(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ac(p-c[m],g),y=Ac(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*jc(c.left,c.right):S=p-2*jc(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function $d(e){let t=ke(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=b(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Mc(n)!==a||Mc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ef(e){return H(e)?e:e.contextElement}function tf(e){let t=ef(e);if(!b(t))return Pc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$d(t),o=(a?Mc(n.width):n.width)/r,s=(a?Mc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nf=Pc(0);function rf(e){let t=dt(e);return!W()||!t.visualViewport?nf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function af(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===dt(e)}function of(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ef(e),o=Pc(1);t&&(r?H(r)&&(o=tf(r)):o=tf(e));let s=af(a,n,r)?rf(a):Pc(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=dt(a),t=H(r)?dt(r):r,n=e,i=N(n);for(;i&&t!==n;){let e=tf(i),t=i.getBoundingClientRect(),r=ke(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=dt(i),i=N(n)}}return nl({width:u,height:d,x:c,y:l})}function sf(e,t){let n=x(e).scrollLeft;return t?t.left+n:of(k(e)).left+n}function cf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-sf(e,n),y:n.top+t.scrollTop}}function lf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k(r),s=t?C(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Pc(1),u=Pc(0),d=b(r);if((d||!a)&&((g(r)!==`body`||v(o))&&(c=x(r)),d)){let e=of(r);l=tf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?cf(o,c):Pc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function uf(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function df(e){let t=x(e),n=e.ownerDocument.body,r=jc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=jc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+sf(e),o=-t.scrollTop;return ke(n).direction===`rtl`&&(a+=jc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ff=25;function pf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=dt(e),a=k(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!W()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(sf(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ff&&(s-=o)}return{width:s,height:c,x:l,y:u}}function mf(e,t){let n=of(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=tf(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function hf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=pf(e,n,t);else if(t===`document`)r=df(k(e));else if(H(t))r=mf(t,n);else{let n=rf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return nl(r)}function gf(e,t){let n=t.get(e);if(n)return n;let r=T(e,[],!1).filter(e=>H(e)&&g(e)!==`body`),i=null,a=ke(e).position===`fixed`,o=a?I(e):e;for(;H(o)&&!V(o);){let e=ke(o),t=l(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=I(o)}return t.set(e,r),r}function _f(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?C(t)?[]:gf(t,this._c):[].concat(n),r],o=hf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=hf(t,a[e],i);s=jc(n.top,s),c=Ac(n.right,c),l=Ac(n.bottom,l),u=jc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function vf(e){let{width:t,height:n}=$d(e);return{width:t,height:n}}function yf(e,t,n){let r=b(t),i=k(t),a=n===`fixed`,o=of(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Pc(0);if((r||!a)&&((g(t)!==`body`||v(i))&&(s=x(t)),r)){let e=of(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=sf(i));let l=i&&!r&&!a?cf(i,s):Pc(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function bf(e){return ke(e).position===`static`}function xf(e,t){if(!b(e)||ke(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k(e)===n&&(n=n.ownerDocument.body),n}function Sf(e,t){let n=dt(e);if(C(e))return n;if(!b(e)){let t=I(e);for(;t&&!V(t);){if(H(t)&&!bf(t))return t;t=I(t)}return n}let r=xf(e,t);for(;r&&Ke(r)&&bf(r);)r=xf(r,t);return r&&V(r)&&bf(r)&&!l(r)?n:r||D(e)||n}var Cf=async function(e){let t=this.getOffsetParent||Sf,n=this.getDimensions,r=await n(e.floating);return{reference:yf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wf(e){return ke(e).direction===`rtl`}var Tf={convertOffsetParentRelativeRectToViewportRelativeRect:lf,getDocumentElement:k,getClippingRect:_f,getOffsetParent:Sf,getElementRects:Cf,getClientRects:uf,getDimensions:vf,getScale:tf,isElement:H,isRTL:wf};function Ef(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Df(e,t,n){let r=null,i,a=k(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Nc(d),h=Nc(a.clientWidth-(u+f)),g=Nc(a.clientHeight-(d+p)),_=Nc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:jc(0,Ac(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ef(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=dt(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Of(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ef(e),u=i||a?[...l?T(l):[],...t?T(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Df(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?of(e):null;c&&g();function g(){let t=of(e);h&&!Ef(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var kf=Yd,Af=Xd,jf=Kd,Mf=Qd,Nf=Zd,Pf=(e,t,n)=>{let r=new Map,i=n??{},a={...Tf,...i.platform,_c:r};return Gd(e,t,{...i,platform:a})},Ff=typeof document<`u`?J.useLayoutEffect:function(){};function If(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!If(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!If(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Lf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rf(e,t){let n=Lf(e);return Math.round(t*n)/n}function zf(e){let t=J.useRef(e);return Ff(()=>{t.current=e}),t}function Bf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);If(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=zf(c),D=zf(i),O=zf(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Pf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!If(w.current,t)&&(w.current=t,zs.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Ff(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);Ff(()=>(A.current=!0,()=>{A.current=!1}),[]),Ff(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Rf(M.floating,u.x),r=Rf(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Lf(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Vf=(e,t)=>{let n=kf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hf=(e,t)=>{let n=Af(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uf=(e,t)=>({fn:Nf(e).fn,options:[e,t]}),Wf=(e,t)=>{let n=jf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gf=(e,t)=>{let n=Mf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kf=J.createContext(void 0);function qf(e){let t=J.useContext(Kf);if(t===void 0&&!e)throw Error(B(69));return t}var Jf=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function Yf(e){return e===`starting`?Xl:it}var Xf=J.createContext(void 0);function Zf(){return J.useContext(Xf)}function Qf(e,t){let n=we(e.render);if(J.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function $f(e,t,n){let r=Qf(e,t),i=r===t?void 0:r;return[r,J.useCallback(e=>n?.(e?i:void 0),[i,n])]}function ep(e,t,n){let r=we(e.render),i=J.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var tp=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=vo(),m=Zf(),{side:h,align:g}=go(),_=qf(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=$f(e,u,d),L=ep(e,C,N),R=w.type===`menu`?m:void 0,z=w.type===`context-menu`,B=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(B=()=>l.state.activeIndex===null&&P),Us({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){l.setOpen(!1,ks(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),Cd(D,{enabled:A&&!j&&!z&&w.type!==`menubar`,closeDelay:k});let V=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ee,handleFocus:H}=(J.useContext(Zo)?.useParentHandoff??rp)(l,w,v,f),U={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},te=Se(`div`,e,{state:U,ref:[t,l.context.popupRef,V,I],stateAttributesMapping:Po,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&Jf.has(e.key)&&e.stopPropagation()},onFocus:H},Yf(y),c,{"data-rootownerid":E}]}),ne=w.type===void 0||z;(C||w.type===`menubar`&&T!==`outside-press`)&&(ne=!0);let re=R?.getReturnElement??ee;return(0,Y.jsx)(Su,{context:D,openInteractionType:M,modal:z,disabled:!x,returnFocus:a??re??ne,explicitReturnFocus:a===void 0&&re?!1:void 0,initialFocus:B,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:te})}),np={parentVirtualFocusRef:void 0,handleFocus:void 0};function rp(){return np}var ip=J.forwardRef(function(e,t){let n=Qo()?.Popup??tp;return(0,Y.jsx)(n,{...e,ref:t})}),ap=J.createContext(void 0);function op(){let e=J.useContext(ap);if(e===void 0)throw Error(B(32));return e}var sp=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=vo();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Y.jsx)(ap.Provider,{value:n,children:(0,Y.jsx)(iu,{ref:t,...r,portalOwnerRole:o})})});function cp(e){return K(19)?e:e?`true`:void 0}function lp(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=J.useState(null),d=J.useRef(null),f=uu(n),m=J.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),h=Bf({...e,elements:{...m,...l&&{reference:l}}}),g=J.useCallback(e=>{let t=H(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=J.useMemo(()=>({...h.refs,setPositionReference:g,domReference:d}),[h.refs,g]),v=J.useMemo(()=>({...h.elements,domReference:o}),[h.elements,o]),y=J.useMemo(()=>({...h,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,s,c]);return p(()=>{o&&(d.current=o)},[o]),p(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),J.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var up=J.createContext(void 0);function dp(){return J.useContext(up)?.direction??`ltr`}var fp=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Lc(e,t)||{};if(l==null)return{};let d=tl(u),f={x:n,y:r},p=Uc(i),m=Vc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Ic(D,k,O),j=!c.arrow&&zc(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),pp=(e,t)=>{let{name:n,fn:r}=fp(e);return{name:n,fn:r,options:[e,t]}},mp={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},hp={sideX:`left`,sideY:`top`},gp=`--available-width`,_p=`--available-height`,vp=`--anchor-width`,yp=`--anchor-height`,bp=`--transform-origin`,xp=gp,Sp=_p;function Cp(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function wp(e,t,n){let{rects:r,placement:i}=e;return{side:Cp(t,Rc(i),n),align:zc(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Tp(e){return Ep(e,lp)}function Ep(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=j(k),M=k?A:n,N=Tc(n),P=Tc(_),F=dp()===`rtl`,[I,L]=J.useState(null);!_&&I!==null&&L(null);let R=S===`placement`,z=I?Rc(I):null,B=I&&R?zc(I)||`center`:null,V=z||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],ee=B||o,H=ee===`center`?V:`${V}-${ee}`,U=l;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let te=+(i===`bottom`),ne=+(i===`top`),re=+(i===`right`),ie=+(i===`left`),W={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:U},G=J.useRef(null),ae=Tc(a),oe=Tc(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];m&&le.push(m),le.push(Vf(e=>{let t=wp(e,i,F),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,F,i]));let K=T===`none`&&w!==`shift`,ue=!K&&(u||D||w===`shift`),de=w===`none`?null:Wf({...W,padding:{top:U.top+1+te,right:U.right+1+ie,bottom:U.bottom+1+ne,left:U.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),fe=K?null:Hf({...W,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ue,limiter:u||D?void 0:Uf(e=>{if(!G.current)return{};let{width:t,height:n}=G.current.getBoundingClientRect(),r=Hc(Rc(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[W,u,D,O,U,T]);w===`shift`||T===`shift`||ee===`center`?le.push(fe,de):le.push(de,fe),le.push(Gf({...W,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(xp,`${t}px`),i.setProperty(Sp,`${n}px`);let a=dt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(vp,`${u}px`),i.setProperty(yp,`${d}px`)}}),pp(e=>({element:G.current||Lr(e.elements.floating).createElement(`div`),padding:G.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Rc(r),u=zc(r),d=Hc(l)===`y`,f=G.current,p=typeof a==`function`?a(wp(e,i,F)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(bp,d?`${m} ${h}`:`${h} ${m}`),{}}},mp,x),p(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=J.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:g,open:h?_:void 0,placement:H,middleware:le,strategy:r,whileElementsMounted:h?void 0:(...e)=>Of(...e,pe),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||hp,Ee=Se?r:`fixed`,De=J.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[xp]=`100vw`,e[Sp]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,ge,Te,_e,Ce,Se]),Oe=J.useRef(null);p(()=>{if(!_)return;let e=N.current,t=typeof e==`function`?e():e,n=(Dp(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[_,me,M,N]),J.useEffect(()=>{if(!_)return;let e=N.current;typeof e!=`function`&&Dp(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[_,me,M,N]),J.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return Of(he.reference,he.floating,ye,pe)},[h,_,he,ye,pe]);let ke=Rc(be),Ae=Cp(i,ke,F),je=zc(be)||`center`,Me=!!ve.hide?.referenceHidden;p(()=>{S&&_&&Se&&(ke!==V||R&&je!==ee)&&L(be)},[S,R,_,Se,be,ke,je,V,ee]);let Ne=J.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:G,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,G,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function Dp(e){return e!=null&&`current`in e}function Op(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=j(i),[,o]=J.useState(0),s=je(Ap).current,c=je(kp).current,l=J.useRef(0),u=J.useRef(!0),d=J.useRef(null),f=J.useRef(null),m=j(()=>{u.current||(u.current=!0,o(e=>e+1))}),h=j((e,t)=>{c.set(e,t),m()}),g=j(e=>{c.delete(e),m()}),_=j(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function v(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Np(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Pp(r,n)>0){t.disconnect(),m();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Mp(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=j(()=>{let[e,t]=jp(c),n=_(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});p(()=>(!u.current&&d.current&&_(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,_]),p(()=>{u.current&&y()}),p(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=j(e=>(s.add(e),()=>{s.delete(e)})),x=J.useMemo(()=>({register:h,unregister:g,subscribeMapChange:b,nextIndexRef:l}),[h,g,b,l]);return(0,Y.jsx)(bs.Provider,{value:x,children:t})}function kp(){return new Map}function Ap(){return new Set}function jp(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Pp(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Mp(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Np(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Pp(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Fp=J.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Ip(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=J.useRef(null),o=J.useRef(null),s=Hs(r);p(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),p(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function Lp(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Se(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Yf(r),i],stateAttributesMapping:No})}var Rp={},zp={},Bp=``;function Vp(e,t){return v(e)?e:t}function Hp(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Vp(t,n)).overflowY)}function Up(e){if(typeof document>`u`)return!1;let t=Lr(e);return dt(t).innerWidth-t.documentElement.clientWidth>0}function Wp(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Lr(e),n=t.documentElement,r=t.body,i=Vp(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Gp(e){let t=Lr(e),n=t.documentElement,r=t.body,i=Vp(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Kp(e){let t=Lr(e),n=t.documentElement,r=t.body,i=dt(n),a=0,o=0,s=!1,c=Ps.create();if(ps&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Rp={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Bp=n.style.scrollBehavior,zp={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Vp(n,r);s=Wp(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Rp),Object.assign(r.style,zp),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Bp)}function d(){u(),c.request(l)}l();let f=$(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var qp=new class{lockCount=0;restore=null;timeoutLock=qs.create();timeoutUnlock=qs.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Lr(e),n=t.documentElement,r=t.body,i=dt(n);if(Hp(i,n,r)){let t=new i.MutationObserver(()=>{Hp(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=cs||!Up(e);this.restore=a?Gp(e):Kp(e)}};function Jp(e=!0,t=null){p(()=>{if(e)return qp.acquire(t)},[e,t])}var Yp=20;function Xp(e,t,n,r){let[i,a]=J.useState(!1);p(()=>{if(!e||!t||n==null){a(!1);return}let r=Lr(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Yp)},[e,t,n]),Jp(e&&(!t||i),r)}var Zp=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Zl,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=vo(),x=op(),S=Io(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),z=n,B=c,V=l,ee=s,H=h;C.type===`context-menu`&&(z=n??C.context?.anchor,ee??=`start`,!o&&ee!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let U=o,te=ee;C.type===`menu`?(U??=`inline-end`,te??=`start`,H=e.collisionAvoidance??Ql):C.type===`menubar`&&(U??=C.context.orientation===`vertical`?`inline-end`:`bottom`,te??=`start`);let ne=C.type===`context-menu`,re=Tp({anchor:z,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:U,sideOffset:B,align:te,alignOffset:V,arrowPadding:ne?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:H,shift:ne?{crossAxis:!(`side`in H&&H.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});J.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,ks(Yo)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),J.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,ks(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ie=Js();J.useEffect(()=>{D||ie.clear()},[D,ie]),J.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?ie.isStarted()||ie.start(e,()=>{v.setOpen(!1,ks(Yo))}):v.setOpen(!1,ks(Yo))}else ie.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ie]),J.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),Ip({store:v,domReference:R,positionerElement:M,open:D});let W={open:D,side:re.side,align:re.align,anchorHidden:re.anchorHidden,nested:C.type===`menu`,instant:N},G=C.type===`menubar`&&C.context.modal;Xp(D&&(G||O&&F!==`trigger-hover`),k===`touch`,M,A);let ae=Lp(e,W,{styles:re.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),oe=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),se=null;return C.type===`menubar`?se=C.context.contentElement:C.type===void 0&&(se=A),(0,Y.jsxs)(ho.Provider,{value:re,children:[oe&&(0,Y.jsx)(Fp,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:cp(!D),cutout:se}),(0,Y.jsx)(fu,{id:I,children:(0,Y.jsx)(Op,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:ae})})]})}),Qp=J.createContext(null);function $p(e){let t=J.useContext(Qp);if(t===null&&!e)throw Error(B(5));return t}function em(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function tm(e,t){let n=J.useRef(e),r=j(t);p(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function nm(e,t){let{onClick:n,onPointerDown:r}=em(j((n,r)=>{(typeof e==`function`?e():e)||t(r||(cs?`touch`:``))}));return J.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function rm(e){let[t,n]=J.useState(null),r=nm(e,n);return tm(e,t=>{t&&!e&&n(null)}),J.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function im(e){return e==null?Lo:e.type.startsWith(`key`)?Ko:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?qo:Lo}var am={...md,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=md.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>ps&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!md.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},om=class extends ad{constructor(e,t,n=!1){let r=new zu,i=cm(r,t,n,e);super(i,sm(r),am),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function sm(e){return{positionerRef:J.createRef(),popupRef:J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:J.createRef(),beforeTriggerFocusGuardRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function cm(e,t,n=!1,r){return{...cd(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:it,inputProps:it,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ou,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:it,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var lm=J.createContext(null);function um(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function dm(e,t){return e===`list-navigation`||um(e,t)}var fm=Ju(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:m,triggerId:g,defaultTriggerId:_=null,highlightItemOnHover:v=!0,isSubmenu:y=!1,virtualFocus:b=!1,virtualFocusRef:x,allowEscape:S=!0,resetOnPointerLeave:C=!0}=e,w=Io(!0),T=vo(!0),E=$p(!0),D=T?.store,O=T?.virtualFocus??!1,k=J.useMemo(()=>y&&D?{type:`menu`,store:D}:E?{type:`menubar`,context:E}:w&&!D?{type:`context-menu`,context:w}:{type:void 0},[w,D,E,y]),A=Os(),M=Os(),[N,P]=J.useState(void 0),F=(N??M)||void 0,I=lu(),L=k.type===`menu`?k.store:void 0,R=(n??o)&&L?.state.transitionStatus===`starting`,z=je(()=>R?L?.state.instantType:void 0).current,B=je(()=>{let e=new om({open:o,openProp:n,activeTriggerId:_,triggerIdProp:g,parent:k,disabled:s,highlightItemOnHover:v,modal:k.type===void 0?c:void 0,rootId:A,instantType:z},F,I!=null);return e.context.virtualFocusRef=x,e}).current;B.useControlledProp(`openProp`,n),B.useControlledProp(`triggerIdProp`,g),B.useContextCallback(`onOpenChangeComplete`,i);let V=B.useState(`floatingTreeRoot`),ee=du(V),H=B.useState(`open`),U=B.useState(`activeTriggerElement`),te=B.useState(`positionerElement`),ne=B.useState(`hoverEnabled`),re=B.useState(`disabled`),ie=B.useState(`lastOpenChangeReason`),W=B.useState(`parent`),G=B.useState(`activeIndex`),ae=B.useState(`keyboardOpen`),se=B.useState(`payload`),ce=B.useState(`floatingParentNodeId`),le=J.useRef(null),K=J.useRef(W.type!==`context-menu`),ue=Js(),de=J.useRef(!0),fe=Js(),pe=ce!=null,{openMethod:me,triggerProps:he}=rm(H);B.useSyncedValues({disabled:s,highlightItemOnHover:v,modal:W.type===void 0?c:void 0,openMethod:me,rootId:A}),Iu(B);let{forceUnmount:ge,transitionStatus:_e}=Lu(H,B,()=>{B.set(`allowMouseEnter`,!1)},R),ve=Hs(B.context.popupRef);J.useEffect(()=>{if(z===void 0)return;let e=()=>{B.state.instantType===z&&B.set(`instantType`,void 0)};if(!H){e();return}if(_e!==void 0)return;if(B.context.popupRef.current==null){e();return}let t=new AbortController;return ve(e,t.signal),()=>{t.abort()}},[z,H,_e,ve,B]),p(()=>{w&&!T?B.update({parent:{type:`context-menu`,context:w},floatingNodeId:ee,floatingParentNodeId:I}):(T||!B.select(`activeTriggerElement`))&&B.update({floatingNodeId:ee,floatingParentNodeId:I})},[w,T,ee,I,U,B]),J.useEffect(()=>{H||(le.current=null),W.type===`context-menu`&&(H?ue.start(500,()=>{K.current=!0}):(ue.clear(),K.current=!1))},[ue,H,W.type]),p(()=>{!H&&!ne&&B.set(`hoverEnabled`,!0)},[H,ne,B]);let ye=j((e,t)=>{let n=t.reason;if(!e&&!B.select(`open`)||H===e&&t.trigger===U&&ie===n)return;let i=Pu(t);if(!e&&t.trigger==null&&(t.trigger=U??void 0),r?.(e,t),t.isCanceled)return;B.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!de.current)return;e&&n===`trigger-focus`?(de.current=!1,fe.start(300,()=>{de.current=!0})):(de.current=!0,fe.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=Nu(B.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&dm(n,a),s.instantType=W.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:um(n,a)?`click`:o?`dismiss`:void 0,B.update(s)}),be=Du({popupStore:B,floatingRootContext:B.state.floatingRootContext,floatingId:F,nested:I!=null,onOpenChange:ye}),xe=be.context.events;p(()=>{let e=({open:e,eventDetails:t})=>ye(e,t);return xe.on(`setOpen`,e),()=>{xe?.off(`setOpen`,e)}},[xe,ye]),p(()=>B.subscribeToParentMenu(),[B]);let Se=J.useCallback(()=>{B.setOpen(!1,ks(Xo))},[B]);J.useImperativeHandle(d,()=>({unmount:ge,close:Se}),[ge,Se]);let Ce;W.type===`context-menu`&&(Ce=W.context),J.useImperativeHandle(Ce?.positionerRef,()=>te,[te]),J.useImperativeHandle(Ce?.actionsRef,()=>({setOpen:ye}),[ye]);let we=Eu(be,{enabled:!re,bubbles:{escapeKey:f&&W.type===`menu`},outsidePress(){return W.type!==`context-menu`||le.current?.type===`contextmenu`||K.current},externalTree:pe?V:void 0}),Te=dp(),Ee=Md(be,{enabled:!re,listRef:B.context.itemDomElements,activeIndex:G,virtual:b,nested:W.type===`menubar`||!b&&W.type!==void 0,parentOrientation:W.type===`menubar`?W.context.orientation:void 0,loopFocus:l,focusItemOnOpen:b?ae:void 0,allowEscape:b&&l&&S,orientation:u,triggerOrientation:b?`vertical`:u,rtl:Te===`rtl`,disabledIndices:oe,onNavigate(e,t){B.setActiveIndex(e,im(t),t?.nativeEvent)},openOnArrowKeyDown:W.type!==`context-menu`&&!(b&&y),externalTree:!b&&pe?V:void 0,nestedReturnFocusRef:L?.context.virtualFocusRef,focusItemOnHover:v,resetOnPointerLeave:C}),De=J.useCallback(e=>{B.context.typingRef.current=e},[B]),Oe=Nd(be,{enabled:!re&&!b,listRef:B.context.itemLabels,elementsRef:B.context.itemDomElements,activeIndex:G,resetMs:500,onMatch:(e,t)=>{H&&e!==G&&B.setActiveIndex(e,Ko,t.nativeEvent)},onTyping:De}),ke=j(a),Ae=J.useRef(-1),Me=j(()=>{let e=B.state.activeIndex,t=e===null?void 0:B.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ae.current===n&&B.context.reportedItem===t)return;Ae.current=n,B.context.reportedItem=t,b&&B.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=B.context;B.context.highlightReason=Lo,B.context.highlightEvent=void 0,a&&ke(t,As(r,i,{label:t===void 0?void 0:B.context.itemLabels.current[n]??void 0}))});p(()=>{Me()},[G,Me]);let Ne=J.useMemo(()=>{if(!b)return Ee.reference;if(!Ee.trigger)return it;let{onFocus:e,...t}=Ee.trigger;return t},[b,Ee.reference,Ee.trigger]);B.useSyncedValue(`inputProps`,b?Ee.reference??it:it);let Pe=J.useMemo(()=>{let e=h(Oe.reference,Ne,we.reference,{onMouseMove(){B.set(`allowMouseEnter`,!0)}},he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=H,e},[B,Oe.reference,Ne,we.reference,he,H]),Fe=J.useMemo(()=>{let e=h(Ee.trigger,we.trigger,he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ee.trigger,we.trigger,he]);je(()=>(B.update({inactiveTriggerProps:Fe}),null)),Ru(B,{floatingRootContext:be,activeTriggerProps:Pe,inactiveTriggerProps:Fe,popupProps:J.useMemo(()=>h(ku,{onMouseMove(){B.set(`allowMouseEnter`,!0),W.type===`menu`&&B.set(`hoverEnabled`,!1)},onClick(){B.select(`hoverEnabled`)&&B.set(`hoverEnabled`,!1)},onKeyDown(e){let t=B.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Oe.floating,Ee.floating,we.floating),[W.type,B,Oe.floating,Ee.floating,we.floating]),itemProps:Ee.item??it});let Ie=J.useMemo(()=>({store:B,parent:k,orientation:u,loopFocus:l,allowEscape:S,defaultFloatingId:M,setRenderedFloatingId:P,virtualFocus:b,parentVirtualFocus:O,syncHighlightedItem:Me}),[B,k,u,l,S,M,b,O,Me]),Le=typeof t==`function`?t({payload:se}):t,Re=(0,Y.jsxs)(_o.Provider,{value:Ie,children:[m&&(0,Y.jsx)(Au,{handle:m,store:B}),Le]});return(W.type===void 0||W.type===`context-menu`)&&(Re=(0,Y.jsx)(pu,{externalTree:V,children:Re})),Re});function pm(e){let t=J.useContext(lm);if(t===null)return(0,Y.jsx)(fm,{...e});let n=t.Root;return(0,Y.jsx)(lm.Provider,{value:null,children:(0,Y.jsx)(n,{...t.options,...e})})}var mm=5;function hm(e,t){let n=gm(t);return e.clientX>=n.left-mm&&e.clientX<=n.right+mm&&e.clientY>=n.top-mm&&e.clientY<=n.bottom+mm}function gm(e){let t=e.getBoundingClientRect(),n=dt(e);if(hs)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function _m(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=ot(),{ref:i,index:a}=Ss(e),o=n===a,s=J.useRef(null),c=ct(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function vm(e){let{render:t,className:n,style:r,state:i=it,props:a=oe,refs:o=oe,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=_m({metadata:s});return Se(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function ym(e){if(b(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!V(e))return ym(I(e))}function bm(e,t){function n(n,r,i){let a=n.currentTarget;zs.flushSync(()=>{e.setOpen(!1,ks(Uo,n.nativeEvent,a))}),Al(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&jl(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function xm(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Lr(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:it,[t,n,r])}var Sm=Yu(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=vo(!0),g=hd(d)??m?.store;if(!g)throw Error(B(85));let _=Os(s),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerControlsId`,_),S=J.useRef(null),C=wm(),w=ot(!0),T=uu(),E=J.useMemo(()=>T??new ou,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=Fu(_,S,g,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:du(E),floatingParentNodeId:lu(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=g.useState(`disabled`),M=a||A||k&&C.context.disabled,{getButtonProps:N,buttonRef:P}=R({disabled:M,native:o});J.useEffect(()=>{!b&&C.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,b,C.type]);let F=J.useRef(null),I=Js(),L=j(e=>{if(!F.current)return;I.clear(),g.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Q(F.current,t)||Q(g.select(`positionerElement`),t)||t===F.current||(t==null||ym(t)!==g.select(`rootId`))&&(hm(e,F.current)||E.events.emit(`close`,{domEvent:e,reason:Jo}))});J.useEffect(()=>{let e=Lr(F.current);if(b&&g.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[b,L,g]);let z=k&&C.context.hasSubmenuOpen,V=Td(y,{enabled:(c??z)&&!M&&(!k||z&&!O),handleClose:Vd({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),ee=Cm(b,g.select(`lastOpenChangeReason`)),H=Cu(y,{enabled:!M,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&ee}),U=_d(y,{enabled:!M&&z}),te=xm({open:b,enabled:k,mouseDownAction:`open`}),ne=J.useMemo(()=>h(U.reference,H.reference),[U.reference,H.reference]),re=g.useState(`triggerProps`,O),ie=g.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:W,handleFocusTargetFocus:G}=bm(g,S),ae={disabled:M,open:b},oe=[F,t,P,D,S],se=[ne,V??it,re,{"aria-haspopup":`menu`,"aria-controls":x,id:_,onMouseDown:e=>{g.select(`open`)||(I.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),Lr(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},ie,k?{role:`menuitem`}:{},te,p,N],ce=Se(`button`,e,{enabled:!k,stateAttributesMapping:Z,state:ae,ref:oe,props:se});return k?(0,Y.jsx)(vm,{tag:`button`,render:n,className:r,style:i,state:ae,refs:oe,props:se,stateAttributesMapping:Z}):b?(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(kc,{ref:g.context.beforeTriggerFocusGuardRef,onFocus:W},`${_}-pre-focus-guard`),(0,Y.jsx)(J.Fragment,{children:ce},_),(0,Y.jsx)(kc,{ref:g.context.triggerFocusTargetRef,onFocus:G},`${_}-post-focus-guard`)]}):(0,Y.jsx)(J.Fragment,{children:ce},_)});function Cm(e,t){let n=Js(),[r,i]=J.useState(!1);return p(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function wm(){let e=$p(!0);return J.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function Tm({label:e,actions:t}){let n=(0,J.useSyncExternalStore)(Dt,Ct),r=n===`unreachable`||n===`retrying`;return(0,Y.jsxs)(pm,{children:[(0,Y.jsx)(Sm,{"aria-label":e,title:`More actions`,className:Ie({variant:`outline`,size:`icon-xs`}),children:(0,Y.jsx)(Mn,{})}),(0,Y.jsx)(sp,{children:(0,Y.jsx)(Zp,{side:`bottom`,align:`end`,sideOffset:4,className:`z-50`,children:(0,Y.jsx)(ip,{"aria-label":e,finalFocus:()=>!(document.activeElement instanceof HTMLElement&&document.activeElement.matches(`input, textarea, select`)),className:`flex min-w-44 flex-col rounded-lg border bg-popover p-1 text-sm text-popover-foreground shadow-lg outline-none`,children:t.map(e=>(0,Y.jsxs)(Gs,{"aria-label":e.ariaLabel,title:e.title,disabled:e.disabled||e.changesData&&r,onClick:e.onSelect,className:a(`flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-muted max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0`,e.destructive?`text-destructive data-[highlighted]:bg-destructive/10 dark:data-[highlighted]:bg-destructive/20`:`[&_svg]:text-muted-foreground`),children:[e.icon,e.label]},e.key))})})})]})}var Em=/^\s*(```|~~~)/,Dm=/^\s*([-*_])(\s*\1){2,}\s*$/,Om=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/,km=/^\s*(>\s*)*(#{1,6}\s+|[-*+]\s+|\d+[.)]\s+)?(\[[ xX]\]\s+)?/;function Am(e){return e.replace(/!?\[([^\]]*)\]\((?:[^()]|\([^()]*\))*\)/g,`$1`).replace(/<((?:https?|mailto):[^>\s]+)>/g,`$1`).replace(/`+/g,``).replace(/(\*\*|__|~~)(?=\S)(.+?)(?<=\S)\1/g,`$2`).replace(/(?<![\w*])([*_])(?=[^\s*_])(.+?)(?<=[^\s*_])\1(?![\w*])/g,`$2`).replace(/\s*\|\s*/g,` `)}var jm=/^\s*#{1,6}(\s|$)/;function Mm(e){let t=[],n=!1;for(let r of e.split(/\r?\n/))if(Em.test(r)){if(n=!n,t.length>0)break}else if(!n){if(r.trim()===``||jm.test(r)||Dm.test(r)){if(t.length>0)break}else t.push(r)}return Nm(t.join(`
|
|
11
|
-
`))}function Nm(e){return e.split(/\r?\n/).filter(e=>!Em.test(e)&&!Dm.test(e)&&!Om.test(e)).map(e=>Am(e.replace(km,``))).join(` `).replace(/\s+/g,` `).trim()}function Pm(e,t,n=!1){let[r,i]=(0,J.useState)(!1),a=(0,J.useRef)(null),o=()=>{e?(a.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i(!0)):t()},s=e=>{let t=a.current;t?.isConnected&&t.matches(`input, textarea, select`)?t.focus():(e instanceof Element?e.closest(`form`):null)?.querySelector(`textarea, input:not([type=checkbox]), select`)?.focus(),i(!1)};return{asking:r,request:o,keep:s,discard:()=>{i(!1),t()},onKeyDown:e=>{e.key!==`Escape`||n||e.defaultPrevented||(e.preventDefault(),r?s(e.target):o())}}}function Fm({label:e,question:t,onKeep:n,onDiscard:r}){return(0,Y.jsxs)(`div`,{role:`group`,"aria-label":e,className:`flex flex-wrap items-center gap-1 text-xs max-md:gap-2`,children:[(0,Y.jsx)(`span`,{className:`mr-1`,children:t}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`outline`,autoFocus:!0,onClick:e=>n(e.currentTarget),children:`Keep editing`}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`destructive`,onClick:r,children:`Discard changes`})]})}var Im=(0,J.lazy)(()=>Za(()=>import(`./markdown-akFj_lY_.js`),__vite__mapDeps([0,1,2])));function Lm({label:e,value:t,onChange:n,placeholder:r,className:i}){let[o,s]=(0,J.useState)(!1),c=(0,J.useId)();return(0,Y.jsxs)(`div`,{className:a(`flex min-w-0 flex-col gap-1 max-md:gap-2`,i),children:[(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Mode of ${e}`,className:`flex gap-0.5 max-md:gap-2`,children:[(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:o?`ghost`:`default`,"aria-pressed":!o,onClick:()=>s(!1),children:`Write`}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:o?`default`:`ghost`,"aria-pressed":o,onClick:()=>s(!0),children:`Preview`})]}),o?(0,Y.jsx)(`div`,{role:`region`,"aria-label":`Preview of ${e}`,className:`min-h-16 rounded-lg border border-input px-2.5 py-1.5`,children:t.trim()?(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:t}),children:(0,Y.jsx)(Im,{source:t})}):(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview`})}):(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 resize-y py-1.5 max-md:h-auto`),rows:3,placeholder:r,"aria-label":e,"aria-describedby":c,value:t,onChange:e=>n(e.target.value)}),(0,Y.jsx)(`p`,{id:c,className:`text-xs text-muted-foreground`,children:`Markdown supported`})]})}function Rm(e){let t=Hi(e.estimate);return t===null?null:Number.isNaN(t)?void 0:{unit:e.estimateUnit,amount:t}}function zm({suffix:e,plan:t,onChange:n,autoFocus:r}){let i=Rm(t)===void 0;return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,Y.jsxs)(`label`,{className:`flex items-center gap-1`,children:[`Estimate`,(0,Y.jsx)(`input`,{className:a(ft,`w-20`),inputMode:`decimal`,placeholder:`Optional`,"aria-label":`Estimate${e}`,"aria-invalid":i,autoFocus:r===`estimate`,title:`Optional: expected size, a number greater than 0`,value:t.estimate,onChange:e=>n({...t,estimate:e.target.value})})]}),(0,Y.jsxs)(`select`,{"aria-label":`Estimate unit${e}`,className:a(_t,`w-24`),value:t.estimateUnit,onChange:e=>n({...t,estimateUnit:e.target.value}),children:[(0,Y.jsx)(`option`,{value:`hours`,children:`hours`}),(0,Y.jsx)(`option`,{value:`days`,children:`days`}),(0,Y.jsx)(`option`,{value:`weeks`,children:`weeks`}),(0,Y.jsx)(`option`,{value:`months`,children:`months`})]}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-1`,children:[`Due`,(0,Y.jsx)(`input`,{type:`date`,className:a(ft,`w-40`),"aria-label":`Due date${e}`,autoFocus:r===`dueDate`,value:t.dueDate,onChange:e=>n({...t,dueDate:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`flex min-w-48 flex-1 items-center gap-1`,children:[`Labels`,(0,Y.jsx)(`input`,{className:ft,placeholder:`Optional, comma-separated`,"aria-label":`Labels${e}`,title:`Optional: projects or goals, separated by commas, that reviews filter by`,value:t.labels,onChange:e=>n({...t,labels:e.target.value})})]})]})}var Bm={manual:`Manual`,url:`URL responds`},Vm=[`manual`,`url`];function Hm(e){return e===`url`}var Um=0;function Wm(e){if(Um+=1,e===void 0)return{key:Um,id:null,text:``,kind:`manual`,target:``};let t=Hm(e.kind)?e.target??``:``;return{key:Um,id:e.id,text:e.text,kind:e.kind,target:t}}function Gm(e){return e.filter(e=>e.text.trim()!==``).map(e=>({...e.id===null?{}:{id:e.id},text:e.text.trim(),kind:e.kind,target:Hm(e.kind)?e.target.trim():null}))}function Km(e){if(e.text.trim()===``)return null;let t=e.target.trim();return e.kind===`url`&&!/^https?:\/\/\S*$/.test(t)?`Enter an http:// or https:// URL`:null}function qm({criteria:e,onChange:t,taskId:n}){let[r,i]=(0,J.useState)(null),o=n===void 0?``:` of #${n}`,s=(n,r)=>t(e.map(e=>e.key===n?{...e,...r}:e));function c(){let n=Wm();i(n.key),t([...e,n])}return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1 max-md:gap-2`,children:[e.length>0&&(0,Y.jsx)(`ol`,{className:`flex flex-col gap-1 max-md:gap-2`,children:e.map((n,i)=>{let c=i+1,l=Km(n);return(0,Y.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1 max-md:grid max-md:grid-cols-[1rem_1fr_auto] max-md:gap-2 max-md:rounded-lg max-md:border max-md:p-2`,children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`w-4 shrink-0 text-right text-xs tabular-nums text-muted-foreground`,children:c}),(0,Y.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 flex-1 basis-48 max-md:col-span-2`),"aria-label":`Criterion ${c} text${o}`,placeholder:`What has to hold, e.g. Docs updated`,value:n.text,onChange:e=>s(n.key,{text:e.target.value}),autoFocus:n.key===r}),(0,Y.jsx)(`select`,{"aria-label":`Criterion ${c} kind${o}`,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`h-7 max-md:col-start-2 max-md:row-start-2`),value:n.kind,title:`How the criterion is checked`,onChange:e=>s(n.key,{kind:e.target.value}),children:Vm.map(e=>(0,Y.jsx)(`option`,{value:e,children:Bm[e]},e))}),Hm(n.kind)&&(0,Y.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 flex-1 basis-40 font-mono max-md:col-span-2 max-md:col-start-2 max-md:row-start-3 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`),"aria-label":`Criterion ${c} target${o}`,"aria-invalid":l!==null,title:l??`Toodo checks that a GET of this URL succeeds`,placeholder:`https://example.com/health`,value:n.target,onChange:e=>s(n.key,{target:e.target.value})}),(0,Y.jsx)(q,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`Remove criterion ${c}${o}`,title:`Remove criterion`,className:`max-md:col-start-3 max-md:row-start-2`,onClick:()=>t(e.filter(e=>e.key!==n.key)),children:(0,Y.jsx)(vt,{})})]},n.key)})}),(0,Y.jsxs)(q,{type:`button`,size:`xs`,variant:`ghost`,className:`self-start`,"aria-label":n===void 0?void 0:`Add criterion to #${n}`,onClick:c,children:[(0,Y.jsx)(pt,{}),`Add criterion`]})]})}function Jm({task:e,focusPlan:t,onDone:n}){let r=ie(),[i,o]=(0,J.useState)(e.taskType),[s,c]=(0,J.useState)(e.title),[l,u]=(0,J.useState)(e.description),[d]=(0,J.useState)(()=>({estimate:e.estimate===null?``:String(e.estimate.amount),estimateUnit:e.estimate?.unit??`hours`,dueDate:e.dueDate??``,labels:Wi(e.labels)})),[f,p]=(0,J.useState)(d),m=Wi(Ui(f.labels))!==Wi(e.labels),[h]=(0,J.useState)(()=>e.criteria.map(e=>Wm(e))),[g,_]=(0,J.useState)(h),v=Rm(f),y=JSON.stringify(Gm(g))!==JSON.stringify(Gm(h)),b=g.some(e=>Km(e)!==null),x=i!==e.taskType||s!==e.title||l!==e.description||f.estimate!==d.estimate||f.estimateUnit!==d.estimateUnit||f.dueDate!==d.dueDate||f.labels!==d.labels||y,S=Pm(x,n,r.isPending);function C(t){t.preventDefault(),!(v===void 0||b)&&r.mutate({status:null,id:e.id,taskType:i,title:s.trim(),description:l.trim(),estimate:v,dueDate:f.dueDate||null,labels:m?Ui(f.labels):null,criteria:y&&e.status!==`done`?Gm(g):null},{onSuccess:n})}return(0,Y.jsxs)(`form`,{onSubmit:C,"aria-label":`Edit task #${e.id}`,"data-dirty":x||void 0,className:`flex flex-col gap-1 max-md:gap-2`,onKeyDown:S.onKeyDown,children:[(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(`select`,{"aria-label":`Type of #${e.id}`,className:a(ft,`w-28`),value:i,onChange:e=>o(e.target.value),children:$a.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))}),(0,Y.jsx)(`input`,{className:ft,"aria-label":`Title of #${e.id}`,value:s,onChange:e=>c(e.target.value),required:!0,autoFocus:t===void 0})]}),(0,Y.jsx)(Lm,{label:`Description of #${e.id}`,placeholder:`Description (optional, Markdown)`,value:l,onChange:u}),(0,Y.jsx)(zm,{suffix:` of #${e.id}`,plan:f,onChange:p,autoFocus:t}),e.status!==`done`&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs`,children:(0,Y.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Completion criteria`})}),(0,Y.jsx)(qm,{taskId:e.id,criteria:g,onChange:_})]}),S.asking?(0,Y.jsx)(Fm,{label:`Discard changes to #${e.id}`,question:`Discard your changes to #${e.id}?`,onKeep:S.keep,onDiscard:S.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[(0,Y.jsx)(q,{type:`submit`,size:`xs`,disabled:r.isPending||v===void 0||b,children:r.isPending?`Saving...`:`Save`}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:S.request,children:`Discard`})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}function Ym({task:e,onDone:t,onShipped:n}){let r=ve(),[i,o]=(0,J.useState)(``),s=Pm(i.trim()!==``,t,r.isPending);function c(n){n.preventDefault(),r.mutate({id:e.id,note:i.trim()},{onSuccess:t})}return(0,Y.jsxs)(`form`,{onSubmit:c,"aria-label":`Conclude #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:s.onKeyDown,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Finish #`,e.id,` without completing it. It is marked not adopted. Tasks that depend on it stay blocked.`]}),(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Conclusion of #${e.id}`,placeholder:`What was tried, what was found, and why it is not adopted.`,value:i,onChange:e=>o(e.target.value),required:!0,autoFocus:!0}),s.asking?(0,Y.jsx)(Fm,{label:`Discard conclusion of #${e.id}`,question:`Discard your conclusion of #${e.id}?`,onKeep:s.keep,onDiscard:s.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{type:`submit`,size:`xs`,variant:`destructive`,disabled:r.isPending||i.trim()===``,children:[(0,Y.jsx)(En,{}),r.isPending?`Concluding...`:`Conclude as not adopted`]}),(0,Y.jsxs)(q,{type:`button`,size:`xs`,variant:`outline`,"aria-label":`Complete #${e.id} as shipped by another task`,title:`The work shipped through another task: complete the task instead`,disabled:r.isPending,onClick:n,children:[(0,Y.jsx)(Bn,{}),`Complete as shipped by...`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:s.request,children:`Back`})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}var Xm={merged:`Merged`,completed:`Completed`,not_adopted:zr.not_adopted};function Zm({task:e,onDone:t}){let n=Oe(),[r,i]=(0,J.useState)(``),o=Pm(r.trim()!==``,t,n.isPending);function s(i){i.preventDefault(),n.mutate({id:e.id,reason:r.trim()},{onSuccess:t})}return(0,Y.jsxs)(`form`,{onSubmit:s,"aria-label":`Reopen #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:o.onKeyDown,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Reopen #`,e.id,`: it is paused, and Resume continues the work. Its outcome and completion note are cleared and kept, with your reason, as a progress note.`]}),(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Reason to reopen #${e.id}`,placeholder:`Why is the task not finished after all?`,value:r,onChange:e=>i(e.target.value),required:!0,autoFocus:!0}),o.asking?(0,Y.jsx)(Fm,{label:`Discard reason to reopen #${e.id}`,question:`Discard your reason to reopen #${e.id}?`,onKeep:o.keep,onDiscard:o.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{changesData:!0,type:`submit`,size:`xs`,disabled:n.isPending||r.trim()===``,children:[(0,Y.jsx)(vr,{}),n.isPending?`Reopening...`:`Reopen`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:o.request,children:`Back`})]}),n.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function Qm({task:e,onDone:t}){let n=U(),r=Object.keys(Xm).filter(t=>t!==e.resolution),[i,o]=(0,J.useState)(r[0]),[s,c]=(0,J.useState)(``),l=Pm(s.trim()!==``,t,n.isPending);function u(r){r.preventDefault(),n.mutate({id:e.id,resolution:i,note:s.trim()},{onSuccess:t})}return(0,Y.jsxs)(`form`,{onSubmit:u,"aria-label":`Outcome of #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:l.onKeyDown,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`#`,e.id,` is done as `,e.resolution===null?`done`:Xm[e.resolution].toLowerCase(),`. Correct how it ended; the earlier outcome and note are kept as a progress note. Tasks that depend on it wait while it is not adopted.`]}),(0,Y.jsx)(`select`,{"aria-label":`New outcome of #${e.id}`,className:a(ft,`w-40`),value:i,onChange:e=>o(e.target.value),children:r.map(e=>(0,Y.jsx)(`option`,{value:e,children:Xm[e]},e))}),(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Outcome note of #${e.id}`,placeholder:`What happened, e.g. the change was reverted. This becomes the completion note.`,value:s,onChange:e=>c(e.target.value),required:!0,autoFocus:!0}),l.asking?(0,Y.jsx)(Fm,{label:`Discard outcome of #${e.id}`,question:`Discard the new outcome of #${e.id}?`,onKeep:l.keep,onDiscard:l.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{changesData:!0,type:`submit`,size:`xs`,disabled:n.isPending||s.trim()===``,children:[(0,Y.jsx)(Pn,{}),n.isPending?`Saving...`:`Change outcome`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:l.request,children:`Back`})]}),n.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function $m({task:e,tasks:t,context:n,onDone:r}){let i=ve(),o=t.filter(t=>t.id!==e.id&&t.status===`done`&&(t.resolution===`merged`||t.resolution===`completed`)).sort((e,t)=>t.id-e.id),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(``),d=s!==``&&l.trim()!==``,f=Pm(s!==``||l.trim()!==``,r,i.isPending);function p(t){t.preventDefault(),i.mutate({id:e.id,note:l.trim(),shippedWith:Number(s)},{onSuccess:r})}return(0,Y.jsxs)(`form`,{onSubmit:p,"aria-label":`Complete #${e.id} as shipped by`,className:`flex flex-col gap-1`,onKeyDown:f.onKeyDown,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Complete #`,e.id,` as shipped by another done task. It becomes done, and tasks that depend on it can start.`]}),(0,Y.jsxs)(`select`,{"aria-label":`Task that shipped #${e.id}`,className:ft,value:s,onChange:e=>c(e.target.value),required:!0,autoFocus:!0,children:[(0,Y.jsx)(`option`,{value:``,children:`Choose a task...`}),o.map(t=>(0,Y.jsxs)(`option`,{value:t.id,children:[oo(t.id,e.workspaceId,n),` `,t.title]},t.id))]}),(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Shipped note of #${e.id}`,placeholder:`How the other task shipped this work. This becomes the completion note.`,value:l,onChange:e=>u(e.target.value),required:!0}),f.asking?(0,Y.jsx)(Fm,{label:`Discard completion of #${e.id}`,question:`Discard completing #${e.id} as shipped by another?`,onKeep:f.keep,onDiscard:f.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{changesData:!0,type:`submit`,size:`xs`,disabled:i.isPending||!d,children:[(0,Y.jsx)(Bn,{}),i.isPending?`Completing...`:`Complete as shipped`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:f.request,children:`Back`})]}),i.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i.error.message})]})}function eh({task:e,adding:t,onAdded:n}){let r=y(),[i,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(``),l=e.completionNote??``,u=i||t;function d(){o(!1),n()}let f=Pm(s.trim()!==l.trim(),()=>{c(l),d()},r.isPending);function p(){c(l),o(!0)}function m(t){t.preventDefault(),r.mutate({id:e.id,note:s},{onSuccess:d})}return u?(0,Y.jsxs)(`form`,{onSubmit:m,"aria-label":`Completion note form of #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:f.onKeyDown,children:[(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Completion note for #${e.id}`,placeholder:`What did this achieve? Impact, decisions, follow-ups. Reviews include this note.`,value:s,onChange:e=>c(e.target.value),autoFocus:!0}),f.asking?(0,Y.jsx)(Fm,{label:`Discard note of #${e.id}`,question:`Discard your note for #${e.id}?`,onKeep:f.keep,onDiscard:f.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{type:`submit`,size:`xs`,disabled:r.isPending||s.trim()===l||Ki(e)&&s.trim()===``,children:r.isPending?`Saving...`:`Save note`}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:f.request,children:`Discard`})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]}):e.completionNote===null?null:(0,Y.jsxs)(`div`,{className:`flex items-start gap-1 rounded-md bg-muted/60 px-2 py-1`,children:[(0,Y.jsx)(Or,{"aria-hidden":!0,className:`mt-0.5 size-3 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`p`,{"aria-label":`Completion note of #${e.id}`,className:`min-w-0 flex-1 whitespace-pre-line break-words-keep text-xs`,children:e.completionNote}),(0,Y.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":`Edit completion note of #${e.id}`,title:`Edit note`,onClick:p,children:(0,Y.jsx)(ur,{})})]})}function th({task:e}){let t=e.issue;return t===null?null:(0,Y.jsx)(so,{label:`Issue`,children:(0,Y.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs`,children:[(0,Y.jsxs)(`span`,{"aria-label":`Issue of #${e.id}`,title:t.url,className:`shrink-0 font-medium tabular-nums`,children:[`#`,t.number]}),(0,Y.jsx)(`span`,{className:`min-w-0 break-all font-mono text-muted-foreground select-all`,children:t.url})]})})}function nh(e){let t=new Date(e*1e3),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function rh(){let e=new Date;return e.setDate(e.getDate()+1),e.setHours(9,0,0,0),e.getTime()/1e3}function ih(e){return e.wait===null?null:`Waiting until ${ni(e.wait.until)}, then ${zr[e.wait.status].toLowerCase()}`}function ah({task:e,onDone:t}){let n=P(),[r,i]=(0,J.useState)(nh(e.wait?.until??rh())),[o,s]=(0,J.useState)(``),c=r===``?NaN:new Date(r).getTime()/1e3,l=Number.isFinite(c);function u(r){r.preventDefault(),l&&n.mutate({id:e.id,until:Math.floor(c),reason:o.trim()===``?null:o.trim()},{onSuccess:t})}return(0,Y.jsxs)(`form`,{onSubmit:u,"aria-label":`Wait #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:e=>e.key===`Escape`&&!n.isPending&&t(),children:[(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.wait===null?e.status===`planned`?`#${e.id} waits until then and stays planned.`:`#${e.id} is paused until then, then returns to ${zr[e.status].toLowerCase()} on its own.`:`Move the end of the wait; #${e.id} then returns to ${zr[e.wait.status].toLowerCase()}.`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1 max-md:gap-2`,children:[(0,Y.jsx)(`input`,{type:`datetime-local`,className:a(ft,`w-auto`),"aria-label":`Wait #${e.id} until`,value:r,onChange:e=>i(e.target.value),required:!0,autoFocus:!0}),(0,Y.jsx)(`input`,{className:a(ft,`min-w-0 flex-1 basis-48`),"aria-label":`Reason #${e.id} waits`,placeholder:`Why it waits (optional)`,value:o,onChange:e=>s(e.target.value)})]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{changesData:!0,type:`submit`,size:`xs`,disabled:n.isPending||!l,children:[(0,Y.jsx)($t,{}),n.isPending?`Saving...`:e.wait===null?`Wait`:`Change wait`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:t,children:`Back`})]}),n.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}var oh=()=>Za(()=>import(`./task-details-S81PKtIo.js`),__vite__mapDeps([3,1,4,5,6,2,7])),sh=(0,J.lazy)(()=>oh().then(e=>({default:e.TaskTimeline}))),ch=(0,J.lazy)(()=>oh().then(e=>({default:e.RelatedTasks}))),lh=(0,J.lazy)(()=>oh().then(e=>({default:e.TaskNotes}))),uh=(0,J.lazy)(()=>oh().then(e=>({default:e.TaskPlan}))),dh=(0,J.lazy)(()=>oh().then(e=>({default:e.TaskCriteria}))),fh=[`planned`,`done`];function ph({task:e,tasks:t,context:n,showWorkspace:r,detailed:i=!1,navigation:o,onShowDetails:s}){let c=_(),l=pe(),d=m(),f=u(),p=rt(),h=qe(),g=Ae(),[v,y]=(0,J.useState)(!1),[b,x]=(0,J.useState)(void 0),[S,C]=(0,J.useState)(!1),[w,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(!1),[O,k]=(0,J.useState)(!1),[A,j]=(0,J.useState)(!1),[M,N]=(0,J.useState)(null),P=e.status===`in_review`,F=e.status===`in_progress`||P,I=l.isPending,L=e.status===`done`,R=e.criteria.every(e=>e.state===`met`),z=e.criteria.filter(e=>e.state!==`met`).length,B=P||e.status===`in_progress`&&R,V=X(e),ee=e.status===`planned`&&qi(e,n.byId),H=e.status===`planned`?e.dependsOn.filter(e=>Ki(n.byId.get(e))):[],U=Gi.includes(e.status),te=Ji(e,n.byId),ne=Da(e,n.byId),re=h.isPending||g.isPending,ie=uo(),W=c.error??l.error??d.error??f.error??p.error??h.error??g.error,G=t.filter(n=>ta(t,n.id,e.id)),ae=[...new Set([e.workspaceId,...G.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:G.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0),oe=e.status===`planned`?{key:`start`,changesData:!0,label:c.isPending?`Starting...`:V?`Resume`:`Start`,ariaLabel:`${V?`Resume`:`Start`} #${e.id}`,icon:(0,Y.jsx)(fr,{}),title:ee?void 0:H.length>0?`A dependency was not adopted; remove it to start`:`Waits until all its dependencies are done`,disabled:!ee||c.isPending,onSelect:()=>c.mutate(e.id)}:null,se=B?{key:`complete`,changesData:!0,label:l.isPending?`Completing...`:`Complete`,ariaLabel:`Complete #${e.id}`,icon:(0,Y.jsx)(gn,{}),className:io,title:R?void 0:`${z} of ${e.criteria.length} criteria not met yet; check the manual ones under Criteria`,disabled:I||!R,onSelect:()=>l.mutate(e.id)}:null,ce=F||e.status===`planned`?{key:`conclude`,label:`Conclude`,ariaLabel:`Conclude #${e.id} without completing`,icon:(0,Y.jsx)(En,{}),title:`Finish without completing, e.g. research whose result is not adopted`,disabled:I,onSelect:()=>C(!0)}:null,le=[oe,se].find(e=>e!==null)??null,K=[oe,se,ce].filter(e=>e!==null&&e!==le),ue=[L?null:{key:`edit`,label:`Edit`,ariaLabel:`Edit #${e.id}`,icon:(0,Y.jsx)(ur,{}),onSelect:()=>{x(void 0),y(!0)}},F?{key:`pause`,changesData:!0,label:`Pause`,ariaLabel:`Pause #${e.id}`,icon:(0,Y.jsx)(cr,{}),title:`Pause: stop working on the task; it can be resumed`,disabled:d.isPending,onSelect:()=>d.mutate(e.id)}:null,L?null:{key:`wait`,label:e.wait===null?`Wait until...`:`Change wait`,ariaLabel:`${e.wait===null?`Wait`:`Change wait of`} #${e.id}`,icon:(0,Y.jsx)($t,{}),title:`Pause the task until a time; it then returns to its status on its own`,onSelect:()=>k(!0)},e.wait===null?null:{key:`end-wait`,changesData:!0,label:`End wait`,ariaLabel:`End wait of #${e.id}`,icon:(0,Y.jsx)(Zt,{}),title:`Return the task to its status now`,disabled:f.isPending,onSelect:()=>f.mutate(e.id)},L&&Ki(e)?{key:`shipped`,label:`Complete as shipped by...`,ariaLabel:`Complete #${e.id} as shipped by another task`,icon:(0,Y.jsx)(Bn,{}),title:`The work did ship, through another task: mark it done as shipped with that one`,onSelect:()=>T(`shipped`)}:null,L?{key:`outcome`,label:`Change outcome`,ariaLabel:`Change outcome of #${e.id}`,icon:(0,Y.jsx)(Pn,{}),title:`Correct how the task ended, e.g. merged work that was reverted; the change is kept as a note`,onSelect:()=>T(`outcome`)}:null,L?{key:`reopen`,label:`Reopen`,ariaLabel:`Reopen #${e.id}`,icon:(0,Y.jsx)(vr,{}),title:`Reopen a task completed or concluded by mistake; it is paused and can be resumed`,onSelect:()=>T(`reopen`)}:null,L&&e.completionNote===null&&!E?{key:`add-note`,label:`Add note`,ariaLabel:`Add completion note to #${e.id}`,icon:(0,Y.jsx)(Or,{}),onSelect:()=>D(!0)}:null,fh.includes(e.status)?{key:`delete`,label:`Delete`,ariaLabel:`Delete #${e.id}`,icon:(0,Y.jsx)(Pr,{}),title:`Delete`,destructive:!0,onSelect:()=>j(!0)}:null].filter(e=>e!==null),de=s?{key:`details`,label:`Details`,ariaLabel:`Show details of #${e.id}`,icon:(0,Y.jsx)(or,{}),onSelect:s}:null,fe=i?ue:[...de?[de]:[],...K,...ue],me=si(e.milestones).at(-1),he=e.criteria.filter(e=>e.state===`met`).length,ge=e.criteria.filter(e=>e.state===`failed`).length,_e=i?``:Mm(e.description);function ve(e,t){return(0,Y.jsxs)(q,{size:`xs`,variant:t,changesData:e.changesData,"aria-label":e.ariaLabel,title:e.title,disabled:e.disabled,onClick:e.onSelect,className:e.className,children:[e.icon,e.label]},e.key)}return(0,Y.jsxs)(`li`,{"data-task-row":i?void 0:e.id,className:a(`flex flex-col`,i?`gap-3 p-4`:`gap-1.5 px-4 py-3 max-md:gap-2`),children:[v?(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(mh,{task:e,byId:n.byId}),(0,Y.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Editing`})]}),(0,Y.jsx)(Jm,{task:e,focusPlan:b,onDone:()=>y(!1)})]}):(0,Y.jsxs)(`div`,{className:a(`flex min-w-0 flex-col`,i?`gap-1.5`:`gap-0.5`),children:[(0,Y.jsxs)(`div`,{className:a(`flex min-w-0 items-center gap-2`,i?`flex-wrap`:`max-md:flex-wrap max-md:gap-y-1`),children:[(0,Y.jsx)(mh,{task:e,byId:n.byId}),(0,Y.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),r&&(0,Y.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-1.5 text-xs text-muted-foreground`,children:n.workspaceName(e.workspaceId)}),(0,Y.jsx)(mo,{type:e.taskType}),!i&&(0,Y.jsx)(`button`,{type:`button`,className:`break-words-keep line-clamp-2 min-w-0 cursor-pointer rounded-sm text-left text-base font-semibold outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50 max-md:order-last max-md:min-h-11 max-md:basis-full md:flex-1 md:text-sm`,title:e.title,"data-task-title":!0,onClick:s,children:e.title}),ne&&(0,Y.jsx)(`span`,{role:`note`,"aria-label":`Blocker on #${e.id}: ${ne.body}`,title:ne.body,className:a(`shrink-0 rounded-md px-1.5 text-xs font-medium`,Vr.attention),children:`Blocker`})]}),i&&(0,Y.jsx)(`h3`,{className:`break-words-keep text-base font-semibold leading-snug`,children:e.title}),i&&e.description.trim()&&(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:e.description}),children:(0,Y.jsx)(Qa,{source:e.description})}),_e&&(0,Y.jsx)(`p`,{className:`break-words-keep line-clamp-2 text-sm text-muted-foreground`,children:_e}),!i&&(0,Y.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground empty:hidden`,children:[H.length>0&&(0,Y.jsxs)(`span`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:Hr.attention,children:[H.map(t=>oo(t,e.workspaceId,n)).join(`, `),` not adopted`]}),te.length>0&&(0,Y.jsxs)(`span`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:Hr.neutral,children:[`Waiting on `,te.map(t=>oo(t,e.workspaceId,n)).join(`, `)]}),e.wait!==null&&(0,Y.jsx)(`span`,{role:`note`,"aria-label":`Wait of #${e.id}`,className:Hr.neutral,children:ih(e)}),e.dueDate!==null&&(0,Y.jsx)(co,{task:e}),(0,Y.jsx)(lo,{task:e,onEdit:e=>{x(e),y(!0)}}),!L&&e.criteria.length>0&&(0,Y.jsxs)(`span`,{children:[he,`/`,e.criteria.length,` criteria met`]}),!L&&ge>0&&(0,Y.jsxs)(`span`,{className:a(`font-medium`,Hr.danger),children:[ge,` failed`]}),me&&(0,Y.jsx)(ci,{at:me.at,prefix:`${me.label} `})]})]}),i&&!v&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(dh,{task:e,detailed:!0})}),M===null?i&&(e.dependsOn.length>0||U&&G.length>0)&&(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Dependencies of #${e.id}`,className:`flex flex-wrap items-center gap-1 text-xs text-muted-foreground max-md:gap-2`,children:[e.dependsOn.length>0&&(0,Y.jsx)(`span`,{children:`Depends on`}),e.dependsOn.map(t=>(0,Y.jsxs)(`span`,{className:a(`inline-flex h-6 items-center gap-0.5 rounded-md border px-1.5 tabular-nums max-md:h-auto max-md:pr-0`,n.byId.get(t)?.status===`done`&&`line-through decoration-muted-foreground/60`,H.includes(t)&&Ur.attention),title:H.includes(t)?`${n.byId.get(t)?.title} (not adopted)`:n.byId.get(t)?.title,children:[(0,Y.jsx)(`span`,{children:oo(t,e.workspaceId,n)}),U&&(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Remove dependency #${t} from #${e.id}`,title:`Remove dependency`,className:`flex items-center justify-center self-stretch rounded-sm p-0.5 hover:bg-muted hover:text-foreground disabled:opacity-50 max-md:size-11`,disabled:re,onClick:()=>g.mutate({id:e.id,dependsOn:t}),children:(0,Y.jsx)(vt,{className:`size-3`})})]},t)),U&&G.length>0&&(0,Y.jsxs)(`select`,{"aria-label":`Add dependency to #${e.id}`,title:e.status===`in_progress`?`A prerequisite that is not done pauses this task`:void 0,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`max-w-48`),value:``,disabled:re||ie,onChange:t=>{if(t.target.value){let n=Number(t.target.value);h.mutate({id:e.id,dependsOn:n,confirmPause:!1},{onSuccess:e=>e===`confirm_pause`&&N(n)})}},children:[(0,Y.jsx)(`option`,{value:``,children:`Add dependency...`}),ae.map(e=>(0,Y.jsx)(`optgroup`,{label:n.workspaceName(e.workspaceId),children:e.tasks.map(e=>(0,Y.jsxs)(`option`,{value:e.id,children:[`#`,e.id,` `,e.title]},e.id))},e.workspaceId))]})]}):(0,Y.jsx)(po,{taskId:e.id,prerequisite:oo(M,e.workspaceId,n),pending:h.isPending,onConfirm:()=>h.mutate({id:e.id,dependsOn:M,confirmPause:!0},{onSettled:()=>N(null)}),onCancel:()=>N(null)}),i&&H.length>0&&(0,Y.jsxs)(`p`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:a(`text-xs`,Hr.attention),children:[H.map(t=>oo(t,e.workspaceId,n)).join(`, `),` `,H.length===1?`was`:`were`,` not adopted. Remove the dependency or change the plan to start this task.`]}),i&&te.length>0&&(0,Y.jsxs)(`p`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:a(`text-xs`,Hr.neutral),children:[`Waiting on `,te.map(t=>oo(t,e.workspaceId,n)).join(`, `)]}),i&&e.wait!==null&&(0,Y.jsx)(`p`,{role:`note`,"aria-label":`Wait of #${e.id}`,className:a(`text-xs`,Hr.neutral),children:ih(e)}),i&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(uh,{task:e})}),i&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(sh,{task:e,detailed:!0})}),i&&e.issue!==null&&(0,Y.jsx)(th,{task:e}),i&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(ch,{task:e,tasks:t,context:n,navigation:o})}),i&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(lh,{task:e,detailed:!0})}),L&&!v&&(i||E)&&(0,Y.jsx)(eh,{task:e,adding:E,onAdded:()=>D(!1)}),W&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:W.message}),S&&!v&&(0,Y.jsx)(Ym,{task:e,onDone:()=>C(!1),onShipped:()=>{C(!1),T(`shipped`)}}),w===`shipped`&&!v&&(0,Y.jsx)($m,{task:e,tasks:t,context:n,onDone:()=>T(null)}),w===`outcome`&&!v&&(0,Y.jsx)(Qm,{task:e,onDone:()=>T(null)}),w===`reopen`&&!v&&(0,Y.jsx)(Zm,{task:e,onDone:()=>T(null)}),O&&!v&&(0,Y.jsx)(ah,{task:e,onDone:()=>k(!1)}),!v&&!S&&w===null&&!O&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[le&&ve(le,i?`default`:`outline`),i&&K.map(e=>ve(e,`outline`)),(0,Y.jsx)(`div`,{role:A?`group`:void 0,"aria-label":A?`Delete #${e.id}?`:void 0,className:a(`ml-auto flex items-center gap-1 max-md:gap-2`,A&&`basis-full flex-wrap justify-end`),onKeyDown:A?mt(()=>j(!1),p.isPending):void 0,children:A?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 basis-48 text-xs`,children:[`Delete #`,e.id,`? It moves to Settings > Archive with its history, where it can be restored.`]}),(0,Y.jsxs)(q,{size:`xs`,variant:`destructive`,"aria-label":`Confirm delete #${e.id}`,disabled:p.isPending,onClick:()=>p.mutate(e.id,{onSettled:()=>j(!1)}),children:[(0,Y.jsx)(Pr,{}),p.isPending?`Deleting...`:`Confirm delete`]}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>j(!1),children:`Back`},`back`)]}):fe.length>0&&(0,Y.jsx)(Tm,{label:`More actions for #${e.id}`,actions:fe})})]})]})}function mh({task:e,byId:t}){return(0,Y.jsxs)(`span`,{className:a(`inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,ao(e,t)),children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-current opacity-80`}),eo(e,t)]})}function hh(e){return/^https?:\/\/\S+$/.test(e)?e:/^[\w.-]+\/[\w.-]+$/.test(e)?`https://github.com/${e}`:null}function gh({workspace:e}){let t=ne(),[n,r]=(0,J.useState)(!1),[i,o]=(0,J.useState)(e.name),[s,c]=(0,J.useState)(e.description??``),[l,u]=(0,J.useState)(e.repository??``),d=Pm(i!==e.name||s!==(e.description??``)||l!==(e.repository??``),()=>r(!1),t.isPending);function f(){t.reset(),o(e.name),c(e.description??``),u(e.repository??``),r(!0)}function p(n){n.preventDefault(),t.mutate({...e,name:i.trim(),description:s.trim()||null,repository:l.trim()||null},{onSuccess:()=>r(!1)})}if(!n){let t=e.repository===null?null:hh(e.repository);return(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-sm text-muted-foreground`,children:[(0,Y.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 max-md:flex-wrap`,children:[e.repository!==null&&(t===null?(0,Y.jsx)(`code`,{"aria-label":`Repository`,className:`truncate text-foreground`,children:e.repository}):(0,Y.jsx)(`a`,{"aria-label":`Repository`,href:t,target:`_blank`,rel:`noreferrer`,className:`truncate font-mono text-foreground underline underline-offset-2`,children:e.repository})),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,"aria-label":`Edit workspace`,onClick:f,children:`Edit`})]}),e.description!==null&&(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.description}),children:(0,Y.jsx)(`div`,{"aria-label":`Workspace description`,className:`text-sm`,children:(0,Y.jsx)(Qa,{source:e.description})})})]})}return(0,Y.jsxs)(`form`,{onSubmit:p,"aria-label":`Workspace details`,className:`flex flex-col gap-1.5`,onKeyDown:d.onKeyDown,children:[(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Name`,(0,Y.jsx)(`input`,{className:ft,value:i,onChange:e=>o(e.target.value),required:!0,autoFocus:!0})]}),(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Description (optional, Markdown)`,(0,Y.jsx)(`textarea`,{className:a(ft,`h-24 py-1.5 max-md:h-32`),value:s,onChange:e=>c(e.target.value)})]}),(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Repository (optional, e.g. owner/repo or a URL)`,(0,Y.jsx)(`input`,{className:a(ft,`font-mono`),value:l,onChange:e=>u(e.target.value)})]}),d.asking?(0,Y.jsx)(Fm,{label:`Discard workspace changes`,question:`Discard the changes to the workspace?`,onKeep:d.keep,onDiscard:d.discard}):(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(q,{type:`submit`,size:`sm`,variant:`outline`,disabled:t.isPending||i.trim()===``,children:`Save`}),(0,Y.jsx)(q,{type:`button`,size:`sm`,variant:`ghost`,onClick:d.request,children:`Discard`})]}),t.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:t.error.message})]})}var _h=4e3,vh=[`rule`,`memory`],yh={rule:`Rule`,memory:`Memory`},bh={rule:`Rules`,memory:`Memory`},xh={rule:`Agents must follow it.`,memory:`A lesson or fact worth keeping for this workspace.`};function Sh({workspace:e}){let t=at(e.id),n=Te(),[r,i]=(0,J.useState)(null),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(!1),u=(0,J.useId)(),d=t.data??[],f=d.filter(e=>e.kind===`rule`),p=d.filter(e=>e.kind===`memory`),m=r??t.data?.length===0,h=[f.length>0&&`${f.length} ${f.length===1?`rule`:`rules`}`,p.length>0&&`${p.length} ${p.length===1?`memory`:`memories`}`].filter(Boolean).join(`, `);function g(){n.reset(),i(!0),s(!0)}function _(){s(!1),l(!0)}return(0,Y.jsxs)(`section`,{"aria-label":`Guidelines`,className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium text-muted-foreground`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":m,"aria-controls":u,className:`flex items-center gap-1.5 rounded-sm text-left outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>i(!m),children:[(0,Y.jsx)(vn,{"aria-hidden":!0,className:a(`size-4 shrink-0 transition-transform`,!m&&`-rotate-90`)}),`Guidelines `,h&&(0,Y.jsx)(`span`,{className:`font-normal tabular-nums`,children:h})]})}),!o&&(0,Y.jsxs)(q,{size:`xs`,variant:`outline`,"aria-label":`Add guideline`,title:`Add a rule or memory for agents`,autoFocus:c,onClick:g,children:[(0,Y.jsx)(pt,{}),`Add`]})]}),t.isError&&(0,Y.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-xs text-destructive`,children:[(0,Y.jsxs)(`p`,{children:[`Failed to load guidelines: `,t.error.message]}),(0,Y.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>void t.refetch(),children:`Retry now`})]}),(0,Y.jsxs)(`div`,{id:u,hidden:!m,className:`flex flex-col gap-2`,children:[t.isPending&&(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading guidelines...`}),t.data?.length===0&&(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No rules or memory yet; agents read them before working on a task in this workspace.`}),(0,Y.jsx)(Ch,{kind:`rule`,entries:f}),(0,Y.jsx)(Ch,{kind:`memory`,entries:p}),o&&(0,Y.jsx)(Th,{label:`Add guideline`,className:`rounded-xl border bg-card p-2.5`,pending:n.isPending,error:n.error,onSave:(t,r)=>n.mutate({workspaceId:e.id,kind:t,body:r},{onSuccess:_}),onClose:_})]})]})}function Ch({kind:e,entries:t}){return t.length===0?null:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:bh[e]}),(0,Y.jsx)(`ul`,{"aria-label":bh[e],className:`flex flex-col divide-y rounded-xl border bg-card`,children:t.map((e,t)=>(0,Y.jsx)(wh,{guideline:e,position:t+1},e.id))})]})}function wh({guideline:e,position:t}){let n=S(),r=xe(),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(null),u=`${e.kind} ${t}`,d=`${yh[e.kind]} ${t}`;function f(){a(!1),l(`edit`)}function p(){s(!1),l(`delete`)}return i?(0,Y.jsx)(`li`,{"aria-label":d,className:`px-2.5 py-2`,children:(0,Y.jsx)(Th,{label:`Edit ${u}`,guideline:e,pending:n.isPending,error:n.error,onSave:(t,r)=>n.mutate({id:e.id,kind:t,body:r},{onSuccess:f}),onClose:f})}):(0,Y.jsxs)(`li`,{"aria-label":d,className:`group/guideline flex flex-col gap-1.5 px-2.5 py-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words-keep text-sm`,children:e.body}),children:(0,Y.jsx)(Qa,{source:e.body,className:`flex-1 text-foreground`})}),!o&&(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-focus-within/guideline:opacity-100 group-hover/guideline:opacity-100 max-md:gap-2 [@media(hover:none)]:opacity-100`,children:[(0,Y.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":`Edit ${u}`,title:`Edit`,autoFocus:c===`edit`,onClick:()=>{n.reset(),a(!0)},children:(0,Y.jsx)(ur,{})}),(0,Y.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":`Delete ${u}`,title:`Delete`,className:`hover:text-destructive`,autoFocus:c===`delete`,onClick:()=>{r.reset(),s(!0)},children:(0,Y.jsx)(Pr,{})})]})]}),o&&(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Delete ${u}?`,className:`flex flex-wrap items-center gap-1 text-xs max-md:gap-2`,onKeyDown:mt(p,r.isPending),children:[(0,Y.jsxs)(`span`,{className:`mr-1`,children:[`Delete this `,e.kind,`? It cannot be restored.`]}),(0,Y.jsxs)(q,{changesData:!0,size:`xs`,variant:`destructive`,"aria-label":`Confirm delete ${u}`,disabled:r.isPending,onClick:()=>r.mutate(e.id),children:[(0,Y.jsx)(Pr,{}),r.isPending?`Deleting...`:`Delete`]}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:p,children:`Back`})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}function Th({label:e,guideline:t,className:n,pending:r,error:i,onSave:o,onClose:s}){let c=t?.kind??`rule`,l=t?.body??``,[u,d]=(0,J.useState)(c),[f,p]=(0,J.useState)(l),m=(0,J.useId)(),h=Pm(u!==c||f!==l,s,r);function g(e){e.preventDefault(),o(u,f.trim())}return(0,Y.jsxs)(`form`,{"aria-label":e,className:a(`flex flex-col gap-1.5`,n),onSubmit:g,onKeyDown:h.onKeyDown,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Y.jsx)(`select`,{"aria-label":`Kind`,"aria-describedby":m,className:_t,value:u,onChange:e=>d(e.target.value),children:vh.map(e=>(0,Y.jsx)(`option`,{value:e,children:yh[e]},e))}),(0,Y.jsx)(`span`,{id:m,className:`text-xs text-muted-foreground`,children:xh[u]})]}),(0,Y.jsx)(`textarea`,{"aria-label":`Guideline`,placeholder:`Write it in Markdown`,className:a(ft,`h-24 py-1.5 max-md:h-32`),value:f,maxLength:_h,required:!0,autoFocus:!0,onChange:e=>p(e.target.value)}),h.asking?(0,Y.jsx)(Fm,{label:t?`Discard guideline changes`:`Discard new guideline`,question:t?`Discard the changes to the guideline?`:`Discard the new guideline?`,onKeep:h.keep,onDiscard:h.discard}):(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(q,{type:`submit`,size:`sm`,variant:`outline`,disabled:r||f.trim()===``,children:t?`Save`:`Add`}),(0,Y.jsx)(q,{type:`button`,size:`sm`,variant:`ghost`,onClick:h.request,children:t?`Discard`:`Cancel`})]}),i&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i.message})]})}var Eh=`(max-width: 47.99rem)`;function Dh(){let[e,t]=(0,J.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(Eh).matches);return(0,J.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(Eh),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Oh({label:e,expanded:t,onExpandedChange:n,onSubmit:r,children:i}){let o=(0,J.useRef)(null),s=(0,J.useRef)(!1),c=Dh(),l=t&&c;(0,J.useEffect)(()=>{if(!t)return;let e=e=>{e.target instanceof Node&&!o.current?.contains(e.target)&&n(!1)};return document.addEventListener(`click`,e),document.addEventListener(`focusin`,e),()=>{document.removeEventListener(`click`,e),document.removeEventListener(`focusin`,e)}},[t]);let u=()=>{s.current?s.current=!1:t||n(!0)};function d(){n(!1);let e=o.current?.querySelector(`input`);e&&e!==document.activeElement&&(s.current=!0,e.focus())}function f(e){e.key===`Escape`&&t&&!e.defaultPrevented&&(e.preventDefault(),n(!1))}return(0,Y.jsxs)(Y.Fragment,{children:[l&&(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-40 bg-black/40`}),(0,Y.jsx)(`div`,{role:l?`dialog`:void 0,"aria-modal":l||void 0,"aria-label":l?e:void 0,className:a(l&&`fixed inset-x-0 bottom-0 z-50 max-h-[90dvh] overflow-y-auto rounded-t-xl bg-card pb-[env(safe-area-inset-bottom)] shadow-xl`),children:(0,Y.jsxs)(`form`,{ref:o,"aria-label":e,"data-expanded":t||void 0,onSubmit:r,onFocus:u,onInput:u,onKeyDown:f,className:a(`flex flex-col gap-2 rounded-xl border bg-card p-3 shadow-xs`,l&&`border-0 shadow-none`),children:[t&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium`,children:e}),(0,Y.jsx)(q,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`Close ${e}`,title:`Close (Esc)`,onClick:d,children:(0,Y.jsx)(vt,{})})]}),i]})})]})}var kh={taskType:`feat`,title:``,description:``,criteria:[],estimate:``,estimateUnit:`hours`,dueDate:``,labels:``};function Ah({workspace:e,draft:t,onChange:n}){let r=Ue(),[i,o]=(0,J.useState)(!1),{taskType:s,title:c,description:l}=t,u=Rm(t),d=t.criteria.some(e=>Km(e)!==null),f=e=>n({...t,taskType:e}),p=e=>n({...t,title:e}),m=e=>n({...t,description:e});function h(i){i.preventDefault(),!(u===void 0||d)&&r.mutate({workspaceId:e.id,taskType:s,title:c,description:l,estimate:u,dueDate:t.dueDate||null,labels:Ui(t.labels),criteria:Gm(t.criteria)},{onSuccess:()=>{n({...t,title:``,description:``,estimate:``,dueDate:``,labels:``,criteria:[]}),o(!1)}})}return(0,Y.jsxs)(Oh,{label:`New task`,expanded:i,onExpandedChange:o,onSubmit:h,children:[(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[i&&(0,Y.jsx)(`select`,{"aria-label":`Task type`,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-28 shrink-0 font-mono`),value:s,onChange:e=>f(e.target.value),children:$a.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))}),(0,Y.jsx)(`input`,{className:a(ft,`min-w-0`),placeholder:i?`Task title`:`New task`,"aria-label":`Task title`,value:c,onChange:e=>p(e.target.value),required:!0}),(0,Y.jsxs)(q,{type:`submit`,disabled:r.isPending||u===void 0||d,children:[(0,Y.jsx)(pt,{}),`Add task`]})]}),i&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Lm,{label:`Description`,placeholder:`Description (optional, Markdown)`,value:l,onChange:m,className:`flex-1`}),(0,Y.jsx)(zm,{suffix:``,plan:t,onChange:e=>n({...t,...e})}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1 border-t pt-2`,children:[(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs`,children:(0,Y.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Completion criteria`})}),(0,Y.jsx)(qm,{criteria:t.criteria,onChange:e=>n({...t,criteria:e})})]})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}var jh={completed:`Completed`,opened_for_review:zr.in_review,started:`Started`,worked_on:`Worked on`,planned:`Planned`},Mh=Object.keys(jh),Nh={week:`week`,month:`month`,quarter:`quarter`,year:`year`,custom:`period`},Ph={week:`Week review`,month:`Month review`,quarter:`Quarter review`,year:`Year review`,custom:`Review`};function Fh(e){let[t,n,r]=e.split(`-`).map(Number);return[t,n-1,r]}function Ih(e,t=0){let[n,r,i]=Fh(e);return new Date(n,r,i+t)}function Lh(e){return Qr(e.getTime()/1e3)}function Rh(e){let t=(e.getDay()+6)%7;return Lh(new Date(e.getFullYear(),e.getMonth(),e.getDate()-t))}function zh(e,t){return Lh(Ih(e,t))}function Bh(e){return{kind:`week`,from:e,to:zh(e,6)}}var Vh={month:1,quarter:3,year:12};function Hh(e,t,n){let r=Vh[e];return{kind:e,from:Lh(new Date(t,n,1)),to:Lh(new Date(t,n+r,0))}}function Uh(e,t){let[n,r]=Fh(t);switch(e){case`week`:return Bh(Rh(Ih(t)));case`month`:return Hh(e,n,r);case`quarter`:return Hh(e,n,r-r%3);case`year`:return Hh(e,n,0);case`custom`:return{kind:e,from:t,to:t}}}function Wh(e,t){switch(e.kind){case`week`:return Bh(zh(e.from,7*t));case`month`:case`quarter`:case`year`:{let[n,r]=Fh(e.from);return Hh(e.kind,n,r+Vh[e.kind]*t)}case`custom`:{let n=Gh(e);return{kind:`custom`,from:zh(e.from,n*t),to:zh(e.to,n*t)}}}}function Gh(e){return Math.round((Ih(e.to,1).getTime()-Ih(e.from).getTime())/864e5)}function Kh(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).formatToParts(e*1e3),r=e=>n.find(t=>t.type===e)?.value??``;return`${r(`year`)}-${r(`month`)}-${r(`day`)}`}function qh(e){let[t,n]=Fh(e.from);switch(e.kind){case`month`:return e.from.slice(0,7);case`quarter`:return`${t} Q${Math.floor(n/3)+1}`;case`year`:return String(t);case`week`:case`custom`:return`${e.from} to ${e.to}`}}function Jh(e){return Mh.flatMap(t=>{let n=e.filter(e=>e.outcome===t);return n.length===0?[]:[{outcome:t,entries:n}]})}function Yh(e){return e.split(`
|
|
12
|
-
`,1)[0]}function Xh(e,t){return`${e} ${e===1?t:`${t}s`}`}function Zh(e){return/\/pull\/(\d+)/.exec(e)?.[1]??null}function Qh(e){return`#${e.number}, +${e.additions}/-${e.deletions} in ${Xh(e.changedFiles,`file`)}, ${Xh(e.reviewCount,`review`)}`}function $h(e){if(e.length===0)return null;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return{median:t.length%2==1?t[n]:(t[n-1]+t[n])/2,tasks:t.length}}function eg(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return[...t].map(([e,t])=>({key:e,count:t})).sort((e,t)=>t.count-e.count||e.key.localeCompare(t.key))}function tg(e,t){return e.flatMap(e=>{let[n,r]=t(e);return n===null||r===null?[]:[r-n]})}function ng(e){for(let t of e.refs)if(t.startsWith(`pr:`)&&/^https?:\/\//.test(t.slice(3)))return t.slice(3);return null}function rg(e,t,n,r){let i=new Map(n.map(e=>[e.id,e.name])),a=t.filter(e=>e.outcome===`completed`),o=pg(e),s=a.flatMap(({pullRequest:e})=>e?[e]:[]);return{outcomes:Jh(t).map(e=>({outcome:e.outcome,count:e.entries.length})),commits:t.reduce((e,t)=>e+t.commits.length,0),completedByType:eg(a.map(e=>e.task.taskType)).map(({key:e,count:t})=>({taskType:e,count:t})),completedByWorkspace:eg(a.map(e=>i.get(e.task.workspaceId)??`workspace ${e.task.workspaceId}`)).map(({key:e,count:t})=>({workspace:e,count:t})),leadTime:$h(tg(a,({task:e,at:t})=>[e.milestones.plannedAt,t])),cycleTime:$h(tg(a,({task:e,at:t})=>[e.milestones.startedAt,t])),activeTime:$h(a.flatMap(({task:e,at:t})=>{let n=ii(e.timeline,t);return n===null?[]:[n]})),reviewTime:$h(tg(a,({task:e,at:t})=>[e.milestones.reviewAt,t])),completedPerMonth:o.length<2?null:o.map(e=>({month:e,count:a.filter(t=>Kh(t.at,r).startsWith(e)).length})),changes:s.length===0?null:s.reduce((e,t)=>({pullRequests:e.pullRequests+1,additions:e.additions+t.additions,deletions:e.deletions+t.deletions,changedFiles:e.changedFiles+t.changedFiles}),{pullRequests:0,additions:0,deletions:0,changedFiles:0}),notAdopted:a.filter(({task:e})=>e.resolution===`not_adopted`).length}}function ig(e,t,n){let r=Math.min(n,e),i=t.filter(e=>e.outcome===`completed`),a=i.flatMap(({task:e,at:t})=>{let n=Vi(e.estimate),r=ii(e.timeline,t);return n===null||r===null?[]:[{estimated:n,actual:r}]}),o=i.flatMap(({task:e})=>{let t=Ni(e,n);return t===`on_time`||t===`late`?[t]:[]}),s=t.flatMap(({task:e,outcome:t})=>{if(e.dueDate===null)return[];if(e.status===`done`)return t===`completed`&&Ni(e,n)===`late`?[{task:e,dueDate:e.dueDate,done:!0,secondsLate:Pi(e,n)}]:[];let i=Mi(e.dueDate);return r>=i?[{task:e,dueDate:e.dueDate,done:!1,secondsLate:r-i}]:[]}).sort((e,t)=>t.secondsLate-e.secondsLate||e.task.id-t.task.id);return t.some(({task:e})=>e.estimate!==null||e.dueDate!==null)?{time:a.length===0?null:{tasks:a.length,estimated:a.reduce((e,{estimated:t})=>e+t,0),actual:a.reduce((e,{actual:t})=>e+t,0)},dueDates:o.length===0?null:{tasks:o.length,onTime:o.filter(e=>e===`on_time`).length},late:s}:null}function ag(e){return`${mg(e.estimated)} estimated, ${mg(e.actual)} active (${Xh(e.tasks,`task`)}, ${(e.actual/e.estimated).toFixed(2)}x)`}function og(e){return`${e.onTime} of ${e.tasks} (${Math.round(e.onTime/e.tasks*100)}%)`}function sg({task:e,dueDate:t,done:n,secondsLate:r}){let i=e.milestones.completedAt;return`due ${t}, ${n&&i!==null?`done ${Qr(i)}`:`still open`}, ${mg(r)} ${n?`late`:`overdue`}`}var cg=3,lg=3;function ug(e){let t=e.filter(e=>e.outcome===`completed`),n=t.flatMap(({task:e,pullRequest:t})=>t?[{task:e,pullRequest:t}]:[]),r=t.filter(({task:e})=>e.taskType===`rnd`).map(({task:e,at:t})=>({task:e,at:t,adopted:e.resolution!==`not_adopted`})).sort((e,t)=>e.at-t.at||e.task.id-t.task.id),i=t.flatMap(({task:e,at:t})=>{let n=Vi(e.estimate),r=ii(e.timeline,t);return n===null||r===null||r<=n?[]:[{task:e,estimated:n,actual:r}]}).sort((e,t)=>t.actual-t.estimated-(e.actual-e.estimated)||e.task.id-t.task.id).slice(0,lg);if(n.length===0&&r.length===0&&i.length===0)return null;let a=({pullRequest:e})=>e.additions+e.deletions;return{pullRequests:n.length===0?null:n.reduce((e,{pullRequest:t})=>({pullRequests:e.pullRequests+1,additions:e.additions+t.additions,deletions:e.deletions+t.deletions,changedFiles:e.changedFiles+t.changedFiles,reviews:e.reviews+t.reviewCount,reviewed:e.reviewed+ +(t.reviewCount>0)}),{pullRequests:0,additions:0,deletions:0,changedFiles:0,reviews:0,reviewed:0}),largest:[...n].sort((e,t)=>a(t)-a(e)||e.task.id-t.task.id).slice(0,cg),research:r,overruns:i}}function dg(e){return`${Xh(e.reviews,`review`)} on ${e.reviewed} of ${Xh(e.pullRequests,`pull request`)}`}function fg(e){return`+${e.additions}/-${e.deletions} in ${Xh(e.changedFiles,`file`)} (${Xh(e.pullRequests,`pull request`)})`}function pg(e){let[t,n]=Fh(e.from),r=e.to.slice(0,7),i=[];for(let e=0;;e+=1){let a=Lh(new Date(t,n+e,1)).slice(0,7);if(i.push(a),a>=r)return i}}function mg(e){let t=e/3600;return t<1?`<1h`:Math.round(t)<24?`${Math.round(t)}h`:`${(t/24).toFixed(1)}d`}var hg=[`leadTime`,`cycleTime`,`activeTime`,`reviewTime`],gg={leadTime:`Median lead time (planned to completed)`,cycleTime:`Median cycle time (started to completed)`,activeTime:`Median active time (started to completed, without pauses)`,reviewTime:`Median review time (awaiting completion to merged)`},_g={workspaceId:null,label:null};function vg(e,t){return e.filter(({task:e})=>(t.workspaceId===null||e.workspaceId===t.workspaceId)&&(t.label===null||e.labels.includes(t.label)))}function yg(e){return[...new Set(e.flatMap(({task:e})=>e.labels))].sort()}var bg={quarter:1,year:4};function xg(e){return e.reduce((e,t)=>e+(Vi(t.estimate)??0),0)}function Sg(e,t,n,r){let i=e.filter(e=>!Ki(e)),a=i.filter(e=>e.dueDate!==null).sort((e,t)=>e.dueDate.localeCompare(t.dueDate)||e.id-t.id),o=i.filter(e=>e.dueDate===null),s=new Map;for(let e of a){let n=Uh(t,e.dueDate).from;s.set(n,[...s.get(n)??[],e])}let c=Uh(t,r),l=a.length>0&&a[0].dueDate<c.from?Uh(t,a[0].dueDate):c,u=a.at(-1)?.dueDate,d=u!==void 0&&u>c.to?Uh(t,u):c,f=n===null?null:(Vi(n)??0)*bg[t],p=[];for(let e=l;e.from<=d.from;e=Wh(e,1)){let t=s.get(e.from)??[],n=xg(t);p.push({period:e,label:qh(e),tasks:t,estimated:n,done:xg(t.filter(e=>e.status===`done`)),unestimated:t.filter(e=>e.estimate===null).length,capacity:f,overloaded:f!==null&&n>f})}return{periods:p,unscheduled:o,unscheduledEstimated:xg(o)}}function Cg(e,t){return Bi({unit:t,amount:e/(Vi({unit:t,amount:1})??1)})}var wg=`toodo-plan-capacity`,Tg=[`hours`,`days`,`weeks`,`months`];function Eg(){try{let e=JSON.parse(localStorage.getItem(wg)??`null`);if(typeof e!=`object`||!e)return null;let{unit:t,amount:n}=e;return Tg.includes(t)&&typeof n==`number`&&n>0&&n<=1e4?{unit:t,amount:n}:null}catch{return null}}function Dg(e){e===null?localStorage.removeItem(wg):localStorage.setItem(wg,JSON.stringify(e))}var Og={quarter:`Quarter`,year:`Year`},kg={hours:`hours`,days:`days`,weeks:`weeks`,months:`months`};function Ag({tasks:e,onShowTask:t}){let[n,r]=(0,J.useState)(`quarter`),[i,o]=(0,J.useState)(Eg),[s,c]=(0,J.useState)(i===null?``:String(i.amount)),[l,u]=(0,J.useState)(i?.unit??`weeks`),d=Hi(s),f=(e,t)=>{c(e),u(t);let n=Hi(e);if(Number.isNaN(n))return;let r=n===null?null:{unit:t,amount:n};Dg(r),o(r)},p=i?.unit??l,{periods:m,unscheduled:h,unscheduledEstimated:g}=Sg(e,n,i,Qr(Date.now()/1e3)),_=m.filter(e=>e.overloaded).length;return(0,Y.jsxs)(`div`,{role:`region`,"aria-label":`Plan`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Plan period`,className:`flex gap-1 max-md:gap-2`,children:[`quarter`,`year`].map(e=>(0,Y.jsx)(q,{size:`xs`,variant:n===e?`secondary`:`ghost`,"aria-pressed":n===e,onClick:()=>r(e),children:Og[e]},e))}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground max-md:text-sm`,children:[`Capacity per quarter`,(0,Y.jsx)(`input`,{type:`text`,inputMode:`decimal`,"aria-label":`Capacity per quarter`,"aria-invalid":Number.isNaN(d)||void 0,"aria-describedby":`capacity-hint`,placeholder:`None`,className:a(_t,`w-16`),value:s,onChange:e=>f(e.target.value,l)})]}),(0,Y.jsx)(`select`,{"aria-label":`Capacity unit`,className:_t,value:l,onChange:e=>f(s,e.target.value),children:Object.keys(kg).map(e=>(0,Y.jsx)(`option`,{value:e,children:kg[e]},e))})]}),(0,Y.jsx)(`p`,{id:`capacity-hint`,className:a(`text-xs`,Number.isNaN(d)?`text-destructive`:`text-muted-foreground`),children:Number.isNaN(d)?`Enter a capacity greater than 0 and at most 10000, such as 12, or clear the field for no capacity.`:i===null?`Set a capacity per quarter to see which periods are overloaded. A year holds four quarters.`:_>0?`${_} ${_===1?`period is`:`periods are`} over capacity: move due dates or cut estimates.`:`Every period fits its capacity.`}),(0,Y.jsx)(`ol`,{"aria-label":`Periods`,className:`flex flex-col gap-3`,children:m.map(e=>(0,Y.jsx)(jg,{load:e,unit:p,onShowTask:t},e.period.from))}),h.length>0&&(0,Y.jsxs)(`section`,{"aria-label":`No due date`,className:`flex flex-col gap-2 rounded-xl border border-dashed p-3`,children:[(0,Y.jsxs)(`h3`,{className:`flex items-baseline gap-2 text-sm font-medium`,children:[`No due date`,(0,Y.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground tabular-nums`,children:[h.length,` `,h.length===1?`task`:`tasks`,`, `,Cg(g,p),` `,`estimated`]})]}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Set a due date on these tasks to count them in a period.`}),(0,Y.jsx)(Mg,{tasks:h,onShowTask:t})]})]})}function jg({load:e,unit:t,onShowTask:n}){let{capacity:r,estimated:i,overloaded:o}=e,s=r===null||r===0?null:i/r;return(0,Y.jsxs)(`li`,{"aria-label":e.label,"data-overloaded":o||void 0,className:a(`flex flex-col gap-2 rounded-xl border bg-card p-3 shadow-xs`,o&&`border-destructive/60 bg-destructive/5`),children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:e.label}),(0,Y.jsxs)(`span`,{className:`text-sm tabular-nums`,children:[Cg(i,t),r!==null&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` of `,Cg(r,t)]}),s!==null&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` (`,Math.round(s*100),`%)`]})]}),o&&r!==null&&(0,Y.jsxs)(`span`,{className:`text-xs font-medium text-destructive`,children:[`Over capacity by `,Cg(i-r,t)]}),(0,Y.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[e.tasks.length,` `,e.tasks.length===1?`task`:`tasks`,e.done>0&&`, ${Cg(e.done,t)} done`]})]}),s!==null&&(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,Y.jsx)(`div`,{className:a(`h-full rounded-full`,o?`bg-destructive`:`bg-primary`),style:{width:`${Math.min(s,1)*100}%`}})}),e.unestimated>0&&(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.unestimated,` `,e.unestimated===1?`task has`:`tasks have`,` no estimate and `,e.unestimated===1?`is`:`are`,` not counted: estimate `,e.unestimated===1?`it`:`them`,` to complete the sum.`]}),e.tasks.length>0&&(0,Y.jsx)(Mg,{tasks:e.tasks,onShowTask:n})]})}function Mg({tasks:e,onShowTask:t}){return(0,Y.jsx)(`ul`,{className:`flex flex-col text-sm`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-baseline gap-2 py-0.5`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:a(`min-w-0 truncate rounded-sm text-left outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,e.status===`done`&&`text-muted-foreground line-through`),onClick:()=>t(e.id),children:[(0,Y.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`#`,e.id]}),` `,e.title]}),(0,Y.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.estimate===null?`No estimate`:Bi(e.estimate),e.dueDate!==null&&` · due ${e.dueDate}`]})]},e.id))})}var Ng=(0,J.lazy)(()=>Za(()=>import(`./task-graph-S1xlbcq-.js`).then(e=>({default:e.TaskGraph})),__vite__mapDeps([8,1,4,5,6,7,9]))),Pg=(0,J.lazy)(()=>Za(()=>import(`./task-details-S81PKtIo.js`).then(e=>({default:e.TaskDetailsSheet})),__vite__mapDeps([3,1,4,5,6,2,7])));function Fg(e,t){let n=e=>`${e} ${e===1?`task`:`tasks`}`;return e===t?`Showing ${n(t)}.`:`Showing ${e} of ${n(t)}.`}function Ig({workspace:e,timelineScale:t,onTimelineScaleChange:n,draft:r=kh,onDraftChange:i,shownTask:s=null,onTaskShown:c,view:l=`list`,onViewChange:u,selectedTask:d,onSelectTask:f}){let p=o(),[m,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(null),v=Ge([s?.id,d,Wa(g?.query??``)]),[y,b]=(0,J.useState)(!1),[x,S]=(0,J.useState)(null),C=new Map(p.data?.map(e=>[e.id,e])),w={byId:new Map(v.data?.map(e=>[e.id,e])),workspaceName:e=>C.get(e)?.name??`Workspace ${e}`},T=e===null?v.data:v.data?.filter(t=>t.workspaceId===e.id),E=e===null&&l===`timeline`,D=e===null&&l===`plan`,O=E||D,k=g??(E?Va:Ba),A=[...new Set(v.data?.map(e=>e.workspaceId))].sort((e,t)=>w.workspaceName(e).localeCompare(w.workspaceName(t))),j=m!==null&&A.includes(m)?m:null,M=[O&&j!==null,k.query.trim()!==``,k.statuses.length>0,k.type!==null].filter(Boolean).length,N=Wa(k.query),P=N===null?void 0:w.byId.get(N),F=P!==void 0&&Ga(P,{...k,query:``},w.byId)?P:void 0,I=T?.filter(e=>e!==F&&(!O||j===null||e.workspaceId===j)&&Ga(e,k,w.byId)),L=F===void 0?I??[]:[F,...I??[]],R=O?k.statuses.length===0||k.statuses.some(e=>e===`done`||e===`not_adopted`):x??Ha(k),z=s===null?void 0:w.byId.get(s.id);(0,J.useEffect)(()=>{z!==void 0&&(h(e=>e===z.workspaceId?e:null),_(e=>Ga(z,e??Va,w.byId)?e:Ba))},[s,z===void 0]),(0,J.useEffect)(()=>{if(E)return;let e=e=>{let t=e.key===`j`?1:e.key===`k`?-1:0;if(t===0||!Ci(e)||document.querySelector(`form[data-dirty]`))return;let n=[...document.querySelectorAll(`[data-task-row] [data-task-title]`)],r=e=>e.closest(`[data-task-row]`),i=n.findIndex(e=>r(e).contains(document.activeElement));i===-1&&(i=n.findIndex(e=>r(e).dataset.taskRow===String(d)));let a=n[i===-1?t>0?0:n.length-1:i+t];a!==void 0&&(e.preventDefault(),a.focus(),a.scrollIntoView?.({block:`nearest`}),d!==null&&f(Number(r(a).dataset.taskRow)))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)});let B=j===null?[]:(T??[]).filter(e=>e!==F&&e.workspaceId!==j&&L.some(t=>t.dependsOn.includes(e.id)));return(0,Y.jsxs)(`section`,{"aria-labelledby":`tasks-heading`,className:`flex flex-1 flex-col gap-4 max-md:gap-3`,children:[(0,Y.jsxs)(`header`,{className:`flex flex-col max-md:gap-2`,children:[(0,Y.jsx)(`h2`,{id:`tasks-heading`,className:`text-xl font-semibold tracking-tight`,children:e?.name??`All workspaces`}),e?(0,Y.jsx)(gh,{workspace:e},e.id):(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground max-md:hidden`,children:`Tasks of every workspace and the dependencies between them.`})]}),e&&(0,Y.jsx)(Sh,{workspace:e},e.id),e&&i&&(0,Y.jsx)(Ah,{workspace:e,draft:r,onChange:i}),(0,Y.jsx)(`p`,{role:`status`,className:a(`text-sm text-muted-foreground`,!v.isPending&&`sr-only`),children:v.isPending?`Loading tasks...`:T&&I?Fg(I.length+ +!!F,T.length):``}),v.isError&&(0,Y.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load tasks: `,v.error.message]}),T?.length===0&&(0,Y.jsx)(zg,{title:e?`No tasks in this workspace yet.`:`No tasks yet.`,hint:e?`Plan the first task above; tasks can depend on each other across workspaces.`:`Pick a workspace in the sidebar to plan its tasks.`}),v.data&&T&&I&&T.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e===null&&(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Task view`,className:`flex gap-1 max-md:gap-2`,children:[`timeline`,`list`,`plan`].map(e=>(0,Y.jsx)(q,{size:`xs`,variant:l===e?`default`:`ghost`,"aria-pressed":l===e,onClick:()=>u?.(e),children:e===`list`?`List`:e===`plan`?`Plan`:`Timeline`},e))}),(0,Y.jsxs)(q,{size:`xs`,variant:y?`secondary`:`outline`,className:`ml-auto md:hidden`,"aria-expanded":y,"aria-controls":`task-filters`,onClick:()=>b(!y),children:[(0,Y.jsx)(Er,{}),`Filters`,M>0&&(0,Y.jsxs)(`span`,{className:`rounded-full bg-primary px-1.5 text-[0.625rem] leading-4 text-primary-foreground tabular-nums`,children:[M,(0,Y.jsx)(`span`,{className:`sr-only`,children:` active`})]})]}),(0,Y.jsxs)(`div`,{id:`task-filters`,className:a(`contents`,!y&&`max-md:hidden`),children:[O&&(0,Y.jsxs)(`select`,{"aria-label":D?`Plan workspace`:`Timeline workspace`,className:`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,value:j??`all`,onChange:e=>h(e.target.value===`all`?null:Number(e.target.value)),children:[(0,Y.jsx)(`option`,{value:`all`,children:`All workspaces`}),A.map(e=>(0,Y.jsx)(`option`,{value:e,children:w.workspaceName(e)},e))]}),(0,Y.jsx)(Lg,{filter:k,onChange:_})]})]}),I.length===0&&F===void 0?(0,Y.jsx)(zg,{icon:(0,Y.jsx)(br,{}),title:`No tasks match the search and filters.`,hint:`Change the search text, status, or type, or clear the filters.`}):E?(0,Y.jsx)(Oi,{label:`the timeline`,children:(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Loading timeline...`}),children:(0,Y.jsx)(Ng,{tasks:[...L,...B],allTasks:v.data,dimmed:new Set(B.map(e=>e.id)),workspaceLabel:e=>j===null||e.workspaceId!==j?w.workspaceName(e.workspaceId):null,statusLabel:e=>eo(e,w.byId),statusStyle:e=>ao(e,w.byId),ready:e=>Fa(e,w.byId)===`ready`,scale:t,onScaleChange:n,selectedTaskId:d,onSelectedTaskChange:f,shownTaskId:s?.id??null,onTaskShown:()=>c?.(),renderDetail:(e,t)=>(0,Y.jsx)(ph,{task:e,tasks:v.data??[],context:w,showWorkspace:!0,detailed:!0,navigation:t},e.id)})})}):(0,Y.jsxs)(Y.Fragment,{children:[D?(0,Y.jsx)(Ag,{tasks:L,onShowTask:f}):(0,Y.jsxs)(`div`,{role:`region`,"aria-label":`Tasks`,className:`flex flex-col gap-4`,children:[F&&(0,Y.jsxs)(`section`,{"aria-label":`Task number match`,className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`h3`,{className:`text-sm font-medium text-muted-foreground`,children:[`Task `,(0,Y.jsxs)(`span`,{className:`tabular-nums font-normal`,children:[`#`,F.id]})]}),(0,Y.jsx)(`ul`,{"aria-label":`Task number match`,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:(0,Y.jsx)(ph,{task:F,tasks:v.data,context:w,showWorkspace:e===null||F.workspaceId!==e.id,onShowDetails:()=>f(F.id)})})]}),za(I,w.byId,Aa(I,Date.now()/1e3,w.byId).map(e=>e.task.id)).map(({group:t,tasks:n})=>{let r=t===`done`&&!(x??Ha(k)),i=La[t],o=(0,Y.jsx)(`span`,{className:`tabular-nums font-normal`,children:n.length});return(0,Y.jsxs)(`section`,{"aria-label":i,className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`h3`,{className:`flex items-center gap-1.5 text-sm font-medium text-muted-foreground`,children:t===`done`?(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":!r,className:`flex items-center gap-1.5 rounded-sm outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>S(r),children:[(0,Y.jsx)(vn,{"aria-hidden":!0,className:a(`size-4 transition-transform`,r&&`-rotate-90`)}),i,` `,o]}):(0,Y.jsxs)(Y.Fragment,{children:[i,` `,o]})}),t===`done`&&e&&(0,Y.jsx)(Rg,{workspace:e})]}),!r&&(0,Y.jsx)(`ul`,{"aria-label":i,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:n.map(t=>(0,Y.jsx)(ph,{task:t,tasks:v.data,context:w,showWorkspace:e===null,onShowDetails:()=>f(t.id)},t.id))})]},t)})]}),d!==null&&w.byId.has(d)&&(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading details...`}),children:(0,Y.jsx)(Pg,{onClose:()=>f(null),children:(0,Y.jsx)(ph,{task:w.byId.get(d),tasks:v.data,context:w,showWorkspace:!0,detailed:!0,navigation:{open:f,canOpen:e=>w.byId.has(e)}},d)})})]}),v.hasNextPage&&R&&(0,Y.jsx)(q,{size:`xs`,variant:`outline`,className:`self-start`,disabled:v.isFetchingNextPage,onClick:()=>void v.fetchNextPage(),children:v.isFetchingNextPage?`Loading older finished tasks...`:`Load older finished tasks`})]})]})}function Lg({filter:e,onChange:t}){return(0,Y.jsxs)(`div`,{role:`search`,"aria-label":`Task filters`,className:`flex flex-1 flex-wrap items-center justify-end gap-2 max-md:grid max-md:basis-full max-md:grid-cols-2`,children:[(0,Y.jsx)(`input`,{type:`search`,"aria-label":`Search tasks`,placeholder:`Search title, description, or #number`,className:a(_t,`w-56 max-md:col-span-2 max-md:w-full`),value:e.query,onChange:n=>t({...e,query:n.target.value})}),(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Status filter`,className:`flex flex-wrap gap-1 max-md:col-span-2 max-md:gap-2`,children:Pa.map(n=>{let r=e.statuses.includes(n),i=to[n];return(0,Y.jsxs)(`button`,{type:`button`,className:a(`inline-flex h-6 shrink-0 items-center gap-1 rounded-full border px-2 text-xs font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,r?a(ro(n),`border-transparent hover:brightness-95 dark:hover:brightness-125`):a(Ur[i],`bg-transparent hover:bg-muted`)),"aria-pressed":r,onClick:()=>t({...e,statuses:Ua(e.statuses,n)}),children:[r?(0,Y.jsx)(gn,{"aria-hidden":!0,className:`size-3`}):(0,Y.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 rounded-full`,Kr[i])}),zr[n]]},n)})}),(0,Y.jsxs)(`select`,{"aria-label":`Type filter`,className:_t,value:e.type??`all`,onChange:n=>t({...e,type:n.target.value===`all`?null:n.target.value}),children:[(0,Y.jsx)(`option`,{value:`all`,children:`All types`}),$a.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))]}),Ha(e)&&(0,Y.jsxs)(q,{size:`xs`,variant:`ghost`,onClick:()=>t(Ba),children:[(0,Y.jsx)(vt,{}),`Clear filters`]})]})}function Rg({workspace:e}){let t=Ce(),[n,r]=(0,J.useState)(null),i=n!==null,[o,s]=(0,J.useState)(!1),c=le(e.id,i),l=n!==null&&c.isSuccess&&c.dataUpdatedAt>=n?c.data:void 0,u=l===void 0?`done tasks`:`${l} done ${l===1?`task`:`tasks`}`;function d(){r(null),s(!0)}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{role:i?`group`:void 0,"aria-label":i?`Delete ${u}?`:void 0,className:a(`ml-auto flex items-center gap-1 max-md:gap-2`,i&&`basis-full flex-wrap justify-end`),onKeyDown:i?mt(d,t.isPending):void 0,children:i?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 basis-48 text-xs`,children:l===void 0?`Counting done tasks...`:l===1?`Delete ${u}? It moves to Settings > Archive with its history, where it can be restored.`:`Delete ${u}? They move to Settings > Archive with their history, where they can be restored.`}),(0,Y.jsxs)(q,{changesData:!0,size:`xs`,variant:`destructive`,disabled:t.isPending||l===void 0||c.isFetching,onClick:()=>t.mutate(e.id,{onSuccess:d}),children:[(0,Y.jsx)(Pr,{}),t.isPending?`Deleting...`:`Confirm delete`]}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:d,children:`Back`})]}):(0,Y.jsxs)(q,{size:`xs`,variant:`ghost`,title:`Move every done task of this workspace to the archive`,autoFocus:o,className:`text-destructive hover:bg-destructive/10 hover:text-destructive dark:hover:bg-destructive/20`,onClick:()=>{t.reset(),r(Date.now())},children:[(0,Y.jsx)(Pr,{}),`Delete done`]})}),t.isError?(0,Y.jsx)(`p`,{role:`alert`,className:`basis-full text-xs text-destructive`,children:t.error.message}):i&&c.isError&&(0,Y.jsxs)(`p`,{role:`alert`,className:`basis-full text-xs text-destructive`,children:[`Could not count the done tasks: `,c.error.message,` Choose Back, then Delete done to count them again.`]})]})}function zg({title:e,hint:t,icon:n,action:r}){return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-1 rounded-xl border border-dashed px-6 py-10 text-center`,children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`mb-1 text-muted-foreground [&_svg]:size-6`,children:n??(0,Y.jsx)(Hn,{})}),(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:e}),t&&(0,Y.jsx)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:t}),r&&(0,Y.jsx)(`div`,{className:`mt-2`,children:r})]})}function Bg(e){let t={type:`http`,url:e.url,headers:{Authorization:`Bearer ${e.token??``}`}};return JSON.stringify({mcpServers:{toodo:t}},null,2)}async function Vg(e){let t={Authorization:`Bearer ${e.token??``}`,"Content-Type":`application/json`,Accept:`application/json, text/event-stream`},n=await Ot(`/mcp`,{method:`POST`,headers:t,body:JSON.stringify({jsonrpc:`2.0`,id:1,method:`initialize`,params:{protocolVersion:`2025-06-18`,capabilities:{},clientInfo:{name:`toodo-web`,version:`1`}}})}),r=await n.text();if(!n.ok)return{ok:!1,message:r.trim()||`The MCP server answered ${n.status} ${n.statusText}.`};let i=n.headers.get(`mcp-session-id`);i&&Ot(`/mcp`,{method:`DELETE`,headers:{...t,"mcp-session-id":i}}).catch(()=>{});let a;try{a=JSON.parse(r)?.result?.serverInfo?.title}catch{a=void 0}return typeof a!=`string`||!a.includes(e.instance)?{ok:!1,message:`The answer came from another server (${String(a??`no server title`)}), not instance ${e.instance}.`}:{ok:!0,message:`Connected: instance ${e.instance} accepts this token.`}}var Hg={no_header:`no Authorization header`,not_bearer:`the header was not Bearer <token>`,wrong_token:`a token this server does not accept (old, mistyped, or another server's)`,web_token:`the web sign-in token instead of the MCP token`};function Ug(e){return e.split(/(?<=\/)(?!\/)/).map((e,t)=>(0,Y.jsxs)(`span`,{children:[t>0&&(0,Y.jsx)(`wbr`,{}),e]},t))}function Wg(){let e=z(),[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);async function o(e,t){try{await navigator.clipboard.writeText(e),n(`Copied ${t}.`)}catch(e){n(`Could not copy: ${String(e)}`)}}async function s(e){i(`testing`);try{i(await Vg(e))}catch(e){i({ok:!1,message:`Could not reach the MCP server: ${String(e)}`})}}let c=e.data,l=c?.lastRejection;return(0,Y.jsxs)(`section`,{"aria-label":`Agent access`,className:`flex flex-col gap-2 text-sm`,children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Agents on the server can plan tasks and connect dependencies through the Toodo server's MCP endpoint.`}),c&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`code`,{className:`overflow-x-auto break-normal rounded bg-muted px-1.5 py-1 [overflow-wrap:normal]`,"aria-label":`MCP server URL`,children:Ug(c.url)}),c.error?(0,Y.jsxs)(`p`,{role:`alert`,className:`text-destructive`,children:[`MCP server is not running: `,c.error]}):c.token&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(q,{size:`xs`,onClick:()=>void o(Bg(c),`the MCP config`),children:`Copy MCP config`}),(0,Y.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>void o(c.token??``,`the MCP token for agents`),children:`Copy MCP token for agents`}),(0,Y.jsx)(q,{size:`xs`,variant:`outline`,disabled:r===`testing`,onClick:()=>void s(c),children:`Test connection`})]}),r&&r!==`testing`&&(0,Y.jsx)(`p`,{role:`status`,"aria-label":`Connection test`,className:a(`break-words`,!r.ok&&`text-destructive`),children:r.message}),(0,Y.jsxs)(`p`,{className:`text-muted-foreground`,children:[`The MCP token is for agents only; the web app signs in with the server's web token (`,(0,Y.jsx)(`code`,{children:`web-token`}),`). Server instance `,(0,Y.jsx)(`code`,{"aria-label":`Server instance`,children:c.instance}),`, which agents see in`,` `,(0,Y.jsx)(`code`,{children:`401`}),` replies and `,(0,Y.jsx)(`code`,{children:`serverInfo`}),`.`]}),l&&(0,Y.jsxs)(`p`,{"aria-label":`Last rejected agent request`,className:`break-words text-destructive`,children:[`Last rejected agent request`,` `,(0,Y.jsx)(`time`,{dateTime:new Date(l.at*1e3).toISOString(),title:ni(l.at),children:ti(l.at)}),`: `,Hg[l.reason],l.count>1&&` (${l.count} since the server started)`,`.`]})]}),t&&(0,Y.jsx)(`p`,{role:`status`,children:t})]})}function Gg(){let e=Be(),t=M(),n=O(),r=A(),i=f(),[a,o]=(0,J.useState)(null),s=t.isPending||n.isPending||r.isPending||i.isPending,c=t.error??n.error??r.error??i.error??e.error,l=()=>{for(let e of[t,n,r,i])e.reset()};function u(e){let t={onSuccess:()=>o(null)};e.kind===`workspace`?r.mutate(e.id,t):i.mutate(e.id,t)}let d=e.data?.workspaces??[],p=e.data?.tasks??[];return(0,Y.jsxs)(`section`,{"aria-label":`Archive`,className:`flex flex-col gap-3 text-xs`,children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Deleted workspaces and tasks are kept here with their history and still count in reviews. Restore one to bring it back, or delete it permanently.`}),a&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm permanent delete`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,children:[(0,Y.jsxs)(`p`,{className:`break-words`,children:[`Permanently delete `,(0,Y.jsx)(`span`,{className:`font-medium`,children:a.name}),a.kind===`workspace`?` and its tasks`:``,`? Its history, commits, and links are removed and leave the reviews; this cannot be undone.`]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`destructive`,onClick:()=>u(a),disabled:s,children:r.isPending||i.isPending?`Deleting...`:`Delete permanently`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>o(null),disabled:s,children:`Cancel`})]})]}),c&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:c.message}),(0,Y.jsx)(Kg,{label:`Archived workspaces`,empty:`No archived workspaces.`,children:d.map(e=>(0,Y.jsx)(qg,{name:e.name,detail:e.repository??``,busy:s,onRestore:()=>{l(),t.mutate(e.id)},onPurge:()=>{l(),o({kind:`workspace`,id:e.id,name:e.name})}},e.id))}),(0,Y.jsx)(Kg,{label:`Archived tasks`,empty:`No archived tasks.`,children:p.map(e=>(0,Y.jsx)(qg,{name:`#${e.id} ${e.title}`,detail:e.status.replace(`_`,` `),busy:s,onRestore:()=>{l(),n.mutate(e.id)},onPurge:()=>{l(),o({kind:`task`,id:e.id,name:`#${e.id} ${e.title}`})}},e.id))})]})}function Kg({label:e,empty:t,children:n}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`h4`,{className:`font-medium`,children:e}),(0,Y.jsxs)(`ul`,{"aria-label":e,className:`flex flex-col divide-y`,children:[n.length===0&&(0,Y.jsx)(`li`,{className:`text-muted-foreground`,children:t}),n]})]})}function qg({name:e,detail:t,busy:n,onRestore:r,onPurge:i}){return(0,Y.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 first:pt-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,Y.jsx)(`span`,{className:`truncate text-muted-foreground`,children:t})]}),(0,Y.jsxs)(`span`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`outline`,"aria-label":`Restore ${e}`,disabled:n,onClick:r,children:`Restore`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,className:`hover:text-destructive`,"aria-label":`Delete ${e} permanently`,disabled:n,onClick:i,children:`Delete permanently`})]})]})}var Jg=[`connected-apps`];function Yg(e){return e.split(` `).includes(`toodo.write`)?`Read and write access`:`Read access`}function Xg({url:e}){let[t,n]=(0,J.useState)(null);async function r(e){try{await navigator.clipboard.writeText(e),n(`Copied the MCP URL.`)}catch(e){n(`Could not copy (${String(e)}). Select the URL and copy it by hand.`)}}return e===null?(0,Y.jsxs)(`p`,{className:`text-muted-foreground`,children:[`To connect ChatGPT or Claude, restart the server with `,(0,Y.jsx)(`code`,{children:`TOODO_PUBLIC_URL`}),` set to the`,` `,(0,Y.jsx)(`code`,{children:`https://`}),` origin they reach it at; see `,(0,Y.jsx)(`code`,{children:`docs/server.md`}),`.`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Add this URL to ChatGPT or Claude as a remote MCP connector with OAuth, leaving client ID and secret empty, then approve the app with `,(0,Y.jsx)(`code`,{children:`web-token`}),`.`]}),(0,Y.jsx)(`code`,{className:`overflow-x-auto break-normal rounded bg-muted px-1.5 py-1 [overflow-wrap:normal]`,"aria-label":`Public MCP URL`,children:e}),(0,Y.jsx)(q,{size:`xs`,className:`self-start`,onClick:()=>void r(e),children:`Copy MCP URL`}),t&&(0,Y.jsx)(`p`,{role:`status`,children:t})]})}function Zg({app:e}){let t=Fe(),[n,r]=(0,J.useState)(!1),i=re({mutationFn:()=>Le(be.revokeConnectedApp(e.grantId)),onSuccess:()=>t.invalidateQueries({queryKey:Jg})}),a=e.clientName??e.clientId;return(0,Y.jsxs)(`li`,{"aria-label":`App ${a}`,className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:a}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Yg(e.scopes)}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,Y.jsx)(ci,{at:e.createdAt,prefix:`Connected `}),` · `,e.lastUsedAt===null?`Not used yet`:(0,Y.jsx)(ci,{at:e.lastUsedAt,prefix:`Last used `})]}),n?(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm revoke of ${a}`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,onKeyDown:mt(()=>r(!1),i.isPending),children:[(0,Y.jsx)(`p`,{children:`The app's tokens stop working at once; to use it later, connect it again from the app.`}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`destructive`,disabled:i.isPending,onClick:()=>i.mutate(),children:`Revoke`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>r(!1),children:`Keep`})]})]}):(0,Y.jsx)(q,{size:`xs`,variant:`outline`,className:`self-start`,"aria-label":`Revoke ${a}`,onClick:()=>r(!0),children:`Revoke`}),i.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:i.error.message})]})}function Qg(){let e=ae({queryKey:Jg,queryFn:()=>Le(be.listConnectedApps())});return(0,Y.jsxs)(`section`,{"aria-label":`Connected apps`,className:`flex flex-col gap-2 text-sm`,children:[e.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:e.error.message}),e.data&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Xg,{url:e.data.publicMcpUrl}),e.data.apps.length===0?(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`No apps connected yet.`}):(0,Y.jsx)(`ul`,{"aria-label":`Apps with access`,className:`flex flex-col gap-2`,children:e.data.apps.map(e=>(0,Y.jsx)(Zg,{app:e},e.grantId))})]})]})}var $g={scope:`full`,expiresInDays:90},e_=[{label:`90 days`,days:90},{label:`30 days`,days:30},{label:`1 year`,days:365},{label:`Never expires`,days:null}];function t_(e,t){return JSON.stringify({label:e,scope:t.scope,expiresInDays:t.expiresInDays})}var n_=class extends Error{constructor(){super(`The server did not accept this token.`)}};async function r_(e){if(e.status===401)throw new n_;if(!e.ok)throw Error(await xt(e));return e}async function i_(e,t,n=$g){return(await(await r_(await bt.fetch(`/api/devices`,{headers:Tt(e)}))).json()).some(e=>e.current)?e:(await(await r_(await bt.fetch(`/api/devices`,{method:`POST`,headers:{...Tt(e),"Content-Type":`application/json`},body:t_(t,n)}))).json()).token}async function a_(){return await(await kt(`/api/devices`)).json()}async function o_(e,t=$g){return(await(await kt(`/api/devices`,{method:`POST`,headers:{"Content-Type":`application/json`},body:t_(e,t)})).json()).token}async function s_(e){return await(await kt(`/api/devices/${e}/revoke`,{method:`POST`})).json()}function c_(e){let t=[[`Edg/`,`Edge`],[`Firefox/`,`Firefox`],[`Chrome/`,`Chrome`],[`Safari/`,`Safari`]].find(([t])=>e.includes(t))?.[1]??`Browser`,n=[[`Android`,`Android`],[`iPhone`,`iOS`],[`iPad`,`iPadOS`],[`Windows`,`Windows`],[`Mac OS`,`macOS`],[`Linux`,`Linux`]].find(([t])=>e.includes(t))?.[1];return n?`${t} on ${n}`:t}var l_=[`devices`];function u_({devices:e}){let t=Fe(),n=re({mutationFn:()=>o_(c_(navigator.userAgent)),onSuccess:e=>(St(e),t.invalidateQueries({queryKey:l_}))}),r=e.find(e=>e.current);return(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`This browser`,className:`flex flex-col gap-1 rounded-md bg-muted px-2 py-1.5`,children:[(0,Y.jsxs)(`p`,{children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`This browser: `}),(0,Y.jsx)(`span`,{className:`font-medium break-words`,children:r?r.label:`shared token`})]}),!r&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Register it to give it a token of its own that you can revoke alone.`}),(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`outline`,className:`self-start`,disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?`Registering...`:`Register this browser`})]}),n.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:n.error.message})]})}function d_({device:e}){let t=Fe(),[n,r]=(0,J.useState)(!1),i=re({mutationFn:()=>s_(e.id),onSuccess:()=>t.invalidateQueries({queryKey:l_})}),a=e.revokedAt!==null;return(0,Y.jsxs)(`li`,{"aria-label":`Device ${e.label}`,"data-revoked":a,className:`flex flex-col gap-0.5`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:a?`truncate text-muted-foreground line-through`:`truncate font-medium`,children:e.label}),e.current&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`(this device)`}),e.scope===`read`&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`read-only`})]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.revokedAt===null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ci,{at:e.lastSeenAt,prefix:`Last seen `}),` · `,e.expiresAt===null?`never expires`:(0,Y.jsx)(ci,{at:e.expiresAt,prefix:e.expiresAt*1e3<=Date.now()?`expired `:`expires `})]}):(0,Y.jsx)(ci,{at:e.revokedAt,prefix:`Revoked `})}),!a&&(n?(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm revoke of ${e.label}`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,onKeyDown:mt(()=>r(!1),i.isPending),children:[(0,Y.jsx)(`p`,{children:e.current?`This browser signs out and needs the shared token to sign in again.`:`The device's token stops working for good.`}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`destructive`,disabled:i.isPending,onClick:()=>i.mutate(),children:`Revoke`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>r(!1),children:`Keep`})]})]}):(0,Y.jsx)(q,{size:`xs`,variant:`outline`,className:`self-start`,"aria-label":`Revoke ${e.label}`,onClick:()=>r(!0),children:`Revoke`})),i.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:i.error.message})]})}function f_(){let e=ae({queryKey:l_,queryFn:a_});if(!e.data)return null;let t=Date.now()/1e3,n=e.data.filter(e=>e.revokedAt===null&&(e.expiresAt===null||e.expiresAt>t));return(0,Y.jsxs)(Y.Fragment,{children:[n.length,` signed in`]})}function p_(){let e=ae({queryKey:l_,queryFn:a_});return(0,Y.jsxs)(`section`,{"aria-label":`Devices`,className:`flex flex-col gap-2 text-sm`,children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Each browser signs in with the shared token once and then keeps its own token until it expires. Revoke a lost device here.`}),e.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:e.error.message}),e.data&&(0,Y.jsx)(u_,{devices:e.data}),e.data&&(0,Y.jsx)(`ul`,{"aria-label":`Signed-in devices`,className:`flex flex-col gap-2`,children:e.data.map(e=>(0,Y.jsx)(d_,{device:e},e.id))})]})}var m_=[`push`],h_=[{key:`completion`,label:`Task awaiting completion`}],g_={"needs-install":`Add Toodo to the Home Screen to get notifications (iOS 16.4 or later).`,unsupported:`This browser cannot get notifications from Toodo.`};function __({subscription:e,permission:t}){return e?`on`:t===`denied`?`blocked`:`off`}function v_({failure:e}){return(0,Y.jsxs)(`div`,{role:`note`,"aria-label":`Last delivery failure`,className:`flex flex-col gap-0.5 rounded-md border border-destructive/40 p-2`,children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`The last notification did not reach this device`}),(0,Y.jsxs)(`p`,{className:`break-words text-muted-foreground`,children:[(0,Y.jsx)(`time`,{dateTime:new Date(e.at*1e3).toISOString(),title:ni(e.at),children:ti(e.at)}),`: `,e.message]}),(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Send a test notification to check again. If it keeps failing, disable and enable notifications to subscribe this device anew.`})]})}function y_({state:e}){let t=Fe(),n=e=>t.setQueryData(m_,t=>t&&{...t,subscription:e}),r=()=>t.invalidateQueries({queryKey:m_}),i=re({mutationFn:t=>et(t,e.publicKey),onSuccess:n,onError:r}),a=re({mutationFn:_e,onSuccess:()=>n(null),onError:r}),o=re({mutationFn:ce,onSuccess:n}),s=re({mutationFn:He,onSettled:r}),c=[i,a,o,s].reduce((e,t)=>t.submittedAt>e.submittedAt?t:e),l=()=>i.mutate(Notification.requestPermission()),{subscription:u}=e,d=(o.isPending?o.variables:void 0)??u?.settings;return(0,Y.jsxs)(Y.Fragment,{children:[u&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Notifications are on for this device.`}),u.lastFailure&&(0,Y.jsx)(v_,{failure:u.lastFailure}),(0,Y.jsxs)(`fieldset`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`legend`,{className:`mb-1 text-muted-foreground`,children:`Notify about`}),h_.map(({key:e,label:t})=>(0,Y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:d[e],disabled:o.isPending,onChange:t=>o.mutate({...d,[e]:t.target.checked})}),t]},e))]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`outline`,disabled:s.isPending,onClick:()=>s.mutate(),children:`Send test notification`}),(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`ghost`,"aria-label":`Disable notifications on this device`,disabled:a.isPending,onClick:()=>a.mutate(),children:`Disable notifications`})]})]}):e.permission===`denied`?(0,Y.jsx)(`p`,{children:`Notifications are blocked for Toodo in the browser settings. Allow them there to turn them on.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Notifications are off for this device.`}),(0,Y.jsx)(q,{size:`xs`,className:`self-start`,"aria-label":`Enable notifications on this device`,disabled:i.isPending,onClick:l,children:`Enable notifications`})]}),c===s&&s.isSuccess&&(0,Y.jsx)(`p`,{role:`status`,className:`text-muted-foreground`,children:`Test notification sent.`}),c.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:c.error.message})]})}function b_(){let[e]=(0,J.useState)(De);return{support:e,state:ae({queryKey:m_,queryFn:ze,enabled:e===`supported`})}}function x_(){let{state:e}=b_();return e.data?(0,Y.jsx)(Y.Fragment,{children:__(e.data)}):null}function S_(){let{support:e,state:t}=b_();return(0,Y.jsxs)(`section`,{"aria-label":`Notifications`,className:`flex flex-col gap-2 text-sm`,children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:e===`supported`?`Alerts reach this device even while Toodo is closed.`:g_[e]}),t.isLoading&&(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Checking this device...`}),t.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:t.error.message}),t.data&&(0,Y.jsx)(y_,{state:t.data})]})}var C_=[`light`,`dark`,`system`],w_=`toodo-theme`,T_=`(prefers-color-scheme: dark)`,E_=new Set,D_={light:`#ffffff`,dark:`#0a0a0a`};function O_(e){return C_.includes(e)}function k_(){let e=localStorage.getItem(w_);return O_(e)?e:`system`}function A_(){let e=k_(),t=e===`dark`||e===`system`&&window.matchMedia(T_).matches;document.documentElement.classList.toggle(`dark`,t),document.documentElement.style.colorScheme=t?`dark`:`light`;for(let e of document.querySelectorAll(`meta[name="theme-color"]`))e.setAttribute(`content`,t?D_.dark:D_.light)}function j_(e){localStorage.setItem(w_,e),A_(),E_.forEach(e=>e())}function M_(){A_(),window.matchMedia(T_).addEventListener(`change`,A_)}function N_(e){return E_.add(e),()=>E_.delete(e)}function P_(){return(0,J.useSyncExternalStore)(N_,k_)}var F_=[{value:`light`,label:`Light theme`,Icon:Mr},{value:`dark`,label:`Dark theme`,Icon:ir},{value:`system`,label:`System theme`,Icon:nr}];function I_(){let e=P_();return(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Theme`,className:`flex gap-0.5 rounded-lg border p-0.5`,children:F_.map(({value:t,label:n,Icon:r})=>(0,Y.jsx)(q,{variant:e===t?`default`:`ghost`,size:`icon-sm`,"aria-label":n,"aria-pressed":e===t,title:n,onClick:()=>j_(t),children:(0,Y.jsx)(r,{})},t))})}var L_=[{id:`general`,label:`General`,icon:(0,Y.jsx)(Er,{})},{id:`agents`,label:`Agent access`,icon:(0,Y.jsx)(cn,{})},{id:`apps`,label:`Connected apps`,icon:(0,Y.jsx)(mr,{})},{id:`devices`,label:`Devices`,icon:(0,Y.jsx)(er,{}),status:(0,Y.jsx)(f_,{})},{id:`notifications`,label:`Notifications`,icon:(0,Y.jsx)(on,{}),status:(0,Y.jsx)(x_,{})},{id:`backups`,label:`Backups`,icon:(0,Y.jsx)(On,{}),status:(0,Y.jsx)(pi,{})},{id:`archive`,label:`Archive`,icon:(0,Y.jsx)(tn,{})}];function R_(){let e=ae({queryKey:[`app-info`],queryFn:()=>be.appInfo()}),t=ae({queryKey:[`update-check`],queryFn:()=>be.checkUpdate(),staleTime:216e5});return(0,Y.jsxs)(`section`,{"aria-label":`General`,className:`flex flex-col gap-5 text-sm`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Theme`}),(0,Y.jsx)(I_,{})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Version`}),(0,Y.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:e.data?`v${e.data.version}`:`Connecting to backend...`}),t.data?.newer&&(0,Y.jsxs)(`p`,{role:`status`,className:`w-full text-muted-foreground`,children:[`v`,t.data.latest,` is available on the `,t.data.channel,` channel. Update the server with`,` `,(0,Y.jsx)(`code`,{children:`toodo update`}),`.`]}),t.data?.error&&(0,Y.jsxs)(`p`,{className:`w-full text-muted-foreground`,children:[`Update check: `,t.data.error]})]})]})}var z_=e=>`settings-tab-${e}`,B_=e=>`settings-panel-${e}`;function V_({open:e,section:t,onShow:n,onClose:r,returnFocus:i}){let o=(0,J.useRef)(null),s=(0,J.useRef)(null),c=t??`general`,l=(0,J.useRef)(r);l.current=r;let u=(0,J.useRef)(i);u.current=i;let d=Dh();(0,J.useLayoutEffect)(()=>{if(e)return d&&t!==null?s.current?.focus({preventScroll:!0}):document.getElementById(z_(c))?.focus({preventScroll:!0}),()=>{let e=document.activeElement;if(e!==null&&e!==document.body&&!o.current?.contains(e))return;let t=u.current();t?.isConnected&&t.focus({preventScroll:!0})}},[e]),(0,J.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),l.current()),e.key===`Tab`&>(o.current,e)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);let f=e=>{n(e),d&&requestAnimationFrame(()=>s.current?.focus({preventScroll:!0}))},p=()=>{n(null),requestAnimationFrame(()=>document.getElementById(z_(c))?.focus({preventScroll:!0}))},m=e=>{let t=L_.findIndex(e=>e.id===c),r=e.key===`ArrowDown`?(t+1)%L_.length:e.key===`ArrowUp`?(t-1+L_.length)%L_.length:e.key===`Home`?0:e.key===`End`?L_.length-1:null;if(r===null)return;e.preventDefault();let i=L_[r].id;n(i),document.getElementById(z_(i))?.focus()},h=L_.find(e=>e.id===c)??L_[0];return(0,Y.jsxs)(`div`,{hidden:!e,className:`fixed inset-0 z-50`,children:[(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-0 bg-black/40 max-md:hidden`,onClick:()=>r()}),(0,Y.jsxs)(`div`,{ref:o,role:`dialog`,"aria-modal":!0,"aria-labelledby":`settings-title`,className:a(`relative flex overflow-hidden bg-background text-foreground`,`max-md:h-full max-md:flex-col max-md:pt-[env(safe-area-inset-top)] max-md:pb-[env(safe-area-inset-bottom)]`,`md:absolute md:top-1/2 md:left-1/2 md:h-[min(40rem,calc(100dvh-4rem))] md:w-[min(52rem,calc(100vw-4rem))] md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-2xl md:border md:shadow-xl`),children:[(0,Y.jsxs)(`div`,{className:a(`flex min-h-0 flex-col gap-2 overflow-y-auto bg-sidebar p-3 text-sidebar-foreground md:w-56 md:shrink-0 md:border-r`,`max-md:flex-1`,t!==null&&`max-md:hidden`),children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-1`,children:[(0,Y.jsx)(`h2`,{id:`settings-title`,className:`text-lg font-semibold tracking-tight md:text-base`,children:`Settings`}),(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`ml-auto md:hidden`,"aria-label":`Close settings`,onClick:()=>r(),children:(0,Y.jsx)(vt,{})})]}),(0,Y.jsx)(`div`,{role:`tablist`,"aria-orientation":`vertical`,"aria-label":`Settings sections`,className:`flex flex-col gap-0.5`,onKeyDown:m,children:L_.map(e=>{let t=e.id===c;return(0,Y.jsxs)(`button`,{id:z_(e.id),type:`button`,role:`tab`,"aria-selected":t,"aria-controls":B_(e.id),tabIndex:t?0:-1,onClick:()=>f(e.id),className:a(`flex items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground`,t&&`md:bg-secondary md:font-medium`),children:[e.icon,(0,Y.jsx)(`span`,{children:e.label}),e.status&&(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.status}),(0,Y.jsx)(bn,{"aria-hidden":!0,className:a(`md:hidden`,!e.status&&`ml-auto`)})]},e.id)})})]}),(0,Y.jsxs)(`div`,{className:a(`flex min-h-0 min-w-0 flex-1 flex-col`,t===null&&`max-md:hidden`),children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b px-2 py-2 md:px-6 md:py-3`,children:[(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`md:hidden`,"aria-label":`Back to settings`,onClick:p,children:(0,Y.jsx)(Sn,{})}),(0,Y.jsx)(`h3`,{ref:s,tabIndex:-1,className:`text-base font-semibold outline-none`,children:h.label}),(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`ml-auto`,"aria-label":`Close settings`,title:`Close settings (Esc)`,onClick:()=>r(),children:(0,Y.jsx)(vt,{})})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 md:px-6`,children:L_.map(e=>(0,Y.jsx)(`div`,{id:B_(e.id),role:`tabpanel`,"aria-labelledby":z_(e.id),hidden:e.id!==c,children:(0,Y.jsx)(Oi,{label:`the ${e.label} settings`,children:e.id===`general`?(0,Y.jsx)(R_,{}):e.id===`agents`?(0,Y.jsx)(Wg,{}):e.id===`apps`?(0,Y.jsx)(Qg,{}):e.id===`devices`?(0,Y.jsx)(p_,{}):e.id===`notifications`?(0,Y.jsx)(S_,{}):e.id===`backups`?(0,Y.jsx)(gi,{}):(0,Y.jsx)(Gg,{})})},e.id))})]})]})]})}function H_(e){return e!==null&&/^\d+$/.test(e)?Number(e):null}function U_(e){let t=new URLSearchParams(e),n=t.get(`view`);if(n===`review`)return{page:`review`};let r=H_(t.get(`task`)),i=H_(t.get(`workspace`));return i===null?{page:`all`,view:n===`list`||n===`plan`?n:`timeline`,task:r}:{page:`workspace`,workspace:i,task:r}}function W_(e){let t=new URLSearchParams;e.page===`review`?t.set(`view`,`review`):e.page===`workspace`?t.set(`workspace`,String(e.workspace)):e.view!==`timeline`&&t.set(`view`,e.view),e.page!==`review`&&e.task!==null&&t.set(`task`,String(e.task));let n=t.toString();return n===``?``:`?${n}`}function G_(e){let[t,n]=(0,J.useState)(()=>U_(location.search)),r=(0,J.useRef)(e);return r.current=e,(0,J.useEffect)(()=>{r.current(U_(location.search));let e=()=>{let e=U_(location.search);n(e),r.current(e)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),[t,e=>{let t=W_(e);t!==location.search&&history.pushState(null,``,`${location.pathname}${t}${location.hash}`),n(e)}]}var K_=(0,J.lazy)(()=>Za(()=>import(`./review-BdO8tzWH.js`).then(e=>({default:e.Review})),__vite__mapDeps([10,1,4,5,6,2])));function q_(){let e=document.querySelector(`input[aria-label='Search tasks']`);return e!==null&&(typeof e.checkVisibility!=`function`||e.checkVisibility())?e:null}function J_(){let e=o();ee();let[t,n]=(0,J.useState)(null),[r,i]=G_(e=>{e.page===`all`&&e.view===`timeline`&&e.task!==null&&n({id:e.task})}),s=r.page===`review`,c=r.page===`workspace`?r.workspace:`all`,l=e=>{i(e),d(!1)},[u,d]=(0,J.useState)(!1),f=(0,J.useRef)(null),p=(0,J.useRef)(null),m=(0,J.useRef)(!1),h=(0,J.useRef)(null),[g,_]=(0,J.useState)(!1),[v,y]=(0,J.useState)(null),b=(0,J.useRef)(null),x=(0,J.useRef)(!1),S=e=>{g||(x.current=u),y(e),_(!0),d(!1)};(0,J.useEffect)(()=>{if(u?p.current?.focus():m.current&&!g&&f.current?.focus(),m.current=u,!u)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&d(!1),e.key===`Tab`&>(h.current,e)},t=()=>{window.innerWidth>=768&&d(!1)};return document.addEventListener(`keydown`,e),window.addEventListener(`resize`,t),()=>{document.removeEventListener(`keydown`,e),window.removeEventListener(`resize`,t)}},[u]);let[C,w]=(0,J.useState)(`week`),[T,E]=(0,J.useState)(new Map),D=(e,t)=>E(n=>new Map(n).set(e,t)),O=e=>{l({page:`all`,view:`timeline`,task:e}),n({id:e})};(0,J.useEffect)(()=>Ye(O),[]);let[k,A]=(0,J.useState)(!1),j=(0,J.useRef)(null),M=c===`all`&&!s,N=e.data?.find(e=>e.id===c)??e.data?.[0],P=Ge(),[F,I]=(0,J.useState)(!1),[L,R]=(0,J.useState)(!1);(0,J.useEffect)(()=>{let e=e=>{if(xi(e)){if(g)return;e.preventDefault(),d(!1),R(!1),I(e=>!e)}else e.key===`?`&&Ci(e)?(e.preventDefault(),R(!0)):e.key===`/`&&Ci(e)&&q_()!==null&&(e.preventDefault(),q_()?.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[g]);let z=e=>{r.page===`all`&&r.view===`timeline`?O(e.id):r.page===`all`?l({...r,task:e.id}):l({page:`workspace`,workspace:e.workspaceId,task:e.id})};return(0,Y.jsxs)(`div`,{className:`flex h-dvh bg-background text-foreground print:block print:h-auto`,children:[u&&(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-30 bg-black/40 md:hidden`,onClick:()=>d(!1)}),(0,Y.jsxs)(`aside`,{ref:h,inert:g,role:u?`dialog`:void 0,"aria-modal":u||void 0,"aria-label":u?`Menu`:void 0,className:a(`flex min-h-0 w-64 shrink-0 flex-col gap-4 overflow-y-auto border-r bg-sidebar p-3 text-sidebar-foreground print:hidden`,`max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-40 max-md:shadow-lg`,!u&&`max-md:hidden`),children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`h1`,{className:`flex items-center gap-2 px-1 text-lg font-semibold tracking-tight`,children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground`,children:(0,Y.jsx)(Jn,{className:`size-4`})}),`Toodo`]}),(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`ml-auto md:hidden`,"aria-label":`Close menu`,ref:p,onClick:()=>d(!1),children:(0,Y.jsx)(vt,{})})]}),(0,Y.jsx)(Oi,{label:`the tasks that need attention`,children:(0,Y.jsx)(Na,{onShow:O})}),(0,Y.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsxs)(q,{variant:s?`secondary`:`ghost`,className:`justify-start`,"aria-pressed":s,onClick:()=>l({page:`review`}),children:[(0,Y.jsx)(fn,{}),`Review`]}),(0,Y.jsxs)(q,{variant:M?`secondary`:`ghost`,className:`justify-start`,"aria-pressed":M,disabled:!e.data?.length,onClick:()=>l({page:`all`,view:`timeline`,task:null}),children:[(0,Y.jsx)(Kn,{}),`All workspaces`]})]}),(0,Y.jsx)(Oi,{label:`the workspace list`,children:(0,Y.jsx)(ht,{selectedId:s||M?null:N?.id??null,onSelect:e=>l({page:`workspace`,workspace:e,task:null})})}),(0,Y.jsxs)(q,{variant:`ghost`,className:`mt-auto shrink-0 justify-start`,"aria-haspopup":`dialog`,"aria-expanded":g,ref:b,onClick:()=>S(null),children:[(0,Y.jsx)(Sr,{}),`Settings`,(0,Y.jsx)(`span`,{className:`ml-auto flex flex-col items-end text-xs font-normal`,children:(0,Y.jsx)(pi,{})})]})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,inert:u||g,children:[(0,Y.jsxs)(`header`,{className:`flex items-center gap-2 border-b px-2 py-1.5 md:hidden print:hidden`,children:[(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open menu`,ref:f,onClick:()=>d(!0),children:(0,Y.jsx)(Qn,{})}),(0,Y.jsx)(`span`,{className:`font-semibold tracking-tight`,children:`Toodo`})]}),(0,Y.jsxs)(`main`,{className:`relative flex min-w-0 flex-1 flex-col overflow-y-auto px-4 py-4 md:px-8 md:py-6 print:block print:overflow-visible print:p-0`,children:[(0,Y.jsx)(`div`,{className:`contents print:hidden`,children:(0,Y.jsx)(Ai,{})}),(0,Y.jsx)(Oi,{label:`this view`,resetKey:s?`review`:M?`all`:N?.id,children:s?(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading review...`}),children:(0,Y.jsx)(K_,{onShowTask:O})}):r.page===`all`&&e.data?.length?(0,Y.jsx)(Ig,{workspace:null,view:r.view,onViewChange:e=>i({page:`all`,view:e,task:null}),selectedTask:r.task,onSelectTask:e=>i({...r,task:e}),timelineScale:C,onTimelineScaleChange:w,shownTask:t,onTaskShown:()=>n(null)},`all`):N?(0,Y.jsx)(Ig,{workspace:N,selectedTask:r.page===`workspace`?r.task:null,onSelectTask:e=>i({page:`workspace`,workspace:N.id,task:e}),timelineScale:C,onTimelineScaleChange:w,draft:T.get(N.id),onDraftChange:e=>D(N.id,e)},N.id):!e.isPending&&!e.isError&&(0,Y.jsx)(zg,{icon:(0,Y.jsx)(Rn,{}),title:`Create a workspace to start planning tasks.`,hint:`A workspace groups tasks, e.g. those of one repository or project.`,action:(0,Y.jsxs)(q,{ref:j,"aria-haspopup":`dialog`,onClick:()=>A(!0),children:[(0,Y.jsx)(pt,{}),`Add workspace`]})})})]})]}),(0,Y.jsx)(V_,{open:g,section:v,onShow:S,onClose:()=>_(!1),returnFocus:()=>x.current?f.current:b.current}),k&&(0,Y.jsx)(yt,{onCreated:e=>{A(!1),l({page:`workspace`,workspace:e.id,task:null})},onClose:()=>{A(!1),j.current?.focus()}}),F&&(0,Y.jsx)(Ei,{commands:(()=>{let t=new Map(e.data?.map(e=>[e.id,e.name])),n=q_(),r=document.querySelector(`input[aria-label='Task title']`),i=[!!e.data?.length&&{id:`timeline`,group:`Actions`,label:`Show the timeline of all workspaces`,icon:(0,Y.jsx)(mn,{}),run:()=>l({page:`all`,view:`timeline`,task:null})},!!e.data?.length&&{id:`list`,group:`Actions`,label:`Show the task list of all workspaces`,icon:(0,Y.jsx)(Xn,{}),run:()=>l({page:`all`,view:`list`,task:null})},!!e.data?.length&&{id:`plan`,group:`Actions`,label:`Show the quarter and year plan of all workspaces`,icon:(0,Y.jsx)(un,{}),run:()=>l({page:`all`,view:`plan`,task:null})},{id:`review`,group:`Actions`,label:`Show the review`,icon:(0,Y.jsx)(fn,{}),run:()=>l({page:`review`})},r!==null&&{id:`new-task`,group:`Actions`,label:`New task in this workspace`,icon:(0,Y.jsx)(pt,{}),run:()=>r.focus()},n!==null&&{id:`search`,group:`Actions`,label:`Search tasks`,hint:`/`,icon:(0,Y.jsx)(br,{}),run:()=>n.focus()},{id:`settings`,group:`Actions`,label:`Open settings`,icon:(0,Y.jsx)(Sr,{}),run:()=>S(null)},{id:`shortcuts`,group:`Actions`,label:`Show keyboard shortcuts`,hint:`?`,icon:(0,Y.jsx)(Wn,{}),run:()=>R(!0)},{id:`light`,group:`Actions`,label:`Use the light theme`,icon:(0,Y.jsx)(Mr,{}),run:()=>j_(`light`)},{id:`dark`,group:`Actions`,label:`Use the dark theme`,icon:(0,Y.jsx)(ir,{}),run:()=>j_(`dark`)},{id:`system`,group:`Actions`,label:`Use the system theme`,icon:(0,Y.jsx)(Ar,{}),run:()=>j_(`system`)},...(e.data??[]).map(e=>({id:`workspace-${e.id}`,group:`Actions`,label:`Open workspace ${e.name}`,icon:(0,Y.jsx)(In,{}),run:()=>l({page:`workspace`,workspace:e.id,task:null})}))],a=[...P.data??[]].sort((e,t)=>Number(e.status===`done`)-Number(t.status===`done`)||t.id-e.id).map(e=>({id:`task-${e.id}`,group:`Tasks`,label:`#${e.id} ${e.title}`,keywords:t.get(e.workspaceId),hint:t.get(e.workspaceId),icon:(0,Y.jsx)(wn,{}),run:()=>z(e)}));return[...i.filter(e=>e!==!1),...a]})(),onClose:()=>I(!1)}),L&&(0,Y.jsx)(Di,{onClose:()=>R(!1)})]})}var Y_=`/version.json`,X_=`toodo-skip-waiting`,Z_=5e3,Q_=null,$_=null,ev=null,tv=new Set;function nv(){tv.forEach(e=>e())}function rv(){return document.querySelector(`meta[name="toodo-build"]`)?.content||null}function iv(e){return tv.add(e),()=>tv.delete(e)}function av(){return Q_!==null&&Q_!==$_?Q_:null}function ov(){$_=Q_,nv()}function sv(e){return typeof e==`object`&&e&&`build`in e&&typeof e.build==`string`?e.build:null}function cv(){let e=rv();return e===null?Promise.resolve():(ev??=(async()=>{try{let t=await fetch(Y_,{cache:`no-store`}),n=t.ok?sv(await t.json().catch(()=>null)):null;if(n===null)return;let r=n===e?null:n;r!==Q_&&(Q_=r,nv())}catch(e){console.warn(`toodo: could not check for a new build`,e)}finally{ev=null}})(),ev)}function lv(){cv(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&cv()}),addEventListener(`focus`,()=>void cv())}function uv(e,t){return new Promise(n=>{let r=setTimeout(n,t);e.finally(()=>{clearTimeout(r),n()})})}async function dv(){if(!(`serviceWorker`in navigator))return;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return;await e.update();let t=e.installing;t!==null&&await uv(new Promise(e=>{let n=()=>t.state!==`installing`&&e();t.addEventListener(`statechange`,n),n()}),Z_);let n=e.waiting;if(n===null||navigator.serviceWorker.controller===null)return;let r=new Promise(e=>navigator.serviceWorker.addEventListener(`controllerchange`,()=>e(),{once:!0}));n.postMessage({type:X_}),await uv(r,Z_)}async function fv(){try{await dv()}catch(e){console.warn(`toodo: could not activate the new service worker`,e)}location.reload()}function pv(){let e=(0,J.useSyncExternalStore)(iv,av),[t,n]=(0,J.useState)(!1);return e===null?null:(0,Y.jsxs)(`div`,{role:`status`,"aria-label":`New version of Toodo`,className:a(`fixed inset-x-2 top-2 z-50 mx-auto flex max-w-xl flex-wrap items-center gap-x-3 gap-y-2 rounded-lg p-3 text-sm shadow-md print:hidden`,Gr.info),children:[(0,Y.jsx)(gr,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 basis-48`,children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`A new version of Toodo is available`}),(0,Y.jsx)(`p`,{className:`text-xs`,children:`This tab still runs the earlier version. Reload to switch to the new one.`})]}),(0,Y.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[(0,Y.jsx)(q,{size:`sm`,disabled:t,onClick:()=>{n(!0),fv()},children:t?`Reloading...`:`Reload`}),(0,Y.jsx)(q,{size:`sm`,variant:`outline`,disabled:t,onClick:ov,children:`Later`})]})]})}var mv=`1.7.0`,hv=[`workspaces`,`task-list`,`tasks`],gv=864e5,_v=1e3;function vv(e){return e.state.status===`success`&&hv.includes(String(e.queryKey[0]))}function yv(e){return typeof e==`object`&&!!e&&e.version===`1.7.0`}function bv(){ge.setEventListener(e=>{let t=()=>e(Ct()===`reachable`);t();let n=Dt(t);return()=>void n()})}async function xv(e,t){for(let t of hv)e.setQueryDefaults([t],{gcTime:gv});if(At()!==null)try{let n=await t.load();yv(n)&&zt(e,n.state)}catch(e){console.error(`Toodo: could not restore the saved tasks`,e)}}function Sv(e,t,n=_v){let r,i=()=>{if(r=void 0,At()===null)return;let n=Rt(e,{shouldDehydrateQuery:vv,shouldDehydrateMutation:()=>!1});t.save({version:mv,savedAt:Date.now(),state:n}).catch(e=>{console.error(`Toodo: could not save the tasks for offline reading`,e)})},a=e.getQueryCache().subscribe(e=>{e.type===`updated`&&e.action.type===`success`&&vv(e.query)&&(r??=setTimeout(i,n))}),o=Et(()=>{At()===null&&(clearTimeout(r),r=void 0,t.clear().catch(e=>console.error(`Toodo: could not forget the saved tasks`,e)))});return()=>{clearTimeout(r),a(),o()}}var Cv=`toodo`,wv=`query-cache`;function Tv(e,t){return new Promise((n,r)=>{let i=indexedDB.open(Cv,1);i.onupgradeneeded=()=>i.result.createObjectStore(wv),i.onerror=()=>r(i.error),i.onsuccess=()=>{let a=i.result,o=e(a.transaction(wv,t).objectStore(wv));o.onsuccess=()=>{a.close(),n(o.result)},o.onerror=()=>{a.close(),r(o.error)}}})}function Ev(){let e=bt.key(`queries`);return{load:()=>Tv(t=>t.get(e),`readonly`),save:t=>Tv(n=>n.put(t,e),`readwrite`).then(()=>void 0),clear:()=>Tv(t=>t.delete(e),`readwrite`)}}M_();var Dv=new Ut({defaultOptions:{mutations:{networkMode:`always`}}}),Ov=Ev(),kv=Rr.createRoot(document.getElementById(`root`));function Av(e){kv.render((0,Y.jsx)(J.StrictMode,{children:(0,Y.jsxs)(We,{client:Dv,children:[(0,Y.jsx)(pv,{}),(0,Y.jsx)(Oi,{label:`Toodo`,className:`m-4`,children:e})]})}))}he(),wt(),bv(),lv(),Promise.all([Za(()=>import(`./server-access-BGKgv-lg.js`),__vite__mapDeps([11,1,4,5,6])),Za(()=>import(`./offline-screen-wqm_r2Vb.js`),__vite__mapDeps([12,1,4,5])),Za(()=>import(`./event-DMqRNLc_.js`).then(e=>e.t),__vite__mapDeps([5,1])),xv(Dv,Ov)]).then(([{ServerAccess:e},{ConnectionGate:t},{onReconnect:n}])=>{n(()=>void Dv.invalidateQueries()),n(()=>void cv()),jt(()=>void cv()),jt(()=>void Dv.invalidateQueries()),Sv(Dv,Ov),`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.error(`Toodo: could not register the service worker`,e)}),Av((0,Y.jsx)(t,{children:(0,Y.jsx)(e,{children:(0,Y.jsx)(J_,{})})}))});export{Gi as $,Wh as A,zr as At,Uu as B,Nh as C,si as Ct,ng as D,Xr as Dt,Zh as E,Jr as Et,Bm as F,Ir as Ft,Qa as G,po as H,Hm as I,An as It,oo as J,lo as K,Fm as L,Sn as Lt,Bh as M,Kr as Mt,ug as N,qr as Nt,Qh as O,Yr as Ot,Jm as P,Hr as Pt,ea as Q,Pm as R,bn as Rt,qh as S,ti as St,ig as T,ri as Tt,so as U,mo as V,co as W,xa as X,uo as Y,ta as Z,Jh as _,Ci as _t,c_ as a,na as at,jh as b,Qr as bt,Yh as c,ra as ct,vg as d,wa as dt,Ki as et,fg as f,Ni as ft,dg as g,Oi as gt,ag as h,Fi as ht,n_ as i,Ea as it,rg as j,Vr as jt,yg as k,Br as kt,hg as l,Ta as lt,mg as m,Bi as mt,$g as n,Ca as nt,i_ as o,ba as ot,og as p,ji as pt,fo as q,e_ as r,Sa as rt,zg as s,oa as st,P_ as t,X as tt,gg as u,Ji as ut,sg as v,ci as vt,Ph as w,ai as wt,Uh as x,ni as xt,_g as y,ii as yt,Nm as z,qt as zt};
|
|
10
|
+
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||tn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&tn(e,``+r);else return;break;case`className`:Rt(e,`class`,r);break;case`tabIndex`:Rt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Rt(e,n,r);break;case`style`:an(e,r,o);return;case`data`:if(t!==`object`){Rt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=ln(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=ln(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=un);return;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=ln(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Lt(e,`popover`,r);break;case`xlinkActuate`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Lt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=sn.get(n)||n,Lt(e,n,r);else return}Ft=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:an(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)tn(e,r);else if(typeof r==`number`||typeof r==`bigint`)tn(e,``+r);else return;break;case`onScroll`:r!=null&&Bf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Bf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=un);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[ft]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}Ft=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Lt(e,n,r)}return}Ft=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Bf(`error`,e),Bf(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,o,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:Bf(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:ep(e,t,r,d,n,null)}}Xt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Bf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Qt(e,!!r,n,!0):Qt(e,!!r,t,!1);return;case`textarea`:for(s in Bf(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:ep(e,t,s,c,n,null)}en(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:Bf(`beforetoggle`,e),Bf(`toggle`,e),Bf(`cancel`,e),Bf(`close`,e);break;case`iframe`:case`object`:Bf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Lf.length;r++)Bf(Lf[r],e);break;case`image`:Bf(`error`,e),Bf(`load`,e);break;case`details`:Bf(`toggle`,e);break;case`embed`:case`source`:case`link`:Bf(`error`,e),Bf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,u,r,n,null)}return;default:if(on(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Ft=!0),o=m;break;case`name`:m!==f&&(Ft=!0),i=m;break;case`checked`:m!==f&&(Ft=!0),u=m;break;case`defaultChecked`:m!==f&&(Ft=!0),d=m;break;case`value`:m!==f&&(Ft=!0),s=m;break;case`defaultValue`:m!==f&&(Ft=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}Yt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(Ft=!0),p=o;break;case`defaultValue`:o!==l&&(Ft=!0),c=o;break;case`multiple`:o!==l&&(Ft=!0),s=o;default:o!==l&&ep(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Qt(e,!!n,n?[]:``,!1):Qt(e,!!n,t,!0)):Qt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(Ft=!0),p=i;break;case`defaultValue`:i!==o&&(Ft=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&ep(e,t,s,i,r,o)}$t(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Ft=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(on(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[dt]=r,n[ft]=t,np(n,e,t),Tt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[vt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=v(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=lp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=xt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Zp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=v(i),Zp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=v(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[vt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===un&&(e.onclick=null),bt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);bt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=G.d;G.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Id();return e||t}function Cm(e){var t=St(e);t!==null&&t.tag===5&&t.type===`form`?Js(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=Jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Tt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Jt(n.imageSizes)+`"]`)):i+=`[href="`+Jt(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[yt]=!0,o.onload=o.onerror=function(){Et(o)}),Tt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Jt(r)+`"][href="`+Jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Tt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=wt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Tt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=wt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Tt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=wt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Tt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=fe.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=wt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=wt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=wt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+Jt(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[yt]){r.loading=1;return}}else t=e.createElement(`link`),t[yt]=!0,t.onload=t.onerror=Et.bind(null,t),np(t,`link`,n),Tt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+Jt(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Jt(n.href)+`"]`);if(r)return t.instance=r,Tt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Tt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Tt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Tt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Tt(i),i):(r=n,(i=vm.get(o))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Tt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[vt]||a[dt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Tt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Tt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:N,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=et(0),this.hiddenUpdates=et(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Si(3,null,null,t),e.current=a,a.stateNode=e,t=Sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},io(a),e}function uh(e){return e?(e=bi,e):bi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=oo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=so(e,r,t),n!==null&&(jd(n,e,t),co(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=_i(e,67108864);t!==null&&jd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Od();t=ot(t);var n=_i(e,t);n!==null&&jd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=2,yh(e,t,n,r)}finally{G.p=a,W.T=i}}function vh(e,t,n,r){var i=W.T;W.T=null;var a=G.p;try{G.p=8,yh(e,t,n,r)}finally{G.p=a,W.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=St(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Je(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-He(o);s.entanglements[1]|=c,o&=~c}wf(a),!(Ku&6)&&(pd=Ae()+500,Tf(0,!1))}}break;case 31:case 13:s=_i(a,2),s!==null&&jd(s,a,2),Id(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=fn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=xt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(je()){case Me:return 2;case Ne:return 8;case Pe:case Fe:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=St(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=xt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,lt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,lt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);dn=r,n.target.dispatchEvent(r),dn=null}else return t=St(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,t){e.blockedOn===t&&(e.blockedOn=null,wh||(wh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=St(n);a!==null&&(e.splice(t,3),t-=3,Ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ft]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ft]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;dh(n,Od(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Id(),t[pt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.0`)throw Error(a(527,Kh,`19.3.0`));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:W,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{ze=Jh.inject(qh),Be=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=mc,s=hc,c=gc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,s,c,Uh),e[pt]=t.current,Uf(e),new Wh(t)}})),Yt=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Jt()})),Xt={name:`alarm-clock-off`,size:24,node:[[`path`,{d:`M6.87 6.87a8 8 0 1 0 11.26 11.26`,key:`3on8tj`}],[`path`,{d:`M19.9 14.25a8 8 0 0 0-9.15-9.15`,key:`15ghsc`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.26 18.67 4 21`,key:`yzmioq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M4 4 2 6`,key:`1ycko6`}]]};Xt.node;var Zt=n(Xt),Qt={name:`alarm-clock`,size:24,node:[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]};Qt.node;var $t=n(Qt),en={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};en.node;var tn=n(en),nn={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};nn.node;var rn=n(nn),an={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};an.node;var on=n(an),sn={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};sn.node;var cn=n(sn),ln={name:`calendar-range`,size:24,node:[[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M17 13h-6`,key:`1qbiup`}],[`path`,{d:`M13 17H7`,key:`1x38vv`}],[`path`,{d:`M7 13h.01`,key:`1vezk1`}],[`path`,{d:`M17 17h.01`,key:`1sd3ek`}]]};ln.node;var un=n(ln),dn={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};dn.node;var fn=n(dn),pn={name:`chart-gantt`,size:24,node:[[`path`,{d:`M10 6h8`,key:`zvc2xc`}],[`path`,{d:`M12 16h6`,key:`yi5mkt`}],[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M8 11h7`,key:`wz2hg0`}]]};pn.node;var mn=n(pn),hn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};hn.node;var gn=n(hn),_n={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};_n.node;var vn=n(_n),yn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};yn.node;var bn=n(yn),xn={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};xn.node;var Sn=n(xn),Cn={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Cn.node;var wn=n(Cn),Tn={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};Tn.node;var En=n(Tn),Dn={name:`database-backup`,size:24,node:[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 12a9 3 0 0 0 5 2.69`,key:`1ui2ym`}],[`path`,{d:`M21 9.3V5`,key:`6k6cib`}],[`path`,{d:`M3 5v14a9 3 0 0 0 6.47 2.88`,key:`i62tjy`}],[`path`,{d:`M12 12v4h4`,key:`1bxaet`}],[`path`,{d:`M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16`,key:`1f4ei9`}]]};Dn.node;var On=n(Dn),kn={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};kn.node;var An=n(kn),jn={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};jn.node;var Mn=n(jn),Nn={name:`flag`,size:24,node:[[`path`,{d:`M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528`,key:`1jaruq`}]]};Nn.node;var Pn=n(Nn),Fn={name:`folder-git-2`,size:24,node:[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]};Fn.node;var In=n(Fn),Ln={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Ln.node;var Rn=n(Ln),zn={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};zn.node;var Bn=n(zn),Vn={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};Vn.node;var Hn=n(Vn),Un={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Un.node;var Wn=n(Un),Gn={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Gn.node;var Kn=n(Gn),qn={name:`list-todo`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]};qn.node;var Jn=n(qn),Yn={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};Yn.node;var Xn=n(Yn),Zn={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Zn.node;var Qn=n(Zn),$n={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};$n.node;var er=n($n),tr={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};tr.node;var nr=n(tr),rr={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};rr.node;var ir=n(rr),ar={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};ar.node;var or=n(ar),sr={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};sr.node;var cr=n(sr),lr={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};lr.node;var ur=n(lr),dr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};dr.node;var fr=n(dr),pr={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};pr.node;var mr=n(pr),hr={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};hr.node;var gr=n(hr),_r={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};_r.node;var vr=n(_r),yr={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};yr.node;var br=n(yr),xr={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};xr.node;var Sr=n(xr),Cr={name:`share`,size:24,node:[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]};Cr.node;var wr=n(Cr),Tr={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Tr.node;var Er=n(Tr),Dr={name:`sticky-note`,size:24,node:[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]};Dr.node;var Or=n(Dr),kr={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};kr.node;var Ar=n(kr),jr={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};jr.node;var Mr=n(jr),Nr={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Nr.node;var Pr=n(Nr),Fr={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Fr.node;var Ir=n(Fr);function Lr(e){return e?.ownerDocument||document}var J=i(t(),1),Rr=i(Yt(),1),zr={planned:`Blocked`,ready:`Ready`,paused:`Paused`,in_progress:`In progress`,in_review:`Awaiting completion`,done:`Done`,not_adopted:`Not adopted`},Br=`Planned on`,Vr={neutral:`bg-muted text-foreground/70`,info:`bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200`,progress:`bg-blue-100 text-blue-800 dark:bg-blue-950 dark:text-blue-200`,review:`bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200`,success:`bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200`,attention:`bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-200`,danger:`bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200`},Hr={neutral:`text-muted-foreground`,info:`text-sky-700 dark:text-sky-300`,progress:`text-blue-700 dark:text-blue-300`,review:`text-violet-700 dark:text-violet-300`,success:`text-emerald-700 dark:text-emerald-300`,attention:`text-amber-700 dark:text-amber-300`,danger:`text-rose-700 dark:text-rose-300`},Ur={neutral:`border-border text-muted-foreground`,info:`border-sky-300 text-sky-700 dark:border-sky-800 dark:text-sky-300`,progress:`border-blue-300 text-blue-700 dark:border-blue-800 dark:text-blue-300`,review:`border-violet-300 text-violet-700 dark:border-violet-800 dark:text-violet-300`,success:`border-emerald-300 text-emerald-700 dark:border-emerald-800 dark:text-emerald-300`,attention:`border-amber-300 text-amber-700 dark:border-amber-800 dark:text-amber-300`,danger:`border-rose-300 text-rose-700 dark:border-rose-800 dark:text-rose-300`},Wr=`border-input text-foreground/70`,Gr={info:`border border-sky-300 bg-sky-50 text-sky-900 dark:border-sky-800 dark:bg-sky-950 dark:text-sky-100`,attention:`border border-amber-300 bg-amber-50 text-amber-900 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100`,danger:`border border-rose-300 bg-rose-50 text-rose-900 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-100`},Kr={neutral:`bg-neutral-400`,info:`bg-sky-500`,progress:`bg-blue-500`,review:`bg-violet-500`,success:`bg-emerald-500`,attention:`bg-amber-500`,danger:`bg-rose-500`},qr={neutral:`border-muted-foreground`,info:`border-sky-500`,progress:`border-blue-500`,review:`border-violet-500`,success:`border-emerald-500`,attention:`border-amber-500`,danger:`border-rose-500 dark:border-rose-400`},Jr={done:`border-emerald-500 bg-emerald-100 dark:bg-emerald-950`,ready:`border-amber-500 shadow-none`,blocked:`border-dashed border-muted-foreground shadow-none`,paused:`border-dashed border-muted-foreground bg-muted shadow-none`,behindDue:`border-2 border-rose-500 dark:border-rose-400`},Yr=`border-foreground/70`,Xr=`text-foreground`,Zr=[[`plannedAt`,`Planned`],[`startedAt`,`Started`],[`reviewAt`,zr.in_review],[`completedAt`,`Completed`],[`reopenedAt`,`Reopened`],[`pausedAt`,zr.paused]];function Qr(e){let t=new Date(e*1e3),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}var $r=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`,style:`short`}),ei=604800;function ti(e,t=Date.now()/1e3){let n=e-t,r=Math.abs(n);if(r<60)return`just now`;if(r<ei){let[e,t]=r<3600?[Math.trunc(n/60),`minute`]:r<86400?[Math.trunc(n/3600),`hour`]:[Math.trunc(n/86400),`day`];return $r.format(e,t)}let i=new Date(e*1e3),a=i.getFullYear()===new Date(t*1e3).getFullYear();return i.toLocaleDateString(`en`,{month:`short`,day:`numeric`,...a?{}:{year:`numeric`}})}function ni(e){return new Date(e*1e3).toLocaleString(`en`,{dateStyle:`medium`,timeStyle:`short`})}function ri(e){let t=[];for(let n of e){let e=t.at(-1);e!==void 0&&e.end===null&&(e.end=n.at),n.status!==`done`&&(n.status===`planned`?t.length>0&&t.push({state:`paused`,start:n.at,end:null,reason:n.reason}):t.push({state:n.status,start:n.at,end:null,reason:null}))}return t}function ii(e,t){return oi(e,t,e=>e!==`paused`)}function ai(e,t){return oi(e,t,e=>e===`paused`)}function oi(e,t,n){let r=ri(e);return r.length===0?null:r.filter(e=>n(e.state)).reduce((e,n)=>e+Math.max((n.end??t)-n.start,0),0)}function si(e){return Zr.flatMap(([t,n])=>{let r=e[t];return r===null?[]:[{label:n,at:r}]}).sort((e,t)=>e.at-t.at)}var Y=r();function ci({at:e,prefix:t=``,className:n}){return(0,Y.jsx)(`time`,{className:n,dateTime:new Date(e*1e3).toISOString(),title:ni(e),children:`${t}${ti(e)}`})}var li=`h-7 w-16 rounded-md border bg-background px-2 text-sm`;function ui(e){return e.split(/[\\/]/).pop()??e}function di(e){return e<1048576?`${Math.ceil(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}var fi={automatic:`Automatic`,preRestore:`Before restore`,preMigration:`Before update`};function pi(){return ue().data?.lastFailure?(0,Y.jsx)(`span`,{className:`text-destructive`,children:`Backup failed`}):null}function mi(){let e=ue().data?.lastFailure;return e?(0,Y.jsxs)(`p`,{role:`alert`,"aria-label":`Automatic backup failed`,className:`text-xs break-words text-destructive`,children:[`The automatic backup `,(0,Y.jsx)(ci,{at:e.at}),` failed: `,e.message]}):null}function hi(e){return e.kind===`upload`?e.file.name:ui(e.path)}function gi(){let e=Me(),t=L(),n=st(),r=E(),i=G(),a=(0,J.useRef)(null),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(null),u=t.isPending,d=r.isPending||i.isPending;function f(){l(null),t.mutate(void 0,{onSuccess:e=>l(`Downloaded ${e}`)})}function p(){l(null),a.current?.click()}function m(e){l(null);let t={onSuccess:t=>{s(null),l(`Restored ${hi(e)}. The previous data was saved as ${ui(t.path)}.`)}};e.kind===`upload`?i.mutate(e.file,t):r.mutate(ui(e.path),t)}let h=t.error??n.error??r.error??i.error??e.error;return(0,Y.jsxs)(`section`,{"aria-label":`Backups`,className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{size:`sm`,variant:`outline`,onClick:f,disabled:u,children:u?`Exporting...`:`Export...`}),(0,Y.jsx)(q,{size:`sm`,variant:`outline`,onClick:p,disabled:d,children:`Restore...`}),(0,Y.jsx)(`input`,{ref:a,type:`file`,accept:`.sqlite3,.db`,"aria-label":`Database file to restore`,className:`hidden`,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&s({kind:`upload`,file:t})}})]}),o&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm restore`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,children:[(0,Y.jsxs)(`p`,{className:`text-xs break-words`,children:[`Replace all workspaces and tasks with `,(0,Y.jsx)(`span`,{className:`font-medium`,children:hi(o)}),`? The current data is backed up first.`]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{size:`xs`,variant:`destructive`,onClick:()=>m(o),disabled:d,children:d?`Restoring...`:`Replace data`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,onClick:()=>s(null),disabled:d,children:`Cancel`})]})]}),c&&(0,Y.jsx)(`p`,{role:`status`,className:`text-xs break-words text-muted-foreground`,children:c}),h&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs break-words text-destructive`,children:h.message}),(0,Y.jsx)(mi,{}),(0,Y.jsx)(_i,{}),(0,Y.jsxs)(`ul`,{"aria-label":`Saved backups`,className:`flex flex-col divide-y`,children:[e.data?.length===0&&(0,Y.jsx)(`li`,{className:`text-xs text-muted-foreground`,children:`No backups yet.`}),e.data?.map(e=>(0,Y.jsxs)(`li`,{className:`flex flex-col gap-1 py-1.5 text-xs first:pt-0`,title:e.path,children:[(0,Y.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Y.jsx)(`time`,{className:`font-medium`,dateTime:new Date(e.createdAt*1e3).toISOString(),children:ni(e.createdAt)}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,Y.jsx)(ci,{at:e.createdAt}),` · `,fi[e.kind],` · `,di(e.sizeBytes)]})]}),(0,Y.jsxs)(`span`,{className:`flex flex-wrap gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`outline`,"aria-label":`Download backup from ${ni(e.createdAt)}`,disabled:n.isPending,onClick:()=>{l(null),n.mutate(ui(e.path),{onSuccess:e=>l(`Downloaded ${e}`)})},children:`Download`}),(0,Y.jsx)(q,{size:`xs`,variant:`outline`,"aria-label":`Restore this backup from ${ni(e.createdAt)}`,onClick:()=>{l(null),s({kind:`backup`,path:e.path})},children:`Restore this backup`})]})]},e.path))]})]})}function _i(){let e=Xe();if(!e.data)return null;let{enabled:t,intervalHours:n,keep:r,directory:i}=e.data;return(0,Y.jsx)(vi,{initial:e.data},`${t}-${n}-${r}-${i??``}`)}function vi({initial:e}){let t=ut(),[n,r]=(0,J.useState)(e.enabled),[i,a]=(0,J.useState)(String(e.intervalHours)),[o,s]=(0,J.useState)(String(e.keep)),[c,l]=(0,J.useState)(e.directory??``);function u(e){e.preventDefault(),t.mutate({enabled:n,intervalHours:Number(i),keep:Number(o),directory:c.trim()||null})}return(0,Y.jsxs)(`form`,{onSubmit:u,"aria-label":`Automatic backups`,className:`flex flex-col gap-1 text-xs`,children:[(0,Y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:n,onChange:e=>r(e.target.checked)}),`Back up automatically`]}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[`Every`,(0,Y.jsx)(`input`,{className:li,type:`number`,min:1,max:720,"aria-label":`Hours between backups`,value:i,onChange:e=>a(e.target.value),disabled:!n,required:!0}),`hours`]}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[`Keep`,(0,Y.jsx)(`input`,{className:li,type:`number`,min:1,max:100,"aria-label":`Backups to keep`,value:o,onChange:e=>s(e.target.value),disabled:!n,required:!0}),`latest`]}),(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[`Save backups in`,(0,Y.jsx)(`input`,{className:`h-7 w-full rounded-md border bg-background px-2 text-sm`,type:`text`,spellCheck:!1,"aria-label":`Backup directory`,placeholder:`the server's data directory`,value:c,onChange:e=>l(e.target.value)}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`An absolute path on the server, e.g. on another disk. Every backup goes there, including the one before an update.`})]}),t.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:t.error.message}),(0,Y.jsx)(q,{type:`submit`,size:`xs`,variant:`outline`,className:`self-start`,disabled:t.isPending,children:t.isPending?`Saving...`:`Save backup settings`})]})}var yi=[{keys:[`Ctrl+K`,`Cmd+K`],description:`Open the command palette: jump to a task or run an action`},{keys:[`j`,`k`],description:`Select the next or previous task in the list or on the timeline`},{keys:[`Enter`],description:`Open the details of the selected task`},{keys:[`Esc`],description:`Close the details, the palette, or a dialog`},{keys:[`/`],description:`Search tasks`},{keys:[`?`],description:`Show these shortcuts`},{keys:[`Up`,`Down`,`Home`,`End`],description:`On a timeline bar, move the selection between rows`}];function bi(e){return e instanceof HTMLElement&&(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true'], [contenteditable='']`)!==null)}function xi(e){return(e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`}function Si(){return[...document.querySelectorAll(`[aria-modal='true'], [role=menu]`)].some(e=>e.closest(`[hidden]`)===null)}function Ci(e){return!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!bi(e.target)&&!Si()}function wi(e,t){let n=t.toLowerCase().split(/\s+/).filter(e=>e!==``);return e.filter(e=>{let t=`${e.label} ${e.keywords??``}`.toLowerCase();return n.every(e=>t.includes(e))})}function Ti({label:e,onClose:t,className:n,children:r}){let i=(0,J.useRef)(null),o=(0,J.useRef)(t);return o.current=t,(0,J.useLayoutEffect)(()=>{let e=document.activeElement instanceof HTMLElement?document.activeElement:null,t=i.current;return()=>{let n=document.activeElement;(n===null||n===document.body||t?.contains(n))&&e?.isConnected&&e.focus({preventScroll:!0})}},[]),(0,J.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),o.current()),e.key===`Tab`&>(i.current,e)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]),(0,Y.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center px-4 pt-[min(15vh,8rem)] max-md:pt-[max(1rem,env(safe-area-inset-top))]`,children:[(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-0 bg-black/40`,onClick:()=>t()}),(0,Y.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":!0,"aria-label":e,className:a(`relative flex max-h-[min(32rem,calc(100dvh-2rem))] w-full max-w-xl flex-col overflow-hidden rounded-xl border bg-popover text-popover-foreground shadow-xl`,n),children:r})]})}function Ei({commands:e,onClose:t}){let[n,r]=(0,J.useState)(``),[i,o]=(0,J.useState)(0),s=(0,J.useId)(),c=(0,J.useRef)(null),l=wi(e,n),u=Math.min(i,l.length-1),d=e=>`${s}-${e}`;(0,J.useEffect)(()=>{c.current?.querySelector(`[id="${d(u)}"]`)?.scrollIntoView?.({block:`nearest`})},[u,n]);let f=e=>{e!==void 0&&(t(),e.run())},p=e=>{let t=l.length-1,n=e.key===`ArrowDown`?Math.min(u+1,t):e.key===`ArrowUp`?Math.max(u-1,0):e.key===`Home`&&e.ctrlKey?0:e.key===`End`&&e.ctrlKey?t:null;n===null?e.key===`Enter`&&(e.preventDefault(),f(l[u])):(e.preventDefault(),o(n))},m=[`Actions`,`Tasks`].map(e=>({group:e,entries:l.map((e,t)=>({command:e,position:t})).filter(({command:t})=>t.group===e)})).filter(({entries:e})=>e.length>0);return(0,Y.jsxs)(Ti,{label:`Command palette`,onClose:t,children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b px-3`,children:[(0,Y.jsx)(br,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`input`,{autoFocus:!0,role:`combobox`,"aria-label":`Search actions and tasks`,"aria-expanded":!0,"aria-controls":s,"aria-autocomplete":`list`,"aria-activedescendant":l.length>0?d(u):void 0,placeholder:`Jump to a task or run an action...`,className:`h-11 min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`,value:n,onChange:e=>{r(e.target.value),o(0)},onKeyDown:p}),(0,Y.jsx)(`kbd`,{className:`rounded border px-1.5 text-[0.625rem] text-muted-foreground max-md:hidden`,children:`Esc`})]}),(0,Y.jsxs)(`div`,{ref:c,id:s,role:`listbox`,"aria-label":`Actions and tasks`,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-1`,children:[m.length===0&&(0,Y.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:`No actions or tasks match.`}),m.map(({group:e,entries:t})=>(0,Y.jsxs)(`div`,{role:`group`,"aria-label":e,className:`flex flex-col`,children:[(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground`,children:e}),t.map(({command:e,position:t})=>(0,Y.jsxs)(`div`,{id:d(t),role:`option`,"aria-selected":t===u,className:a(`flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm select-none max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground`,t===u&&`bg-muted`),onMouseMove:()=>t!==u&&o(t),onMouseDown:e=>e.preventDefault(),onClick:()=>f(e),children:[e.icon,(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.hint&&(0,Y.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.hint})]},e.id))]},e))]})]})}function Di({onClose:e}){let t=(0,J.useRef)(null);return(0,J.useLayoutEffect)(()=>t.current?.focus({preventScroll:!0}),[]),(0,Y.jsxs)(Ti,{label:`Keyboard shortcuts`,onClose:e,className:`max-w-md`,children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center border-b px-4 py-2`,children:[(0,Y.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Keyboard shortcuts`}),(0,Y.jsx)(q,{ref:t,variant:`ghost`,size:`icon-sm`,className:`ml-auto`,"aria-label":`Close shortcuts`,title:`Close (Esc)`,onClick:e,children:(0,Y.jsx)(vt,{})})]}),(0,Y.jsx)(`dl`,{className:`flex min-h-0 flex-col gap-2 overflow-y-auto p-4 text-sm`,children:yi.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,Y.jsx)(`dt`,{className:`flex w-32 shrink-0 flex-wrap gap-1`,children:e.keys.map(e=>(0,Y.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 font-mono text-xs`,children:e},e))}),(0,Y.jsx)(`dd`,{className:`text-muted-foreground`,children:e.description})]},e.description))}),(0,Y.jsx)(`p`,{className:`border-t px-4 py-2 text-xs text-muted-foreground`,children:`Letter shortcuts do nothing while you type in a field.`})]})}var Oi=class extends J.Component{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}componentDidCatch(e,t){console.error(`Toodo: ${this.props.label} failed to render`,e,t.componentStack)}componentDidUpdate(e){this.state.error!==null&&e.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){let{error:e}=this.state;if(e===null)return this.props.children;let t=this.props.as??`div`;return(0,Y.jsxs)(t,{role:`alert`,className:a(`flex flex-col items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/5 p-4 text-sm`,this.props.className),children:[(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 font-medium`,children:[(0,Y.jsx)(Ir,{"aria-hidden":!0,className:`size-4 shrink-0 text-destructive`}),ki(this.props.label),` could not be shown.`]}),(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Something went wrong while showing it. Try again, or reload the page if it keeps happening.`}),e.message&&(0,Y.jsx)(`p`,{className:`font-mono text-xs break-all text-muted-foreground`,children:e.message}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Y.jsxs)(q,{size:`sm`,variant:`outline`,onClick:()=>this.setState({error:null}),children:[(0,Y.jsx)(vr,{}),`Try again`]}),(0,Y.jsx)(q,{size:`sm`,variant:`ghost`,onClick:()=>window.location.reload(),children:`Reload page`})]})]})}};function ki(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ai(){let e=(0,J.useSyncExternalStore)(nt,Pe),[t,n]=(0,J.useState)(!1);return e===`none`?null:(0,Y.jsxs)(`div`,{role:`region`,"aria-label":`Install Toodo`,className:a(`mb-4 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg px-3 py-2`,Gr.info),children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-56 flex-col gap-0.5`,children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:`Install Toodo on this device`}),(0,Y.jsx)(`p`,{className:`text-xs break-words`,children:e===`prompt`?`It opens in its own window and can show notifications.`:(0,Y.jsxs)(Y.Fragment,{children:[`Tap `,(0,Y.jsx)(wr,{"aria-label":`Share`,className:`inline size-3.5 align-text-bottom`}),`, then`,` `,(0,Y.jsx)(`span`,{className:`font-medium`,children:`Add to Home Screen`}),`. Notifications need the installed app.`]})})]}),(0,Y.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[e===`prompt`&&(0,Y.jsxs)(q,{size:`sm`,disabled:t,onClick:()=>{n(!0),fe().finally(()=>n(!1))},children:[(0,Y.jsx)(An,{}),`Install`]}),(0,Y.jsx)(q,{size:`sm`,variant:`outline`,onClick:Qe,children:e===`prompt`?`Not now`:`Dismiss`})]})]})}var ji={on_time:`On time`,late:`Late`,overdue:`Overdue`,upcoming:`Due`};function Mi(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r+1).getTime()/1e3}function Ni(e,t){if(e.dueDate===null)return null;let n=Mi(e.dueDate);if(e.status===`done`){let{completedAt:t}=e.milestones;return t===null?null:t<n?`on_time`:`late`}return t>=n?`overdue`:`upcoming`}function Pi(e,t){if(e.dueDate===null)return 0;let n=e.status===`done`?e.milestones.completedAt??t:t;return Math.max(n-Mi(e.dueDate),0)}function Fi(e){return[...e.estimate===null?[`estimate`]:[],...e.dueDate===null?[`dueDate`]:[]]}function Ii(e){return e.length===0?null:`No ${e.map(e=>e===`estimate`?`estimate`:`due date`).join(` or `)}`}function Li(e){return String(Math.round(e*100)/100)}var Ri={hours:`h`,days:`d`,weeks:`w`,months:`mo`},zi={hours:3600,days:86400,weeks:604800,months:2592e3};function Bi(e){return`${Li(e.amount)}${Ri[e.unit]}`}function Vi(e){return e?e.amount*zi[e.unit]:null}function Hi(e){let t=e.trim();if(t===``)return null;let n=/^\d+(\.\d+)?$/.test(t)?Number(t):NaN;return n>0&&n<=1e4?n:NaN}function Ui(e){let t=e.split(`,`).map(e=>e.trim()).filter(e=>e!==``);return[...new Set(t)].sort()}function Wi(e){return e.join(`, `)}var Gi=[`planned`,`in_progress`,`in_review`];function Ki(e){return e?.resolution===`not_adopted`}function qi(e,t){return e.dependsOn.every(e=>{let n=t.get(e);return n?.status===`done`&&!Ki(n)})}function Ji(e,t){return e.status!==`planned`||e.dependsOn.some(e=>Ki(t.get(e)))?[]:e.dependsOn.filter(e=>t.get(e)?.status!==`done`)}function X(e){return e.status===`planned`&&e.milestones.startedAt!==null}function Yi(e,t){return e.notes.some(e=>e.kind===`blocker`&&e.at===t)}function Xi(e,t){let n=e.milestones.pausedAt;return X(e)&&n!==null&&qi(e,t)&&(Yi(e,n)||e.dependsOn.some(e=>(t.get(e)?.milestones.completedAt??-1/0)>=n))}function Zi(e){return e.status===`planned`&&!X(e)}function Qi(e,t){let n=e.dependsOn.map(e=>{let n=t.get(e);return Ki(n)?null:n?.milestones.completedAt??null});return n.length===0||n.includes(null)?null:Math.max(...n)}function $i(e,t){return`${e}->${t}`}function ea(e){let t=new Set(e.map(e=>e.id));return e.flatMap(e=>e.dependsOn.filter(e=>t.has(e)).map(t=>({id:$i(t,e.id),source:t,target:e.id})))}function ta(e,t,n){if(t===n)return!1;let r=new Map(e.map(e=>[e.id,e])),i=r.get(t),a=r.get(n);if(i===void 0||a===void 0||!Gi.includes(a.status)||a.dependsOn.includes(t))return!1;let o=[t],s=new Set(o);for(let e=o.pop();e!==void 0;e=o.pop())for(let t of r.get(e)?.dependsOn??[]){if(t===n)return!1;s.has(t)||(s.add(t),o.push(t))}return!0}function na(e,t){let n=new Set([t]),r=e=>{let r=[t],i=new Set([t]);for(let t=r.pop();t!==void 0;t=r.pop())for(let a of e(t))i.has(a)||(i.add(a),n.add(a),r.push(a))},i=new Map(e.map(e=>[e.id,e]));return r(e=>i.get(e)?.dependsOn.filter(e=>i.has(e))??[]),r(t=>e.filter(e=>e.dependsOn.includes(t)).map(e=>e.id)),n}var ra=[`hour`,`day`,`week`,`month`],ia={hour:960,day:48,week:12,month:3},aa=120;function oa(e,t,n){let r=e.x+8,i=t.x-8,a=t.y-n/2;return`M ${e.x} ${e.y} H ${r} V ${a} H ${i} V ${t.y} H ${t.x}`}var sa=86400;function ca(e,t){let{plannedAt:n,startedAt:r,reviewAt:i,completedAt:a,pausedAt:o}=e.milestones;if(Zi(e))return{start:t,end:t};let s=r??i;if(e.status===`in_progress`||e.status===`in_review`)return s===null?null:{start:Math.min(s,t),end:t};let c=[n,r,i].filter(e=>e!==null),l=(e.status===`done`?a:o)??(c.length>0?Math.max(...c):null);return l===null?null:{start:Math.min(s??l,l),end:l}}function la(e,{start:t,end:n}){let r=ri(e.timeline),{reviewAt:i}=e.milestones;return(r.length>0?r.map(e=>({phase:e.state,start:e.start,end:e.end??n})):[{phase:`in_progress`,start:t,end:i??n},{phase:`in_review`,start:i??n,end:n}]).map(e=>({...e,start:Math.max(e.start,t),end:Math.min(e.end,n)})).filter(e=>e.end>e.start)}function ua(e,t,n,r,i){let{plannedAt:a}=e.milestones;if(a===null||i(Math.max(a,r))>=n)return null;let o=i(Math.max(a,r)),s=t!==null&&t>a&&t>=r?i(t):null;return{x:o-n,planned:a>=r,readyX:s!==null&&s<n?s-n:null}}function da(e,t){let n=[],r=0;for(let i of t)i.x>r&&n.push({x:r,width:Math.min(i.x,e)-r}),r=Math.max(r,i.x+i.width);return r<e&&n.push({x:r,width:e-r}),n}function fa(e){let t=new Set(e.map(({task:e})=>e.id)),n=new Map(e.map(({task:e})=>[e.id,e.dependsOn.filter(e=>t.has(e)).length])),r=(e,t)=>e.interval.start-t.interval.start||e.task.id-t.task.id,i=new Set,a=[],o=e.filter(({task:e})=>n.get(e.id)===0);for(;a.length<e.length;){o.length===0&&(o=[e.filter(({task:e})=>!i.has(e.id)).sort(r)[0]]),o.sort(r);let t=o.shift();a.push(t),i.add(t.task.id);for(let r of e)if(!i.has(r.task.id)&&r.task.dependsOn.includes(t.task.id)){let e=n.get(r.task.id)-1;n.set(r.task.id,e),e===0&&o.push(r)}}return a}var pa=e=>String(e).padStart(2,`0`),ma={hour:{minor:`hour`,major:`day`},day:{minor:`day`,major:`month`},week:{minor:`week`,major:`month`},month:{minor:`month`,major:`year`}},ha={hour:e=>`${pa(e.getHours())}:00`,day:e=>`${pa(e.getMonth()+1)}-${pa(e.getDate())}`,week:e=>`${pa(e.getMonth()+1)}-${pa(e.getDate())}`,month:e=>`${e.getFullYear()}-${pa(e.getMonth()+1)}`,year:e=>String(e.getFullYear())},ga={...ha,day:e=>`${e.getFullYear()}-${pa(e.getMonth()+1)}-${pa(e.getDate())}`};function _a(e,t){let n=new Date(e*1e3);return n.setMinutes(0,0,0),t!==`hour`&&n.setHours(0),t===`week`?n.setDate(n.getDate()-(n.getDay()+6)%7):t===`month`?n.setDate(1):t===`year`&&n.setMonth(0,1),n}function va(e,t){t===`hour`?e.setHours(e.getHours()+1):t===`day`?e.setDate(e.getDate()+1):t===`week`?e.setDate(e.getDate()+7):t===`month`?e.setMonth(e.getMonth()+1):e.setFullYear(e.getFullYear()+1)}function ya(e,t,n){let r=[];for(let i=_a(e,n);i.getTime()/1e3<t;va(i,n))r.push(new Date(i));return r}function ba(e,t,n){let r=ia[e.scale],i=t=>(t-e.start)/sa*r,a=e.start+t/r*sa,o=e.start+n/r*sa;e.period!==null&&(a=Math.max(a,e.period.start),o=Math.min(o,e.period.end));let{minor:s,major:c}=ma[e.scale];return{ticks:ya(a,o,s).filter(e=>e.getTime()/1e3>=a).map(e=>({at:e.getTime()/1e3,x:i(e.getTime()/1e3),label:ha[s](e)})),majorTicks:ya(a,o,c).map(t=>{let n=new Date(t);va(n,c);let r=t.getTime()/1e3,a=n.getTime()/1e3;return e.period!==null&&(r=Math.max(r,e.period.start),a=Math.min(a,e.period.end)),{at:r,x:i(r),right:i(a),label:ga[c](t)}})}}function xa(e){return e.length*6+6}function Sa(e,t,n,r){let i=Math.max(e.x,n);return r!==null&&i<r.x+r.width&&i+t>r.x&&(i=r.x+r.width),i+t>e.right?null:i-e.x}function Ca(e,{now:t,scale:n,period:r}){let i=new Map(e.map(e=>[e.id,e])),a=[],o=[];for(let n of e){let e=ca(n,t);e===null?a.push(n):(r===null||e.start<r.end&&e.end>=r.start)&&o.push({task:n,interval:e})}let s,c;if(r!==null)({start:s,end:c}=r);else{let e=o.map(({task:e,interval:t})=>Math.min(t.start,e.milestones.plannedAt??t.start)),n=o.flatMap(({task:e})=>e.dueDate===null?[]:[Mi(e.dueDate)]);s=_a(Math.min(t,...e,...n.map(e=>e-sa)),`day`).getTime()/1e3;let r=_a(Math.max(t,...o.map(({interval:e})=>e.end),...n.map(e=>e-1)),`day`);va(r,`day`),c=r.getTime()/1e3}let l=e=>(e-s)/sa*ia[n],u=new Map,d=fa(o).map(({task:e,interval:r},a)=>{let o={start:Math.max(r.start,s),end:Math.min(r.end,c)},d=Zi(e),f,p,m=[],h=[];if(d){let t=e.dependsOn.flatMap(e=>{let t=i.get(e);if(t?.status===`done`&&!Ki(t))return[];let n=u.get(e);return n===void 0?[]:[n+16]});f=Math.max(l(o.start),...t);let r=Vi(e.estimate);p=Math.max(r===null?0:r/sa*ia[n],28)}else{f=l(o.start),p=Math.max(l(o.end)-f,4);for(let t of la(e,o)){let e={x:l(t.start)-f,width:l(t.end)-l(t.start)};t.phase===`paused`?e.width>=6&&h.push(e):m.push({phase:t.phase,...e})}let n=l(Math.min(t,c))-f;X(e)&&n-p>=6&&(h=[...h,{x:p,width:n-p}])}u.set(e.id,f+p);let g=e.dueDate===null?null:Mi(e.dueDate);return{task:e,row:a,x:f,width:p,pending:d,phases:m,blocks:da(p,h),pauses:h,lead:ua(e,Qi(e,i),f,s,l),dueX:g!==null&&g>=s&&g<=c?l(g)-f:null,dueState:Ni(e,t)}});return{bars:d,unplaced:a,rows:d.length,start:s,end:c,width:Math.max(l(c),...d.map(e=>e.x+Math.max(e.width,aa))),scale:n,period:r,nowX:t>=s&&t<=c?l(t):null}}function wa(e){return{start:new Date(e,0,1).getTime()/1e3,end:new Date(e+1,0,1).getTime()/1e3}}function Ta(e,t){let n=new Date(t*1e3).getFullYear(),r=e.flatMap(e=>e.milestones.plannedAt===null?[]:[e.milestones.plannedAt]),i=new Date(Math.min(t,...r)*1e3).getFullYear();return Array.from({length:n-i+1},(e,t)=>n-t)}function Ea(e,t){return e.scale!==`month`&&e.nowX!==null?{x:16-e.nowX,y:Math.min(0,t.panel-t.height-8),zoom:1}:{x:Math.min(16,t.visible-e.width-16),y:0,zoom:1}}function Da(e,t){let n=e.notes.at(-1);if(e.status===`done`||n?.kind!==`blocker`)return null;let r=e.timeline.some(e=>e.status===`in_progress`&&e.at>n.at),i=n.at===e.milestones.pausedAt&&Xi(e,t);return r||i?null:n}var Oa=[`blocker_note`,`stalled`];function ka(e){let t=[...e.milestones.startedAt===null?[]:[e.milestones.startedAt],...e.timeline.map(e=>e.at),...e.notes.map(e=>e.at)];return t.length===0?null:Math.max(...t)}function Aa(e,t,n=new Map(e.map(e=>[e.id,e]))){let r=e=>Oa.indexOf(e.reasons[0]);return e.flatMap(e=>{let r=Oa.filter(r=>{switch(r){case`blocker_note`:return Da(e,n)!==null;case`stalled`:{let n=ka(e);return e.status===`in_progress`&&n!==null&&t-n>604800}}});return r.length>0?[{task:e,reasons:r}]:[]}).sort((e,t)=>r(e)-r(t)||e.task.id-t.task.id)}var ja={blocker_note:`Blocker`,stalled:`Stalled`},Ma={blocker_note:Vr.attention,stalled:Vr.neutral};function Na({onShow:e}){let t=Aa(Ge().data??[],Date.now()/1e3);return t.length===0?null:(0,Y.jsxs)(`section`,{"aria-labelledby":`attention-heading`,className:`flex flex-col gap-1`,children:[(0,Y.jsxs)(`h2`,{id:`attention-heading`,className:a(`flex items-center gap-1.5 px-1 text-xs font-medium uppercase`,Hr.attention),children:[(0,Y.jsx)(rn,{"aria-hidden":!0,className:`size-3.5`}),`Needs attention`,(0,Y.jsx)(`span`,{className:a(`ml-auto rounded-full px-1.5 tabular-nums`,Vr.attention),children:t.length})]}),(0,Y.jsx)(`ul`,{"aria-label":`Tasks needing attention`,className:`flex max-h-60 flex-col gap-0.5 overflow-y-auto`,children:t.map(({task:t,reasons:n})=>(0,Y.jsx)(`li`,{className:`flex items-start gap-0.5 rounded-md hover:bg-sidebar-accent`,children:(0,Y.jsxs)(`button`,{type:`button`,title:`Show on the timeline`,className:`flex min-w-0 flex-1 flex-col gap-1 rounded-md px-1.5 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>e(t.id),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-xs`,children:[(0,Y.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`#`,t.id]}),(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:t.title})]}),(0,Y.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,Y.jsx)(`span`,{"data-reason":e,className:a(`rounded-full px-1.5 text-[11px] font-medium leading-4`,Ma[e]),children:ja[e]},e))})]})},t.id))})]})}var Pa=[`planned`,`ready`,`paused`,`in_progress`,`in_review`,`done`,`not_adopted`];function Fa(e,t){return Ki(e)?`not_adopted`:X(e)?Xi(e,t)?`ready`:`paused`:e.status===`planned`&&qi(e,t)?`ready`:e.status}var Ia=[`attention`,`in_progress`,`in_review`,`ready`,`planned`,`done`],La={attention:`Needs attention`,in_progress:`In progress`,in_review:`Awaiting completion`,ready:`Ready`,planned:`Planned`,done:`Done`};function Ra(e,t){switch(Fa(e,t)){case`in_progress`:return`in_progress`;case`in_review`:return`in_review`;case`ready`:return`ready`;case`planned`:case`paused`:return`planned`;case`done`:case`not_adopted`:return`done`}}function za(e,t,n){let r=e.filter(e=>n.includes(e.id)).sort((e,t)=>n.indexOf(e.id)-n.indexOf(t.id));return Ia.map(i=>({group:i,tasks:i===`attention`?r:e.filter(e=>!n.includes(e.id)&&Ra(e,t)===i)})).filter(e=>e.tasks.length>0)}var Ba={query:``,statuses:[],type:null,autopilot:!1},Va={...Ba,statuses:Pa.filter(e=>e!==`done`&&e!==`not_adopted`)};function Ha(e){return e.query.trim()!==``||e.statuses.length>0||e.type!==null||e.autopilot}function Ua(e,t){return Pa.filter(n=>n===t!==e.includes(n))}function Wa(e){let t=/^#?(\d+)$/.exec(e.trim());return t===null?null:Number(t[1])}function Ga(e,t,n){if(t.statuses.length>0&&!t.statuses.includes(Fa(e,n))||t.type!==null&&e.taskType!==t.type||t.autopilot&&!e.autopilot)return!1;let r=`${e.title}\n${e.description}`.toLocaleLowerCase();return t.query.toLocaleLowerCase().split(/\s+/).filter(e=>e!==``).every(e=>r.includes(e))}var Ka=`modulepreload`,qa=function(e){return`/`+e},Ja={},Ya=function(e){return e.pathname.endsWith(`.css`)},Xa=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Za=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=qa(t,n);let r=s(t),i=Ya(r);return Xa(Ja,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ka,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Qa=(0,J.lazy)(()=>Za(()=>import(`./markdown-akFj_lY_.js`),__vite__mapDeps([0,1,2]))),$a=[`feat`,`fix`,`modify`,`refactor`,`docs`,`test`,`chore`,`rnd`];function eo(e,t){return e.status===`done`&&e.resolution===`completed`?`Completed`:zr[Fa(e,t)]}var to={planned:`neutral`,ready:`attention`,paused:`neutral`,in_progress:`progress`,in_review:`review`,done:`success`,not_adopted:`neutral`},no=a(Vr.neutral,`ring-1 ring-inset ring-muted-foreground/40`);function ro(e){return e===`not_adopted`?no:Vr[to[e]]}var io=a(ro(`done`),`border-transparent hover:bg-emerald-200 dark:hover:bg-emerald-900 disabled:bg-emerald-100 disabled:opacity-60 dark:disabled:bg-emerald-950`);function ao(e,t){return ro(Fa(e,t))}function oo(e,t,{byId:n,workspaceName:r}){let i=n.get(e);return i===void 0||i.workspaceId===t?`#${e}`:`${r(i.workspaceId)} #${e}`}function so({label:e,children:t}){return(0,Y.jsxs)(`section`,{"aria-label":e,className:`flex flex-col gap-0.5 text-xs`,children:[(0,Y.jsx)(`h4`,{className:`font-medium text-muted-foreground`,children:e}),t]})}function co({task:e}){let t=Ni(e,Date.now()/1e3);return(0,Y.jsxs)(`span`,{"data-due-state":t??void 0,className:a((t===`late`||t===`overdue`)&&a(`font-medium`,Hr.danger)),children:[t===null||t===`upcoming`?`Due`:ji[t],` `,e.dueDate]})}function lo({task:e,onEdit:t}){let n=Fi(e),r=Ii(n);return r===null?null:(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Edit plan of #${e.id}: ${r.toLowerCase()}`,title:`Reviews compare estimates and due dates with what happened; add them`,"data-missing-plan":n.join(` `),className:`cursor-pointer rounded-sm underline decoration-dotted underline-offset-2 outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>t(n[0]),children:r})}function uo(){let e=(0,J.useSyncExternalStore)(Dt,Ct);return e===`unreachable`||e===`retrying`}function fo({task:e,className:t}){return e.labels.length===0?null:(0,Y.jsx)(`ul`,{"aria-label":`Labels of #${e.id}`,className:a(`flex flex-wrap gap-1`,t),children:e.labels.map(e=>(0,Y.jsx)(`li`,{className:`rounded-full border px-2 py-0.5 text-xs text-muted-foreground`,children:e},e))})}function po({taskId:e,prerequisite:t,pending:n,onConfirm:r,onCancel:i}){return(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Confirm prerequisite of #${e}`,className:a(`flex flex-wrap items-center gap-2 rounded-md px-2 py-1.5 text-xs`,Gr.attention),onKeyDown:mt(i,n),children:[(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Adding `,t,` as a prerequisite pauses #`,e,` until `,t,` is done.`]}),(0,Y.jsxs)(q,{size:`xs`,variant:`destructive`,disabled:n,onClick:r,children:[(0,Y.jsx)(cr,{}),n?`Pausing...`:`Pause and add`]}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,disabled:n,onClick:i,children:`Back`})]})}function mo({type:e,className:t}){return(0,Y.jsx)(`span`,{"data-task-type":e,className:a(`shrink-0 rounded-md border px-1.5 font-mono text-xs`,Wr,t),children:e})}var ho=J.createContext(void 0);function go(e){let t=J.useContext(ho);if(t===void 0&&!e)throw Error(B(33));return t}var _o=J.createContext(void 0);function vo(e){let t=J.useContext(_o);if(t===void 0&&!e)throw Error(B(36));return t}var yo=`data-starting-style`,bo=`data-ending-style`,xo={[yo]:``},So={[bo]:``},Co={transitionStatus(e){return e===`starting`?xo:e===`ending`?So:null}},wo=`data-open`,To=`data-closed`,Eo=`data-anchor-hidden`,Do=`data-popup-open`,Oo=`data-pressed`,ko={[Do]:``,[Oo]:``},Ao={[wo]:``},jo={[To]:``},Mo={[Eo]:``},Z={open(e){return e?ko:null}},No={open(e){return e?Ao:jo},anchorHidden(e){return e?Mo:null}},Po={...No,...Co},Fo=J.createContext(void 0);function Io(e=!0){let t=J.useContext(Fo);if(t===void 0&&!e)throw Error(B(25));return t}var Lo=`none`,Ro=`trigger-press`,zo=`trigger-hover`,Bo=`trigger-focus`,Vo=`outside-press`,Ho=`item-press`,Uo=`focus-out`,Wo=`escape-key`,Go=`list-navigation`,Ko=`keyboard`,qo=`pointer`,Jo=`cancel-open`,Yo=`sibling-open`,Xo=`imperative-action`,Zo=J.createContext(null);function Qo(e=`root`){let t=J.useContext(Zo),n=J.useContext(_o);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var $o={visible:!0,ref:null};function es(){return $o}function ts(e,t,n=`root`){let r=Qo(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??es)({label:e.label,children:e.children,render:e.render}),a=ct(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function ns(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:rs,platform:is,maxTouchPoints:as}=ns(),os=rs.toLowerCase(),ss=is.toLowerCase(),cs=/^i(os$|p)/.test(ss)||ss===`macintel`&&as>1,ls=`android`,us=ss===ls||os.includes(ls),ds=!cs&&ss.startsWith(`mac`);ss.startsWith(`win`),!us&&/^(linux|chrome os)/.test(ss);var fs=ds||cs,ps=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ps&&os.includes(`firefox`),!ps&&os.includes(`chrom`);var ms=fs,hs=/jsdom|happydom/.test(os);function gs(e){e.preventDefault()}function _s(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=vo(),u=Io(!0),f=c.type===`submenu-trigger`,p=f?l.parentVirtualFocus:l.virtualFocus,m=(f&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:h}=a.useState(`floatingTreeRoot`),g=a.useState(`open`),_=u!==void 0,v=!p&&g&&n?0:-1;return J.useMemo(()=>({id:r,role:`menuitem`,tabIndex:v,"aria-selected":m,onMouseDown:p?gs:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&h.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&h.emit(`close`,{domEvent:e.nativeEvent,reason:Ho})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,_&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||_&&!ds&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!_||e.button===2)&&c.type===`regular-item`&&d(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,v,r,h,i,a.context.allowMouseUpTriggerRef,o,s,u,_,c.type,m,p])}var vs={type:`regular-item`};function ys(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=J.useRef(null),{getButtonProps:d,buttonRef:f}=R({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=_s({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=J.useCallback(e=>h(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),g=ct(u,f);return J.useMemo(()=>({getItemProps:m,itemRef:g}),[m,g])}var bs=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function xs(){return J.useContext(bs)}function Ss(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=xs(),u=J.useRef(-1),[d,f]=J.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),m=a??d,h=J.useRef(null),g=J.useCallback(e=>{let t=h.current;t&&s(t),h.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return p(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:g,index:m}}function Cs(){let[,e]=J.useState({});return J.useCallback(()=>{e({})},[])}var ws=0;function Ts(e,t=`mui`){let n=J.useRef(void 0),r=Cs(),i=e??n.current;return J.useEffect(()=>{n.current??(ws+=1,n.current=`${t}-${ws}`,e??r())},[e,t,r]),i}var Es=c.useId;function Ds(e,t){if(Es!==void 0){let n=Es();return e??(t?`${t}-${n}`:n)}return Ts(e,t)}function Os(e){return Ds(e,`base-ui`)}function ks(e,t,n,r){let i=!1,a=!1,o=r??it;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function As(e,t,n){let r=n??it;return{reason:e,event:t??new Event(`base-ui`),...r}}function js(e){J.useEffect(e,oe)}var Ms=null;globalThis.requestAnimationFrame;var Ns=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Ps=class e{static create(){return new e}static request(e){return Ns.request(e)}static cancel(e){return Ns.cancel(e)}currentId=Ms;request(e){this.cancel(),this.currentId=Ns.request(()=>{this.currentId=Ms,e()})}cancel=()=>{this.currentId!==Ms&&(Ns.cancel(this.currentId),this.currentId=Ms)};disposeEffect=()=>this.cancel};function Fs(){let e=je(Ps.create).current;return js(e.disposeEffect),e}function Is(e,t=!1,n=!1,r=!1){let[i,a]=J.useState(e&&t?`idle`:void 0),[o,s]=J.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),p(()=>{if(!e&&o&&i!==`ending`&&n){let e=Ps.request(()=>{a(`ending`)});return()=>{Ps.cancel(e)}}},[e,o,i,n]),p(()=>{if(!e||t||i===void 0)return;let n=Ps.request(()=>{a(void 0)});return()=>{Ps.cancel(n)}},[t,e,i]),p(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Ps.request(()=>{a(`idle`)});return()=>{Ps.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Ls(e){return e==null?e:`current`in e?e.current:e}function Rs(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var zs=i(qt(),1),Bs=null;function Vs(e){if(!Bs){let e=[];Bs=e,queueMicrotask(()=>{Bs=null,zs.flushSync(()=>{for(let t of e)t()})})}Bs.push(e)}function Hs(e,t=!1,n=!1){let r=Fs();return j((i,a=null)=>{r.cancel();let o=Ls(e);if(o==null)return;let s=o,c=()=>{n?Vs(()=>{a?.aborted||i()}):zs.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Rs(s).map(e=>e.finished.then(lt))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Rs(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=yo;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Us(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=j(a),s=Hs(r,n,i);J.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var Ws=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=vo(),f=Ss({guess:!0,label:a}),p=Os(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=ys({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:vs});return Se(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Gs=J.forwardRef(function(e,t){let n=ts(e,t);return n.visible?(0,Y.jsx)(Ws,{...e,ref:n.ref}):null}),Ks=0,qs=class e{static create(){return new e}currentId=Ks;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ks,t()},e)}isStarted(){return this.currentId!==Ks}clear=()=>{this.currentId!==Ks&&(clearTimeout(this.currentId),this.currentId=Ks)};disposeEffect=()=>this.clear};function Js(){let e=je(qs.create).current;return js(e.disposeEffect),e}function Ys(e){e.preventDefault(),e.stopPropagation()}function Xs(e){return`nativeEvent`in e}function Zs(e){return e.pointerType===``&&e.isTrusted?!0:us&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Qs(e){return hs?!1:!us&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(us||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function $s(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function ec(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function tc(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&w(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function nc(e,t){let n=e;for(;n;){if(H(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(w(n)?n.host:null)}return null}function rc(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var ic=`data-base-ui-focusable`,ac=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,oc=`ArrowLeft`,sc=`ArrowRight`,cc=`ArrowUp`,lc=`ArrowDown`,uc=`data-trigger-disabled`;function dc(e,t){if(!H(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(uc);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(uc);return!1}function fc(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function pc(e){return e.matches(`html,body`)}function mc(e){return b(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function hc(e){return nc(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ac}`)!=null}function gc(e){return e?e.getAttribute(`role`)===`combobox`&&mc(e):!1}function _c(e){if(!e||hs)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function vc(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function yc(e,t){return t!=null&&!$s(t)?0:typeof e==`function`?e():e}function bc(e,t,n){let r=yc(e,n);return typeof r==`number`?r:r?.[t]}function xc(e){return typeof e==`function`?e():e}function Sc(e,t){return t||e===`click`||e===`mousedown`}function Cc(e){return e?.includes(`mouse`)&&e!==`mousedown`}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function wc(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Tc(e){let t=je(Ec,e).current;return t.next=e,p(t.effect),t}function Ec(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Dc={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Oc={...Dc,position:`fixed`,margin:0,top:0,left:0};({...Dc});var kc=J.forwardRef(function(e,t){let[n,r]=J.useState();p(()=>{ms&&ps&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:Oc,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),Ac=Math.min,jc=Math.max,Mc=Math.round,Nc=Math.floor,Pc=e=>({x:e,y:e}),Fc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ic(e,t,n){return jc(e,Ac(t,n))}function Lc(e,t){return typeof e==`function`?e(t):e}function Rc(e){return e.split(`-`)[0]}function zc(e){return e.split(`-`)[1]}function Bc(e){return e===`x`?`y`:`x`}function Vc(e){return e===`y`?`height`:`width`}function Hc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Uc(e){return Bc(Hc(e))}function Wc(e,t,n){n===void 0&&(n=!1);let r=zc(e),i=Uc(e),a=Vc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=$c(o)),[o,$c(o)]}function Gc(e){let t=$c(e);return[Kc(e),t,Kc(t)]}function Kc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var qc=[`left`,`right`],Jc=[`right`,`left`],Yc=[`top`,`bottom`],Xc=[`bottom`,`top`];function Zc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Jc:qc:t?qc:Jc;case`left`:case`right`:return t?Yc:Xc;default:return[]}}function Qc(e,t,n,r){let i=zc(e),a=Zc(Rc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Kc)))),a}function $c(e){let t=Rc(e);return Fc[t]+e.slice(t.length)}function el(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function tl(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:el(e)}function nl(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function rl(e,t){return t<0||t>=e.length}function il(e,t){return sl(e.current,{disabledIndices:t})}function al(e,t){return sl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ol(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>sl(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:rl(e,u)?-1:u,wrapped:d}}function sl(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&cl(e,a,r));return a}function cl(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!ul(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function ll(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ul(e,t=e?ke(e):null){return!e||!e.isConnected||!t||ll(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var dl=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function fl(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return w(n)?n.host:null}function pl(e){for(let t of Array.from(e.children))if(g(t)===`summary`)return t;return null}function ml(e,t){let n=pl(t);return!!n&&(e===n||Q(n,e))}function hl(e){let t=e?g(e):``;return e!=null&&e.matches(dl)&&(t!==`summary`||e.parentElement!=null&&g(e.parentElement)===`details`&&pl(e.parentElement)===e)&&(t!==`details`||pl(e)==null)&&(t!==`input`||e.type!==`hidden`)}function gl(e){if(!hl(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=fl(t)){let n=t!==e,r=g(t)===`slot`;if(t.hasAttribute(`inert`)||n&&g(t)===`details`&&!t.open&&!ml(e,t)||t.hasAttribute(`hidden`)||!r&&!_l(t,n))return!1}return!0}function _l(e,t){let n=ke(e);return t?n.display!==`none`:ul(e,n)}function vl(e){let t=e.tabIndex;if(t<0){let t=g(e);if(t===`details`||t===`audio`||t===`video`||b(e)&&e.isContentEditable)return 0}return t}function yl(e){if(g(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function bl(e,t){let n=yl(e);if(!n)return!0;let r=t.find(e=>{let t=yl(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=yl(e);return t?.name===n.name&&t.form===n.form})===n}function xl(e){if(b(e)&&g(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return b(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Sl(e,t){xl(e).forEach(e=>{hl(e)&&t.push(e),Sl(e,t)})}function Cl(e,t,n){xl(e).forEach(e=>{b(e)&&e.matches(t)&&n.push(e),Cl(e,t,n)})}function wl(e){return gl(e)&&vl(e)>=0}function Tl(e){let t=[];return Sl(e,t),t.filter(gl)}function El(e){let t=Tl(e);return t.filter(e=>vl(e)>=0&&bl(e,t))}function Dl(e,t){let n=El(e),r=n.length;if(r===0)return;let i=tc(Lr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ol(e){return Dl(Lr(e).body,1)||e}function kl(e){return Dl(Lr(e).body,-1)||e}function Al(e,t,n){if(!e)return null;let r=[];Sl(Lr(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(gl);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&wl(o)&&bl(o,a))return o}return r[i]}function jl(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function Ml(e){El(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Nl(e){let t=[];Cl(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Pl(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Pl(e,t.id,n)])}function Fl(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Il(e){return`data-base-ui-${e}`}var Ll=0;function Rl(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ll);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),lt;let o=requestAnimationFrame(a);return Ll=o,()=>{Ll===o&&(cancelAnimationFrame(o),Ll=0)}}var zl=`data-base-ui-inert`,Bl=new WeakMap,Vl=new WeakSet,Hl=new WeakMap,Ul=0;function Wl(e){return e?w(e)?e.host:Wl(e.parentNode):null}var Gl=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Wl(t);return e.contains(n)?n:null}).filter(e=>e!=null),Kl=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},ql=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{g(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Jl(e,t,n,{mark:r=!0}){let i=Gl(t,e),a=r?ql(t,Kl(i),new Set(i)):[],o=[],s=[];if(n){let e=Gl(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);ql(t,Kl(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Bl.get(e)||0)+1;Bl.set(e,r),o.push(e),r===1&&n&&Vl.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Hl.get(e)||0)+1;Hl.set(e,t),s.push(e),t===1&&e.setAttribute(zl,``)}),Ul+=1,()=>{o.forEach(e=>{let t=(Bl.get(e)||0)-1;Bl.set(e,t),t||(Vl.has(e)||e.removeAttribute(`aria-hidden`),Vl.delete(e))}),r&&s.forEach(e=>{let t=(Hl.get(e)||0)-1;Hl.set(e,t),t||e.removeAttribute(zl)}),--Ul,Ul||(Bl=new WeakMap,Vl=new WeakSet,Hl=new WeakMap)}}function Yl(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Lr(e[0]).body;return Jl(e,i,n,{mark:r})}var Xl={style:{transition:`none`}},Zl={fallbackAxisSide:`none`},Ql={fallbackAxisSide:`end`},$l={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},eu=J.createContext(null),tu=()=>J.useContext(eu),nu=Il(`portal`);function ru(e={}){let{ref:t,container:n,componentProps:r=it,elementProps:i}=e,a=Ds(),o=tu()?.portalNode,[s,c]=J.useState(null),[l,u]=J.useState(null),d=j(e=>{e!==null&&u(e)}),f=J.useRef(null);p(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(te(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let m=Se(`div`,r,{ref:[t,d],props:[{id:a,[nu]:``},i]}),h=s&&m?zs.createPortal(m,s):null;return{node:l,nodeId:J.isValidElement(m)?m.props.id:void 0,subtree:h}}var iu=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ru({container:o,ref:t,componentProps:e,elementProps:c}),f=J.useRef(null),m=J.useRef(null),h=J.useRef(null),g=J.useRef(null),[_,v]=J.useState(null),y=J.useRef(!1),b=_?.modal,x=_?.open,S=!!_&&!_.modal&&_.open&&!!l;J.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&jl(e)&&(e.type===`focusin`?y.current&&=(Nl(l),!1):(Ml(l),y.current=!0))}return wc($(l,`focusin`,e,!0),$(l,`focusout`,e,!0))},[l,b]),p(()=>{l&&x===!0&&y.current&&(Nl(l),y.current=!1)},[x,l]);let C=J.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:l,setFocusManagerState:v}),[l]);return(0,Y.jsxs)(J.Fragment,{children:[d,(0,Y.jsxs)(eu.Provider,{value:C,children:[S&&l&&(0,Y.jsx)(kc,{"data-type":`outside`,ref:f,onFocus:e=>{jl(e,l)?h.current?.focus():kl(_?_.domReference:null)?.focus()}}),S&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:$l}),l&&zs.createPortal(a,l),S&&l&&(0,Y.jsx)(kc,{"data-type":`outside`,ref:m,onFocus:e=>{jl(e,l)?g.current?.focus():(Ol(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,ks(`focus-out`,e.nativeEvent)))}})]})]})});function au(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ou=class{nodesRef={current:[]};events=au();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},su=J.createContext(null),cu=J.createContext(null),lu=()=>J.useContext(su)?.id||null,uu=e=>{let t=J.useContext(cu);return e??t};function du(e){let t=Ds(),n=uu(e),r=lu();return p(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fu(e){let{children:t,id:n}=e,r=lu();return(0,Y.jsx)(su.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function pu(e){let{children:t,externalTree:n}=e,r=je(()=>n??new ou).current;return(0,Y.jsx)(cu.Provider,{value:r,children:t})}function mu(e,t){let n=dt(rc(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Zs(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var hu=20,gu=[];function _u(){gu=gu.filter(e=>e.deref()?.isConnected)}function vu(e){_u(),e&&g(e)!==`body`&&(gu.push(new WeakRef(e)),gu.length>hu&&(gu=gu.slice(-20)))}function yu(){return _u(),gu[gu.length-1]?.deref()}function bu(e){return e?wl(e)?e:El(e)[0]||e:null}function xu(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Tl(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return wl(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Su(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:_}=e,v=t.useState(`open`),y=t.useState(`domReferenceElement`),x=t.useState(`floatingElement`),{events:S,dataRef:C}=t.context,w=j(()=>C.current.floatingContext?.nodeId),T=i===!1,E=gc(y)&&T,D=Tc(i),O=Tc(a),k=Tc(o),A=Tc(u),M=Tc(v),N=uu(h),P=tu(),F=J.useRef(!1),I=J.useRef(!1),L=J.useRef(!1),R=J.useRef(null),z=J.useRef(``),B=J.useRef(``),V=J.useRef(null),ee=J.useRef(null),H=ct(V,m,P?.beforeInsideRef),U=ct(ee,P?.afterInsideRef),te=Js(),ne=Js(),re=Fs(),ie=P!=null,W=vc(x),G=j((e=W)=>e?El(e):[]),ae=j(()=>_?.().filter(e=>e!=null)??[]);J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(W,tc(Lr(W)))&&G().length===0&&!E&&Ys(e)}return $(Lr(W),`keydown`,e)},[r,W,c,E,G]),J.useEffect(()=>{if(r||!v)return;let e=Lr(W);function t(){L.current=!1}function n(e){let t=rc(e),n=ae(),r=Q(x,t)||Q(y,t)||Q(P?.portalNode,t)||n.some(e=>e===t||Q(e,t));L.current=!r,B.current=e.pointerType||`keyboard`,nc(t,`[data-base-ui-click-trigger]`)&&(I.current=!0,ne.start(0,()=>{I.current=!1}))}function i(){B.current=`keyboard`}return wc($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,x,y,W,v,P,ne,ae]),J.useEffect(()=>{if(r||!l)return;let e=Lr(W);function n(){I.current=!0,ne.start(0,()=>{I.current=!1})}function i(e){let t=rc(e);wl(t)&&(R.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=rc(n);c&&r==null&&a!=null&&Q(x,a)&&vu(a),queueMicrotask(()=>{let o=w(),l=t.context.triggerElements,u=ae(),p=r?.hasAttribute(Il(`focus-guard`))&&[V.current,ee.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Ls(f),Ls(d)].includes(r),m=!(Q(y,r)||Q(x,r)||Q(r,x)||Q(P?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||p||N&&(Pl(N.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||Fl(N.nodesRef.current,o).find(e=>[e.context?.elements.floating,vc(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===y&&W&&xu(W),s&&i!==y&&!ul(a)&&tc(e)===e.body){if(b(W)&&(W.focus(),s===`popup`)){re.request(()=>{W.focus()});return}let e=G(),t=R.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;b(n)&&n.focus()}C.current.insideReactTree?C.current.insideReactTree=!1:(E||!c)&&r&&m&&!I.current&&(E||r!==yu())&&(F.current=!0,t.setOpen(!1,ks(Uo,n)))})}function o(){L.current||(C.current.insideReactTree=!0,te.start(0,()=>{C.current.insideReactTree=!1}))}let u=b(y)?y:null;if(x||u)return wc(u&&$(u,`focusout`,a),u&&$(u,`pointerdown`,n),x&&$(x,`focusin`,i),x&&$(x,`focusout`,a),x&&P&&$(x,`focusout`,o,!0))},[r,y,x,W,c,N,P,t,l,s,G,E,w,C,te,ne,re,d,f,ae]),J.useEffect(()=>{if(r||!x||!v)return;let e=Array.from(P?.portalNode?.querySelectorAll(`[${Il(`portal`)}]`)||[]),t=(N?Fl(N.nodesRef.current,w()):[]).find(e=>gc(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Yl([x,...e,V.current,ee.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...ae(),t,Ls(f),Ls(d),E?y:null].filter(e=>e!=null),{ariaHidden:c||E,mark:!1}),i=Yl([x,...e].filter(e=>e!=null));return()=>{i(),n()}},[v,r,y,x,c,P,E,N,w,d,f,ae]),p(()=>{if(!v||r||!b(W))return;z.current=``,B.current=``;let e=Lr(W),t=tc(e);queueMicrotask(()=>{let n=D.current,r=typeof n==`function`?n(A.current||``):n;if(r===void 0||r===!1||Q(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():Ls(r),o||=a();let s=Q(W,tc(e)),c=C.current.openEvent,l=c?.type===`mousedown`&&Zs(c);Rl(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!M.current)return!1;if(s)return!0;let t=tc(e);return!(t!==o&&Q(W,t))}})})},[r,v,W,G,D,A,M,C]);let oe=J.useRef(null);p(()=>{if(r||!W){oe.current=null;return}oe.current&&=(oe.current.cancelled=!0,null);let e=Lr(W),t=tc(e),n=A.current==null;vu(t);function i(e){if(e.open||(z.current=mu(e.nativeEvent,B.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Il(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(F.current=!0),e.reason===`outside-press`){if(e.nested)F.current=!1;else if(Zs(e.nativeEvent)||Qs(e.nativeEvent))F.current=!1;else{let e=!1;Lr(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?F.current=!1:F.current=!0}}}S.on(`openchange`,i);function a(e){let r=O.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=y?.isConnected?y:null,o=t?.isConnected&&g(t)!==`body`?t:null,s=n?o||a:a||o;return s||=yu()||null,typeof i==`boolean`?s:Ls(i)||s||null}return()=>{S.off(`openchange`,i);let t=tc(e),n=ae(),r=Q(x,t)||n.some(e=>e===t||Q(e,t))||N&&Pl(N.nodesRef.current,w(),!1).some(e=>Q(e.context?.elements.floating,t)),o=O.current,s=z.current,c=a(s),l={cancelled:!1};oe.current=l,queueMicrotask(()=>{oe.current===l&&(oe.current=null);let n=bu(c),i=k.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!F.current&&b(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}F.current=!1})}},[r,x,W,O,k,A,S,N,y,w,ae]),p(()=>{if(!ps||v||!x)return;let e=tc(Lr(x));b(e)&&mc(e)&&Q(x,e)&&e.blur()},[v,x]),p(()=>{if(!r&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:l,open:v,onOpenChange:t.setOpen,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,c,v,t,l,y]),p(()=>{if(!r&&W)return xu(W),()=>{queueMicrotask(_u)}},[r,W]);let se=!r&&(!c||!E)&&(ie||c);return(0,Y.jsxs)(J.Fragment,{children:[se&&(0,Y.jsx)(kc,{"data-type":`inside`,ref:H,onFocus:e=>{if(c){let e=G();Rl(e[e.length-1])}else P?.portalNode&&(F.current=!1,jl(e,P.portalNode)?Ol(y)?.focus():Ls(f??P.beforeOutsideRef)?.focus())}}),n,se&&(0,Y.jsx)(kc,{"data-type":`inside`,ref:U,onFocus:e=>{c?Rl(G()[0]):P?.portalNode&&(l&&(F.current=!0),jl(e,P.portalNode)?kl(y)?.focus():Ls(d??P.afterOutsideRef)?.focus())}})]})}function Cu(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Ro}=t,l=e.context.dataRef,u=J.useRef(void 0),d=Fs(),f=Js(),p=J.useMemo(()=>{function t(t,n,r,i){let a=ks(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=$s(e.pointerType,!0)&&Qs(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||$s(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=rc(s),p=mc(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:$s(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return J.useMemo(()=>n?{reference:p}:it,[n,p])}function wu(){return!1}function Tu(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Eu(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=wu,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=uu(c),m=j(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=j(()=>a),{escapeKey:v,outsidePress:y}=Tu(s),x=J.useRef(!1),S=J.useRef(!1),C=J.useRef(!1),T=J.useRef(!1),E=J.useRef(!1),D=J.useRef(``),O=J.useRef(null),k=Js(),A=Js(),M=Js(),N=j(()=>{A.clear(),d.current.insideReactTree=!1}),P=j(e=>{let t=d.current.floatingContext?.nodeId;return(p?Pl(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),F=j(t=>fc(t,e.select(`floatingElement`))||fc(t,e.select(`domReferenceElement`))),L=j(t=>{o()&&e.setOpen(!1,ks(Ro,t.nativeEvent))}),R=j(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Xs(t)?t.nativeEvent:t;if(E.current||i.isComposing||!v&&P(`__escapeKeyBubbles`))return;let a=ks(Wo,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),z=j(()=>{d.current.insideReactTree=!0,A.start(0,N)}),B=j(t=>{if(!l||!n||t.button!==0)return;let r=rc(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),ee=j(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});J.useEffect(()=>{function e(e){e.open||(T.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),J.useEffect(()=>N,[N]),J.useEffect(()=>{if(!l||!n)return l||(T.current=!1,E.current=!1,D.current=``,O.current=null),N;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new qs,i=Lr(u);function a(){M.clear(),E.current=!0}function o(){E.current=!0,M.start(ps?5:0,()=>{E.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function f(){let e=D.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function A(e){let t=d.current.floatingContext?.nodeId,n=p&&Pl(p.nodesRef.current,t).some(t=>fc(e,t.context?.elements.floating));return F(e)||n}function j(n){if(m(n)){n.type!==`click`&&!F(n)&&(t.clear(),C.current=!1),N();return}if(d.current.insideReactTree){N();return}let r=rc(n),i=`[${Il(`inert`)}]`,a=H(r)?r.getRootNode():null,o=Array.from((w(a)?a:Lr(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=H(r)?r:null;for(;c&&!V(c);){let e=I(c);if(V(e)||!H(e))break;c=e}if(!(o.length&&H(r)&&!pc(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(b(r)&&!(`touches`in n)){let e=V(r),t=ke(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!A(n)){if(f()===`intentional`){if(n.detail!==0&&!Zs(n)&&!T.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof h!=`function`||h(n))&&(P(`__outsidePressBubbles`)||(e.setOpen(!1,ks(Vo,n)),N()))}}}function L(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!F(t)&&j(t)}function z(t){if(f()!==`sloppy`||!e.select(`open`)||!n||F(t))return;let r=t.touches[0];r&&(O.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function B(e,t){let n=rc(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function ee(e){D.current=`touch`,B(e,z)}function U(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(T.current=!0),D.current=e.pointerType),(e.type!==`mousedown`||!O.current||O.current.dismissOnMouseDown)&&B(e,e=>{e.type===`pointerdown`?L(e):j(e)})}function te(e){if(e.type===`pointercancel`&&(T.current=!1),!x.current)return;let n=S.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():A(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),C.current=!0,N())))}function ne(e){if(f()!==`sloppy`||!O.current||F(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(j(e),k.clear(),O.current=null)}function re(e){B(e,ne)}function ie(e){f()===`sloppy`&&O.current&&!F(e)&&(O.current.dismissOnTouchEnd&&j(e),k.clear(),O.current=null)}function W(e){B(e,ie)}let G=wc(r&&wc($(i,`keydown`,R),$(i,`compositionstart`,a),$(i,`compositionend`,o)),g&&wc($(i,`click`,U,!0),$(i,`pointerdown`,U,!0),$(i,`pointerup`,te,!0),$(i,`pointercancel`,te,!0),$(i,`mousedown`,U,!0),$(i,`mouseup`,te,!0),$(i,`touchstart`,ee,{capture:!0,passive:!0}),$(i,`touchmove`,re,{capture:!0,passive:!0}),$(i,`touchend`,W,{capture:!0,passive:!0})));return()=>{G(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,v,y,R,N,_,P,F,p,e,k,M]);let U=J.useMemo(()=>({onKeyDown:R,onPointerDown:L,onClick:L}),[R,L]),te=J.useMemo(()=>({onKeyDown:R,onPointerDown:ee,onMouseDown:ee,onClickCapture:z,onMouseDownCapture(e){z(),B(e)},onPointerDownCapture(e){z(),B(e)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[R,z,B,ee]);return J.useMemo(()=>n?{reference:U,floating:te,trigger:U}:{},[n,U,te])}function Du(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),p(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};H(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Ou(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=j(i),{mounted:c,setMounted:l,transitionStatus:u}=Is(t,!1,!1,o),d=!t&&r;p(()=>{t&&s(!1)},[t,s]);let f=J.useRef(c),m=J.useRef(!1),h=Cs(),g=()=>{f.current=!1,l(!1),a()};p(()=>{f.current=c,m.current&&(m.current=!1,!t&&c&&g())});let _=j(()=>{f.current&&(t?(m.current=!0,h()):g())});return Us({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||_()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:_}}var ku={tabIndex:-1,[ic]:``};function Au({handle:e,store:t}){return p(()=>e.attachStore(t),[e,t]),null}function ju(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Mu(e,t){let n=J.useRef(null);return j(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),ju(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),ju(t))})}function Nu(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Pu(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Fu(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Mu(e,n),o=j(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=j(e=>{a(e),e&&o(e)});return p(()=>(s(t.current),()=>s(null)),[s,t,n,e]),p(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Iu(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=J.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);p(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ks(Lo);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Lu(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Ou({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return je(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Ru(e,t){e.useSyncedValues(t),p(()=>()=>{e.update({activeTriggerProps:it,inactiveTriggerProps:it,popupProps:it})},[e])}var zu=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Bu=e((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Vu=e(((e,t)=>{t.exports=Bu()})),Hu=e((e=>{var n=t(),r=Vu();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Uu=e(((e,t)=>{t.exports=Hu()})),Wu=[],Gu=void 0;function Ku(){return Gu}function qu(e){Wu.push(e)}function Ju(e){let t=(t,n)=>{let r=je(Xu).current,i;try{Gu=r;for(let e of Wu)e.before(r);i=e(t,n);for(let e of Wu)e.after(r);r.didInitialize=!0}finally{Gu=void 0}return i};return t.displayName=e.displayName||e.name,t}function Yu(e){return J.forwardRef(Ju(e))}function Xu(){return{didInitialize:!1}}var Zu=Vu(),Qu=i(Uu(),1),$u=K(19)?nd:rd;function ed(e,t,n,r,i){return $u(e,t,n,r,i)}function td(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Zu.useSyncExternalStore)(e.subscribe,a,a)}qu({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Zu.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function nd(e,t,n,r,i){let a=Ku();if(!a)return td(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function rd(e,t,n,r,i){return(0,Qu.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var id=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return ed(this,e,t,n,r)}},ad=class extends id{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){J.useDebugValue(e);let n=this;p(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;p(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);p(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){J.useDebugValue(e);let n=this,r=t!==void 0;p(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return J.useDebugValue(e),ed(this,this.selectors[e],t,n,r)}useContextCallback(e,t){J.useDebugValue(e);let n=j(t??lt);this.context[e]=n}useStateSetter(e){let t=J.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},od={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},sd=class extends ad{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:au(),nested:n,triggerElements:i},od),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&ec(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function cd(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new sd({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:it,inactiveTriggerProps:it,popupProps:it}}var ld=e=>e.triggerIdProp??e.activeTriggerId,ud=e=>e.openProp??e.open,dd=e=>(e.popupElement?.id??e.floatingId)||void 0;function fd(e,t){return t!==void 0&&ud(e)&&ld(e)===t}function pd(e,t){return fd(e,t)?!0:t!==void 0&&ud(e)&&ld(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var md={open:ud,mounted:e=>e.mounted,transitionStatus:e=>ud(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:ld,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:dd,isTriggerActive:(e,t)=>t!==void 0&&ld(e)===t,isOpenedByTrigger:(e,t)=>fd(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&ld(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>pd(e,t)?dd(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function hd(e){let t=J.useCallback(t=>e===void 0?lt:e.subscribeStore(t),[e]),n=J.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Zu.useSyncExternalStore)(t,n,()=>e?.serverStore)}var gd=ds&&ps;function _d(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=J.useRef(!1),s=J.useRef(null),c=J.useRef(!0),l=Js();J.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=dt(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&b(t)&&t===tc(Lr(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return wc($(r,`blur`,i),gd&&$(r,`keydown`,a,!0),gd&&$(r,`pointerdown`,l,!0))},[e,n]),J.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);H(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=J.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=rc(n.nativeEvent);if(H(a)){if(gd&&!n.relatedTarget){if(!c.current&&!mc(a))return}else if(!_c(a))return}let u=dc(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,ks(Bo,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,ks(Bo,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=H(r)&&r.hasAttribute(Il(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=tc(Lr(t));(r||n!==t)&&(Q(a.current.floatingContext?.refs.floating.current,n)||Q(t,n)||o||dc(r??n,e.context.triggerElements)||e.setOpen(!1,ks(Bo,i)))})}}},[a,r,e,l]);return J.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var vd=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new qs;restTimeout=new qs;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},yd=new WeakMap;function bd(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&yd.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),yd.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function xd(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=yd.get(n);a&&a!==e&&bd(a),bd(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,yd.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Sd(e){let t=e.context.dataRef.current,n=je(()=>t.hoverInteractionState??vd.create()).current;return t.hoverInteractionState||=n,js(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Cd(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=uu(),u=lu(),d=Sd(e),f=Js(),m=j(()=>Sc(c.current.openEvent?.type,d.interactedInside)),h=j(()=>Cc(c.current.openEvent?.type)),g=j(()=>{bd(d)});p(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),J.useEffect(()=>g,[g]),p(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&h()&&H(s)&&o){let e=s,t=o,n=Lr(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??nc(e,`[data-rootownerid]`)??n.body;return xd(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,a,s,o,d,h,l,u,g]),J.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Pl(l.nodesRef.current,u).length>0)}function a(t){let n=bc(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,ks(zo,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=rc(e);hc(t)?d.interactedInside=nc(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function p(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),g()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(dc(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&H(o)&&Pl(l.nodesRef.current,r,!1).some(e=>Q(e.context?.elements.floating,o))||(d.handler?d.handler(n):(g(),h()&&!m()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,ks(zo,n)),l.events.emit(`floating.closed`,n)})}let y=o;return wc(y&&$(y,`mouseenter`,p),y&&$(y,`mouseleave`,_),y&&$(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,h,m,g,d,l,u,f])}var wd={current:null};function Td(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=wd,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=uu(l),v=Sd(e),y=J.useRef(!1),b=Tc(i),x=Tc(r),S=Tc(o),C=Tc(n),w=Tc(p),T=Tc(f),E=j(()=>Sc(h.current.openEvent?.type,v.interactedInside)),D=j(()=>w.current?.()!==!1),O=j((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Q(t,n);if(!H(r))return!1;let a=r;return i.hasMatchingElement(e=>Q(e,a))&&(!t||!Q(t,a))}),k=j(()=>{v.handler&&=(Lr(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=j(()=>{bd(v)});return u&&(v.handleCloseOptions=i?.__options),J.useEffect(()=>k,[k]),J.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===zo,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),J.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=bc(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,ks(zo,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,ks(zo,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!H(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!$s(v.pointerType))return;let n=xc(S.current),r=bc(x.current,`open`,v.pointerType),i=rc(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(H(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Q(t,i)){c=t;break}}H(o)&&H(s)&&!e.context.triggerElements.hasElement(o)&&Q(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&H(c)&&H(s)&&Q(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,ks(zo,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,ks(zo,t,c))}):g&&D()&&e.setOpen(!0,ks(zo,t,c)))}function o(n){if(E()){A();return}k();let r=Lr(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!dc(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else(v.pointerType!==`touch`||!Q(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){Q(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?$(r,`mouseout`,l):void 0;return s?wc($(r,`mousemove`,i,{once:!0}),$(r,`mouseenter`,i),$(r,`mouseleave`,o),f):wc($(r,`mouseenter`,i),$(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),J.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!$s(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;xd(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=xc(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,ks(zo,n,r))}v.pointerType===`touch`?zs.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function Ed(e){return ps&&e.movementX===0&&e.movementY===0}function Dd(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Od(e,t){return Dd(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function kd(e,t,n){return Dd(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Ad(e,t,n){return Dd(t,n?e===oc:e===sc,e===lc)}function jd(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Dd(t,n?e===sc:e===oc,e===cc)}function Md(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:x,resetOnPointerLeave:S=!0,externalTree:C,nestedReturnFocusRef:w,grid:T}=t,E=T!=null,D=e.useState(`open`),O=e.useState(`floatingElement`),k=e.useState(`domReferenceElement`),A=e.context.dataRef,M=vc(O),N=gc(k),P=Tc(M),F=lu(),I=uu(C),L=J.useRef(f),R=J.useRef(o??-1),z=J.useRef(null),B=J.useRef(!0),V=j(e=>{i(R.current===-1?null:R.current,e)}),ee=J.useRef(!!O),H=J.useRef(D),U=J.useRef(!1),te=J.useRef(!1),ne=J.useRef(null),re=Tc(g),ie=Tc(D),W=Tc(o),G=Tc(S),ae=Fs(),oe=Fs(),se=j(()=>{ae.cancel();function e(e){d||(ne.current=Rl(e,{sync:U.current,preventScroll:!0}))}let t=n.current[R.current],r=te.current;t&&e(t),(U.current?e=>e():e=>ae.request(e))(()=>{let i=n.current[R.current]||t;i&&(t||e(i),fe&&(r||!B.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});p(()=>{A.current.orientation=_},[A,_]),p(()=>{D||(z.current=null),(!D||f!==`auto`)&&(L.current=f)},[D,f]),p(()=>{a&&(D&&O?(R.current=o??-1,L.current&&o!=null&&(te.current=!0,V())):ee.current&&(R.current=-1,V()))},[a,D,O,o,V]),p(()=>{if(a){if(!D)U.current=!1;else if(O){if(r==null){if(U.current=!1,W.current!=null)return;if(ee.current&&(R.current=-1,se()),(!H.current||!ee.current)&&L.current&&(z.current!=null||L.current===!0&&z.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>oe.request(e):queueMicrotask)(t),e+=1):(R.current=z.current==null||kd(z.current,v,u)||l?il(n):al(n),z.current=null,V())};t()}}else rl(n.current,r)||(R.current=r,se(),te.current=!1)}}},[a,D,O,r,W,l,n,v,u,V,se,oe]),p(()=>{if(!a||O||!I||d||!ee.current)return;let e=I.nodesRef.current,t=e.find(e=>e.id===F)?.context?.elements.floating,n=tc(Lr(k??t??null)),r=e.some(e=>e.context&&Q(e.context.elements.floating,n));t&&!r&&B.current&&t.focus({preventScroll:!0})},[a,O,k,I,F,d]),p(()=>{H.current=D,ee.current=!!O});let ce=r!=null,le=j(e=>{if(!ie.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(R.current!==t||r!==t)&&(R.current=t,V(e))}),K=j(()=>y??I?.nodesRef.current.find(e=>e.id===F)?.context?.dataRef?.current.orientation),ue=j(()=>il(n,re.current)),de=j(t=>{if(B.current=!1,U.current=!0,t.which===229||!ie.current&&t.currentTarget===P.current)return;if(l&&jd(t.key,_,u,E)){Od(t.key,K())||Ys(t),e.setOpen(!1,ks(Go,t.nativeEvent));let n=w?.current??k;b(n)&&n.focus();return}r!=null&&r!==R.current&&!rl(n.current,r)&&(R.current=r);let i=R.current,a=il(n,g),o=al(n,g);if(N||(t.key===`Home`&&(Ys(t),R.current=a,V(t)),t.key===`End`&&(Ys(t),R.current=o,V(t))),T!=null){let e=T(t,R.current,n,_,c,u,g,a,o);if(e!=null&&e!==R.current&&(R.current=e,V(t)),_===`both`)return}if(Od(t.key,_)){Ys(t);let e=tc(t.currentTarget.ownerDocument);if(D&&!d&&Q(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Q(t,e))){R.current=kd(t.key,_,u)?a:o,V(t),r===R.current&&se();return}let{index:l,wrapped:f}=ol(n.current,i,{decrement:!kd(t.key,_,u),loopFocus:c,allowEscape:s,disabledIndices:g,minIndex:a,maxIndex:o});f&&(U.current=!1),R.current=l,V(t)}}),fe=J.useMemo(()=>({onFocus(e){U.current=!0,le(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Ed(e)||(U.current=!0,te.current=!1,m&&le(e))},onPointerLeave(e){if(!ie.current||!B.current||e.pointerType===`touch`)return;U.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&G.current&&(ne.current?.(),ne.current=null,R.current=-1,V(e),!d)){let e=P.current,t=tc(Lr(e));e&&Q(e,t)&&e.focus({preventScroll:!0})}}}),[le,ie,P,m,n,V,G,d]),pe=J.useMemo(()=>d&&D&&ce&&{"aria-activedescendant":`${x}-${r}`},[d,D,ce,x,r]),me=J.useMemo(()=>({...N?{}:pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&D&&!d){let n=rc(t.nativeEvent);if(n&&!Q(P.current,n))return;Ys(t);let r=ks(Uo,t.nativeEvent);e.setOpen(!1,r);let i=w?.current??k;!r.isCanceled&&b(i)&&i.focus()}else de(t)},onPointerMove(e){Ed(e)||(B.current=!0)}}),[pe,de,P,N,e,D,d,k,w]),he=J.useMemo(()=>{function t(t){e.setOpen(!0,ks(Go,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Zs(e.nativeEvent)&&(L.current=!d)}function r(e){L.current=f,f===`auto`&&Qs(e.nativeEvent)&&(L.current=!0)}return{onKeyDown(n){let r=e.select(`open`);B.current=!1;let i=n.key.startsWith(`Arrow`),a=Ad(n.key,K(),u),o=Od(n.key,r?_:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||mc(n.currentTarget)))return de(n);if(r||h||!i){if(s){let e=Od(n.key,K());z.current=l&&e?null:n.key}l?a&&(Ys(n),r?(R.current=ue(),V(n),d&&P.current?.focus()):t(n)):o&&(W.current!=null&&(R.current=W.current),Ys(n),!r&&h?t(n):de(n),r&&V(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(R.current=-1,V(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[de,f,ue,l,V,e,h,_,v,K,u,W,d,P]),ge=J.useMemo(()=>({...pe,...he}),[pe,he]);return J.useMemo(()=>a?{reference:ge,floating:me,item:fe,trigger:he}:{},[a,ge,me,he,fe])}function Nd(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=j(s),f=e.useState(`open`),m=Js(),h=J.useRef(``),g=J.useRef(u??i??-1),_=J.useRef(null),v=j(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!ul(n)||n?.matches(`:disabled`)?!1:o==null||!cl(oe,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let p=n.current;if(h.current.length>0&&e.key===` `&&(Ys(e),d?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(p,h.current)===-1&&e.key!==` `&&d?.(!1),p==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Ys(e),d?.(!0));let v=h.current===``;v&&(g.current=u??i??-1),p.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(l,()=>{h.current=``,g.current=_.current,d?.(!1)});let y=((v?u??i??-1:g.current)??0)+1,b=c(p,h.current,y);b===-1?e.key!==` `&&(h.current=``,d?.(!1)):(a?.(b,e),_.current=b)}),y=j(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Q(r,n)||Q(i,n)||(m.clear(),h.current=``,g.current=_.current,d?.(!1))});p(()=>{(f||u===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,d?.(!1)))},[f,u,m,d]);let b=J.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return J.useMemo(()=>c?{reference:b,floating:b}:{},[c,b])}var Pd=.1,Fd=Pd*Pd,Id=.5;function Ld(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Rd(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ld(e,t,n,r,i,a)&&(u=!u),Ld(e,t,i,a,o,s)&&(u=!u),Ld(e,t,o,s,c,l)&&(u=!u),Ld(e,t,c,l,n,r)&&(u=!u),u}function zd(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Bd(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Vd(e={}){let{blockPointerEvents:t=!1}=e,n=new qs,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Fd;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=rc(r),g=r.type===`mouseleave`,_=Q(u,h),v=Q(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&H(r.relatedTarget)&&Q(u,r.relatedTarget))return;function y(){return!!(s&&Pl(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Bd(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Bd(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Bd(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Bd(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!zd(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Id/2:Id*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Id+1,o=C||T?S.bottom-Id:S.top,s=C?T?S.bottom-Id:S.top:S.bottom-Id;M=Rd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Id/2:Id*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Id,o=C||T?S.top+Id:S.bottom,s=C?T?S.top+Id:S.bottom:S.top+Id;M=Rd(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Id/2:Id*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Id+1,o=w||E?S.right-Id:S.left,s=w?E?S.right-Id:S.left:S.right-Id;M=Rd(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Id/2:Id*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Id,o=w||E?S.left+Id:S.right,s=w?E?S.left+Id:S.right:S.left+Id;M=Rd(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Hd(e,t,n){let{reference:r,floating:i}=e,a=Hc(t),o=Uc(t),s=Vc(o),c=Rc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=zc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ud(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Lc(t,e),p=tl(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=nl(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=nl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Wd=50,Gd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ud},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Hd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Wd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Hd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Kd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Lc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Rc(r),_=Hc(o),v=Rc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[$c(o)]:Gc(o)),x=p!==`none`;!d&&x&&b.push(...Qc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Wc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Hc(t)||T.every(e=>Hc(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Hc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},qd=new Set([`left`,`top`]);async function Jd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rc(n),s=zc(n),c=Hc(n)===`y`,l=qd.has(o)?-1:1,u=a&&c?-1:1,d=Lc(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Yd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Jd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Xd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Lc(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Hc(i),p=Bc(f),m=u[p],h=u[f],g=(e,t)=>Ic(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Zd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Lc(e,t),u={x:n,y:r},d=Hc(i),f=Bc(d),p=u[f],m=u[d],h=Lc(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=qd.has(Rc(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Qd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Lc(e,t),c=await i.detectOverflow(t,s),l=Rc(n),u=zc(n),d=Hc(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ac(p-c[m],g),y=Ac(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*jc(c.left,c.right):S=p-2*jc(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function $d(e){let t=ke(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=b(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Mc(n)!==a||Mc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ef(e){return H(e)?e:e.contextElement}function tf(e){let t=ef(e);if(!b(t))return Pc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$d(t),o=(a?Mc(n.width):n.width)/r,s=(a?Mc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nf=Pc(0);function rf(e){let t=dt(e);return!W()||!t.visualViewport?nf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function af(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===dt(e)}function of(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ef(e),o=Pc(1);t&&(r?H(r)&&(o=tf(r)):o=tf(e));let s=af(a,n,r)?rf(a):Pc(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=dt(a),t=H(r)?dt(r):r,n=e,i=N(n);for(;i&&t!==n;){let e=tf(i),t=i.getBoundingClientRect(),r=ke(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=dt(i),i=N(n)}}return nl({width:u,height:d,x:c,y:l})}function sf(e,t){let n=x(e).scrollLeft;return t?t.left+n:of(k(e)).left+n}function cf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-sf(e,n),y:n.top+t.scrollTop}}function lf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k(r),s=t?C(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Pc(1),u=Pc(0),d=b(r);if((d||!a)&&((g(r)!==`body`||v(o))&&(c=x(r)),d)){let e=of(r);l=tf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?cf(o,c):Pc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function uf(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function df(e){let t=x(e),n=e.ownerDocument.body,r=jc(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=jc(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+sf(e),o=-t.scrollTop;return ke(n).direction===`rtl`&&(a+=jc(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ff=25;function pf(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=dt(e),a=k(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!W()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(sf(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ff&&(s-=o)}return{width:s,height:c,x:l,y:u}}function mf(e,t){let n=of(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=tf(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function hf(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=pf(e,n,t);else if(t===`document`)r=df(k(e));else if(H(t))r=mf(t,n);else{let n=rf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return nl(r)}function gf(e,t){let n=t.get(e);if(n)return n;let r=T(e,[],!1).filter(e=>H(e)&&g(e)!==`body`),i=null,a=ke(e).position===`fixed`,o=a?I(e):e;for(;H(o)&&!V(o);){let e=ke(o),t=l(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=I(o)}return t.set(e,r),r}function _f(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?C(t)?[]:gf(t,this._c):[].concat(n),r],o=hf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=hf(t,a[e],i);s=jc(n.top,s),c=Ac(n.right,c),l=Ac(n.bottom,l),u=jc(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function vf(e){let{width:t,height:n}=$d(e);return{width:t,height:n}}function yf(e,t,n){let r=b(t),i=k(t),a=n===`fixed`,o=of(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Pc(0);if((r||!a)&&((g(t)!==`body`||v(i))&&(s=x(t)),r)){let e=of(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=sf(i));let l=i&&!r&&!a?cf(i,s):Pc(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function bf(e){return ke(e).position===`static`}function xf(e,t){if(!b(e)||ke(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k(e)===n&&(n=n.ownerDocument.body),n}function Sf(e,t){let n=dt(e);if(C(e))return n;if(!b(e)){let t=I(e);for(;t&&!V(t);){if(H(t)&&!bf(t))return t;t=I(t)}return n}let r=xf(e,t);for(;r&&Ke(r)&&bf(r);)r=xf(r,t);return r&&V(r)&&bf(r)&&!l(r)?n:r||D(e)||n}var Cf=async function(e){let t=this.getOffsetParent||Sf,n=this.getDimensions,r=await n(e.floating);return{reference:yf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wf(e){return ke(e).direction===`rtl`}var Tf={convertOffsetParentRelativeRectToViewportRelativeRect:lf,getDocumentElement:k,getClippingRect:_f,getOffsetParent:Sf,getElementRects:Cf,getClientRects:uf,getDimensions:vf,getScale:tf,isElement:H,isRTL:wf};function Ef(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Df(e,t,n){let r=null,i,a=k(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Nc(d),h=Nc(a.clientWidth-(u+f)),g=Nc(a.clientHeight-(d+p)),_=Nc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:jc(0,Ac(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ef(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=dt(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Of(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ef(e),u=i||a?[...l?T(l):[],...t?T(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Df(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?of(e):null;c&&g();function g(){let t=of(e);h&&!Ef(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var kf=Yd,Af=Xd,jf=Kd,Mf=Qd,Nf=Zd,Pf=(e,t,n)=>{let r=new Map,i=n??{},a={...Tf,...i.platform,_c:r};return Gd(e,t,{...i,platform:a})},Ff=typeof document<`u`?J.useLayoutEffect:function(){};function If(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!If(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!If(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Lf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Rf(e,t){let n=Lf(e);return Math.round(t*n)/n}function zf(e){let t=J.useRef(e);return Ff(()=>{t.current=e}),t}function Bf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);If(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=zf(c),D=zf(i),O=zf(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Pf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!If(w.current,t)&&(w.current=t,zs.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Ff(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);Ff(()=>(A.current=!0,()=>{A.current=!1}),[]),Ff(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Rf(M.floating,u.x),r=Rf(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Lf(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Vf=(e,t)=>{let n=kf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hf=(e,t)=>{let n=Af(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uf=(e,t)=>({fn:Nf(e).fn,options:[e,t]}),Wf=(e,t)=>{let n=jf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gf=(e,t)=>{let n=Mf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kf=J.createContext(void 0);function qf(e){let t=J.useContext(Kf);if(t===void 0&&!e)throw Error(B(69));return t}var Jf=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function Yf(e){return e===`starting`?Xl:it}var Xf=J.createContext(void 0);function Zf(){return J.useContext(Xf)}function Qf(e,t){let n=we(e.render);if(J.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function $f(e,t,n){let r=Qf(e,t),i=r===t?void 0:r;return[r,J.useCallback(e=>n?.(e?i:void 0),[i,n])]}function ep(e,t,n){let r=we(e.render),i=J.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var tp=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=vo(),m=Zf(),{side:h,align:g}=go(),_=qf(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=$f(e,u,d),L=ep(e,C,N),R=w.type===`menu`?m:void 0,z=w.type===`context-menu`,B=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(B=()=>l.state.activeIndex===null&&P),Us({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){l.setOpen(!1,ks(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),Cd(D,{enabled:A&&!j&&!z&&w.type!==`menubar`,closeDelay:k});let V=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ee,handleFocus:H}=(J.useContext(Zo)?.useParentHandoff??rp)(l,w,v,f),U={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},te=Se(`div`,e,{state:U,ref:[t,l.context.popupRef,V,I],stateAttributesMapping:Po,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&Jf.has(e.key)&&e.stopPropagation()},onFocus:H},Yf(y),c,{"data-rootownerid":E}]}),ne=w.type===void 0||z;(C||w.type===`menubar`&&T!==`outside-press`)&&(ne=!0);let re=R?.getReturnElement??ee;return(0,Y.jsx)(Su,{context:D,openInteractionType:M,modal:z,disabled:!x,returnFocus:a??re??ne,explicitReturnFocus:a===void 0&&re?!1:void 0,initialFocus:B,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:te})}),np={parentVirtualFocusRef:void 0,handleFocus:void 0};function rp(){return np}var ip=J.forwardRef(function(e,t){let n=Qo()?.Popup??tp;return(0,Y.jsx)(n,{...e,ref:t})}),ap=J.createContext(void 0);function op(){let e=J.useContext(ap);if(e===void 0)throw Error(B(32));return e}var sp=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=vo();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Y.jsx)(ap.Provider,{value:n,children:(0,Y.jsx)(iu,{ref:t,...r,portalOwnerRole:o})})});function cp(e){return K(19)?e:e?`true`:void 0}function lp(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=J.useState(null),d=J.useRef(null),f=uu(n),m=J.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),h=Bf({...e,elements:{...m,...l&&{reference:l}}}),g=J.useCallback(e=>{let t=H(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=J.useMemo(()=>({...h.refs,setPositionReference:g,domReference:d}),[h.refs,g]),v=J.useMemo(()=>({...h.elements,domReference:o}),[h.elements,o]),y=J.useMemo(()=>({...h,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,s,c]);return p(()=>{o&&(d.current=o)},[o]),p(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),J.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var up=J.createContext(void 0);function dp(){return J.useContext(up)?.direction??`ltr`}var fp=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Lc(e,t)||{};if(l==null)return{};let d=tl(u),f={x:n,y:r},p=Uc(i),m=Vc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Ic(D,k,O),j=!c.arrow&&zc(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),pp=(e,t)=>{let{name:n,fn:r}=fp(e);return{name:n,fn:r,options:[e,t]}},mp={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},hp={sideX:`left`,sideY:`top`},gp=`--available-width`,_p=`--available-height`,vp=`--anchor-width`,yp=`--anchor-height`,bp=`--transform-origin`,xp=gp,Sp=_p;function Cp(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function wp(e,t,n){let{rects:r,placement:i}=e;return{side:Cp(t,Rc(i),n),align:zc(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Tp(e){return Ep(e,lp)}function Ep(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,k=typeof n==`function`?n:void 0,A=j(k),M=k?A:n,N=Tc(n),P=Tc(_),F=dp()===`rtl`,[I,L]=J.useState(null);!_&&I!==null&&L(null);let R=S===`placement`,z=I?Rc(I):null,B=I&&R?zc(I)||`center`:null,V=z||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],ee=B||o,H=ee===`center`?V:`${V}-${ee}`,U=l;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let te=+(i===`bottom`),ne=+(i===`top`),re=+(i===`right`),ie=+(i===`left`),W={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:U},G=J.useRef(null),ae=Tc(a),oe=Tc(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];m&&le.push(m),le.push(Vf(e=>{let t=wp(e,i,F),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,F,i]));let K=T===`none`&&w!==`shift`,ue=!K&&(u||D||w===`shift`),de=w===`none`?null:Wf({...W,padding:{top:U.top+1+te,right:U.right+1+ie,bottom:U.bottom+1+ne,left:U.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),fe=K?null:Hf({...W,rootBoundary:O,mainAxis:T!==`none`,crossAxis:ue,limiter:u||D?void 0:Uf(e=>{if(!G.current)return{};let{width:t,height:n}=G.current.getBoundingClientRect(),r=Hc(Rc(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[W,u,D,O,U,T]);w===`shift`||T===`shift`||ee===`center`?le.push(fe,de):le.push(de,fe),le.push(Gf({...W,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(xp,`${t}px`),i.setProperty(Sp,`${n}px`);let a=dt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(vp,`${u}px`),i.setProperty(yp,`${d}px`)}}),pp(e=>({element:G.current||Lr(e.elements.floating).createElement(`div`),padding:G.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Rc(r),u=zc(r),d=Hc(l)===`y`,f=G.current,p=typeof a==`function`?a(wp(e,i,F)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ue&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(bp,d?`${m} ${h}`:`${h} ${m}`),{}}},mp,x),p(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=J.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:g,open:h?_:void 0,placement:H,middleware:le,strategy:r,whileElementsMounted:h?void 0:(...e)=>Of(...e,pe),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||hp,Ee=Se?r:`fixed`,De=J.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[xp]=`100vw`,e[Sp]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,ge,Te,_e,Ce,Se]),Oe=J.useRef(null);p(()=>{if(!_)return;let e=N.current,t=typeof e==`function`?e():e,n=(Dp(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[_,me,M,N]),J.useEffect(()=>{if(!_)return;let e=N.current;typeof e!=`function`&&Dp(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[_,me,M,N]),J.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return Of(he.reference,he.floating,ye,pe)},[h,_,he,ye,pe]);let ke=Rc(be),Ae=Cp(i,ke,F),je=zc(be)||`center`,Me=!!ve.hide?.referenceHidden;p(()=>{S&&_&&Se&&(ke!==V||R&&je!==ee)&&L(be)},[S,R,_,Se,be,ke,je,V,ee]);let Ne=J.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:G,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,G,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function Dp(e){return e!=null&&`current`in e}function Op(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=j(i),[,o]=J.useState(0),s=je(Ap).current,c=je(kp).current,l=J.useRef(0),u=J.useRef(!0),d=J.useRef(null),f=J.useRef(null),m=j(()=>{u.current||(u.current=!0,o(e=>e+1))}),h=j((e,t)=>{c.set(e,t),m()}),g=j(e=>{c.delete(e),m()}),_=j(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function v(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Np(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Pp(r,n)>0){t.disconnect(),m();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Mp(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=j(()=>{let[e,t]=jp(c),n=_(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});v(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});p(()=>(!u.current&&d.current&&_(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,_]),p(()=>{u.current&&y()}),p(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let b=j(e=>(s.add(e),()=>{s.delete(e)})),x=J.useMemo(()=>({register:h,unregister:g,subscribeMapChange:b,nextIndexRef:l}),[h,g,b,l]);return(0,Y.jsx)(bs.Provider,{value:x,children:t})}function kp(){return new Map}function Ap(){return new Set}function jp(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Pp(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Mp(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Np(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Pp(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Fp=J.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Ip(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=J.useRef(null),o=J.useRef(null),s=Hs(r);p(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),p(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function Lp(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Se(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Yf(r),i],stateAttributesMapping:No})}var Rp={},zp={},Bp=``;function Vp(e,t){return v(e)?e:t}function Hp(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Vp(t,n)).overflowY)}function Up(e){if(typeof document>`u`)return!1;let t=Lr(e);return dt(t).innerWidth-t.documentElement.clientWidth>0}function Wp(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Lr(e),n=t.documentElement,r=t.body,i=Vp(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Gp(e){let t=Lr(e),n=t.documentElement,r=t.body,i=Vp(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Kp(e){let t=Lr(e),n=t.documentElement,r=t.body,i=dt(n),a=0,o=0,s=!1,c=Ps.create();if(ps&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Rp={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Bp=n.style.scrollBehavior,zp={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Vp(n,r);s=Wp(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Rp),Object.assign(r.style,zp),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Bp)}function d(){u(),c.request(l)}l();let f=$(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var qp=new class{lockCount=0;restore=null;timeoutLock=qs.create();timeoutUnlock=qs.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Lr(e),n=t.documentElement,r=t.body,i=dt(n);if(Hp(i,n,r)){let t=new i.MutationObserver(()=>{Hp(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=cs||!Up(e);this.restore=a?Gp(e):Kp(e)}};function Jp(e=!0,t=null){p(()=>{if(e)return qp.acquire(t)},[e,t])}var Yp=20;function Xp(e,t,n,r){let[i,a]=J.useState(!1);p(()=>{if(!e||!t||n==null){a(!1);return}let r=Lr(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Yp)},[e,t,n]),Jp(e&&(!t||i),r)}var Zp=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Zl,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=vo(),x=op(),S=Io(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),z=n,B=c,V=l,ee=s,H=h;C.type===`context-menu`&&(z=n??C.context?.anchor,ee??=`start`,!o&&ee!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let U=o,te=ee;C.type===`menu`?(U??=`inline-end`,te??=`start`,H=e.collisionAvoidance??Ql):C.type===`menubar`&&(U??=C.context.orientation===`vertical`?`inline-end`:`bottom`,te??=`start`);let ne=C.type===`context-menu`,re=Tp({anchor:z,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:U,sideOffset:B,align:te,alignOffset:V,arrowPadding:ne?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:H,shift:ne?{crossAxis:!(`side`in H&&H.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});J.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,ks(Yo)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),J.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,ks(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ie=Js();J.useEffect(()=>{D||ie.clear()},[D,ie]),J.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?ie.isStarted()||ie.start(e,()=>{v.setOpen(!1,ks(Yo))}):v.setOpen(!1,ks(Yo))}else ie.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ie]),J.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),Ip({store:v,domReference:R,positionerElement:M,open:D});let W={open:D,side:re.side,align:re.align,anchorHidden:re.anchorHidden,nested:C.type===`menu`,instant:N},G=C.type===`menubar`&&C.context.modal;Xp(D&&(G||O&&F!==`trigger-hover`),k===`touch`,M,A);let ae=Lp(e,W,{styles:re.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),oe=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),se=null;return C.type===`menubar`?se=C.context.contentElement:C.type===void 0&&(se=A),(0,Y.jsxs)(ho.Provider,{value:re,children:[oe&&(0,Y.jsx)(Fp,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:cp(!D),cutout:se}),(0,Y.jsx)(fu,{id:I,children:(0,Y.jsx)(Op,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:ae})})]})}),Qp=J.createContext(null);function $p(e){let t=J.useContext(Qp);if(t===null&&!e)throw Error(B(5));return t}function em(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function tm(e,t){let n=J.useRef(e),r=j(t);p(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function nm(e,t){let{onClick:n,onPointerDown:r}=em(j((n,r)=>{(typeof e==`function`?e():e)||t(r||(cs?`touch`:``))}));return J.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function rm(e){let[t,n]=J.useState(null),r=nm(e,n);return tm(e,t=>{t&&!e&&n(null)}),J.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function im(e){return e==null?Lo:e.type.startsWith(`key`)?Ko:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?qo:Lo}var am={...md,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=md.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>ps&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!md.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},om=class extends ad{constructor(e,t,n=!1){let r=new zu,i=cm(r,t,n,e);super(i,sm(r),am),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function sm(e){return{positionerRef:J.createRef(),popupRef:J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:J.createRef(),beforeTriggerFocusGuardRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function cm(e,t,n=!1,r){return{...cd(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:it,inputProps:it,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ou,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:it,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var lm=J.createContext(null);function um(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function dm(e,t){return e===`list-navigation`||um(e,t)}var fm=Ju(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:m,triggerId:g,defaultTriggerId:_=null,highlightItemOnHover:v=!0,isSubmenu:y=!1,virtualFocus:b=!1,virtualFocusRef:x,allowEscape:S=!0,resetOnPointerLeave:C=!0}=e,w=Io(!0),T=vo(!0),E=$p(!0),D=T?.store,O=T?.virtualFocus??!1,k=J.useMemo(()=>y&&D?{type:`menu`,store:D}:E?{type:`menubar`,context:E}:w&&!D?{type:`context-menu`,context:w}:{type:void 0},[w,D,E,y]),A=Os(),M=Os(),[N,P]=J.useState(void 0),F=(N??M)||void 0,I=lu(),L=k.type===`menu`?k.store:void 0,R=(n??o)&&L?.state.transitionStatus===`starting`,z=je(()=>R?L?.state.instantType:void 0).current,B=je(()=>{let e=new om({open:o,openProp:n,activeTriggerId:_,triggerIdProp:g,parent:k,disabled:s,highlightItemOnHover:v,modal:k.type===void 0?c:void 0,rootId:A,instantType:z},F,I!=null);return e.context.virtualFocusRef=x,e}).current;B.useControlledProp(`openProp`,n),B.useControlledProp(`triggerIdProp`,g),B.useContextCallback(`onOpenChangeComplete`,i);let V=B.useState(`floatingTreeRoot`),ee=du(V),H=B.useState(`open`),U=B.useState(`activeTriggerElement`),te=B.useState(`positionerElement`),ne=B.useState(`hoverEnabled`),re=B.useState(`disabled`),ie=B.useState(`lastOpenChangeReason`),W=B.useState(`parent`),G=B.useState(`activeIndex`),ae=B.useState(`keyboardOpen`),se=B.useState(`payload`),ce=B.useState(`floatingParentNodeId`),le=J.useRef(null),K=J.useRef(W.type!==`context-menu`),ue=Js(),de=J.useRef(!0),fe=Js(),pe=ce!=null,{openMethod:me,triggerProps:he}=rm(H);B.useSyncedValues({disabled:s,highlightItemOnHover:v,modal:W.type===void 0?c:void 0,openMethod:me,rootId:A}),Iu(B);let{forceUnmount:ge,transitionStatus:_e}=Lu(H,B,()=>{B.set(`allowMouseEnter`,!1)},R),ve=Hs(B.context.popupRef);J.useEffect(()=>{if(z===void 0)return;let e=()=>{B.state.instantType===z&&B.set(`instantType`,void 0)};if(!H){e();return}if(_e!==void 0)return;if(B.context.popupRef.current==null){e();return}let t=new AbortController;return ve(e,t.signal),()=>{t.abort()}},[z,H,_e,ve,B]),p(()=>{w&&!T?B.update({parent:{type:`context-menu`,context:w},floatingNodeId:ee,floatingParentNodeId:I}):(T||!B.select(`activeTriggerElement`))&&B.update({floatingNodeId:ee,floatingParentNodeId:I})},[w,T,ee,I,U,B]),J.useEffect(()=>{H||(le.current=null),W.type===`context-menu`&&(H?ue.start(500,()=>{K.current=!0}):(ue.clear(),K.current=!1))},[ue,H,W.type]),p(()=>{!H&&!ne&&B.set(`hoverEnabled`,!0)},[H,ne,B]);let ye=j((e,t)=>{let n=t.reason;if(!e&&!B.select(`open`)||H===e&&t.trigger===U&&ie===n)return;let i=Pu(t);if(!e&&t.trigger==null&&(t.trigger=U??void 0),r?.(e,t),t.isCanceled)return;B.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!de.current)return;e&&n===`trigger-focus`?(de.current=!1,fe.start(300,()=>{de.current=!0})):(de.current=!0,fe.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=Nu(B.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&dm(n,a),s.instantType=W.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:um(n,a)?`click`:o?`dismiss`:void 0,B.update(s)}),be=Du({popupStore:B,floatingRootContext:B.state.floatingRootContext,floatingId:F,nested:I!=null,onOpenChange:ye}),xe=be.context.events;p(()=>{let e=({open:e,eventDetails:t})=>ye(e,t);return xe.on(`setOpen`,e),()=>{xe?.off(`setOpen`,e)}},[xe,ye]),p(()=>B.subscribeToParentMenu(),[B]);let Se=J.useCallback(()=>{B.setOpen(!1,ks(Xo))},[B]);J.useImperativeHandle(d,()=>({unmount:ge,close:Se}),[ge,Se]);let Ce;W.type===`context-menu`&&(Ce=W.context),J.useImperativeHandle(Ce?.positionerRef,()=>te,[te]),J.useImperativeHandle(Ce?.actionsRef,()=>({setOpen:ye}),[ye]);let we=Eu(be,{enabled:!re,bubbles:{escapeKey:f&&W.type===`menu`},outsidePress(){return W.type!==`context-menu`||le.current?.type===`contextmenu`||K.current},externalTree:pe?V:void 0}),Te=dp(),Ee=Md(be,{enabled:!re,listRef:B.context.itemDomElements,activeIndex:G,virtual:b,nested:W.type===`menubar`||!b&&W.type!==void 0,parentOrientation:W.type===`menubar`?W.context.orientation:void 0,loopFocus:l,focusItemOnOpen:b?ae:void 0,allowEscape:b&&l&&S,orientation:u,triggerOrientation:b?`vertical`:u,rtl:Te===`rtl`,disabledIndices:oe,onNavigate(e,t){B.setActiveIndex(e,im(t),t?.nativeEvent)},openOnArrowKeyDown:W.type!==`context-menu`&&!(b&&y),externalTree:!b&&pe?V:void 0,nestedReturnFocusRef:L?.context.virtualFocusRef,focusItemOnHover:v,resetOnPointerLeave:C}),De=J.useCallback(e=>{B.context.typingRef.current=e},[B]),Oe=Nd(be,{enabled:!re&&!b,listRef:B.context.itemLabels,elementsRef:B.context.itemDomElements,activeIndex:G,resetMs:500,onMatch:(e,t)=>{H&&e!==G&&B.setActiveIndex(e,Ko,t.nativeEvent)},onTyping:De}),ke=j(a),Ae=J.useRef(-1),Me=j(()=>{let e=B.state.activeIndex,t=e===null?void 0:B.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ae.current===n&&B.context.reportedItem===t)return;Ae.current=n,B.context.reportedItem=t,b&&B.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=B.context;B.context.highlightReason=Lo,B.context.highlightEvent=void 0,a&&ke(t,As(r,i,{label:t===void 0?void 0:B.context.itemLabels.current[n]??void 0}))});p(()=>{Me()},[G,Me]);let Ne=J.useMemo(()=>{if(!b)return Ee.reference;if(!Ee.trigger)return it;let{onFocus:e,...t}=Ee.trigger;return t},[b,Ee.reference,Ee.trigger]);B.useSyncedValue(`inputProps`,b?Ee.reference??it:it);let Pe=J.useMemo(()=>{let e=h(Oe.reference,Ne,we.reference,{onMouseMove(){B.set(`allowMouseEnter`,!0)}},he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=H,e},[B,Oe.reference,Ne,we.reference,he,H]),Fe=J.useMemo(()=>{let e=h(Ee.trigger,we.trigger,he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ee.trigger,we.trigger,he]);je(()=>(B.update({inactiveTriggerProps:Fe}),null)),Ru(B,{floatingRootContext:be,activeTriggerProps:Pe,inactiveTriggerProps:Fe,popupProps:J.useMemo(()=>h(ku,{onMouseMove(){B.set(`allowMouseEnter`,!0),W.type===`menu`&&B.set(`hoverEnabled`,!1)},onClick(){B.select(`hoverEnabled`)&&B.set(`hoverEnabled`,!1)},onKeyDown(e){let t=B.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Oe.floating,Ee.floating,we.floating),[W.type,B,Oe.floating,Ee.floating,we.floating]),itemProps:Ee.item??it});let Ie=J.useMemo(()=>({store:B,parent:k,orientation:u,loopFocus:l,allowEscape:S,defaultFloatingId:M,setRenderedFloatingId:P,virtualFocus:b,parentVirtualFocus:O,syncHighlightedItem:Me}),[B,k,u,l,S,M,b,O,Me]),Le=typeof t==`function`?t({payload:se}):t,Re=(0,Y.jsxs)(_o.Provider,{value:Ie,children:[m&&(0,Y.jsx)(Au,{handle:m,store:B}),Le]});return(W.type===void 0||W.type===`context-menu`)&&(Re=(0,Y.jsx)(pu,{externalTree:V,children:Re})),Re});function pm(e){let t=J.useContext(lm);if(t===null)return(0,Y.jsx)(fm,{...e});let n=t.Root;return(0,Y.jsx)(lm.Provider,{value:null,children:(0,Y.jsx)(n,{...t.options,...e})})}var mm=5;function hm(e,t){let n=gm(t);return e.clientX>=n.left-mm&&e.clientX<=n.right+mm&&e.clientY>=n.top-mm&&e.clientY<=n.bottom+mm}function gm(e){let t=e.getBoundingClientRect(),n=dt(e);if(hs)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function _m(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=ot(),{ref:i,index:a}=Ss(e),o=n===a,s=J.useRef(null),c=ct(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function vm(e){let{render:t,className:n,style:r,state:i=it,props:a=oe,refs:o=oe,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=_m({metadata:s});return Se(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function ym(e){if(b(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!V(e))return ym(I(e))}function bm(e,t){function n(n,r,i){let a=n.currentTarget;zs.flushSync(()=>{e.setOpen(!1,ks(Uo,n.nativeEvent,a))}),Al(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&jl(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function xm(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Lr(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:it,[t,n,r])}var Sm=Yu(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=vo(!0),g=hd(d)??m?.store;if(!g)throw Error(B(85));let _=Os(s),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerControlsId`,_),S=J.useRef(null),C=wm(),w=ot(!0),T=uu(),E=J.useMemo(()=>T??new ou,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=Fu(_,S,g,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:du(E),floatingParentNodeId:lu(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=g.useState(`disabled`),M=a||A||k&&C.context.disabled,{getButtonProps:N,buttonRef:P}=R({disabled:M,native:o});J.useEffect(()=>{!b&&C.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,b,C.type]);let F=J.useRef(null),I=Js(),L=j(e=>{if(!F.current)return;I.clear(),g.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Q(F.current,t)||Q(g.select(`positionerElement`),t)||t===F.current||(t==null||ym(t)!==g.select(`rootId`))&&(hm(e,F.current)||E.events.emit(`close`,{domEvent:e,reason:Jo}))});J.useEffect(()=>{let e=Lr(F.current);if(b&&g.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,L,{once:!0}),()=>{e.removeEventListener(`mouseup`,L)}},[b,L,g]);let z=k&&C.context.hasSubmenuOpen,V=Td(y,{enabled:(c??z)&&!M&&(!k||z&&!O),handleClose:Vd({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:S,externalTree:E,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),ee=Cm(b,g.select(`lastOpenChangeReason`)),H=Cu(y,{enabled:!M,event:b&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&ee}),U=_d(y,{enabled:!M&&z}),te=xm({open:b,enabled:k,mouseDownAction:`open`}),ne=J.useMemo(()=>h(U.reference,H.reference),[U.reference,H.reference]),re=g.useState(`triggerProps`,O),ie=g.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:W,handleFocusTargetFocus:G}=bm(g,S),ae={disabled:M,open:b},oe=[F,t,P,D,S],se=[ne,V??it,re,{"aria-haspopup":`menu`,"aria-controls":x,id:_,onMouseDown:e=>{g.select(`open`)||(I.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),Lr(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},ie,k?{role:`menuitem`}:{},te,p,N],ce=Se(`button`,e,{enabled:!k,stateAttributesMapping:Z,state:ae,ref:oe,props:se});return k?(0,Y.jsx)(vm,{tag:`button`,render:n,className:r,style:i,state:ae,refs:oe,props:se,stateAttributesMapping:Z}):b?(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(kc,{ref:g.context.beforeTriggerFocusGuardRef,onFocus:W},`${_}-pre-focus-guard`),(0,Y.jsx)(J.Fragment,{children:ce},_),(0,Y.jsx)(kc,{ref:g.context.triggerFocusTargetRef,onFocus:G},`${_}-post-focus-guard`)]}):(0,Y.jsx)(J.Fragment,{children:ce},_)});function Cm(e,t){let n=Js(),[r,i]=J.useState(!1);return p(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function wm(){let e=$p(!0);return J.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function Tm({label:e,actions:t}){let n=(0,J.useSyncExternalStore)(Dt,Ct),r=n===`unreachable`||n===`retrying`;return(0,Y.jsxs)(pm,{children:[(0,Y.jsx)(Sm,{"aria-label":e,title:`More actions`,className:Ie({variant:`outline`,size:`icon-xs`}),children:(0,Y.jsx)(Mn,{})}),(0,Y.jsx)(sp,{children:(0,Y.jsx)(Zp,{side:`bottom`,align:`end`,sideOffset:4,className:`z-50`,children:(0,Y.jsx)(ip,{"aria-label":e,finalFocus:()=>!(document.activeElement instanceof HTMLElement&&document.activeElement.matches(`input, textarea, select`)),className:`flex min-w-44 flex-col rounded-lg border bg-popover p-1 text-sm text-popover-foreground shadow-lg outline-none`,children:t.map(e=>(0,Y.jsxs)(Gs,{"aria-label":e.ariaLabel,title:e.title,disabled:e.disabled||e.changesData&&r,onClick:e.onSelect,className:a(`flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-muted max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0`,e.destructive?`text-destructive data-[highlighted]:bg-destructive/10 dark:data-[highlighted]:bg-destructive/20`:`[&_svg]:text-muted-foreground`),children:[e.icon,e.label]},e.key))})})})]})}var Em=/^\s*(```|~~~)/,Dm=/^\s*([-*_])(\s*\1){2,}\s*$/,Om=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/,km=/^\s*(>\s*)*(#{1,6}\s+|[-*+]\s+|\d+[.)]\s+)?(\[[ xX]\]\s+)?/;function Am(e){return e.replace(/!?\[([^\]]*)\]\((?:[^()]|\([^()]*\))*\)/g,`$1`).replace(/<((?:https?|mailto):[^>\s]+)>/g,`$1`).replace(/`+/g,``).replace(/(\*\*|__|~~)(?=\S)(.+?)(?<=\S)\1/g,`$2`).replace(/(?<![\w*])([*_])(?=[^\s*_])(.+?)(?<=[^\s*_])\1(?![\w*])/g,`$2`).replace(/\s*\|\s*/g,` `)}var jm=/^\s*#{1,6}(\s|$)/;function Mm(e){let t=[],n=!1;for(let r of e.split(/\r?\n/))if(Em.test(r)){if(n=!n,t.length>0)break}else if(!n){if(r.trim()===``||jm.test(r)||Dm.test(r)){if(t.length>0)break}else t.push(r)}return Nm(t.join(`
|
|
11
|
+
`))}function Nm(e){return e.split(/\r?\n/).filter(e=>!Em.test(e)&&!Dm.test(e)&&!Om.test(e)).map(e=>Am(e.replace(km,``))).join(` `).replace(/\s+/g,` `).trim()}function Pm(e,t,n=!1){let[r,i]=(0,J.useState)(!1),a=(0,J.useRef)(null),o=()=>{e?(a.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i(!0)):t()},s=e=>{let t=a.current;t?.isConnected&&t.matches(`input, textarea, select`)?t.focus():(e instanceof Element?e.closest(`form`):null)?.querySelector(`textarea, input:not([type=checkbox]), select`)?.focus(),i(!1)};return{asking:r,request:o,keep:s,discard:()=>{i(!1),t()},onKeyDown:e=>{e.key!==`Escape`||n||e.defaultPrevented||(e.preventDefault(),r?s(e.target):o())}}}function Fm({label:e,question:t,onKeep:n,onDiscard:r}){return(0,Y.jsxs)(`div`,{role:`group`,"aria-label":e,className:`flex flex-wrap items-center gap-1 text-xs max-md:gap-2`,children:[(0,Y.jsx)(`span`,{className:`mr-1`,children:t}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`outline`,autoFocus:!0,onClick:e=>n(e.currentTarget),children:`Keep editing`}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`destructive`,onClick:r,children:`Discard changes`})]})}var Im=(0,J.lazy)(()=>Za(()=>import(`./markdown-akFj_lY_.js`),__vite__mapDeps([0,1,2])));function Lm({label:e,value:t,onChange:n,placeholder:r,className:i}){let[o,s]=(0,J.useState)(!1),c=(0,J.useId)();return(0,Y.jsxs)(`div`,{className:a(`flex min-w-0 flex-col gap-1 max-md:gap-2`,i),children:[(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Mode of ${e}`,className:`flex gap-0.5 max-md:gap-2`,children:[(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:o?`ghost`:`default`,"aria-pressed":!o,onClick:()=>s(!1),children:`Write`}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:o?`default`:`ghost`,"aria-pressed":o,onClick:()=>s(!0),children:`Preview`})]}),o?(0,Y.jsx)(`div`,{role:`region`,"aria-label":`Preview of ${e}`,className:`min-h-16 rounded-lg border border-input px-2.5 py-1.5`,children:t.trim()?(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:t}),children:(0,Y.jsx)(Im,{source:t})}):(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview`})}):(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 resize-y py-1.5 max-md:h-auto`),rows:3,placeholder:r,"aria-label":e,"aria-describedby":c,value:t,onChange:e=>n(e.target.value)}),(0,Y.jsx)(`p`,{id:c,className:`text-xs text-muted-foreground`,children:`Markdown supported`})]})}function Rm(e){let t=Hi(e.estimate);return t===null?null:Number.isNaN(t)?void 0:{unit:e.estimateUnit,amount:t}}function zm({suffix:e,checked:t,onChange:n}){return(0,Y.jsxs)(`label`,{className:`flex w-fit items-center gap-1.5 text-xs text-muted-foreground max-md:min-h-11`,title:`An executor may take up the task on its own once it is ready`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,className:`size-3.5 accent-sky-600`,"aria-label":`Autopilot${e}`,checked:t,onChange:e=>n(e.target.checked)}),`Autopilot`]})}function Bm({suffix:e,plan:t,onChange:n,autoFocus:r}){let i=Rm(t)===void 0;return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,Y.jsxs)(`label`,{className:`flex items-center gap-1`,children:[`Estimate`,(0,Y.jsx)(`input`,{className:a(ft,`w-20`),inputMode:`decimal`,placeholder:`Optional`,"aria-label":`Estimate${e}`,"aria-invalid":i,autoFocus:r===`estimate`,title:`Optional: expected size, a number greater than 0`,value:t.estimate,onChange:e=>n({...t,estimate:e.target.value})})]}),(0,Y.jsxs)(`select`,{"aria-label":`Estimate unit${e}`,className:a(_t,`w-24`),value:t.estimateUnit,onChange:e=>n({...t,estimateUnit:e.target.value}),children:[(0,Y.jsx)(`option`,{value:`hours`,children:`hours`}),(0,Y.jsx)(`option`,{value:`days`,children:`days`}),(0,Y.jsx)(`option`,{value:`weeks`,children:`weeks`}),(0,Y.jsx)(`option`,{value:`months`,children:`months`})]}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-1`,children:[`Due`,(0,Y.jsx)(`input`,{type:`date`,className:a(ft,`w-40`),"aria-label":`Due date${e}`,autoFocus:r===`dueDate`,value:t.dueDate,onChange:e=>n({...t,dueDate:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`flex min-w-48 flex-1 items-center gap-1`,children:[`Labels`,(0,Y.jsx)(`input`,{className:ft,placeholder:`Optional, comma-separated`,"aria-label":`Labels${e}`,title:`Optional: projects or goals, separated by commas, that reviews filter by`,value:t.labels,onChange:e=>n({...t,labels:e.target.value})})]})]})}var Vm={manual:`Manual`,url:`URL responds`},Hm=[`manual`,`url`];function Um(e){return e===`url`}var Wm=0;function Gm(e){if(Wm+=1,e===void 0)return{key:Wm,id:null,text:``,kind:`manual`,target:``};let t=Um(e.kind)?e.target??``:``;return{key:Wm,id:e.id,text:e.text,kind:e.kind,target:t}}function Km(e){return e.filter(e=>e.text.trim()!==``).map(e=>({...e.id===null?{}:{id:e.id},text:e.text.trim(),kind:e.kind,target:Um(e.kind)?e.target.trim():null}))}function qm(e){if(e.text.trim()===``)return null;let t=e.target.trim();return e.kind===`url`&&!/^https?:\/\/\S*$/.test(t)?`Enter an http:// or https:// URL`:null}function Jm({criteria:e,onChange:t,taskId:n}){let[r,i]=(0,J.useState)(null),o=n===void 0?``:` of #${n}`,s=(n,r)=>t(e.map(e=>e.key===n?{...e,...r}:e));function c(){let n=Gm();i(n.key),t([...e,n])}return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1 max-md:gap-2`,children:[e.length>0&&(0,Y.jsx)(`ol`,{className:`flex flex-col gap-1 max-md:gap-2`,children:e.map((n,i)=>{let c=i+1,l=qm(n);return(0,Y.jsxs)(`li`,{className:`flex flex-wrap items-center gap-1 max-md:grid max-md:grid-cols-[1rem_1fr_auto] max-md:gap-2 max-md:rounded-lg max-md:border max-md:p-2`,children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`w-4 shrink-0 text-right text-xs tabular-nums text-muted-foreground`,children:c}),(0,Y.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 flex-1 basis-48 max-md:col-span-2`),"aria-label":`Criterion ${c} text${o}`,placeholder:`What has to hold, e.g. Docs updated`,value:n.text,onChange:e=>s(n.key,{text:e.target.value}),autoFocus:n.key===r}),(0,Y.jsx)(`select`,{"aria-label":`Criterion ${c} kind${o}`,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`h-7 max-md:col-start-2 max-md:row-start-2`),value:n.kind,title:`How the criterion is checked`,onChange:e=>s(n.key,{kind:e.target.value}),children:Hm.map(e=>(0,Y.jsx)(`option`,{value:e,children:Vm[e]},e))}),Um(n.kind)&&(0,Y.jsx)(`input`,{className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`h-7 flex-1 basis-40 font-mono max-md:col-span-2 max-md:col-start-2 max-md:row-start-3 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`),"aria-label":`Criterion ${c} target${o}`,"aria-invalid":l!==null,title:l??`Toodo checks that a GET of this URL succeeds`,placeholder:`https://example.com/health`,value:n.target,onChange:e=>s(n.key,{target:e.target.value})}),(0,Y.jsx)(q,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`Remove criterion ${c}${o}`,title:`Remove criterion`,className:`max-md:col-start-3 max-md:row-start-2`,onClick:()=>t(e.filter(e=>e.key!==n.key)),children:(0,Y.jsx)(vt,{})})]},n.key)})}),(0,Y.jsxs)(q,{type:`button`,size:`xs`,variant:`ghost`,className:`self-start`,"aria-label":n===void 0?void 0:`Add criterion to #${n}`,onClick:c,children:[(0,Y.jsx)(pt,{}),`Add criterion`]})]})}function Ym({task:e,focusPlan:t,onDone:n}){let r=ie(),[i,o]=(0,J.useState)(e.taskType),[s,c]=(0,J.useState)(e.title),[l,u]=(0,J.useState)(e.description),[d]=(0,J.useState)(()=>({estimate:e.estimate===null?``:String(e.estimate.amount),estimateUnit:e.estimate?.unit??`hours`,dueDate:e.dueDate??``,labels:Wi(e.labels)})),[f,p]=(0,J.useState)(d),[m,h]=(0,J.useState)(e.autopilot),g=Wi(Ui(f.labels))!==Wi(e.labels),[_]=(0,J.useState)(()=>e.criteria.map(e=>Gm(e))),[v,y]=(0,J.useState)(_),b=Rm(f),x=JSON.stringify(Km(v))!==JSON.stringify(Km(_)),S=v.some(e=>qm(e)!==null),C=i!==e.taskType||s!==e.title||l!==e.description||f.estimate!==d.estimate||f.estimateUnit!==d.estimateUnit||f.dueDate!==d.dueDate||f.labels!==d.labels||m!==e.autopilot||x,w=Pm(C,n,r.isPending);function T(t){t.preventDefault(),!(b===void 0||S)&&r.mutate({status:null,id:e.id,taskType:i,title:s.trim(),description:l.trim(),estimate:b,dueDate:f.dueDate||null,labels:g?Ui(f.labels):null,autopilot:m===e.autopilot?null:m,criteria:x&&e.status!==`done`?Km(v):null},{onSuccess:n})}return(0,Y.jsxs)(`form`,{onSubmit:T,"aria-label":`Edit task #${e.id}`,"data-dirty":C||void 0,className:`flex flex-col gap-1 max-md:gap-2`,onKeyDown:w.onKeyDown,children:[(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(`select`,{"aria-label":`Type of #${e.id}`,className:a(ft,`w-28`),value:i,onChange:e=>o(e.target.value),children:$a.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))}),(0,Y.jsx)(`input`,{className:ft,"aria-label":`Title of #${e.id}`,value:s,onChange:e=>c(e.target.value),required:!0,autoFocus:t===void 0})]}),(0,Y.jsx)(Lm,{label:`Description of #${e.id}`,placeholder:`Description (optional, Markdown)`,value:l,onChange:u}),(0,Y.jsx)(Bm,{suffix:` of #${e.id}`,plan:f,onChange:p,autoFocus:t}),(0,Y.jsx)(zm,{suffix:` of #${e.id}`,checked:m,onChange:h}),e.status!==`done`&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs`,children:(0,Y.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Completion criteria`})}),(0,Y.jsx)(Jm,{taskId:e.id,criteria:v,onChange:y})]}),w.asking?(0,Y.jsx)(Fm,{label:`Discard changes to #${e.id}`,question:`Discard your changes to #${e.id}?`,onKeep:w.keep,onDiscard:w.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[(0,Y.jsx)(q,{type:`submit`,size:`xs`,disabled:r.isPending||b===void 0||S,children:r.isPending?`Saving...`:`Save`}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:w.request,children:`Discard`})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}function Xm({task:e,onDone:t,onShipped:n}){let r=ve(),[i,o]=(0,J.useState)(``),s=Pm(i.trim()!==``,t,r.isPending);function c(n){n.preventDefault(),r.mutate({id:e.id,note:i.trim()},{onSuccess:t})}return(0,Y.jsxs)(`form`,{onSubmit:c,"aria-label":`Conclude #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:s.onKeyDown,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Finish #`,e.id,` without completing it. It is marked not adopted. Tasks that depend on it stay blocked.`]}),(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Conclusion of #${e.id}`,placeholder:`What was tried, what was found, and why it is not adopted.`,value:i,onChange:e=>o(e.target.value),required:!0,autoFocus:!0}),s.asking?(0,Y.jsx)(Fm,{label:`Discard conclusion of #${e.id}`,question:`Discard your conclusion of #${e.id}?`,onKeep:s.keep,onDiscard:s.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{type:`submit`,size:`xs`,variant:`destructive`,disabled:r.isPending||i.trim()===``,children:[(0,Y.jsx)(En,{}),r.isPending?`Concluding...`:`Conclude as not adopted`]}),(0,Y.jsxs)(q,{type:`button`,size:`xs`,variant:`outline`,"aria-label":`Complete #${e.id} as shipped by another task`,title:`The work shipped through another task: complete the task instead`,disabled:r.isPending,onClick:n,children:[(0,Y.jsx)(Bn,{}),`Complete as shipped by...`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:s.request,children:`Back`})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}var Zm={merged:`Merged`,completed:`Completed`,not_adopted:zr.not_adopted};function Qm({task:e,onDone:t}){let n=Oe(),[r,i]=(0,J.useState)(``),o=Pm(r.trim()!==``,t,n.isPending);function s(i){i.preventDefault(),n.mutate({id:e.id,reason:r.trim()},{onSuccess:t})}return(0,Y.jsxs)(`form`,{onSubmit:s,"aria-label":`Reopen #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:o.onKeyDown,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Reopen #`,e.id,`: it is paused, and Resume continues the work. Its outcome and completion note are cleared and kept, with your reason, as a progress note.`]}),(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Reason to reopen #${e.id}`,placeholder:`Why is the task not finished after all?`,value:r,onChange:e=>i(e.target.value),required:!0,autoFocus:!0}),o.asking?(0,Y.jsx)(Fm,{label:`Discard reason to reopen #${e.id}`,question:`Discard your reason to reopen #${e.id}?`,onKeep:o.keep,onDiscard:o.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{changesData:!0,type:`submit`,size:`xs`,disabled:n.isPending||r.trim()===``,children:[(0,Y.jsx)(vr,{}),n.isPending?`Reopening...`:`Reopen`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:o.request,children:`Back`})]}),n.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function $m({task:e,onDone:t}){let n=U(),r=Object.keys(Zm).filter(t=>t!==e.resolution),[i,o]=(0,J.useState)(r[0]),[s,c]=(0,J.useState)(``),l=Pm(s.trim()!==``,t,n.isPending);function u(r){r.preventDefault(),n.mutate({id:e.id,resolution:i,note:s.trim()},{onSuccess:t})}return(0,Y.jsxs)(`form`,{onSubmit:u,"aria-label":`Outcome of #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:l.onKeyDown,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`#`,e.id,` is done as `,e.resolution===null?`done`:Zm[e.resolution].toLowerCase(),`. Correct how it ended; the earlier outcome and note are kept as a progress note. Tasks that depend on it wait while it is not adopted.`]}),(0,Y.jsx)(`select`,{"aria-label":`New outcome of #${e.id}`,className:a(ft,`w-40`),value:i,onChange:e=>o(e.target.value),children:r.map(e=>(0,Y.jsx)(`option`,{value:e,children:Zm[e]},e))}),(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Outcome note of #${e.id}`,placeholder:`What happened, e.g. the change was reverted. This becomes the completion note.`,value:s,onChange:e=>c(e.target.value),required:!0,autoFocus:!0}),l.asking?(0,Y.jsx)(Fm,{label:`Discard outcome of #${e.id}`,question:`Discard the new outcome of #${e.id}?`,onKeep:l.keep,onDiscard:l.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{changesData:!0,type:`submit`,size:`xs`,disabled:n.isPending||s.trim()===``,children:[(0,Y.jsx)(Pn,{}),n.isPending?`Saving...`:`Change outcome`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:l.request,children:`Back`})]}),n.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}function eh({task:e,tasks:t,context:n,onDone:r}){let i=ve(),o=t.filter(t=>t.id!==e.id&&t.status===`done`&&(t.resolution===`merged`||t.resolution===`completed`)).sort((e,t)=>t.id-e.id),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(``),d=s!==``&&l.trim()!==``,f=Pm(s!==``||l.trim()!==``,r,i.isPending);function p(t){t.preventDefault(),i.mutate({id:e.id,note:l.trim(),shippedWith:Number(s)},{onSuccess:r})}return(0,Y.jsxs)(`form`,{onSubmit:p,"aria-label":`Complete #${e.id} as shipped by`,className:`flex flex-col gap-1`,onKeyDown:f.onKeyDown,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Complete #`,e.id,` as shipped by another done task. It becomes done, and tasks that depend on it can start.`]}),(0,Y.jsxs)(`select`,{"aria-label":`Task that shipped #${e.id}`,className:ft,value:s,onChange:e=>c(e.target.value),required:!0,autoFocus:!0,children:[(0,Y.jsx)(`option`,{value:``,children:`Choose a task...`}),o.map(t=>(0,Y.jsxs)(`option`,{value:t.id,children:[oo(t.id,e.workspaceId,n),` `,t.title]},t.id))]}),(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Shipped note of #${e.id}`,placeholder:`How the other task shipped this work. This becomes the completion note.`,value:l,onChange:e=>u(e.target.value),required:!0}),f.asking?(0,Y.jsx)(Fm,{label:`Discard completion of #${e.id}`,question:`Discard completing #${e.id} as shipped by another?`,onKeep:f.keep,onDiscard:f.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{changesData:!0,type:`submit`,size:`xs`,disabled:i.isPending||!d,children:[(0,Y.jsx)(Bn,{}),i.isPending?`Completing...`:`Complete as shipped`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:f.request,children:`Back`})]}),i.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i.error.message})]})}function th({task:e,adding:t,onAdded:n}){let r=y(),[i,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(``),l=e.completionNote??``,u=i||t;function d(){o(!1),n()}let f=Pm(s.trim()!==l.trim(),()=>{c(l),d()},r.isPending);function p(){c(l),o(!0)}function m(t){t.preventDefault(),r.mutate({id:e.id,note:s},{onSuccess:d})}return u?(0,Y.jsxs)(`form`,{onSubmit:m,"aria-label":`Completion note form of #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:f.onKeyDown,children:[(0,Y.jsx)(`textarea`,{className:a(ft,`h-auto min-h-16 py-1.5`),"aria-label":`Completion note for #${e.id}`,placeholder:`What did this achieve? Impact, decisions, follow-ups. Reviews include this note.`,value:s,onChange:e=>c(e.target.value),autoFocus:!0}),f.asking?(0,Y.jsx)(Fm,{label:`Discard note of #${e.id}`,question:`Discard your note for #${e.id}?`,onKeep:f.keep,onDiscard:f.discard}):(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{type:`submit`,size:`xs`,disabled:r.isPending||s.trim()===l||Ki(e)&&s.trim()===``,children:r.isPending?`Saving...`:`Save note`}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:f.request,children:`Discard`})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]}):e.completionNote===null?null:(0,Y.jsxs)(`div`,{className:`flex items-start gap-1 rounded-md bg-muted/60 px-2 py-1`,children:[(0,Y.jsx)(Or,{"aria-hidden":!0,className:`mt-0.5 size-3 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`p`,{"aria-label":`Completion note of #${e.id}`,className:`min-w-0 flex-1 whitespace-pre-line break-words-keep text-xs`,children:e.completionNote}),(0,Y.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":`Edit completion note of #${e.id}`,title:`Edit note`,onClick:p,children:(0,Y.jsx)(ur,{})})]})}function nh({task:e}){let t=e.issue;return t===null?null:(0,Y.jsx)(so,{label:`Issue`,children:(0,Y.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs`,children:[(0,Y.jsxs)(`span`,{"aria-label":`Issue of #${e.id}`,title:t.url,className:`shrink-0 font-medium tabular-nums`,children:[`#`,t.number]}),(0,Y.jsx)(`span`,{className:`min-w-0 break-all font-mono text-muted-foreground select-all`,children:t.url})]})})}function rh(e){let t=new Date(e*1e3),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}function ih(){let e=new Date;return e.setDate(e.getDate()+1),e.setHours(9,0,0,0),e.getTime()/1e3}function ah(e){return e.wait===null?null:`Waiting until ${ni(e.wait.until)}, then ${zr[e.wait.status].toLowerCase()}`}function oh({task:e,onDone:t}){let n=P(),[r,i]=(0,J.useState)(rh(e.wait?.until??ih())),[o,s]=(0,J.useState)(``),c=r===``?NaN:new Date(r).getTime()/1e3,l=Number.isFinite(c);function u(r){r.preventDefault(),l&&n.mutate({id:e.id,until:Math.floor(c),reason:o.trim()===``?null:o.trim()},{onSuccess:t})}return(0,Y.jsxs)(`form`,{onSubmit:u,"aria-label":`Wait #${e.id}`,className:`flex flex-col gap-1`,onKeyDown:e=>e.key===`Escape`&&!n.isPending&&t(),children:[(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.wait===null?e.status===`planned`?`#${e.id} waits until then and stays planned.`:`#${e.id} is paused until then, then returns to ${zr[e.status].toLowerCase()} on its own.`:`Move the end of the wait; #${e.id} then returns to ${zr[e.wait.status].toLowerCase()}.`}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1 max-md:gap-2`,children:[(0,Y.jsx)(`input`,{type:`datetime-local`,className:a(ft,`w-auto`),"aria-label":`Wait #${e.id} until`,value:r,onChange:e=>i(e.target.value),required:!0,autoFocus:!0}),(0,Y.jsx)(`input`,{className:a(ft,`min-w-0 flex-1 basis-48`),"aria-label":`Reason #${e.id} waits`,placeholder:`Why it waits (optional)`,value:o,onChange:e=>s(e.target.value)})]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsxs)(q,{changesData:!0,type:`submit`,size:`xs`,disabled:n.isPending||!l,children:[(0,Y.jsx)($t,{}),n.isPending?`Saving...`:e.wait===null?`Wait`:`Change wait`]}),(0,Y.jsx)(q,{type:`button`,size:`xs`,variant:`ghost`,onClick:t,children:`Back`})]}),n.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:n.error.message})]})}var sh=()=>Za(()=>import(`./task-details-Bdwlw6-2.js`),__vite__mapDeps([3,1,4,5,6,2,7])),ch=(0,J.lazy)(()=>sh().then(e=>({default:e.TaskTimeline}))),lh=(0,J.lazy)(()=>sh().then(e=>({default:e.RelatedTasks}))),uh=(0,J.lazy)(()=>sh().then(e=>({default:e.TaskNotes}))),dh=(0,J.lazy)(()=>sh().then(e=>({default:e.TaskPlan}))),fh=(0,J.lazy)(()=>sh().then(e=>({default:e.TaskCriteria}))),ph=[`planned`,`done`];function mh({task:e,tasks:t,context:n,showWorkspace:r,detailed:i=!1,navigation:o,onShowDetails:s}){let c=_(),l=pe(),d=m(),f=u(),p=rt(),h=qe(),g=Ae(),[v,y]=(0,J.useState)(!1),[b,x]=(0,J.useState)(void 0),[S,C]=(0,J.useState)(!1),[w,T]=(0,J.useState)(null),[E,D]=(0,J.useState)(!1),[O,k]=(0,J.useState)(!1),[A,j]=(0,J.useState)(!1),[M,N]=(0,J.useState)(null),P=e.status===`in_review`,F=e.status===`in_progress`||P,I=l.isPending,L=e.status===`done`,R=e.criteria.every(e=>e.state===`met`),z=e.criteria.filter(e=>e.state!==`met`).length,B=P||e.status===`in_progress`&&R,V=X(e),ee=e.status===`planned`&&qi(e,n.byId),H=e.status===`planned`?e.dependsOn.filter(e=>Ki(n.byId.get(e))):[],U=Gi.includes(e.status),te=Ji(e,n.byId),ne=Da(e,n.byId),re=h.isPending||g.isPending,ie=uo(),W=c.error??l.error??d.error??f.error??p.error??h.error??g.error,G=t.filter(n=>ta(t,n.id,e.id)),ae=[...new Set([e.workspaceId,...G.map(e=>e.workspaceId)])].map(e=>({workspaceId:e,tasks:G.filter(t=>t.workspaceId===e)})).filter(e=>e.tasks.length>0),oe=e.status===`planned`?{key:`start`,changesData:!0,label:c.isPending?`Starting...`:V?`Resume`:`Start`,ariaLabel:`${V?`Resume`:`Start`} #${e.id}`,icon:(0,Y.jsx)(fr,{}),title:ee?void 0:H.length>0?`A dependency was not adopted; remove it to start`:`Waits until all its dependencies are done`,disabled:!ee||c.isPending,onSelect:()=>c.mutate(e.id)}:null,se=B?{key:`complete`,changesData:!0,label:l.isPending?`Completing...`:`Complete`,ariaLabel:`Complete #${e.id}`,icon:(0,Y.jsx)(gn,{}),className:io,title:R?void 0:`${z} of ${e.criteria.length} criteria not met yet; check the manual ones under Criteria`,disabled:I||!R,onSelect:()=>l.mutate(e.id)}:null,ce=F||e.status===`planned`?{key:`conclude`,label:`Conclude`,ariaLabel:`Conclude #${e.id} without completing`,icon:(0,Y.jsx)(En,{}),title:`Finish without completing, e.g. research whose result is not adopted`,disabled:I,onSelect:()=>C(!0)}:null,le=[oe,se].find(e=>e!==null)??null,K=[oe,se,ce].filter(e=>e!==null&&e!==le),ue=[L?null:{key:`edit`,label:`Edit`,ariaLabel:`Edit #${e.id}`,icon:(0,Y.jsx)(ur,{}),onSelect:()=>{x(void 0),y(!0)}},F?{key:`pause`,changesData:!0,label:`Pause`,ariaLabel:`Pause #${e.id}`,icon:(0,Y.jsx)(cr,{}),title:`Pause: stop working on the task; it can be resumed`,disabled:d.isPending,onSelect:()=>d.mutate(e.id)}:null,L?null:{key:`wait`,label:e.wait===null?`Wait until...`:`Change wait`,ariaLabel:`${e.wait===null?`Wait`:`Change wait of`} #${e.id}`,icon:(0,Y.jsx)($t,{}),title:`Pause the task until a time; it then returns to its status on its own`,onSelect:()=>k(!0)},e.wait===null?null:{key:`end-wait`,changesData:!0,label:`End wait`,ariaLabel:`End wait of #${e.id}`,icon:(0,Y.jsx)(Zt,{}),title:`Return the task to its status now`,disabled:f.isPending,onSelect:()=>f.mutate(e.id)},L&&Ki(e)?{key:`shipped`,label:`Complete as shipped by...`,ariaLabel:`Complete #${e.id} as shipped by another task`,icon:(0,Y.jsx)(Bn,{}),title:`The work did ship, through another task: mark it done as shipped with that one`,onSelect:()=>T(`shipped`)}:null,L?{key:`outcome`,label:`Change outcome`,ariaLabel:`Change outcome of #${e.id}`,icon:(0,Y.jsx)(Pn,{}),title:`Correct how the task ended, e.g. merged work that was reverted; the change is kept as a note`,onSelect:()=>T(`outcome`)}:null,L?{key:`reopen`,label:`Reopen`,ariaLabel:`Reopen #${e.id}`,icon:(0,Y.jsx)(vr,{}),title:`Reopen a task completed or concluded by mistake; it is paused and can be resumed`,onSelect:()=>T(`reopen`)}:null,L&&e.completionNote===null&&!E?{key:`add-note`,label:`Add note`,ariaLabel:`Add completion note to #${e.id}`,icon:(0,Y.jsx)(Or,{}),onSelect:()=>D(!0)}:null,ph.includes(e.status)?{key:`delete`,label:`Delete`,ariaLabel:`Delete #${e.id}`,icon:(0,Y.jsx)(Pr,{}),title:`Delete`,destructive:!0,onSelect:()=>j(!0)}:null].filter(e=>e!==null),de=s?{key:`details`,label:`Details`,ariaLabel:`Show details of #${e.id}`,icon:(0,Y.jsx)(or,{}),onSelect:s}:null,fe=i?ue:[...de?[de]:[],...K,...ue],me=si(e.milestones).at(-1),he=e.criteria.filter(e=>e.state===`met`).length,ge=e.criteria.filter(e=>e.state===`failed`).length,_e=i?``:Mm(e.description);function ve(e,t){return(0,Y.jsxs)(q,{size:`xs`,variant:t,changesData:e.changesData,"aria-label":e.ariaLabel,title:e.title,disabled:e.disabled,onClick:e.onSelect,className:e.className,children:[e.icon,e.label]},e.key)}return(0,Y.jsxs)(`li`,{"data-task-row":i?void 0:e.id,className:a(`flex flex-col`,i?`gap-3 p-4`:`gap-1.5 px-4 py-3 max-md:gap-2`),children:[v?(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(hh,{task:e,byId:n.byId}),(0,Y.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Editing`})]}),(0,Y.jsx)(Ym,{task:e,focusPlan:b,onDone:()=>y(!1)})]}):(0,Y.jsxs)(`div`,{className:a(`flex min-w-0 flex-col`,i?`gap-1.5`:`gap-0.5`),children:[(0,Y.jsxs)(`div`,{className:a(`flex min-w-0 items-center gap-2`,i?`flex-wrap`:`max-md:flex-wrap max-md:gap-y-1`),children:[(0,Y.jsx)(hh,{task:e,byId:n.byId}),(0,Y.jsxs)(`span`,{className:`shrink-0 text-xs tabular-nums text-muted-foreground`,children:[`#`,e.id]}),r&&(0,Y.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-1.5 text-xs text-muted-foreground`,children:n.workspaceName(e.workspaceId)}),(0,Y.jsx)(mo,{type:e.taskType}),e.autopilot&&(0,Y.jsx)(`span`,{role:`note`,"aria-label":`#${e.id} is marked for autopilot`,title:`Marked for autopilot: an executor may take it up on its own once it is ready`,className:a(`shrink-0 rounded-md px-1.5 text-xs font-medium`,Vr.info),children:`Autopilot`}),!i&&(0,Y.jsx)(`button`,{type:`button`,className:`break-words-keep line-clamp-2 min-w-0 cursor-pointer rounded-sm text-left text-base font-semibold outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50 max-md:order-last max-md:min-h-11 max-md:basis-full md:flex-1 md:text-sm`,title:e.title,"data-task-title":!0,onClick:s,children:e.title}),ne&&(0,Y.jsx)(`span`,{role:`note`,"aria-label":`Blocker on #${e.id}: ${ne.body}`,title:ne.body,className:a(`shrink-0 rounded-md px-1.5 text-xs font-medium`,Vr.attention),children:`Blocker`})]}),i&&(0,Y.jsx)(`h3`,{className:`break-words-keep text-base font-semibold leading-snug`,children:e.title}),i&&e.description.trim()&&(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`whitespace-pre-line break-words-keep text-sm text-muted-foreground`,children:e.description}),children:(0,Y.jsx)(Qa,{source:e.description})}),_e&&(0,Y.jsx)(`p`,{className:`break-words-keep line-clamp-2 text-sm text-muted-foreground`,children:_e}),!i&&(0,Y.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground empty:hidden`,children:[H.length>0&&(0,Y.jsxs)(`span`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:Hr.attention,children:[H.map(t=>oo(t,e.workspaceId,n)).join(`, `),` not adopted`]}),te.length>0&&(0,Y.jsxs)(`span`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:Hr.neutral,children:[`Waiting on `,te.map(t=>oo(t,e.workspaceId,n)).join(`, `)]}),e.wait!==null&&(0,Y.jsx)(`span`,{role:`note`,"aria-label":`Wait of #${e.id}`,className:Hr.neutral,children:ah(e)}),e.dueDate!==null&&(0,Y.jsx)(co,{task:e}),(0,Y.jsx)(lo,{task:e,onEdit:e=>{x(e),y(!0)}}),!L&&e.criteria.length>0&&(0,Y.jsxs)(`span`,{children:[he,`/`,e.criteria.length,` criteria met`]}),!L&&ge>0&&(0,Y.jsxs)(`span`,{className:a(`font-medium`,Hr.danger),children:[ge,` failed`]}),me&&(0,Y.jsx)(ci,{at:me.at,prefix:`${me.label} `})]})]}),i&&!v&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(fh,{task:e,detailed:!0})}),M===null?i&&(e.dependsOn.length>0||U&&G.length>0)&&(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Dependencies of #${e.id}`,className:`flex flex-wrap items-center gap-1 text-xs text-muted-foreground max-md:gap-2`,children:[e.dependsOn.length>0&&(0,Y.jsx)(`span`,{children:`Depends on`}),e.dependsOn.map(t=>(0,Y.jsxs)(`span`,{className:a(`inline-flex h-6 items-center gap-0.5 rounded-md border px-1.5 tabular-nums max-md:h-auto max-md:pr-0`,n.byId.get(t)?.status===`done`&&`line-through decoration-muted-foreground/60`,H.includes(t)&&Ur.attention),title:H.includes(t)?`${n.byId.get(t)?.title} (not adopted)`:n.byId.get(t)?.title,children:[(0,Y.jsx)(`span`,{children:oo(t,e.workspaceId,n)}),U&&(0,Y.jsx)(`button`,{type:`button`,"aria-label":`Remove dependency #${t} from #${e.id}`,title:`Remove dependency`,className:`flex items-center justify-center self-stretch rounded-sm p-0.5 hover:bg-muted hover:text-foreground disabled:opacity-50 max-md:size-11`,disabled:re,onClick:()=>g.mutate({id:e.id,dependsOn:t}),children:(0,Y.jsx)(vt,{className:`size-3`})})]},t)),U&&G.length>0&&(0,Y.jsxs)(`select`,{"aria-label":`Add dependency to #${e.id}`,title:e.status===`in_progress`?`A prerequisite that is not done pauses this task`:void 0,className:a(`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,`max-w-48`),value:``,disabled:re||ie,onChange:t=>{if(t.target.value){let n=Number(t.target.value);h.mutate({id:e.id,dependsOn:n,confirmPause:!1},{onSuccess:e=>e===`confirm_pause`&&N(n)})}},children:[(0,Y.jsx)(`option`,{value:``,children:`Add dependency...`}),ae.map(e=>(0,Y.jsx)(`optgroup`,{label:n.workspaceName(e.workspaceId),children:e.tasks.map(e=>(0,Y.jsxs)(`option`,{value:e.id,children:[`#`,e.id,` `,e.title]},e.id))},e.workspaceId))]})]}):(0,Y.jsx)(po,{taskId:e.id,prerequisite:oo(M,e.workspaceId,n),pending:h.isPending,onConfirm:()=>h.mutate({id:e.id,dependsOn:M,confirmPause:!0},{onSettled:()=>N(null)}),onCancel:()=>N(null)}),i&&H.length>0&&(0,Y.jsxs)(`p`,{role:`note`,"aria-label":`Blocked prerequisites of #${e.id}`,className:a(`text-xs`,Hr.attention),children:[H.map(t=>oo(t,e.workspaceId,n)).join(`, `),` `,H.length===1?`was`:`were`,` not adopted. Remove the dependency or change the plan to start this task.`]}),i&&te.length>0&&(0,Y.jsxs)(`p`,{role:`note`,"aria-label":`Waiting prerequisites of #${e.id}`,className:a(`text-xs`,Hr.neutral),children:[`Waiting on `,te.map(t=>oo(t,e.workspaceId,n)).join(`, `)]}),i&&e.wait!==null&&(0,Y.jsx)(`p`,{role:`note`,"aria-label":`Wait of #${e.id}`,className:a(`text-xs`,Hr.neutral),children:ah(e)}),i&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(dh,{task:e})}),i&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(ch,{task:e,detailed:!0})}),i&&e.issue!==null&&(0,Y.jsx)(nh,{task:e}),i&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(lh,{task:e,tasks:t,context:n,navigation:o})}),i&&(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(uh,{task:e,detailed:!0})}),L&&!v&&(i||E)&&(0,Y.jsx)(th,{task:e,adding:E,onAdded:()=>D(!1)}),W&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:W.message}),S&&!v&&(0,Y.jsx)(Xm,{task:e,onDone:()=>C(!1),onShipped:()=>{C(!1),T(`shipped`)}}),w===`shipped`&&!v&&(0,Y.jsx)(eh,{task:e,tasks:t,context:n,onDone:()=>T(null)}),w===`outcome`&&!v&&(0,Y.jsx)($m,{task:e,onDone:()=>T(null)}),w===`reopen`&&!v&&(0,Y.jsx)(Qm,{task:e,onDone:()=>T(null)}),O&&!v&&(0,Y.jsx)(oh,{task:e,onDone:()=>k(!1)}),!v&&!S&&w===null&&!O&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 max-md:gap-2`,children:[le&&ve(le,i?`default`:`outline`),i&&K.map(e=>ve(e,`outline`)),(0,Y.jsx)(`div`,{role:A?`group`:void 0,"aria-label":A?`Delete #${e.id}?`:void 0,className:a(`ml-auto flex items-center gap-1 max-md:gap-2`,A&&`basis-full flex-wrap justify-end`),onKeyDown:A?mt(()=>j(!1),p.isPending):void 0,children:A?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 basis-48 text-xs`,children:[`Delete #`,e.id,`? It moves to Settings > Archive with its history, where it can be restored.`]}),(0,Y.jsxs)(q,{size:`xs`,variant:`destructive`,"aria-label":`Confirm delete #${e.id}`,disabled:p.isPending,onClick:()=>p.mutate(e.id,{onSettled:()=>j(!1)}),children:[(0,Y.jsx)(Pr,{}),p.isPending?`Deleting...`:`Confirm delete`]}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>j(!1),children:`Back`},`back`)]}):fe.length>0&&(0,Y.jsx)(Tm,{label:`More actions for #${e.id}`,actions:fe})})]})]})}function hh({task:e,byId:t}){return(0,Y.jsxs)(`span`,{className:a(`inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium`,ao(e,t)),children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-current opacity-80`}),eo(e,t)]})}function gh(e){return/^https?:\/\/\S+$/.test(e)?e:/^[\w.-]+\/[\w.-]+$/.test(e)?`https://github.com/${e}`:null}function _h({workspace:e}){let t=ne(),[n,r]=(0,J.useState)(!1),[i,o]=(0,J.useState)(e.name),[s,c]=(0,J.useState)(e.description??``),[l,u]=(0,J.useState)(e.repository??``),d=Pm(i!==e.name||s!==(e.description??``)||l!==(e.repository??``),()=>r(!1),t.isPending);function f(){t.reset(),o(e.name),c(e.description??``),u(e.repository??``),r(!0)}function p(n){n.preventDefault(),t.mutate({...e,name:i.trim(),description:s.trim()||null,repository:l.trim()||null},{onSuccess:()=>r(!1)})}if(!n){let t=e.repository===null?null:gh(e.repository);return(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-sm text-muted-foreground`,children:[(0,Y.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 max-md:flex-wrap`,children:[e.repository!==null&&(t===null?(0,Y.jsx)(`code`,{"aria-label":`Repository`,className:`truncate text-foreground`,children:e.repository}):(0,Y.jsx)(`a`,{"aria-label":`Repository`,href:t,target:`_blank`,rel:`noreferrer`,className:`truncate font-mono text-foreground underline underline-offset-2`,children:e.repository})),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,"aria-label":`Edit workspace`,onClick:f,children:`Edit`})]}),e.description!==null&&(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.description}),children:(0,Y.jsx)(`div`,{"aria-label":`Workspace description`,className:`text-sm`,children:(0,Y.jsx)(Qa,{source:e.description})})})]})}return(0,Y.jsxs)(`form`,{onSubmit:p,"aria-label":`Workspace details`,className:`flex flex-col gap-1.5`,onKeyDown:d.onKeyDown,children:[(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Name`,(0,Y.jsx)(`input`,{className:ft,value:i,onChange:e=>o(e.target.value),required:!0,autoFocus:!0})]}),(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Description (optional, Markdown)`,(0,Y.jsx)(`textarea`,{className:a(ft,`h-24 py-1.5 max-md:h-32`),value:s,onChange:e=>c(e.target.value)})]}),(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Repository (optional, e.g. owner/repo or a URL)`,(0,Y.jsx)(`input`,{className:a(ft,`font-mono`),value:l,onChange:e=>u(e.target.value)})]}),d.asking?(0,Y.jsx)(Fm,{label:`Discard workspace changes`,question:`Discard the changes to the workspace?`,onKeep:d.keep,onDiscard:d.discard}):(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(q,{type:`submit`,size:`sm`,variant:`outline`,disabled:t.isPending||i.trim()===``,children:`Save`}),(0,Y.jsx)(q,{type:`button`,size:`sm`,variant:`ghost`,onClick:d.request,children:`Discard`})]}),t.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:t.error.message})]})}var vh=4e3,yh=[`rule`,`memory`],bh={rule:`Rule`,memory:`Memory`},xh={rule:`Rules`,memory:`Memory`},Sh={rule:`Agents must follow it.`,memory:`A lesson or fact worth keeping for this workspace.`};function Ch({workspace:e}){let t=at(e.id),n=Te(),[r,i]=(0,J.useState)(null),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(!1),u=(0,J.useId)(),d=t.data??[],f=d.filter(e=>e.kind===`rule`),p=d.filter(e=>e.kind===`memory`),m=r??t.data?.length===0,h=[f.length>0&&`${f.length} ${f.length===1?`rule`:`rules`}`,p.length>0&&`${p.length} ${p.length===1?`memory`:`memories`}`].filter(Boolean).join(`, `);function g(){n.reset(),i(!0),s(!0)}function _(){s(!1),l(!0)}return(0,Y.jsxs)(`section`,{"aria-label":`Guidelines`,className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium text-muted-foreground`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":m,"aria-controls":u,className:`flex items-center gap-1.5 rounded-sm text-left outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>i(!m),children:[(0,Y.jsx)(vn,{"aria-hidden":!0,className:a(`size-4 shrink-0 transition-transform`,!m&&`-rotate-90`)}),`Guidelines `,h&&(0,Y.jsx)(`span`,{className:`font-normal tabular-nums`,children:h})]})}),!o&&(0,Y.jsxs)(q,{size:`xs`,variant:`outline`,"aria-label":`Add guideline`,title:`Add a rule or memory for agents`,autoFocus:c,onClick:g,children:[(0,Y.jsx)(pt,{}),`Add`]})]}),t.isError&&(0,Y.jsxs)(`div`,{role:`alert`,className:`flex flex-wrap items-center gap-2 text-xs text-destructive`,children:[(0,Y.jsxs)(`p`,{children:[`Failed to load guidelines: `,t.error.message]}),(0,Y.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>void t.refetch(),children:`Retry now`})]}),(0,Y.jsxs)(`div`,{id:u,hidden:!m,className:`flex flex-col gap-2`,children:[t.isPending&&(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading guidelines...`}),t.data?.length===0&&(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No rules or memory yet; agents read them before working on a task in this workspace.`}),(0,Y.jsx)(wh,{kind:`rule`,entries:f}),(0,Y.jsx)(wh,{kind:`memory`,entries:p}),o&&(0,Y.jsx)(Eh,{label:`Add guideline`,className:`rounded-xl border bg-card p-2.5`,pending:n.isPending,error:n.error,onSave:(t,r)=>n.mutate({workspaceId:e.id,kind:t,body:r},{onSuccess:_}),onClose:_})]})]})}function wh({kind:e,entries:t}){return t.length===0?null:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`h4`,{className:`text-xs font-medium text-muted-foreground`,children:xh[e]}),(0,Y.jsx)(`ul`,{"aria-label":xh[e],className:`flex flex-col divide-y rounded-xl border bg-card`,children:t.map((e,t)=>(0,Y.jsx)(Th,{guideline:e,position:t+1},e.id))})]})}function Th({guideline:e,position:t}){let n=S(),r=xe(),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),[c,l]=(0,J.useState)(null),u=`${e.kind} ${t}`,d=`${bh[e.kind]} ${t}`;function f(){a(!1),l(`edit`)}function p(){s(!1),l(`delete`)}return i?(0,Y.jsx)(`li`,{"aria-label":d,className:`px-2.5 py-2`,children:(0,Y.jsx)(Eh,{label:`Edit ${u}`,guideline:e,pending:n.isPending,error:n.error,onSave:(t,r)=>n.mutate({id:e.id,kind:t,body:r},{onSuccess:f}),onClose:f})}):(0,Y.jsxs)(`li`,{"aria-label":d,className:`group/guideline flex flex-col gap-1.5 px-2.5 py-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words-keep text-sm`,children:e.body}),children:(0,Y.jsx)(Qa,{source:e.body,className:`flex-1 text-foreground`})}),!o&&(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-focus-within/guideline:opacity-100 group-hover/guideline:opacity-100 max-md:gap-2 [@media(hover:none)]:opacity-100`,children:[(0,Y.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":`Edit ${u}`,title:`Edit`,autoFocus:c===`edit`,onClick:()=>{n.reset(),a(!0)},children:(0,Y.jsx)(ur,{})}),(0,Y.jsx)(q,{size:`icon-xs`,variant:`ghost`,"aria-label":`Delete ${u}`,title:`Delete`,className:`hover:text-destructive`,autoFocus:c===`delete`,onClick:()=>{r.reset(),s(!0)},children:(0,Y.jsx)(Pr,{})})]})]}),o&&(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`Delete ${u}?`,className:`flex flex-wrap items-center gap-1 text-xs max-md:gap-2`,onKeyDown:mt(p,r.isPending),children:[(0,Y.jsxs)(`span`,{className:`mr-1`,children:[`Delete this `,e.kind,`? It cannot be restored.`]}),(0,Y.jsxs)(q,{changesData:!0,size:`xs`,variant:`destructive`,"aria-label":`Confirm delete ${u}`,disabled:r.isPending,onClick:()=>r.mutate(e.id),children:[(0,Y.jsx)(Pr,{}),r.isPending?`Deleting...`:`Delete`]}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:p,children:`Back`})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}function Eh({label:e,guideline:t,className:n,pending:r,error:i,onSave:o,onClose:s}){let c=t?.kind??`rule`,l=t?.body??``,[u,d]=(0,J.useState)(c),[f,p]=(0,J.useState)(l),m=(0,J.useId)(),h=Pm(u!==c||f!==l,s,r);function g(e){e.preventDefault(),o(u,f.trim())}return(0,Y.jsxs)(`form`,{"aria-label":e,className:a(`flex flex-col gap-1.5`,n),onSubmit:g,onKeyDown:h.onKeyDown,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Y.jsx)(`select`,{"aria-label":`Kind`,"aria-describedby":m,className:_t,value:u,onChange:e=>d(e.target.value),children:yh.map(e=>(0,Y.jsx)(`option`,{value:e,children:bh[e]},e))}),(0,Y.jsx)(`span`,{id:m,className:`text-xs text-muted-foreground`,children:Sh[u]})]}),(0,Y.jsx)(`textarea`,{"aria-label":`Guideline`,placeholder:`Write it in Markdown`,className:a(ft,`h-24 py-1.5 max-md:h-32`),value:f,maxLength:vh,required:!0,autoFocus:!0,onChange:e=>p(e.target.value)}),h.asking?(0,Y.jsx)(Fm,{label:t?`Discard guideline changes`:`Discard new guideline`,question:t?`Discard the changes to the guideline?`:`Discard the new guideline?`,onKeep:h.keep,onDiscard:h.discard}):(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(q,{type:`submit`,size:`sm`,variant:`outline`,disabled:r||f.trim()===``,children:t?`Save`:`Add`}),(0,Y.jsx)(q,{type:`button`,size:`sm`,variant:`ghost`,onClick:h.request,children:t?`Discard`:`Cancel`})]}),i&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:i.message})]})}var Dh=`(max-width: 47.99rem)`;function Oh(){let[e,t]=(0,J.useState)(()=>typeof window.matchMedia==`function`&&window.matchMedia(Dh).matches);return(0,J.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(Dh),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function kh({label:e,expanded:t,onExpandedChange:n,onSubmit:r,children:i}){let o=(0,J.useRef)(null),s=(0,J.useRef)(!1),c=Oh(),l=t&&c;(0,J.useEffect)(()=>{if(!t)return;let e=e=>{e.target instanceof Node&&!o.current?.contains(e.target)&&n(!1)};return document.addEventListener(`click`,e),document.addEventListener(`focusin`,e),()=>{document.removeEventListener(`click`,e),document.removeEventListener(`focusin`,e)}},[t]);let u=()=>{s.current?s.current=!1:t||n(!0)};function d(){n(!1);let e=o.current?.querySelector(`input`);e&&e!==document.activeElement&&(s.current=!0,e.focus())}function f(e){e.key===`Escape`&&t&&!e.defaultPrevented&&(e.preventDefault(),n(!1))}return(0,Y.jsxs)(Y.Fragment,{children:[l&&(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-40 bg-black/40`}),(0,Y.jsx)(`div`,{role:l?`dialog`:void 0,"aria-modal":l||void 0,"aria-label":l?e:void 0,className:a(l&&`fixed inset-x-0 bottom-0 z-50 max-h-[90dvh] overflow-y-auto rounded-t-xl bg-card pb-[env(safe-area-inset-bottom)] shadow-xl`),children:(0,Y.jsxs)(`form`,{ref:o,"aria-label":e,"data-expanded":t||void 0,onSubmit:r,onFocus:u,onInput:u,onKeyDown:f,className:a(`flex flex-col gap-2 rounded-xl border bg-card p-3 shadow-xs`,l&&`border-0 shadow-none`),children:[t&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium`,children:e}),(0,Y.jsx)(q,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`Close ${e}`,title:`Close (Esc)`,onClick:d,children:(0,Y.jsx)(vt,{})})]}),i]})})]})}var Ah={taskType:`feat`,title:``,description:``,criteria:[],autopilot:!1,estimate:``,estimateUnit:`hours`,dueDate:``,labels:``};function jh({workspace:e,draft:t,onChange:n}){let r=Ue(),[i,o]=(0,J.useState)(!1),{taskType:s,title:c,description:l}=t,u=Rm(t),d=t.criteria.some(e=>qm(e)!==null),f=e=>n({...t,taskType:e}),p=e=>n({...t,title:e}),m=e=>n({...t,description:e});function h(i){i.preventDefault(),!(u===void 0||d)&&r.mutate({workspaceId:e.id,taskType:s,title:c,description:l,estimate:u,dueDate:t.dueDate||null,labels:Ui(t.labels),autopilot:t.autopilot,criteria:Km(t.criteria)},{onSuccess:()=>{n({...t,title:``,description:``,estimate:``,dueDate:``,labels:``,criteria:[],autopilot:!1}),o(!1)}})}return(0,Y.jsxs)(kh,{label:`New task`,expanded:i,onExpandedChange:o,onSubmit:h,children:[(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[i&&(0,Y.jsx)(`select`,{"aria-label":`Task type`,className:a(`h-8 w-full min-w-0 rounded-lg border border-input bg-background px-2.5 text-sm outline-none max-md:h-11 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`w-28 shrink-0 font-mono`),value:s,onChange:e=>f(e.target.value),children:$a.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))}),(0,Y.jsx)(`input`,{className:a(ft,`min-w-0`),placeholder:i?`Task title`:`New task`,"aria-label":`Task title`,value:c,onChange:e=>p(e.target.value),required:!0}),(0,Y.jsxs)(q,{type:`submit`,disabled:r.isPending||u===void 0||d,children:[(0,Y.jsx)(pt,{}),`Add task`]})]}),i&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Lm,{label:`Description`,placeholder:`Description (optional, Markdown)`,value:l,onChange:m,className:`flex-1`}),(0,Y.jsx)(Bm,{suffix:``,plan:t,onChange:e=>n({...t,...e})}),(0,Y.jsx)(zm,{suffix:``,checked:t.autopilot,onChange:e=>n({...t,autopilot:e})}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1 border-t pt-2`,children:[(0,Y.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs`,children:(0,Y.jsx)(`span`,{className:`font-medium text-muted-foreground`,children:`Completion criteria`})}),(0,Y.jsx)(Jm,{criteria:t.criteria,onChange:e=>n({...t,criteria:e})})]})]}),r.isError&&(0,Y.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:r.error.message})]})}var Mh={completed:`Completed`,opened_for_review:zr.in_review,started:`Started`,worked_on:`Worked on`,planned:`Planned`},Nh=Object.keys(Mh),Ph={week:`week`,month:`month`,quarter:`quarter`,year:`year`,custom:`period`},Fh={week:`Week review`,month:`Month review`,quarter:`Quarter review`,year:`Year review`,custom:`Review`};function Ih(e){let[t,n,r]=e.split(`-`).map(Number);return[t,n-1,r]}function Lh(e,t=0){let[n,r,i]=Ih(e);return new Date(n,r,i+t)}function Rh(e){return Qr(e.getTime()/1e3)}function zh(e){let t=(e.getDay()+6)%7;return Rh(new Date(e.getFullYear(),e.getMonth(),e.getDate()-t))}function Bh(e,t){return Rh(Lh(e,t))}function Vh(e){return{kind:`week`,from:e,to:Bh(e,6)}}var Hh={month:1,quarter:3,year:12};function Uh(e,t,n){let r=Hh[e];return{kind:e,from:Rh(new Date(t,n,1)),to:Rh(new Date(t,n+r,0))}}function Wh(e,t){let[n,r]=Ih(t);switch(e){case`week`:return Vh(zh(Lh(t)));case`month`:return Uh(e,n,r);case`quarter`:return Uh(e,n,r-r%3);case`year`:return Uh(e,n,0);case`custom`:return{kind:e,from:t,to:t}}}function Gh(e,t){switch(e.kind){case`week`:return Vh(Bh(e.from,7*t));case`month`:case`quarter`:case`year`:{let[n,r]=Ih(e.from);return Uh(e.kind,n,r+Hh[e.kind]*t)}case`custom`:{let n=Kh(e);return{kind:`custom`,from:Bh(e.from,n*t),to:Bh(e.to,n*t)}}}}function Kh(e){return Math.round((Lh(e.to,1).getTime()-Lh(e.from).getTime())/864e5)}function qh(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,year:`numeric`,month:`2-digit`,day:`2-digit`}).formatToParts(e*1e3),r=e=>n.find(t=>t.type===e)?.value??``;return`${r(`year`)}-${r(`month`)}-${r(`day`)}`}function Jh(e){let[t,n]=Ih(e.from);switch(e.kind){case`month`:return e.from.slice(0,7);case`quarter`:return`${t} Q${Math.floor(n/3)+1}`;case`year`:return String(t);case`week`:case`custom`:return`${e.from} to ${e.to}`}}function Yh(e){return Nh.flatMap(t=>{let n=e.filter(e=>e.outcome===t);return n.length===0?[]:[{outcome:t,entries:n}]})}function Xh(e){return e.split(`
|
|
12
|
+
`,1)[0]}function Zh(e,t){return`${e} ${e===1?t:`${t}s`}`}function Qh(e){return/\/pull\/(\d+)/.exec(e)?.[1]??null}function $h(e){return`#${e.number}, +${e.additions}/-${e.deletions} in ${Zh(e.changedFiles,`file`)}, ${Zh(e.reviewCount,`review`)}`}function eg(e){if(e.length===0)return null;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return{median:t.length%2==1?t[n]:(t[n-1]+t[n])/2,tasks:t.length}}function tg(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return[...t].map(([e,t])=>({key:e,count:t})).sort((e,t)=>t.count-e.count||e.key.localeCompare(t.key))}function ng(e,t){return e.flatMap(e=>{let[n,r]=t(e);return n===null||r===null?[]:[r-n]})}function rg(e){for(let t of e.refs)if(t.startsWith(`pr:`)&&/^https?:\/\//.test(t.slice(3)))return t.slice(3);return null}function ig(e,t,n,r){let i=new Map(n.map(e=>[e.id,e.name])),a=t.filter(e=>e.outcome===`completed`),o=mg(e),s=a.flatMap(({pullRequest:e})=>e?[e]:[]);return{outcomes:Yh(t).map(e=>({outcome:e.outcome,count:e.entries.length})),commits:t.reduce((e,t)=>e+t.commits.length,0),completedByType:tg(a.map(e=>e.task.taskType)).map(({key:e,count:t})=>({taskType:e,count:t})),completedByWorkspace:tg(a.map(e=>i.get(e.task.workspaceId)??`workspace ${e.task.workspaceId}`)).map(({key:e,count:t})=>({workspace:e,count:t})),leadTime:eg(ng(a,({task:e,at:t})=>[e.milestones.plannedAt,t])),cycleTime:eg(ng(a,({task:e,at:t})=>[e.milestones.startedAt,t])),activeTime:eg(a.flatMap(({task:e,at:t})=>{let n=ii(e.timeline,t);return n===null?[]:[n]})),reviewTime:eg(ng(a,({task:e,at:t})=>[e.milestones.reviewAt,t])),completedPerMonth:o.length<2?null:o.map(e=>({month:e,count:a.filter(t=>qh(t.at,r).startsWith(e)).length})),changes:s.length===0?null:s.reduce((e,t)=>({pullRequests:e.pullRequests+1,additions:e.additions+t.additions,deletions:e.deletions+t.deletions,changedFiles:e.changedFiles+t.changedFiles}),{pullRequests:0,additions:0,deletions:0,changedFiles:0}),notAdopted:a.filter(({task:e})=>e.resolution===`not_adopted`).length}}function ag(e,t,n){let r=Math.min(n,e),i=t.filter(e=>e.outcome===`completed`),a=i.flatMap(({task:e,at:t})=>{let n=Vi(e.estimate),r=ii(e.timeline,t);return n===null||r===null?[]:[{estimated:n,actual:r}]}),o=i.flatMap(({task:e})=>{let t=Ni(e,n);return t===`on_time`||t===`late`?[t]:[]}),s=t.flatMap(({task:e,outcome:t})=>{if(e.dueDate===null)return[];if(e.status===`done`)return t===`completed`&&Ni(e,n)===`late`?[{task:e,dueDate:e.dueDate,done:!0,secondsLate:Pi(e,n)}]:[];let i=Mi(e.dueDate);return r>=i?[{task:e,dueDate:e.dueDate,done:!1,secondsLate:r-i}]:[]}).sort((e,t)=>t.secondsLate-e.secondsLate||e.task.id-t.task.id);return t.some(({task:e})=>e.estimate!==null||e.dueDate!==null)?{time:a.length===0?null:{tasks:a.length,estimated:a.reduce((e,{estimated:t})=>e+t,0),actual:a.reduce((e,{actual:t})=>e+t,0)},dueDates:o.length===0?null:{tasks:o.length,onTime:o.filter(e=>e===`on_time`).length},late:s}:null}function og(e){return`${hg(e.estimated)} estimated, ${hg(e.actual)} active (${Zh(e.tasks,`task`)}, ${(e.actual/e.estimated).toFixed(2)}x)`}function sg(e){return`${e.onTime} of ${e.tasks} (${Math.round(e.onTime/e.tasks*100)}%)`}function cg({task:e,dueDate:t,done:n,secondsLate:r}){let i=e.milestones.completedAt;return`due ${t}, ${n&&i!==null?`done ${Qr(i)}`:`still open`}, ${hg(r)} ${n?`late`:`overdue`}`}var lg=3,ug=3;function dg(e){let t=e.filter(e=>e.outcome===`completed`),n=t.flatMap(({task:e,pullRequest:t})=>t?[{task:e,pullRequest:t}]:[]),r=t.filter(({task:e})=>e.taskType===`rnd`).map(({task:e,at:t})=>({task:e,at:t,adopted:e.resolution!==`not_adopted`})).sort((e,t)=>e.at-t.at||e.task.id-t.task.id),i=t.flatMap(({task:e,at:t})=>{let n=Vi(e.estimate),r=ii(e.timeline,t);return n===null||r===null||r<=n?[]:[{task:e,estimated:n,actual:r}]}).sort((e,t)=>t.actual-t.estimated-(e.actual-e.estimated)||e.task.id-t.task.id).slice(0,ug);if(n.length===0&&r.length===0&&i.length===0)return null;let a=({pullRequest:e})=>e.additions+e.deletions;return{pullRequests:n.length===0?null:n.reduce((e,{pullRequest:t})=>({pullRequests:e.pullRequests+1,additions:e.additions+t.additions,deletions:e.deletions+t.deletions,changedFiles:e.changedFiles+t.changedFiles,reviews:e.reviews+t.reviewCount,reviewed:e.reviewed+ +(t.reviewCount>0)}),{pullRequests:0,additions:0,deletions:0,changedFiles:0,reviews:0,reviewed:0}),largest:[...n].sort((e,t)=>a(t)-a(e)||e.task.id-t.task.id).slice(0,lg),research:r,overruns:i}}function fg(e){return`${Zh(e.reviews,`review`)} on ${e.reviewed} of ${Zh(e.pullRequests,`pull request`)}`}function pg(e){return`+${e.additions}/-${e.deletions} in ${Zh(e.changedFiles,`file`)} (${Zh(e.pullRequests,`pull request`)})`}function mg(e){let[t,n]=Ih(e.from),r=e.to.slice(0,7),i=[];for(let e=0;;e+=1){let a=Rh(new Date(t,n+e,1)).slice(0,7);if(i.push(a),a>=r)return i}}function hg(e){let t=e/3600;return t<1?`<1h`:Math.round(t)<24?`${Math.round(t)}h`:`${(t/24).toFixed(1)}d`}var gg=[`leadTime`,`cycleTime`,`activeTime`,`reviewTime`],_g={leadTime:`Median lead time (planned to completed)`,cycleTime:`Median cycle time (started to completed)`,activeTime:`Median active time (started to completed, without pauses)`,reviewTime:`Median review time (awaiting completion to merged)`},vg={workspaceId:null,label:null};function yg(e,t){return e.filter(({task:e})=>(t.workspaceId===null||e.workspaceId===t.workspaceId)&&(t.label===null||e.labels.includes(t.label)))}function bg(e){return[...new Set(e.flatMap(({task:e})=>e.labels))].sort()}var xg={quarter:1,year:4};function Sg(e){return e.reduce((e,t)=>e+(Vi(t.estimate)??0),0)}function Cg(e,t,n,r){let i=e.filter(e=>!Ki(e)),a=i.filter(e=>e.dueDate!==null).sort((e,t)=>e.dueDate.localeCompare(t.dueDate)||e.id-t.id),o=i.filter(e=>e.dueDate===null),s=new Map;for(let e of a){let n=Wh(t,e.dueDate).from;s.set(n,[...s.get(n)??[],e])}let c=Wh(t,r),l=a.length>0&&a[0].dueDate<c.from?Wh(t,a[0].dueDate):c,u=a.at(-1)?.dueDate,d=u!==void 0&&u>c.to?Wh(t,u):c,f=n===null?null:(Vi(n)??0)*xg[t],p=[];for(let e=l;e.from<=d.from;e=Gh(e,1)){let t=s.get(e.from)??[],n=Sg(t);p.push({period:e,label:Jh(e),tasks:t,estimated:n,done:Sg(t.filter(e=>e.status===`done`)),unestimated:t.filter(e=>e.estimate===null).length,capacity:f,overloaded:f!==null&&n>f})}return{periods:p,unscheduled:o,unscheduledEstimated:Sg(o)}}function wg(e,t){return Bi({unit:t,amount:e/(Vi({unit:t,amount:1})??1)})}var Tg=`toodo-plan-capacity`,Eg=[`hours`,`days`,`weeks`,`months`];function Dg(){try{let e=JSON.parse(localStorage.getItem(Tg)??`null`);if(typeof e!=`object`||!e)return null;let{unit:t,amount:n}=e;return Eg.includes(t)&&typeof n==`number`&&n>0&&n<=1e4?{unit:t,amount:n}:null}catch{return null}}function Og(e){e===null?localStorage.removeItem(Tg):localStorage.setItem(Tg,JSON.stringify(e))}var kg={quarter:`Quarter`,year:`Year`},Ag={hours:`hours`,days:`days`,weeks:`weeks`,months:`months`};function jg({tasks:e,onShowTask:t}){let[n,r]=(0,J.useState)(`quarter`),[i,o]=(0,J.useState)(Dg),[s,c]=(0,J.useState)(i===null?``:String(i.amount)),[l,u]=(0,J.useState)(i?.unit??`weeks`),d=Hi(s),f=(e,t)=>{c(e),u(t);let n=Hi(e);if(Number.isNaN(n))return;let r=n===null?null:{unit:t,amount:n};Og(r),o(r)},p=i?.unit??l,{periods:m,unscheduled:h,unscheduledEstimated:g}=Cg(e,n,i,Qr(Date.now()/1e3)),_=m.filter(e=>e.overloaded).length;return(0,Y.jsxs)(`div`,{role:`region`,"aria-label":`Plan`,className:`flex flex-col gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Plan period`,className:`flex gap-1 max-md:gap-2`,children:[`quarter`,`year`].map(e=>(0,Y.jsx)(q,{size:`xs`,variant:n===e?`secondary`:`ghost`,"aria-pressed":n===e,onClick:()=>r(e),children:kg[e]},e))}),(0,Y.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground max-md:text-sm`,children:[`Capacity per quarter`,(0,Y.jsx)(`input`,{type:`text`,inputMode:`decimal`,"aria-label":`Capacity per quarter`,"aria-invalid":Number.isNaN(d)||void 0,"aria-describedby":`capacity-hint`,placeholder:`None`,className:a(_t,`w-16`),value:s,onChange:e=>f(e.target.value,l)})]}),(0,Y.jsx)(`select`,{"aria-label":`Capacity unit`,className:_t,value:l,onChange:e=>f(s,e.target.value),children:Object.keys(Ag).map(e=>(0,Y.jsx)(`option`,{value:e,children:Ag[e]},e))})]}),(0,Y.jsx)(`p`,{id:`capacity-hint`,className:a(`text-xs`,Number.isNaN(d)?`text-destructive`:`text-muted-foreground`),children:Number.isNaN(d)?`Enter a capacity greater than 0 and at most 10000, such as 12, or clear the field for no capacity.`:i===null?`Set a capacity per quarter to see which periods are overloaded. A year holds four quarters.`:_>0?`${_} ${_===1?`period is`:`periods are`} over capacity: move due dates or cut estimates.`:`Every period fits its capacity.`}),(0,Y.jsx)(`ol`,{"aria-label":`Periods`,className:`flex flex-col gap-3`,children:m.map(e=>(0,Y.jsx)(Mg,{load:e,unit:p,onShowTask:t},e.period.from))}),h.length>0&&(0,Y.jsxs)(`section`,{"aria-label":`No due date`,className:`flex flex-col gap-2 rounded-xl border border-dashed p-3`,children:[(0,Y.jsxs)(`h3`,{className:`flex items-baseline gap-2 text-sm font-medium`,children:[`No due date`,(0,Y.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground tabular-nums`,children:[h.length,` `,h.length===1?`task`:`tasks`,`, `,wg(g,p),` `,`estimated`]})]}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Set a due date on these tasks to count them in a period.`}),(0,Y.jsx)(Ng,{tasks:h,onShowTask:t})]})]})}function Mg({load:e,unit:t,onShowTask:n}){let{capacity:r,estimated:i,overloaded:o}=e,s=r===null||r===0?null:i/r;return(0,Y.jsxs)(`li`,{"aria-label":e.label,"data-overloaded":o||void 0,className:a(`flex flex-col gap-2 rounded-xl border bg-card p-3 shadow-xs`,o&&`border-destructive/60 bg-destructive/5`),children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,Y.jsx)(`h3`,{className:`text-sm font-medium`,children:e.label}),(0,Y.jsxs)(`span`,{className:`text-sm tabular-nums`,children:[wg(i,t),r!==null&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` of `,wg(r,t)]}),s!==null&&(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[` (`,Math.round(s*100),`%)`]})]}),o&&r!==null&&(0,Y.jsxs)(`span`,{className:`text-xs font-medium text-destructive`,children:[`Over capacity by `,wg(i-r,t)]}),(0,Y.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[e.tasks.length,` `,e.tasks.length===1?`task`:`tasks`,e.done>0&&`, ${wg(e.done,t)} done`]})]}),s!==null&&(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,Y.jsx)(`div`,{className:a(`h-full rounded-full`,o?`bg-destructive`:`bg-primary`),style:{width:`${Math.min(s,1)*100}%`}})}),e.unestimated>0&&(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.unestimated,` `,e.unestimated===1?`task has`:`tasks have`,` no estimate and `,e.unestimated===1?`is`:`are`,` not counted: estimate `,e.unestimated===1?`it`:`them`,` to complete the sum.`]}),e.tasks.length>0&&(0,Y.jsx)(Ng,{tasks:e.tasks,onShowTask:n})]})}function Ng({tasks:e,onShowTask:t}){return(0,Y.jsx)(`ul`,{className:`flex flex-col text-sm`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`flex items-baseline gap-2 py-0.5`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:a(`min-w-0 truncate rounded-sm text-left outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,e.status===`done`&&`text-muted-foreground line-through`),onClick:()=>t(e.id),children:[(0,Y.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[`#`,e.id]}),` `,e.title]}),(0,Y.jsxs)(`span`,{className:`ml-auto shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.estimate===null?`No estimate`:Bi(e.estimate),e.dueDate!==null&&` · due ${e.dueDate}`]})]},e.id))})}var Pg=(0,J.lazy)(()=>Za(()=>import(`./task-graph-DERVr57J.js`).then(e=>({default:e.TaskGraph})),__vite__mapDeps([8,1,4,5,6,7,9]))),Fg=(0,J.lazy)(()=>Za(()=>import(`./task-details-Bdwlw6-2.js`).then(e=>({default:e.TaskDetailsSheet})),__vite__mapDeps([3,1,4,5,6,2,7])));function Ig(e,t){let n=e=>`${e} ${e===1?`task`:`tasks`}`;return e===t?`Showing ${n(t)}.`:`Showing ${e} of ${n(t)}.`}function Lg({workspace:e,timelineScale:t,onTimelineScaleChange:n,draft:r=Ah,onDraftChange:i,shownTask:s=null,onTaskShown:c,view:l=`list`,onViewChange:u,selectedTask:d,onSelectTask:f}){let p=o(),[m,h]=(0,J.useState)(null),[g,_]=(0,J.useState)(null),v=Ge([s?.id,d,Wa(g?.query??``)]),[y,b]=(0,J.useState)(!1),[x,S]=(0,J.useState)(null),C=new Map(p.data?.map(e=>[e.id,e])),w={byId:new Map(v.data?.map(e=>[e.id,e])),workspaceName:e=>C.get(e)?.name??`Workspace ${e}`},T=e===null?v.data:v.data?.filter(t=>t.workspaceId===e.id),E=e===null&&l===`timeline`,D=e===null&&l===`plan`,O=E||D,k=g??(E?Va:Ba),A=[...new Set(v.data?.map(e=>e.workspaceId))].sort((e,t)=>w.workspaceName(e).localeCompare(w.workspaceName(t))),j=m!==null&&A.includes(m)?m:null,M=[O&&j!==null,k.query.trim()!==``,k.statuses.length>0,k.type!==null].filter(Boolean).length,N=Wa(k.query),P=N===null?void 0:w.byId.get(N),F=P!==void 0&&Ga(P,{...k,query:``},w.byId)?P:void 0,I=T?.filter(e=>e!==F&&(!O||j===null||e.workspaceId===j)&&Ga(e,k,w.byId)),L=F===void 0?I??[]:[F,...I??[]],R=O?k.statuses.length===0||k.statuses.some(e=>e===`done`||e===`not_adopted`):x??Ha(k),z=s===null?void 0:w.byId.get(s.id);(0,J.useEffect)(()=>{z!==void 0&&(h(e=>e===z.workspaceId?e:null),_(e=>Ga(z,e??Va,w.byId)?e:Ba))},[s,z===void 0]),(0,J.useEffect)(()=>{if(E)return;let e=e=>{let t=e.key===`j`?1:e.key===`k`?-1:0;if(t===0||!Ci(e)||document.querySelector(`form[data-dirty]`))return;let n=[...document.querySelectorAll(`[data-task-row] [data-task-title]`)],r=e=>e.closest(`[data-task-row]`),i=n.findIndex(e=>r(e).contains(document.activeElement));i===-1&&(i=n.findIndex(e=>r(e).dataset.taskRow===String(d)));let a=n[i===-1?t>0?0:n.length-1:i+t];a!==void 0&&(e.preventDefault(),a.focus(),a.scrollIntoView?.({block:`nearest`}),d!==null&&f(Number(r(a).dataset.taskRow)))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)});let B=j===null?[]:(T??[]).filter(e=>e!==F&&e.workspaceId!==j&&L.some(t=>t.dependsOn.includes(e.id)));return(0,Y.jsxs)(`section`,{"aria-labelledby":`tasks-heading`,className:`flex flex-1 flex-col gap-4 max-md:gap-3`,children:[(0,Y.jsxs)(`header`,{className:`flex flex-col max-md:gap-2`,children:[(0,Y.jsx)(`h2`,{id:`tasks-heading`,className:`text-xl font-semibold tracking-tight`,children:e?.name??`All workspaces`}),e?(0,Y.jsx)(_h,{workspace:e},e.id):(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground max-md:hidden`,children:`Tasks of every workspace and the dependencies between them.`})]}),e&&(0,Y.jsx)(Ch,{workspace:e},e.id),e&&i&&(0,Y.jsx)(jh,{workspace:e,draft:r,onChange:i}),(0,Y.jsx)(`p`,{role:`status`,className:a(`text-sm text-muted-foreground`,!v.isPending&&`sr-only`),children:v.isPending?`Loading tasks...`:T&&I?Ig(I.length+ +!!F,T.length):``}),v.isError&&(0,Y.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load tasks: `,v.error.message]}),T?.length===0&&(0,Y.jsx)(Bg,{title:e?`No tasks in this workspace yet.`:`No tasks yet.`,hint:e?`Plan the first task above; tasks can depend on each other across workspaces.`:`Pick a workspace in the sidebar to plan its tasks.`}),v.data&&T&&I&&T.length>0&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e===null&&(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Task view`,className:`flex gap-1 max-md:gap-2`,children:[`timeline`,`list`,`plan`].map(e=>(0,Y.jsx)(q,{size:`xs`,variant:l===e?`default`:`ghost`,"aria-pressed":l===e,onClick:()=>u?.(e),children:e===`list`?`List`:e===`plan`?`Plan`:`Timeline`},e))}),(0,Y.jsxs)(q,{size:`xs`,variant:y?`secondary`:`outline`,className:`ml-auto md:hidden`,"aria-expanded":y,"aria-controls":`task-filters`,onClick:()=>b(!y),children:[(0,Y.jsx)(Er,{}),`Filters`,M>0&&(0,Y.jsxs)(`span`,{className:`rounded-full bg-primary px-1.5 text-[0.625rem] leading-4 text-primary-foreground tabular-nums`,children:[M,(0,Y.jsx)(`span`,{className:`sr-only`,children:` active`})]})]}),(0,Y.jsxs)(`div`,{id:`task-filters`,className:a(`contents`,!y&&`max-md:hidden`),children:[O&&(0,Y.jsxs)(`select`,{"aria-label":D?`Plan workspace`:`Timeline workspace`,className:`h-6 rounded-md border border-input bg-background px-1.5 text-xs outline-none max-md:h-11 max-md:px-2.5 max-md:text-sm focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50`,value:j??`all`,onChange:e=>h(e.target.value===`all`?null:Number(e.target.value)),children:[(0,Y.jsx)(`option`,{value:`all`,children:`All workspaces`}),A.map(e=>(0,Y.jsx)(`option`,{value:e,children:w.workspaceName(e)},e))]}),(0,Y.jsx)(Rg,{filter:k,onChange:_})]})]}),I.length===0&&F===void 0?(0,Y.jsx)(Bg,{icon:(0,Y.jsx)(br,{}),title:`No tasks match the search and filters.`,hint:`Change the search text, status, or type, or clear the filters.`}):E?(0,Y.jsx)(Oi,{label:`the timeline`,children:(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Loading timeline...`}),children:(0,Y.jsx)(Pg,{tasks:[...L,...B],allTasks:v.data,dimmed:new Set(B.map(e=>e.id)),workspaceLabel:e=>j===null||e.workspaceId!==j?w.workspaceName(e.workspaceId):null,statusLabel:e=>eo(e,w.byId),statusStyle:e=>ao(e,w.byId),ready:e=>Fa(e,w.byId)===`ready`,scale:t,onScaleChange:n,selectedTaskId:d,onSelectedTaskChange:f,shownTaskId:s?.id??null,onTaskShown:()=>c?.(),renderDetail:(e,t)=>(0,Y.jsx)(mh,{task:e,tasks:v.data??[],context:w,showWorkspace:!0,detailed:!0,navigation:t},e.id)})})}):(0,Y.jsxs)(Y.Fragment,{children:[D?(0,Y.jsx)(jg,{tasks:L,onShowTask:f}):(0,Y.jsxs)(`div`,{role:`region`,"aria-label":`Tasks`,className:`flex flex-col gap-4`,children:[F&&(0,Y.jsxs)(`section`,{"aria-label":`Task number match`,className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`h3`,{className:`text-sm font-medium text-muted-foreground`,children:[`Task `,(0,Y.jsxs)(`span`,{className:`tabular-nums font-normal`,children:[`#`,F.id]})]}),(0,Y.jsx)(`ul`,{"aria-label":`Task number match`,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:(0,Y.jsx)(mh,{task:F,tasks:v.data,context:w,showWorkspace:e===null||F.workspaceId!==e.id,onShowDetails:()=>f(F.id)})})]}),za(I,w.byId,Aa(I,Date.now()/1e3,w.byId).map(e=>e.task.id)).map(({group:t,tasks:n})=>{let r=t===`done`&&!(x??Ha(k)),i=La[t],o=(0,Y.jsx)(`span`,{className:`tabular-nums font-normal`,children:n.length});return(0,Y.jsxs)(`section`,{"aria-label":i,className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`h3`,{className:`flex items-center gap-1.5 text-sm font-medium text-muted-foreground`,children:t===`done`?(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":!r,className:`flex items-center gap-1.5 rounded-sm outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,onClick:()=>S(r),children:[(0,Y.jsx)(vn,{"aria-hidden":!0,className:a(`size-4 transition-transform`,r&&`-rotate-90`)}),i,` `,o]}):(0,Y.jsxs)(Y.Fragment,{children:[i,` `,o]})}),t===`done`&&e&&(0,Y.jsx)(zg,{workspace:e})]}),!r&&(0,Y.jsx)(`ul`,{"aria-label":i,className:`flex flex-col divide-y rounded-xl border bg-card shadow-xs`,children:n.map(t=>(0,Y.jsx)(mh,{task:t,tasks:v.data,context:w,showWorkspace:e===null,onShowDetails:()=>f(t.id)},t.id))})]},t)})]}),d!==null&&w.byId.has(d)&&(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading details...`}),children:(0,Y.jsx)(Fg,{onClose:()=>f(null),children:(0,Y.jsx)(mh,{task:w.byId.get(d),tasks:v.data,context:w,showWorkspace:!0,detailed:!0,navigation:{open:f,canOpen:e=>w.byId.has(e)}},d)})})]}),v.hasNextPage&&R&&(0,Y.jsx)(q,{size:`xs`,variant:`outline`,className:`self-start`,disabled:v.isFetchingNextPage,onClick:()=>void v.fetchNextPage(),children:v.isFetchingNextPage?`Loading older finished tasks...`:`Load older finished tasks`})]})]})}function Rg({filter:e,onChange:t}){return(0,Y.jsxs)(`div`,{role:`search`,"aria-label":`Task filters`,className:`flex flex-1 flex-wrap items-center justify-end gap-2 max-md:grid max-md:basis-full max-md:grid-cols-2`,children:[(0,Y.jsx)(`input`,{type:`search`,"aria-label":`Search tasks`,placeholder:`Search title, description, or #number`,className:a(_t,`w-56 max-md:col-span-2 max-md:w-full`),value:e.query,onChange:n=>t({...e,query:n.target.value})}),(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Status filter`,className:`flex flex-wrap gap-1 max-md:col-span-2 max-md:gap-2`,children:Pa.map(n=>{let r=e.statuses.includes(n),i=to[n];return(0,Y.jsxs)(`button`,{type:`button`,className:a(`inline-flex h-6 shrink-0 items-center gap-1 rounded-full border px-2 text-xs font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,r?a(ro(n),`border-transparent hover:brightness-95 dark:hover:brightness-125`):a(Ur[i],`bg-transparent hover:bg-muted`)),"aria-pressed":r,onClick:()=>t({...e,statuses:Ua(e.statuses,n)}),children:[r?(0,Y.jsx)(gn,{"aria-hidden":!0,className:`size-3`}):(0,Y.jsx)(`span`,{"aria-hidden":!0,className:a(`size-1.5 rounded-full`,Kr[i])}),zr[n]]},n)})}),(0,Y.jsxs)(`select`,{"aria-label":`Type filter`,className:_t,value:e.type??`all`,onChange:n=>t({...e,type:n.target.value===`all`?null:n.target.value}),children:[(0,Y.jsx)(`option`,{value:`all`,children:`All types`}),$a.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))]}),(0,Y.jsxs)(`button`,{type:`button`,className:a(`inline-flex h-6 shrink-0 items-center gap-1 rounded-full border px-2 text-xs font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11`,e.autopilot?a(Vr.info,`border-transparent hover:brightness-95 dark:hover:brightness-125`):a(Ur.info,`bg-transparent hover:bg-muted`)),"aria-pressed":e.autopilot,title:`Only tasks marked for autopilot`,onClick:()=>t({...e,autopilot:!e.autopilot}),children:[e.autopilot?(0,Y.jsx)(gn,{"aria-hidden":!0,className:`size-3`}):(0,Y.jsx)(cn,{"aria-hidden":!0,className:`size-3`}),`Autopilot`]}),Ha(e)&&(0,Y.jsxs)(q,{size:`xs`,variant:`ghost`,onClick:()=>t(Ba),children:[(0,Y.jsx)(vt,{}),`Clear filters`]})]})}function zg({workspace:e}){let t=Ce(),[n,r]=(0,J.useState)(null),i=n!==null,[o,s]=(0,J.useState)(!1),c=le(e.id,i),l=n!==null&&c.isSuccess&&c.dataUpdatedAt>=n?c.data:void 0,u=l===void 0?`done tasks`:`${l} done ${l===1?`task`:`tasks`}`;function d(){r(null),s(!0)}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{role:i?`group`:void 0,"aria-label":i?`Delete ${u}?`:void 0,className:a(`ml-auto flex items-center gap-1 max-md:gap-2`,i&&`basis-full flex-wrap justify-end`),onKeyDown:i?mt(d,t.isPending):void 0,children:i?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 basis-48 text-xs`,children:l===void 0?`Counting done tasks...`:l===1?`Delete ${u}? It moves to Settings > Archive with its history, where it can be restored.`:`Delete ${u}? They move to Settings > Archive with their history, where they can be restored.`}),(0,Y.jsxs)(q,{changesData:!0,size:`xs`,variant:`destructive`,disabled:t.isPending||l===void 0||c.isFetching,onClick:()=>t.mutate(e.id,{onSuccess:d}),children:[(0,Y.jsx)(Pr,{}),t.isPending?`Deleting...`:`Confirm delete`]}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:d,children:`Back`})]}):(0,Y.jsxs)(q,{size:`xs`,variant:`ghost`,title:`Move every done task of this workspace to the archive`,autoFocus:o,className:`text-destructive hover:bg-destructive/10 hover:text-destructive dark:hover:bg-destructive/20`,onClick:()=>{t.reset(),r(Date.now())},children:[(0,Y.jsx)(Pr,{}),`Delete done`]})}),t.isError?(0,Y.jsx)(`p`,{role:`alert`,className:`basis-full text-xs text-destructive`,children:t.error.message}):i&&c.isError&&(0,Y.jsxs)(`p`,{role:`alert`,className:`basis-full text-xs text-destructive`,children:[`Could not count the done tasks: `,c.error.message,` Choose Back, then Delete done to count them again.`]})]})}function Bg({title:e,hint:t,icon:n,action:r}){return(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-1 rounded-xl border border-dashed px-6 py-10 text-center`,children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`mb-1 text-muted-foreground [&_svg]:size-6`,children:n??(0,Y.jsx)(Hn,{})}),(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:e}),t&&(0,Y.jsx)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:t}),r&&(0,Y.jsx)(`div`,{className:`mt-2`,children:r})]})}function Vg(e){let t={type:`http`,url:e.url,headers:{Authorization:`Bearer ${e.token??``}`}};return JSON.stringify({mcpServers:{toodo:t}},null,2)}async function Hg(e){let t={Authorization:`Bearer ${e.token??``}`,"Content-Type":`application/json`,Accept:`application/json, text/event-stream`},n=await Ot(`/mcp`,{method:`POST`,headers:t,body:JSON.stringify({jsonrpc:`2.0`,id:1,method:`initialize`,params:{protocolVersion:`2025-06-18`,capabilities:{},clientInfo:{name:`toodo-web`,version:`1`}}})}),r=await n.text();if(!n.ok)return{ok:!1,message:r.trim()||`The MCP server answered ${n.status} ${n.statusText}.`};let i=n.headers.get(`mcp-session-id`);i&&Ot(`/mcp`,{method:`DELETE`,headers:{...t,"mcp-session-id":i}}).catch(()=>{});let a;try{a=JSON.parse(r)?.result?.serverInfo?.title}catch{a=void 0}return typeof a!=`string`||!a.includes(e.instance)?{ok:!1,message:`The answer came from another server (${String(a??`no server title`)}), not instance ${e.instance}.`}:{ok:!0,message:`Connected: instance ${e.instance} accepts this token.`}}var Ug={no_header:`no Authorization header`,not_bearer:`the header was not Bearer <token>`,wrong_token:`a token this server does not accept (old, mistyped, or another server's)`,web_token:`the web sign-in token instead of the MCP token`};function Wg(e){return e.split(/(?<=\/)(?!\/)/).map((e,t)=>(0,Y.jsxs)(`span`,{children:[t>0&&(0,Y.jsx)(`wbr`,{}),e]},t))}function Gg(){let e=z(),[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);async function o(e,t){try{await navigator.clipboard.writeText(e),n(`Copied ${t}.`)}catch(e){n(`Could not copy: ${String(e)}`)}}async function s(e){i(`testing`);try{i(await Hg(e))}catch(e){i({ok:!1,message:`Could not reach the MCP server: ${String(e)}`})}}let c=e.data,l=c?.lastRejection;return(0,Y.jsxs)(`section`,{"aria-label":`Agent access`,className:`flex flex-col gap-2 text-sm`,children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Agents on the server can plan tasks and connect dependencies through the Toodo server's MCP endpoint.`}),c&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`code`,{className:`overflow-x-auto break-normal rounded bg-muted px-1.5 py-1 [overflow-wrap:normal]`,"aria-label":`MCP server URL`,children:Wg(c.url)}),c.error?(0,Y.jsxs)(`p`,{role:`alert`,className:`text-destructive`,children:[`MCP server is not running: `,c.error]}):c.token&&(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(q,{size:`xs`,onClick:()=>void o(Vg(c),`the MCP config`),children:`Copy MCP config`}),(0,Y.jsx)(q,{size:`xs`,variant:`outline`,onClick:()=>void o(c.token??``,`the MCP token for agents`),children:`Copy MCP token for agents`}),(0,Y.jsx)(q,{size:`xs`,variant:`outline`,disabled:r===`testing`,onClick:()=>void s(c),children:`Test connection`})]}),r&&r!==`testing`&&(0,Y.jsx)(`p`,{role:`status`,"aria-label":`Connection test`,className:a(`break-words`,!r.ok&&`text-destructive`),children:r.message}),(0,Y.jsxs)(`p`,{className:`text-muted-foreground`,children:[`The MCP token is for agents only; the web app signs in with the server's web token (`,(0,Y.jsx)(`code`,{children:`web-token`}),`). Server instance `,(0,Y.jsx)(`code`,{"aria-label":`Server instance`,children:c.instance}),`, which agents see in`,` `,(0,Y.jsx)(`code`,{children:`401`}),` replies and `,(0,Y.jsx)(`code`,{children:`serverInfo`}),`.`]}),l&&(0,Y.jsxs)(`p`,{"aria-label":`Last rejected agent request`,className:`break-words text-destructive`,children:[`Last rejected agent request`,` `,(0,Y.jsx)(`time`,{dateTime:new Date(l.at*1e3).toISOString(),title:ni(l.at),children:ti(l.at)}),`: `,Ug[l.reason],l.count>1&&` (${l.count} since the server started)`,`.`]})]}),t&&(0,Y.jsx)(`p`,{role:`status`,children:t})]})}function Kg(){let e=Be(),t=M(),n=O(),r=A(),i=f(),[a,o]=(0,J.useState)(null),s=t.isPending||n.isPending||r.isPending||i.isPending,c=t.error??n.error??r.error??i.error??e.error,l=()=>{for(let e of[t,n,r,i])e.reset()};function u(e){let t={onSuccess:()=>o(null)};e.kind===`workspace`?r.mutate(e.id,t):i.mutate(e.id,t)}let d=e.data?.workspaces??[],p=e.data?.tasks??[];return(0,Y.jsxs)(`section`,{"aria-label":`Archive`,className:`flex flex-col gap-3 text-xs`,children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Deleted workspaces and tasks are kept here with their history and still count in reviews. Restore one to bring it back, or delete it permanently.`}),a&&(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm permanent delete`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,children:[(0,Y.jsxs)(`p`,{className:`break-words`,children:[`Permanently delete `,(0,Y.jsx)(`span`,{className:`font-medium`,children:a.name}),a.kind===`workspace`?` and its tasks`:``,`? Its history, commits, and links are removed and leave the reviews; this cannot be undone.`]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`destructive`,onClick:()=>u(a),disabled:s,children:r.isPending||i.isPending?`Deleting...`:`Delete permanently`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>o(null),disabled:s,children:`Cancel`})]})]}),c&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:c.message}),(0,Y.jsx)(qg,{label:`Archived workspaces`,empty:`No archived workspaces.`,children:d.map(e=>(0,Y.jsx)(Jg,{name:e.name,detail:e.repository??``,busy:s,onRestore:()=>{l(),t.mutate(e.id)},onPurge:()=>{l(),o({kind:`workspace`,id:e.id,name:e.name})}},e.id))}),(0,Y.jsx)(qg,{label:`Archived tasks`,empty:`No archived tasks.`,children:p.map(e=>(0,Y.jsx)(Jg,{name:`#${e.id} ${e.title}`,detail:e.status.replace(`_`,` `),busy:s,onRestore:()=>{l(),n.mutate(e.id)},onPurge:()=>{l(),o({kind:`task`,id:e.id,name:`#${e.id} ${e.title}`})}},e.id))})]})}function qg({label:e,empty:t,children:n}){return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`h4`,{className:`font-medium`,children:e}),(0,Y.jsxs)(`ul`,{"aria-label":e,className:`flex flex-col divide-y`,children:[n.length===0&&(0,Y.jsx)(`li`,{className:`text-muted-foreground`,children:t}),n]})]})}function Jg({name:e,detail:t,busy:n,onRestore:r,onPurge:i}){return(0,Y.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 first:pt-0`,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,Y.jsx)(`span`,{className:`truncate text-muted-foreground`,children:t})]}),(0,Y.jsxs)(`span`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`outline`,"aria-label":`Restore ${e}`,disabled:n,onClick:r,children:`Restore`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,className:`hover:text-destructive`,"aria-label":`Delete ${e} permanently`,disabled:n,onClick:i,children:`Delete permanently`})]})]})}var Yg=[`connected-apps`];function Xg(e){return e.split(` `).includes(`toodo.write`)?`Read and write access`:`Read access`}function Zg({url:e}){let[t,n]=(0,J.useState)(null);async function r(e){try{await navigator.clipboard.writeText(e),n(`Copied the MCP URL.`)}catch(e){n(`Could not copy (${String(e)}). Select the URL and copy it by hand.`)}}return e===null?(0,Y.jsxs)(`p`,{className:`text-muted-foreground`,children:[`To connect ChatGPT or Claude, restart the server with `,(0,Y.jsx)(`code`,{children:`TOODO_PUBLIC_URL`}),` set to the`,` `,(0,Y.jsx)(`code`,{children:`https://`}),` origin they reach it at; see `,(0,Y.jsx)(`code`,{children:`docs/server.md`}),`.`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Add this URL to ChatGPT or Claude as a remote MCP connector with OAuth, leaving client ID and secret empty, then approve the app with `,(0,Y.jsx)(`code`,{children:`web-token`}),`.`]}),(0,Y.jsx)(`code`,{className:`overflow-x-auto break-normal rounded bg-muted px-1.5 py-1 [overflow-wrap:normal]`,"aria-label":`Public MCP URL`,children:e}),(0,Y.jsx)(q,{size:`xs`,className:`self-start`,onClick:()=>void r(e),children:`Copy MCP URL`}),t&&(0,Y.jsx)(`p`,{role:`status`,children:t})]})}function Qg({app:e}){let t=Fe(),[n,r]=(0,J.useState)(!1),i=re({mutationFn:()=>Le(be.revokeConnectedApp(e.grantId)),onSuccess:()=>t.invalidateQueries({queryKey:Yg})}),a=e.clientName??e.clientId;return(0,Y.jsxs)(`li`,{"aria-label":`App ${a}`,className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`truncate font-medium`,children:a}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Xg(e.scopes)}),(0,Y.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,Y.jsx)(ci,{at:e.createdAt,prefix:`Connected `}),` · `,e.lastUsedAt===null?`Not used yet`:(0,Y.jsx)(ci,{at:e.lastUsedAt,prefix:`Last used `})]}),n?(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm revoke of ${a}`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,onKeyDown:mt(()=>r(!1),i.isPending),children:[(0,Y.jsx)(`p`,{children:`The app's tokens stop working at once; to use it later, connect it again from the app.`}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`destructive`,disabled:i.isPending,onClick:()=>i.mutate(),children:`Revoke`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>r(!1),children:`Keep`})]})]}):(0,Y.jsx)(q,{size:`xs`,variant:`outline`,className:`self-start`,"aria-label":`Revoke ${a}`,onClick:()=>r(!0),children:`Revoke`}),i.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:i.error.message})]})}function $g(){let e=ae({queryKey:Yg,queryFn:()=>Le(be.listConnectedApps())});return(0,Y.jsxs)(`section`,{"aria-label":`Connected apps`,className:`flex flex-col gap-2 text-sm`,children:[e.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:e.error.message}),e.data&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Zg,{url:e.data.publicMcpUrl}),e.data.apps.length===0?(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`No apps connected yet.`}):(0,Y.jsx)(`ul`,{"aria-label":`Apps with access`,className:`flex flex-col gap-2`,children:e.data.apps.map(e=>(0,Y.jsx)(Qg,{app:e},e.grantId))})]})]})}var e_={scope:`full`,expiresInDays:90},t_=[{label:`90 days`,days:90},{label:`30 days`,days:30},{label:`1 year`,days:365},{label:`Never expires`,days:null}];function n_(e,t){return JSON.stringify({label:e,scope:t.scope,expiresInDays:t.expiresInDays})}var r_=class extends Error{constructor(){super(`The server did not accept this token.`)}};async function i_(e){if(e.status===401)throw new r_;if(!e.ok)throw Error(await xt(e));return e}async function a_(e,t,n=e_){return(await(await i_(await bt.fetch(`/api/devices`,{headers:Tt(e)}))).json()).some(e=>e.current)?e:(await(await i_(await bt.fetch(`/api/devices`,{method:`POST`,headers:{...Tt(e),"Content-Type":`application/json`},body:n_(t,n)}))).json()).token}async function o_(){return await(await kt(`/api/devices`)).json()}async function s_(e,t=e_){return(await(await kt(`/api/devices`,{method:`POST`,headers:{"Content-Type":`application/json`},body:n_(e,t)})).json()).token}async function c_(e){return await(await kt(`/api/devices/${e}/revoke`,{method:`POST`})).json()}function l_(e){let t=[[`Edg/`,`Edge`],[`Firefox/`,`Firefox`],[`Chrome/`,`Chrome`],[`Safari/`,`Safari`]].find(([t])=>e.includes(t))?.[1]??`Browser`,n=[[`Android`,`Android`],[`iPhone`,`iOS`],[`iPad`,`iPadOS`],[`Windows`,`Windows`],[`Mac OS`,`macOS`],[`Linux`,`Linux`]].find(([t])=>e.includes(t))?.[1];return n?`${t} on ${n}`:t}var u_=[`devices`];function d_({devices:e}){let t=Fe(),n=re({mutationFn:()=>s_(l_(navigator.userAgent)),onSuccess:e=>(St(e),t.invalidateQueries({queryKey:u_}))}),r=e.find(e=>e.current);return(0,Y.jsxs)(`div`,{role:`group`,"aria-label":`This browser`,className:`flex flex-col gap-1 rounded-md bg-muted px-2 py-1.5`,children:[(0,Y.jsxs)(`p`,{children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`This browser: `}),(0,Y.jsx)(`span`,{className:`font-medium break-words`,children:r?r.label:`shared token`})]}),!r&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Register it to give it a token of its own that you can revoke alone.`}),(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`outline`,className:`self-start`,disabled:n.isPending,onClick:()=>n.mutate(),children:n.isPending?`Registering...`:`Register this browser`})]}),n.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:n.error.message})]})}function f_({device:e}){let t=Fe(),[n,r]=(0,J.useState)(!1),i=re({mutationFn:()=>c_(e.id),onSuccess:()=>t.invalidateQueries({queryKey:u_})}),a=e.revokedAt!==null;return(0,Y.jsxs)(`li`,{"aria-label":`Device ${e.label}`,"data-revoked":a,className:`flex flex-col gap-0.5`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:a?`truncate text-muted-foreground line-through`:`truncate font-medium`,children:e.label}),e.current&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`(this device)`}),e.scope===`read`&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`read-only`})]}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e.revokedAt===null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ci,{at:e.lastSeenAt,prefix:`Last seen `}),` · `,e.expiresAt===null?`never expires`:(0,Y.jsx)(ci,{at:e.expiresAt,prefix:e.expiresAt*1e3<=Date.now()?`expired `:`expires `})]}):(0,Y.jsx)(ci,{at:e.revokedAt,prefix:`Revoked `})}),!a&&(n?(0,Y.jsxs)(`div`,{role:`alertdialog`,"aria-label":`Confirm revoke of ${e.label}`,className:`flex flex-col gap-1 rounded-md border border-destructive/40 p-2`,onKeyDown:mt(()=>r(!1),i.isPending),children:[(0,Y.jsx)(`p`,{children:e.current?`This browser signs out and needs the shared token to sign in again.`:`The device's token stops working for good.`}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`destructive`,disabled:i.isPending,onClick:()=>i.mutate(),children:`Revoke`}),(0,Y.jsx)(q,{size:`xs`,variant:`ghost`,autoFocus:!0,onClick:()=>r(!1),children:`Keep`})]})]}):(0,Y.jsx)(q,{size:`xs`,variant:`outline`,className:`self-start`,"aria-label":`Revoke ${e.label}`,onClick:()=>r(!0),children:`Revoke`})),i.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:i.error.message})]})}function p_(){let e=ae({queryKey:u_,queryFn:o_});if(!e.data)return null;let t=Date.now()/1e3,n=e.data.filter(e=>e.revokedAt===null&&(e.expiresAt===null||e.expiresAt>t));return(0,Y.jsxs)(Y.Fragment,{children:[n.length,` signed in`]})}function m_(){let e=ae({queryKey:u_,queryFn:o_});return(0,Y.jsxs)(`section`,{"aria-label":`Devices`,className:`flex flex-col gap-2 text-sm`,children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Each browser signs in with the shared token once and then keeps its own token until it expires. Revoke a lost device here.`}),e.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:e.error.message}),e.data&&(0,Y.jsx)(d_,{devices:e.data}),e.data&&(0,Y.jsx)(`ul`,{"aria-label":`Signed-in devices`,className:`flex flex-col gap-2`,children:e.data.map(e=>(0,Y.jsx)(f_,{device:e},e.id))})]})}var h_=[`push`],g_=[{key:`completion`,label:`Task awaiting completion`}],__={"needs-install":`Add Toodo to the Home Screen to get notifications (iOS 16.4 or later).`,unsupported:`This browser cannot get notifications from Toodo.`};function v_({subscription:e,permission:t}){return e?`on`:t===`denied`?`blocked`:`off`}function y_({failure:e}){return(0,Y.jsxs)(`div`,{role:`note`,"aria-label":`Last delivery failure`,className:`flex flex-col gap-0.5 rounded-md border border-destructive/40 p-2`,children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`The last notification did not reach this device`}),(0,Y.jsxs)(`p`,{className:`break-words text-muted-foreground`,children:[(0,Y.jsx)(`time`,{dateTime:new Date(e.at*1e3).toISOString(),title:ni(e.at),children:ti(e.at)}),`: `,e.message]}),(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Send a test notification to check again. If it keeps failing, disable and enable notifications to subscribe this device anew.`})]})}function b_({state:e}){let t=Fe(),n=e=>t.setQueryData(h_,t=>t&&{...t,subscription:e}),r=()=>t.invalidateQueries({queryKey:h_}),i=re({mutationFn:t=>et(t,e.publicKey),onSuccess:n,onError:r}),a=re({mutationFn:_e,onSuccess:()=>n(null),onError:r}),o=re({mutationFn:ce,onSuccess:n}),s=re({mutationFn:He,onSettled:r}),c=[i,a,o,s].reduce((e,t)=>t.submittedAt>e.submittedAt?t:e),l=()=>i.mutate(Notification.requestPermission()),{subscription:u}=e,d=(o.isPending?o.variables:void 0)??u?.settings;return(0,Y.jsxs)(Y.Fragment,{children:[u&&d?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Notifications are on for this device.`}),u.lastFailure&&(0,Y.jsx)(y_,{failure:u.lastFailure}),(0,Y.jsxs)(`fieldset`,{className:`flex flex-col gap-1`,children:[(0,Y.jsx)(`legend`,{className:`mb-1 text-muted-foreground`,children:`Notify about`}),g_.map(({key:e,label:t})=>(0,Y.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:d[e],disabled:o.isPending,onChange:t=>o.mutate({...d,[e]:t.target.checked})}),t]},e))]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`outline`,disabled:s.isPending,onClick:()=>s.mutate(),children:`Send test notification`}),(0,Y.jsx)(q,{changesData:!0,size:`xs`,variant:`ghost`,"aria-label":`Disable notifications on this device`,disabled:a.isPending,onClick:()=>a.mutate(),children:`Disable notifications`})]})]}):e.permission===`denied`?(0,Y.jsx)(`p`,{children:`Notifications are blocked for Toodo in the browser settings. Allow them there to turn them on.`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`Notifications are off for this device.`}),(0,Y.jsx)(q,{size:`xs`,className:`self-start`,"aria-label":`Enable notifications on this device`,disabled:i.isPending,onClick:l,children:`Enable notifications`})]}),c===s&&s.isSuccess&&(0,Y.jsx)(`p`,{role:`status`,className:`text-muted-foreground`,children:`Test notification sent.`}),c.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:c.error.message})]})}function x_(){let[e]=(0,J.useState)(De);return{support:e,state:ae({queryKey:h_,queryFn:ze,enabled:e===`supported`})}}function S_(){let{state:e}=x_();return e.data?(0,Y.jsx)(Y.Fragment,{children:v_(e.data)}):null}function C_(){let{support:e,state:t}=x_();return(0,Y.jsxs)(`section`,{"aria-label":`Notifications`,className:`flex flex-col gap-2 text-sm`,children:[(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:e===`supported`?`Alerts reach this device even while Toodo is closed.`:__[e]}),t.isLoading&&(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Checking this device...`}),t.error&&(0,Y.jsx)(`p`,{role:`alert`,className:`break-words text-destructive`,children:t.error.message}),t.data&&(0,Y.jsx)(b_,{state:t.data})]})}var w_=[`light`,`dark`,`system`],T_=`toodo-theme`,E_=`(prefers-color-scheme: dark)`,D_=new Set,O_={light:`#ffffff`,dark:`#0a0a0a`};function k_(e){return w_.includes(e)}function A_(){let e=localStorage.getItem(T_);return k_(e)?e:`system`}function j_(){let e=A_(),t=e===`dark`||e===`system`&&window.matchMedia(E_).matches;document.documentElement.classList.toggle(`dark`,t),document.documentElement.style.colorScheme=t?`dark`:`light`;for(let e of document.querySelectorAll(`meta[name="theme-color"]`))e.setAttribute(`content`,t?O_.dark:O_.light)}function M_(e){localStorage.setItem(T_,e),j_(),D_.forEach(e=>e())}function N_(){j_(),window.matchMedia(E_).addEventListener(`change`,j_)}function P_(e){return D_.add(e),()=>D_.delete(e)}function F_(){return(0,J.useSyncExternalStore)(P_,A_)}var I_=[{value:`light`,label:`Light theme`,Icon:Mr},{value:`dark`,label:`Dark theme`,Icon:ir},{value:`system`,label:`System theme`,Icon:nr}];function L_(){let e=F_();return(0,Y.jsx)(`div`,{role:`group`,"aria-label":`Theme`,className:`flex gap-0.5 rounded-lg border p-0.5`,children:I_.map(({value:t,label:n,Icon:r})=>(0,Y.jsx)(q,{variant:e===t?`default`:`ghost`,size:`icon-sm`,"aria-label":n,"aria-pressed":e===t,title:n,onClick:()=>M_(t),children:(0,Y.jsx)(r,{})},t))})}var R_=[{id:`general`,label:`General`,icon:(0,Y.jsx)(Er,{})},{id:`agents`,label:`Agent access`,icon:(0,Y.jsx)(cn,{})},{id:`apps`,label:`Connected apps`,icon:(0,Y.jsx)(mr,{})},{id:`devices`,label:`Devices`,icon:(0,Y.jsx)(er,{}),status:(0,Y.jsx)(p_,{})},{id:`notifications`,label:`Notifications`,icon:(0,Y.jsx)(on,{}),status:(0,Y.jsx)(S_,{})},{id:`backups`,label:`Backups`,icon:(0,Y.jsx)(On,{}),status:(0,Y.jsx)(pi,{})},{id:`archive`,label:`Archive`,icon:(0,Y.jsx)(tn,{})}];function z_(){let e=ae({queryKey:[`app-info`],queryFn:()=>be.appInfo()}),t=ae({queryKey:[`update-check`],queryFn:()=>be.checkUpdate(),staleTime:216e5});return(0,Y.jsxs)(`section`,{"aria-label":`General`,className:`flex flex-col gap-5 text-sm`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Theme`}),(0,Y.jsx)(L_,{})]}),(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:`Version`}),(0,Y.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:e.data?`v${e.data.version}`:`Connecting to backend...`}),t.data?.newer&&(0,Y.jsxs)(`p`,{role:`status`,className:`w-full text-muted-foreground`,children:[`v`,t.data.latest,` is available on the `,t.data.channel,` channel. Update the server with`,` `,(0,Y.jsx)(`code`,{children:`toodo update`}),`.`]}),t.data?.error&&(0,Y.jsxs)(`p`,{className:`w-full text-muted-foreground`,children:[`Update check: `,t.data.error]})]})]})}var B_=e=>`settings-tab-${e}`,V_=e=>`settings-panel-${e}`;function H_({open:e,section:t,onShow:n,onClose:r,returnFocus:i}){let o=(0,J.useRef)(null),s=(0,J.useRef)(null),c=t??`general`,l=(0,J.useRef)(r);l.current=r;let u=(0,J.useRef)(i);u.current=i;let d=Oh();(0,J.useLayoutEffect)(()=>{if(e)return d&&t!==null?s.current?.focus({preventScroll:!0}):document.getElementById(B_(c))?.focus({preventScroll:!0}),()=>{let e=document.activeElement;if(e!==null&&e!==document.body&&!o.current?.contains(e))return;let t=u.current();t?.isConnected&&t.focus({preventScroll:!0})}},[e]),(0,J.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),l.current()),e.key===`Tab`&>(o.current,e)};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e]);let f=e=>{n(e),d&&requestAnimationFrame(()=>s.current?.focus({preventScroll:!0}))},p=()=>{n(null),requestAnimationFrame(()=>document.getElementById(B_(c))?.focus({preventScroll:!0}))},m=e=>{let t=R_.findIndex(e=>e.id===c),r=e.key===`ArrowDown`?(t+1)%R_.length:e.key===`ArrowUp`?(t-1+R_.length)%R_.length:e.key===`Home`?0:e.key===`End`?R_.length-1:null;if(r===null)return;e.preventDefault();let i=R_[r].id;n(i),document.getElementById(B_(i))?.focus()},h=R_.find(e=>e.id===c)??R_[0];return(0,Y.jsxs)(`div`,{hidden:!e,className:`fixed inset-0 z-50`,children:[(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-0 bg-black/40 max-md:hidden`,onClick:()=>r()}),(0,Y.jsxs)(`div`,{ref:o,role:`dialog`,"aria-modal":!0,"aria-labelledby":`settings-title`,className:a(`relative flex overflow-hidden bg-background text-foreground`,`max-md:h-full max-md:flex-col max-md:pt-[env(safe-area-inset-top)] max-md:pb-[env(safe-area-inset-bottom)]`,`md:absolute md:top-1/2 md:left-1/2 md:h-[min(40rem,calc(100dvh-4rem))] md:w-[min(52rem,calc(100vw-4rem))] md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-2xl md:border md:shadow-xl`),children:[(0,Y.jsxs)(`div`,{className:a(`flex min-h-0 flex-col gap-2 overflow-y-auto bg-sidebar p-3 text-sidebar-foreground md:w-56 md:shrink-0 md:border-r`,`max-md:flex-1`,t!==null&&`max-md:hidden`),children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-1`,children:[(0,Y.jsx)(`h2`,{id:`settings-title`,className:`text-lg font-semibold tracking-tight md:text-base`,children:`Settings`}),(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`ml-auto md:hidden`,"aria-label":`Close settings`,onClick:()=>r(),children:(0,Y.jsx)(vt,{})})]}),(0,Y.jsx)(`div`,{role:`tablist`,"aria-orientation":`vertical`,"aria-label":`Settings sections`,className:`flex flex-col gap-0.5`,onKeyDown:m,children:R_.map(e=>{let t=e.id===c;return(0,Y.jsxs)(`button`,{id:B_(e.id),type:`button`,role:`tab`,"aria-selected":t,"aria-controls":V_(e.id),tabIndex:t?0:-1,onClick:()=>f(e.id),className:a(`flex items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 max-md:min-h-11 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground`,t&&`md:bg-secondary md:font-medium`),children:[e.icon,(0,Y.jsx)(`span`,{children:e.label}),e.status&&(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.status}),(0,Y.jsx)(bn,{"aria-hidden":!0,className:a(`md:hidden`,!e.status&&`ml-auto`)})]},e.id)})})]}),(0,Y.jsxs)(`div`,{className:a(`flex min-h-0 min-w-0 flex-1 flex-col`,t===null&&`max-md:hidden`),children:[(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 border-b px-2 py-2 md:px-6 md:py-3`,children:[(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`md:hidden`,"aria-label":`Back to settings`,onClick:p,children:(0,Y.jsx)(Sn,{})}),(0,Y.jsx)(`h3`,{ref:s,tabIndex:-1,className:`text-base font-semibold outline-none`,children:h.label}),(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`ml-auto`,"aria-label":`Close settings`,title:`Close settings (Esc)`,onClick:()=>r(),children:(0,Y.jsx)(vt,{})})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-4 md:px-6`,children:R_.map(e=>(0,Y.jsx)(`div`,{id:V_(e.id),role:`tabpanel`,"aria-labelledby":B_(e.id),hidden:e.id!==c,children:(0,Y.jsx)(Oi,{label:`the ${e.label} settings`,children:e.id===`general`?(0,Y.jsx)(z_,{}):e.id===`agents`?(0,Y.jsx)(Gg,{}):e.id===`apps`?(0,Y.jsx)($g,{}):e.id===`devices`?(0,Y.jsx)(m_,{}):e.id===`notifications`?(0,Y.jsx)(C_,{}):e.id===`backups`?(0,Y.jsx)(gi,{}):(0,Y.jsx)(Kg,{})})},e.id))})]})]})]})}function U_(e){return e!==null&&/^\d+$/.test(e)?Number(e):null}function W_(e){let t=new URLSearchParams(e),n=t.get(`view`);if(n===`review`)return{page:`review`};let r=U_(t.get(`task`)),i=U_(t.get(`workspace`));return i===null?{page:`all`,view:n===`list`||n===`plan`?n:`timeline`,task:r}:{page:`workspace`,workspace:i,task:r}}function G_(e){let t=new URLSearchParams;e.page===`review`?t.set(`view`,`review`):e.page===`workspace`?t.set(`workspace`,String(e.workspace)):e.view!==`timeline`&&t.set(`view`,e.view),e.page!==`review`&&e.task!==null&&t.set(`task`,String(e.task));let n=t.toString();return n===``?``:`?${n}`}function K_(e){let[t,n]=(0,J.useState)(()=>W_(location.search)),r=(0,J.useRef)(e);return r.current=e,(0,J.useEffect)(()=>{r.current(W_(location.search));let e=()=>{let e=W_(location.search);n(e),r.current(e)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),[t,e=>{let t=G_(e);t!==location.search&&history.pushState(null,``,`${location.pathname}${t}${location.hash}`),n(e)}]}var q_=(0,J.lazy)(()=>Za(()=>import(`./review-BJQCyyBb.js`).then(e=>({default:e.Review})),__vite__mapDeps([10,1,4,5,6,2])));function J_(){let e=document.querySelector(`input[aria-label='Search tasks']`);return e!==null&&(typeof e.checkVisibility!=`function`||e.checkVisibility())?e:null}function Y_(){let e=o();ee();let[t,n]=(0,J.useState)(null),[r,i]=K_(e=>{e.page===`all`&&e.view===`timeline`&&e.task!==null&&n({id:e.task})}),s=r.page===`review`,c=r.page===`workspace`?r.workspace:`all`,l=e=>{i(e),d(!1)},[u,d]=(0,J.useState)(!1),f=(0,J.useRef)(null),p=(0,J.useRef)(null),m=(0,J.useRef)(!1),h=(0,J.useRef)(null),[g,_]=(0,J.useState)(!1),[v,y]=(0,J.useState)(null),b=(0,J.useRef)(null),x=(0,J.useRef)(!1),S=e=>{g||(x.current=u),y(e),_(!0),d(!1)};(0,J.useEffect)(()=>{if(u?p.current?.focus():m.current&&!g&&f.current?.focus(),m.current=u,!u)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&d(!1),e.key===`Tab`&>(h.current,e)},t=()=>{window.innerWidth>=768&&d(!1)};return document.addEventListener(`keydown`,e),window.addEventListener(`resize`,t),()=>{document.removeEventListener(`keydown`,e),window.removeEventListener(`resize`,t)}},[u]);let[C,w]=(0,J.useState)(`week`),[T,E]=(0,J.useState)(new Map),D=(e,t)=>E(n=>new Map(n).set(e,t)),O=e=>{l({page:`all`,view:`timeline`,task:e}),n({id:e})};(0,J.useEffect)(()=>Ye(O),[]);let[k,A]=(0,J.useState)(!1),j=(0,J.useRef)(null),M=c===`all`&&!s,N=e.data?.find(e=>e.id===c)??e.data?.[0],P=Ge(),[F,I]=(0,J.useState)(!1),[L,R]=(0,J.useState)(!1);(0,J.useEffect)(()=>{let e=e=>{if(xi(e)){if(g)return;e.preventDefault(),d(!1),R(!1),I(e=>!e)}else e.key===`?`&&Ci(e)?(e.preventDefault(),R(!0)):e.key===`/`&&Ci(e)&&J_()!==null&&(e.preventDefault(),J_()?.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[g]);let z=e=>{r.page===`all`&&r.view===`timeline`?O(e.id):r.page===`all`?l({...r,task:e.id}):l({page:`workspace`,workspace:e.workspaceId,task:e.id})};return(0,Y.jsxs)(`div`,{className:`flex h-dvh bg-background text-foreground print:block print:h-auto`,children:[u&&(0,Y.jsx)(`div`,{"aria-hidden":!0,className:`fixed inset-0 z-30 bg-black/40 md:hidden`,onClick:()=>d(!1)}),(0,Y.jsxs)(`aside`,{ref:h,inert:g,role:u?`dialog`:void 0,"aria-modal":u||void 0,"aria-label":u?`Menu`:void 0,className:a(`flex min-h-0 w-64 shrink-0 flex-col gap-4 overflow-y-auto border-r bg-sidebar p-3 text-sidebar-foreground print:hidden`,`max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-40 max-md:shadow-lg`,!u&&`max-md:hidden`),children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`h1`,{className:`flex items-center gap-2 px-1 text-lg font-semibold tracking-tight`,children:[(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground`,children:(0,Y.jsx)(Jn,{className:`size-4`})}),`Toodo`]}),(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:`ml-auto md:hidden`,"aria-label":`Close menu`,ref:p,onClick:()=>d(!1),children:(0,Y.jsx)(vt,{})})]}),(0,Y.jsx)(Oi,{label:`the tasks that need attention`,children:(0,Y.jsx)(Na,{onShow:O})}),(0,Y.jsxs)(`nav`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsxs)(q,{variant:s?`secondary`:`ghost`,className:`justify-start`,"aria-pressed":s,onClick:()=>l({page:`review`}),children:[(0,Y.jsx)(fn,{}),`Review`]}),(0,Y.jsxs)(q,{variant:M?`secondary`:`ghost`,className:`justify-start`,"aria-pressed":M,disabled:!e.data?.length,onClick:()=>l({page:`all`,view:`timeline`,task:null}),children:[(0,Y.jsx)(Kn,{}),`All workspaces`]})]}),(0,Y.jsx)(Oi,{label:`the workspace list`,children:(0,Y.jsx)(ht,{selectedId:s||M?null:N?.id??null,onSelect:e=>l({page:`workspace`,workspace:e,task:null})})}),(0,Y.jsxs)(q,{variant:`ghost`,className:`mt-auto shrink-0 justify-start`,"aria-haspopup":`dialog`,"aria-expanded":g,ref:b,onClick:()=>S(null),children:[(0,Y.jsx)(Sr,{}),`Settings`,(0,Y.jsx)(`span`,{className:`ml-auto flex flex-col items-end text-xs font-normal`,children:(0,Y.jsx)(pi,{})})]})]}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,inert:u||g,children:[(0,Y.jsxs)(`header`,{className:`flex items-center gap-2 border-b px-2 py-1.5 md:hidden print:hidden`,children:[(0,Y.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open menu`,ref:f,onClick:()=>d(!0),children:(0,Y.jsx)(Qn,{})}),(0,Y.jsx)(`span`,{className:`font-semibold tracking-tight`,children:`Toodo`})]}),(0,Y.jsxs)(`main`,{className:`relative flex min-w-0 flex-1 flex-col overflow-y-auto px-4 py-4 md:px-8 md:py-6 print:block print:overflow-visible print:p-0`,children:[(0,Y.jsx)(`div`,{className:`contents print:hidden`,children:(0,Y.jsx)(Ai,{})}),(0,Y.jsx)(Oi,{label:`this view`,resetKey:s?`review`:M?`all`:N?.id,children:s?(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading review...`}),children:(0,Y.jsx)(q_,{onShowTask:O})}):r.page===`all`&&e.data?.length?(0,Y.jsx)(Lg,{workspace:null,view:r.view,onViewChange:e=>i({page:`all`,view:e,task:null}),selectedTask:r.task,onSelectTask:e=>i({...r,task:e}),timelineScale:C,onTimelineScaleChange:w,shownTask:t,onTaskShown:()=>n(null)},`all`):N?(0,Y.jsx)(Lg,{workspace:N,selectedTask:r.page===`workspace`?r.task:null,onSelectTask:e=>i({page:`workspace`,workspace:N.id,task:e}),timelineScale:C,onTimelineScaleChange:w,draft:T.get(N.id),onDraftChange:e=>D(N.id,e)},N.id):!e.isPending&&!e.isError&&(0,Y.jsx)(Bg,{icon:(0,Y.jsx)(Rn,{}),title:`Create a workspace to start planning tasks.`,hint:`A workspace groups tasks, e.g. those of one repository or project.`,action:(0,Y.jsxs)(q,{ref:j,"aria-haspopup":`dialog`,onClick:()=>A(!0),children:[(0,Y.jsx)(pt,{}),`Add workspace`]})})})]})]}),(0,Y.jsx)(H_,{open:g,section:v,onShow:S,onClose:()=>_(!1),returnFocus:()=>x.current?f.current:b.current}),k&&(0,Y.jsx)(yt,{onCreated:e=>{A(!1),l({page:`workspace`,workspace:e.id,task:null})},onClose:()=>{A(!1),j.current?.focus()}}),F&&(0,Y.jsx)(Ei,{commands:(()=>{let t=new Map(e.data?.map(e=>[e.id,e.name])),n=J_(),r=document.querySelector(`input[aria-label='Task title']`),i=[!!e.data?.length&&{id:`timeline`,group:`Actions`,label:`Show the timeline of all workspaces`,icon:(0,Y.jsx)(mn,{}),run:()=>l({page:`all`,view:`timeline`,task:null})},!!e.data?.length&&{id:`list`,group:`Actions`,label:`Show the task list of all workspaces`,icon:(0,Y.jsx)(Xn,{}),run:()=>l({page:`all`,view:`list`,task:null})},!!e.data?.length&&{id:`plan`,group:`Actions`,label:`Show the quarter and year plan of all workspaces`,icon:(0,Y.jsx)(un,{}),run:()=>l({page:`all`,view:`plan`,task:null})},{id:`review`,group:`Actions`,label:`Show the review`,icon:(0,Y.jsx)(fn,{}),run:()=>l({page:`review`})},r!==null&&{id:`new-task`,group:`Actions`,label:`New task in this workspace`,icon:(0,Y.jsx)(pt,{}),run:()=>r.focus()},n!==null&&{id:`search`,group:`Actions`,label:`Search tasks`,hint:`/`,icon:(0,Y.jsx)(br,{}),run:()=>n.focus()},{id:`settings`,group:`Actions`,label:`Open settings`,icon:(0,Y.jsx)(Sr,{}),run:()=>S(null)},{id:`shortcuts`,group:`Actions`,label:`Show keyboard shortcuts`,hint:`?`,icon:(0,Y.jsx)(Wn,{}),run:()=>R(!0)},{id:`light`,group:`Actions`,label:`Use the light theme`,icon:(0,Y.jsx)(Mr,{}),run:()=>M_(`light`)},{id:`dark`,group:`Actions`,label:`Use the dark theme`,icon:(0,Y.jsx)(ir,{}),run:()=>M_(`dark`)},{id:`system`,group:`Actions`,label:`Use the system theme`,icon:(0,Y.jsx)(Ar,{}),run:()=>M_(`system`)},...(e.data??[]).map(e=>({id:`workspace-${e.id}`,group:`Actions`,label:`Open workspace ${e.name}`,icon:(0,Y.jsx)(In,{}),run:()=>l({page:`workspace`,workspace:e.id,task:null})}))],a=[...P.data??[]].sort((e,t)=>Number(e.status===`done`)-Number(t.status===`done`)||t.id-e.id).map(e=>({id:`task-${e.id}`,group:`Tasks`,label:`#${e.id} ${e.title}`,keywords:t.get(e.workspaceId),hint:t.get(e.workspaceId),icon:(0,Y.jsx)(wn,{}),run:()=>z(e)}));return[...i.filter(e=>e!==!1),...a]})(),onClose:()=>I(!1)}),L&&(0,Y.jsx)(Di,{onClose:()=>R(!1)})]})}var X_=`/version.json`,Z_=`toodo-skip-waiting`,Q_=5e3,$_=null,ev=null,tv=null,nv=new Set;function rv(){nv.forEach(e=>e())}function iv(){return document.querySelector(`meta[name="toodo-build"]`)?.content||null}function av(e){return nv.add(e),()=>nv.delete(e)}function ov(){return $_!==null&&$_!==ev?$_:null}function sv(){ev=$_,rv()}function cv(e){return typeof e==`object`&&e&&`build`in e&&typeof e.build==`string`?e.build:null}function lv(){let e=iv();return e===null?Promise.resolve():(tv??=(async()=>{try{let t=await fetch(X_,{cache:`no-store`}),n=t.ok?cv(await t.json().catch(()=>null)):null;if(n===null)return;let r=n===e?null:n;r!==$_&&($_=r,rv())}catch(e){console.warn(`toodo: could not check for a new build`,e)}finally{tv=null}})(),tv)}function uv(){lv(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&lv()}),addEventListener(`focus`,()=>void lv())}function dv(e,t){return new Promise(n=>{let r=setTimeout(n,t);e.finally(()=>{clearTimeout(r),n()})})}async function fv(){if(!(`serviceWorker`in navigator))return;let e=await navigator.serviceWorker.getRegistration();if(e===void 0)return;await e.update();let t=e.installing;t!==null&&await dv(new Promise(e=>{let n=()=>t.state!==`installing`&&e();t.addEventListener(`statechange`,n),n()}),Q_);let n=e.waiting;if(n===null||navigator.serviceWorker.controller===null)return;let r=new Promise(e=>navigator.serviceWorker.addEventListener(`controllerchange`,()=>e(),{once:!0}));n.postMessage({type:Z_}),await dv(r,Q_)}async function pv(){try{await fv()}catch(e){console.warn(`toodo: could not activate the new service worker`,e)}location.reload()}function mv(){let e=(0,J.useSyncExternalStore)(av,ov),[t,n]=(0,J.useState)(!1);return e===null?null:(0,Y.jsxs)(`div`,{role:`status`,"aria-label":`New version of Toodo`,className:a(`fixed inset-x-2 top-2 z-50 mx-auto flex max-w-xl flex-wrap items-center gap-x-3 gap-y-2 rounded-lg p-3 text-sm shadow-md print:hidden`,Gr.info),children:[(0,Y.jsx)(gr,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 basis-48`,children:[(0,Y.jsx)(`p`,{className:`font-medium`,children:`A new version of Toodo is available`}),(0,Y.jsx)(`p`,{className:`text-xs`,children:`This tab still runs the earlier version. Reload to switch to the new one.`})]}),(0,Y.jsxs)(`div`,{className:`flex gap-1 max-md:gap-2`,children:[(0,Y.jsx)(q,{size:`sm`,disabled:t,onClick:()=>{n(!0),pv()},children:t?`Reloading...`:`Reload`}),(0,Y.jsx)(q,{size:`sm`,variant:`outline`,disabled:t,onClick:sv,children:`Later`})]})]})}var hv=`1.8.0`,gv=[`workspaces`,`task-list`,`tasks`],_v=864e5,vv=1e3;function yv(e){return e.state.status===`success`&&gv.includes(String(e.queryKey[0]))}function bv(e){return typeof e==`object`&&!!e&&e.version===`1.8.0`}function xv(){ge.setEventListener(e=>{let t=()=>e(Ct()===`reachable`);t();let n=Dt(t);return()=>void n()})}async function Sv(e,t){for(let t of gv)e.setQueryDefaults([t],{gcTime:_v});if(At()!==null)try{let n=await t.load();bv(n)&&zt(e,n.state)}catch(e){console.error(`Toodo: could not restore the saved tasks`,e)}}function Cv(e,t,n=vv){let r,i=()=>{if(r=void 0,At()===null)return;let n=Rt(e,{shouldDehydrateQuery:yv,shouldDehydrateMutation:()=>!1});t.save({version:hv,savedAt:Date.now(),state:n}).catch(e=>{console.error(`Toodo: could not save the tasks for offline reading`,e)})},a=e.getQueryCache().subscribe(e=>{e.type===`updated`&&e.action.type===`success`&&yv(e.query)&&(r??=setTimeout(i,n))}),o=Et(()=>{At()===null&&(clearTimeout(r),r=void 0,t.clear().catch(e=>console.error(`Toodo: could not forget the saved tasks`,e)))});return()=>{clearTimeout(r),a(),o()}}var wv=`toodo`,Tv=`query-cache`;function Ev(e,t){return new Promise((n,r)=>{let i=indexedDB.open(wv,1);i.onupgradeneeded=()=>i.result.createObjectStore(Tv),i.onerror=()=>r(i.error),i.onsuccess=()=>{let a=i.result,o=e(a.transaction(Tv,t).objectStore(Tv));o.onsuccess=()=>{a.close(),n(o.result)},o.onerror=()=>{a.close(),r(o.error)}}})}function Dv(){let e=bt.key(`queries`);return{load:()=>Ev(t=>t.get(e),`readonly`),save:t=>Ev(n=>n.put(t,e),`readwrite`).then(()=>void 0),clear:()=>Ev(t=>t.delete(e),`readwrite`)}}N_();var Ov=new Ut({defaultOptions:{mutations:{networkMode:`always`}}}),kv=Dv(),Av=Rr.createRoot(document.getElementById(`root`));function jv(e){Av.render((0,Y.jsx)(J.StrictMode,{children:(0,Y.jsxs)(We,{client:Ov,children:[(0,Y.jsx)(mv,{}),(0,Y.jsx)(Oi,{label:`Toodo`,className:`m-4`,children:e})]})}))}he(),wt(),xv(),uv(),Promise.all([Za(()=>import(`./server-access-DDsyuORf.js`),__vite__mapDeps([11,1,4,5,6])),Za(()=>import(`./offline-screen-h2o9Tj2z.js`),__vite__mapDeps([12,1,4,5])),Za(()=>import(`./event-DMqRNLc_.js`).then(e=>e.t),__vite__mapDeps([5,1])),Sv(Ov,kv)]).then(([{ServerAccess:e},{ConnectionGate:t},{onReconnect:n}])=>{n(()=>void Ov.invalidateQueries()),n(()=>void lv()),jt(()=>void lv()),jt(()=>void Ov.invalidateQueries()),Cv(Ov,kv),`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.error(`Toodo: could not register the service worker`,e)}),jv((0,Y.jsx)(t,{children:(0,Y.jsx)(e,{children:(0,Y.jsx)(Y_,{})})}))});export{Gi as $,Gh as A,zr as At,Uu as B,Ph as C,si as Ct,rg as D,Xr as Dt,Qh as E,Jr as Et,Vm as F,Ir as Ft,Qa as G,po as H,Um as I,An as It,oo as J,lo as K,Fm as L,Sn as Lt,Vh as M,Kr as Mt,dg as N,qr as Nt,$h as O,Yr as Ot,Ym as P,Hr as Pt,ea as Q,Pm as R,bn as Rt,Jh as S,ti as St,ag as T,ri as Tt,so as U,mo as V,co as W,xa as X,uo as Y,ta as Z,Yh as _,Ci as _t,l_ as a,na as at,Mh as b,Qr as bt,Xh as c,ra as ct,yg as d,wa as dt,Ki as et,pg as f,Ni as ft,fg as g,Oi as gt,og as h,Fi as ht,r_ as i,Ea as it,ig as j,Vr as jt,bg as k,Br as kt,gg as l,Ta as lt,hg as m,Bi as mt,e_ as n,Ca as nt,a_ as o,ba as ot,sg as p,ji as pt,fo as q,t_ as r,Sa as rt,Bg as s,oa as st,F_ as t,X as tt,_g as u,Ji as ut,cg as v,ci as vt,Fh as w,ai as wt,Wh as x,ni as xt,vg as y,ii as yt,Nm as z,qt as zt};
|