@agent-plan/pi-adapter 0.2.19-next.9 → 0.2.20

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.
@@ -0,0 +1,293 @@
1
+ var RS=Object.defineProperty;var jS=(t,a,l)=>a in t?RS(t,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[a]=l;var hn=(t,a,l)=>jS(t,typeof a!="symbol"?a+"":a,l);function TS(t,a){for(var l=0;l<a.length;l++){const s=a[l];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in t)){const u=Object.getOwnPropertyDescriptor(s,o);u&&Object.defineProperty(t,o,u.get?u:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function l(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=l(o);fetch(o.href,u)}})();function CS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ch={exports:{}},oo={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var vy;function AS(){if(vy)return oo;vy=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(s,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:t,type:s,key:f,ref:o!==void 0?o:null,props:u}}return oo.Fragment=a,oo.jsx=l,oo.jsxs=l,oo}var yy;function DS(){return yy||(yy=1,ch.exports=AS()),ch.exports}var c=DS(),dh={exports:{}},et={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var xy;function kS(){if(xy)return et;xy=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),N=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=N&&C[N]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,R={};function L(C,V,ne){this.props=C,this.context=V,this.refs=R,this.updater=ne||S}L.prototype.isReactComponent={},L.prototype.setState=function(C,V){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,V,"setState")},L.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function I(){}I.prototype=L.prototype;function q(C,V,ne){this.props=C,this.context=V,this.refs=R,this.updater=ne||S}var X=q.prototype=new I;X.constructor=q,A(X,L.prototype),X.isPureReactComponent=!0;var W=Array.isArray;function ae(){}var z={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(C,V,ne){var me=ne.ref;return{$$typeof:t,type:C,key:V,ref:me!==void 0?me:null,props:ne}}function fe(C,V){return ee(C.type,V,C.props)}function be(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function ye(C){var V={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ne){return V[ne]})}var te=/\/+/g;function re(C,V){return typeof C=="object"&&C!==null&&C.key!=null?ye(""+C.key):V.toString(36)}function ge(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(ae,ae):(C.status="pending",C.then(function(V){C.status==="pending"&&(C.status="fulfilled",C.value=V)},function(V){C.status==="pending"&&(C.status="rejected",C.reason=V)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function U(C,V,ne,me,Ne){var je=typeof C;(je==="undefined"||je==="boolean")&&(C=null);var ze=!1;if(C===null)ze=!0;else switch(je){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(C.$$typeof){case t:case a:ze=!0;break;case x:return ze=C._init,U(ze(C._payload),V,ne,me,Ne)}}if(ze)return Ne=Ne(C),ze=me===""?"."+re(C,0):me,W(Ne)?(ne="",ze!=null&&(ne=ze.replace(te,"$&/")+"/"),U(Ne,V,ne,"",function(nt){return nt})):Ne!=null&&(be(Ne)&&(Ne=fe(Ne,ne+(Ne.key==null||C&&C.key===Ne.key?"":(""+Ne.key).replace(te,"$&/")+"/")+ze)),V.push(Ne)),1;ze=0;var ut=me===""?".":me+":";if(W(C))for(var Ge=0;Ge<C.length;Ge++)me=C[Ge],je=ut+re(me,Ge),ze+=U(me,V,ne,je,Ne);else if(Ge=w(C),typeof Ge=="function")for(C=Ge.call(C),Ge=0;!(me=C.next()).done;)me=me.value,je=ut+re(me,Ge++),ze+=U(me,V,ne,je,Ne);else if(je==="object"){if(typeof C.then=="function")return U(ge(C),V,ne,me,Ne);throw V=String(C),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ze}function B(C,V,ne){if(C==null)return C;var me=[],Ne=0;return U(C,me,"","",function(je){return V.call(ne,je,Ne++)}),me}function ue(C){if(C._status===-1){var V=C._result;V=V(),V.then(function(ne){(C._status===0||C._status===-1)&&(C._status=1,C._result=ne)},function(ne){(C._status===0||C._status===-1)&&(C._status=2,C._result=ne)}),C._status===-1&&(C._status=0,C._result=V)}if(C._status===1)return C._result.default;throw C._result}var de=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},we={map:B,forEach:function(C,V,ne){B(C,function(){V.apply(this,arguments)},ne)},count:function(C){var V=0;return B(C,function(){V++}),V},toArray:function(C){return B(C,function(V){return V})||[]},only:function(C){if(!be(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return et.Activity=y,et.Children=we,et.Component=L,et.Fragment=l,et.Profiler=o,et.PureComponent=q,et.StrictMode=s,et.Suspense=p,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,et.__COMPILER_RUNTIME={__proto__:null,c:function(C){return z.H.useMemoCache(C)}},et.cache=function(C){return function(){return C.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(C,V,ne){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var me=A({},C.props),Ne=C.key;if(V!=null)for(je in V.key!==void 0&&(Ne=""+V.key),V)!T.call(V,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&V.ref===void 0||(me[je]=V[je]);var je=arguments.length-2;if(je===1)me.children=ne;else if(1<je){for(var ze=Array(je),ut=0;ut<je;ut++)ze[ut]=arguments[ut+2];me.children=ze}return ee(C.type,Ne,me)},et.createContext=function(C){return C={$$typeof:f,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},et.createElement=function(C,V,ne){var me,Ne={},je=null;if(V!=null)for(me in V.key!==void 0&&(je=""+V.key),V)T.call(V,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(Ne[me]=V[me]);var ze=arguments.length-2;if(ze===1)Ne.children=ne;else if(1<ze){for(var ut=Array(ze),Ge=0;Ge<ze;Ge++)ut[Ge]=arguments[Ge+2];Ne.children=ut}if(C&&C.defaultProps)for(me in ze=C.defaultProps,ze)Ne[me]===void 0&&(Ne[me]=ze[me]);return ee(C,je,Ne)},et.createRef=function(){return{current:null}},et.forwardRef=function(C){return{$$typeof:m,render:C}},et.isValidElement=be,et.lazy=function(C){return{$$typeof:x,_payload:{_status:-1,_result:C},_init:ue}},et.memo=function(C,V){return{$$typeof:g,type:C,compare:V===void 0?null:V}},et.startTransition=function(C){var V=z.T,ne={};z.T=ne;try{var me=C(),Ne=z.S;Ne!==null&&Ne(ne,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(ae,de)}catch(je){de(je)}finally{V!==null&&ne.types!==null&&(V.types=ne.types),z.T=V}},et.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},et.use=function(C){return z.H.use(C)},et.useActionState=function(C,V,ne){return z.H.useActionState(C,V,ne)},et.useCallback=function(C,V){return z.H.useCallback(C,V)},et.useContext=function(C){return z.H.useContext(C)},et.useDebugValue=function(){},et.useDeferredValue=function(C,V){return z.H.useDeferredValue(C,V)},et.useEffect=function(C,V){return z.H.useEffect(C,V)},et.useEffectEvent=function(C){return z.H.useEffectEvent(C)},et.useId=function(){return z.H.useId()},et.useImperativeHandle=function(C,V,ne){return z.H.useImperativeHandle(C,V,ne)},et.useInsertionEffect=function(C,V){return z.H.useInsertionEffect(C,V)},et.useLayoutEffect=function(C,V){return z.H.useLayoutEffect(C,V)},et.useMemo=function(C,V){return z.H.useMemo(C,V)},et.useOptimistic=function(C,V){return z.H.useOptimistic(C,V)},et.useReducer=function(C,V,ne){return z.H.useReducer(C,V,ne)},et.useRef=function(C){return z.H.useRef(C)},et.useState=function(C){return z.H.useState(C)},et.useSyncExternalStore=function(C,V,ne){return z.H.useSyncExternalStore(C,V,ne)},et.useTransition=function(){return z.H.useTransition()},et.version="19.2.7",et}var by;function em(){return by||(by=1,dh.exports=kS()),dh.exports}var v=em();const un=CS(v),OS=TS({__proto__:null,default:un},[v]);var fh={exports:{}},uo={},hh={exports:{}},mh={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Sy;function MS(){return Sy||(Sy=1,(function(t){function a(U,B){var ue=U.length;U.push(B);e:for(;0<ue;){var de=ue-1>>>1,we=U[de];if(0<o(we,B))U[de]=B,U[ue]=we,ue=de;else break e}}function l(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var B=U[0],ue=U.pop();if(ue!==B){U[0]=ue;e:for(var de=0,we=U.length,C=we>>>1;de<C;){var V=2*(de+1)-1,ne=U[V],me=V+1,Ne=U[me];if(0>o(ne,ue))me<we&&0>o(Ne,ne)?(U[de]=Ne,U[me]=ue,de=me):(U[de]=ne,U[V]=ue,de=V);else if(me<we&&0>o(Ne,ue))U[de]=Ne,U[me]=ue,de=me;else break e}}return B}function o(U,B){var ue=U.sortIndex-B.sortIndex;return ue!==0?ue:U.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,m=f.now();t.unstable_now=function(){return f.now()-m}}var p=[],g=[],x=1,y=null,N=3,w=!1,S=!1,A=!1,R=!1,L=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function X(U){for(var B=l(g);B!==null;){if(B.callback===null)s(g);else if(B.startTime<=U)s(g),B.sortIndex=B.expirationTime,a(p,B);else break;B=l(g)}}function W(U){if(A=!1,X(U),!S)if(l(p)!==null)S=!0,ae||(ae=!0,ye());else{var B=l(g);B!==null&&ge(W,B.startTime-U)}}var ae=!1,z=-1,T=5,ee=-1;function fe(){return R?!0:!(t.unstable_now()-ee<T)}function be(){if(R=!1,ae){var U=t.unstable_now();ee=U;var B=!0;try{e:{S=!1,A&&(A=!1,I(z),z=-1),w=!0;var ue=N;try{t:{for(X(U),y=l(p);y!==null&&!(y.expirationTime>U&&fe());){var de=y.callback;if(typeof de=="function"){y.callback=null,N=y.priorityLevel;var we=de(y.expirationTime<=U);if(U=t.unstable_now(),typeof we=="function"){y.callback=we,X(U),B=!0;break t}y===l(p)&&s(p),X(U)}else s(p);y=l(p)}if(y!==null)B=!0;else{var C=l(g);C!==null&&ge(W,C.startTime-U),B=!1}}break e}finally{y=null,N=ue,w=!1}B=void 0}}finally{B?ye():ae=!1}}}var ye;if(typeof q=="function")ye=function(){q(be)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,re=te.port2;te.port1.onmessage=be,ye=function(){re.postMessage(null)}}else ye=function(){L(be,0)};function ge(U,B){z=L(function(){U(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_next=function(U){switch(N){case 1:case 2:case 3:var B=3;break;default:B=N}var ue=N;N=B;try{return U()}finally{N=ue}},t.unstable_requestPaint=function(){R=!0},t.unstable_runWithPriority=function(U,B){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ue=N;N=U;try{return B()}finally{N=ue}},t.unstable_scheduleCallback=function(U,B,ue){var de=t.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?de+ue:de):ue=de,U){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=ue+we,U={id:x++,callback:B,priorityLevel:U,startTime:ue,expirationTime:we,sortIndex:-1},ue>de?(U.sortIndex=ue,a(g,U),l(p)===null&&U===l(g)&&(A?(I(z),z=-1):A=!0,ge(W,ue-de))):(U.sortIndex=we,a(p,U),S||w||(S=!0,ae||(ae=!0,ye()))),U},t.unstable_shouldYield=fe,t.unstable_wrapCallback=function(U){var B=N;return function(){var ue=N;N=B;try{return U.apply(this,arguments)}finally{N=ue}}}})(mh)),mh}var wy;function _S(){return wy||(wy=1,hh.exports=MS()),hh.exports}var ph={exports:{}},sa={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Ey;function LS(){if(Ey)return sa;Ey=1;var t=em();function a(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var s={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(p,g,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:p,containerInfo:g,implementation:x}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return sa.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,sa.createPortal=function(p,g){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(a(299));return u(p,g,null,x)},sa.flushSync=function(p){var g=f.T,x=s.p;try{if(f.T=null,s.p=2,p)return p()}finally{f.T=g,s.p=x,s.d.f()}},sa.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(p,g))},sa.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},sa.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var x=g.as,y=m(x,g.crossOrigin),N=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?s.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:N,fetchPriority:w}):x==="script"&&s.d.X(p,{crossOrigin:y,integrity:N,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},sa.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var x=m(g.as,g.crossOrigin);s.d.M(p,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&s.d.M(p)},sa.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,y=m(x,g.crossOrigin);s.d.L(p,x,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},sa.preloadModule=function(p,g){if(typeof p=="string")if(g){var x=m(g.as,g.crossOrigin);s.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else s.d.m(p)},sa.requestFormReset=function(p){s.d.r(p)},sa.unstable_batchedUpdates=function(p,g){return p(g)},sa.useFormState=function(p,g,x){return f.H.useFormState(p,g,x)},sa.useFormStatus=function(){return f.H.useHostTransitionStatus()},sa.version="19.2.7",sa}var Ny;function Gx(){if(Ny)return ph.exports;Ny=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),ph.exports=LS(),ph.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Ry;function zS(){if(Ry)return uo;Ry=1;var t=_S(),a=em(),l=Gx();function s(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+n+" 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 u(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(u(e)!==e)throw Error(s(188))}function g(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(s(188));return n!==e?null:e}for(var r=e,i=n;;){var d=r.return;if(d===null)break;var h=d.alternate;if(h===null){if(i=d.return,i!==null){r=i;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===r)return p(d),e;if(h===i)return p(d),n;h=h.sibling}throw Error(s(188))}if(r.return!==i.return)r=d,i=h;else{for(var b=!1,E=d.child;E;){if(E===r){b=!0,r=d,i=h;break}if(E===i){b=!0,i=d,r=h;break}E=E.sibling}if(!b){for(E=h.child;E;){if(E===r){b=!0,r=h,i=d;break}if(E===i){b=!0,i=h,r=d;break}E=E.sibling}if(!b)throw Error(s(189))}}if(r.alternate!==i)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?e:n}function x(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=x(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,N=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),q=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),be=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=be&&e[be]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case L:return"Profiler";case R:return"StrictMode";case W:return"Suspense";case ae:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case S:return"Portal";case q:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case X:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return n=e.displayName||null,n!==null?n:re(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return re(e(n))}catch{}}return null}var ge=Array.isArray,U=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],we=-1;function C(e){return{current:e}}function V(e){0>we||(e.current=de[we],de[we]=null,we--)}function ne(e,n){we++,de[we]=e.current,e.current=n}var me=C(null),Ne=C(null),je=C(null),ze=C(null);function ut(e,n){switch(ne(je,n),ne(Ne,e),ne(me,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?$v(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=$v(n),e=qv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(me),ne(me,e)}function Ge(){V(me),V(Ne),V(je)}function nt(e){e.memoizedState!==null&&ne(ze,e);var n=me.current,r=qv(n,e.type);n!==r&&(ne(Ne,e),ne(me,r))}function Sn(e){Ne.current===e&&(V(me),V(Ne)),ze.current===e&&(V(ze),ro._currentValue=ue)}var Xt,ft;function oe(e){if(Xt===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Xt=n&&n[1]||"",ft=-1<r.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Xt+e+ft}var $e=!1;function at(e,n){if(!e||$e)return"";$e=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(n){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Q){var G=Q}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(Q){G=Q}e.call(ie.prototype)}}else{try{throw Error()}catch(Q){G=Q}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=i.DetermineComponentFrameRoot(),b=h[0],E=h[1];if(b&&E){var k=b.split(`
44
+ `),F=E.split(`
45
+ `);for(d=i=0;i<k.length&&!k[i].includes("DetermineComponentFrameRoot");)i++;for(;d<F.length&&!F[d].includes("DetermineComponentFrameRoot");)d++;if(i===k.length||d===F.length)for(i=k.length-1,d=F.length-1;1<=i&&0<=d&&k[i]!==F[d];)d--;for(;1<=i&&0<=d;i--,d--)if(k[i]!==F[d]){if(i!==1||d!==1)do if(i--,d--,0>d||k[i]!==F[d]){var J=`
46
+ `+k[i].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=i&&0<=d);break}}}finally{$e=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?oe(r):""}function Ut(e,n){switch(e.tag){case 26:case 27:case 5:return oe(e.type);case 16:return oe("Lazy");case 13:return e.child!==n&&n!==null?oe("Suspense Fallback"):oe("Suspense");case 19:return oe("SuspenseList");case 0:case 15:return at(e.type,!1);case 11:return at(e.type.render,!1);case 1:return at(e.type,!0);case 31:return oe("Activity");default:return""}}function pn(e){try{var n="",r=null;do n+=Ut(e,r),r=e,e=e.return;while(e);return n}catch(i){return`
47
+ Error generating stack: `+i.message+`
48
+ `+i.stack}}var jt=Object.prototype.hasOwnProperty,_t=t.unstable_scheduleCallback,Qt=t.unstable_cancelCallback,Hn=t.unstable_shouldYield,$n=t.unstable_requestPaint,tn=t.unstable_now,da=t.unstable_getCurrentPriorityLevel,fa=t.unstable_ImmediatePriority,Wn=t.unstable_UserBlockingPriority,qn=t.unstable_NormalPriority,he=t.unstable_LowPriority,Ce=t.unstable_IdlePriority,Ae=t.log,Pe=t.unstable_setDisableYieldValue,qe=null,Z=null;function Tt(e){if(typeof Ae=="function"&&Pe(e),Z&&typeof Z.setStrictMode=="function")try{Z.setStrictMode(qe,e)}catch{}}var Kt=Math.clz32?Math.clz32:Ba,Yn=Math.log,gn=Math.LN2;function Ba(e){return e>>>=0,e===0?32:31-(Yn(e)/gn|0)|0}var Me=256,vt=262144,yt=4194304;function St(e){var n=e&42;if(n!==0)return n;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&261888;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 Bt(e,n,r){var i=e.pendingLanes;if(i===0)return 0;var d=0,h=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var E=i&134217727;return E!==0?(i=E&~h,i!==0?d=St(i):(b&=E,b!==0?d=St(b):r||(r=E&~e,r!==0&&(d=St(r))))):(E=i&~h,E!==0?d=St(E):b!==0?d=St(b):r||(r=i&~e,r!==0&&(d=St(r)))),d===0?0:n!==0&&n!==d&&(n&h)===0&&(h=d&-d,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:d}function Ct(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function nn(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Zt(){var e=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),e}function Ht(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function ht(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,n,r,i,d,h){var b=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var E=e.entanglements,k=e.expirationTimes,F=e.hiddenUpdates;for(r=b&~r;0<r;){var J=31-Kt(r),ie=1<<J;E[J]=0,k[J]=-1;var G=F[J];if(G!==null)for(F[J]=null,J=0;J<G.length;J++){var Q=G[J];Q!==null&&(Q.lane&=-536870913)}r&=~ie}i!==0&&wn(e,i,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(b&~n))}function wn(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var i=31-Kt(n);e.entangledLanes|=n,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function kn(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var i=31-Kt(r),d=1<<i;d&n|e[i]&n&&(e[i]|=n),r&=~d}}function D(e,n){var r=n&-n;return r=(r&42)!==0?1:M(r),(r&(e.suspendedLanes|n))!==0?0:r}function M(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 $(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function K(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:cy(e.type))}function se(e,n){var r=B.p;try{return B.p=e,n()}finally{B.p=r}}var Te=Math.random().toString(36).slice(2),ve="__reactFiber$"+Te,De="__reactProps$"+Te,Re="__reactContainer$"+Te,_e="__reactEvents$"+Te,Ue="__reactListeners$"+Te,Xe="__reactHandles$"+Te,ke="__reactResources$"+Te,Ze="__reactMarker$"+Te;function Ie(e){delete e[ve],delete e[De],delete e[_e],delete e[Ue],delete e[Xe]}function $t(e){var n=e[ve];if(n)return n;for(var r=e.parentNode;r;){if(n=r[Re]||r[ve]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=Xv(e);e!==null;){if(r=e[ve])return r;e=Xv(e)}return n}e=r,r=e.parentNode}return null}function We(e){if(e=e[ve]||e[Re]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function ct(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(s(33))}function it(e){var n=e[ke];return n||(n=e[ke]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function dt(e){e[Ze]=!0}var Jt=new Set,Fn={};function En(e,n){On(e,n),On(e+"Capture",n)}function On(e,n){for(Fn[e]=n,e=0;e<n.length;e++)Jt.add(n[e])}var Mn=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]*$"),Pn={},ga={};function il(e){return jt.call(ga,e)?!0:jt.call(Pn,e)?!1:Mn.test(e)?ga[e]=!0:(Pn[e]=!0,!1)}function ea(e,n,r){if(il(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var i=n.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function pr(e,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.setAttribute(n,""+r)}}function Qe(e,n,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+i)}}function Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wt(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ta(e,n,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,h=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(b){r=""+b,h.call(this,b)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(b){r=""+b},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function _n(e){if(!e._valueTracker){var n=Wt(e)?"checked":"value";e._valueTracker=ta(e,n,""+e[n])}}function Mr(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),i="";return e&&(i=Wt(e)?e.checked?"true":"false":e.value),e=i,e!==r?(n.setValue(e),!0):!1}function Rt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ja=/[\n"\\]/g;function Gn(e){return e.replace(ja,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Fl(e,n,r,i,d,h,b,E){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),n!=null?b==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Nt(n)):e.value!==""+Nt(n)&&(e.value=""+Nt(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?At(e,b,Nt(n)):r!=null?At(e,b,Nt(r)):i!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+Nt(E):e.removeAttribute("name")}function bi(e,n,r,i,d,h,b,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){_n(e);return}r=r!=null?""+Nt(r):"",n=n!=null?""+Nt(n):r,E||n===e.value||(e.value=n),e.defaultValue=n}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=E?e.checked:!!i,e.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),_n(e)}function At(e,n,r){n==="number"&&Rt(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function gr(e,n,r,i){if(e=e.options,n){n={};for(var d=0;d<r.length;d++)n["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=n.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&i&&(e[r].defaultSelected=!0)}else{for(r=""+Nt(r),n=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function Wo(e,n,r){if(n!=null&&(n=""+Nt(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+Nt(r):""}function nr(e,n,r,i){if(n==null){if(i!=null){if(r!=null)throw Error(s(92));if(ge(i)){if(1<i.length)throw Error(s(93));i=i[0]}r=i}r==null&&(r=""),n=r}r=Nt(n),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),_n(e)}function ol(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var cd=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 Ss(e,n,r){var i=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?i?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":i?e.setProperty(n,r):typeof r!="number"||r===0||cd.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function va(e,n,r){if(n!=null&&typeof n!="object")throw Error(s(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||n!=null&&n.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in n)i=n[d],n.hasOwnProperty(d)&&r[d]!==i&&Ss(e,d,i)}else for(var h in n)n.hasOwnProperty(h)&&Ss(e,h,n[h])}function Pl(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 ws=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"],["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"]]),ya=/^[\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 an(e){return ya.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function na(){}var Ta=null;function _r(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vr=null,Lr=null;function Si(e){var n=We(e);if(n&&(e=n.stateNode)){var r=e[De]||null;e:switch(e=n.stateNode,n.type){case"input":if(Fl(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Gn(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var i=r[n];if(i!==e&&i.form===e.form){var d=i[De]||null;if(!d)throw Error(s(90));Fl(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<r.length;n++)i=r[n],i.form===e.form&&Mr(i)}break e;case"textarea":Wo(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&gr(e,!!r.multiple,n,!1)}}}var yr=!1;function wi(e,n,r){if(yr)return e(n,r);yr=!0;try{var i=e(n);return i}finally{if(yr=!1,(vr!==null||Lr!==null)&&($u(),vr&&(n=vr,e=Lr,Lr=vr=null,Si(n),e)))for(n=0;n<e.length;n++)Si(e[n])}}function Ha(e,n){var r=e.stateNode;if(r===null)return null;var i=r[De]||null;if(i===null)return null;r=i[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(s(231,n,typeof r));return r}var ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ei=!1;if(ar)try{var zr={};Object.defineProperty(zr,"passive",{get:function(){Ei=!0}}),window.addEventListener("test",zr,zr),window.removeEventListener("test",zr,zr)}catch{Ei=!1}var $a=null,Ni=null,Es=null;function eu(){if(Es)return Es;var e,n=Ni,r=n.length,i,d="value"in $a?$a.value:$a.textContent,h=d.length;for(e=0;e<r&&n[e]===d[e];e++);var b=r-e;for(i=1;i<=b&&n[r-i]===d[h-i];i++);return Es=d.slice(e,1<i?1-i:void 0)}function Ns(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ur(){return!0}function tu(){return!1}function aa(e){function n(r,i,d,h,b){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(r=e[E],this[E]=r?r(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ur:tu,this.isPropagationStopped=tu,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ur)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ur)},persist:function(){},isPersistent:Ur}),n}var Br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hr=aa(Br),Gl=y({},Br,{view:0,detail:0}),dd=aa(Gl),ul,Xl,Ql,$r=y({},Gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:la,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!==Ql&&(Ql&&e.type==="mousemove"?(ul=e.screenX-Ql.screenX,Xl=e.screenY-Ql.screenY):Xl=ul=0,Ql=e),ul)},movementY:function(e){return"movementY"in e?e.movementY:Xl}}),nu=aa($r),j=y({},$r,{dataTransfer:0}),P=aa(j),Ee=y({},Gl,{relatedTarget:0}),xe=aa(Ee),Fe=y({},Br,{animationName:0,elapsedTime:0,pseudoElement:0}),ce=aa(Fe),pe=y({},Br,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Se=aa(pe),Ke=y({},Br,{data:0}),rt=aa(Ke),Be={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nn={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"},Lt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ra(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Lt[e])?!!n[e]:!1}function la(){return ra}var xa=y({},Gl,{key:function(e){if(e.key){var n=Be[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Ns(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:la,charCode:function(e){return e.type==="keypress"?Ns(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ns(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rn=aa(xa),cn=y({},$r,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zt=aa(cn),Kl=y({},Gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:la}),xr=aa(Kl),fd=y({},Br,{propertyName:0,elapsedTime:0,pseudoElement:0}),au=aa(fd),ru=y({},$r,{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}),hd=aa(ru),md=y({},Br,{newState:0,oldState:0}),P0=aa(md),G0=[9,13,27,32],pd=ar&&"CompositionEvent"in window,Ri=null;ar&&"documentMode"in document&&(Ri=document.documentMode);var X0=ar&&"TextEvent"in window&&!Ri,Pm=ar&&(!pd||Ri&&8<Ri&&11>=Ri),Gm=" ",Xm=!1;function Qm(e,n){switch(e){case"keyup":return G0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Km(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rs=!1;function Q0(e,n){switch(e){case"compositionend":return Km(n);case"keypress":return n.which!==32?null:(Xm=!0,Gm);case"textInput":return e=n.data,e===Gm&&Xm?null:e;default:return null}}function K0(e,n){if(Rs)return e==="compositionend"||!pd&&Qm(e,n)?(e=eu(),Es=Ni=$a=null,Rs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Pm&&n.locale!=="ko"?null:n.data;default:return null}}var Z0={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 Zm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Z0[e.type]:n==="textarea"}function Jm(e,n,r,i){vr?Lr?Lr.push(i):Lr=[i]:vr=i,n=Gu(n,"onChange"),0<n.length&&(r=new Hr("onChange","change",null,r,i),e.push({event:r,listeners:n}))}var ji=null,Ti=null;function J0(e){_v(e,0)}function lu(e){var n=ct(e);if(Mr(n))return e}function Wm(e,n){if(e==="change")return n}var ep=!1;if(ar){var gd;if(ar){var vd="oninput"in document;if(!vd){var tp=document.createElement("div");tp.setAttribute("oninput","return;"),vd=typeof tp.oninput=="function"}gd=vd}else gd=!1;ep=gd&&(!document.documentMode||9<document.documentMode)}function np(){ji&&(ji.detachEvent("onpropertychange",ap),Ti=ji=null)}function ap(e){if(e.propertyName==="value"&&lu(Ti)){var n=[];Jm(n,Ti,e,_r(e)),wi(J0,n)}}function W0(e,n,r){e==="focusin"?(np(),ji=n,Ti=r,ji.attachEvent("onpropertychange",ap)):e==="focusout"&&np()}function e1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return lu(Ti)}function t1(e,n){if(e==="click")return lu(n)}function n1(e,n){if(e==="input"||e==="change")return lu(n)}function a1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Ca=typeof Object.is=="function"?Object.is:a1;function Ci(e,n){if(Ca(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),i=Object.keys(n);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var d=r[i];if(!jt.call(n,d)||!Ca(e[d],n[d]))return!1}return!0}function rp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lp(e,n){var r=rp(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=n&&i>=n)return{node:r,offset:n-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=rp(r)}}function sp(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?sp(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function ip(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Rt(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=Rt(e.document)}return n}function yd(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var r1=ar&&"documentMode"in document&&11>=document.documentMode,js=null,xd=null,Ai=null,bd=!1;function op(e,n,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;bd||js==null||js!==Rt(i)||(i=js,"selectionStart"in i&&yd(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ai&&Ci(Ai,i)||(Ai=i,i=Gu(xd,"onSelect"),0<i.length&&(n=new Hr("onSelect","select",null,n,r),e.push({event:n,listeners:i}),n.target=js)))}function Zl(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Ts={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionrun:Zl("Transition","TransitionRun"),transitionstart:Zl("Transition","TransitionStart"),transitioncancel:Zl("Transition","TransitionCancel"),transitionend:Zl("Transition","TransitionEnd")},Sd={},up={};ar&&(up=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function Jl(e){if(Sd[e])return Sd[e];if(!Ts[e])return e;var n=Ts[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in up)return Sd[e]=n[r];return e}var cp=Jl("animationend"),dp=Jl("animationiteration"),fp=Jl("animationstart"),l1=Jl("transitionrun"),s1=Jl("transitionstart"),i1=Jl("transitioncancel"),hp=Jl("transitionend"),mp=new Map,wd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");wd.push("scrollEnd");function rr(e,n){mp.set(e,n),En(n,[e])}var su=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qa=[],Cs=0,Ed=0;function iu(){for(var e=Cs,n=Ed=Cs=0;n<e;){var r=qa[n];qa[n++]=null;var i=qa[n];qa[n++]=null;var d=qa[n];qa[n++]=null;var h=qa[n];if(qa[n++]=null,i!==null&&d!==null){var b=i.pending;b===null?d.next=d:(d.next=b.next,b.next=d),i.pending=d}h!==0&&pp(r,d,h)}}function ou(e,n,r,i){qa[Cs++]=e,qa[Cs++]=n,qa[Cs++]=r,qa[Cs++]=i,Ed|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Nd(e,n,r,i){return ou(e,n,r,i),uu(e)}function Wl(e,n){return ou(e,null,null,n),uu(e)}function pp(e,n,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var d=!1,h=e.return;h!==null;)h.childLanes|=r,i=h.alternate,i!==null&&(i.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&n!==null&&(d=31-Kt(r),e=h.hiddenUpdates,i=e[d],i===null?e[d]=[n]:i.push(n),n.lane=r|536870912),h):null}function uu(e){if(50<Zi)throw Zi=0,_f=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var As={};function o1(e,n,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Aa(e,n,r,i){return new o1(e,n,r,i)}function Rd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qr(e,n){var r=e.alternate;return r===null?(r=Aa(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function gp(e,n){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function cu(e,n,r,i,d,h){var b=0;if(i=e,typeof e=="function")Rd(e)&&(b=1);else if(typeof e=="string")b=hS(e,r,me.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=Aa(31,r,n,d),e.elementType=ee,e.lanes=h,e;case A:return es(r.children,d,h,n);case R:b=8,d|=24;break;case L:return e=Aa(12,r,n,d|2),e.elementType=L,e.lanes=h,e;case W:return e=Aa(13,r,n,d),e.elementType=W,e.lanes=h,e;case ae:return e=Aa(19,r,n,d),e.elementType=ae,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q:b=10;break e;case I:b=9;break e;case X:b=11;break e;case z:b=14;break e;case T:b=16,i=null;break e}b=29,r=Error(s(130,e===null?"null":typeof e,"")),i=null}return n=Aa(b,r,n,d),n.elementType=e,n.type=i,n.lanes=h,n}function es(e,n,r,i){return e=Aa(7,e,i,n),e.lanes=r,e}function jd(e,n,r){return e=Aa(6,e,null,n),e.lanes=r,e}function vp(e){var n=Aa(18,null,null,0);return n.stateNode=e,n}function Td(e,n,r){return n=Aa(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var yp=new WeakMap;function Ia(e,n){if(typeof e=="object"&&e!==null){var r=yp.get(e);return r!==void 0?r:(n={value:e,source:n,stack:pn(n)},yp.set(e,n),n)}return{value:e,source:n,stack:pn(n)}}var Ds=[],ks=0,du=null,Di=0,Va=[],Ya=0,cl=null,br=1,Sr="";function Ir(e,n){Ds[ks++]=Di,Ds[ks++]=du,du=e,Di=n}function xp(e,n,r){Va[Ya++]=br,Va[Ya++]=Sr,Va[Ya++]=cl,cl=e;var i=br;e=Sr;var d=32-Kt(i)-1;i&=~(1<<d),r+=1;var h=32-Kt(n)+d;if(30<h){var b=d-d%5;h=(i&(1<<b)-1).toString(32),i>>=b,d-=b,br=1<<32-Kt(n)+d|r<<d|i,Sr=h+e}else br=1<<h|r<<d|i,Sr=e}function Cd(e){e.return!==null&&(Ir(e,1),xp(e,1,0))}function Ad(e){for(;e===du;)du=Ds[--ks],Ds[ks]=null,Di=Ds[--ks],Ds[ks]=null;for(;e===cl;)cl=Va[--Ya],Va[Ya]=null,Sr=Va[--Ya],Va[Ya]=null,br=Va[--Ya],Va[Ya]=null}function bp(e,n){Va[Ya++]=br,Va[Ya++]=Sr,Va[Ya++]=cl,br=n.id,Sr=n.overflow,cl=e}var Xn=null,rn=null,wt=!1,dl=null,Fa=!1,Dd=Error(s(519));function fl(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ki(Ia(n,e)),Dd}function Sp(e){var n=e.stateNode,r=e.type,i=e.memoizedProps;switch(n[ve]=e,n[De]=i,r){case"dialog":pt("cancel",n),pt("close",n);break;case"iframe":case"object":case"embed":pt("load",n);break;case"video":case"audio":for(r=0;r<Wi.length;r++)pt(Wi[r],n);break;case"source":pt("error",n);break;case"img":case"image":case"link":pt("error",n),pt("load",n);break;case"details":pt("toggle",n);break;case"input":pt("invalid",n),bi(n,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":pt("invalid",n);break;case"textarea":pt("invalid",n),nr(n,i.value,i.defaultValue,i.children)}r=i.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||i.suppressHydrationWarning===!0||Bv(n.textContent,r)?(i.popover!=null&&(pt("beforetoggle",n),pt("toggle",n)),i.onScroll!=null&&pt("scroll",n),i.onScrollEnd!=null&&pt("scrollend",n),i.onClick!=null&&(n.onclick=na),n=!0):n=!1,n||fl(e,!0)}function wp(e){for(Xn=e.return;Xn;)switch(Xn.tag){case 5:case 31:case 13:Fa=!1;return;case 27:case 3:Fa=!0;return;default:Xn=Xn.return}}function Os(e){if(e!==Xn)return!1;if(!wt)return wp(e),wt=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Qf(e.type,e.memoizedProps)),r=!r),r&&rn&&fl(e),wp(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));rn=Gv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));rn=Gv(e)}else n===27?(n=rn,jl(e.type)?(e=eh,eh=null,rn=e):rn=n):rn=Xn?Ga(e.stateNode.nextSibling):null;return!0}function ts(){rn=Xn=null,wt=!1}function kd(){var e=dl;return e!==null&&(Ea===null?Ea=e:Ea.push.apply(Ea,e),dl=null),e}function ki(e){dl===null?dl=[e]:dl.push(e)}var Od=C(null),ns=null,Vr=null;function hl(e,n,r){ne(Od,n._currentValue),n._currentValue=r}function Yr(e){e._currentValue=Od.current,V(Od)}function Md(e,n,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===r)break;e=e.return}}function _d(e,n,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var b=d.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=d;for(var k=0;k<n.length;k++)if(E.context===n[k]){h.lanes|=r,E=h.alternate,E!==null&&(E.lanes|=r),Md(h.return,r,e),i||(b=null);break e}h=E.next}}else if(d.tag===18){if(b=d.return,b===null)throw Error(s(341));b.lanes|=r,h=b.alternate,h!==null&&(h.lanes|=r),Md(b,r,e),b=null}else b=d.child;if(b!==null)b.return=d;else for(b=d;b!==null;){if(b===e){b=null;break}if(d=b.sibling,d!==null){d.return=b.return,b=d;break}b=b.return}d=b}}function Ms(e,n,r,i){e=null;for(var d=n,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var b=d.alternate;if(b===null)throw Error(s(387));if(b=b.memoizedProps,b!==null){var E=d.type;Ca(d.pendingProps.value,b.value)||(e!==null?e.push(E):e=[E])}}else if(d===ze.current){if(b=d.alternate,b===null)throw Error(s(387));b.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(ro):e=[ro])}d=d.return}e!==null&&_d(n,e,r,i),n.flags|=262144}function fu(e){for(e=e.firstContext;e!==null;){if(!Ca(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function as(e){ns=e,Vr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qn(e){return Ep(ns,e)}function hu(e,n){return ns===null&&as(e),Ep(e,n)}function Ep(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},Vr===null){if(e===null)throw Error(s(308));Vr=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Vr=Vr.next=n;return r}var u1=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,i){e.push(i)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},c1=t.unstable_scheduleCallback,d1=t.unstable_NormalPriority,jn={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ld(){return{controller:new u1,data:new Map,refCount:0}}function Oi(e){e.refCount--,e.refCount===0&&c1(d1,function(){e.controller.abort()})}var Mi=null,zd=0,_s=0,Ls=null;function f1(e,n){if(Mi===null){var r=Mi=[];zd=0,_s=$f(),Ls={status:"pending",value:void 0,then:function(i){r.push(i)}}}return zd++,n.then(Np,Np),n}function Np(){if(--zd===0&&Mi!==null){Ls!==null&&(Ls.status="fulfilled");var e=Mi;Mi=null,_s=0,Ls=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function h1(e,n){var r=[],i={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){i.status="fulfilled",i.value=n;for(var d=0;d<r.length;d++)(0,r[d])(n)},function(d){for(i.status="rejected",i.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),i}var Rp=U.S;U.S=function(e,n){ov=tn(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&f1(e,n),Rp!==null&&Rp(e,n)};var rs=C(null);function Ud(){var e=rs.current;return e!==null?e:en.pooledCache}function mu(e,n){n===null?ne(rs,rs.current):ne(rs,n.pool)}function jp(){var e=Ud();return e===null?null:{parent:jn._currentValue,pool:e}}var zs=Error(s(460)),Bd=Error(s(474)),pu=Error(s(542)),gu={then:function(){}};function Tp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Cp(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(na,na),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Dp(e),e;default:if(typeof n.status=="string")n.then(na,na);else{if(e=en,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=n,e.status="pending",e.then(function(i){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=i}},function(i){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=i}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Dp(e),e}throw ss=n,zs}}function ls(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ss=r,zs):r}}var ss=null;function Ap(){if(ss===null)throw Error(s(459));var e=ss;return ss=null,e}function Dp(e){if(e===zs||e===pu)throw Error(s(483))}var Us=null,_i=0;function vu(e){var n=_i;return _i+=1,Us===null&&(Us=[]),Cp(Us,e,n)}function Li(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function yu(e,n){throw n.$$typeof===N?Error(s(525)):(e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function kp(e){function n(H,_){if(e){var Y=H.deletions;Y===null?(H.deletions=[_],H.flags|=16):Y.push(_)}}function r(H,_){if(!e)return null;for(;_!==null;)n(H,_),_=_.sibling;return null}function i(H){for(var _=new Map;H!==null;)H.key!==null?_.set(H.key,H):_.set(H.index,H),H=H.sibling;return _}function d(H,_){return H=qr(H,_),H.index=0,H.sibling=null,H}function h(H,_,Y){return H.index=Y,e?(Y=H.alternate,Y!==null?(Y=Y.index,Y<_?(H.flags|=67108866,_):Y):(H.flags|=67108866,_)):(H.flags|=1048576,_)}function b(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function E(H,_,Y,le){return _===null||_.tag!==6?(_=jd(Y,H.mode,le),_.return=H,_):(_=d(_,Y),_.return=H,_)}function k(H,_,Y,le){var He=Y.type;return He===A?J(H,_,Y.props.children,le,Y.key):_!==null&&(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&ls(He)===_.type)?(_=d(_,Y.props),Li(_,Y),_.return=H,_):(_=cu(Y.type,Y.key,Y.props,null,H.mode,le),Li(_,Y),_.return=H,_)}function F(H,_,Y,le){return _===null||_.tag!==4||_.stateNode.containerInfo!==Y.containerInfo||_.stateNode.implementation!==Y.implementation?(_=Td(Y,H.mode,le),_.return=H,_):(_=d(_,Y.children||[]),_.return=H,_)}function J(H,_,Y,le,He){return _===null||_.tag!==7?(_=es(Y,H.mode,le,He),_.return=H,_):(_=d(_,Y),_.return=H,_)}function ie(H,_,Y){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=jd(""+_,H.mode,Y),_.return=H,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case w:return Y=cu(_.type,_.key,_.props,null,H.mode,Y),Li(Y,_),Y.return=H,Y;case S:return _=Td(_,H.mode,Y),_.return=H,_;case T:return _=ls(_),ie(H,_,Y)}if(ge(_)||ye(_))return _=es(_,H.mode,Y,null),_.return=H,_;if(typeof _.then=="function")return ie(H,vu(_),Y);if(_.$$typeof===q)return ie(H,hu(H,_),Y);yu(H,_)}return null}function G(H,_,Y,le){var He=_!==null?_.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return He!==null?null:E(H,_,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===He?k(H,_,Y,le):null;case S:return Y.key===He?F(H,_,Y,le):null;case T:return Y=ls(Y),G(H,_,Y,le)}if(ge(Y)||ye(Y))return He!==null?null:J(H,_,Y,le,null);if(typeof Y.then=="function")return G(H,_,vu(Y),le);if(Y.$$typeof===q)return G(H,_,hu(H,Y),le);yu(H,Y)}return null}function Q(H,_,Y,le,He){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(Y)||null,E(_,H,""+le,He);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return H=H.get(le.key===null?Y:le.key)||null,k(_,H,le,He);case S:return H=H.get(le.key===null?Y:le.key)||null,F(_,H,le,He);case T:return le=ls(le),Q(H,_,Y,le,He)}if(ge(le)||ye(le))return H=H.get(Y)||null,J(_,H,le,He,null);if(typeof le.then=="function")return Q(H,_,Y,vu(le),He);if(le.$$typeof===q)return Q(H,_,Y,hu(_,le),He);yu(_,le)}return null}function Oe(H,_,Y,le){for(var He=null,Dt=null,Le=_,ot=_=0,bt=null;Le!==null&&ot<Y.length;ot++){Le.index>ot?(bt=Le,Le=null):bt=Le.sibling;var kt=G(H,Le,Y[ot],le);if(kt===null){Le===null&&(Le=bt);break}e&&Le&&kt.alternate===null&&n(H,Le),_=h(kt,_,ot),Dt===null?He=kt:Dt.sibling=kt,Dt=kt,Le=bt}if(ot===Y.length)return r(H,Le),wt&&Ir(H,ot),He;if(Le===null){for(;ot<Y.length;ot++)Le=ie(H,Y[ot],le),Le!==null&&(_=h(Le,_,ot),Dt===null?He=Le:Dt.sibling=Le,Dt=Le);return wt&&Ir(H,ot),He}for(Le=i(Le);ot<Y.length;ot++)bt=Q(Le,H,ot,Y[ot],le),bt!==null&&(e&&bt.alternate!==null&&Le.delete(bt.key===null?ot:bt.key),_=h(bt,_,ot),Dt===null?He=bt:Dt.sibling=bt,Dt=bt);return e&&Le.forEach(function(kl){return n(H,kl)}),wt&&Ir(H,ot),He}function Ve(H,_,Y,le){if(Y==null)throw Error(s(151));for(var He=null,Dt=null,Le=_,ot=_=0,bt=null,kt=Y.next();Le!==null&&!kt.done;ot++,kt=Y.next()){Le.index>ot?(bt=Le,Le=null):bt=Le.sibling;var kl=G(H,Le,kt.value,le);if(kl===null){Le===null&&(Le=bt);break}e&&Le&&kl.alternate===null&&n(H,Le),_=h(kl,_,ot),Dt===null?He=kl:Dt.sibling=kl,Dt=kl,Le=bt}if(kt.done)return r(H,Le),wt&&Ir(H,ot),He;if(Le===null){for(;!kt.done;ot++,kt=Y.next())kt=ie(H,kt.value,le),kt!==null&&(_=h(kt,_,ot),Dt===null?He=kt:Dt.sibling=kt,Dt=kt);return wt&&Ir(H,ot),He}for(Le=i(Le);!kt.done;ot++,kt=Y.next())kt=Q(Le,H,ot,kt.value,le),kt!==null&&(e&&kt.alternate!==null&&Le.delete(kt.key===null?ot:kt.key),_=h(kt,_,ot),Dt===null?He=kt:Dt.sibling=kt,Dt=kt);return e&&Le.forEach(function(NS){return n(H,NS)}),wt&&Ir(H,ot),He}function Ft(H,_,Y,le){if(typeof Y=="object"&&Y!==null&&Y.type===A&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var He=Y.key;_!==null;){if(_.key===He){if(He=Y.type,He===A){if(_.tag===7){r(H,_.sibling),le=d(_,Y.props.children),le.return=H,H=le;break e}}else if(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&ls(He)===_.type){r(H,_.sibling),le=d(_,Y.props),Li(le,Y),le.return=H,H=le;break e}r(H,_);break}else n(H,_);_=_.sibling}Y.type===A?(le=es(Y.props.children,H.mode,le,Y.key),le.return=H,H=le):(le=cu(Y.type,Y.key,Y.props,null,H.mode,le),Li(le,Y),le.return=H,H=le)}return b(H);case S:e:{for(He=Y.key;_!==null;){if(_.key===He)if(_.tag===4&&_.stateNode.containerInfo===Y.containerInfo&&_.stateNode.implementation===Y.implementation){r(H,_.sibling),le=d(_,Y.children||[]),le.return=H,H=le;break e}else{r(H,_);break}else n(H,_);_=_.sibling}le=Td(Y,H.mode,le),le.return=H,H=le}return b(H);case T:return Y=ls(Y),Ft(H,_,Y,le)}if(ge(Y))return Oe(H,_,Y,le);if(ye(Y)){if(He=ye(Y),typeof He!="function")throw Error(s(150));return Y=He.call(Y),Ve(H,_,Y,le)}if(typeof Y.then=="function")return Ft(H,_,vu(Y),le);if(Y.$$typeof===q)return Ft(H,_,hu(H,Y),le);yu(H,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,_!==null&&_.tag===6?(r(H,_.sibling),le=d(_,Y),le.return=H,H=le):(r(H,_),le=jd(Y,H.mode,le),le.return=H,H=le),b(H)):r(H,_)}return function(H,_,Y,le){try{_i=0;var He=Ft(H,_,Y,le);return Us=null,He}catch(Le){if(Le===zs||Le===pu)throw Le;var Dt=Aa(29,Le,null,H.mode);return Dt.lanes=le,Dt.return=H,Dt}finally{}}}var is=kp(!0),Op=kp(!1),ml=!1;function Hd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $d(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function pl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gl(e,n,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ot&2)!==0){var d=i.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),i.pending=n,n=uu(e),pp(e,null,r),n}return ou(e,i,n,r),uu(e)}function zi(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var i=n.lanes;i&=e.pendingLanes,r|=i,n.lanes=r,kn(e,r)}}function qd(e,n){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var d=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var b={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};h===null?d=h=b:h=h.next=b,r=r.next}while(r!==null);h===null?d=h=n:h=h.next=n}else d=h=n;r={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:i.shared,callbacks:i.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var Id=!1;function Ui(){if(Id){var e=Ls;if(e!==null)throw e}}function Bi(e,n,r,i){Id=!1;var d=e.updateQueue;ml=!1;var h=d.firstBaseUpdate,b=d.lastBaseUpdate,E=d.shared.pending;if(E!==null){d.shared.pending=null;var k=E,F=k.next;k.next=null,b===null?h=F:b.next=F,b=k;var J=e.alternate;J!==null&&(J=J.updateQueue,E=J.lastBaseUpdate,E!==b&&(E===null?J.firstBaseUpdate=F:E.next=F,J.lastBaseUpdate=k))}if(h!==null){var ie=d.baseState;b=0,J=F=k=null,E=h;do{var G=E.lane&-536870913,Q=G!==E.lane;if(Q?(xt&G)===G:(i&G)===G){G!==0&&G===_s&&(Id=!0),J!==null&&(J=J.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Oe=e,Ve=E;G=n;var Ft=r;switch(Ve.tag){case 1:if(Oe=Ve.payload,typeof Oe=="function"){ie=Oe.call(Ft,ie,G);break e}ie=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ve.payload,G=typeof Oe=="function"?Oe.call(Ft,ie,G):Oe,G==null)break e;ie=y({},ie,G);break e;case 2:ml=!0}}G=E.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=d.callbacks,Q===null?d.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:E.tag,payload:E.payload,callback:E.callback,next:null},J===null?(F=J=Q,k=ie):J=J.next=Q,b|=G;if(E=E.next,E===null){if(E=d.shared.pending,E===null)break;Q=E,E=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);J===null&&(k=ie),d.baseState=k,d.firstBaseUpdate=F,d.lastBaseUpdate=J,h===null&&(d.shared.lanes=0),Sl|=b,e.lanes=b,e.memoizedState=ie}}function Mp(e,n){if(typeof e!="function")throw Error(s(191,e));e.call(n)}function _p(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Mp(r[e],n)}var Bs=C(null),xu=C(0);function Lp(e,n){e=Wr,ne(xu,e),ne(Bs,n),Wr=e|n.baseLanes}function Vd(){ne(xu,Wr),ne(Bs,Bs.current)}function Yd(){Wr=xu.current,V(Bs),V(xu)}var Da=C(null),Pa=null;function vl(e){var n=e.alternate;ne(vn,vn.current&1),ne(Da,e),Pa===null&&(n===null||Bs.current!==null||n.memoizedState!==null)&&(Pa=e)}function Fd(e){ne(vn,vn.current),ne(Da,e),Pa===null&&(Pa=e)}function zp(e){e.tag===22?(ne(vn,vn.current),ne(Da,e),Pa===null&&(Pa=e)):yl()}function yl(){ne(vn,vn.current),ne(Da,Da.current)}function ka(e){V(Da),Pa===e&&(Pa=null),V(vn)}var vn=C(0);function bu(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Jf(r)||Wf(r)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Fr=0,st=null,Vt=null,Tn=null,Su=!1,Hs=!1,os=!1,wu=0,Hi=0,$s=null,m1=0;function dn(){throw Error(s(321))}function Pd(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Ca(e[r],n[r]))return!1;return!0}function Gd(e,n,r,i,d,h){return Fr=h,st=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,U.H=e===null||e.memoizedState===null?xg:uf,os=!1,h=r(i,d),os=!1,Hs&&(h=Bp(n,r,i,d)),Up(e),h}function Up(e){U.H=Ii;var n=Vt!==null&&Vt.next!==null;if(Fr=0,Tn=Vt=st=null,Su=!1,Hi=0,$s=null,n)throw Error(s(300));e===null||Cn||(e=e.dependencies,e!==null&&fu(e)&&(Cn=!0))}function Bp(e,n,r,i){st=e;var d=0;do{if(Hs&&($s=null),Hi=0,Hs=!1,25<=d)throw Error(s(301));if(d+=1,Tn=Vt=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}U.H=bg,h=n(r,i)}while(Hs);return h}function p1(){var e=U.H,n=e.useState()[0];return n=typeof n.then=="function"?$i(n):n,e=e.useState()[0],(Vt!==null?Vt.memoizedState:null)!==e&&(st.flags|=1024),n}function Xd(){var e=wu!==0;return wu=0,e}function Qd(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Kd(e){if(Su){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Su=!1}Fr=0,Tn=Vt=st=null,Hs=!1,Hi=wu=0,$s=null}function ha(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?st.memoizedState=Tn=e:Tn=Tn.next=e,Tn}function yn(){if(Vt===null){var e=st.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var n=Tn===null?st.memoizedState:Tn.next;if(n!==null)Tn=n,Vt=e;else{if(e===null)throw st.alternate===null?Error(s(467)):Error(s(310));Vt=e,e={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Tn===null?st.memoizedState=Tn=e:Tn=Tn.next=e}return Tn}function Eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $i(e){var n=Hi;return Hi+=1,$s===null&&($s=[]),e=Cp($s,e,n),n=st,(Tn===null?n.memoizedState:Tn.next)===null&&(n=n.alternate,U.H=n===null||n.memoizedState===null?xg:uf),e}function Nu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return $i(e);if(e.$$typeof===q)return Qn(e)}throw Error(s(438,String(e)))}function Zd(e){var n=null,r=st.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var i=st.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(n={data:i.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=Eu(),st.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),i=0;i<e;i++)r[i]=fe;return n.index++,r}function Pr(e,n){return typeof n=="function"?n(e):n}function Ru(e){var n=yn();return Jd(n,Vt,e)}function Jd(e,n,r){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=r;var d=e.baseQueue,h=i.pending;if(h!==null){if(d!==null){var b=d.next;d.next=h.next,h.next=b}n.baseQueue=d=h,i.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{n=d.next;var E=b=null,k=null,F=n,J=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(xt&ie)===ie:(Fr&ie)===ie){var G=F.revertLane;if(G===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ie===_s&&(J=!0);else if((Fr&G)===G){F=F.next,G===_s&&(J=!0);continue}else ie={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},k===null?(E=k=ie,b=h):k=k.next=ie,st.lanes|=G,Sl|=G;ie=F.action,os&&r(h,ie),h=F.hasEagerState?F.eagerState:r(h,ie)}else G={lane:ie,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},k===null?(E=k=G,b=h):k=k.next=G,st.lanes|=ie,Sl|=ie;F=F.next}while(F!==null&&F!==n);if(k===null?b=h:k.next=E,!Ca(h,e.memoizedState)&&(Cn=!0,J&&(r=Ls,r!==null)))throw r;e.memoizedState=h,e.baseState=b,e.baseQueue=k,i.lastRenderedState=h}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Wd(e){var n=yn(),r=n.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var i=r.dispatch,d=r.pending,h=n.memoizedState;if(d!==null){r.pending=null;var b=d=d.next;do h=e(h,b.action),b=b.next;while(b!==d);Ca(h,n.memoizedState)||(Cn=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,i]}function Hp(e,n,r){var i=st,d=yn(),h=wt;if(h){if(r===void 0)throw Error(s(407));r=r()}else r=n();var b=!Ca((Vt||d).memoizedState,r);if(b&&(d.memoizedState=r,Cn=!0),d=d.queue,nf(Ip.bind(null,i,d,e),[e]),d.getSnapshot!==n||b||Tn!==null&&Tn.memoizedState.tag&1){if(i.flags|=2048,qs(9,{destroy:void 0},qp.bind(null,i,d,r,n),null),en===null)throw Error(s(349));h||(Fr&127)!==0||$p(i,n,r)}return r}function $p(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=st.updateQueue,n===null?(n=Eu(),st.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function qp(e,n,r,i){n.value=r,n.getSnapshot=i,Vp(n)&&Yp(e)}function Ip(e,n,r){return r(function(){Vp(n)&&Yp(e)})}function Vp(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Ca(e,r)}catch{return!0}}function Yp(e){var n=Wl(e,2);n!==null&&Na(n,e,2)}function ef(e){var n=ha();if(typeof e=="function"){var r=e;if(e=r(),os){Tt(!0);try{r()}finally{Tt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:e},n}function Fp(e,n,r,i){return e.baseState=r,Jd(e,Vt,typeof i=="function"?i:Pr)}function g1(e,n,r,i,d){if(Cu(e))throw Error(s(485));if(e=n.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){h.listeners.push(b)}};U.T!==null?r(!0):h.isTransition=!1,i(h),r=n.pending,r===null?(h.next=n.pending=h,Pp(n,h)):(h.next=r.next,n.pending=r.next=h)}}function Pp(e,n){var r=n.action,i=n.payload,d=e.state;if(n.isTransition){var h=U.T,b={};U.T=b;try{var E=r(d,i),k=U.S;k!==null&&k(b,E),Gp(e,n,E)}catch(F){tf(e,n,F)}finally{h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}else try{h=r(d,i),Gp(e,n,h)}catch(F){tf(e,n,F)}}function Gp(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){Xp(e,n,i)},function(i){return tf(e,n,i)}):Xp(e,n,r)}function Xp(e,n,r){n.status="fulfilled",n.value=r,Qp(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Pp(e,r)))}function tf(e,n,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do n.status="rejected",n.reason=r,Qp(n),n=n.next;while(n!==i)}e.action=null}function Qp(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Kp(e,n){return n}function Zp(e,n){if(wt){var r=en.formState;if(r!==null){e:{var i=st;if(wt){if(rn){t:{for(var d=rn,h=Fa;d.nodeType!==8;){if(!h){d=null;break t}if(d=Ga(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){rn=Ga(d.nextSibling),i=d.data==="F!";break e}}fl(i)}i=!1}i&&(n=r[0])}}return r=ha(),r.memoizedState=r.baseState=n,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kp,lastRenderedState:n},r.queue=i,r=gg.bind(null,st,i),i.dispatch=r,i=ef(!1),h=of.bind(null,st,!1,i.queue),i=ha(),d={state:n,dispatch:null,action:e,pending:null},i.queue=d,r=g1.bind(null,st,d,h,r),d.dispatch=r,i.memoizedState=e,[n,r,!1]}function Jp(e){var n=yn();return Wp(n,Vt,e)}function Wp(e,n,r){if(n=Jd(e,n,Kp)[0],e=Ru(Pr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=$i(n)}catch(b){throw b===zs?pu:b}else i=n;n=yn();var d=n.queue,h=d.dispatch;return r!==n.memoizedState&&(st.flags|=2048,qs(9,{destroy:void 0},v1.bind(null,d,r),null)),[i,h,e]}function v1(e,n){e.action=n}function eg(e){var n=yn(),r=Vt;if(r!==null)return Wp(n,r,e);yn(),n=n.memoizedState,r=yn();var i=r.queue.dispatch;return r.memoizedState=e,[n,i,!1]}function qs(e,n,r,i){return e={tag:e,create:r,deps:i,inst:n,next:null},n=st.updateQueue,n===null&&(n=Eu(),st.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,n.lastEffect=e),e}function tg(){return yn().memoizedState}function ju(e,n,r,i){var d=ha();st.flags|=e,d.memoizedState=qs(1|n,{destroy:void 0},r,i===void 0?null:i)}function Tu(e,n,r,i){var d=yn();i=i===void 0?null:i;var h=d.memoizedState.inst;Vt!==null&&i!==null&&Pd(i,Vt.memoizedState.deps)?d.memoizedState=qs(n,h,r,i):(st.flags|=e,d.memoizedState=qs(1|n,h,r,i))}function ng(e,n){ju(8390656,8,e,n)}function nf(e,n){Tu(2048,8,e,n)}function y1(e){st.flags|=4;var n=st.updateQueue;if(n===null)n=Eu(),st.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function ag(e){var n=yn().memoizedState;return y1({ref:n,nextImpl:e}),function(){if((Ot&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function rg(e,n){return Tu(4,2,e,n)}function lg(e,n){return Tu(4,4,e,n)}function sg(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function ig(e,n,r){r=r!=null?r.concat([e]):null,Tu(4,4,sg.bind(null,n,e),r)}function af(){}function og(e,n){var r=yn();n=n===void 0?null:n;var i=r.memoizedState;return n!==null&&Pd(n,i[1])?i[0]:(r.memoizedState=[e,n],e)}function ug(e,n){var r=yn();n=n===void 0?null:n;var i=r.memoizedState;if(n!==null&&Pd(n,i[1]))return i[0];if(i=e(),os){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[i,n],i}function rf(e,n,r){return r===void 0||(Fr&1073741824)!==0&&(xt&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=cv(),st.lanes|=e,Sl|=e,r)}function cg(e,n,r,i){return Ca(r,n)?r:Bs.current!==null?(e=rf(e,r,i),Ca(e,n)||(Cn=!0),e):(Fr&42)===0||(Fr&1073741824)!==0&&(xt&261930)===0?(Cn=!0,e.memoizedState=r):(e=cv(),st.lanes|=e,Sl|=e,n)}function dg(e,n,r,i,d){var h=B.p;B.p=h!==0&&8>h?h:8;var b=U.T,E={};U.T=E,of(e,!1,n,r);try{var k=d(),F=U.S;if(F!==null&&F(E,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var J=h1(k,i);qi(e,n,J,_a(e))}else qi(e,n,i,_a(e))}catch(ie){qi(e,n,{then:function(){},status:"rejected",reason:ie},_a())}finally{B.p=h,b!==null&&E.types!==null&&(b.types=E.types),U.T=b}}function x1(){}function lf(e,n,r,i){if(e.tag!==5)throw Error(s(476));var d=fg(e).queue;dg(e,d,n,ue,r===null?x1:function(){return hg(e),r(i)})}function fg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:ue},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function hg(e){var n=fg(e);n.next===null&&(n=e.alternate.memoizedState),qi(e,n.next.queue,{},_a())}function sf(){return Qn(ro)}function mg(){return yn().memoizedState}function pg(){return yn().memoizedState}function b1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=_a();e=pl(r);var i=gl(n,e,r);i!==null&&(Na(i,n,r),zi(i,n,r)),n={cache:Ld()},e.payload=n;return}n=n.return}}function S1(e,n,r){var i=_a();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Cu(e)?vg(n,r):(r=Nd(e,n,r,i),r!==null&&(Na(r,e,i),yg(r,n,i)))}function gg(e,n,r){var i=_a();qi(e,n,r,i)}function qi(e,n,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Cu(e))vg(n,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var b=n.lastRenderedState,E=h(b,r);if(d.hasEagerState=!0,d.eagerState=E,Ca(E,b))return ou(e,n,d,0),en===null&&iu(),!1}catch{}finally{}if(r=Nd(e,n,d,i),r!==null)return Na(r,e,i),yg(r,n,i),!0}return!1}function of(e,n,r,i){if(i={lane:2,revertLane:$f(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Cu(e)){if(n)throw Error(s(479))}else n=Nd(e,r,i,2),n!==null&&Na(n,e,2)}function Cu(e){var n=e.alternate;return e===st||n!==null&&n===st}function vg(e,n){Hs=Su=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function yg(e,n,r){if((r&4194048)!==0){var i=n.lanes;i&=e.pendingLanes,r|=i,n.lanes=r,kn(e,r)}}var Ii={readContext:Qn,use:Nu,useCallback:dn,useContext:dn,useEffect:dn,useImperativeHandle:dn,useLayoutEffect:dn,useInsertionEffect:dn,useMemo:dn,useReducer:dn,useRef:dn,useState:dn,useDebugValue:dn,useDeferredValue:dn,useTransition:dn,useSyncExternalStore:dn,useId:dn,useHostTransitionStatus:dn,useFormState:dn,useActionState:dn,useOptimistic:dn,useMemoCache:dn,useCacheRefresh:dn};Ii.useEffectEvent=dn;var xg={readContext:Qn,use:Nu,useCallback:function(e,n){return ha().memoizedState=[e,n===void 0?null:n],e},useContext:Qn,useEffect:ng,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,ju(4194308,4,sg.bind(null,n,e),r)},useLayoutEffect:function(e,n){return ju(4194308,4,e,n)},useInsertionEffect:function(e,n){ju(4,2,e,n)},useMemo:function(e,n){var r=ha();n=n===void 0?null:n;var i=e();if(os){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[i,n],i},useReducer:function(e,n,r){var i=ha();if(r!==void 0){var d=r(n);if(os){Tt(!0);try{r(n)}finally{Tt(!1)}}}else d=n;return i.memoizedState=i.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},i.queue=e,e=e.dispatch=S1.bind(null,st,e),[i.memoizedState,e]},useRef:function(e){var n=ha();return e={current:e},n.memoizedState=e},useState:function(e){e=ef(e);var n=e.queue,r=gg.bind(null,st,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:af,useDeferredValue:function(e,n){var r=ha();return rf(r,e,n)},useTransition:function(){var e=ef(!1);return e=dg.bind(null,st,e.queue,!0,!1),ha().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var i=st,d=ha();if(wt){if(r===void 0)throw Error(s(407));r=r()}else{if(r=n(),en===null)throw Error(s(349));(xt&127)!==0||$p(i,n,r)}d.memoizedState=r;var h={value:r,getSnapshot:n};return d.queue=h,ng(Ip.bind(null,i,h,e),[e]),i.flags|=2048,qs(9,{destroy:void 0},qp.bind(null,i,h,r,n),null),r},useId:function(){var e=ha(),n=en.identifierPrefix;if(wt){var r=Sr,i=br;r=(i&~(1<<32-Kt(i)-1)).toString(32)+r,n="_"+n+"R_"+r,r=wu++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=m1++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:sf,useFormState:Zp,useActionState:Zp,useOptimistic:function(e){var n=ha();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=of.bind(null,st,!0,r),r.dispatch=n,[e,n]},useMemoCache:Zd,useCacheRefresh:function(){return ha().memoizedState=b1.bind(null,st)},useEffectEvent:function(e){var n=ha(),r={impl:e};return n.memoizedState=r,function(){if((Ot&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},uf={readContext:Qn,use:Nu,useCallback:og,useContext:Qn,useEffect:nf,useImperativeHandle:ig,useInsertionEffect:rg,useLayoutEffect:lg,useMemo:ug,useReducer:Ru,useRef:tg,useState:function(){return Ru(Pr)},useDebugValue:af,useDeferredValue:function(e,n){var r=yn();return cg(r,Vt.memoizedState,e,n)},useTransition:function(){var e=Ru(Pr)[0],n=yn().memoizedState;return[typeof e=="boolean"?e:$i(e),n]},useSyncExternalStore:Hp,useId:mg,useHostTransitionStatus:sf,useFormState:Jp,useActionState:Jp,useOptimistic:function(e,n){var r=yn();return Fp(r,Vt,e,n)},useMemoCache:Zd,useCacheRefresh:pg};uf.useEffectEvent=ag;var bg={readContext:Qn,use:Nu,useCallback:og,useContext:Qn,useEffect:nf,useImperativeHandle:ig,useInsertionEffect:rg,useLayoutEffect:lg,useMemo:ug,useReducer:Wd,useRef:tg,useState:function(){return Wd(Pr)},useDebugValue:af,useDeferredValue:function(e,n){var r=yn();return Vt===null?rf(r,e,n):cg(r,Vt.memoizedState,e,n)},useTransition:function(){var e=Wd(Pr)[0],n=yn().memoizedState;return[typeof e=="boolean"?e:$i(e),n]},useSyncExternalStore:Hp,useId:mg,useHostTransitionStatus:sf,useFormState:eg,useActionState:eg,useOptimistic:function(e,n){var r=yn();return Vt!==null?Fp(r,Vt,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Zd,useCacheRefresh:pg};bg.useEffectEvent=ag;function cf(e,n,r,i){n=e.memoizedState,r=r(i,n),r=r==null?n:y({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var df={enqueueSetState:function(e,n,r){e=e._reactInternals;var i=_a(),d=pl(i);d.payload=n,r!=null&&(d.callback=r),n=gl(e,d,i),n!==null&&(Na(n,e,i),zi(n,e,i))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var i=_a(),d=pl(i);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=gl(e,d,i),n!==null&&(Na(n,e,i),zi(n,e,i))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=_a(),i=pl(r);i.tag=2,n!=null&&(i.callback=n),n=gl(e,i,r),n!==null&&(Na(n,e,r),zi(n,e,r))}};function Sg(e,n,r,i,d,h,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,b):n.prototype&&n.prototype.isPureReactComponent?!Ci(r,i)||!Ci(d,h):!0}function wg(e,n,r,i){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,i),n.state!==e&&df.enqueueReplaceState(n,n.state,null)}function us(e,n){var r=n;if("ref"in n){r={};for(var i in n)i!=="ref"&&(r[i]=n[i])}if(e=e.defaultProps){r===n&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function Eg(e){su(e)}function Ng(e){console.error(e)}function Rg(e){su(e)}function Au(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(i){setTimeout(function(){throw i})}}function jg(e,n,r){try{var i=e.onCaughtError;i(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function ff(e,n,r){return r=pl(r),r.tag=3,r.payload={element:null},r.callback=function(){Au(e,n)},r}function Tg(e){return e=pl(e),e.tag=3,e}function Cg(e,n,r,i){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var h=i.value;e.payload=function(){return d(h)},e.callback=function(){jg(n,r,i)}}var b=r.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){jg(n,r,i),typeof d!="function"&&(wl===null?wl=new Set([this]):wl.add(this));var E=i.stack;this.componentDidCatch(i.value,{componentStack:E!==null?E:""})})}function w1(e,n,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=r.alternate,n!==null&&Ms(n,r,d,!0),r=Da.current,r!==null){switch(r.tag){case 31:case 13:return Pa===null?qu():r.alternate===null&&fn===0&&(fn=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===gu?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([i]):n.add(i),Uf(e,i,d)),!1;case 22:return r.flags|=65536,i===gu?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([i]):r.add(i)),Uf(e,i,d)),!1}throw Error(s(435,r.tag))}return Uf(e,i,d),qu(),!1}if(wt)return n=Da.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,i!==Dd&&(e=Error(s(422),{cause:i}),ki(Ia(e,r)))):(i!==Dd&&(n=Error(s(423),{cause:i}),ki(Ia(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=Ia(i,r),d=ff(e.stateNode,i,d),qd(e,d),fn!==4&&(fn=2)),!1;var h=Error(s(520),{cause:i});if(h=Ia(h,r),Ki===null?Ki=[h]:Ki.push(h),fn!==4&&(fn=2),n===null)return!0;i=Ia(i,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=ff(r.stateNode,i,e),qd(r,e),!1;case 1:if(n=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(wl===null||!wl.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Tg(d),Cg(d,e,r,i),qd(r,d),!1}r=r.return}while(r!==null);return!1}var hf=Error(s(461)),Cn=!1;function Kn(e,n,r,i){n.child=e===null?Op(n,null,r,i):is(n,e.child,r,i)}function Ag(e,n,r,i,d){r=r.render;var h=n.ref;if("ref"in i){var b={};for(var E in i)E!=="ref"&&(b[E]=i[E])}else b=i;return as(n),i=Gd(e,n,r,b,h,d),E=Xd(),e!==null&&!Cn?(Qd(e,n,d),Gr(e,n,d)):(wt&&E&&Cd(n),n.flags|=1,Kn(e,n,i,d),n.child)}function Dg(e,n,r,i,d){if(e===null){var h=r.type;return typeof h=="function"&&!Rd(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,kg(e,n,h,i,d)):(e=cu(r.type,null,i,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!Sf(e,d)){var b=h.memoizedProps;if(r=r.compare,r=r!==null?r:Ci,r(b,i)&&e.ref===n.ref)return Gr(e,n,d)}return n.flags|=1,e=qr(h,i),e.ref=n.ref,e.return=n,n.child=e}function kg(e,n,r,i,d){if(e!==null){var h=e.memoizedProps;if(Ci(h,i)&&e.ref===n.ref)if(Cn=!1,n.pendingProps=i=h,Sf(e,d))(e.flags&131072)!==0&&(Cn=!0);else return n.lanes=e.lanes,Gr(e,n,d)}return mf(e,n,r,i,d)}function Og(e,n,r,i){var d=i.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|r:r,e!==null){for(i=n.child=e.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~h}else i=0,n.child=null;return Mg(e,n,h,r,i)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&mu(n,h!==null?h.cachePool:null),h!==null?Lp(n,h):Vd(),zp(n);else return i=n.lanes=536870912,Mg(e,n,h!==null?h.baseLanes|r:r,r,i)}else h!==null?(mu(n,h.cachePool),Lp(n,h),yl(),n.memoizedState=null):(e!==null&&mu(n,null),Vd(),yl());return Kn(e,n,d,r),n.child}function Vi(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Mg(e,n,r,i,d){var h=Ud();return h=h===null?null:{parent:jn._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&mu(n,null),Vd(),zp(n),e!==null&&Ms(e,n,i,!0),n.childLanes=d,null}function Du(e,n){return n=Ou({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function _g(e,n,r){return is(n,e.child,null,r),e=Du(n,n.pendingProps),e.flags|=2,ka(n),n.memoizedState=null,e}function E1(e,n,r){var i=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(wt){if(i.mode==="hidden")return e=Du(n,i),n.lanes=536870912,Vi(null,e);if(Fd(n),(e=rn)?(e=Pv(e,Fa),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:cl!==null?{id:br,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},r=vp(e),r.return=n,n.child=r,Xn=n,rn=null)):e=null,e===null)throw fl(n);return n.lanes=536870912,null}return Du(n,i)}var h=e.memoizedState;if(h!==null){var b=h.dehydrated;if(Fd(n),d)if(n.flags&256)n.flags&=-257,n=_g(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(s(558));else if(Cn||Ms(e,n,r,!1),d=(r&e.childLanes)!==0,Cn||d){if(i=en,i!==null&&(b=D(i,r),b!==0&&b!==h.retryLane))throw h.retryLane=b,Wl(e,b),Na(i,e,b),hf;qu(),n=_g(e,n,r)}else e=h.treeContext,rn=Ga(b.nextSibling),Xn=n,wt=!0,dl=null,Fa=!1,e!==null&&bp(n,e),n=Du(n,i),n.flags|=4096;return n}return e=qr(e.child,{mode:i.mode,children:i.children}),e.ref=n.ref,n.child=e,e.return=n,e}function ku(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function mf(e,n,r,i,d){return as(n),r=Gd(e,n,r,i,void 0,d),i=Xd(),e!==null&&!Cn?(Qd(e,n,d),Gr(e,n,d)):(wt&&i&&Cd(n),n.flags|=1,Kn(e,n,r,d),n.child)}function Lg(e,n,r,i,d,h){return as(n),n.updateQueue=null,r=Bp(n,i,r,d),Up(e),i=Xd(),e!==null&&!Cn?(Qd(e,n,h),Gr(e,n,h)):(wt&&i&&Cd(n),n.flags|=1,Kn(e,n,r,h),n.child)}function zg(e,n,r,i,d){if(as(n),n.stateNode===null){var h=As,b=r.contextType;typeof b=="object"&&b!==null&&(h=Qn(b)),h=new r(i,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=df,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=i,h.state=n.memoizedState,h.refs={},Hd(n),b=r.contextType,h.context=typeof b=="object"&&b!==null?Qn(b):As,h.state=n.memoizedState,b=r.getDerivedStateFromProps,typeof b=="function"&&(cf(n,r,b,i),h.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&df.enqueueReplaceState(h,h.state,null),Bi(n,i,h,d),Ui(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(e===null){h=n.stateNode;var E=n.memoizedProps,k=us(r,E);h.props=k;var F=h.context,J=r.contextType;b=As,typeof J=="object"&&J!==null&&(b=Qn(J));var ie=r.getDerivedStateFromProps;J=typeof ie=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,J||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||F!==b)&&wg(n,h,i,b),ml=!1;var G=n.memoizedState;h.state=G,Bi(n,i,h,d),Ui(),F=n.memoizedState,E||G!==F||ml?(typeof ie=="function"&&(cf(n,r,ie,i),F=n.memoizedState),(k=ml||Sg(n,r,k,i,G,F,b))?(J||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=i,n.memoizedState=F),h.props=i,h.state=F,h.context=b,i=k):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{h=n.stateNode,$d(e,n),b=n.memoizedProps,J=us(r,b),h.props=J,ie=n.pendingProps,G=h.context,F=r.contextType,k=As,typeof F=="object"&&F!==null&&(k=Qn(F)),E=r.getDerivedStateFromProps,(F=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==ie||G!==k)&&wg(n,h,i,k),ml=!1,G=n.memoizedState,h.state=G,Bi(n,i,h,d),Ui();var Q=n.memoizedState;b!==ie||G!==Q||ml||e!==null&&e.dependencies!==null&&fu(e.dependencies)?(typeof E=="function"&&(cf(n,r,E,i),Q=n.memoizedState),(J=ml||Sg(n,r,J,i,G,Q,k)||e!==null&&e.dependencies!==null&&fu(e.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,Q,k),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,Q,k)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=Q),h.props=i,h.state=Q,h.context=k,i=J):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(n.flags|=1024),i=!1)}return h=i,ku(e,n),i=(n.flags&128)!==0,h||i?(h=n.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&i?(n.child=is(n,e.child,null,d),n.child=is(n,null,r,d)):Kn(e,n,r,d),n.memoizedState=h.state,e=n.child):e=Gr(e,n,d),e}function Ug(e,n,r,i){return ts(),n.flags|=256,Kn(e,n,r,i),n.child}var pf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gf(e){return{baseLanes:e,cachePool:jp()}}function vf(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=Ma),e}function Bg(e,n,r){var i=n.pendingProps,d=!1,h=(n.flags&128)!==0,b;if((b=h)||(b=e!==null&&e.memoizedState===null?!1:(vn.current&2)!==0),b&&(d=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(wt){if(d?vl(n):yl(),(e=rn)?(e=Pv(e,Fa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:cl!==null?{id:br,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},r=vp(e),r.return=n,n.child=r,Xn=n,rn=null)):e=null,e===null)throw fl(n);return Wf(e)?n.lanes=32:n.lanes=536870912,null}var E=i.children;return i=i.fallback,d?(yl(),d=n.mode,E=Ou({mode:"hidden",children:E},d),i=es(i,d,r,null),E.return=n,i.return=n,E.sibling=i,n.child=E,i=n.child,i.memoizedState=gf(r),i.childLanes=vf(e,b,r),n.memoizedState=pf,Vi(null,i)):(vl(n),yf(n,E))}var k=e.memoizedState;if(k!==null&&(E=k.dehydrated,E!==null)){if(h)n.flags&256?(vl(n),n.flags&=-257,n=xf(e,n,r)):n.memoizedState!==null?(yl(),n.child=e.child,n.flags|=128,n=null):(yl(),E=i.fallback,d=n.mode,i=Ou({mode:"visible",children:i.children},d),E=es(E,d,r,null),E.flags|=2,i.return=n,E.return=n,i.sibling=E,n.child=i,is(n,e.child,null,r),i=n.child,i.memoizedState=gf(r),i.childLanes=vf(e,b,r),n.memoizedState=pf,n=Vi(null,i));else if(vl(n),Wf(E)){if(b=E.nextSibling&&E.nextSibling.dataset,b)var F=b.dgst;b=F,i=Error(s(419)),i.stack="",i.digest=b,ki({value:i,source:null,stack:null}),n=xf(e,n,r)}else if(Cn||Ms(e,n,r,!1),b=(r&e.childLanes)!==0,Cn||b){if(b=en,b!==null&&(i=D(b,r),i!==0&&i!==k.retryLane))throw k.retryLane=i,Wl(e,i),Na(b,e,i),hf;Jf(E)||qu(),n=xf(e,n,r)}else Jf(E)?(n.flags|=192,n.child=e.child,n=null):(e=k.treeContext,rn=Ga(E.nextSibling),Xn=n,wt=!0,dl=null,Fa=!1,e!==null&&bp(n,e),n=yf(n,i.children),n.flags|=4096);return n}return d?(yl(),E=i.fallback,d=n.mode,k=e.child,F=k.sibling,i=qr(k,{mode:"hidden",children:i.children}),i.subtreeFlags=k.subtreeFlags&65011712,F!==null?E=qr(F,E):(E=es(E,d,r,null),E.flags|=2),E.return=n,i.return=n,i.sibling=E,n.child=i,Vi(null,i),i=n.child,E=e.child.memoizedState,E===null?E=gf(r):(d=E.cachePool,d!==null?(k=jn._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=jp(),E={baseLanes:E.baseLanes|r,cachePool:d}),i.memoizedState=E,i.childLanes=vf(e,b,r),n.memoizedState=pf,Vi(e.child,i)):(vl(n),r=e.child,e=r.sibling,r=qr(r,{mode:"visible",children:i.children}),r.return=n,r.sibling=null,e!==null&&(b=n.deletions,b===null?(n.deletions=[e],n.flags|=16):b.push(e)),n.child=r,n.memoizedState=null,r)}function yf(e,n){return n=Ou({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Ou(e,n){return e=Aa(22,e,null,n),e.lanes=0,e}function xf(e,n,r){return is(n,e.child,null,r),e=yf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Hg(e,n,r){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n),Md(e.return,n,r)}function bf(e,n,r,i,d,h){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:h}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=i,b.tail=r,b.tailMode=d,b.treeForkCount=h)}function $g(e,n,r){var i=n.pendingProps,d=i.revealOrder,h=i.tail;i=i.children;var b=vn.current,E=(b&2)!==0;if(E?(b=b&1|2,n.flags|=128):b&=1,ne(vn,b),Kn(e,n,i,r),i=wt?Di:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hg(e,r,n);else if(e.tag===19)Hg(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=n.child,d=null;r!==null;)e=r.alternate,e!==null&&bu(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),bf(n,!1,d,r,h,i);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&bu(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}bf(n,!0,r,null,h,i);break;case"together":bf(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function Gr(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),Sl|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Ms(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,r=qr(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=qr(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function Sf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&fu(e)))}function N1(e,n,r){switch(n.tag){case 3:ut(n,n.stateNode.containerInfo),hl(n,jn,e.memoizedState.cache),ts();break;case 27:case 5:nt(n);break;case 4:ut(n,n.stateNode.containerInfo);break;case 10:hl(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Fd(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(vl(n),n.flags|=128,null):(r&n.child.childLanes)!==0?Bg(e,n,r):(vl(n),e=Gr(e,n,r),e!==null?e.sibling:null);vl(n);break;case 19:var d=(e.flags&128)!==0;if(i=(r&n.childLanes)!==0,i||(Ms(e,n,r,!1),i=(r&n.childLanes)!==0),d){if(i)return $g(e,n,r);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ne(vn,vn.current),i)break;return null;case 22:return n.lanes=0,Og(e,n,r,n.pendingProps);case 24:hl(n,jn,e.memoizedState.cache)}return Gr(e,n,r)}function qg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)Cn=!0;else{if(!Sf(e,r)&&(n.flags&128)===0)return Cn=!1,N1(e,n,r);Cn=(e.flags&131072)!==0}else Cn=!1,wt&&(n.flags&1048576)!==0&&xp(n,Di,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(e=ls(n.elementType),n.type=e,typeof e=="function")Rd(e)?(i=us(e,i),n.tag=1,n=zg(null,n,e,i,r)):(n.tag=0,n=mf(null,n,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===X){n.tag=11,n=Ag(null,n,e,i,r);break e}else if(d===z){n.tag=14,n=Dg(null,n,e,i,r);break e}}throw n=re(e)||e,Error(s(306,n,""))}}return n;case 0:return mf(e,n,n.type,n.pendingProps,r);case 1:return i=n.type,d=us(i,n.pendingProps),zg(e,n,i,d,r);case 3:e:{if(ut(n,n.stateNode.containerInfo),e===null)throw Error(s(387));i=n.pendingProps;var h=n.memoizedState;d=h.element,$d(e,n),Bi(n,i,null,r);var b=n.memoizedState;if(i=b.cache,hl(n,jn,i),i!==h.cache&&_d(n,[jn],r,!0),Ui(),i=b.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Ug(e,n,i,r);break e}else if(i!==d){d=Ia(Error(s(424)),n),ki(d),n=Ug(e,n,i,r);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(rn=Ga(e.firstChild),Xn=n,wt=!0,dl=null,Fa=!0,r=Op(n,null,i,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ts(),i===d){n=Gr(e,n,r);break e}Kn(e,n,i,r)}n=n.child}return n;case 26:return ku(e,n),e===null?(r=Jv(n.type,null,n.pendingProps,null))?n.memoizedState=r:wt||(r=n.type,e=n.pendingProps,i=Xu(je.current).createElement(r),i[ve]=n,i[De]=e,Zn(i,r,e),dt(i),n.stateNode=i):n.memoizedState=Jv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return nt(n),e===null&&wt&&(i=n.stateNode=Qv(n.type,n.pendingProps,je.current),Xn=n,Fa=!0,d=rn,jl(n.type)?(eh=d,rn=Ga(i.firstChild)):rn=d),Kn(e,n,n.pendingProps.children,r),ku(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&wt&&((d=i=rn)&&(i=eS(i,n.type,n.pendingProps,Fa),i!==null?(n.stateNode=i,Xn=n,rn=Ga(i.firstChild),Fa=!1,d=!0):d=!1),d||fl(n)),nt(n),d=n.type,h=n.pendingProps,b=e!==null?e.memoizedProps:null,i=h.children,Qf(d,h)?i=null:b!==null&&Qf(d,b)&&(n.flags|=32),n.memoizedState!==null&&(d=Gd(e,n,p1,null,null,r),ro._currentValue=d),ku(e,n),Kn(e,n,i,r),n.child;case 6:return e===null&&wt&&((e=r=rn)&&(r=tS(r,n.pendingProps,Fa),r!==null?(n.stateNode=r,Xn=n,rn=null,e=!0):e=!1),e||fl(n)),null;case 13:return Bg(e,n,r);case 4:return ut(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=is(n,null,i,r):Kn(e,n,i,r),n.child;case 11:return Ag(e,n,n.type,n.pendingProps,r);case 7:return Kn(e,n,n.pendingProps,r),n.child;case 8:return Kn(e,n,n.pendingProps.children,r),n.child;case 12:return Kn(e,n,n.pendingProps.children,r),n.child;case 10:return i=n.pendingProps,hl(n,n.type,i.value),Kn(e,n,i.children,r),n.child;case 9:return d=n.type._context,i=n.pendingProps.children,as(n),d=Qn(d),i=i(d),n.flags|=1,Kn(e,n,i,r),n.child;case 14:return Dg(e,n,n.type,n.pendingProps,r);case 15:return kg(e,n,n.type,n.pendingProps,r);case 19:return $g(e,n,r);case 31:return E1(e,n,r);case 22:return Og(e,n,r,n.pendingProps);case 24:return as(n),i=Qn(jn),e===null?(d=Ud(),d===null&&(d=en,h=Ld(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),n.memoizedState={parent:i,cache:d},Hd(n),hl(n,jn,d)):((e.lanes&r)!==0&&($d(e,n),Bi(n,null,null,r),Ui()),d=e.memoizedState,h=n.memoizedState,d.parent!==i?(d={parent:i,cache:i},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),hl(n,jn,i)):(i=h.cache,hl(n,jn,i),i!==d.cache&&_d(n,[jn],r,!0))),Kn(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function Xr(e){e.flags|=4}function wf(e,n,r,i,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(mv())e.flags|=8192;else throw ss=gu,Bd}else e.flags&=-16777217}function Ig(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ay(n))if(mv())e.flags|=8192;else throw ss=gu,Bd}function Mu(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Zt():536870912,e.lanes|=n,Fs|=n)}function Yi(e,n){if(!wt)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function ln(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(n)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=r,n}function R1(e,n,r){var i=n.pendingProps;switch(Ad(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(n),null;case 1:return ln(n),null;case 3:return r=n.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Yr(jn),Ge(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Os(n)?Xr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,kd())),ln(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(Xr(n),h!==null?(ln(n),Ig(n,h)):(ln(n),wf(n,d,null,i,r))):h?h!==e.memoizedState?(Xr(n),ln(n),Ig(n,h)):(ln(n),n.flags&=-16777217):(e=e.memoizedProps,e!==i&&Xr(n),ln(n),wf(n,d,e,i,r)),null;case 27:if(Sn(n),r=je.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Xr(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return ln(n),null}e=me.current,Os(n)?Sp(n):(e=Qv(d,i,r),n.stateNode=e,Xr(n))}return ln(n),null;case 5:if(Sn(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Xr(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return ln(n),null}if(h=me.current,Os(n))Sp(n);else{var b=Xu(je.current);switch(h){case 1:h=b.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=b.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=b.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?h.multiple=!0:i.size&&(h.size=i.size);break;default:h=typeof i.is=="string"?b.createElement(d,{is:i.is}):b.createElement(d)}}h[ve]=n,h[De]=i;e:for(b=n.child;b!==null;){if(b.tag===5||b.tag===6)h.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=h;e:switch(Zn(h,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Xr(n)}}return ln(n),wf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==i&&Xr(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(s(166));if(e=je.current,Os(n)){if(e=n.stateNode,r=n.memoizedProps,i=null,d=Xn,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[ve]=n,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||Bv(e.nodeValue,r)),e||fl(n,!0)}else e=Xu(e).createTextNode(i),e[ve]=n,n.stateNode=e}return ln(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(i=Os(n),r!==null){if(e===null){if(!i)throw Error(s(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[ve]=n}else ts(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ln(n),e=!1}else r=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(ka(n),n):(ka(n),null);if((n.flags&128)!==0)throw Error(s(558))}return ln(n),null;case 13:if(i=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Os(n),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(s(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[ve]=n}else ts(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ln(n),d=!1}else d=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(ka(n),n):(ka(n),null)}return ka(n),(n.flags&128)!==0?(n.lanes=r,n):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=n.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==d&&(i.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),Mu(n,n.updateQueue),ln(n),null);case 4:return Ge(),e===null&&Yf(n.stateNode.containerInfo),ln(n),null;case 10:return Yr(n.type),ln(n),null;case 19:if(V(vn),i=n.memoizedState,i===null)return ln(n),null;if(d=(n.flags&128)!==0,h=i.rendering,h===null)if(d)Yi(i,!1);else{if(fn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=bu(e),h!==null){for(n.flags|=128,Yi(i,!1),e=h.updateQueue,n.updateQueue=e,Mu(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)gp(r,e),r=r.sibling;return ne(vn,vn.current&1|2),wt&&Ir(n,i.treeForkCount),n.child}e=e.sibling}i.tail!==null&&tn()>Bu&&(n.flags|=128,d=!0,Yi(i,!1),n.lanes=4194304)}else{if(!d)if(e=bu(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Mu(n,e),Yi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!h.alternate&&!wt)return ln(n),null}else 2*tn()-i.renderingStartTime>Bu&&r!==536870912&&(n.flags|=128,d=!0,Yi(i,!1),n.lanes=4194304);i.isBackwards?(h.sibling=n.child,n.child=h):(e=i.last,e!==null?e.sibling=h:n.child=h,i.last=h)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=tn(),e.sibling=null,r=vn.current,ne(vn,d?r&1|2:r&1),wt&&Ir(n,i.treeForkCount),e):(ln(n),null);case 22:case 23:return ka(n),Yd(),i=n.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(n.flags|=8192):i&&(n.flags|=8192),i?(r&536870912)!==0&&(n.flags&128)===0&&(ln(n),n.subtreeFlags&6&&(n.flags|=8192)):ln(n),r=n.updateQueue,r!==null&&Mu(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==r&&(n.flags|=2048),e!==null&&V(rs),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Yr(jn),ln(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function j1(e,n){switch(Ad(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Yr(jn),Ge(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Sn(n),null;case 31:if(n.memoizedState!==null){if(ka(n),n.alternate===null)throw Error(s(340));ts()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(ka(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));ts()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return V(vn),null;case 4:return Ge(),null;case 10:return Yr(n.type),null;case 22:case 23:return ka(n),Yd(),e!==null&&V(rs),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Yr(jn),null;case 25:return null;default:return null}}function Vg(e,n){switch(Ad(n),n.tag){case 3:Yr(jn),Ge();break;case 26:case 27:case 5:Sn(n);break;case 4:Ge();break;case 31:n.memoizedState!==null&&ka(n);break;case 13:ka(n);break;case 19:V(vn);break;case 10:Yr(n.type);break;case 22:case 23:ka(n),Yd(),e!==null&&V(rs);break;case 24:Yr(jn)}}function Fi(e,n){try{var r=n.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var d=i.next;r=d;do{if((r.tag&e)===e){i=void 0;var h=r.create,b=r.inst;i=h(),b.destroy=i}r=r.next}while(r!==d)}}catch(E){It(n,n.return,E)}}function xl(e,n,r){try{var i=n.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var h=d.next;i=h;do{if((i.tag&e)===e){var b=i.inst,E=b.destroy;if(E!==void 0){b.destroy=void 0,d=n;var k=r,F=E;try{F()}catch(J){It(d,k,J)}}}i=i.next}while(i!==h)}}catch(J){It(n,n.return,J)}}function Yg(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{_p(n,r)}catch(i){It(e,e.return,i)}}}function Fg(e,n,r){r.props=us(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){It(e,n,i)}}function Pi(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof r=="function"?e.refCleanup=r(i):r.current=i}}catch(d){It(e,n,d)}}function wr(e,n){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(d){It(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){It(e,n,d)}else r.current=null}function Pg(e){var n=e.type,r=e.memoizedProps,i=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&i.focus();break e;case"img":r.src?i.src=r.src:r.srcSet&&(i.srcset=r.srcSet)}}catch(d){It(e,e.return,d)}}function Ef(e,n,r){try{var i=e.stateNode;X1(i,e.type,r,n),i[De]=n}catch(d){It(e,e.return,d)}}function Gg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&jl(e.type)||e.tag===4}function Nf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gg(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&&jl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rf(e,n,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=na));else if(i!==4&&(i===27&&jl(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(Rf(e,n,r),e=e.sibling;e!==null;)Rf(e,n,r),e=e.sibling}function _u(e,n,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(i!==4&&(i===27&&jl(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(_u(e,n,r),e=e.sibling;e!==null;)_u(e,n,r),e=e.sibling}function Xg(e){var n=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);Zn(n,i,r),n[ve]=e,n[De]=r}catch(h){It(e,e.return,h)}}var Qr=!1,An=!1,jf=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,In=null;function T1(e,n){if(e=e.containerInfo,Gf=tc,e=ip(e),yd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var d=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var b=0,E=-1,k=-1,F=0,J=0,ie=e,G=null;t:for(;;){for(var Q;ie!==r||d!==0&&ie.nodeType!==3||(E=b+d),ie!==h||i!==0&&ie.nodeType!==3||(k=b+i),ie.nodeType===3&&(b+=ie.nodeValue.length),(Q=ie.firstChild)!==null;)G=ie,ie=Q;for(;;){if(ie===e)break t;if(G===r&&++F===d&&(E=b),G===h&&++J===i&&(k=b),(Q=ie.nextSibling)!==null)break;ie=G,G=ie.parentNode}ie=Q}r=E===-1||k===-1?null:{start:E,end:k}}else r=null}r=r||{start:0,end:0}}else r=null;for(Xf={focusedElem:e,selectionRange:r},tc=!1,In=n;In!==null;)if(n=In,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,In=e;else for(;In!==null;){switch(n=In,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,d=h.memoizedProps,h=h.memoizedState,i=r.stateNode;try{var Oe=us(r.type,d);e=i.getSnapshotBeforeUpdate(Oe,h),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ve){It(r,r.return,Ve)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)Zf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Zf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=n.sibling,e!==null){e.return=n.return,In=e;break}In=n.return}}function Kg(e,n,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:Zr(e,r),i&4&&Fi(5,r);break;case 1:if(Zr(e,r),i&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(b){It(r,r.return,b)}else{var d=us(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){It(r,r.return,b)}}i&64&&Yg(r),i&512&&Pi(r,r.return);break;case 3:if(Zr(e,r),i&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{_p(e,n)}catch(b){It(r,r.return,b)}}break;case 27:n===null&&i&4&&Xg(r);case 26:case 5:Zr(e,r),n===null&&i&4&&Pg(r),i&512&&Pi(r,r.return);break;case 12:Zr(e,r);break;case 31:Zr(e,r),i&4&&Wg(e,r);break;case 13:Zr(e,r),i&4&&ev(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=z1.bind(null,r),nS(e,r))));break;case 22:if(i=r.memoizedState!==null||Qr,!i){n=n!==null&&n.memoizedState!==null||An,d=Qr;var h=An;Qr=i,(An=n)&&!h?Jr(e,r,(r.subtreeFlags&8772)!==0):Zr(e,r),Qr=d,An=h}break;case 30:break;default:Zr(e,r)}}function Zg(e){var n=e.alternate;n!==null&&(e.alternate=null,Zg(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Ie(n)),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 on=null,ba=!1;function Kr(e,n,r){for(r=r.child;r!==null;)Jg(e,n,r),r=r.sibling}function Jg(e,n,r){if(Z&&typeof Z.onCommitFiberUnmount=="function")try{Z.onCommitFiberUnmount(qe,r)}catch{}switch(r.tag){case 26:An||wr(r,n),Kr(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:An||wr(r,n);var i=on,d=ba;jl(r.type)&&(on=r.stateNode,ba=!1),Kr(e,n,r),to(r.stateNode),on=i,ba=d;break;case 5:An||wr(r,n);case 6:if(i=on,d=ba,on=null,Kr(e,n,r),on=i,ba=d,on!==null)if(ba)try{(on.nodeType===9?on.body:on.nodeName==="HTML"?on.ownerDocument.body:on).removeChild(r.stateNode)}catch(h){It(r,n,h)}else try{on.removeChild(r.stateNode)}catch(h){It(r,n,h)}break;case 18:on!==null&&(ba?(e=on,Yv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ws(e)):Yv(on,r.stateNode));break;case 4:i=on,d=ba,on=r.stateNode.containerInfo,ba=!0,Kr(e,n,r),on=i,ba=d;break;case 0:case 11:case 14:case 15:xl(2,r,n),An||xl(4,r,n),Kr(e,n,r);break;case 1:An||(wr(r,n),i=r.stateNode,typeof i.componentWillUnmount=="function"&&Fg(r,n,i)),Kr(e,n,r);break;case 21:Kr(e,n,r);break;case 22:An=(i=An)||r.memoizedState!==null,Kr(e,n,r),An=i;break;default:Kr(e,n,r)}}function Wg(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ws(e)}catch(r){It(n,n.return,r)}}}function ev(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ws(e)}catch(r){It(n,n.return,r)}}function C1(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Qg),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Qg),n;default:throw Error(s(435,e.tag))}}function Lu(e,n){var r=C1(e);n.forEach(function(i){if(!r.has(i)){r.add(i);var d=U1.bind(null,e,i);i.then(d,d)}})}function Sa(e,n){var r=n.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],h=e,b=n,E=b;e:for(;E!==null;){switch(E.tag){case 27:if(jl(E.type)){on=E.stateNode,ba=!1;break e}break;case 5:on=E.stateNode,ba=!1;break e;case 3:case 4:on=E.stateNode.containerInfo,ba=!0;break e}E=E.return}if(on===null)throw Error(s(160));Jg(h,b,d),on=null,ba=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)tv(n,e),n=n.sibling}var lr=null;function tv(e,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sa(n,e),wa(e),i&4&&(xl(3,e,e.return),Fi(3,e),xl(5,e,e.return));break;case 1:Sa(n,e),wa(e),i&512&&(An||r===null||wr(r,r.return)),i&64&&Qr&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var d=lr;if(Sa(n,e),wa(e),i&512&&(An||r===null||wr(r,r.return)),i&4){var h=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){e:{i=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Ze]||h[ve]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(i),d.head.insertBefore(h,d.querySelector("head > title"))),Zn(h,i,r),h[ve]=e,dt(h),i=h;break e;case"link":var b=ty("link","href",d).get(i+(r.href||""));if(b){for(var E=0;E<b.length;E++)if(h=b[E],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){b.splice(E,1);break t}}h=d.createElement(i),Zn(h,i,r),d.head.appendChild(h);break;case"meta":if(b=ty("meta","content",d).get(i+(r.content||""))){for(E=0;E<b.length;E++)if(h=b[E],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){b.splice(E,1);break t}}h=d.createElement(i),Zn(h,i,r),d.head.appendChild(h);break;default:throw Error(s(468,i))}h[ve]=e,dt(h),i=h}e.stateNode=i}else ny(d,e.type,e.stateNode);else e.stateNode=ey(d,i,e.memoizedProps);else h!==i?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,i===null?ny(d,e.type,e.stateNode):ey(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Ef(e,e.memoizedProps,r.memoizedProps)}break;case 27:Sa(n,e),wa(e),i&512&&(An||r===null||wr(r,r.return)),r!==null&&i&4&&Ef(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Sa(n,e),wa(e),i&512&&(An||r===null||wr(r,r.return)),e.flags&32){d=e.stateNode;try{ol(d,"")}catch(Oe){It(e,e.return,Oe)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,Ef(e,d,r!==null?r.memoizedProps:d)),i&1024&&(jf=!0);break;case 6:if(Sa(n,e),wa(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(Oe){It(e,e.return,Oe)}}break;case 3:if(Zu=null,d=lr,lr=Qu(n.containerInfo),Sa(n,e),lr=d,wa(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ws(n.containerInfo)}catch(Oe){It(e,e.return,Oe)}jf&&(jf=!1,nv(e));break;case 4:i=lr,lr=Qu(e.stateNode.containerInfo),Sa(n,e),wa(e),lr=i;break;case 12:Sa(n,e),wa(e);break;case 31:Sa(n,e),wa(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Lu(e,i)));break;case 13:Sa(n,e),wa(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Uu=tn()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Lu(e,i)));break;case 22:d=e.memoizedState!==null;var k=r!==null&&r.memoizedState!==null,F=Qr,J=An;if(Qr=F||d,An=J||k,Sa(n,e),An=J,Qr=F,wa(e),i&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(r===null||k||Qr||An||cs(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){k=r=n;try{if(h=k.stateNode,d)b=h.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{E=k.stateNode;var ie=k.memoizedProps.style,G=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;E.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(Oe){It(k,k.return,Oe)}}}else if(n.tag===6){if(r===null){k=n;try{k.stateNode.nodeValue=d?"":k.memoizedProps}catch(Oe){It(k,k.return,Oe)}}}else if(n.tag===18){if(r===null){k=n;try{var Q=k.stateNode;d?Fv(Q,!0):Fv(k.stateNode,!1)}catch(Oe){It(k,k.return,Oe)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,Lu(e,r))));break;case 19:Sa(n,e),wa(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Lu(e,i)));break;case 30:break;case 21:break;default:Sa(n,e),wa(e)}}function wa(e){var n=e.flags;if(n&2){try{for(var r,i=e.return;i!==null;){if(Gg(i)){r=i;break}i=i.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var d=r.stateNode,h=Nf(e);_u(e,h,d);break;case 5:var b=r.stateNode;r.flags&32&&(ol(b,""),r.flags&=-33);var E=Nf(e);_u(e,E,b);break;case 3:case 4:var k=r.stateNode.containerInfo,F=Nf(e);Rf(e,F,k);break;default:throw Error(s(161))}}catch(J){It(e,e.return,J)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function nv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;nv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Zr(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Kg(e,n.alternate,n),n=n.sibling}function cs(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:xl(4,n,n.return),cs(n);break;case 1:wr(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Fg(n,n.return,r),cs(n);break;case 27:to(n.stateNode);case 26:case 5:wr(n,n.return),cs(n);break;case 22:n.memoizedState===null&&cs(n);break;case 30:cs(n);break;default:cs(n)}e=e.sibling}}function Jr(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var i=n.alternate,d=e,h=n,b=h.flags;switch(h.tag){case 0:case 11:case 15:Jr(d,h,r),Fi(4,h);break;case 1:if(Jr(d,h,r),i=h,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(F){It(i,i.return,F)}if(i=h,d=i.updateQueue,d!==null){var E=i.stateNode;try{var k=d.shared.hiddenCallbacks;if(k!==null)for(d.shared.hiddenCallbacks=null,d=0;d<k.length;d++)Mp(k[d],E)}catch(F){It(i,i.return,F)}}r&&b&64&&Yg(h),Pi(h,h.return);break;case 27:Xg(h);case 26:case 5:Jr(d,h,r),r&&i===null&&b&4&&Pg(h),Pi(h,h.return);break;case 12:Jr(d,h,r);break;case 31:Jr(d,h,r),r&&b&4&&Wg(d,h);break;case 13:Jr(d,h,r),r&&b&4&&ev(d,h);break;case 22:h.memoizedState===null&&Jr(d,h,r),Pi(h,h.return);break;case 30:break;default:Jr(d,h,r)}n=n.sibling}}function Tf(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Oi(r))}function Cf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Oi(e))}function sr(e,n,r,i){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)av(e,n,r,i),n=n.sibling}function av(e,n,r,i){var d=n.flags;switch(n.tag){case 0:case 11:case 15:sr(e,n,r,i),d&2048&&Fi(9,n);break;case 1:sr(e,n,r,i);break;case 3:sr(e,n,r,i),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Oi(e)));break;case 12:if(d&2048){sr(e,n,r,i),e=n.stateNode;try{var h=n.memoizedProps,b=h.id,E=h.onPostCommit;typeof E=="function"&&E(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){It(n,n.return,k)}}else sr(e,n,r,i);break;case 31:sr(e,n,r,i);break;case 13:sr(e,n,r,i);break;case 23:break;case 22:h=n.stateNode,b=n.alternate,n.memoizedState!==null?h._visibility&2?sr(e,n,r,i):Gi(e,n):h._visibility&2?sr(e,n,r,i):(h._visibility|=2,Is(e,n,r,i,(n.subtreeFlags&10256)!==0||!1)),d&2048&&Tf(b,n);break;case 24:sr(e,n,r,i),d&2048&&Cf(n.alternate,n);break;default:sr(e,n,r,i)}}function Is(e,n,r,i,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,b=n,E=r,k=i,F=b.flags;switch(b.tag){case 0:case 11:case 15:Is(h,b,E,k,d),Fi(8,b);break;case 23:break;case 22:var J=b.stateNode;b.memoizedState!==null?J._visibility&2?Is(h,b,E,k,d):Gi(h,b):(J._visibility|=2,Is(h,b,E,k,d)),d&&F&2048&&Tf(b.alternate,b);break;case 24:Is(h,b,E,k,d),d&&F&2048&&Cf(b.alternate,b);break;default:Is(h,b,E,k,d)}n=n.sibling}}function Gi(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,i=n,d=i.flags;switch(i.tag){case 22:Gi(r,i),d&2048&&Tf(i.alternate,i);break;case 24:Gi(r,i),d&2048&&Cf(i.alternate,i);break;default:Gi(r,i)}n=n.sibling}}var Xi=8192;function Vs(e,n,r){if(e.subtreeFlags&Xi)for(e=e.child;e!==null;)rv(e,n,r),e=e.sibling}function rv(e,n,r){switch(e.tag){case 26:Vs(e,n,r),e.flags&Xi&&e.memoizedState!==null&&mS(r,lr,e.memoizedState,e.memoizedProps);break;case 5:Vs(e,n,r);break;case 3:case 4:var i=lr;lr=Qu(e.stateNode.containerInfo),Vs(e,n,r),lr=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Xi,Xi=16777216,Vs(e,n,r),Xi=i):Vs(e,n,r));break;default:Vs(e,n,r)}}function lv(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Qi(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];In=i,iv(i,e)}lv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)sv(e),e=e.sibling}function sv(e){switch(e.tag){case 0:case 11:case 15:Qi(e),e.flags&2048&&xl(9,e,e.return);break;case 3:Qi(e);break;case 12:Qi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,zu(e)):Qi(e);break;default:Qi(e)}}function zu(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];In=i,iv(i,e)}lv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:xl(8,n,n.return),zu(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,zu(n));break;default:zu(n)}e=e.sibling}}function iv(e,n){for(;In!==null;){var r=In;switch(r.tag){case 0:case 11:case 15:xl(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var i=r.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Oi(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,In=i;else e:for(r=e;In!==null;){i=In;var d=i.sibling,h=i.return;if(Zg(i),i===r){In=null;break e}if(d!==null){d.return=h,In=d;break e}In=h}}}var A1={getCacheForType:function(e){var n=Qn(jn),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return Qn(jn).controller.signal}},D1=typeof WeakMap=="function"?WeakMap:Map,Ot=0,en=null,mt=null,xt=0,qt=0,Oa=null,bl=!1,Ys=!1,Af=!1,Wr=0,fn=0,Sl=0,ds=0,Df=0,Ma=0,Fs=0,Ki=null,Ea=null,kf=!1,Uu=0,ov=0,Bu=1/0,Hu=null,wl=null,Ln=0,El=null,Ps=null,el=0,Of=0,Mf=null,uv=null,Zi=0,_f=null;function _a(){return(Ot&2)!==0&&xt!==0?xt&-xt:U.T!==null?$f():K()}function cv(){if(Ma===0)if((xt&536870912)===0||wt){var e=vt;vt<<=1,(vt&3932160)===0&&(vt=262144),Ma=e}else Ma=536870912;return e=Da.current,e!==null&&(e.flags|=32),Ma}function Na(e,n,r){(e===en&&(qt===2||qt===9)||e.cancelPendingCommit!==null)&&(Gs(e,0),Nl(e,xt,Ma,!1)),ht(e,r),((Ot&2)===0||e!==en)&&(e===en&&((Ot&2)===0&&(ds|=r),fn===4&&Nl(e,xt,Ma,!1)),Er(e))}function dv(e,n,r){if((Ot&6)!==0)throw Error(s(327));var i=!r&&(n&127)===0&&(n&e.expiredLanes)===0||Ct(e,n),d=i?M1(e,n):zf(e,n,!0),h=i;do{if(d===0){Ys&&!i&&Nl(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!k1(r)){d=zf(e,n,!1),h=!1;continue}if(d===2){if(h=n,e.errorRecoveryDisabledLanes&h)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var E=e;d=Ki;var k=E.current.memoizedState.isDehydrated;if(k&&(Gs(E,b).flags|=256),b=zf(E,b,!1),b!==2){if(Af&&!k){E.errorRecoveryDisabledLanes|=h,ds|=h,d=4;break e}h=Ea,Ea=d,h!==null&&(Ea===null?Ea=h:Ea.push.apply(Ea,h))}d=b}if(h=!1,d!==2)continue}}if(d===1){Gs(e,0),Nl(e,n,0,!0);break}e:{switch(i=e,h=d,h){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:Nl(i,n,Ma,!bl);break e;case 2:Ea=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(d=Uu+300-tn(),10<d)){if(Nl(i,n,Ma,!bl),Bt(i,0,!0)!==0)break e;el=n,i.timeoutHandle=Iv(fv.bind(null,i,r,Ea,Hu,kf,n,Ma,ds,Fs,bl,h,"Throttled",-0,0),d);break e}fv(i,r,Ea,Hu,kf,n,Ma,ds,Fs,bl,h,null,-0,0)}}break}while(!0);Er(e)}function fv(e,n,r,i,d,h,b,E,k,F,J,ie,G,Q){if(e.timeoutHandle=-1,ie=n.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},rv(n,h,ie);var Oe=(h&62914560)===h?Uu-tn():(h&4194048)===h?ov-tn():0;if(Oe=pS(ie,Oe),Oe!==null){el=h,e.cancelPendingCommit=Oe(bv.bind(null,e,n,h,r,i,d,b,E,k,J,ie,null,G,Q)),Nl(e,h,b,!F);return}}bv(e,n,h,r,i,d,b,E,k)}function k1(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var i=0;i<r.length;i++){var d=r[i],h=d.getSnapshot;d=d.value;try{if(!Ca(h(),d))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Nl(e,n,r,i){n&=~Df,n&=~ds,e.suspendedLanes|=n,e.pingedLanes&=~n,i&&(e.warmLanes|=n),i=e.expirationTimes;for(var d=n;0<d;){var h=31-Kt(d),b=1<<h;i[h]=-1,d&=~b}r!==0&&wn(e,r,n)}function $u(){return(Ot&6)===0?(Ji(0),!1):!0}function Lf(){if(mt!==null){if(qt===0)var e=mt.return;else e=mt,Vr=ns=null,Kd(e),Us=null,_i=0,e=mt;for(;e!==null;)Vg(e.alternate,e),e=e.return;mt=null}}function Gs(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,Z1(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),el=0,Lf(),en=e,mt=r=qr(e.current,null),xt=n,qt=0,Oa=null,bl=!1,Ys=Ct(e,n),Af=!1,Fs=Ma=Df=ds=Sl=fn=0,Ea=Ki=null,kf=!1,(n&8)!==0&&(n|=n&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=n;0<i;){var d=31-Kt(i),h=1<<d;n|=e[d],i&=~h}return Wr=n,iu(),r}function hv(e,n){st=null,U.H=Ii,n===zs||n===pu?(n=Ap(),qt=3):n===Bd?(n=Ap(),qt=4):qt=n===hf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Oa=n,mt===null&&(fn=1,Au(e,Ia(n,e.current)))}function mv(){var e=Da.current;return e===null?!0:(xt&4194048)===xt?Pa===null:(xt&62914560)===xt||(xt&536870912)!==0?e===Pa:!1}function pv(){var e=U.H;return U.H=Ii,e===null?Ii:e}function gv(){var e=U.A;return U.A=A1,e}function qu(){fn=4,bl||(xt&4194048)!==xt&&Da.current!==null||(Ys=!0),(Sl&134217727)===0&&(ds&134217727)===0||en===null||Nl(en,xt,Ma,!1)}function zf(e,n,r){var i=Ot;Ot|=2;var d=pv(),h=gv();(en!==e||xt!==n)&&(Hu=null,Gs(e,n)),n=!1;var b=fn;e:do try{if(qt!==0&&mt!==null){var E=mt,k=Oa;switch(qt){case 8:Lf(),b=6;break e;case 3:case 2:case 9:case 6:Da.current===null&&(n=!0);var F=qt;if(qt=0,Oa=null,Xs(e,E,k,F),r&&Ys){b=0;break e}break;default:F=qt,qt=0,Oa=null,Xs(e,E,k,F)}}O1(),b=fn;break}catch(J){hv(e,J)}while(!0);return n&&e.shellSuspendCounter++,Vr=ns=null,Ot=i,U.H=d,U.A=h,mt===null&&(en=null,xt=0,iu()),b}function O1(){for(;mt!==null;)vv(mt)}function M1(e,n){var r=Ot;Ot|=2;var i=pv(),d=gv();en!==e||xt!==n?(Hu=null,Bu=tn()+500,Gs(e,n)):Ys=Ct(e,n);e:do try{if(qt!==0&&mt!==null){n=mt;var h=Oa;t:switch(qt){case 1:qt=0,Oa=null,Xs(e,n,h,1);break;case 2:case 9:if(Tp(h)){qt=0,Oa=null,yv(n);break}n=function(){qt!==2&&qt!==9||en!==e||(qt=7),Er(e)},h.then(n,n);break e;case 3:qt=7;break e;case 4:qt=5;break e;case 7:Tp(h)?(qt=0,Oa=null,yv(n)):(qt=0,Oa=null,Xs(e,n,h,7));break;case 5:var b=null;switch(mt.tag){case 26:b=mt.memoizedState;case 5:case 27:var E=mt;if(b?ay(b):E.stateNode.complete){qt=0,Oa=null;var k=E.sibling;if(k!==null)mt=k;else{var F=E.return;F!==null?(mt=F,Iu(F)):mt=null}break t}}qt=0,Oa=null,Xs(e,n,h,5);break;case 6:qt=0,Oa=null,Xs(e,n,h,6);break;case 8:Lf(),fn=6;break e;default:throw Error(s(462))}}_1();break}catch(J){hv(e,J)}while(!0);return Vr=ns=null,U.H=i,U.A=d,Ot=r,mt!==null?0:(en=null,xt=0,iu(),fn)}function _1(){for(;mt!==null&&!Hn();)vv(mt)}function vv(e){var n=qg(e.alternate,e,Wr);e.memoizedProps=e.pendingProps,n===null?Iu(e):mt=n}function yv(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=Lg(r,n,n.pendingProps,n.type,void 0,xt);break;case 11:n=Lg(r,n,n.pendingProps,n.type.render,n.ref,xt);break;case 5:Kd(n);default:Vg(r,n),n=mt=gp(n,Wr),n=qg(r,n,Wr)}e.memoizedProps=e.pendingProps,n===null?Iu(e):mt=n}function Xs(e,n,r,i){Vr=ns=null,Kd(n),Us=null,_i=0;var d=n.return;try{if(w1(e,d,n,r,xt)){fn=1,Au(e,Ia(r,e.current)),mt=null;return}}catch(h){if(d!==null)throw mt=d,h;fn=1,Au(e,Ia(r,e.current)),mt=null;return}n.flags&32768?(wt||i===1?e=!0:Ys||(xt&536870912)!==0?e=!1:(bl=e=!0,(i===2||i===9||i===3||i===6)&&(i=Da.current,i!==null&&i.tag===13&&(i.flags|=16384))),xv(n,e)):Iu(n)}function Iu(e){var n=e;do{if((n.flags&32768)!==0){xv(n,bl);return}e=n.return;var r=R1(n.alternate,n,Wr);if(r!==null){mt=r;return}if(n=n.sibling,n!==null){mt=n;return}mt=n=e}while(n!==null);fn===0&&(fn=5)}function xv(e,n){do{var r=j1(e.alternate,e);if(r!==null){r.flags&=32767,mt=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){mt=e;return}mt=e=r}while(e!==null);fn=6,mt=null}function bv(e,n,r,i,d,h,b,E,k){e.cancelPendingCommit=null;do Vu();while(Ln!==0);if((Ot&6)!==0)throw Error(s(327));if(n!==null){if(n===e.current)throw Error(s(177));if(h=n.lanes|n.childLanes,h|=Ed,Je(e,r,h,b,E,k),e===en&&(mt=en=null,xt=0),Ps=n,El=e,el=r,Of=h,Mf=d,uv=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,B1(qn,function(){return Rv(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||i){i=U.T,U.T=null,d=B.p,B.p=2,b=Ot,Ot|=4;try{T1(e,n,r)}finally{Ot=b,B.p=d,U.T=i}}Ln=1,Sv(),wv(),Ev()}}function Sv(){if(Ln===1){Ln=0;var e=El,n=Ps,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=U.T,U.T=null;var i=B.p;B.p=2;var d=Ot;Ot|=4;try{tv(n,e);var h=Xf,b=ip(e.containerInfo),E=h.focusedElem,k=h.selectionRange;if(b!==E&&E&&E.ownerDocument&&sp(E.ownerDocument.documentElement,E)){if(k!==null&&yd(E)){var F=k.start,J=k.end;if(J===void 0&&(J=F),"selectionStart"in E)E.selectionStart=F,E.selectionEnd=Math.min(J,E.value.length);else{var ie=E.ownerDocument||document,G=ie&&ie.defaultView||window;if(G.getSelection){var Q=G.getSelection(),Oe=E.textContent.length,Ve=Math.min(k.start,Oe),Ft=k.end===void 0?Ve:Math.min(k.end,Oe);!Q.extend&&Ve>Ft&&(b=Ft,Ft=Ve,Ve=b);var H=lp(E,Ve),_=lp(E,Ft);if(H&&_&&(Q.rangeCount!==1||Q.anchorNode!==H.node||Q.anchorOffset!==H.offset||Q.focusNode!==_.node||Q.focusOffset!==_.offset)){var Y=ie.createRange();Y.setStart(H.node,H.offset),Q.removeAllRanges(),Ve>Ft?(Q.addRange(Y),Q.extend(_.node,_.offset)):(Y.setEnd(_.node,_.offset),Q.addRange(Y))}}}}for(ie=[],Q=E;Q=Q.parentNode;)Q.nodeType===1&&ie.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ie.length;E++){var le=ie[E];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}tc=!!Gf,Xf=Gf=null}finally{Ot=d,B.p=i,U.T=r}}e.current=n,Ln=2}}function wv(){if(Ln===2){Ln=0;var e=El,n=Ps,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=U.T,U.T=null;var i=B.p;B.p=2;var d=Ot;Ot|=4;try{Kg(e,n.alternate,n)}finally{Ot=d,B.p=i,U.T=r}}Ln=3}}function Ev(){if(Ln===4||Ln===3){Ln=0,$n();var e=El,n=Ps,r=el,i=uv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ln=5:(Ln=0,Ps=El=null,Nv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(wl=null),$(r),n=n.stateNode,Z&&typeof Z.onCommitFiberRoot=="function")try{Z.onCommitFiberRoot(qe,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=U.T,d=B.p,B.p=2,U.T=null;try{for(var h=e.onRecoverableError,b=0;b<i.length;b++){var E=i[b];h(E.value,{componentStack:E.stack})}}finally{U.T=n,B.p=d}}(el&3)!==0&&Vu(),Er(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===_f?Zi++:(Zi=0,_f=e):Zi=0,Ji(0)}}function Nv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Oi(n)))}function Vu(){return Sv(),wv(),Ev(),Rv()}function Rv(){if(Ln!==5)return!1;var e=El,n=Of;Of=0;var r=$(el),i=U.T,d=B.p;try{B.p=32>r?32:r,U.T=null,r=Mf,Mf=null;var h=El,b=el;if(Ln=0,Ps=El=null,el=0,(Ot&6)!==0)throw Error(s(331));var E=Ot;if(Ot|=4,sv(h.current),av(h,h.current,b,r),Ot=E,Ji(0,!1),Z&&typeof Z.onPostCommitFiberRoot=="function")try{Z.onPostCommitFiberRoot(qe,h)}catch{}return!0}finally{B.p=d,U.T=i,Nv(e,n)}}function jv(e,n,r){n=Ia(r,n),n=ff(e.stateNode,n,2),e=gl(e,n,2),e!==null&&(ht(e,2),Er(e))}function It(e,n,r){if(e.tag===3)jv(e,e,r);else for(;n!==null;){if(n.tag===3){jv(n,e,r);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(wl===null||!wl.has(i))){e=Ia(r,e),r=Tg(2),i=gl(n,r,2),i!==null&&(Cg(r,i,n,e),ht(i,2),Er(i));break}}n=n.return}}function Uf(e,n,r){var i=e.pingCache;if(i===null){i=e.pingCache=new D1;var d=new Set;i.set(n,d)}else d=i.get(n),d===void 0&&(d=new Set,i.set(n,d));d.has(r)||(Af=!0,d.add(r),e=L1.bind(null,e,n,r),n.then(e,e))}function L1(e,n,r){var i=e.pingCache;i!==null&&i.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,en===e&&(xt&r)===r&&(fn===4||fn===3&&(xt&62914560)===xt&&300>tn()-Uu?(Ot&2)===0&&Gs(e,0):Df|=r,Fs===xt&&(Fs=0)),Er(e)}function Tv(e,n){n===0&&(n=Zt()),e=Wl(e,n),e!==null&&(ht(e,n),Er(e))}function z1(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),Tv(e,r)}function U1(e,n){var r=0;switch(e.tag){case 31:case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(n),Tv(e,r)}function B1(e,n){return _t(e,n)}var Yu=null,Qs=null,Bf=!1,Fu=!1,Hf=!1,Rl=0;function Er(e){e!==Qs&&e.next===null&&(Qs===null?Yu=Qs=e:Qs=Qs.next=e),Fu=!0,Bf||(Bf=!0,$1())}function Ji(e,n){if(!Hf&&Fu){Hf=!0;do for(var r=!1,i=Yu;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var h=0;else{var b=i.suspendedLanes,E=i.pingedLanes;h=(1<<31-Kt(42|e)+1)-1,h&=d&~(b&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,kv(i,h))}else h=xt,h=Bt(i,i===en?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(h&3)===0||Ct(i,h)||(r=!0,kv(i,h));i=i.next}while(r);Hf=!1}}function H1(){Cv()}function Cv(){Fu=Bf=!1;var e=0;Rl!==0&&K1()&&(e=Rl);for(var n=tn(),r=null,i=Yu;i!==null;){var d=i.next,h=Av(i,n);h===0?(i.next=null,r===null?Yu=d:r.next=d,d===null&&(Qs=r)):(r=i,(e!==0||(h&3)!==0)&&(Fu=!0)),i=d}Ln!==0&&Ln!==5||Ji(e),Rl!==0&&(Rl=0)}function Av(e,n){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var b=31-Kt(h),E=1<<b,k=d[b];k===-1?((E&r)===0||(E&i)!==0)&&(d[b]=nn(E,n)):k<=n&&(e.expiredLanes|=E),h&=~E}if(n=en,r=xt,r=Bt(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===n&&(qt===2||qt===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Qt(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ct(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(i!==null&&Qt(i),$(r)){case 2:case 8:r=Wn;break;case 32:r=qn;break;case 268435456:r=Ce;break;default:r=qn}return i=Dv.bind(null,e),r=_t(r,i),e.callbackPriority=n,e.callbackNode=r,n}return i!==null&&i!==null&&Qt(i),e.callbackPriority=2,e.callbackNode=null,2}function Dv(e,n){if(Ln!==0&&Ln!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Vu()&&e.callbackNode!==r)return null;var i=xt;return i=Bt(e,e===en?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(dv(e,i,n),Av(e,tn()),e.callbackNode!=null&&e.callbackNode===r?Dv.bind(null,e):null)}function kv(e,n){if(Vu())return null;dv(e,n,!0)}function $1(){J1(function(){(Ot&6)!==0?_t(fa,H1):Cv()})}function $f(){if(Rl===0){var e=_s;e===0&&(e=Me,Me<<=1,(Me&261888)===0&&(Me=256)),Rl=e}return Rl}function Ov(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:an(""+e)}function Mv(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function q1(e,n,r,i,d){if(n==="submit"&&r&&r.stateNode===d){var h=Ov((d[De]||null).action),b=i.submitter;b&&(n=(n=b[De]||null)?Ov(n.formAction):b.getAttribute("formAction"),n!==null&&(h=n,b=null));var E=new Hr("action","action",null,i,d);e.push({event:E,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Rl!==0){var k=b?Mv(d,b):new FormData(d);lf(r,{pending:!0,data:k,method:d.method,action:h},null,k)}}else typeof h=="function"&&(E.preventDefault(),k=b?Mv(d,b):new FormData(d),lf(r,{pending:!0,data:k,method:d.method,action:h},h,k))},currentTarget:d}]})}}for(var qf=0;qf<wd.length;qf++){var If=wd[qf],I1=If.toLowerCase(),V1=If[0].toUpperCase()+If.slice(1);rr(I1,"on"+V1)}rr(cp,"onAnimationEnd"),rr(dp,"onAnimationIteration"),rr(fp,"onAnimationStart"),rr("dblclick","onDoubleClick"),rr("focusin","onFocus"),rr("focusout","onBlur"),rr(l1,"onTransitionRun"),rr(s1,"onTransitionStart"),rr(i1,"onTransitionCancel"),rr(hp,"onTransitionEnd"),On("onMouseEnter",["mouseout","mouseover"]),On("onMouseLeave",["mouseout","mouseover"]),On("onPointerEnter",["pointerout","pointerover"]),On("onPointerLeave",["pointerout","pointerover"]),En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),En("onBeforeInput",["compositionend","keypress","textInput","paste"]),En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="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(" "),Y1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wi));function _v(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],d=i.event;i=i.listeners;e:{var h=void 0;if(n)for(var b=i.length-1;0<=b;b--){var E=i[b],k=E.instance,F=E.currentTarget;if(E=E.listener,k!==h&&d.isPropagationStopped())break e;h=E,d.currentTarget=F;try{h(d)}catch(J){su(J)}d.currentTarget=null,h=k}else for(b=0;b<i.length;b++){if(E=i[b],k=E.instance,F=E.currentTarget,E=E.listener,k!==h&&d.isPropagationStopped())break e;h=E,d.currentTarget=F;try{h(d)}catch(J){su(J)}d.currentTarget=null,h=k}}}}function pt(e,n){var r=n[_e];r===void 0&&(r=n[_e]=new Set);var i=e+"__bubble";r.has(i)||(Lv(n,e,2,!1),r.add(i))}function Vf(e,n,r){var i=0;n&&(i|=4),Lv(r,e,i,n)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Yf(e){if(!e[Pu]){e[Pu]=!0,Jt.forEach(function(r){r!=="selectionchange"&&(Y1.has(r)||Vf(r,!1,e),Vf(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Pu]||(n[Pu]=!0,Vf("selectionchange",!1,n))}}function Lv(e,n,r,i){switch(cy(n)){case 2:var d=yS;break;case 8:d=xS;break;default:d=lh}r=d.bind(null,n,r,e),d=void 0,!Ei||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(n,r,{capture:!0,passive:d}):e.addEventListener(n,r,!0):d!==void 0?e.addEventListener(n,r,{passive:d}):e.addEventListener(n,r,!1)}function Ff(e,n,r,i,d){var h=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var E=i.stateNode.containerInfo;if(E===d)break;if(b===4)for(b=i.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===d)return;b=b.return}for(;E!==null;){if(b=$t(E),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){i=h=b;continue e}E=E.parentNode}}i=i.return}wi(function(){var F=h,J=_r(r),ie=[];e:{var G=mp.get(e);if(G!==void 0){var Q=Hr,Oe=e;switch(e){case"keypress":if(Ns(r)===0)break e;case"keydown":case"keyup":Q=Rn;break;case"focusin":Oe="focus",Q=xe;break;case"focusout":Oe="blur",Q=xe;break;case"beforeblur":case"afterblur":Q=xe;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=nu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=P;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=xr;break;case cp:case dp:case fp:Q=ce;break;case hp:Q=au;break;case"scroll":case"scrollend":Q=dd;break;case"wheel":Q=hd;break;case"copy":case"cut":case"paste":Q=Se;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=zt;break;case"toggle":case"beforetoggle":Q=P0}var Ve=(n&4)!==0,Ft=!Ve&&(e==="scroll"||e==="scrollend"),H=Ve?G!==null?G+"Capture":null:G;Ve=[];for(var _=F,Y;_!==null;){var le=_;if(Y=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Y===null||H===null||(le=Ha(_,H),le!=null&&Ve.push(eo(_,le,Y))),Ft)break;_=_.return}0<Ve.length&&(G=new Q(G,Oe,null,r,J),ie.push({event:G,listeners:Ve}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&r!==Ta&&(Oe=r.relatedTarget||r.fromElement)&&($t(Oe)||Oe[Re]))break e;if((Q||G)&&(G=J.window===J?J:(G=J.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(Oe=r.relatedTarget||r.toElement,Q=F,Oe=Oe?$t(Oe):null,Oe!==null&&(Ft=u(Oe),Ve=Oe.tag,Oe!==Ft||Ve!==5&&Ve!==27&&Ve!==6)&&(Oe=null)):(Q=null,Oe=F),Q!==Oe)){if(Ve=nu,le="onMouseLeave",H="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(Ve=zt,le="onPointerLeave",H="onPointerEnter",_="pointer"),Ft=Q==null?G:ct(Q),Y=Oe==null?G:ct(Oe),G=new Ve(le,_+"leave",Q,r,J),G.target=Ft,G.relatedTarget=Y,le=null,$t(J)===F&&(Ve=new Ve(H,_+"enter",Oe,r,J),Ve.target=Y,Ve.relatedTarget=Ft,le=Ve),Ft=le,Q&&Oe)t:{for(Ve=F1,H=Q,_=Oe,Y=0,le=H;le;le=Ve(le))Y++;le=0;for(var He=_;He;He=Ve(He))le++;for(;0<Y-le;)H=Ve(H),Y--;for(;0<le-Y;)_=Ve(_),le--;for(;Y--;){if(H===_||_!==null&&H===_.alternate){Ve=H;break t}H=Ve(H),_=Ve(_)}Ve=null}else Ve=null;Q!==null&&zv(ie,G,Q,Ve,!1),Oe!==null&&Ft!==null&&zv(ie,Ft,Oe,Ve,!0)}}e:{if(G=F?ct(F):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var Dt=Wm;else if(Zm(G))if(ep)Dt=n1;else{Dt=e1;var Le=W0}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?F&&Pl(F.elementType)&&(Dt=Wm):Dt=t1;if(Dt&&(Dt=Dt(e,F))){Jm(ie,Dt,r,J);break e}Le&&Le(e,G,F),e==="focusout"&&F&&G.type==="number"&&F.memoizedProps.value!=null&&At(G,"number",G.value)}switch(Le=F?ct(F):window,e){case"focusin":(Zm(Le)||Le.contentEditable==="true")&&(js=Le,xd=F,Ai=null);break;case"focusout":Ai=xd=js=null;break;case"mousedown":bd=!0;break;case"contextmenu":case"mouseup":case"dragend":bd=!1,op(ie,r,J);break;case"selectionchange":if(r1)break;case"keydown":case"keyup":op(ie,r,J)}var ot;if(pd)e:{switch(e){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Rs?Qm(e,r)&&(bt="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(bt="onCompositionStart");bt&&(Pm&&r.locale!=="ko"&&(Rs||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Rs&&(ot=eu()):($a=J,Ni="value"in $a?$a.value:$a.textContent,Rs=!0)),Le=Gu(F,bt),0<Le.length&&(bt=new rt(bt,e,null,r,J),ie.push({event:bt,listeners:Le}),ot?bt.data=ot:(ot=Km(r),ot!==null&&(bt.data=ot)))),(ot=X0?Q0(e,r):K0(e,r))&&(bt=Gu(F,"onBeforeInput"),0<bt.length&&(Le=new rt("onBeforeInput","beforeinput",null,r,J),ie.push({event:Le,listeners:bt}),Le.data=ot)),q1(ie,e,F,r,J)}_v(ie,n)})}function eo(e,n,r){return{instance:e,listener:n,currentTarget:r}}function Gu(e,n){for(var r=n+"Capture",i=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Ha(e,r),d!=null&&i.unshift(eo(e,d,h)),d=Ha(e,n),d!=null&&i.push(eo(e,d,h))),e.tag===3)return i;e=e.return}return[]}function F1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zv(e,n,r,i,d){for(var h=n._reactName,b=[];r!==null&&r!==i;){var E=r,k=E.alternate,F=E.stateNode;if(E=E.tag,k!==null&&k===i)break;E!==5&&E!==26&&E!==27||F===null||(k=F,d?(F=Ha(r,h),F!=null&&b.unshift(eo(r,F,k))):d||(F=Ha(r,h),F!=null&&b.push(eo(r,F,k)))),r=r.return}b.length!==0&&e.push({event:n,listeners:b})}var P1=/\r\n?/g,G1=/\u0000|\uFFFD/g;function Uv(e){return(typeof e=="string"?e:""+e).replace(P1,`
49
+ `).replace(G1,"")}function Bv(e,n){return n=Uv(n),Uv(e)===n}function Yt(e,n,r,i,d,h){switch(r){case"children":typeof i=="string"?n==="body"||n==="textarea"&&i===""||ol(e,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&ol(e,""+i);break;case"className":pr(e,"class",i);break;case"tabIndex":pr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":pr(e,r,i);break;case"style":va(e,i,h);break;case"data":if(n!=="object"){pr(e,"data",i);break}case"src":case"href":if(i===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=an(""+i),e.setAttribute(r,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(r,"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}else typeof h=="function"&&(r==="formAction"?(n!=="input"&&Yt(e,n,"name",d.name,d,null),Yt(e,n,"formEncType",d.formEncType,d,null),Yt(e,n,"formMethod",d.formMethod,d,null),Yt(e,n,"formTarget",d.formTarget,d,null)):(Yt(e,n,"encType",d.encType,d,null),Yt(e,n,"method",d.method,d,null),Yt(e,n,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=an(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=na);break;case"onScroll":i!=null&&pt("scroll",e);break;case"onScrollEnd":i!=null&&pt("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}r=an(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""+i):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":i===!0?e.setAttribute(r,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,i):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case"popover":pt("beforetoggle",e),pt("toggle",e),ea(e,"popover",i);break;case"xlinkActuate":Qe(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Qe(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Qe(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Qe(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Qe(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Qe(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Qe(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Qe(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Qe(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ea(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=ws.get(r)||r,ea(e,r,i))}}function Pf(e,n,r,i,d,h){switch(r){case"style":va(e,i,h);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"children":typeof i=="string"?ol(e,i):(typeof i=="number"||typeof i=="bigint")&&ol(e,""+i);break;case"onScroll":i!=null&&pt("scroll",e);break;case"onScrollEnd":i!=null&&pt("scrollend",e);break;case"onClick":i!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fn.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),n=r.slice(2,d?r.length-7:void 0),h=e[De]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(n,h,d),typeof i=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,i,d);break e}r in e?e[r]=i:i===!0?e.setAttribute(r,""):ea(e,r,i)}}}function Zn(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pt("error",e),pt("load",e);var i=!1,d=!1,h;for(h in r)if(r.hasOwnProperty(h)){var b=r[h];if(b!=null)switch(h){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Yt(e,n,h,b,r,null)}}d&&Yt(e,n,"srcSet",r.srcSet,r,null),i&&Yt(e,n,"src",r.src,r,null);return;case"input":pt("invalid",e);var E=h=b=d=null,k=null,F=null;for(i in r)if(r.hasOwnProperty(i)){var J=r[i];if(J!=null)switch(i){case"name":d=J;break;case"type":b=J;break;case"checked":k=J;break;case"defaultChecked":F=J;break;case"value":h=J;break;case"defaultValue":E=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(s(137,n));break;default:Yt(e,n,i,J,r,null)}}bi(e,h,E,k,F,b,d,!1);return;case"select":pt("invalid",e),i=b=h=null;for(d in r)if(r.hasOwnProperty(d)&&(E=r[d],E!=null))switch(d){case"value":h=E;break;case"defaultValue":b=E;break;case"multiple":i=E;default:Yt(e,n,d,E,r,null)}n=h,r=b,e.multiple=!!i,n!=null?gr(e,!!i,n,!1):r!=null&&gr(e,!!i,r,!0);return;case"textarea":pt("invalid",e),h=d=i=null;for(b in r)if(r.hasOwnProperty(b)&&(E=r[b],E!=null))switch(b){case"value":i=E;break;case"defaultValue":d=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(s(91));break;default:Yt(e,n,b,E,r,null)}nr(e,i,d,h);return;case"option":for(k in r)if(r.hasOwnProperty(k)&&(i=r[k],i!=null))switch(k){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Yt(e,n,k,i,r,null)}return;case"dialog":pt("beforetoggle",e),pt("toggle",e),pt("cancel",e),pt("close",e);break;case"iframe":case"object":pt("load",e);break;case"video":case"audio":for(i=0;i<Wi.length;i++)pt(Wi[i],e);break;case"image":pt("error",e),pt("load",e);break;case"details":pt("toggle",e);break;case"embed":case"source":case"link":pt("error",e),pt("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(F in r)if(r.hasOwnProperty(F)&&(i=r[F],i!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Yt(e,n,F,i,r,null)}return;default:if(Pl(n)){for(J in r)r.hasOwnProperty(J)&&(i=r[J],i!==void 0&&Pf(e,n,J,i,r,void 0));return}}for(E in r)r.hasOwnProperty(E)&&(i=r[E],i!=null&&Yt(e,n,E,i,r,null))}function X1(e,n,r,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,b=null,E=null,k=null,F=null,J=null;for(Q in r){var ie=r[Q];if(r.hasOwnProperty(Q)&&ie!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":k=ie;default:i.hasOwnProperty(Q)||Yt(e,n,Q,null,i,ie)}}for(var G in i){var Q=i[G];if(ie=r[G],i.hasOwnProperty(G)&&(Q!=null||ie!=null))switch(G){case"type":h=Q;break;case"name":d=Q;break;case"checked":F=Q;break;case"defaultChecked":J=Q;break;case"value":b=Q;break;case"defaultValue":E=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(137,n));break;default:Q!==ie&&Yt(e,n,G,Q,i,ie)}}Fl(e,b,E,k,F,J,h,d);return;case"select":Q=b=E=G=null;for(h in r)if(k=r[h],r.hasOwnProperty(h)&&k!=null)switch(h){case"value":break;case"multiple":Q=k;default:i.hasOwnProperty(h)||Yt(e,n,h,null,i,k)}for(d in i)if(h=i[d],k=r[d],i.hasOwnProperty(d)&&(h!=null||k!=null))switch(d){case"value":G=h;break;case"defaultValue":E=h;break;case"multiple":b=h;default:h!==k&&Yt(e,n,d,h,i,k)}n=E,r=b,i=Q,G!=null?gr(e,!!r,G,!1):!!i!=!!r&&(n!=null?gr(e,!!r,n,!0):gr(e,!!r,r?[]:"",!1));return;case"textarea":Q=G=null;for(E in r)if(d=r[E],r.hasOwnProperty(E)&&d!=null&&!i.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Yt(e,n,E,null,i,d)}for(b in i)if(d=i[b],h=r[b],i.hasOwnProperty(b)&&(d!=null||h!=null))switch(b){case"value":G=d;break;case"defaultValue":Q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==h&&Yt(e,n,b,d,i,h)}Wo(e,G,Q);return;case"option":for(var Oe in r)if(G=r[Oe],r.hasOwnProperty(Oe)&&G!=null&&!i.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:Yt(e,n,Oe,null,i,G)}for(k in i)if(G=i[k],Q=r[k],i.hasOwnProperty(k)&&G!==Q&&(G!=null||Q!=null))switch(k){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:Yt(e,n,k,G,i,Q)}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 Ve in r)G=r[Ve],r.hasOwnProperty(Ve)&&G!=null&&!i.hasOwnProperty(Ve)&&Yt(e,n,Ve,null,i,G);for(F in i)if(G=i[F],Q=r[F],i.hasOwnProperty(F)&&G!==Q&&(G!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,n));break;default:Yt(e,n,F,G,i,Q)}return;default:if(Pl(n)){for(var Ft in r)G=r[Ft],r.hasOwnProperty(Ft)&&G!==void 0&&!i.hasOwnProperty(Ft)&&Pf(e,n,Ft,void 0,i,G);for(J in i)G=i[J],Q=r[J],!i.hasOwnProperty(J)||G===Q||G===void 0&&Q===void 0||Pf(e,n,J,G,i,Q);return}}for(var H in r)G=r[H],r.hasOwnProperty(H)&&G!=null&&!i.hasOwnProperty(H)&&Yt(e,n,H,null,i,G);for(ie in i)G=i[ie],Q=r[ie],!i.hasOwnProperty(ie)||G===Q||G==null&&Q==null||Yt(e,n,ie,G,i,Q)}function Hv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),i=0;i<r.length;i++){var d=r[i],h=d.transferSize,b=d.initiatorType,E=d.duration;if(h&&E&&Hv(b)){for(b=0,E=d.responseEnd,i+=1;i<r.length;i++){var k=r[i],F=k.startTime;if(F>E)break;var J=k.transferSize,ie=k.initiatorType;J&&Hv(ie)&&(k=k.responseEnd,b+=J*(k<E?1:(E-F)/(k-F)))}if(--i,n+=8*(h+b)/(d.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Gf=null,Xf=null;function Xu(e){return e.nodeType===9?e:e.ownerDocument}function $v(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 qv(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Qf(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Kf=null;function K1(){var e=window.event;return e&&e.type==="popstate"?e===Kf?!1:(Kf=e,!0):(Kf=null,!1)}var Iv=typeof setTimeout=="function"?setTimeout:void 0,Z1=typeof clearTimeout=="function"?clearTimeout:void 0,Vv=typeof Promise=="function"?Promise:void 0,J1=typeof queueMicrotask=="function"?queueMicrotask:typeof Vv<"u"?function(e){return Vv.resolve(null).then(e).catch(W1)}:Iv;function W1(e){setTimeout(function(){throw e})}function jl(e){return e==="head"}function Yv(e,n){var r=n,i=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(i===0){e.removeChild(d),Ws(n);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")to(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,to(r);for(var h=r.firstChild;h;){var b=h.nextSibling,E=h.nodeName;h[Ze]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=b}}else r==="body"&&to(e.ownerDocument.body);r=d}while(r);Ws(n)}function Fv(e,n){var r=e;e=0;do{var i=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=i}while(r)}function Zf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Zf(r),Ie(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function eS(e,n,r,i){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ze])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Ga(e.nextSibling),e===null)break}return null}function tS(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Ga(e.nextSibling),e===null))return null;return e}function Pv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ga(e.nextSibling),e===null))return null;return e}function Jf(e){return e.data==="$?"||e.data==="$~"}function Wf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function nS(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var i=function(){n(),r.removeEventListener("DOMContentLoaded",i)};r.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Ga(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var eh=null;function Gv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return Ga(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function Xv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function Qv(e,n,r){switch(n=Xu(r),e){case"html":if(e=n.documentElement,!e)throw Error(s(452));return e;case"head":if(e=n.head,!e)throw Error(s(453));return e;case"body":if(e=n.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function to(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ie(e)}var Xa=new Map,Kv=new Set;function Qu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var tl=B.d;B.d={f:aS,r:rS,D:lS,C:sS,L:iS,m:oS,X:cS,S:uS,M:dS};function aS(){var e=tl.f(),n=$u();return e||n}function rS(e){var n=We(e);n!==null&&n.tag===5&&n.type==="form"?hg(n):tl.r(e)}var Ks=typeof document>"u"?null:document;function Zv(e,n,r){var i=Ks;if(i&&typeof n=="string"&&n){var d=Gn(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),Kv.has(d)||(Kv.add(d),e={rel:e,crossOrigin:r,href:n},i.querySelector(d)===null&&(n=i.createElement("link"),Zn(n,"link",e),dt(n),i.head.appendChild(n)))}}function lS(e){tl.D(e),Zv("dns-prefetch",e,null)}function sS(e,n){tl.C(e,n),Zv("preconnect",e,n)}function iS(e,n,r){tl.L(e,n,r);var i=Ks;if(i&&e&&n){var d='link[rel="preload"][as="'+Gn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+Gn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+Gn(r.imageSizes)+'"]')):d+='[href="'+Gn(e)+'"]';var h=d;switch(n){case"style":h=Zs(e);break;case"script":h=Js(e)}Xa.has(h)||(e=y({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Xa.set(h,e),i.querySelector(d)!==null||n==="style"&&i.querySelector(no(h))||n==="script"&&i.querySelector(ao(h))||(n=i.createElement("link"),Zn(n,"link",e),dt(n),i.head.appendChild(n)))}}function oS(e,n){tl.m(e,n);var r=Ks;if(r&&e){var i=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+Gn(i)+'"][href="'+Gn(e)+'"]',h=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Js(e)}if(!Xa.has(h)&&(e=y({rel:"modulepreload",href:e},n),Xa.set(h,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ao(h)))return}i=r.createElement("link"),Zn(i,"link",e),dt(i),r.head.appendChild(i)}}}function uS(e,n,r){tl.S(e,n,r);var i=Ks;if(i&&e){var d=it(i).hoistableStyles,h=Zs(e);n=n||"default";var b=d.get(h);if(!b){var E={loading:0,preload:null};if(b=i.querySelector(no(h)))E.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Xa.get(h))&&th(e,r);var k=b=i.createElement("link");dt(k),Zn(k,"link",e),k._p=new Promise(function(F,J){k.onload=F,k.onerror=J}),k.addEventListener("load",function(){E.loading|=1}),k.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ku(b,n,i)}b={type:"stylesheet",instance:b,count:1,state:E},d.set(h,b)}}}function cS(e,n){tl.X(e,n);var r=Ks;if(r&&e){var i=it(r).hoistableScripts,d=Js(e),h=i.get(d);h||(h=r.querySelector(ao(d)),h||(e=y({src:e,async:!0},n),(n=Xa.get(d))&&nh(e,n),h=r.createElement("script"),dt(h),Zn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function dS(e,n){tl.M(e,n);var r=Ks;if(r&&e){var i=it(r).hoistableScripts,d=Js(e),h=i.get(d);h||(h=r.querySelector(ao(d)),h||(e=y({src:e,async:!0,type:"module"},n),(n=Xa.get(d))&&nh(e,n),h=r.createElement("script"),dt(h),Zn(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function Jv(e,n,r,i){var d=(d=je.current)?Qu(d):null;if(!d)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Zs(r.href),r=it(d).hoistableStyles,i=r.get(n),i||(i={type:"style",instance:null,count:0,state:null},r.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Zs(r.href);var h=it(d).hoistableStyles,b=h.get(e);if(b||(d=d.ownerDocument||d,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,b),(h=d.querySelector(no(e)))&&!h._p&&(b.instance=h,b.state.loading=5),Xa.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Xa.set(e,r),h||fS(d,e,r,b.state))),n&&i===null)throw Error(s(528,""));return b}if(n&&i!==null)throw Error(s(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Js(r),r=it(d).hoistableScripts,i=r.get(n),i||(i={type:"script",instance:null,count:0,state:null},r.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Zs(e){return'href="'+Gn(e)+'"'}function no(e){return'link[rel="stylesheet"]['+e+"]"}function Wv(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function fS(e,n,r,i){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=e.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),Zn(n,"link",r),dt(n),e.head.appendChild(n))}function Js(e){return'[src="'+Gn(e)+'"]'}function ao(e){return"script[async]"+e}function ey(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var i=e.querySelector('style[data-href~="'+Gn(r.href)+'"]');if(i)return n.instance=i,dt(i),i;var d=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),dt(i),Zn(i,"style",d),Ku(i,r.precedence,e),n.instance=i;case"stylesheet":d=Zs(r.href);var h=e.querySelector(no(d));if(h)return n.state.loading|=4,n.instance=h,dt(h),h;i=Wv(r),(d=Xa.get(d))&&th(i,d),h=(e.ownerDocument||e).createElement("link"),dt(h);var b=h;return b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),Zn(h,"link",i),n.state.loading|=4,Ku(h,r.precedence,e),n.instance=h;case"script":return h=Js(r.src),(d=e.querySelector(ao(h)))?(n.instance=d,dt(d),d):(i=r,(d=Xa.get(h))&&(i=y({},r),nh(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),dt(d),Zn(d,"link",i),e.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(i=n.instance,n.state.loading|=4,Ku(i,r.precedence,e));return n.instance}function Ku(e,n,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,h=d,b=0;b<i.length;b++){var E=i[b];if(E.dataset.precedence===n)h=E;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function th(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function nh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Zu=null;function ty(e,n,r){if(Zu===null){var i=new Map,d=Zu=new Map;d.set(r,i)}else d=Zu,i=d.get(r),i||(i=new Map,d.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var h=r[d];if(!(h[Ze]||h[ve]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var b=h.getAttribute(n)||"";b=e+b;var E=i.get(b);E?E.push(h):i.set(b,[h])}}return i}function ny(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function hS(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function ay(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function mS(e,n,r,i){if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Zs(i.href),h=n.querySelector(no(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Ju.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,dt(h);return}h=n.ownerDocument||n,i=Wv(i),(d=Xa.get(d))&&th(i,d),h=h.createElement("link"),dt(h);var b=h;b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),Zn(h,"link",i),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Ju.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var ah=0;function pS(e,n){return e.stylesheets&&e.count===0&&ec(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&ec(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&ah===0&&(ah=62500*Q1());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ec(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>ah?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function Ju(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ec(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Wu=null;function ec(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wu=new Map,n.forEach(gS,e),Wu=null,Ju.call(e))}function gS(e,n){if(!(n.state.loading&4)){var r=Wu.get(e);if(r)var i=r.get(null);else{r=new Map,Wu.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var b=d[h];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(r.set(b.dataset.precedence,b),i=b)}i&&r.set(null,i)}d=n.instance,b=d.getAttribute("data-precedence"),h=r.get(b)||i,h===i&&r.set(null,d),r.set(b,d),this.count++,i=Ju.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var ro={$$typeof:q,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function vS(e,n,r,i,d,h,b,E,k){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=Ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ht(0),this.hiddenUpdates=Ht(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function ry(e,n,r,i,d,h,b,E,k,F,J,ie){return e=new vS(e,n,r,b,k,F,J,ie,E),n=1,h===!0&&(n|=24),h=Aa(3,null,null,n),e.current=h,h.stateNode=e,n=Ld(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:i,isDehydrated:r,cache:n},Hd(h),e}function ly(e){return e?(e=As,e):As}function sy(e,n,r,i,d,h){d=ly(d),i.context===null?i.context=d:i.pendingContext=d,i=pl(n),i.payload={element:r},h=h===void 0?null:h,h!==null&&(i.callback=h),r=gl(e,i,n),r!==null&&(Na(r,e,n),zi(r,e,n))}function iy(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function rh(e,n){iy(e,n),(e=e.alternate)&&iy(e,n)}function oy(e){if(e.tag===13||e.tag===31){var n=Wl(e,67108864);n!==null&&Na(n,e,67108864),rh(e,67108864)}}function uy(e){if(e.tag===13||e.tag===31){var n=_a();n=M(n);var r=Wl(e,n);r!==null&&Na(r,e,n),rh(e,n)}}var tc=!0;function yS(e,n,r,i){var d=U.T;U.T=null;var h=B.p;try{B.p=2,lh(e,n,r,i)}finally{B.p=h,U.T=d}}function xS(e,n,r,i){var d=U.T;U.T=null;var h=B.p;try{B.p=8,lh(e,n,r,i)}finally{B.p=h,U.T=d}}function lh(e,n,r,i){if(tc){var d=sh(i);if(d===null)Ff(e,n,i,nc,r),dy(e,i);else if(SS(d,e,n,r,i))i.stopPropagation();else if(dy(e,i),n&4&&-1<bS.indexOf(e)){for(;d!==null;){var h=We(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var b=St(h.pendingLanes);if(b!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var k=1<<31-Kt(b);E.entanglements[1]|=k,b&=~k}Er(h),(Ot&6)===0&&(Bu=tn()+500,Ji(0))}}break;case 31:case 13:E=Wl(h,2),E!==null&&Na(E,h,2),$u(),rh(h,2)}if(h=sh(i),h===null&&Ff(e,n,i,nc,r),h===d)break;d=h}d!==null&&i.stopPropagation()}else Ff(e,n,i,null,r)}}function sh(e){return e=_r(e),ih(e)}var nc=null;function ih(e){if(nc=null,e=$t(e),e!==null){var n=u(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=f(n),e!==null)return e;e=null}else if(r===31){if(e=m(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return nc=e,null}function cy(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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(da()){case fa:return 2;case Wn:return 8;case qn:case he:return 32;case Ce:return 268435456;default:return 32}default:return 32}}var oh=!1,Tl=null,Cl=null,Al=null,lo=new Map,so=new Map,Dl=[],bS="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 dy(e,n){switch(e){case"focusin":case"focusout":Tl=null;break;case"dragenter":case"dragleave":Cl=null;break;case"mouseover":case"mouseout":Al=null;break;case"pointerover":case"pointerout":lo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":so.delete(n.pointerId)}}function io(e,n,r,i,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[d]},n!==null&&(n=We(n),n!==null&&oy(n)),e):(e.eventSystemFlags|=i,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function SS(e,n,r,i,d){switch(n){case"focusin":return Tl=io(Tl,e,n,r,i,d),!0;case"dragenter":return Cl=io(Cl,e,n,r,i,d),!0;case"mouseover":return Al=io(Al,e,n,r,i,d),!0;case"pointerover":var h=d.pointerId;return lo.set(h,io(lo.get(h)||null,e,n,r,i,d)),!0;case"gotpointercapture":return h=d.pointerId,so.set(h,io(so.get(h)||null,e,n,r,i,d)),!0}return!1}function fy(e){var n=$t(e.target);if(n!==null){var r=u(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,se(e.priority,function(){uy(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,se(e.priority,function(){uy(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ac(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=sh(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Ta=i,r.target.dispatchEvent(i),Ta=null}else return n=We(r),n!==null&&oy(n),e.blockedOn=r,!1;n.shift()}return!0}function hy(e,n,r){ac(e)&&r.delete(n)}function wS(){oh=!1,Tl!==null&&ac(Tl)&&(Tl=null),Cl!==null&&ac(Cl)&&(Cl=null),Al!==null&&ac(Al)&&(Al=null),lo.forEach(hy),so.forEach(hy)}function rc(e,n){e.blockedOn===n&&(e.blockedOn=null,oh||(oh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,wS)))}var lc=null;function my(e){lc!==e&&(lc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){lc===e&&(lc=null);for(var n=0;n<e.length;n+=3){var r=e[n],i=e[n+1],d=e[n+2];if(typeof i!="function"){if(ih(i||r)===null)continue;break}var h=We(r);h!==null&&(e.splice(n,3),n-=3,lf(h,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Ws(e){function n(k){return rc(k,e)}Tl!==null&&rc(Tl,e),Cl!==null&&rc(Cl,e),Al!==null&&rc(Al,e),lo.forEach(n),so.forEach(n);for(var r=0;r<Dl.length;r++){var i=Dl[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Dl.length&&(r=Dl[0],r.blockedOn===null);)fy(r),r.blockedOn===null&&Dl.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var d=r[i],h=r[i+1],b=d[De]||null;if(typeof h=="function")b||my(r);else if(b){var E=null;if(h&&h.hasAttribute("formAction")){if(d=h,b=h[De]||null)E=b.formAction;else if(ih(d)!==null)continue}else E=b.action;typeof E=="function"?r[i+1]=E:(r.splice(i,3),i-=3),my(r)}}}function py(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(b){return d=b})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function uh(e){this._internalRoot=e}sc.prototype.render=uh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));var r=n.current,i=_a();sy(r,i,e,n,null,null)},sc.prototype.unmount=uh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;sy(e.current,2,null,e,null,null),$u(),n[Re]=null}};function sc(e){this._internalRoot=e}sc.prototype.unstable_scheduleHydration=function(e){if(e){var n=K();e={blockedOn:null,target:e,priority:n};for(var r=0;r<Dl.length&&n!==0&&n<Dl[r].priority;r++);Dl.splice(r,0,e),r===0&&fy(e)}};var gy=a.version;if(gy!=="19.2.7")throw Error(s(527,gy,"19.2.7"));B.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=g(n),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var ES={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{qe=ic.inject(ES),Z=ic}catch{}}return uo.createRoot=function(e,n){if(!o(e))throw Error(s(299));var r=!1,i="",d=Eg,h=Ng,b=Rg;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError)),n=ry(e,1,!1,null,null,r,i,null,d,h,b,py),e[Re]=n.current,Yf(e),new uh(n)},uo.hydrateRoot=function(e,n,r){if(!o(e))throw Error(s(299));var i=!1,d="",h=Eg,b=Ng,E=Rg,k=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(E=r.onRecoverableError),r.formState!==void 0&&(k=r.formState)),n=ry(e,1,!0,n,r??null,i,d,k,h,b,E,py),n.context=ly(null),r=n.current,i=_a(),i=M(i),d=pl(i),d.callback=null,gl(r,d,i),r=i,n.current.lanes=r,ht(n,r),Er(n),e[Re]=n.current,Yf(e),new sc(n)},uo.version="19.2.7",uo}var jy;function US(){if(jy)return fh.exports;jy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(a){console.error(a)}}return t(),fh.exports=zS(),fh.exports}var BS=US();/**
50
+ * react-router v7.18.0
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var Xx=t=>{throw TypeError(t)},Qx=(t,a,l)=>a.has(t)||Xx("Cannot "+l),Qa=(t,a,l)=>(Qx(t,a,"read from private field"),l?l.call(t):a.get(t)),bo=(t,a,l)=>a.has(t)?Xx("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,l),Nr=(t,a,l,s)=>(Qx(t,a,"write to private field"),a.set(t,l),l),qc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,tm=/^[\\/]{2}/;function Kx(t,a){return a+t.replace(/\\/g,"/")}var Ty="popstate";function Cy(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function HS(t={}){function a(s,o){var g;let u=(g=o.state)==null?void 0:g.masked,{pathname:f,search:m,hash:p}=u||s.location;return ko("",{pathname:f,search:m,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function l(s,o){return typeof o=="string"?o:Ar(o)}return qS(a,l,null,t)}function tt(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function bn(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function $S(){return Math.random().toString(36).substring(2,10)}function Ay(t,a){return{usr:t.state,key:t.key,idx:a,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function ko(t,a,l=null,s,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?Dr(a):a,state:l,key:a&&a.key||s||$S(),mask:o}}function Ar({pathname:t="/",search:a="",hash:l=""}){return a&&a!=="?"&&(t+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(t+=l.charAt(0)==="#"?l:"#"+l),t}function Dr(t){let a={};if(t){let l=t.indexOf("#");l>=0&&(a.hash=t.substring(l),t=t.substring(0,l));let s=t.indexOf("?");s>=0&&(a.search=t.substring(s),t=t.substring(0,s)),t&&(a.pathname=t)}return a}function qS(t,a,l,s={}){let{window:o=document.defaultView,v5Compat:u=!1}=s,f=o.history,m="POP",p=null,g=x();g==null&&(g=0,f.replaceState({...f.state,idx:g},""));function x(){return(f.state||{idx:null}).idx}function y(){m="POP";let R=x(),L=R==null?null:R-g;g=R,p&&p({action:m,location:A.location,delta:L})}function N(R,L){m="PUSH";let I=Cy(R)?R:ko(A.location,R,L);g=x()+1;let q=Ay(I,g),X=A.createHref(I.mask||I);try{f.pushState(q,"",X)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;o.location.assign(X)}u&&p&&p({action:m,location:A.location,delta:1})}function w(R,L){m="REPLACE";let I=Cy(R)?R:ko(A.location,R,L);g=x();let q=Ay(I,g),X=A.createHref(I.mask||I);f.replaceState(q,"",X),u&&p&&p({action:m,location:A.location,delta:0})}function S(R){return Zx(o,R)}let A={get action(){return m},get location(){return t(o,f)},listen(R){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Ty,y),p=R,()=>{o.removeEventListener(Ty,y),p=null}},createHref(R){return a(o,R)},createURL:S,encodeLocation(R){let L=S(R);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:N,replace:w,go(R){return f.go(R)}};return A}function Zx(t,a,l=!1){let s="http://localhost";t&&(s=t.location.origin!=="null"?t.location.origin:t.location.href),tt(s,"No window.location.(origin|href) available to create URL");let o=typeof a=="string"?a:Ar(a);return o=o.replace(/ $/,"%20"),!l&&tm.test(o)&&(o=s+o),new URL(o,s)}var So,Dy=class{constructor(t){if(bo(this,So,new Map),t)for(let[a,l]of t)this.set(a,l)}get(t){if(Qa(this,So).has(t))return Qa(this,So).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Qa(this,So).set(t,a)}};So=new WeakMap;var IS=new Set(["lazy","caseSensitive","path","id","index","children"]);function VS(t){return IS.has(t)}var YS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function FS(t){return YS.has(t)}function PS(t){return t.index===!0}function Oo(t,a,l=[],s={},o=!1){return t.map((u,f)=>{let m=[...l,String(f)],p=typeof u.id=="string"?u.id:m.join("-");if(tt(u.index!==!0||!u.children,"Cannot specify children on an index route"),tt(o||!s[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),PS(u)){let g={...u,id:p};return s[p]=ky(g,a(g)),g}else{let g={...u,id:p,children:void 0};return s[p]=ky(g,a(g)),u.children&&(g.children=Oo(u.children,a,m,s,o)),g}})}function ky(t,a){return Object.assign(t,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...t.lazy,...a.lazy}}:{}})}function Jx(t,a,l="/"){return or(t,a,l,!1)}function or(t,a,l,s,o){let u=typeof a=="string"?Dr(a):a,f=Wa(u.pathname||"/",l);if(f==null)return null;let m=o??bc(t),p=null,g=rw(f);for(let x=0;p==null&&x<m.length;++x)p=aw(m[x],g,s);return p}function GS(t,a){let{route:l,pathname:s,params:o}=t;return{id:l.id,pathname:s,params:o,data:a[l.id],loaderData:a[l.id],handle:l.handle}}function bc(t){let a=Wx(t);return XS(a),a}function Wx(t,a=[],l=[],s="",o=!1){let u=(f,m,p=o,g)=>{let x={relativePath:g===void 0?f.path||"":g,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&p)return;tt(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let y=Ja([s,x.relativePath]),N=l.concat(x);f.children&&f.children.length>0&&(tt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Wx(f.children,a,N,y,p)),!(f.path==null&&!f.index)&&a.push({path:y,score:tw(y,f.index),routesMeta:N.map((w,S)=>{let[A,R]=nb(w.relativePath,w.caseSensitive,S===N.length-1);return{...w,matcher:A,compiledParams:R}})})};return t.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))u(f,m);else for(let g of eb(f.path))u(f,m,!0,g)}),a}function eb(t){let a=t.split("/");if(a.length===0)return[];let[l,...s]=a,o=l.endsWith("?"),u=l.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let f=eb(s.join("/")),m=[];return m.push(...f.map(p=>p===""?u:[u,p].join("/"))),o&&m.push(...f),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function XS(t){t.sort((a,l)=>a.score!==l.score?l.score-a.score:nw(a.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}var QS=/^:[\w-]+$/,KS=3,ZS=2,JS=1,WS=10,ew=-2,Oy=t=>t==="*";function tw(t,a){let l=t.split("/"),s=l.length;return l.some(Oy)&&(s+=ew),a&&(s+=ZS),l.filter(o=>!Oy(o)).reduce((o,u)=>o+(QS.test(u)?KS:u===""?JS:WS),s)}function nw(t,a){return t.length===a.length&&t.slice(0,-1).every((s,o)=>s===a[o])?t[t.length-1]-a[a.length-1]:0}function aw(t,a,l=!1){let{routesMeta:s}=t,o={},u="/",f=[];for(let m=0;m<s.length;++m){let p=s[m],g=m===s.length-1,x=u==="/"?a:a.slice(u.length)||"/",y={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},N=p.matcher&&p.compiledParams?tb(y,x,p.matcher,p.compiledParams):Cc(y,x),w=p.route;if(!N&&g&&l&&!s[s.length-1].route.index&&(N=Cc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!N)return null;Object.assign(o,N.params),f.push({params:o,pathname:Ja([u,N.pathname]),pathnameBase:iw(Ja([u,N.pathnameBase])),route:w}),N.pathnameBase!=="/"&&(u=Ja([u,N.pathnameBase]))}return f}function Cc(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[l,s]=nb(t.path,t.caseSensitive,t.end);return tb(t,a,l,s)}function tb(t,a,l,s){let o=a.match(l);if(!o)return null;let u=o[0],f=u.replace(/(.)\/+$/,"$1"),m=o.slice(1);return{params:s.reduce((g,{paramName:x,isOptional:y},N)=>{if(x==="*"){let S=m[N]||"";f=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const w=m[N];return y&&!w?g[x]=void 0:g[x]=(w||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:t}}function nb(t,a=!1,l=!0){bn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p,g,x)=>{if(s.push({paramName:m,isOptional:p!=null}),p){let y=x.charAt(g+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(s.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,a?void 0:"i"),s]}function rw(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return bn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),t}}function Wa(t,a){if(a==="/")return t;if(!t.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,s=t.charAt(l);return s&&s!=="/"?null:t.slice(l)||"/"}function lw({basename:t,pathname:a}){return a==="/"?t:Ja([t,a])}var nm=t=>qc.test(t);function sw(t,a="/"){let{pathname:l,search:s="",hash:o=""}=typeof t=="string"?Dr(t):t,u;return l?(l=rm(l),l.startsWith("/")?u=My(l.substring(1),"/"):u=My(l,a)):u=a,{pathname:u,search:ow(s),hash:uw(o)}}function My(t,a){let l=Ac(a).split("/");return t.split("/").forEach(o=>{o===".."?l.length>1&&l.pop():o!=="."&&l.push(o)}),l.length>1?l.join("/"):"/"}function gh(t,a,l,s){return`Cannot include a '${t}' character in a manually specified \`to.${a}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ab(t){return t.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function am(t){let a=ab(t);return a.map((l,s)=>s===a.length-1?l.pathname:l.pathnameBase)}function Ic(t,a,l,s=!1){let o;typeof t=="string"?o=Dr(t):(o={...t},tt(!o.pathname||!o.pathname.includes("?"),gh("?","pathname","search",o)),tt(!o.pathname||!o.pathname.includes("#"),gh("#","pathname","hash",o)),tt(!o.search||!o.search.includes("#"),gh("#","search","hash",o)));let u=t===""||o.pathname==="",f=u?"/":o.pathname,m;if(f==null)m=l;else{let y=a.length-1;if(!s&&f.startsWith("..")){let N=f.split("/");for(;N[0]==="..";)N.shift(),y-=1;o.pathname=N.join("/")}m=y>=0?a[y]:"/"}let p=sw(o,m),g=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var rm=t=>t.replace(/[\\/]{2,}/g,"/"),Ja=t=>rm(t.join("/")),Ac=t=>t.replace(/\/+$/,""),iw=t=>Ac(t).replace(/^\/*/,"/"),ow=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,uw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Ua=(t,a=302)=>{let l=a;typeof l=="number"?l={status:l}:typeof l.status>"u"&&(l.status=302);let s=new Headers(l.headers);return s.set("Location",t),new Response(null,{...l,headers:s})},cw=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Uo=class{constructor(t,a,l,s=!1){this.status=t,this.statusText=a||"",this.internal=s,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function fi(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Bo(t){let a=t.map(l=>l.route.path).filter(Boolean);return Ja(a)||"/"}var rb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lb(t,a){let l=t;if(typeof l!="string"||!qc.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let s=l,o=!1;if(rb)try{let u=new URL(window.location.href),f=tm.test(l)?new URL(Kx(l,u.protocol)):new URL(l),m=Wa(f.pathname,a);f.origin===u.origin&&m!=null?l=m+f.search+f.hash:o=!0}catch{bn(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:l}}var Ul=Symbol("Uninstrumented");function dw(t,a){let l={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(o=>o({id:a.id,index:a.index,path:a.path,instrument(u){let f=Object.keys(l);for(let m of f)u[m]&&l[m].push(u[m])}}));let s={};if(typeof a.lazy=="function"&&l.lazy.length>0){let o=oi(l.lazy,a.lazy,()=>{});o&&(s.lazy=o)}if(typeof a.lazy=="object"){let o=a.lazy;["middleware","loader","action"].forEach(u=>{let f=o[u],m=l[`lazy.${u}`];if(typeof f=="function"&&m.length>0){let p=oi(m,f,()=>{});p&&(s.lazy=Object.assign(s.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(o=>{let u=a[o];if(typeof u=="function"&&l[o].length>0){let f=u[Ul]??u,m=oi(l[o],f,(...p)=>_y(p[0]));m&&(o==="loader"&&f.hydrate===!0&&(m.hydrate=!0),m[Ul]=f,s[o]=m)}}),a.middleware&&a.middleware.length>0&&l.middleware.length>0&&(s.middleware=a.middleware.map(o=>{let u=o[Ul]??o,f=oi(l.middleware,u,(...m)=>_y(m[0]));return f?(f[Ul]=u,f):o})),s}function fw(t,a){let l={navigate:[],fetch:[]};if(a.forEach(s=>s({instrument(o){let u=Object.keys(o);for(let f of u)o[f]&&l[f].push(o[f])}})),l.navigate.length>0){let s=t.navigate[Ul]??t.navigate,o=oi(l.navigate,s,(...u)=>{let[f,m]=u;return{to:typeof f=="number"||typeof f=="string"?f:f?Ar(f):".",...Ly(t,m??{})}});o&&(o[Ul]=s,t.navigate=o)}if(l.fetch.length>0){let s=t.fetch[Ul]??t.fetch,o=oi(l.fetch,s,(...u)=>{let[f,,m,p]=u;return{href:m??".",fetcherKey:f,...Ly(t,p??{})}});o&&(o[Ul]=s,t.fetch=o)}return t}function oi(t,a,l){return t.length===0?null:async(...s)=>{let o=await sb(t,l(...s),()=>a(...s),t.length-1);if(o.type==="error")throw o.value;return o.value}}async function sb(t,a,l,s){let o=t[s],u;if(o){let f,m=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=sb(t,a,l,s-1),u=await f,tt(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(m,a)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await m(),await f}else try{u={type:"success",value:await l()}}catch(f){u={type:"error",value:f}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function _y(t){let{request:a,context:l,params:s,pattern:o}=t;return{request:hw(a),params:{...s},pattern:o,context:mw(l)}}function Ly(t,a){return{currentUrl:Ar(t.state.location),..."formMethod"in a?{formMethod:a.formMethod}:{},..."formEncType"in a?{formEncType:a.formEncType}:{},..."formData"in a?{formData:a.formData}:{},..."body"in a?{body:a.body}:{}}}function hw(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function mw(t){if(gw(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var pw=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gw(t){if(t===null||typeof t!="object")return!1;const a=Object.getPrototypeOf(t);return a===Object.prototype||a===null||Object.getOwnPropertyNames(a).sort().join("\0")===pw}var ib=["POST","PUT","PATCH","DELETE"],vw=new Set(ib),yw=["GET",...ib],xw=new Set(yw),ob=new Set([301,302,303,307,308]),bw=new Set([307,308]),vh={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ub={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},co={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Sw=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),cb="remix-router-transitions",db=Symbol("ResetLoaderData"),fs,li,Ml,si,ww=class{constructor(t){bo(this,fs),bo(this,li),bo(this,Ml),bo(this,si),Nr(this,fs,t),Nr(this,li,bc(t))}get stableRoutes(){return Qa(this,fs)}get activeRoutes(){return Qa(this,Ml)??Qa(this,fs)}get branches(){return Qa(this,si)??Qa(this,li)}get hasHMRRoutes(){return Qa(this,Ml)!=null}setRoutes(t){Nr(this,fs,t),Nr(this,li,bc(t))}setHmrRoutes(t){Nr(this,Ml,t),Nr(this,si,bc(t))}commitHmrRoutes(){Qa(this,Ml)&&(Nr(this,fs,Qa(this,Ml)),Nr(this,li,Qa(this,si)),Nr(this,Ml,void 0),Nr(this,si,void 0))}};fs=new WeakMap;li=new WeakMap;Ml=new WeakMap;si=new WeakMap;function Ew(t){const a=t.window?t.window:typeof window<"u"?window:void 0,l=typeof a<"u"&&typeof a.document<"u"&&typeof a.document.createElement<"u";tt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=t.hydrationRouteProperties||[],o=t.mapRouteProperties||Sw,u=o;if(t.instrumentations){let D=t.instrumentations;u=M=>({...o(M),...dw(D.map($=>$.route).filter(Boolean),M)})}let f={},m=new ww(Oo(t.routes,u,void 0,f)),p=t.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=t.dataStrategy||Cw,x={...t.future},y=null,N=new Set,w=null,S=null,A=null,R=null,L=t.hydrationData!=null,I=or(m.activeRoutes,t.history.location,p,!1,m.branches),q=!1,X=null,W,ae;if(I==null&&!t.patchRoutesOnNavigation){let D=Ka(404,{pathname:t.history.location.pathname}),{matches:M,route:$}=oc(m.activeRoutes);W=!0,ae=!W,I=M,X={[$.id]:D}}else if(I&&!t.hydrationData&&Ht(I,m.activeRoutes,t.history.location.pathname).active&&(I=null),I)if(I.some(D=>D.route.lazy))W=!1,ae=!W;else if(!I.some(D=>lm(D.route)))W=!0,ae=!W;else{let D=t.hydrationData?t.hydrationData.loaderData:null,M=t.hydrationData?t.hydrationData.errors:null,$=I;if(M){let K=I.findIndex(se=>M[se.route.id]!==void 0);$=$.slice(0,K+1)}ae=!1,W=!0,$.forEach(K=>{let se=fb(K.route,D,M);ae=ae||se.renderFallback,W=W&&!se.shouldLoad})}else{W=!1,ae=!W,I=[];let D=Ht(null,m.activeRoutes,t.history.location.pathname);D.active&&D.matches&&(q=!0,I=D.matches)}let z,T={historyAction:t.history.action,location:t.history.location,matches:I,initialized:W,renderFallback:ae,navigation:vh,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||X,fetchers:new Map,blockers:new Map},ee="POP",fe=null,be=!1,ye,te=!1,re=new Map,ge=null,U=!1,B=!1,ue=new Set,de=new Map,we=0,C=-1,V=new Map,ne=new Set,me=new Map,Ne=new Map,je=new Set,ze=new Map,ut,Ge=null;function nt(){if(y=t.history.listen(({action:D,location:M,delta:$})=>{if(ut){ut(),ut=void 0;return}bn(ze.size===0||$!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let K=yt({currentLocation:T.location,nextLocation:M,historyAction:D});if(K&&$!=null){let se=new Promise(Te=>{ut=Te});t.history.go($*-1),vt(K,{state:"blocked",location:M,proceed(){vt(K,{state:"proceeding",proceed:void 0,reset:void 0,location:M}),se.then(()=>t.history.go($))},reset(){let Te=new Map(T.blockers);Te.set(K,co),ft({blockers:Te})}}),fe==null||fe.resolve(),fe=null;return}return Ut(D,M)}),l){Gw(a,re);let D=()=>Xw(a,re);a.addEventListener("pagehide",D),ge=()=>a.removeEventListener("pagehide",D)}return T.initialized||Ut("POP",T.location,{initialHydration:!0}),z}function Sn(){y&&y(),ge&&ge(),N.clear(),ye&&ye.abort(),T.fetchers.forEach((D,M)=>qe(T.fetchers,M)),T.blockers.forEach((D,M)=>Me(M))}function Xt(D){if(N.add(D),w){let{newErrors:M}=w;w=null,D(T,{deletedFetchers:[],newErrors:M,viewTransitionOpts:void 0,flushSync:!1})}return()=>N.delete(D)}function ft(D,M={}){D.matches&&(D.matches=D.matches.map(se=>{let Te=f[se.route.id],ve=se.route;return ve.element!==Te.element||ve.errorElement!==Te.errorElement||ve.hydrateFallbackElement!==Te.hydrateFallbackElement?{...se,route:Te}:se})),T={...T,...D};let $=[],K=[];T.fetchers.forEach((se,Te)=>{se.state==="idle"&&(je.has(Te)?$.push(Te):K.push(Te))}),je.forEach(se=>{!T.fetchers.has(se)&&!de.has(se)&&$.push(se)}),N.size===0&&(w={newErrors:D.errors??null}),[...N].forEach(se=>se(T,{deletedFetchers:$,newErrors:D.errors??null,viewTransitionOpts:M.viewTransitionOpts,flushSync:M.flushSync===!0})),$.forEach(se=>qe(T.fetchers,se)),K.forEach(se=>T.fetchers.delete(se))}function oe(D,M,{flushSync:$}={}){var Ue,Xe;let K=T.actionData!=null&&T.navigation.formMethod!=null&&oa(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Ue=D.state)==null?void 0:Ue._isRedirect)!==!0,se;M.actionData?Object.keys(M.actionData).length>0?se=M.actionData:se=null:K?se=T.actionData:se=null;let Te=M.loaderData?Fy(T.loaderData,M.loaderData,M.matches||[],M.errors):T.loaderData,ve=T.blockers;ve.size>0&&(ve=new Map(ve),ve.forEach((ke,Ze)=>ve.set(Ze,co)));let De=U?!1:Zt(D,M.matches||T.matches),Re=be===!0||T.navigation.formMethod!=null&&oa(T.navigation.formMethod)&&((Xe=D.state)==null?void 0:Xe._isRedirect)!==!0;m.commitHmrRoutes(),U||ee==="POP"||(ee==="PUSH"?t.history.push(D,D.state):ee==="REPLACE"&&t.history.replace(D,D.state));let _e;if(ee==="POP"){let ke=re.get(T.location.pathname);ke&&ke.has(D.pathname)?_e={currentLocation:T.location,nextLocation:D}:re.has(D.pathname)&&(_e={currentLocation:D,nextLocation:T.location})}else if(te){let ke=re.get(T.location.pathname);ke?ke.add(D.pathname):(ke=new Set([D.pathname]),re.set(T.location.pathname,ke)),_e={currentLocation:T.location,nextLocation:D}}ft({...M,actionData:se,loaderData:Te,historyAction:ee,location:D,initialized:!0,renderFallback:!1,navigation:vh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:Re,blockers:ve},{viewTransitionOpts:_e,flushSync:$===!0}),ee="POP",be=!1,te=!1,U=!1,B=!1,fe==null||fe.resolve(),fe=null,Ge==null||Ge.resolve(),Ge=null}async function $e(D,M){if(fe==null||fe.resolve(),fe=null,typeof D=="number"){fe||(fe=Qy());let Ie=fe.promise;return t.history.go(D),Ie}let $=qh(T.location,T.matches,p,D,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:K,submission:se,error:Te}=zy(!1,$,M),ve;M!=null&&M.mask&&(ve={pathname:"",search:"",hash:"",...typeof M.mask=="string"?Dr(M.mask):{...T.location.mask,...M.mask}});let De=T.location,Re=ko(De,K,M&&M.state,void 0,ve);Re={...Re,...t.history.encodeLocation(Re)};let _e=M&&M.replace!=null?M.replace:void 0,Ue="PUSH";_e===!0?Ue="REPLACE":_e===!1||se!=null&&oa(se.formMethod)&&se.formAction===T.location.pathname+T.location.search&&(Ue="REPLACE");let Xe=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,ke=(M&&M.flushSync)===!0,Ze=yt({currentLocation:De,nextLocation:Re,historyAction:Ue});if(Ze){vt(Ze,{state:"blocked",location:Re,proceed(){vt(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:Re}),$e(D,M)},reset(){let Ie=new Map(T.blockers);Ie.set(Ze,co),ft({blockers:Ie})}});return}await Ut(Ue,Re,{submission:se,pendingError:Te,preventScrollReset:Xe,replace:M&&M.replace,enableViewTransition:M&&M.viewTransition,flushSync:ke,callSiteDefaultShouldRevalidate:M&&M.defaultShouldRevalidate})}function at(){Ge||(Ge=Qy()),qn(),ft({revalidation:"loading"});let D=Ge.promise;return T.navigation.state==="submitting"?D:T.navigation.state==="idle"?(Ut(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),D):(Ut(ee||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:te===!0}),D)}async function Ut(D,M,$){ye&&ye.abort(),ye=null,ee=D,U=($&&$.startUninterruptedRevalidation)===!0,nn(T.location,T.matches),be=($&&$.preventScrollReset)===!0,te=($&&$.enableViewTransition)===!0;let K=m.activeRoutes,se=$!=null&&$.initialHydration&&T.matches&&T.matches.length>0&&!q?T.matches:or(K,M,p,!1,m.branches),Te=($&&$.flushSync)===!0;if(se&&T.initialized&&!B&&Uw(T.location,M)&&!($&&$.submission&&oa($.submission.formMethod))){oe(M,{matches:se},{flushSync:Te});return}let ve=Ht(se,K,M.pathname);if(ve.active&&ve.matches&&(se=ve.matches),!se){let{error:We,notFoundMatches:ct,route:it}=St(M.pathname);oe(M,{matches:ct,loaderData:{},errors:{[it.id]:We}},{flushSync:Te});return}let De=$&&$.overrideNavigation?{...$.overrideNavigation,matches:se,historyAction:D}:void 0;ye=new AbortController;let Re=ii(t.history,M,ye.signal,$&&$.submission),_e=t.getContext?await t.getContext():new Dy,Ue;if($&&$.pendingError)Ue=[zl(se).route.id,{type:"error",error:$.pendingError}];else if($&&$.submission&&oa($.submission.formMethod)){let We=await pn(Re,M,$.submission,se,D,_e,ve.active,$&&$.initialHydration===!0,{replace:$.replace,flushSync:Te});if(We.shortCircuited)return;if(We.pendingActionResult){let[ct,it]=We.pendingActionResult;if(La(it)&&fi(it.error)&&it.error.status===404){ye=null,oe(M,{matches:We.matches,loaderData:{},errors:{[ct]:it.error}});return}}se=We.matches||se,Ue=We.pendingActionResult,De=yh(M,se,D,$.submission),Te=!1,ve.active=!1,Re=ii(t.history,Re.url,Re.signal)}let{shortCircuited:Xe,matches:ke,loaderData:Ze,errors:Ie,workingFetchers:$t}=await jt(Re,M,se,D,_e,ve.active,De,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,Te,Ue,$&&$.callSiteDefaultShouldRevalidate);Xe||(ye=null,oe(M,{matches:ke||se,...Py(Ue),loaderData:Ze,errors:Ie,...$t?{fetchers:$t}:{}}))}async function pn(D,M,$,K,se,Te,ve,De,Re={}){qn();let _e=Fw(M,K,se,$);if(ft({navigation:_e},{flushSync:Re.flushSync===!0}),ve){let ke=await ht(K,M.pathname,D.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){if(ke.partialMatches.length===0){let{matches:Ie,route:$t}=oc(m.activeRoutes);return{matches:Ie,pendingActionResult:[$t.id,{type:"error",error:ke.error}]}}let Ze=zl(ke.partialMatches).route.id;return{matches:ke.partialMatches,pendingActionResult:[Ze,{type:"error",error:ke.error}]}}else if(ke.matches)K=ke.matches;else{let{notFoundMatches:Ze,error:Ie,route:$t}=St(M.pathname);return{matches:Ze,pendingActionResult:[$t.id,{type:"error",error:Ie}]}}}let Ue,Xe=Sc(K,M);if(!Xe.route.action&&!Xe.route.lazy)Ue={type:"error",error:Ka(405,{method:D.method,pathname:M.pathname,routeId:Xe.route.id})};else{let ke=ci(u,f,D,M,K,Xe,De?[]:s,Te),Ze=await fa(D,M,ke,Te,null);if(Ue=Ze[Xe.route.id],!Ue){for(let Ie of K)if(Ze[Ie.route.id]){Ue=Ze[Ie.route.id];break}}if(D.signal.aborted)return{shortCircuited:!0}}if(hs(Ue)){let ke;return Re&&Re.replace!=null?ke=Re.replace:ke=Iy(Ue.response.headers.get("Location"),new URL(D.url),p,t.history)===T.location.pathname+T.location.search,await da(D,Ue,!0,{submission:$,replace:ke}),{shortCircuited:!0}}if(La(Ue)){let ke=zl(K,Xe.route.id);return(Re&&Re.replace)!==!0&&(ee="PUSH"),{matches:K,pendingActionResult:[ke.route.id,Ue,Xe.route.id]}}return{matches:K,pendingActionResult:[Xe.route.id,Ue]}}async function jt(D,M,$,K,se,Te,ve,De,Re,_e,Ue,Xe,ke,Ze){let Ie=ve||yh(M,$,K,De),$t=De||Re||Xy(Ie),We=!U&&!Ue;if(Te){if(We){let Nt=_t(ke);ft({navigation:Ie,...Nt!==void 0?{actionData:Nt}:{}},{flushSync:Xe})}let Qe=await ht($,M.pathname,D.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){if(Qe.partialMatches.length===0){let{matches:Wt,route:ta}=oc(m.activeRoutes);return{matches:Wt,loaderData:{},errors:{[ta.id]:Qe.error}}}let Nt=zl(Qe.partialMatches).route.id;return{matches:Qe.partialMatches,loaderData:{},errors:{[Nt]:Qe.error}}}else if(Qe.matches)$=Qe.matches;else{let{error:Nt,notFoundMatches:Wt,route:ta}=St(M.pathname);return{matches:Wt,loaderData:{},errors:{[ta.id]:Nt}}}}let ct=m.activeRoutes,{dsMatches:it,revalidatingFetchers:dt}=Uy(D,se,u,f,t.history,T,$,$t,M,Ue?[]:s,Ue===!0,B,ue,je,me,ne,ct,p,t.patchRoutesOnNavigation!=null,m.branches,ke,Ze);if(C=++we,!t.dataStrategy&&!it.some(Qe=>Qe.shouldLoad)&&!it.some(Qe=>Qe.route.middleware&&Qe.route.middleware.length>0)&&dt.length===0){let Qe=new Map(T.fetchers),Nt=Yn(Qe);return oe(M,{matches:$,loaderData:{},errors:ke&&La(ke[1])?{[ke[0]]:ke[1].error}:null,...Py(ke),...Nt?{fetchers:Qe}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(We){let Qe={};if(!Te){Qe.navigation=Ie;let Nt=_t(ke);Nt!==void 0&&(Qe.actionData=Nt)}dt.length>0&&(Qe.fetchers=Qt(dt)),ft(Qe,{flushSync:Xe})}dt.forEach(Qe=>{Tt(Qe.key),Qe.controller&&de.set(Qe.key,Qe.controller)});let Jt=()=>dt.forEach(Qe=>Tt(Qe.key));ye&&ye.signal.addEventListener("abort",Jt);let{loaderResults:Fn,fetcherResults:En}=await Wn(it,dt,D,M,se);if(D.signal.aborted)return{shortCircuited:!0};ye&&ye.signal.removeEventListener("abort",Jt),dt.forEach(Qe=>de.delete(Qe.key));let On=uc(Fn);if(On)return await da(D,On.result,!0,{replace:_e}),{shortCircuited:!0};if(On=uc(En),On)return ne.add(On.key),await da(D,On.result,!0,{replace:_e}),{shortCircuited:!0};let Mn=new Map(T.fetchers),{loaderData:Pn,errors:ga}=Yy(T,$,Fn,ke,dt,En,Mn);Ue&&T.errors&&(ga={...T.errors,...ga});let il=Yn(Mn),ea=gn(C,Mn),pr=il||ea||dt.length>0;return{matches:$,loaderData:Pn,errors:ga,...pr?{workingFetchers:Mn}:{}}}function _t(D){if(D&&!La(D[1]))return{[D[0]]:D[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Qt(D){let M=new Map(T.fetchers);return D.forEach($=>{let K=M.get($.key),se=fo(void 0,K?K.data:void 0);M.set($.key,se)}),M}async function Hn(D,M,$,K){Tt(D);let se=(K&&K.flushSync)===!0,Te=m.activeRoutes,ve=qh(T.location,T.matches,p,$,M,K==null?void 0:K.relative),De=or(Te,ve,p,!1,m.branches),Re=Ht(De,Te,ve);if(Re.active&&Re.matches&&(De=Re.matches),!De){Ce(D,M,Ka(404,{pathname:ve}),{flushSync:se});return}let{path:_e,submission:Ue,error:Xe}=zy(!0,ve,K);if(Xe){Ce(D,M,Xe,{flushSync:se});return}let ke=t.getContext?await t.getContext():new Dy,Ze=(K&&K.preventScrollReset)===!0;if(Ue&&oa(Ue.formMethod)){await $n(D,M,_e,De,ke,Re.active,se,Ze,Ue,K&&K.defaultShouldRevalidate);return}me.set(D,{routeId:M,path:_e}),await tn(D,M,_e,De,ke,Re.active,se,Ze,Ue)}async function $n(D,M,$,K,se,Te,ve,De,Re,_e){qn(),me.delete(D);let Ue=T.fetchers.get(D);he(D,Pw(Re,Ue),{flushSync:ve});let Xe=new AbortController,ke=ii(t.history,$,Xe.signal,Re);if(Te){let Rt=await ht(K,new URL(ke.url).pathname,ke.signal,D);if(Rt.type==="aborted")return;if(Rt.type==="error"){Ce(D,M,Rt.error,{flushSync:ve});return}else if(Rt.matches)K=Rt.matches;else{Ce(D,M,Ka(404,{pathname:$}),{flushSync:ve});return}}let Ze=Sc(K,$);if(!Ze.route.action&&!Ze.route.lazy){let Rt=Ka(405,{method:Re.formMethod,pathname:$,routeId:M});Ce(D,M,Rt,{flushSync:ve});return}de.set(D,Xe);let Ie=we,$t=ci(u,f,ke,$,K,Ze,s,se),We=await fa(ke,$,$t,se,D),ct=We[Ze.route.id];if(!ct){for(let Rt of $t)if(We[Rt.route.id]){ct=We[Rt.route.id];break}}if(ke.signal.aborted){de.get(D)===Xe&&de.delete(D);return}if(je.has(D)){if(hs(ct)||La(ct)){he(D,jr(void 0));return}}else{if(hs(ct))if(de.delete(D),C>Ie){he(D,jr(void 0));return}else return ne.add(D),he(D,fo(Re)),da(ke,ct,!1,{fetcherSubmission:Re,preventScrollReset:De});if(La(ct)){Ce(D,M,ct.error);return}}let it=T.navigation.location||T.location,dt=ii(t.history,it,Xe.signal),Jt=m.activeRoutes,Fn=T.navigation.state!=="idle"?or(Jt,T.navigation.location,p,!1,m.branches):T.matches;tt(Fn,"Didn't find any matches after fetcher action");let En=++we;V.set(D,En);let{dsMatches:On,revalidatingFetchers:Mn}=Uy(dt,se,u,f,t.history,T,Fn,Re,it,s,!1,B,ue,je,me,ne,Jt,p,t.patchRoutesOnNavigation!=null,m.branches,[Ze.route.id,ct],_e),Pn=fo(Re,ct.data),ga=new Map(T.fetchers);ga.set(D,Pn),Mn.filter(Rt=>Rt.key!==D).forEach(Rt=>{let ja=Rt.key,Gn=ga.get(ja),Fl=fo(void 0,Gn?Gn.data:void 0);ga.set(ja,Fl),Tt(ja),Rt.controller&&de.set(ja,Rt.controller)}),ft({fetchers:ga});let il=()=>Mn.forEach(Rt=>Tt(Rt.key));Xe.signal.addEventListener("abort",il);let{loaderResults:ea,fetcherResults:pr}=await Wn(On,Mn,dt,it,se);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",il),V.delete(D),de.delete(D),Mn.forEach(Rt=>de.delete(Rt.key));let Qe=T.fetchers.has(D),Nt=Rt=>{if(!Qe)return Rt;let ja=new Map(Rt.fetchers);return ja.set(D,jr(ct.data)),{...Rt,fetchers:ja}},Wt=uc(ea);if(Wt)return T=Nt(T),da(dt,Wt.result,!1,{preventScrollReset:De});if(Wt=uc(pr),Wt)return ne.add(Wt.key),T=Nt(T),da(dt,Wt.result,!1,{preventScrollReset:De});let ta=new Map(T.fetchers);Qe&&ta.set(D,jr(ct.data));let{loaderData:_n,errors:Mr}=Yy(T,Fn,ea,void 0,Mn,pr,ta);gn(En,ta),T.navigation.state==="loading"&&En>C?(tt(ee,"Expected pending action"),ye&&ye.abort(),oe(T.navigation.location,{matches:Fn,loaderData:_n,errors:Mr,fetchers:ta})):(ft({errors:Mr,loaderData:Fy(T.loaderData,_n,Fn,Mr),fetchers:ta}),B=!1)}async function tn(D,M,$,K,se,Te,ve,De,Re){let _e=T.fetchers.get(D);he(D,fo(Re,_e?_e.data:void 0),{flushSync:ve});let Ue=new AbortController,Xe=ii(t.history,$,Ue.signal);if(Te){let ct=await ht(K,new URL(Xe.url).pathname,Xe.signal,D);if(ct.type==="aborted")return;if(ct.type==="error"){Ce(D,M,ct.error,{flushSync:ve});return}else if(ct.matches)K=ct.matches;else{Ce(D,M,Ka(404,{pathname:$}),{flushSync:ve});return}}let ke=Sc(K,$);de.set(D,Ue);let Ze=we,Ie=ci(u,f,Xe,$,K,ke,s,se),$t=await fa(Xe,$,Ie,se,D),We=$t[ke.route.id];if(!We){for(let ct of K)if($t[ct.route.id]){We=$t[ct.route.id];break}}if(de.get(D)===Ue&&de.delete(D),!Xe.signal.aborted){if(je.has(D)){he(D,jr(void 0));return}if(hs(We))if(C>Ze){he(D,jr(void 0));return}else{ne.add(D),await da(Xe,We,!1,{preventScrollReset:De});return}if(La(We)){Ce(D,M,We.error);return}he(D,jr(We.data))}}async function da(D,M,$,{submission:K,fetcherSubmission:se,preventScrollReset:Te,replace:ve}={}){$||(fe==null||fe.resolve(),fe=null),M.response.headers.has("X-Remix-Revalidate")&&(B=!0);let De=M.response.headers.get("Location");tt(De,"Expected a Location header on the redirect Response"),De=Iy(De,new URL(D.url),p,t.history);let Re=ko(T.location,De,{_isRedirect:!0});if(l){let Ie=!1;if(M.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(nm(De)){const $t=Zx(a,De,!0);Ie=$t.origin!==a.location.origin||Wa($t.pathname,p)==null}if(Ie){ve?a.location.replace(De):a.location.assign(De);return}}ye=null;let _e=ve===!0||M.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Xe,formEncType:ke}=T.navigation;!K&&!se&&Ue&&Xe&&ke&&(K=Xy(T.navigation));let Ze=K||se;if(bw.has(M.response.status)&&Ze&&oa(Ze.formMethod))await Ut(_e,Re,{submission:{...Ze,formAction:De},preventScrollReset:Te||be,enableViewTransition:$?te:void 0});else{let Ie=yh(Re,[],_e,K);await Ut(_e,Re,{overrideNavigation:Ie,fetcherSubmission:se,preventScrollReset:Te||be,enableViewTransition:$?te:void 0})}}async function fa(D,M,$,K,se){var De;let Te,ve={};try{Te=await Dw(g,D,M,$,se,K,!1)}catch(Re){return $.filter(_e=>_e.shouldLoad).forEach(_e=>{ve[_e.route.id]={type:"error",error:Re}}),ve}if(D.signal.aborted)return ve;if(!oa(D.method))for(let Re of $){if(((De=Te[Re.route.id])==null?void 0:De.type)==="error")break;!Te.hasOwnProperty(Re.route.id)&&!T.loaderData.hasOwnProperty(Re.route.id)&&(!T.errors||!T.errors.hasOwnProperty(Re.route.id))&&Re.shouldCallHandler()&&(Te[Re.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Re.route.id}`)})}for(let[Re,_e]of Object.entries(Te))if(qw(_e)){let Ue=_e.result;ve[Re]={type:"redirect",response:_w(Ue,D,Re,$,p)}}else ve[Re]=await Mw(_e);return ve}async function Wn(D,M,$,K,se){let Te=fa($,K,D,se,null),ve=Promise.all(M.map(async _e=>{if(_e.matches&&_e.match&&_e.request&&_e.controller){let Xe=(await fa(_e.request,_e.path,_e.matches,se,_e.key))[_e.match.route.id];return{[_e.key]:Xe}}else return Promise.resolve({[_e.key]:{type:"error",error:Ka(404,{pathname:_e.path})}})})),De=await Te,Re=(await ve).reduce((_e,Ue)=>Object.assign(_e,Ue),{});return{loaderResults:De,fetcherResults:Re}}function qn(){B=!0,me.forEach((D,M)=>{de.has(M)&&ue.add(M),Tt(M)})}function he(D,M,$={}){let K=new Map(T.fetchers);K.set(D,M),ft({fetchers:K},{flushSync:($&&$.flushSync)===!0})}function Ce(D,M,$,K={}){let se=zl(T.matches,M),Te=new Map(T.fetchers);qe(Te,D),ft({errors:{[se.route.id]:$},fetchers:Te},{flushSync:(K&&K.flushSync)===!0})}function Ae(D){return Ne.set(D,(Ne.get(D)||0)+1),je.has(D)&&je.delete(D),T.fetchers.get(D)||ub}function Pe(D,M){Tt(D,M==null?void 0:M.reason),he(D,jr(null))}function qe(D,M){let $=T.fetchers.get(M);de.has(M)&&!($&&$.state==="loading"&&V.has(M))&&Tt(M),me.delete(M),V.delete(M),ne.delete(M),je.delete(M),ue.delete(M),D.delete(M)}function Z(D){let M=(Ne.get(D)||0)-1;M<=0?(Ne.delete(D),je.add(D)):Ne.set(D,M),ft({fetchers:new Map(T.fetchers)})}function Tt(D,M){let $=de.get(D);$&&($.abort(M),de.delete(D))}function Kt(D,M){for(let $ of D){let K=M.get($);tt(K,`Expected fetcher: ${$}`);let se=jr(K.data);M.set($,se)}}function Yn(D){let M=[],$=!1;for(let K of ne){let se=D.get(K);tt(se,`Expected fetcher: ${K}`),se.state==="loading"&&(ne.delete(K),M.push(K),$=!0)}return Kt(M,D),$}function gn(D,M){let $=[];for(let[K,se]of V)if(se<D){let Te=M.get(K);tt(Te,`Expected fetcher: ${K}`),Te.state==="loading"&&(Tt(K),V.delete(K),$.push(K))}return Kt($,M),$.length>0}function Ba(D,M){let $=T.blockers.get(D)||co;return ze.get(D)!==M&&ze.set(D,M),$}function Me(D){T.blockers.delete(D),ze.delete(D)}function vt(D,M){let $=T.blockers.get(D)||co;tt($.state==="unblocked"&&M.state==="blocked"||$.state==="blocked"&&M.state==="blocked"||$.state==="blocked"&&M.state==="proceeding"||$.state==="blocked"&&M.state==="unblocked"||$.state==="proceeding"&&M.state==="unblocked",`Invalid blocker state transition: ${$.state} -> ${M.state}`);let K=new Map(T.blockers);K.set(D,M),ft({blockers:K})}function yt({currentLocation:D,nextLocation:M,historyAction:$}){if(ze.size===0)return;ze.size>1&&bn(!1,"A router only supports one blocker at a time");let K=Array.from(ze.entries()),[se,Te]=K[K.length-1],ve=T.blockers.get(se);if(!(ve&&ve.state==="proceeding")&&Te({currentLocation:D,nextLocation:M,historyAction:$}))return se}function St(D){let M=Ka(404,{pathname:D}),$=m.activeRoutes,{matches:K,route:se}=oc($);return{notFoundMatches:K,route:se,error:M}}function Bt(D,M,$){if(S=D,R=M,A=$||null,!L&&T.navigation===vh){L=!0;let K=Zt(T.location,T.matches);K!=null&&ft({restoreScrollPosition:K})}return()=>{S=null,R=null,A=null}}function Ct(D,M){return A&&A(D,M.map(K=>GS(K,T.loaderData)))||D.key}function nn(D,M){if(S&&R){let $=Ct(D,M);S[$]=R()}}function Zt(D,M){if(S){let $=Ct(D,M),K=S[$];if(typeof K=="number")return K}return null}function Ht(D,M,$){if(t.patchRoutesOnNavigation){let K=m.branches;if(D){if(Object.keys(D[0].params).length>0)return{active:!0,matches:or(M,$,p,!0,K)}}else return{active:!0,matches:or(M,$,p,!0,K)||[]}}return{active:!1,matches:null}}async function ht(D,M,$,K){if(!t.patchRoutesOnNavigation)return{type:"success",matches:D};let se=D;for(;;){let Te=f;try{await t.patchRoutesOnNavigation({signal:$,path:M,matches:se,fetcherKey:K,patch:(_e,Ue)=>{$.aborted||By(_e,Ue,m,Te,u,!1)}})}catch(_e){return{type:"error",error:_e,partialMatches:se}}if($.aborted)return{type:"aborted"};let ve=m.branches,De=or(m.activeRoutes,M,p,!1,ve),Re=null;if(De){if(Object.keys(De[0].params).length===0)return{type:"success",matches:De};if(Re=or(m.activeRoutes,M,p,!0,ve),!(Re&&se.length<Re.length&&Je(se,Re.slice(0,se.length))))return{type:"success",matches:De}}if(Re||(Re=or(m.activeRoutes,M,p,!0,ve)),!Re||Je(se,Re))return{type:"success",matches:null};se=Re}}function Je(D,M){return D.length===M.length&&D.every(($,K)=>$.route.id===M[K].route.id)}function wn(D){f={},m.setHmrRoutes(Oo(D,u,void 0,f))}function kn(D,M,$=!1){By(D,M,m,f,u,$),m.hasHMRRoutes||ft({})}return z={get basename(){return p},get future(){return x},get state(){return T},get routes(){return m.stableRoutes},get branches(){return m.branches},get manifest(){return f},get window(){return a},initialize:nt,subscribe:Xt,enableScrollRestoration:Bt,navigate:$e,fetch:Hn,revalidate:at,createHref:D=>t.history.createHref(D),encodeLocation:D=>t.history.encodeLocation(D),getFetcher:Ae,resetFetcher:Pe,deleteFetcher:Z,dispose:Sn,getBlocker:Ba,deleteBlocker:Me,patchRoutes:kn,_internalFetchControllers:de,_internalSetRoutes:wn,_internalSetStateDoNotUseOrYouWillBreakYourApp(D){ft(D)}},t.instrumentations&&(z=fw(z,t.instrumentations.map(D=>D.router).filter(Boolean))),z}function Nw(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function qh(t,a,l,s,o,u){let f,m;if(o){f=[];for(let g of a)if(f.push(g),g.route.id===o){m=g;break}}else f=a,m=a[a.length-1];let p=Ic(s||".",am(f),Wa(t.pathname,l)||t.pathname,u==="path");if(s==null&&(p.search=t.search,p.hash=t.hash),(s==null||s===""||s===".")&&m){let g=im(p.search);if(m.route.index&&!g)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!m.route.index&&g){let x=new URLSearchParams(p.search),y=x.getAll("index");x.delete("index"),y.filter(w=>w).forEach(w=>x.append("index",w));let N=x.toString();p.search=N?`?${N}`:""}}return l!=="/"&&(p.pathname=lw({basename:l,pathname:p.pathname})),Ar(p)}function zy(t,a,l){if(!l||!Nw(l))return{path:a};if(l.formMethod&&!Yw(l.formMethod))return{path:a,error:Ka(405,{method:l.formMethod})};let s=()=>({path:a,error:Ka(400,{type:"invalid-body"})}),u=(l.formMethod||"get").toUpperCase(),f=xb(a);if(l.body!==void 0){if(l.formEncType==="text/plain"){if(!oa(u))return s();let y=typeof l.body=="string"?l.body:l.body instanceof FormData||l.body instanceof URLSearchParams?Array.from(l.body.entries()).reduce((N,[w,S])=>`${N}${w}=${S}
59
+ `,""):String(l.body);return{path:a,submission:{formMethod:u,formAction:f,formEncType:l.formEncType,formData:void 0,json:void 0,text:y}}}else if(l.formEncType==="application/json"){if(!oa(u))return s();try{let y=typeof l.body=="string"?JSON.parse(l.body):l.body;return{path:a,submission:{formMethod:u,formAction:f,formEncType:l.formEncType,formData:void 0,json:y,text:void 0}}}catch{return s()}}}tt(typeof FormData=="function","FormData is not available in this environment");let m,p;if(l.formData)m=Yh(l.formData),p=l.formData;else if(l.body instanceof FormData)m=Yh(l.body),p=l.body;else if(l.body instanceof URLSearchParams)m=l.body,p=Vy(m);else if(l.body==null)m=new URLSearchParams,p=new FormData;else try{m=new URLSearchParams(l.body),p=Vy(m)}catch{return s()}let g={formMethod:u,formAction:f,formEncType:l&&l.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(oa(g.formMethod))return{path:a,submission:g};let x=Dr(a);return t&&x.search&&im(x.search)&&m.append("index",""),x.search=`?${m}`,{path:Ar(x),submission:g}}function Uy(t,a,l,s,o,u,f,m,p,g,x,y,N,w,S,A,R,L,I,q,X,W){var U;let ae=X?La(X[1])?X[1].error:X[1].data:void 0,z=o.createURL(u.location),T=o.createURL(p),ee;if(x&&u.errors){let B=Object.keys(u.errors)[0];ee=f.findIndex(ue=>ue.route.id===B)}else if(X&&La(X[1])){let B=X[0];ee=f.findIndex(ue=>ue.route.id===B)-1}let fe=X?X[1].statusCode:void 0,be=fe&&fe>=400,ye={currentUrl:z,currentParams:((U=u.matches[0])==null?void 0:U.params)||{},nextUrl:T,nextParams:f[0].params,...m,actionResult:ae,actionStatus:fe},te=Bo(f),re=f.map((B,ue)=>{let{route:de}=B,we=null;if(ee!=null&&ue>ee)we=!1;else if(de.lazy)we=!0;else if(!lm(de))we=!1;else if(x){let{shouldLoad:me}=fb(de,u.loaderData,u.errors);we=me}else Rw(u.loaderData,u.matches[ue],B)&&(we=!0);if(we!==null)return Ih(l,s,t,p,te,B,g,a,we);let C=!1;typeof W=="boolean"?C=W:be?C=!1:(y||z.pathname+z.search===T.pathname+T.search||z.search!==T.search||jw(u.matches[ue],B))&&(C=!0);let V={...ye,defaultShouldRevalidate:C},ne=No(B,V);return Ih(l,s,t,p,te,B,g,a,ne,V,W)}),ge=[];return S.forEach((B,ue)=>{if(x||!f.some(je=>je.route.id===B.routeId)||w.has(ue))return;let de=u.fetchers.get(ue),we=de&&de.state!=="idle"&&de.data===void 0,C=or(R,B.path,L??"/",!1,q);if(!C){if(I&&we)return;ge.push({key:ue,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(A.has(ue))return;let V=Sc(C,B.path),ne=new AbortController,me=ii(o,B.path,ne.signal),Ne=null;if(N.has(ue))N.delete(ue),Ne=ci(l,s,me,B.path,C,V,g,a);else if(we)y&&(Ne=ci(l,s,me,B.path,C,V,g,a));else{let je;typeof W=="boolean"?je=W:be?je=!1:je=y;let ze={...ye,defaultShouldRevalidate:je};No(V,ze)&&(Ne=ci(l,s,me,B.path,C,V,g,a,ze))}Ne&&ge.push({key:ue,routeId:B.routeId,path:B.path,matches:Ne,match:V,request:me,controller:ne})}),{dsMatches:re,revalidatingFetchers:ge}}function lm(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function fb(t,a,l){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!lm(t))return{shouldLoad:!1,renderFallback:!1};let s=a!=null&&t.id in a,o=l!=null&&l[t.id]!==void 0;if(!s&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let u=!s&&!o;return{shouldLoad:u,renderFallback:u}}function Rw(t,a,l){let s=!a||l.route.id!==a.route.id,o=!t.hasOwnProperty(l.route.id);return s||o}function jw(t,a){let l=t.route.path;return t.pathname!==a.pathname||l!=null&&l.endsWith("*")&&t.params["*"]!==a.params["*"]}function No(t,a){if(t.route.shouldRevalidate){let l=t.route.shouldRevalidate(a);if(typeof l=="boolean")return l}return a.defaultShouldRevalidate}function By(t,a,l,s,o,u){let f;if(t){let g=s[t];tt(g,`No route found to patch children into: routeId = ${t}`),g.children||(g.children=[]),f=g.children}else f=l.activeRoutes;let m=[],p=[];if(a.forEach(g=>{let x=f.find(y=>hb(g,y));x?p.push({existingRoute:x,newRoute:g}):m.push(g)}),m.length>0){let g=Oo(m,o,[t||"_","patch",String((f==null?void 0:f.length)||"0")],s);f.push(...g)}if(u&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:x,newRoute:y}=p[g],N=x,[w]=Oo([y],o,[],{},!0);Object.assign(N,{element:w.element?w.element:N.element,errorElement:w.errorElement?w.errorElement:N.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:N.hydrateFallbackElement})}l.hasHMRRoutes||l.setRoutes([...l.activeRoutes])}function hb(t,a){var l;return"id"in t&&"id"in a&&t.id===a.id?!0:t.index===a.index&&t.path===a.path&&t.caseSensitive===a.caseSensitive?(!t.children||t.children.length===0)&&(!a.children||a.children.length===0)?!0:((l=t.children)==null?void 0:l.every((s,o)=>{var u;return(u=a.children)==null?void 0:u.some(f=>hb(s,f))}))??!1:!1}var Hy=new WeakMap,mb=({key:t,route:a,manifest:l,mapRouteProperties:s})=>{let o=l[a.id];if(tt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[t];if(!u)return;let f=Hy.get(o);f||(f={},Hy.set(o,f));let m=f[t];if(m)return m;let p=(async()=>{let g=VS(t),y=o[t]!==void 0&&t!=="hasErrorBoundary";if(g)bn(!g,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),f[t]=Promise.resolve();else if(y)bn(!1,`Route "${o.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let N=await u();N!=null&&(Object.assign(o,{[t]:N}),Object.assign(o,s(o)))}typeof o.lazy=="object"&&(o.lazy[t]=void 0,Object.values(o.lazy).every(N=>N===void 0)&&(o.lazy=void 0))})();return f[t]=p,p},$y=new WeakMap;function Tw(t,a,l,s,o){let u=l[t.id];if(tt(u,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let x=$y.get(u);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let y=(async()=>{tt(typeof t.lazy=="function","No lazy route function found");let N=await t.lazy(),w={};for(let S in N){let A=N[S];if(A===void 0)continue;let R=FS(S),I=u[S]!==void 0&&S!=="hasErrorBoundary";R?bn(!R,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):I?bn(!I,`Route "${u.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):w[S]=A}Object.assign(u,w),Object.assign(u,{...s(u),lazy:void 0})})();return $y.set(u,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let f=Object.keys(t.lazy),m=[],p;for(let x of f){if(o&&o.includes(x))continue;let y=mb({key:x,route:t,manifest:l,mapRouteProperties:s});y&&(m.push(y),x===a&&(p=y))}let g=m.length>0?Promise.all(m).then(()=>{}):void 0;return g==null||g.catch(()=>{}),p==null||p.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:p}}async function qy(t){let a=t.matches.filter(o=>o.shouldLoad),l={};return(await Promise.all(a.map(o=>o.resolve()))).forEach((o,u)=>{l[a[u].route.id]=o}),l}async function Cw(t){return t.matches.some(a=>a.route.middleware)?pb(t,()=>qy(t)):qy(t)}function pb(t,a){return Aw(t,a,s=>{if(Vw(s))throw s;return s},Hw,l);function l(s,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:s}}));{let{matches:f}=t,m=Math.min(Math.max(f.findIndex(g=>g.route.id===o),0),Math.max(f.findIndex(g=>g.shouldCallHandler()),0)),p=zl(f,f[m].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:s}})}}}async function Aw(t,a,l,s,o){let{matches:u,...f}=t,m=u.flatMap(g=>g.route.middleware?g.route.middleware.map(x=>[g.route.id,x]):[]);return await gb(f,m,a,l,s,o)}async function gb(t,a,l,s,o,u,f=0){let{request:m}=t;if(m.signal.aborted)throw m.signal.reason??new Error(`Request aborted: ${m.method} ${m.url}`);let p=a[f];if(!p)return await l();let[g,x]=p,y,N=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await gb(t,a,l,s,o,u,f+1)},y.value}catch(w){return y={value:await u(w,g,y)},y.value}};try{let w=await x(t,N),S=w!=null?s(w):void 0;return o(S)?S:y?S??y.value:(y={value:await N()},y.value)}catch(w){return await u(w,g,y)}}function vb(t,a,l,s,o){let u=mb({key:"middleware",route:s.route,manifest:a,mapRouteProperties:t}),f=Tw(s.route,oa(l.method)?"action":"loader",a,t,o);return{middleware:u,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Ih(t,a,l,s,o,u,f,m,p,g=null,x){let y=!1,N=vb(t,a,l,u,f);return{...u,_lazyPromises:N,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(w){return y=!0,g?typeof x=="boolean"?No(u,{...g,defaultShouldRevalidate:x}):typeof w=="boolean"?No(u,{...g,defaultShouldRevalidate:w}):No(u,g):p},resolve(w){let{lazy:S,loader:A,middleware:R}=u.route,L=y||p||w&&!oa(l.method)&&(S||A),I=R&&R.length>0&&!A&&!S;return L&&(oa(l.method)||!I)?kw({request:l,path:s,pattern:o,match:u,lazyHandlerPromise:N==null?void 0:N.handler,lazyRoutePromise:N==null?void 0:N.route,handlerOverride:w,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function ci(t,a,l,s,o,u,f,m,p=null){return o.map(g=>g.route.id!==u.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:vb(t,a,l,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ih(t,a,l,s,Bo(o),g,f,m,!0,p))}async function Dw(t,a,l,s,o,u,f){s.some(x=>{var y;return(y=x._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(s.map(x=>{var y;return(y=x._lazyPromises)==null?void 0:y.middleware}));let m={request:a,url:yb(a,l),pattern:Bo(s),params:s[0].params,context:u,matches:s},g=await t({...m,fetcherKey:o,runClientMiddleware:x=>{let y=m;return pb(y,()=>x({...y,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(x=>{var y,N;return[(y=x._lazyPromises)==null?void 0:y.handler,(N=x._lazyPromises)==null?void 0:N.route]}))}catch{}return g}async function kw({request:t,path:a,pattern:l,match:s,lazyHandlerPromise:o,lazyRoutePromise:u,handlerOverride:f,scopedContext:m}){let p,g,x=oa(t.method),y=x?"action":"loader",N=w=>{let S,A=new Promise((I,q)=>S=q);g=()=>S(),t.signal.addEventListener("abort",g);let R=I=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${s.route.id}]`)):w({request:t,url:yb(t,a),pattern:l,params:s.params,context:m},...I!==void 0?[I]:[]),L=(async()=>{try{return{type:"data",result:await(f?f(q=>R(q)):R())}}catch(I){return{type:"error",result:I}}})();return Promise.race([L,A])};try{let w=x?s.route.action:s.route.loader;if(o||u)if(w){let S,[A]=await Promise.all([N(w).catch(R=>{S=R}),o,u]);if(S!==void 0)throw S;p=A}else{await o;let S=x?s.route.action:s.route.loader;if(S)[p]=await Promise.all([N(S),u]);else if(y==="action"){let A=new URL(t.url),R=A.pathname+A.search;throw Ka(405,{method:t.method,pathname:R,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(w)p=await N(w);else{let S=new URL(t.url),A=S.pathname+S.search;throw Ka(404,{pathname:A})}}catch(w){return{type:"error",result:w}}finally{g&&t.signal.removeEventListener("abort",g)}return p}async function Ow(t){let a=t.headers.get("Content-Type");return a&&/\bapplication\/json\b/.test(a)?t.body==null?null:t.json():t.text()}async function Mw(t){var s,o,u,f,m;let{result:a,type:l}=t;if(sm(a)){let p;try{p=await Ow(a)}catch(g){return{type:"error",error:g}}return l==="error"?{type:"error",error:new Uo(a.status,a.statusText,p),statusCode:a.status,headers:a.headers}:{type:"data",data:p,statusCode:a.status,headers:a.headers}}return l==="error"?Gy(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:(s=a.init)==null?void 0:s.status,headers:(o=a.init)!=null&&o.headers?new Headers(a.init.headers):void 0}:{type:"error",error:Bw(a),statusCode:fi(a)?a.status:void 0,headers:(u=a.init)!=null&&u.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:fi(a)?a.status:void 0}:Gy(a)?{type:"data",data:a.data,statusCode:(f=a.init)==null?void 0:f.status,headers:(m=a.init)!=null&&m.headers?new Headers(a.init.headers):void 0}:{type:"data",data:a}}function _w(t,a,l,s,o){let u=t.headers.get("Location");if(tt(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!nm(u)){let f=s.slice(0,s.findIndex(m=>m.route.id===l)+1);u=qh(new URL(a.url),f,o,u),t.headers.set("Location",u)}return t}var Lw=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Vh(t){try{return Lw.includes(new URL(t).protocol)}catch{return!1}}function Iy(t,a,l,s){if(nm(t)){let o=t,u=tm.test(o)?new URL(Kx(o,a.protocol)):new URL(o);if(Vh(u.toString()))throw new Error("Invalid redirect location");let f=Wa(u.pathname,l)!=null;if(u.origin===a.origin&&f)return rm(u.pathname)+u.search+u.hash}try{let o=s.createURL(t);if(Vh(o.toString()))throw new Error("Invalid redirect location")}catch{}return t}function ii(t,a,l,s){let o=t.createURL(xb(a)).toString(),u={signal:l};if(s&&oa(s.formMethod)){let{formMethod:f,formEncType:m}=s;u.method=f.toUpperCase(),m==="application/json"?(u.headers=new Headers({"Content-Type":m}),u.body=JSON.stringify(s.json)):m==="text/plain"?u.body=s.text:m==="application/x-www-form-urlencoded"&&s.formData?u.body=Yh(s.formData):u.body=s.formData}return new Request(o,u)}function yb(t,a){let l=new URL(t.url),s=typeof a=="string"?Dr(a):a;if(l.pathname=s.pathname||"/",s.search){let o=new URLSearchParams(s.search),u=o.getAll("index");o.delete("index");for(let f of u.filter(Boolean))o.append("index",f);l.search=o.size?`?${o.toString()}`:""}else l.search="";return l.hash=s.hash||"",l}function Yh(t){let a=new URLSearchParams;for(let[l,s]of t.entries())a.append(l,typeof s=="string"?s:s.name);return a}function Vy(t){let a=new FormData;for(let[l,s]of t.entries())a.append(l,s);return a}function zw(t,a,l,s=!1,o=!1){let u={},f=null,m,p=!1,g={},x=l&&La(l[1])?l[1].error:void 0;return t.forEach(y=>{if(!(y.route.id in a))return;let N=y.route.id,w=a[N];if(tt(!hs(w),"Cannot handle redirect results in processLoaderData"),La(w)){let S=w.error;if(x!==void 0&&(S=x,x=void 0),f=f||{},o)f[N]=S;else{let A=zl(t,N);f[A.route.id]==null&&(f[A.route.id]=S)}s||(u[N]=db),p||(p=!0,m=fi(w.error)?w.error.status:500),w.headers&&(g[N]=w.headers)}else u[N]=w.data,w.statusCode&&w.statusCode!==200&&!p&&(m=w.statusCode),w.headers&&(g[N]=w.headers)}),x!==void 0&&l&&(f={[l[0]]:x},l[2]&&(u[l[2]]=void 0)),{loaderData:u,errors:f,statusCode:m||200,loaderHeaders:g}}function Yy(t,a,l,s,o,u,f){let{loaderData:m,errors:p}=zw(a,l,s);return o.filter(g=>!g.matches||g.matches.some(x=>x.shouldLoad)).forEach(g=>{let{key:x,match:y,controller:N}=g;if(N&&N.signal.aborted)return;let w=u[x];if(tt(w,"Did not find corresponding fetcher result"),La(w)){let S=zl(t.matches,y==null?void 0:y.route.id);p&&p[S.route.id]||(p={...p,[S.route.id]:w.error}),f.delete(x)}else if(hs(w))tt(!1,"Unhandled fetcher revalidation redirect");else{let S=jr(w.data);f.set(x,S)}}),{loaderData:m,errors:p}}function Fy(t,a,l,s){let o=Object.entries(a).filter(([,u])=>u!==db).reduce((u,[f,m])=>(u[f]=m,u),{});for(let u of l){let f=u.route.id;if(!a.hasOwnProperty(f)&&t.hasOwnProperty(f)&&u.route.loader&&(o[f]=t[f]),s&&s.hasOwnProperty(f))break}return o}function Py(t){return t?La(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function zl(t,a){return(a?t.slice(0,t.findIndex(s=>s.route.id===a)+1):[...t]).reverse().find(s=>s.route.hasErrorBoundary===!0)||t[0]}function oc(t){let a=t.length===1?t[0]:t.find(l=>l.index||!l.path||l.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:a}],route:a}}function Ka(t,{pathname:a,routeId:l,method:s,type:o,message:u}={}){let f="Unknown Server Error",m="Unknown @remix-run/router error";return t===400?(f="Bad Request",s&&a&&l?m=`You made a ${s} request to "${a}" but did not provide a \`loader\` for route "${l}", so there is no way to handle the request.`:o==="invalid-body"&&(m="Unable to encode submission body")):t===403?(f="Forbidden",m=`Route "${l}" does not match URL "${a}"`):t===404?(f="Not Found",m=`No route matches URL "${a}"`):t===405&&(f="Method Not Allowed",s&&a&&l?m=`You made a ${s.toUpperCase()} request to "${a}" but did not provide an \`action\` for route "${l}", so there is no way to handle the request.`:s&&(m=`Invalid request method "${s.toUpperCase()}"`)),new Uo(t||500,f,new Error(m),!0)}function uc(t){let a=Object.entries(t);for(let l=a.length-1;l>=0;l--){let[s,o]=a[l];if(hs(o))return{key:s,result:o}}}function xb(t){let a=typeof t=="string"?Dr(t):t;return Ar({...a,hash:""})}function Uw(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function Bw(t){var a,l;return new Uo(((a=t.init)==null?void 0:a.status)??500,((l=t.init)==null?void 0:l.statusText)??"Internal Server Error",t.data)}function Hw(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,l])=>typeof a=="string"&&$w(l))}function $w(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function qw(t){return sm(t.result)&&ob.has(t.result.status)}function La(t){return t.type==="error"}function hs(t){return(t&&t.type)==="redirect"}function Gy(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function sm(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function Iw(t){return ob.has(t)}function Vw(t){return sm(t)&&Iw(t.status)&&t.headers.has("Location")}function Yw(t){return xw.has(t.toUpperCase())}function oa(t){return vw.has(t.toUpperCase())}function im(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function Sc(t,a){let l=typeof a=="string"?Dr(a).search:a.search;if(t[t.length-1].route.index&&im(l||""))return t[t.length-1];let s=ab(t);return s[s.length-1]}function Xy(t){let{formMethod:a,formAction:l,formEncType:s,text:o,formData:u,json:f}=t;if(!(!a||!l||!s)){if(o!=null)return{formMethod:a,formAction:l,formEncType:s,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:a,formAction:l,formEncType:s,formData:u,json:void 0,text:void 0};if(f!==void 0)return{formMethod:a,formAction:l,formEncType:s,formData:void 0,json:f,text:void 0}}}function yh(t,a,l,s){return s?{state:"loading",location:t,matches:a,historyAction:l,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}:{state:"loading",location:t,matches:a,historyAction:l,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Fw(t,a,l,s){return{state:"submitting",location:t,matches:a,historyAction:l,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}}function fo(t,a){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:a}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function Pw(t,a){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:a?a.data:void 0}}function jr(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Gw(t,a){try{let l=t.sessionStorage.getItem(cb);if(l){let s=JSON.parse(l);for(let[o,u]of Object.entries(s||{}))u&&Array.isArray(u)&&a.set(o,new Set(u||[]))}}catch{}}function Xw(t,a){if(a.size>0){let l={};for(let[s,o]of a)l[s]=[...o];try{t.sessionStorage.setItem(cb,JSON.stringify(l))}catch(s){bn(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function Qy(){let t,a,l=new Promise((s,o)=>{t=async u=>{s(u);try{await l}catch{}},a=async u=>{o(u);try{await l}catch{}}});return{promise:l,resolve:t,reject:a}}var vs=v.createContext(null);vs.displayName="DataRouter";var mi=v.createContext(null);mi.displayName="DataRouterState";var bb=v.createContext(!1);function Sb(){return v.useContext(bb)}var om=v.createContext({isTransitioning:!1});om.displayName="ViewTransition";var um=v.createContext(new Map);um.displayName="Fetchers";var Qw=v.createContext(null);Qw.displayName="Await";var er=v.createContext(null);er.displayName="Navigation";var Vc=v.createContext(null);Vc.displayName="Location";var tr=v.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName="Route";var cm=v.createContext(null);cm.displayName="RouteError";var wb="REACT_ROUTER_ERROR",Kw="REDIRECT",Zw="ROUTE_ERROR_RESPONSE";function Jw(t){if(t.startsWith(`${wb}:${Kw}:{`))try{let a=JSON.parse(t.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function Ww(t){if(t.startsWith(`${wb}:${Zw}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Uo(a.status,a.statusText,a.data)}catch{}}function eE(t,{relative:a}={}){tt(Ho(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:s}=v.useContext(er),{hash:o,pathname:u,search:f}=$o(t,{relative:a}),m=u;return l!=="/"&&(m=u==="/"?l:Ja([l,u])),s.createHref({pathname:m,search:f,hash:o})}function Ho(){return v.useContext(Vc)!=null}function hr(){return tt(Ho(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Vc).location}var Eb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Nb(t){v.useContext(er).static||v.useLayoutEffect(t)}function kr(){let{isDataRoute:t}=v.useContext(tr);return t?mE():tE()}function tE(){tt(Ho(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(vs),{basename:a,navigator:l}=v.useContext(er),{matches:s}=v.useContext(tr),{pathname:o}=hr(),u=JSON.stringify(am(s)),f=v.useRef(!1);return Nb(()=>{f.current=!0}),v.useCallback((p,g={})=>{if(bn(f.current,Eb),!f.current)return;if(typeof p=="number"){l.go(p);return}let x=Ic(p,JSON.parse(u),o,g.relative==="path");t==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Ja([a,x.pathname])),(g.replace?l.replace:l.push)(x,g.state,g)},[a,l,u,o,t])}var nE=v.createContext(null);function aE(t){let a=v.useContext(tr).outlet;return v.useMemo(()=>a&&v.createElement(nE.Provider,{value:t},a),[a,t])}function rE(){let{matches:t}=v.useContext(tr),a=t[t.length-1];return(a==null?void 0:a.params)??{}}function $o(t,{relative:a}={}){let{matches:l}=v.useContext(tr),{pathname:s}=hr(),o=JSON.stringify(am(l));return v.useMemo(()=>Ic(t,JSON.parse(o),s,a==="path"),[t,o,s,a])}function lE(t,a,l){tt(Ho(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(er),{matches:o}=v.useContext(tr),u=o[o.length-1],f=u?u.params:{},m=u?u.pathname:"/",p=u?u.pathnameBase:"/",g=u&&u.route;{let R=g&&g.path||"";Cb(m,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
+
61
+ Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=hr(),y;y=x;let N=y.pathname||"/",w=N;if(p!=="/"){let R=p.replace(/^\//,"").split("/");w="/"+N.replace(/^\//,"").split("/").slice(R.length).join("/")}let S=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):Jx(t,{pathname:w});return bn(g||S!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),bn(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),cE(S&&S.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Ja([p,s.encodeLocation?s.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:Ja([p,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),o,l)}function sE(){let t=Tb(),a=fi(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),l=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:u},"ErrorBoundary")," or"," ",v.createElement("code",{style:u},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},a),l?v.createElement("pre",{style:o},l):null,f)}var iE=v.createElement(sE,null),Rb=class extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){this.props.onError?this.props.onError(t,a):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const l=Ww(t.digest);l&&(t=l)}let a=t!==void 0?v.createElement(tr.Provider,{value:this.props.routeContext},v.createElement(cm.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(oE,{error:t},a):a}};Rb.contextType=bb;var xh=new WeakMap;function oE({children:t,error:a}){let{basename:l}=v.useContext(er);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let s=Jw(a.digest);if(s){let o=xh.get(a);if(o)throw o;let u=lb(s.location,l),f=u.absoluteURL||u.to;if(Vh(f))throw new Error("Invalid redirect location");if(rb&&!xh.get(a))if(u.isExternal||s.reloadDocument)window.location.href=f;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:s.replace}));throw xh.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return t}function uE({routeContext:t,match:a,children:l}){let s=v.useContext(vs);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(tr.Provider,{value:t},l)}function cE(t,a=[],l){let s=l==null?void 0:l.state;if(t==null){if(!s)return null;if(s.errors)t=s.matches;else if(a.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let o=t,u=s==null?void 0:s.errors;if(u!=null){let x=o.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);tt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,x+1))}let f=!1,m=-1;if(l&&s){f=s.renderFallback;for(let x=0;x<o.length;x++){let y=o[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(m=x),y.route.id){let{loaderData:N,errors:w}=s,S=y.route.loader&&!N.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||S){l.isStatic&&(f=!0),m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}}let p=l==null?void 0:l.onError,g=s&&p?(x,y)=>{var N,w;p(x,{location:s.location,params:((w=(N=s.matches)==null?void 0:N[0])==null?void 0:w.params)??{},pattern:Bo(s.matches),errorInfo:y})}:void 0;return o.reduceRight((x,y,N)=>{let w,S=!1,A=null,R=null;s&&(w=u&&y.route.id?u[y.route.id]:void 0,A=y.route.errorElement||iE,f&&(m<0&&N===0?(Cb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,R=null):m===N&&(S=!0,R=y.route.hydrateFallbackElement||null)));let L=a.concat(o.slice(0,N+1)),I=()=>{let q;return w?q=A:S?q=R:y.route.Component?q=v.createElement(y.route.Component,null):y.route.element?q=y.route.element:q=x,v.createElement(uE,{match:y,routeContext:{outlet:x,matches:L,isDataRoute:s!=null},children:q})};return s&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?v.createElement(Rb,{location:s.location,revalidation:s.revalidation,component:A,error:w,children:I(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:g}):I()},null)}function dm(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jb(t){let a=v.useContext(vs);return tt(a,dm(t)),a}function qo(t){let a=v.useContext(mi);return tt(a,dm(t)),a}function dE(t){let a=v.useContext(tr);return tt(a,dm(t)),a}function Yc(t){let a=dE(t),l=a.matches[a.matches.length-1];return tt(l.route.id,`${t} can only be used on routes that contain a unique "id"`),l.route.id}function fE(){return Yc("useRouteId")}function Or(){let t=qo("useNavigation");return v.useMemo(()=>{let{matches:a,historyAction:l,...s}=t.navigation;return s},[t.navigation])}function hE(){let t=jb("useRevalidator"),a=qo("useRevalidator"),l=v.useCallback(async()=>{await t.router.revalidate()},[t.router]);return v.useMemo(()=>({revalidate:l,state:a.revalidation}),[l,a.revalidation])}function ll(){let t=qo("useLoaderData"),a=Yc("useLoaderData");return t.loaderData[a]}function ys(t){return qo("useRouteLoaderData").loaderData[t]}function Tb(){var s;let t=v.useContext(cm),a=qo("useRouteError"),l=Yc("useRouteError");return t!==void 0?t:(s=a.errors)==null?void 0:s[l]}function mE(){let{router:t}=jb("useNavigate"),a=Yc("useNavigate"),l=v.useRef(!1);return Nb(()=>{l.current=!0}),v.useCallback(async(o,u={})=>{bn(l.current,Eb),l.current&&(typeof o=="number"?await t.navigate(o):await t.navigate(o,{fromRouteId:a,...u}))},[t,a])}var Ky={};function Cb(t,a,l){!a&&!Ky[t]&&(Ky[t]=!0,bn(!1,l))}var Zy={};function Jy(t,a){!t&&!Zy[a]&&(Zy[a]=!0,console.warn(a))}var pE="useOptimistic",Wy=OS[pE],gE=()=>{};function vE(t){return Wy?Wy(t):[t,gE]}function yE(t){let a={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&bn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(a,{element:v.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&bn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(a,{hydrateFallbackElement:v.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&bn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(a,{errorElement:v.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),a}var xE=["HydrateFallback","hydrateFallbackElement"],bE=class{constructor(){this.status="pending",this.promise=new Promise((t,a)=>{this.resolve=l=>{this.status==="pending"&&(this.status="resolved",t(l))},this.reject=l=>{this.status==="pending"&&(this.status="rejected",a(l))}})}};function SE({router:t,flushSync:a,onError:l,useTransitions:s}){s=Sb()||s;let[u,f]=v.useState(t.state),[m,p]=vE(u),[g,x]=v.useState(),[y,N]=v.useState({isTransitioning:!1}),[w,S]=v.useState(),[A,R]=v.useState(),[L,I]=v.useState(),q=v.useRef(new Map),X=v.useCallback((T,{deletedFetchers:ee,newErrors:fe,flushSync:be,viewTransitionOpts:ye})=>{fe&&l&&Object.values(fe).forEach(re=>{var ge;return l(re,{location:T.location,params:((ge=T.matches[0])==null?void 0:ge.params)??{},pattern:Bo(T.matches)})}),T.fetchers.forEach((re,ge)=>{re.data!==void 0&&q.current.set(ge,re.data)}),ee.forEach(re=>q.current.delete(re)),Jy(be===!1||a!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let te=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(Jy(ye==null||te,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!ye||!te){a&&be?a(()=>f(T)):s===!1?f(T):v.startTransition(()=>{s===!0&&p(re=>ex(re,T)),f(T)});return}if(a&&be){a(()=>{A&&(w==null||w.resolve(),A.skipTransition()),N({isTransitioning:!0,flushSync:!0,currentLocation:ye.currentLocation,nextLocation:ye.nextLocation})});let re=t.window.document.startViewTransition(()=>{a(()=>f(T))});re.finished.finally(()=>{a(()=>{S(void 0),R(void 0),x(void 0),N({isTransitioning:!1})})}),a(()=>R(re));return}A?(w==null||w.resolve(),A.skipTransition(),I({state:T,currentLocation:ye.currentLocation,nextLocation:ye.nextLocation})):(x(T),N({isTransitioning:!0,flushSync:!1,currentLocation:ye.currentLocation,nextLocation:ye.nextLocation}))},[t.window,a,A,w,s,p,l]);v.useLayoutEffect(()=>t.subscribe(X),[t,X]),v.useEffect(()=>{y.isTransitioning&&!y.flushSync&&S(new bE)},[y]),v.useEffect(()=>{if(w&&g&&t.window){let T=g,ee=w.promise,fe=t.window.document.startViewTransition(async()=>{s===!1?f(T):v.startTransition(()=>{s===!0&&p(be=>ex(be,T)),f(T)}),await ee});fe.finished.finally(()=>{S(void 0),R(void 0),x(void 0),N({isTransitioning:!1})}),R(fe)}},[g,w,t.window,s,p]),v.useEffect(()=>{w&&g&&m.location.key===g.location.key&&w.resolve()},[w,A,m.location,g]),v.useEffect(()=>{!y.isTransitioning&&L&&(x(L.state),N({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),I(void 0))},[y.isTransitioning,L]);let W=v.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:T=>t.navigate(T),push:(T,ee,fe)=>t.navigate(T,{state:ee,preventScrollReset:fe==null?void 0:fe.preventScrollReset}),replace:(T,ee,fe)=>t.navigate(T,{replace:!0,state:ee,preventScrollReset:fe==null?void 0:fe.preventScrollReset})}),[t]),ae=t.basename||"/",z=v.useMemo(()=>({router:t,navigator:W,static:!1,basename:ae,onError:l}),[t,W,ae,l]);return v.createElement(v.Fragment,null,v.createElement(vs.Provider,{value:z},v.createElement(mi.Provider,{value:m},v.createElement(um.Provider,{value:q.current},v.createElement(om.Provider,{value:y},v.createElement(NE,{basename:ae,location:m.location,navigationType:m.historyAction,navigator:W,useTransitions:s},v.createElement(wE,{routes:t.routes,manifest:t.manifest,future:t.future,state:m,isStatic:!1,onError:l})))))),null)}function ex(t,a){return{...t,navigation:a.navigation.state!=="idle"?a.navigation:t.navigation,revalidation:a.revalidation!=="idle"?a.revalidation:t.revalidation,actionData:a.navigation.state!=="submitting"?a.actionData:t.actionData,fetchers:a.fetchers}}var wE=v.memo(EE);function EE({routes:t,manifest:a,future:l,state:s,isStatic:o,onError:u}){return lE(t,void 0,{manifest:a,state:s,isStatic:o,onError:u})}function pi(t){return aE(t.context)}function NE({basename:t="/",children:a=null,location:l,navigationType:s="POP",navigator:o,static:u=!1,useTransitions:f}){tt(!Ho(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=t.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:m,navigator:o,static:u,useTransitions:f,future:{}}),[m,o,u,f]);typeof l=="string"&&(l=Dr(l));let{pathname:g="/",search:x="",hash:y="",state:N=null,key:w="default",mask:S}=l,A=v.useMemo(()=>{let R=Wa(g,m);return R==null?null:{location:{pathname:R,search:x,hash:y,state:N,key:w,mask:S},navigationType:s}},[m,g,x,y,N,w,s,S]);return bn(A!=null,`<Router basename="${m}"> is not able to match the URL "${g}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:v.createElement(er.Provider,{value:p},v.createElement(Vc.Provider,{children:a,value:A}))}var wc="get",Ec="application/x-www-form-urlencoded";function Fc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function RE(t){return Fc(t)&&t.tagName.toLowerCase()==="button"}function jE(t){return Fc(t)&&t.tagName.toLowerCase()==="form"}function TE(t){return Fc(t)&&t.tagName.toLowerCase()==="input"}function CE(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function AE(t,a){return t.button===0&&(!a||a==="_self")&&!CE(t)}function Fh(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((a,l)=>{let s=t[l];return a.concat(Array.isArray(s)?s.map(o=>[l,o]):[[l,s]])},[]))}function DE(t,a){let l=Fh(t);return a&&a.forEach((s,o)=>{l.has(o)||a.getAll(o).forEach(u=>{l.append(o,u)})}),l}var cc=null;function kE(){if(cc===null)try{new FormData(document.createElement("form"),0),cc=!1}catch{cc=!0}return cc}var OE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function bh(t){return t!=null&&!OE.has(t)?(bn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ec}"`),null):t}function ME(t,a){let l,s,o,u,f;if(jE(t)){let m=t.getAttribute("action");s=m?Wa(m,a):null,l=t.getAttribute("method")||wc,o=bh(t.getAttribute("enctype"))||Ec,u=new FormData(t)}else if(RE(t)||TE(t)&&(t.type==="submit"||t.type==="image")){let m=t.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=t.getAttribute("formaction")||m.getAttribute("action");if(s=p?Wa(p,a):null,l=t.getAttribute("formmethod")||m.getAttribute("method")||wc,o=bh(t.getAttribute("formenctype"))||bh(m.getAttribute("enctype"))||Ec,u=new FormData(m,t),!kE()){let{name:g,type:x,value:y}=t;if(x==="image"){let N=g?`${g}.`:"";u.append(`${N}x`,"0"),u.append(`${N}y`,"0")}else g&&u.append(g,y)}}else{if(Fc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=wc,s=null,o=Ec,f=t}return u&&o==="text/plain"&&(f=u,u=void 0),{action:s,method:l.toLowerCase(),encType:o,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function fm(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Ab(t,a,l,s){let o=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return l?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:a&&Wa(o.pathname,a)==="/"?o.pathname=`${Ac(a)}/_root.${s}`:o.pathname=`${Ac(o.pathname)}.${s}`,o}async function _E(t,a){if(t.id in a)return a[t.id];try{let l=await import(t.module);return a[t.id]=l,l}catch(l){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function LE(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function zE(t,a,l){let s=await Promise.all(t.map(async o=>{let u=a.routes[o.route.id];if(u){let f=await _E(u,l);return f.links?f.links():[]}return[]}));return $E(s.flat(1).filter(LE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function tx(t,a,l,s,o,u){let f=(p,g)=>l[g]?p.route.id!==l[g].route.id:!0,m=(p,g)=>{var x;return l[g].pathname!==p.pathname||((x=l[g].route.path)==null?void 0:x.endsWith("*"))&&l[g].params["*"]!==p.params["*"]};return u==="assets"?a.filter((p,g)=>f(p,g)||m(p,g)):u==="data"?a.filter((p,g)=>{var y;let x=s.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(f(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let N=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof N=="boolean")return N}return!0}):[]}function UE(t,a,{includeHydrateFallback:l}={}){return BE(t.map(s=>{let o=a.routes[s.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),l&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function BE(t){return[...new Set(t)]}function HE(t){let a={},l=Object.keys(t).sort();for(let s of l)a[s]=t[s];return a}function $E(t,a){let l=new Set;return new Set(a),t.reduce((s,o)=>{let u=JSON.stringify(HE(o));return l.has(u)||(l.add(u),s.push({key:u,link:o})),s},[])}function hm(){let t=v.useContext(vs);return fm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function qE(){let t=v.useContext(mi);return fm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var mm=v.createContext(void 0);mm.displayName="FrameworkContext";function Pc(){let t=v.useContext(mm);return fm(t,"You must render this element inside a <HydratedRouter> element"),t}function IE(t,a){let l=v.useContext(mm),[s,o]=v.useState(!1),[u,f]=v.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:y}=a,N=v.useRef(null);v.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let A=L=>{L.forEach(I=>{f(I.isIntersecting)})},R=new IntersectionObserver(A,{threshold:.5});return N.current&&R.observe(N.current),()=>{R.disconnect()}}},[t]),v.useEffect(()=>{if(s){let A=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(A)}}},[s]);let w=()=>{o(!0)},S=()=>{o(!1),f(!1)};return l?t!=="intent"?[u,N,{}]:[u,N,{onFocus:ho(m,w),onBlur:ho(p,S),onMouseEnter:ho(g,w),onMouseLeave:ho(x,S),onTouchStart:ho(y,w)}]:[!1,N,{}]}function ho(t,a){return l=>{t&&t(l),l.defaultPrevented||a(l)}}function VE({page:t,...a}){let l=Sb(),{nonce:s}=Pc(),{router:o}=hm(),u=v.useMemo(()=>Jx(o.routes,t,o.basename),[o.routes,t,o.basename]);return u?(a.nonce==null&&s&&(a={...a,nonce:s}),l?v.createElement(FE,{page:t,matches:u,...a}):v.createElement(PE,{page:t,matches:u,...a})):null}function YE(t){let{manifest:a,routeModules:l}=Pc(),[s,o]=v.useState([]);return v.useEffect(()=>{let u=!1;return zE(t,a,l).then(f=>{u||o(f)}),()=>{u=!0}},[t,a,l]),s}function FE({page:t,matches:a,...l}){let s=hr(),{future:o}=Pc(),{basename:u}=hm(),f=v.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let m=Ab(t,u,o.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let x of a)typeof x.route.shouldRevalidate=="function"?p=!0:g.push(x.route.id);return p&&g.length>0&&m.searchParams.set("_routes",g.join(",")),[m.pathname+m.search]},[u,o.v8_trailingSlashAwareDataRequests,t,s,a]);return v.createElement(v.Fragment,null,f.map(m=>v.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...l})))}function PE({page:t,matches:a,...l}){let s=hr(),{future:o,manifest:u,routeModules:f}=Pc(),{basename:m}=hm(),{loaderData:p,matches:g}=qE(),x=v.useMemo(()=>tx(t,a,g,u,s,"data"),[t,a,g,u,s]),y=v.useMemo(()=>tx(t,a,g,u,s,"assets"),[t,a,g,u,s]),N=v.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let A=new Set,R=!1;if(a.forEach(I=>{var X;let q=u.routes[I.route.id];!q||!q.hasLoader||(!x.some(W=>W.route.id===I.route.id)&&I.route.id in p&&((X=f[I.route.id])!=null&&X.shouldRevalidate)||q.hasClientLoader?R=!0:A.add(I.route.id))}),A.size===0)return[];let L=Ab(t,m,o.v8_trailingSlashAwareDataRequests,"data");return R&&A.size>0&&L.searchParams.set("_routes",a.filter(I=>A.has(I.route.id)).map(I=>I.route.id).join(",")),[L.pathname+L.search]},[m,o.v8_trailingSlashAwareDataRequests,p,s,u,x,a,t,f]),w=v.useMemo(()=>UE(y,u),[y,u]),S=YE(y);return v.createElement(v.Fragment,null,N.map(A=>v.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...l})),w.map(A=>v.createElement("link",{key:A,rel:"modulepreload",href:A,...l})),S.map(({key:A,link:R})=>v.createElement("link",{key:A,nonce:l.nonce,...R,crossOrigin:R.crossOrigin??l.crossOrigin})))}function GE(...t){return a=>{t.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var XE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{XE&&(window.__reactRouterVersion="7.18.0")}catch{}function QE(t,a){return Ew({basename:a==null?void 0:a.basename,getContext:a==null?void 0:a.getContext,future:a==null?void 0:a.future,history:HS({window:a==null?void 0:a.window}),hydrationData:KE(),routes:t,mapRouteProperties:yE,hydrationRouteProperties:xE,dataStrategy:a==null?void 0:a.dataStrategy,patchRoutesOnNavigation:a==null?void 0:a.patchRoutesOnNavigation,window:a==null?void 0:a.window,instrumentations:a==null?void 0:a.instrumentations}).initialize()}function KE(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:ZE(t.errors)}),t}function ZE(t){if(!t)return null;let a=Object.entries(t),l={};for(let[s,o]of a)if(o&&o.__type==="RouteErrorResponse")l[s]=new Uo(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&cw.includes(o.__subType)){let u=window[o.__subType];if(typeof u=="function")try{let f=new u(o.message);f.stack="",l[s]=f}catch{}}if(l[s]==null){let u=new Error(o.message);u.stack="",l[s]=u}}else l[s]=o;return l}var Ye=v.forwardRef(function({onClick:a,discover:l="render",prefetch:s="none",relative:o,reloadDocument:u,replace:f,mask:m,state:p,target:g,to:x,preventScrollReset:y,viewTransition:N,defaultShouldRevalidate:w,...S},A){let{basename:R,navigator:L,useTransitions:I}=v.useContext(er),q=typeof x=="string"&&qc.test(x),X=lb(x,R);x=X.to;let W=eE(x,{relative:o}),ae=hr(),z=null;if(m){let ge=Ic(m,[],ae.mask?ae.mask.pathname:"/",!0);R!=="/"&&(ge.pathname=ge.pathname==="/"?R:Ja([R,ge.pathname])),z=L.createHref(ge)}let[T,ee,fe]=IE(s,S),be=WE(x,{replace:f,mask:m,state:p,target:g,preventScrollReset:y,relative:o,viewTransition:N,defaultShouldRevalidate:w,useTransitions:I});function ye(ge){a&&a(ge),ge.defaultPrevented||be(ge)}let te=!(X.isExternal||u),re=v.createElement("a",{...S,...fe,href:(te?z:void 0)||X.absoluteURL||W,onClick:te?ye:a,ref:GE(A,ee),target:g,"data-discover":!q&&l==="render"?"true":void 0});return T&&!q?v.createElement(v.Fragment,null,re,v.createElement(VE,{page:W})):re});Ye.displayName="Link";var Db=v.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:s="",end:o=!1,style:u,to:f,viewTransition:m,children:p,...g},x){let y=$o(f,{relative:g.relative}),N=hr(),w=v.useContext(mi),{navigator:S,basename:A}=v.useContext(er),R=w!=null&&aN(y)&&m===!0,L=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,I=N.pathname,q=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(I=I.toLowerCase(),q=q?q.toLowerCase():null,L=L.toLowerCase()),q&&A&&(q=Wa(q,A)||q);const X=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let W=I===L||!o&&I.startsWith(L)&&I.charAt(X)==="/",ae=q!=null&&(q===L||!o&&q.startsWith(L)&&q.charAt(L.length)==="/"),z={isActive:W,isPending:ae,isTransitioning:R},T=W?a:void 0,ee;typeof s=="function"?ee=s(z):ee=[s,W?"active":null,ae?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let fe=typeof u=="function"?u(z):u;return v.createElement(Ye,{...g,"aria-current":T,className:ee,ref:x,style:fe,to:f,viewTransition:m},typeof p=="function"?p(z):p)});Db.displayName="NavLink";var ca=v.forwardRef(({discover:t="render",fetcherKey:a,navigate:l,reloadDocument:s,replace:o,state:u,method:f=wc,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:N,...w},S)=>{let{useTransitions:A}=v.useContext(er),R=gm(),L=nN(m,{relative:g}),I=f.toLowerCase()==="get"?"get":"post",q=typeof m=="string"&&qc.test(m),X=W=>{if(p&&p(W),W.defaultPrevented)return;W.preventDefault();let ae=W.nativeEvent.submitter,z=(ae==null?void 0:ae.getAttribute("formmethod"))||f,T=()=>R(ae||W.currentTarget,{fetcherKey:a,method:z,navigate:l,replace:o,state:u,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:N});A&&l!==!1?v.startTransition(()=>T()):T()};return v.createElement("form",{ref:S,method:I,action:L,onSubmit:s?p:X,...w,"data-discover":!q&&t==="render"?"true":void 0})});ca.displayName="Form";function kb(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pm(t){let a=v.useContext(vs);return tt(a,kb(t)),a}function JE(t){let a=v.useContext(mi);return tt(a,kb(t)),a}function WE(t,{target:a,replace:l,mask:s,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=kr(),y=hr(),N=$o(t,{relative:f});return v.useCallback(w=>{if(AE(w,a)){w.preventDefault();let S=l!==void 0?l:Ar(y)===Ar(N),A=()=>x(t,{replace:S,mask:s,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p});g?v.startTransition(()=>A()):A()}},[y,x,N,l,s,o,a,t,u,f,m,p,g])}function Io(t){bn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let a=v.useRef(Fh(t)),l=v.useRef(!1),s=hr(),o=v.useMemo(()=>DE(s.search,l.current?null:a.current),[s.search]),u=kr(),f=v.useCallback((m,p)=>{const g=Fh(typeof m=="function"?m(new URLSearchParams(o)):m);l.current=!0,u("?"+g,p)},[u,o]);return[o,f]}var eN=0,tN=()=>`__${String(++eN)}__`;function gm(){let{router:t}=pm("useSubmit"),{basename:a}=v.useContext(er),l=fE(),s=t.fetch,o=t.navigate;return v.useCallback(async(u,f={})=>{let{action:m,method:p,encType:g,formData:x,body:y}=ME(u,a);if(f.navigate===!1){let N=f.fetcherKey||tN();await s(N,l,f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||p,formEncType:f.encType||g,flushSync:f.flushSync})}else await o(f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||p,formEncType:f.encType||g,replace:f.replace,state:f.state,fromRouteId:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[s,o,a,l])}function nN(t,{relative:a}={}){let{basename:l}=v.useContext(er),s=v.useContext(tr);tt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),u={...$o(t||".",{relative:a})},f=hr();if(t==null){u.search=f.search;let m=new URLSearchParams(u.search),p=m.getAll("index");if(p.some(x=>x==="")){m.delete("index"),p.filter(y=>y).forEach(y=>m.append("index",y));let x=m.toString();u.search=x?`?${x}`:""}}return(!t||t===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(u.pathname=u.pathname==="/"?l:Ja([l,u.pathname])),Ar(u)}function ps({key:t}={}){var W;let{router:a}=pm("useFetcher"),l=JE("useFetcher"),s=v.useContext(um),o=v.useContext(tr),u=(W=o.matches[o.matches.length-1])==null?void 0:W.route.id;tt(s,"useFetcher must be used inside a FetchersContext"),tt(o,"useFetcher must be used inside a RouteContext"),tt(u!=null,'useFetcher can only be used on routes that contain a unique "id"');let f=v.useId(),[m,p]=v.useState(t||f);t&&t!==m&&p(t);let{deleteFetcher:g,getFetcher:x,resetFetcher:y,fetch:N}=a;v.useEffect(()=>(x(m),()=>g(m)),[g,x,m]);let w=v.useCallback(async(ae,z)=>{tt(u,"No routeId available for fetcher.load()"),await N(m,u,ae,z)},[m,u,N]),S=gm(),A=v.useCallback(async(ae,z)=>{await S(ae,{...z,navigate:!1,fetcherKey:m})},[m,S]),R=v.useCallback(ae=>y(m,ae),[y,m]),L=v.useMemo(()=>{let ae=v.forwardRef((z,T)=>v.createElement(ca,{...z,navigate:!1,fetcherKey:m,ref:T}));return ae.displayName="fetcher.Form",ae},[m]),I=l.fetchers.get(m)||ub,q=s.get(m);return v.useMemo(()=>({Form:L,submit:A,load:w,reset:R,...I,data:q}),[L,A,w,R,I,q])}function aN(t,{relative:a}={}){let l=v.useContext(om);tt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=pm("useViewTransitionState"),o=$o(t,{relative:a});if(!l.isTransitioning)return!1;let u=Wa(l.currentLocation.pathname,s)||l.currentLocation.pathname,f=Wa(l.nextLocation.pathname,s)||l.nextLocation.pathname;return Cc(o.pathname,f)!=null||Cc(o.pathname,u)!=null}var rl=Gx();function rN(t){return v.createElement(SE,{flushSync:rl.flushSync,...t})}/**
62
+ * @license lucide-react v1.21.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const Ob=(...t)=>t.filter((a,l,s)=>!!a&&a.trim()!==""&&s.indexOf(a)===l).join(" ").trim();/**
67
+ * @license lucide-react v1.21.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const lN=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
72
+ * @license lucide-react v1.21.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const sN=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,s)=>s?s.toUpperCase():l.toLowerCase());/**
77
+ * @license lucide-react v1.21.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const nx=t=>{const a=sN(t);return a.charAt(0).toUpperCase()+a.slice(1)};/**
82
+ * @license lucide-react v1.21.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */var Sh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
87
+ * @license lucide-react v1.21.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const iN=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},oN=v.createContext({}),uN=()=>v.useContext(oN),cN=v.forwardRef(({color:t,size:a,strokeWidth:l,absoluteStrokeWidth:s,className:o="",children:u,iconNode:f,...m},p)=>{const{size:g=24,strokeWidth:x=2,absoluteStrokeWidth:y=!1,color:N="currentColor",className:w=""}=uN()??{},S=s??y?Number(l??x)*24/Number(a??g):l??x;return v.createElement("svg",{ref:p,...Sh,width:a??g??Sh.width,height:a??g??Sh.height,stroke:t??N,strokeWidth:S,className:Ob("lucide",w,o),...!u&&!iN(m)&&{"aria-hidden":"true"},...m},[...f.map(([A,R])=>v.createElement(A,R)),...Array.isArray(u)?u:[u]])});/**
92
+ * @license lucide-react v1.21.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const Et=(t,a)=>{const l=v.forwardRef(({className:s,...o},u)=>v.createElement(cN,{ref:u,iconNode:a,className:Ob(`lucide-${lN(nx(t))}`,`lucide-${t}`,s),...o}));return l.displayName=nx(t),l};/**
97
+ * @license lucide-react v1.21.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const dN=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],fN=Et("arrow-down-wide-narrow",dN);/**
102
+ * @license lucide-react v1.21.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const hN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Gc=Et("arrow-left",hN);/**
107
+ * @license lucide-react v1.21.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const mN=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]],pN=Et("arrow-up-narrow-wide",mN);/**
112
+ * @license lucide-react v1.21.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const gN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Mb=Et("ban",gN);/**
117
+ * @license lucide-react v1.21.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const vN=[["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"}]],yN=Et("chart-column",vN);/**
122
+ * @license lucide-react v1.21.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const xN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_b=Et("check",xN);/**
127
+ * @license lucide-react v1.21.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const bN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xs=Et("chevron-down",bN);/**
132
+ * @license lucide-react v1.21.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const SN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Lb=Et("chevron-right",SN);/**
137
+ * @license lucide-react v1.21.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const wN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],EN=Et("circle-check-big",wN);/**
142
+ * @license lucide-react v1.21.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const NN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],vm=Et("circle-check",NN);/**
147
+ * @license lucide-react v1.21.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const RN=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],jN=Et("circle-dashed",RN);/**
152
+ * @license lucide-react v1.21.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const TN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],CN=Et("circle-minus",TN);/**
157
+ * @license lucide-react v1.21.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const AN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],zb=Et("circle-pause",AN);/**
162
+ * @license lucide-react v1.21.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const DN=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ub=Et("circle-play",DN);/**
167
+ * @license lucide-react v1.21.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const kN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ON=Et("circle-x",kN);/**
172
+ * @license lucide-react v1.21.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const MN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Xc=Et("circle",MN);/**
177
+ * @license lucide-react v1.21.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const _N=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],LN=Et("clock",_N);/**
182
+ * @license lucide-react v1.21.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const zN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Bb=Et("copy",zN);/**
187
+ * @license lucide-react v1.21.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const UN=[["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"}]],BN=Et("download",UN);/**
192
+ * @license lucide-react v1.21.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const HN=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],$N=Et("git-branch",HN);/**
197
+ * @license lucide-react v1.21.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const qN=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],IN=Et("grip-vertical",qN);/**
202
+ * @license lucide-react v1.21.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const VN=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],YN=Et("house",VN);/**
207
+ * @license lucide-react v1.21.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const FN=[["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"}]],Dc=Et("layers",FN);/**
212
+ * @license lucide-react v1.21.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const PN=[["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"}]],Vo=Et("list-todo",PN);/**
217
+ * @license lucide-react v1.21.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const GN=[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],XN=Et("locate-fixed",GN);/**
222
+ * @license lucide-react v1.21.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const QN=[["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"}]],KN=Et("moon",QN);/**
227
+ * @license lucide-react v1.21.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const ZN=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],Hb=Et("octagon-alert",ZN);/**
232
+ * @license lucide-react v1.21.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const JN=[["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"}]],gs=Et("pencil",JN);/**
237
+ * @license lucide-react v1.21.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const WN=[["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"}]],eR=Et("play",WN);/**
242
+ * @license lucide-react v1.21.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const tR=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],$b=Et("scroll-text",tR);/**
247
+ * @license lucide-react v1.21.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const nR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],aR=Et("search",nR);/**
252
+ * @license lucide-react v1.21.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const rR=[["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"}]],lR=Et("sun",rR);/**
257
+ * @license lucide-react v1.21.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const sR=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]],iR=Et("timer-reset",sR);/**
262
+ * @license lucide-react v1.21.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const oR=[["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"}]],hi=Et("trash-2",oR);/**
267
+ * @license lucide-react v1.21.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const uR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],cR=Et("x",uR),dR="/api",fR=120,hR=40;function Qc(t){return{...t,number:t.number??0,decisions:t.decisions??[],acceptedDecisions:t.acceptedDecisions??[],checklist:t.checklist??[],subtasks:t.subtasks??[],startedAt:t.startedAt??"",completedAt:t.completedAt??"",descriptionUpdatedAt:t.descriptionUpdatedAt??""}}function Kc(t){return{...t,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",notes:t.notes??"",goals:t.goals??[],nonGoals:t.nonGoals??[],dependencies:t.dependencies??[],risks:t.risks??[],openQuestions:t.openQuestions??[],decisions:t.decisions??[],acceptedDecisions:t.acceptedDecisions??[],completionCriteria:t.completionCriteria??[],taskIds:t.taskIds??[],tasks:(t.tasks??[]).map(Qc),linkedRequirements:t.linkedRequirements??[],handoff:t.handoff??"",handoffUpdatedAt:t.handoffUpdatedAt??"",descriptionUpdatedAt:t.descriptionUpdatedAt??""}}function Zc(t){return{...t,number:t.number??0,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",acceptedDecisions:t.acceptedDecisions??[],phaseIds:t.phaseIds??[],descriptionUpdatedAt:t.descriptionUpdatedAt??""}}function qb(t){var a,l,s;return{...t,scope:t.scope??[],outOfScope:t.outOfScope??[],decisions:t.decisions??[],globalRules:t.globalRules??[],technologies:t.technologies??[],tools:t.tools??[],acceptedDecisions:t.acceptedDecisions??[],planRoot:t.planRoot??"",projectRoot:t.projectRoot??"",workflowRules:{beforePhaseStart:((a=t.workflowRules)==null?void 0:a.beforePhaseStart)??[],beforeTaskStart:((l=t.workflowRules)==null?void 0:l.beforeTaskStart)??[],afterPhaseComplete:((s=t.workflowRules)==null?void 0:s.afterPhaseComplete)??[]}}}function ym(t){return{...t,description:t.description??"",macroTasks:t.macroTasks??[],linkedPhaseIds:t.linkedPhaseIds??[]}}async function ax(t,a){try{return await fetch(`${dR}${t}`,{headers:{"Content-Type":"application/json"},...a})}catch{throw new Response("Planner web server unavailable. Pi or planner-web may have stopped. Restart the planner web UI or Pi, then reload this page.",{status:503,statusText:"Planner web server unavailable"})}}async function Gt(t,a){let l=await ax(t,a),s=0;for(;l.status===503&&s<hR;)await new Promise(o=>setTimeout(o,fR)),s+=1,l=await ax(t,a);if(!l.ok){const o=await l.text().catch(()=>l.statusText);throw new Response(o||l.statusText,{status:l.status,statusText:l.statusText})}return l.json()}async function Ib(){return qb(await Gt("/project"))}async function mR(t){return qb(await Gt("/project",{method:"PUT",body:JSON.stringify(t)}))}async function pR(){return Gt("/ui-config")}async function Vb(){return(await Gt("/features")).map(Zc)}async function Yo(t){return Zc(await Gt(`/features/${t}`))}async function gR(t){return Zc(await Gt("/features",{method:"POST",body:JSON.stringify(t)}))}async function Yb(t){return Zc(await Gt(`/features/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function vR(t){return Gt(`/features/${t}`,{method:"DELETE"})}async function xm(){return(await Gt("/requirements")).requirements.map(ym)}async function yR(t){const a=new Date().toISOString();return ym(await Gt("/requirements",{method:"POST",body:JSON.stringify({...t,macroTasks:[],createdAt:a,updatedAt:a})}))}async function xR(t){return ym(await Gt(`/requirements/${t.id}`,{method:"PUT",body:JSON.stringify({...t,updatedAt:new Date().toISOString()})}))}async function bR(t){return Gt(`/requirements/${t}`,{method:"DELETE"})}async function Jc(t){const a=t?`?featureId=${encodeURIComponent(t)}`:"";return(await Gt(`/phases${a}`)).map(Kc)}async function Wc(t){return Kc(await Gt(`/phases/${t}`))}async function SR(t){return Kc(await Gt("/phases",{method:"POST",body:JSON.stringify(t)}))}async function Fb(t){return Kc(await Gt(`/phases/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function wR(t){return Gt(`/phases/${t}`,{method:"DELETE"})}async function ER(t,a){return Qc(await Gt(`/phases/${t}/tasks`,{method:"POST",body:JSON.stringify(a)}))}async function ed(t){return Qc(await Gt(`/tasks/${t}`))}async function bm(t){return Qc(await Gt(`/tasks/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function NR(t){return Gt(`/tasks/${t}`,{method:"DELETE"})}async function Pb(){return Gt("/tasks/active")}async function Ph(){return(await Gt("/handoffs")).handoffs??[]}async function RR(){return(await Gt("/handoffs/archive")).archived??[]}async function Gb(t){return Gt(`/phases/${t}/handoff`,{method:"DELETE"})}async function jR(t=!1){return Gt(`/export?full=${t?"true":"false"}`)}async function TR(){return Gt("/repair",{method:"POST"})}async function wh(t,a,l,s){return Gt("/reorder",{method:"POST",body:JSON.stringify({kind:t,movedId:a,beforeId:l,afterId:s})})}function CR(){const[t,a]=v.useState(()=>{if(typeof window>"u")return"dark";const l=window.localStorage.getItem("plan-ui-theme");return l||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")});return v.useEffect(()=>{document.documentElement.setAttribute("data-theme",t),window.localStorage.setItem("plan-ui-theme",t)},[t]),{theme:t,toggleTheme:()=>a(l=>l==="dark"?"light":"dark")}}function AR({liveStatus:t}){const a=t==="live"?{label:"Live",className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",dotClassName:"bg-emerald-500"}:t==="reconnecting"?{label:"Reconnecting…",className:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-400",dotClassName:"bg-amber-500 animate-pulse"}:t==="disconnected"?{label:"Disconnected",className:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-400",dotClassName:"bg-rose-500"}:{label:"Connecting…",className:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-400",dotClassName:"bg-sky-500 animate-pulse"};return c.jsxs("span",{className:`inline-flex min-h-9 items-center gap-2 rounded-[12px] border px-2.5 py-1.5 text-sm font-semibold sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 ${a.className}`,children:[c.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${a.dotClassName}`}),c.jsx("span",{className:"hidden sm:inline",children:a.label})]})}function DR({projectName:t,projectRoot:a,planRoot:l,liveStatus:s}){const{theme:o,toggleTheme:u}=CR(),[f,m]=v.useState(!1),[p,g]=v.useState(!1),[x,y]=v.useState(null),N=[{to:"/",label:"Dashboard",icon:YN},{to:"/features",label:"Features",icon:Dc},{to:"/requirements",label:"Requirements",icon:Vo},{to:"/handoff",label:"Handoff",icon:$b}];async function w(S){y(S?"full":"summary");try{const R=await jR(S),L=new Blob([R.markdown],{type:"text/markdown;charset=utf-8"}),I=URL.createObjectURL(L),q=document.createElement("a");q.href=I,q.download=S?"EXPORT-full.md":R.filePath||"EXPORT.md",document.body.appendChild(q),q.click(),q.remove(),URL.revokeObjectURL(I),g(!1)}catch(R){window.alert(`Export failed: ${R instanceof Error?R.message:String(R)}`)}finally{y(null)}}return c.jsx("div",{className:"relative z-20 overflow-visible border-b border-[var(--border)] bg-[var(--surface-elevated)] backdrop-blur-xl backdrop-saturate-150",children:c.jsxs("div",{className:"page-container flex flex-col gap-3 py-2.5 md:flex-row md:items-center md:justify-between sm:gap-4 sm:py-3",children:[c.jsxs(Ye,{to:"/",className:"flex min-w-0 items-center gap-3",children:[c.jsx("div",{className:"surface-card flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] text-[var(--accent)]",children:c.jsx(Dc,{className:"h-4 w-4"})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("div",{className:"truncate text-sm font-black tracking-tight",children:t??"Agent Plan"})}),a?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"truncate text-[11px] text-[var(--text-subtle)]",title:a,children:a}),c.jsx("button",{type:"button",onClick:async S=>{S.preventDefault(),S.stopPropagation(),a&&(await navigator.clipboard.writeText(a).catch(()=>{}),m(!0),window.setTimeout(()=>m(!1),1200))},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] transition hover:text-[var(--text)]",title:f?"Copied":"Copy project path","aria-label":f?"Copied":"Copy project path",children:f?c.jsx(_b,{className:"h-3.5 w-3.5"}):c.jsx(Bb,{className:"h-3.5 w-3.5"})})]}):null]})]}),c.jsxs("div",{className:"flex items-center justify-end gap-2 sm:gap-3",children:[c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(AR,{liveStatus:s})}),c.jsx("nav",{className:"flex items-center gap-1.5 sm:gap-2",children:N.map(S=>c.jsxs(Db,{to:S.to,end:S.to==="/","aria-label":S.label,className:({isActive:A})=>`inline-flex min-h-9 items-center gap-2 rounded-[12px] border px-2.5 py-1.5 text-sm font-semibold transition sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 sm:px-4 ${A?"border-transparent bg-[var(--accent-soft)] text-[var(--accent)]":"border-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"}`,children:[c.jsx(S.icon,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:S.label})]},S.to))}),c.jsxs("div",{className:"relative z-30",children:[c.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":p,"aria-label":"Export",onClick:()=>g(S=>!S),className:"inline-flex min-h-9 items-center gap-2 rounded-[12px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2.5 py-1.5 text-sm font-semibold text-[var(--text-muted)] transition hover:text-[var(--text)] sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 sm:px-4",children:[c.jsx(BN,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Export"}),c.jsx(xs,{className:`h-4 w-4 transition-transform ${p?"rotate-180":""}`})]}),p?c.jsxs("div",{role:"menu",onKeyDown:S=>{var I;const A=Array.from(S.currentTarget.querySelectorAll("[role=menuitem]")).filter(q=>!q.hasAttribute("disabled"));if(A.length===0)return;const R=A.indexOf(document.activeElement);let L=R;if(S.key==="ArrowDown")L=R===-1?0:(R+1)%A.length;else if(S.key==="ArrowUp")L=R===-1?A.length-1:(R-1+A.length)%A.length;else if(S.key==="Home")L=0;else if(S.key==="End")L=A.length-1;else return;S.preventDefault(),(I=A[L])==null||I.focus()},className:"absolute right-0 top-full z-[200] mt-2 min-w-44 overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-1 shadow-xl",children:[c.jsxs("button",{type:"button",role:"menuitem",disabled:x!==null,onClick:()=>void w(!1),className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Summary",x==="summary"?c.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),c.jsxs("button",{type:"button",role:"menuitem",disabled:x!==null,onClick:()=>void w(!0),className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Full",x==="full"?c.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]}):null]}),c.jsx("button",{type:"button",onClick:u,"aria-label":o==="dark"?"Switch to light theme":"Switch to dark theme",title:o==="dark"?"Switch to light theme":"Switch to dark theme",className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[12px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)] sm:h-11 sm:w-11 sm:rounded-[14px]",children:o==="dark"?c.jsx(lR,{className:"h-4 w-4"}):c.jsx(KN,{className:"h-4 w-4"})})]})]})})}function rx(t,a,l){t.split(`
272
+ `).forEach((o,u)=>{u>0&&a.push(c.jsx("br",{},`${l}-br-${u}`)),o&&a.push(o)})}function mo(t,a){const l=[],s=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*)/g;let o=0,u=null,f=0;for(;(u=s.exec(t))!==null;)u.index>o&&rx(t.slice(o,u.index),l,`${a}-${f}`),u[2]&&u[3]?l.push(c.jsx("a",{href:u[3],target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline-offset-4 hover:underline",children:u[2]},`${a}-link-${f}`)):u[4]?l.push(c.jsx("strong",{className:"font-semibold text-[var(--text)]",children:u[4]},`${a}-strong-${f}`)):u[5]?l.push(c.jsx("code",{className:"rounded-md border border-[var(--border)] px-1.5 py-0.5 font-mono text-[0.95em] text-[var(--text)]",children:u[5]},`${a}-code-${f}`)):u[6]&&l.push(c.jsx("em",{className:"italic",children:u[6]},`${a}-em-${f}`)),o=s.lastIndex,f+=1;return o<t.length&&rx(t.slice(o),l,`${a}-tail`),l}function kR(t,a){var o;const l=t.split(`
273
+ `);if(t.startsWith("```")){const u=t.replace(/^```[a-zA-Z]*\n?/,"").replace(/```\s*$/,"");return c.jsx("pre",{className:"overflow-x-auto rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] p-3 text-sm font-mono text-[var(--text)]",children:c.jsx("code",{children:u})},`code-${a}`)}const s=t.match(/^(#{1,6})\s+(.+)$/);if(s&&s[2]){const u=((o=s[1])==null?void 0:o.length)??1,f=s[2],m=u<=2?"text-base font-bold text-[var(--text)]":"text-sm font-bold text-[var(--text)]";return c.jsx("p",{className:m,children:mo(f,`h-${a}`)},`h-${a}`)}return l.every(u=>/^\s*>\s?/.test(u))?c.jsx("blockquote",{className:"border-l-2 border-[var(--accent)] pl-4 text-sm italic text-[var(--text-muted)]",children:l.map((u,f)=>c.jsx("div",{children:mo(u.replace(/^\s*>\s?/,""),`bq-${a}-${f}`)},`bq-${a}-${f}`))},`bq-${a}`):/^\s*([-*_])\1{2,}\s*$/.test(t.trim())?c.jsx("hr",{className:"border-[var(--border)]"},`hr-${a}`):l.every(u=>/^\s*[-*]\s+/.test(u))?c.jsx("ul",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map((u,f)=>c.jsx("li",{className:"list-disc",children:mo(u.replace(/^\s*[-*]\s+/,""),`ul-${a}-${f}`)},`ul-${a}-${f}`))},`ul-${a}`):l.every(u=>/^\s*\d+\.\s+/.test(u))?c.jsx("ol",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)] list-decimal",children:l.map((u,f)=>c.jsx("li",{children:mo(u.replace(/^\s*\d+\.\s+/,""),`ol-${a}-${f}`)},`ol-${a}-${f}`))},`ol-${a}`):c.jsx("p",{className:"text-sm leading-6 text-[var(--text-muted)] whitespace-pre-wrap",children:mo(t,`p-${a}`)},`p-${a}`)}function xn({text:t,className:a=""}){if(!(t!=null&&t.trim()))return null;const l=t.trim().split(/\n\s*\n/).filter(Boolean);return c.jsx("div",{className:`formatted-text grid grid-cols-1 gap-3 ${a}`,children:l.map((s,o)=>kR(s,o))})}const lx={feature:{soft:"rgba(139, 92, 246, 0.16)",strong:"var(--color-entity-feature)"},phase:{soft:"rgba(6, 182, 212, 0.16)",strong:"var(--color-entity-phase)"},task:{soft:"rgba(16, 185, 129, 0.16)",strong:"var(--color-entity-task)"}};function Cr(t){return String(t&&t>0?t:0).padStart(3,"0")}function $l({featureNum:t,phaseNum:a,taskNum:l}){const s=[];return t!==void 0&&s.push(`F${Cr(t)}`),a!==void 0&&s.push(`P${Cr(a)}`),l!==void 0&&s.push(`T${Cr(l)}`),s.join("/")}async function OR(t){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(t),!0}catch{}try{const a=document.createElement("textarea");a.value=t,a.style.position="fixed",a.style.top="-1000px",a.style.opacity="0",document.body.appendChild(a),a.focus(),a.select();const l=document.execCommand("copy");return a.remove(),l}catch{return!1}}function Xb({type:t,number:a}){const l=lx[t]||lx.task,s=(l==null?void 0:l.soft)||"transparent",o=(l==null?void 0:l.strong)||"inherit";return c.jsxs("span",{className:"shrink-0 inline-flex items-center justify-center font-mono text-[11px] font-bold leading-none px-2 py-1 rounded-md transition-colors",style:{backgroundColor:s,color:o},children:[t?t.charAt(0).toUpperCase():"?",Cr(a)]})}function kc({type:t,phaseNum:a,featureNum:l}){return t==="feature"?null:t==="phase"?l===void 0?null:c.jsx("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:c.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["F",Cr(l)]})}):t==="task"?a===void 0?null:c.jsxs("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:[c.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["P",Cr(a)]}),l!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-[1px] bg-[var(--border)]"}),c.jsxs("span",{className:"px-2 py-1 text-[var(--text-subtle)]",children:["F",Cr(l)]})]})]}):null}function cr({featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:o,taskId:u}){const f=s?({children:g})=>c.jsx(Ye,{to:`/features/${s}`,className:"entity-path-seg entity-path-seg--feature entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--feature",children:g}),m=o?({children:g})=>c.jsx(Ye,{to:`/features/${s}/phases/${o}`,className:"entity-path-seg entity-path-seg--phase entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--phase",children:g}),p=u?({children:g})=>c.jsx(Ye,{to:`/features/${s}/phases/${o}/tasks/${u}`,className:"entity-path-seg entity-path-seg--task entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--task",children:g});return c.jsxs("span",{className:"entity-path-badge",children:[t!==void 0?c.jsxs(f,{children:["F",Cr(t)]}):null,a!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),c.jsxs(m,{children:["P",Cr(a)]})]}):null,l!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),c.jsxs(p,{children:["T",Cr(l)]})]}):null]})}function mr({id:t,children:a}){const[l,s]=v.useState(!1);return c.jsxs("button",{type:"button",onClick:async o=>{o.preventDefault(),o.stopPropagation(),await OR(t)&&(s(!0),window.setTimeout(()=>s(!1),1200))},title:l?"Copied":`Copy ${t}`,"aria-label":l?"Copied":`Copy ${t}`,className:"copyable-id group inline-flex items-center gap-1.5",children:[a,c.jsx("span",{className:"copyable-id__icon","aria-hidden":"true",children:l?c.jsx(_b,{className:"h-3 w-3 text-emerald-500"}):c.jsx(Bb,{className:"h-3 w-3"})})]})}function ql({shortId:t}){return c.jsx(mr,{id:t,children:c.jsx("span",{className:"short-id-badge",children:t})})}function Sm({phaseId:t,updatedAt:a}){const l=`Phase handoff pending${a?` · updated ${new Date(a).toLocaleString()}`:""}`;return c.jsxs("a",{href:`/handoff#${t}`,className:"handoff-badge flex items-center gap-1 ml-2 shrink-0",title:l,"aria-label":l,children:[c.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"}),c.jsx("path",{d:"M9 2v3h3"}),c.jsx("path",{d:"M5.5 8h5M5.5 10.5h5"})]}),c.jsx("span",{className:"handoff-badge__label",children:"handoff"})]})}function MR({activeTasks:t}){const a=kr(),l=v.useMemo(()=>{const s=new Set;return t.filter(o=>{const u=`${o.id}-${o.title}-${o.phaseId}`;return s.has(u)?!1:(s.add(u),!0)})},[t]);return l.length===0?null:c.jsx("div",{className:"relative z-10 border-t border-[var(--border)] bg-[var(--surface-elevated)]/95 backdrop-blur-xl",children:c.jsx("div",{className:"page-container py-2.5",children:c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["In-progress tasks (",l.length,")"]}),c.jsx("div",{className:"grid grid-cols-1 max-h-[35vh] gap-1.5 overflow-y-auto pr-1",children:l.map(s=>{const o=s.featureId?`/features/${s.featureId}/phases/${s.phaseId}/tasks/${s.id}`:"/features";return c.jsxs("div",{className:"flex min-w-0 items-center gap-2 rounded-[10px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] transition-colors hover:border-[var(--accent)] hover:bg-[var(--accent-soft)] hover:text-[var(--accent)]",children:[s.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"inline-block h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]","aria-label":"In progress"}):null,c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c.jsx(cr,{featureNum:s.featureNumber,phaseNum:s.phaseNumber,taskNum:s.number,featureId:s.featureId,phaseId:s.phaseId,taskId:s.id}),c.jsx(mr,{id:$l({featureNum:s.featureNumber,phaseNum:s.phaseNumber,taskNum:s.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),s.shortId?c.jsx(ql,{shortId:s.shortId}):null,c.jsx(Ye,{to:o,className:"min-w-0 flex-1 truncate font-medium",children:s.title})]}),c.jsx("button",{type:"button",onClick:u=>{u.preventDefault(),u.stopPropagation(),a(`/?locate=T${s.number}`)},"aria-label":`Locate T${s.number} in work tree`,title:"Locate in work tree",className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-[8px] text-[var(--text-subtle)] transition-colors hover:bg-[var(--accent)] hover:text-[var(--text)]",children:c.jsx(XN,{className:"h-4 w-4"})})]},s.id)})})]})})})}function _R({project:t,activeTasks:a,serverInfo:l}){const s=Or(),[o,u]=v.useState("connecting");return v.useEffect(()=>{const f=m=>{var g;const p=(g=m.detail)==null?void 0:g.status;p&&u(p)};return window.addEventListener("agent-plan:ws-status",f),()=>window.removeEventListener("agent-plan:ws-status",f)},[]),c.jsxs("div",{className:"page-shell",children:[c.jsxs("header",{className:"sticky top-0 z-30 overflow-visible",children:[c.jsx(DR,{projectName:t==null?void 0:t.name,projectRoot:t==null?void 0:t.projectRoot,planRoot:t==null?void 0:t.planRoot,liveStatus:o}),c.jsx(MR,{activeTasks:a})]}),c.jsxs("div",{className:"page-container py-8",children:[c.jsxs("div",{className:"mb-8 flex flex-col gap-3 md:flex-row md:items-end md:justify-between md:gap-6",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Current project"}),c.jsx("h1",{className:"text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:c.jsx(Ye,{to:"/",className:"hover:text-[var(--accent)]",children:(t==null?void 0:t.name)??"Agent Plan"})}),t!=null&&t.projectRoot?c.jsx("p",{className:"mt-2 truncate font-mono text-xs text-[var(--text-subtle)]",title:t.projectRoot,children:t.projectRoot}):null,l?c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[c.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 font-semibold uppercase tracking-[0.12em] ${l.mode==="lan"?"bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] text-[var(--accent)]":"bg-[var(--surface-elevated)] text-[var(--text-muted)]"}`,children:[c.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 rounded-full bg-current"}),l.mode==="lan"?"LAN visible":"Local only"]}),c.jsx("a",{href:l.localUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:l.localUrl}),l.lanUrl?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-[var(--text-subtle)]",children:"·"}),c.jsx("a",{href:l.lanUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:l.lanUrl})]}):null]}):null,t!=null&&t.description?c.jsx(xn,{text:t.description,className:"mt-2 max-w-3xl"}):null]}),s.state!=="idle"?c.jsx("div",{className:"text-sm font-semibold text-[var(--accent)]",children:"Updating…"}):null]}),c.jsx(pi,{})]})]})}const Ra=32,Qb=4,LR=Math.PI*1.2;function Kb(){if(typeof document>"u")return"#7b68ee";const t=document.createElement("div");t.style.color="var(--accent, #7b68ee)",document.body.appendChild(t);const a=getComputedStyle(t).color||"#7b68ee";return t.remove(),a}function zR(){const t=document.createElement("canvas");t.width=Ra,t.height=Ra;const a=t.getContext("2d");if(!a)return"";const l=Kb();return a.beginPath(),a.arc(Ra/2,Ra/2,Ra/2-Qb,0,Math.PI*2),a.fillStyle=l,a.fill(),a.fillStyle="#ffffff",a.font="bold 16px system-ui, sans-serif",a.textAlign="center",a.textBaseline="middle",a.fillText("A",Ra/2,Ra/2+1),t.toDataURL("image/png")}function UR(t,a){const l=t.getContext("2d");if(!l)return"";const s=Kb();l.clearRect(0,0,Ra,Ra);const o=Ra/2,u=Ra/2,f=Ra/2-Qb;return l.beginPath(),l.arc(o,u,f,0,Math.PI*2),l.fillStyle=s,l.globalAlpha=.85,l.fill(),l.globalAlpha=1,l.beginPath(),l.arc(o,u,f-3,a,a+LR),l.strokeStyle="#ffffff",l.lineWidth=3,l.lineCap="round",l.stroke(),l.fillStyle="#ffffff",l.font="bold 14px system-ui, sans-serif",l.textAlign="center",l.textBaseline="middle",l.fillText("A",o,u+1),t.toDataURL("image/png")}function BR(){let t=document.querySelector("link[rel~='icon']");return t||(t=document.createElement("link"),t.rel="icon",t.type="image/png",document.head.appendChild(t)),t}function HR(t){const a=v.useRef(null),l=v.useRef(null),s=v.useRef(null),o=v.useRef(0);v.useEffect(()=>{if(a.current||(a.current=BR()),s.current||(s.current=zR()),!l.current){const m=document.createElement("canvas");m.width=Ra,m.height=Ra,l.current=m}const u=a.current;if(!t){u.href=s.current;return}const f=window.setInterval(()=>{document.hidden||(o.current+=Math.PI/10,u.href=UR(l.current,o.current))},100);return()=>{window.clearInterval(f),u.href=s.current}},[t])}const wo={create:{key:"n",primary:!0},edit:{key:"e",primary:!0},delete:{key:"d",primary:!0},submit:{key:"Enter",primary:!0}},Zb=v.createContext(wo);function Jb(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function $R(t){return typeof t!="string"}function qR(t){return{create:(t==null?void 0:t.create)??wo.create,edit:(t==null?void 0:t.edit)??wo.edit,delete:(t==null?void 0:t.delete)??wo.delete,submit:(t==null?void 0:t.submit)??wo.submit}}function IR(t){const a=[],l=Jb();t.primary&&a.push(l?"⌘":"Ctrl"),t.meta&&a.push(l?"⌘":"Meta"),t.ctrl&&a.push(l?"⌃":"Ctrl"),t.shift&&a.push(l?"⇧":"Shift"),t.alt&&a.push(l?"⌥":"Alt");const s=t.key==="Backspace"?l?"⌫":"Backspace":t.key==="Enter"?l?"↩":"Enter":t.key.length===1?t.key.toUpperCase():t.key;return a.push(s),l?a.join(""):a.join("+")}function VR(t){return t instanceof HTMLElement?!!t.closest("input, textarea, select, [contenteditable='true']"):!1}function YR(t,a){const l=a.key.length===1?a.key.toLowerCase():a.key,s=t.key.length===1?t.key.toLowerCase():t.key,o=Jb(),u=a.meta??(a.primary?o:!1),f=a.ctrl??(a.primary?!o:!1);return s===l&&!!u===t.metaKey&&!!f===t.ctrlKey&&!!a.shift===t.shiftKey&&!!a.alt===t.altKey}function FR({shortcuts:t,children:a}){return v.createElement(Zb.Provider,{value:qR(t)},a)}function Wb(t){const a=v.useContext(Zb);if(t)return $R(t)?t:a[t]}function Dn(t,a,l){const s=Wb(t);v.useEffect(()=>{if(!s||(l==null?void 0:l.enabled)===!1)return;const o=u=>{!(l!=null&&l.allowInEditable)&&VR(u.target)||YR(u,s)&&(u.preventDefault(),a())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a,l==null?void 0:l.allowInEditable,l==null?void 0:l.enabled,s])}const PR=1500,GR=80,XR=12e3,QR=5e3;function KR(){const{revalidate:t}=hE(),a=v.useRef(null),l=v.useRef(null),s=v.useRef(null),o=v.useRef(null),u=v.useRef(null);return v.useEffect(()=>{let f=!0;const m=X=>{window.dispatchEvent(new CustomEvent("agent-plan:ws-status",{detail:{status:X}}))},p=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},g=()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)},x=()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},y=()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},N=()=>{g(),s.current=window.setTimeout(()=>{t()},GR)},w=()=>{!f||l.current!==null||(m("reconnecting"),l.current=window.setTimeout(()=>{l.current=null,R()},PR))},S=()=>{y(),x();const X=a.current;if(a.current=null,X&&(X.readyState===WebSocket.OPEN||X.readyState===WebSocket.CONNECTING))try{X.close()}catch{}},A=()=>{y(),x(),o.current=window.setInterval(()=>{const X=a.current;if(!(!X||X.readyState!==WebSocket.OPEN)){try{X.send(JSON.stringify({type:"ping"}))}catch{S(),w();return}x(),u.current=window.setTimeout(()=>{S(),w()},QR)}},XR)},R=()=>{if(!f)return;const X=a.current;if(X&&(X.readyState===WebSocket.OPEN||X.readyState===WebSocket.CONNECTING))return;m(l.current!==null?"reconnecting":"connecting"),p();const W=window.location.protocol==="https:"?"wss":"ws",ae=new WebSocket(`${W}://${window.location.host}/ws`);a.current=ae,ae.onopen=()=>{p(),m("live"),A()},ae.onmessage=z=>{x();try{const T=JSON.parse(z.data);if(!T.type||T.type==="pong"||T.type==="connected")return;switch(window.dispatchEvent(new CustomEvent("agent-plan:ws-event",{detail:T})),T.type){case"project-updated":case"features-updated":case"phases-updated":case"requirements-updated":case"plan-rendered":case"file-changed":case"handoffUpdated":case"handoffCleared":N();break;default:break}}catch{}},ae.onclose=()=>{y(),x(),a.current===ae&&(a.current=null),f&&w()},ae.onerror=()=>{try{ae.close()}catch{}}},L=()=>{const X=a.current;(!X||X.readyState===WebSocket.CLOSED||X.readyState===WebSocket.CLOSING)&&R()},I=()=>{document.visibilityState==="visible"&&L()},q=()=>{L()};return m("connecting"),R(),window.addEventListener("online",q),document.addEventListener("visibilitychange",I),()=>{f=!1,m("disconnected"),window.removeEventListener("online",q),document.removeEventListener("visibilitychange",I),p(),g(),y(),x(),S()}},[t]),null}async function ZR(){const[t,a,l]=await Promise.all([Ib(),pR(),Pb()]);return{project:t,uiConfig:a,activeTasks:l}}function JR(){const{project:t,uiConfig:a,activeTasks:l}=ll();return v.useEffect(()=>{var f,m;const s=(f=t==null?void 0:t.name)==null?void 0:f.trim(),o=(m=t==null?void 0:t.projectRoot)==null?void 0:m.trim(),u=o?o.split(/[/\\]/).filter(Boolean).pop():void 0;s?u&&u!==s?document.title=`${s} · ${u}`:document.title=`${s} · Agent Plan`:document.title="Agent Plan"},[t==null?void 0:t.name,t==null?void 0:t.projectRoot]),HR(l.length>0),c.jsxs(FR,{shortcuts:a.shortcuts,children:[c.jsx(KR,{}),c.jsx(_R,{project:t,activeTasks:l,serverInfo:a.server})]})}function WR(){const t=Tb(),a=fi(t),l=a&&t.status===503,s=a?l?"Planner web UI disconnected":`Request failed (${t.status})`:"Planner web UI unavailable",o=a?t.data||t.statusText:t instanceof Error?t.message:"The planner web UI could not reach its local server.";return v.useEffect(()=>{document.title="Agent Plan"},[]),c.jsx("div",{className:"page-shell min-h-screen",children:c.jsx("div",{className:"page-container flex min-h-screen items-center justify-center py-12",children:c.jsxs("div",{className:"surface-card max-w-2xl rounded-[24px] px-8 py-8",children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Agent Plan"}),c.jsx("h1",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:s}),c.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:String(o)}),c.jsx("div",{className:"mt-6 grid gap-2 text-sm text-[var(--text-muted)]",children:l?c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Possible cause: Pi was closed or the local planner web server stopped."}),c.jsx("p",{children:"What to do:"}),c.jsxs("ul",{className:"grid gap-1 pl-5",children:[c.jsxs("li",{className:"list-disc",children:["restart Pi or run ",c.jsx("code",{children:"planner-web start"})]}),c.jsx("li",{className:"list-disc",children:"reopen this planner UI from the new session if needed"}),c.jsx("li",{className:"list-disc",children:"then reload this page"})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"The request reached the planner server, but the server rejected it."}),c.jsx("p",{children:"Fix the validation issue above, then try again."})]})}),c.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:c.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex min-h-9 items-center whitespace-nowrap rounded-[12px] bg-[var(--accent)] px-3 py-1.5 text-sm font-semibold text-white transition hover:opacity-90 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2",children:"Reload page"})})]})})})}async function e2(){const[t,a,l]=await Promise.all([Vb(),Jc(),Pb()]);return{features:t,phases:a,activeTasks:l}}function t2({shortcut:t}){const a=Wb(t);return a?c.jsx("span",{className:"hidden rounded-md border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2 py-0.5 text-[11px] font-bold tracking-wide text-[var(--text-muted)] sm:inline-block",children:IR(a)}):null}const n2={primary:"border-transparent bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)]",secondary:"border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",ghost:"border-transparent bg-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",danger:"border-transparent bg-[var(--danger-soft)] text-[var(--color-status-blocked)] hover:bg-[color-mix(in_srgb,var(--danger-soft)_88%,black_12%)]"};function gt({variant:t="secondary",className:a="",children:l,shortcut:s,...o}){return c.jsxs("button",{className:`inline-flex min-h-9 items-center justify-center gap-1.5 whitespace-nowrap rounded-[12px] border px-3 py-1.5 text-sm font-semibold transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface)] disabled:cursor-not-allowed disabled:opacity-60 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2 sm:gap-2 ${n2[t]} ${a}`,...o,children:[c.jsx("span",{className:"inline-flex items-center gap-1.5 sm:gap-2",children:l}),s?c.jsx(t2,{shortcut:s}):null]})}function Pt({className:t="",children:a,...l}){return c.jsx("div",{className:`surface-card p-6 ${t}`,...l,children:a})}function a2({decisions:t}){return t.length===0?null:c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Accepted decisions (",t.length,")"]}),c.jsx("div",{className:"mt-4 grid gap-3",children:t.map(a=>c.jsxs("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?c.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"})," ",c.jsx(xn,{text:a.decision})]}):null,a.rationale?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"})," ",c.jsx(xn,{text:a.rationale})]}):null,a.implementationNotes?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"})," ",c.jsx(xn,{text:a.implementationNotes})]}):null]},a.id))})]})}function r2({project:t}){var x,y,N;const a=t.scope??[],l=t.outOfScope??[],s=t.technologies??[],o=t.tools??[],u=t.globalRules??[],f=t.decisions??[],m=t.acceptedDecisions??[],p={beforePhaseStart:((x=t.workflowRules)==null?void 0:x.beforePhaseStart)??[],beforeTaskStart:((y=t.workflowRules)==null?void 0:y.beforeTaskStart)??[],afterPhaseComplete:((N=t.workflowRules)==null?void 0:N.afterPhaseComplete)??[]};return a.length>0||l.length>0||s.length>0||o.length>0||u.length>0||f.length>0||m.length>0||p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?c.jsx(Pt,{className:"grid gap-4",children:c.jsxs("details",{className:"group",children:[c.jsx("summary",{className:"cursor-pointer select-none text-lg font-bold text-[var(--text)]",children:"AI Consolidated Context"}),c.jsxs("div",{className:"mt-4 grid gap-4",children:[a.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"In scope"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:a.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,l.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Out of scope"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,s.length>0||o.length>0?c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Technologies"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:s.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,o.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Tools"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:o.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null]}):null,u.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Global rules"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:u.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsx("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:"Workflow rules"}),c.jsxs("div",{className:"mt-4 grid gap-4 text-sm text-[var(--text-muted)]",children:[p.beforePhaseStart.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before phase start"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforePhaseStart.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.beforeTaskStart.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before task start"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforeTaskStart.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.afterPhaseComplete.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"After phase complete"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.afterPhaseComplete.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null]})]}):null,f.length>0?c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Legacy decisions (",f.length,")"]}),c.jsx("ul",{className:"mt-4 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:f.map(w=>c.jsx("li",{className:"list-disc",children:w},w))})]}):null,c.jsx(a2,{decisions:m})]})]})}):null}const Gh={planned:{colorVar:"--color-status-planned",icon:"circle",pattern:"",label:"Planned",description:"Not started",borderStyle:"solid",bgOpacity:10,borderOpacity:30},started:{colorVar:"--color-status-started",icon:"play-start",pattern:"dashed",label:"Started",description:"Begun but not active now",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},"in-progress":{colorVar:"--color-status-in-progress",icon:"play",pattern:"pulse",label:"In progress",description:"Active now",borderStyle:"solid",bgOpacity:12,borderOpacity:30},waiting:{colorVar:"--color-status-waiting",icon:"clock",pattern:"dashed",label:"Waiting",description:"Waiting on a dependency",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},blocked:{colorVar:"--color-status-blocked",icon:"stop",pattern:"",label:"Blocked",description:"Impediment",borderStyle:"solid",bgOpacity:12,borderOpacity:30},deferred:{colorVar:"--color-status-deferred",icon:"pause",pattern:"dashed",label:"Deferred",description:"Postponed",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},done:{colorVar:"--color-status-done",icon:"check",pattern:"",label:"Done",description:"Completed",borderStyle:"solid",bgOpacity:14,borderOpacity:30},closed:{colorVar:"--color-status-closed",icon:"check-mixed",pattern:"",label:"Closed",description:"Closed with mixed outcomes",borderStyle:"solid",bgOpacity:14,borderOpacity:30},canceled:{colorVar:"--color-status-canceled",icon:"ban",pattern:"hatch",label:"Canceled",description:"Canceled",borderStyle:"solid",bgOpacity:8,borderOpacity:30},rejected:{colorVar:"--color-status-rejected",icon:"x",pattern:"crosshatch",label:"Rejected",description:"Rejected",borderStyle:"solid",bgOpacity:10,borderOpacity:30}};function Il(t){return Gh[t]??Gh.planned}function Oc(t,a,l){switch(a){case"bg":return`color-mix(in srgb, var(${t.colorVar}) ${t.bgOpacity}%, transparent)`;case"border":return`color-mix(in srgb, var(${t.colorVar}) ${t.borderOpacity}%, transparent)`}}function l2(t){const a=Il(t);return{backgroundColor:Oc(a,"bg"),borderStyle:a.borderStyle,borderColor:Oc(a,"border"),borderWidth:"1px"}}function s2(t){const a=Il(t);return{backgroundColor:Oc(a,"bg"),borderStyle:a.borderStyle,borderColor:Oc(a,"border"),borderWidth:"1px"}}function wm(t){const{pattern:a}=Il(t);return a?a==="dashed"?`status-pattern-dashed status-pattern-dashed-${t}`:`status-pattern-${a}`:""}function e0(t){return`status-${t}`}function t0(t,a=30){return`color-mix(in srgb, var(${Il(t).colorVar}) ${a}%, transparent)`}function n0(t){return t in Gh?t:"planned"}function i2(t,a){const s=[Il(t).label],o=[["done",a.done],["in-progress",a.inProgress],["planned",a.planned],["waiting",a.waiting],["blocked",a.blocked],["deferred",a.deferred],["canceled",a.canceled],["rejected",a.rejected]];for(const[u,f]of o)f>0&&s.push(`${f} ${u}`);return s.join(" · ")}const a0={circle:Xc,"play-start":eR,play:Ub,clock:LN,stop:Hb,pause:zb,check:vm,"check-mixed":EN,ban:Mb,x:ON};function o2({status:t,className:a=""}){const l=Il(t),s=a0[l.icon]??Xc;return c.jsx(s,{className:`h-4 w-4 shrink-0 ${a}`.trim(),"aria-hidden":"true"})}function ur({status:t}){const a=n0(t),l=Il(a);return c.jsxs("span",{className:`status-chip ${e0(a)} ${wm(a)}`,title:l.description,"aria-label":l.description,children:[c.jsx(o2,{status:a,className:"h-3.5 w-3.5"}),c.jsx("span",{children:l.label})]})}function Fo({status:t,breakdown:a,size:l="md",children:s}){const o=Il(t),u=a0[o.icon]??Xc,f=wm(t),m=a?i2(t,a):o.description,p=l==="sm"?"px-2 py-0.5 text-[10px]":"px-2.5 py-1 text-[11px]";return c.jsxs("span",{className:`status-chip ${e0(t)} ${f} ${p}`,title:m,"aria-label":m,children:[c.jsx(u,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:o.label}),s]})}function Mc({status:t,breakdown:a,doneTasks:l,totalTasks:s,recentlyChanged:o,className:u}){const f=l!=null&&s!=null;return c.jsxs("div",{className:u,children:[o?c.jsx("span",{className:"rounded-full bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Updated"}):null,f?c.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",l,"/",s||0,")"]}):null,c.jsx(Fo,{status:t,breakdown:a})]})}function u2(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function c2({features:t,phases:a}){const l=v.useMemo(()=>{const s=new Map(t.map(o=>[o.id,o.name]));return a.flatMap(o=>o.tasks.filter(u=>u.status==="done").map(u=>({task:u,phase:o,feature:t.find(f=>f.id===o.featureId),featureName:o.featureId?s.get(o.featureId)??o.featureId:"Unlinked feature",completedAt:u.completedAt||u.updatedAt}))).sort((o,u)=>u.completedAt.localeCompare(o.completedAt)).slice(0,3)},[t,a]);return c.jsxs(Pt,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Latest completed tasks"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Most recently completed tasks, ordered by completion timestamp."})]}),c.jsx("div",{className:"grid gap-3",children:l.length>0?l.map(({task:s,phase:o,feature:u,featureName:f,completedAt:m})=>c.jsxs(Ye,{to:o.featureId?`/features/${o.featureId}/phases/${o.id}/tasks/${s.id}`:"/features",className:"surface-card grid min-w-0 grid-cols-1 gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Xb,{type:"task",number:s.number}),c.jsx(kc,{type:"task",phaseNum:o.number,featureNum:u==null?void 0:u.number}),c.jsx("span",{className:"shrink-0",children:c.jsx(ur,{status:s.status})})]}),c.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:s.title}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[c.jsx(kc,{type:"phase",featureNum:u==null?void 0:u.number}),c.jsxs("span",{className:"min-w-0 truncate",children:[f," · ",o.title]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Completed ",u2(m)]})]},s.id)):c.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const sx=1440*60*1e3;function d2(t){const a=Date.now()-new Date(t).getTime();if(a<0)return"just now";const l=Math.floor(a/1e3);if(l<60)return`${l}s ago`;const s=Math.floor(l/60);return s<60?`${s}m ago`:new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}function f2({features:t,phases:a}){const[,l]=v.useState(0),s=Date.now(),o=v.useMemo(()=>{const u=new Map(t.map(f=>[f.id,f.name]));return a.flatMap(f=>f.tasks.map(m=>({task:m,phase:f,feature:t.find(p=>p.id===f.featureId),featureName:f.featureId?u.get(f.featureId)??f.featureId:"Unlinked feature",createdAt:m.createdAt}))).filter(f=>{const m=new Date(f.createdAt).getTime();return Number.isFinite(m)&&s-m<sx&&s-m>=0&&f.task.status==="planned"&&!f.task.startedAt}).sort((f,m)=>m.createdAt.localeCompare(f.createdAt)).slice(0,10)},[t,a,s]);return v.useEffect(()=>{if(o.length===0)return;const u=o.reduce((m,p)=>{const g=new Date(p.createdAt).getTime()+sx-Date.now();return Math.min(m,g)},1/0);if(!Number.isFinite(u)||u<=0)return;const f=window.setTimeout(()=>l(m=>m+1),u+50);return()=>window.clearTimeout(f)},[o]),o.length===0?null:c.jsxs(Pt,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"New Added Tasks"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Tasks created in the last 24 hours."})]}),c.jsx("div",{className:"grid gap-3",children:o.map(({task:u,phase:f,feature:m,featureName:p,createdAt:g})=>c.jsxs(Ye,{to:f.featureId?`/features/${f.featureId}/phases/${f.id}/tasks/${u.id}`:"/features",className:"surface-card grid min-w-0 grid-cols-1 gap-1 border-[color:color-mix(in_srgb,var(--color-status-done)_0%,transparent)] px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Xb,{type:"task",number:u.number}),c.jsx(kc,{type:"task",phaseNum:f.number,featureNum:m==null?void 0:m.number}),c.jsx("span",{className:"inline-flex items-center rounded-full bg-[color:color-mix(in_srgb,var(--accent)_18%,transparent)] px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-[var(--accent)]",children:"New"}),c.jsx("span",{className:"shrink-0",children:c.jsx(ur,{status:u.status})})]}),c.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:u.title}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[c.jsx(kc,{type:"phase",featureNum:m==null?void 0:m.number}),c.jsxs("span",{className:"min-w-0 truncate",children:[p," · ",f.title]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Added ",d2(g)]})]},u.id))})]})}const h2=new Set(["in-progress"]),m2=new Set(["planned","waiting","blocked","deferred"]),p2=new Set(["done","canceled","rejected"]);function r0(t){return t==="discovery"?"in-progress":t==="draft"?"planned":t}function g2(t){const a={planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0};for(const l of t)switch(l){case"planned":a.planned++;break;case"in-progress":a.inProgress++;break;case"waiting":a.waiting++;break;case"blocked":a.blocked++;break;case"deferred":a.deferred++;break;case"done":a.done++;break;case"canceled":a.canceled++;break;case"rejected":a.rejected++;break}return a}function v2(){return{planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0}}function l0(t){const a=t,l=g2(a),s=a.length;if(s===0)return{displayStatus:"planned",breakdown:v2(),hasStarted:!1,totalChildren:0,meaningfulChildren:0};const o=a.filter(g=>g!=="canceled"&&g!=="rejected"),u=o.length,f=o.some(g=>g!=="planned");if(o.some(g=>h2.has(g)))return{displayStatus:"in-progress",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u};if(a.every(g=>p2.has(g)))return a.every(g=>g==="done")?{displayStatus:"done",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:a.every(g=>g==="canceled")?{displayStatus:"canceled",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:a.every(g=>g==="rejected")?{displayStatus:"rejected",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:{displayStatus:"closed",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u};const m=o.filter(g=>m2.has(g));return m.length>0&&m.every(g=>g==="waiting")?{displayStatus:"waiting",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="blocked")?{displayStatus:"blocked",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="deferred")?{displayStatus:"deferred",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="planned")&&!f?{displayStatus:"planned",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:{displayStatus:"started",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}}function Em(t){const a=t.map(l=>r0(l.status));return l0(a)}function Nm(t){const a=t.map(l=>r0(l.status));return l0(a)}function s0(t){return Nm(t)}function i0(t){return Em(t)}const Eo={key:"priority",direction:"asc"},y2=4200;function x2(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function b2(t){return t.reduce((a,l)=>a+l.tasks.filter(s=>s.status==="done").length,0)}function S2(t){return String(t&&t>0?t:0).padStart(3,"0")}const w2={draft:0,discovery:1,planned:2,waiting:3,blocked:4,deferred:5,"in-progress":6,done:7,canceled:8,rejected:9};function ix(t,a){if(a==="title")return"name"in t?t.name:t.title;if(a==="status")return w2[t.status]??99;if(a==="startedAt"){if("startedAt"in t){const l=t.startedAt;return l?new Date(l).getTime():Number.MAX_SAFE_INTEGER}return Number.MAX_SAFE_INTEGER}if(a==="completedAt"){if("completedAt"in t){const l=t.completedAt;return l?new Date(l).getTime():Number.MAX_SAFE_INTEGER}return Number.MAX_SAFE_INTEGER}if(a==="shortId")return t.shortId??"";if(a==="priority"||a==="number")return t[a]??0;if(a==="createdAt"||a==="updatedAt"){const l=t[a];return l?new Date(l).getTime():0}return 0}function Ro(t,a,l,s){const o=ix(t,l),u=ix(a,l);let f;return typeof o=="number"&&typeof u=="number"?f=o-u:f=String(o).localeCompare(String(u)),f===0&&(f=(t.priority??0)-(a.priority??0)||t.number-a.number||t.createdAt.localeCompare(a.createdAt)),s==="desc"?-f:f}function E2(t,a,l=Eo){const s=new Map;for(const o of a){if(!o.featureId)continue;const u=s.get(o.featureId)??[];u.push(o),s.set(o.featureId,u)}return t.map(o=>{const u=s.get(o.id)??[],f=u.reduce((x,y)=>x+y.tasks.length,0),m=u.reduce((x,y)=>x+y.tasks.filter(N=>N.status==="done").length,0),p=u.map(x=>{const y=[...x.tasks].sort((w,S)=>Ro(w,S,l.key,l.direction)),N=y.some(w=>w.status==="in-progress");return{phase:x,totalTasks:x.tasks.length,doneTasks:x.tasks.filter(w=>w.status==="done").length,allTasks:y,hasActiveTask:N,display:Em(y)}}),g=p.some(({phase:x,allTasks:y})=>x.status==="in-progress"||x.status==="discovery"||y.some(N=>N.status==="in-progress"));return{feature:o,totalTasks:f,doneTasks:m,allPhases:p.sort((x,y)=>Ro(x.phase,y.phase,l.key,l.direction)),hasActiveTask:p.some(x=>x.hasActiveTask),isActive:g,display:Nm(p.map(x=>x.phase))}}).sort((o,u)=>Ro(o.feature,u.feature,l.key,l.direction))}function dc({title:t,value:a,valueSuffix:l,subtitle:s,icon:o,valueClassName:u,iconClassName:f}){return c.jsxs(Pt,{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:t}),c.jsxs("div",{className:"mt-2 flex items-end gap-2",children:[c.jsx("p",{className:`text-3xl font-black tracking-tight ${u??"text-[var(--text)]"}`,children:a}),l?c.jsx("span",{className:"pb-1 text-sm font-semibold text-[var(--text-muted)]",children:l}):null]}),c.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:s})]}),c.jsx("div",{className:`surface-card flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] bg-[var(--accent-soft)] ${f??"text-[var(--accent)]"}`,children:o})]})}function ox(t){return t>=80?"text-emerald-600 dark:text-emerald-400":t>=30?"text-amber-600 dark:text-amber-400":"text-rose-600 dark:text-rose-400"}function N2({features:t,phases:a}){const l=new Map;for(const y of a)y.featureId&&l.set(y.featureId,[...l.get(y.featureId)??[],y]);const s=t.filter(y=>{const N=l.get(y.id)??[];return Nm(N).displayStatus==="done"}).length,o=Math.max(t.length-s,0),u=a.filter(y=>Em(y.tasks).displayStatus==="done").length,f=Math.max(a.length-u,0),m=x2(a),p=b2(a),g=Math.max(m-p,0),x=m>0?Math.round(p/m*100):0;return c.jsxs("div",{className:"grid gap-4 lg:grid-cols-4",children:[c.jsx(dc,{title:"Features",value:String(t.length),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[s," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[o," left"]})]}),icon:c.jsx(Dc,{className:"h-4 w-4"})}),c.jsx(dc,{title:"Phases",value:String(a.length),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[u," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[f," left"]})]}),icon:c.jsx(yN,{className:"h-4 w-4"})}),c.jsx(dc,{title:"Tasks",value:String(m),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[p," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[g," left"]})]}),icon:c.jsx(Vo,{className:"h-4 w-4"})}),c.jsx(dc,{title:"Completion",value:`${x}%`,subtitle:"Task completion rate",valueClassName:ox(x),iconClassName:ox(x),icon:c.jsx(vm,{className:"h-4 w-4"})})]})}function R2(){for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];return v.useMemo(()=>s=>{a.forEach(o=>o(s))},a)}const td=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gi(t){const a=Object.prototype.toString.call(t);return a==="[object Window]"||a==="[object global]"}function Rm(t){return"nodeType"in t}function pa(t){var a,l;return t?gi(t)?t:Rm(t)&&(a=(l=t.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function jm(t){const{Document:a}=pa(t);return t instanceof a}function Po(t){return gi(t)?!1:t instanceof pa(t).HTMLElement}function o0(t){return t instanceof pa(t).SVGElement}function vi(t){return t?gi(t)?t.document:Rm(t)?jm(t)?t:Po(t)||o0(t)?t.ownerDocument:document:document:document}const dr=td?v.useLayoutEffect:v.useEffect;function nd(t){const a=v.useRef(t);return dr(()=>{a.current=t}),v.useCallback(function(){for(var l=arguments.length,s=new Array(l),o=0;o<l;o++)s[o]=arguments[o];return a.current==null?void 0:a.current(...s)},[])}function j2(){const t=v.useRef(null),a=v.useCallback((s,o)=>{t.current=setInterval(s,o)},[]),l=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[a,l]}function Mo(t,a){a===void 0&&(a=[t]);const l=v.useRef(t);return dr(()=>{l.current!==t&&(l.current=t)},a),l}function Go(t,a){const l=v.useRef();return v.useMemo(()=>{const s=t(l.current);return l.current=s,s},[...a])}function _c(t){const a=nd(t),l=v.useRef(null),s=v.useCallback(o=>{o!==l.current&&(a==null||a(o,l.current)),l.current=o},[]);return[l,s]}function Lc(t){const a=v.useRef();return v.useEffect(()=>{a.current=t},[t]),a.current}let Eh={};function Xo(t,a){return v.useMemo(()=>{if(a)return a;const l=Eh[t]==null?0:Eh[t]+1;return Eh[t]=l,t+"-"+l},[t,a])}function u0(t){return function(a){for(var l=arguments.length,s=new Array(l>1?l-1:0),o=1;o<l;o++)s[o-1]=arguments[o];return s.reduce((u,f)=>{const m=Object.entries(f);for(const[p,g]of m){const x=u[p];x!=null&&(u[p]=x+t*g)}return u},{...a})}}const di=u0(1),zc=u0(-1);function T2(t){return"clientX"in t&&"clientY"in t}function ad(t){if(!t)return!1;const{KeyboardEvent:a}=pa(t.target);return a&&t instanceof a}function C2(t){if(!t)return!1;const{TouchEvent:a}=pa(t.target);return a&&t instanceof a}function Uc(t){if(C2(t)){if(t.touches&&t.touches.length){const{clientX:a,clientY:l}=t.touches[0];return{x:a,y:l}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:a,clientY:l}=t.changedTouches[0];return{x:a,y:l}}}return T2(t)?{x:t.clientX,y:t.clientY}:null}const Hl=Object.freeze({Translate:{toString(t){if(!t)return;const{x:a,y:l}=t;return"translate3d("+(a?Math.round(a):0)+"px, "+(l?Math.round(l):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:a,scaleY:l}=t;return"scaleX("+a+") scaleY("+l+")"}},Transform:{toString(t){if(t)return[Hl.Translate.toString(t),Hl.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:a,duration:l,easing:s}=t;return a+" "+l+"ms "+s}}}),ux="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function A2(t){return t.matches(ux)?t:t.querySelector(ux)}const D2={display:"none"};function k2(t){let{id:a,value:l}=t;return un.createElement("div",{id:a,style:D2},l)}function O2(t){let{id:a,announcement:l,ariaLiveType:s="assertive"}=t;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return un.createElement("div",{id:a,style:o,role:"status","aria-live":s,"aria-atomic":!0},l)}function M2(){const[t,a]=v.useState("");return{announce:v.useCallback(s=>{s!=null&&a(s)},[]),announcement:t}}const c0=v.createContext(null);function _2(t){const a=v.useContext(c0);v.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(t)},[t,a])}function L2(){const[t]=v.useState(()=>new Set),a=v.useCallback(s=>(t.add(s),()=>t.delete(s)),[t]);return[v.useCallback(s=>{let{type:o,event:u}=s;t.forEach(f=>{var m;return(m=f[o])==null?void 0:m.call(f,u)})},[t]),a]}const z2={draggable:`
274
+ To pick up a draggable item, press the space bar.
275
+ While dragging, use the arrow keys to move the item.
276
+ Press space again to drop the item in its new position, or press escape to cancel.
277
+ `},U2={onDragStart(t){let{active:a}=t;return"Picked up draggable item "+a.id+"."},onDragOver(t){let{active:a,over:l}=t;return l?"Draggable item "+a.id+" was moved over droppable area "+l.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(t){let{active:a,over:l}=t;return l?"Draggable item "+a.id+" was dropped over droppable area "+l.id:"Draggable item "+a.id+" was dropped."},onDragCancel(t){let{active:a}=t;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function B2(t){let{announcements:a=U2,container:l,hiddenTextDescribedById:s,screenReaderInstructions:o=z2}=t;const{announce:u,announcement:f}=M2(),m=Xo("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),_2(v.useMemo(()=>({onDragStart(y){let{active:N}=y;u(a.onDragStart({active:N}))},onDragMove(y){let{active:N,over:w}=y;a.onDragMove&&u(a.onDragMove({active:N,over:w}))},onDragOver(y){let{active:N,over:w}=y;u(a.onDragOver({active:N,over:w}))},onDragEnd(y){let{active:N,over:w}=y;u(a.onDragEnd({active:N,over:w}))},onDragCancel(y){let{active:N,over:w}=y;u(a.onDragCancel({active:N,over:w}))}}),[u,a])),!p)return null;const x=un.createElement(un.Fragment,null,un.createElement(k2,{id:s,value:o.draggable}),un.createElement(O2,{id:m,announcement:f}));return l?rl.createPortal(x,l):x}var Un;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Un||(Un={}));function Bc(){}function H2(t,a){return v.useMemo(()=>({sensor:t,options:a??{}}),[t,a])}function $2(){for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];return v.useMemo(()=>[...a].filter(s=>s!=null),[...a])}const fr=Object.freeze({x:0,y:0});function q2(t,a){return Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))}function I2(t,a){const l=Uc(t);if(!l)return"0 0";const s={x:(l.x-a.left)/a.width*100,y:(l.y-a.top)/a.height*100};return s.x+"% "+s.y+"%"}function V2(t,a){let{data:{value:l}}=t,{data:{value:s}}=a;return l-s}function Y2(t,a){let{data:{value:l}}=t,{data:{value:s}}=a;return s-l}function F2(t,a){if(!t||t.length===0)return null;const[l]=t;return l[a]}function cx(t,a,l){return a===void 0&&(a=t.left),l===void 0&&(l=t.top),{x:a+t.width*.5,y:l+t.height*.5}}const P2=t=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=t;const o=cx(a,a.left,a.top),u=[];for(const f of s){const{id:m}=f,p=l.get(m);if(p){const g=q2(cx(p),o);u.push({id:m,data:{droppableContainer:f,value:g}})}}return u.sort(V2)};function G2(t,a){const l=Math.max(a.top,t.top),s=Math.max(a.left,t.left),o=Math.min(a.left+a.width,t.left+t.width),u=Math.min(a.top+a.height,t.top+t.height),f=o-s,m=u-l;if(s<o&&l<u){const p=a.width*a.height,g=t.width*t.height,x=f*m,y=x/(p+g-x);return Number(y.toFixed(4))}return 0}const X2=t=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=t;const o=[];for(const u of s){const{id:f}=u,m=l.get(f);if(m){const p=G2(m,a);p>0&&o.push({id:f,data:{droppableContainer:u,value:p}})}}return o.sort(Y2)};function Q2(t,a,l){return{...t,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function d0(t,a){return t&&a?{x:t.left-a.left,y:t.top-a.top}:fr}function K2(t){return function(l){for(var s=arguments.length,o=new Array(s>1?s-1:0),u=1;u<s;u++)o[u-1]=arguments[u];return o.reduce((f,m)=>({...f,top:f.top+t*m.y,bottom:f.bottom+t*m.y,left:f.left+t*m.x,right:f.right+t*m.x}),{...l})}}const Z2=K2(1);function f0(t){if(t.startsWith("matrix3d(")){const a=t.slice(9,-1).split(/, /);return{x:+a[12],y:+a[13],scaleX:+a[0],scaleY:+a[5]}}else if(t.startsWith("matrix(")){const a=t.slice(7,-1).split(/, /);return{x:+a[4],y:+a[5],scaleX:+a[0],scaleY:+a[3]}}return null}function J2(t,a,l){const s=f0(a);if(!s)return t;const{scaleX:o,scaleY:u,x:f,y:m}=s,p=t.left-f-(1-o)*parseFloat(l),g=t.top-m-(1-u)*parseFloat(l.slice(l.indexOf(" ")+1)),x=o?t.width/o:t.width,y=u?t.height/u:t.height;return{width:x,height:y,top:g,right:p+x,bottom:g+y,left:p}}const W2={ignoreTransform:!1};function yi(t,a){a===void 0&&(a=W2);let l=t.getBoundingClientRect();if(a.ignoreTransform){const{transform:g,transformOrigin:x}=pa(t).getComputedStyle(t);g&&(l=J2(l,g,x))}const{top:s,left:o,width:u,height:f,bottom:m,right:p}=l;return{top:s,left:o,width:u,height:f,bottom:m,right:p}}function dx(t){return yi(t,{ignoreTransform:!0})}function ej(t){const a=t.innerWidth,l=t.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function tj(t,a){return a===void 0&&(a=pa(t).getComputedStyle(t)),a.position==="fixed"}function nj(t,a){a===void 0&&(a=pa(t).getComputedStyle(t));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const u=a[o];return typeof u=="string"?l.test(u):!1})}function Tm(t,a){const l=[];function s(o){if(a!=null&&l.length>=a||!o)return l;if(jm(o)&&o.scrollingElement!=null&&!l.includes(o.scrollingElement))return l.push(o.scrollingElement),l;if(!Po(o)||o0(o)||l.includes(o))return l;const u=pa(t).getComputedStyle(o);return o!==t&&nj(o,u)&&l.push(o),tj(o,u)?l:s(o.parentNode)}return t?s(t):l}function h0(t){const[a]=Tm(t,1);return a??null}function Nh(t){return!td||!t?null:gi(t)?t:Rm(t)?jm(t)||t===vi(t).scrollingElement?window:Po(t)?t:null:null}function m0(t){return gi(t)?t.scrollX:t.scrollLeft}function p0(t){return gi(t)?t.scrollY:t.scrollTop}function Xh(t){return{x:m0(t),y:p0(t)}}var Vn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Vn||(Vn={}));function g0(t){return!td||!t?!1:t===document.scrollingElement}function v0(t){const a={x:0,y:0},l=g0(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},s={x:t.scrollWidth-l.width,y:t.scrollHeight-l.height},o=t.scrollTop<=a.y,u=t.scrollLeft<=a.x,f=t.scrollTop>=s.y,m=t.scrollLeft>=s.x;return{isTop:o,isLeft:u,isBottom:f,isRight:m,maxScroll:s,minScroll:a}}const aj={x:.2,y:.2};function rj(t,a,l,s,o){let{top:u,left:f,right:m,bottom:p}=l;s===void 0&&(s=10),o===void 0&&(o=aj);const{isTop:g,isBottom:x,isLeft:y,isRight:N}=v0(t),w={x:0,y:0},S={x:0,y:0},A={height:a.height*o.y,width:a.width*o.x};return!g&&u<=a.top+A.height?(w.y=Vn.Backward,S.y=s*Math.abs((a.top+A.height-u)/A.height)):!x&&p>=a.bottom-A.height&&(w.y=Vn.Forward,S.y=s*Math.abs((a.bottom-A.height-p)/A.height)),!N&&m>=a.right-A.width?(w.x=Vn.Forward,S.x=s*Math.abs((a.right-A.width-m)/A.width)):!y&&f<=a.left+A.width&&(w.x=Vn.Backward,S.x=s*Math.abs((a.left+A.width-f)/A.width)),{direction:w,speed:S}}function lj(t){if(t===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:a,left:l,right:s,bottom:o}=t.getBoundingClientRect();return{top:a,left:l,right:s,bottom:o,width:t.clientWidth,height:t.clientHeight}}function y0(t){return t.reduce((a,l)=>di(a,Xh(l)),fr)}function sj(t){return t.reduce((a,l)=>a+m0(l),0)}function ij(t){return t.reduce((a,l)=>a+p0(l),0)}function x0(t,a){if(a===void 0&&(a=yi),!t)return;const{top:l,left:s,bottom:o,right:u}=a(t);h0(t)&&(o<=0||u<=0||l>=window.innerHeight||s>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const oj=[["x",["left","right"],sj],["y",["top","bottom"],ij]];class Cm{constructor(a,l){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=Tm(l),o=y0(s);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,m]of oj)for(const p of f)Object.defineProperty(this,p,{get:()=>{const g=m(s),x=o[u]-g;return this.rect[p]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class jo{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...l)})},this.target=a}add(a,l,s){var o;(o=this.target)==null||o.addEventListener(a,l,s),this.listeners.push([a,l,s])}}function uj(t){const{EventTarget:a}=pa(t);return t instanceof a?t:vi(t)}function Rh(t,a){const l=Math.abs(t.x),s=Math.abs(t.y);return typeof a=="number"?Math.sqrt(l**2+s**2)>a:"x"in a&&"y"in a?l>a.x&&s>a.y:"x"in a?l>a.x:"y"in a?s>a.y:!1}var Za;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Za||(Za={}));function fx(t){t.preventDefault()}function cj(t){t.stopPropagation()}var Mt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Mt||(Mt={}));const b0={start:[Mt.Space,Mt.Enter],cancel:[Mt.Esc],end:[Mt.Space,Mt.Enter,Mt.Tab]},dj=(t,a)=>{let{currentCoordinates:l}=a;switch(t.code){case Mt.Right:return{...l,x:l.x+25};case Mt.Left:return{...l,x:l.x-25};case Mt.Down:return{...l,y:l.y+25};case Mt.Up:return{...l,y:l.y-25}}};class S0{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:l}}=a;this.props=a,this.listeners=new jo(vi(l)),this.windowListeners=new jo(pa(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Za.Resize,this.handleCancel),this.windowListeners.add(Za.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Za.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:l}=this.props,s=a.node.current;s&&x0(s),l(fr)}handleKeyDown(a){if(ad(a)){const{active:l,context:s,options:o}=this.props,{keyboardCodes:u=b0,coordinateGetter:f=dj,scrollBehavior:m="smooth"}=o,{code:p}=a;if(u.end.includes(p)){this.handleEnd(a);return}if(u.cancel.includes(p)){this.handleCancel(a);return}const{collisionRect:g}=s.current,x=g?{x:g.left,y:g.top}:fr;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:s.current,currentCoordinates:x});if(y){const N=zc(y,x),w={x:0,y:0},{scrollableAncestors:S}=s.current;for(const A of S){const R=a.code,{isTop:L,isRight:I,isLeft:q,isBottom:X,maxScroll:W,minScroll:ae}=v0(A),z=lj(A),T={x:Math.min(R===Mt.Right?z.right-z.width/2:z.right,Math.max(R===Mt.Right?z.left:z.left+z.width/2,y.x)),y:Math.min(R===Mt.Down?z.bottom-z.height/2:z.bottom,Math.max(R===Mt.Down?z.top:z.top+z.height/2,y.y))},ee=R===Mt.Right&&!I||R===Mt.Left&&!q,fe=R===Mt.Down&&!X||R===Mt.Up&&!L;if(ee&&T.x!==y.x){const be=A.scrollLeft+N.x,ye=R===Mt.Right&&be<=W.x||R===Mt.Left&&be>=ae.x;if(ye&&!N.y){A.scrollTo({left:be,behavior:m});return}ye?w.x=A.scrollLeft-be:w.x=R===Mt.Right?A.scrollLeft-W.x:A.scrollLeft-ae.x,w.x&&A.scrollBy({left:-w.x,behavior:m});break}else if(fe&&T.y!==y.y){const be=A.scrollTop+N.y,ye=R===Mt.Down&&be<=W.y||R===Mt.Up&&be>=ae.y;if(ye&&!N.x){A.scrollTo({top:be,behavior:m});return}ye?w.y=A.scrollTop-be:w.y=R===Mt.Down?A.scrollTop-W.y:A.scrollTop-ae.y,w.y&&A.scrollBy({top:-w.y,behavior:m});break}}this.handleMove(a,di(zc(y,this.referenceCoordinates),w))}}}handleMove(a,l){const{onMove:s}=this.props;a.preventDefault(),s(l)}handleEnd(a){const{onEnd:l}=this.props;a.preventDefault(),this.detach(),l()}handleCancel(a){const{onCancel:l}=this.props;a.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}S0.activators=[{eventName:"onKeyDown",handler:(t,a,l)=>{let{keyboardCodes:s=b0,onActivation:o}=a,{active:u}=l;const{code:f}=t.nativeEvent;if(s.start.includes(f)){const m=u.activatorNode.current;return m&&t.target!==m?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function hx(t){return!!(t&&"distance"in t)}function mx(t){return!!(t&&"delay"in t)}class Am{constructor(a,l,s){var o;s===void 0&&(s=uj(a.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=a,this.events=l;const{event:u}=a,{target:f}=u;this.props=a,this.events=l,this.document=vi(f),this.documentListeners=new jo(this.document),this.listeners=new jo(s),this.windowListeners=new jo(pa(f)),this.initialCoordinates=(o=Uc(u))!=null?o:fr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:a,props:{options:{activationConstraint:l,bypassActivationConstraint:s}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(Za.Resize,this.handleCancel),this.windowListeners.add(Za.DragStart,fx),this.windowListeners.add(Za.VisibilityChange,this.handleCancel),this.windowListeners.add(Za.ContextMenu,fx),this.documentListeners.add(Za.Keydown,this.handleKeydown),l){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(mx(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(hx(l)){this.handlePending(l);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(a,l){const{active:s,onPending:o}=this.props;o(s,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(Za.Click,cj,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Za.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:s,initialCoordinates:o,props:u}=this,{onMove:f,options:{activationConstraint:m}}=u;if(!o)return;const p=(l=Uc(a))!=null?l:fr,g=zc(o,p);if(!s&&m){if(hx(m)){if(m.tolerance!=null&&Rh(g,m.tolerance))return this.handleCancel();if(Rh(g,m.distance))return this.handleStart()}if(mx(m)&&Rh(g,m.tolerance))return this.handleCancel();this.handlePending(m,g);return}a.cancelable&&a.preventDefault(),f(p)}handleEnd(){const{onAbort:a,onEnd:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleCancel(){const{onAbort:a,onCancel:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleKeydown(a){a.code===Mt.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const fj={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dm extends Am{constructor(a){const{event:l}=a,s=vi(l.target);super(a,fj,s)}}Dm.activators=[{eventName:"onPointerDown",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:s}=a;return!l.isPrimary||l.button!==0?!1:(s==null||s({event:l}),!0)}}];const hj={move:{name:"mousemove"},end:{name:"mouseup"}};var Qh;(function(t){t[t.RightClick=2]="RightClick"})(Qh||(Qh={}));class mj extends Am{constructor(a){super(a,hj,vi(a.event.target))}}mj.activators=[{eventName:"onMouseDown",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:s}=a;return l.button===Qh.RightClick?!1:(s==null||s({event:l}),!0)}}];const jh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pj extends Am{constructor(a){super(a,jh)}static setup(){return window.addEventListener(jh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(jh.move.name,a)};function a(){}}}pj.activators=[{eventName:"onTouchStart",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:s}=a;const{touches:o}=l;return o.length>1?!1:(s==null||s({event:l}),!0)}}];var To;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(To||(To={}));var Hc;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Hc||(Hc={}));function gj(t){let{acceleration:a,activator:l=To.Pointer,canScroll:s,draggingRect:o,enabled:u,interval:f=5,order:m=Hc.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:y,threshold:N}=t;const w=yj({delta:y,disabled:!u}),[S,A]=j2(),R=v.useRef({x:0,y:0}),L=v.useRef({x:0,y:0}),I=v.useMemo(()=>{switch(l){case To.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case To.DraggableRect:return o}},[l,o,p]),q=v.useRef(null),X=v.useCallback(()=>{const ae=q.current;if(!ae)return;const z=R.current.x*L.current.x,T=R.current.y*L.current.y;ae.scrollBy(z,T)},[]),W=v.useMemo(()=>m===Hc.TreeOrder?[...g].reverse():g,[m,g]);v.useEffect(()=>{if(!u||!g.length||!I){A();return}for(const ae of W){if((s==null?void 0:s(ae))===!1)continue;const z=g.indexOf(ae),T=x[z];if(!T)continue;const{direction:ee,speed:fe}=rj(ae,T,I,a,N);for(const be of["x","y"])w[be][ee[be]]||(fe[be]=0,ee[be]=0);if(fe.x>0||fe.y>0){A(),q.current=ae,S(X,f),R.current=fe,L.current=ee;return}}R.current={x:0,y:0},L.current={x:0,y:0},A()},[a,X,s,A,u,f,JSON.stringify(I),JSON.stringify(w),S,g,W,x,JSON.stringify(N)])}const vj={x:{[Vn.Backward]:!1,[Vn.Forward]:!1},y:{[Vn.Backward]:!1,[Vn.Forward]:!1}};function yj(t){let{delta:a,disabled:l}=t;const s=Lc(a);return Go(o=>{if(l||!s||!o)return vj;const u={x:Math.sign(a.x-s.x),y:Math.sign(a.y-s.y)};return{x:{[Vn.Backward]:o.x[Vn.Backward]||u.x===-1,[Vn.Forward]:o.x[Vn.Forward]||u.x===1},y:{[Vn.Backward]:o.y[Vn.Backward]||u.y===-1,[Vn.Forward]:o.y[Vn.Forward]||u.y===1}}},[l,a,s])}function xj(t,a){const l=a!=null?t.get(a):void 0,s=l?l.node.current:null;return Go(o=>{var u;return a==null?null:(u=s??o)!=null?u:null},[s,a])}function bj(t,a){return v.useMemo(()=>t.reduce((l,s)=>{const{sensor:o}=s,u=o.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,s)}));return[...l,...u]},[]),[t,a])}var _o;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(_o||(_o={}));var Kh;(function(t){t.Optimized="optimized"})(Kh||(Kh={}));const px=new Map;function Sj(t,a){let{dragging:l,dependencies:s,config:o}=a;const[u,f]=v.useState(null),{frequency:m,measure:p,strategy:g}=o,x=v.useRef(t),y=R(),N=Mo(y),w=v.useCallback(function(L){L===void 0&&(L=[]),!N.current&&f(I=>I===null?L:I.concat(L.filter(q=>!I.includes(q))))},[N]),S=v.useRef(null),A=Go(L=>{if(y&&!l)return px;if(!L||L===px||x.current!==t||u!=null){const I=new Map;for(let q of t){if(!q)continue;if(u&&u.length>0&&!u.includes(q.id)&&q.rect.current){I.set(q.id,q.rect.current);continue}const X=q.node.current,W=X?new Cm(p(X),X):null;q.rect.current=W,W&&I.set(q.id,W)}return I}return L},[t,u,l,y,p]);return v.useEffect(()=>{x.current=t},[t]),v.useEffect(()=>{y||w()},[l,y]),v.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),v.useEffect(()=>{y||typeof m!="number"||S.current!==null||(S.current=setTimeout(()=>{w(),S.current=null},m))},[m,y,w,...s]),{droppableRects:A,measureDroppableContainers:w,measuringScheduled:u!=null};function R(){switch(g){case _o.Always:return!1;case _o.BeforeDragging:return l;default:return!l}}}function km(t,a){return Go(l=>t?l||(typeof a=="function"?a(t):t):null,[a,t])}function wj(t,a){return km(t,a)}function Ej(t){let{callback:a,disabled:l}=t;const s=nd(a),o=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(s)},[s,l]);return v.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function rd(t){let{callback:a,disabled:l}=t;const s=nd(a),o=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(s)},[l]);return v.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Nj(t){return new Cm(yi(t),t)}function gx(t,a,l){a===void 0&&(a=Nj);const[s,o]=v.useState(null);function u(){o(p=>{if(!t)return null;if(t.isConnected===!1){var g;return(g=p??l)!=null?g:null}const x=a(t);return JSON.stringify(p)===JSON.stringify(x)?p:x})}const f=Ej({callback(p){if(t)for(const g of p){const{type:x,target:y}=g;if(x==="childList"&&y instanceof HTMLElement&&y.contains(t)){u();break}}}}),m=rd({callback:u});return dr(()=>{u(),t?(m==null||m.observe(t),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(m==null||m.disconnect(),f==null||f.disconnect())},[t]),s}function Rj(t){const a=km(t);return d0(t,a)}const vx=[];function jj(t){const a=v.useRef(t),l=Go(s=>t?s&&s!==vx&&t&&a.current&&t.parentNode===a.current.parentNode?s:Tm(t):vx,[t]);return v.useEffect(()=>{a.current=t},[t]),l}function Tj(t){const[a,l]=v.useState(null),s=v.useRef(t),o=v.useCallback(u=>{const f=Nh(u.target);f&&l(m=>m?(m.set(f,Xh(f)),new Map(m)):null)},[]);return v.useEffect(()=>{const u=s.current;if(t!==u){f(u);const m=t.map(p=>{const g=Nh(p);return g?(g.addEventListener("scroll",o,{passive:!0}),[g,Xh(g)]):null}).filter(p=>p!=null);l(m.length?new Map(m):null),s.current=t}return()=>{f(t),f(u)};function f(m){m.forEach(p=>{const g=Nh(p);g==null||g.removeEventListener("scroll",o)})}},[o,t]),v.useMemo(()=>t.length?a?Array.from(a.values()).reduce((u,f)=>di(u,f),fr):y0(t):fr,[t,a])}function yx(t,a){a===void 0&&(a=[]);const l=v.useRef(null);return v.useEffect(()=>{l.current=null},a),v.useEffect(()=>{const s=t!==fr;s&&!l.current&&(l.current=t),!s&&l.current&&(l.current=null)},[t]),l.current?zc(t,l.current):fr}function Cj(t){v.useEffect(()=>{if(!td)return;const a=t.map(l=>{let{sensor:s}=l;return s.setup==null?void 0:s.setup()});return()=>{for(const l of a)l==null||l()}},t.map(a=>{let{sensor:l}=a;return l}))}function Aj(t,a){return v.useMemo(()=>t.reduce((l,s)=>{let{eventName:o,handler:u}=s;return l[o]=f=>{u(f,a)},l},{}),[t,a])}function w0(t){return v.useMemo(()=>t?ej(t):null,[t])}const xx=[];function Dj(t,a){a===void 0&&(a=yi);const[l]=t,s=w0(l?pa(l):null),[o,u]=v.useState(xx);function f(){u(()=>t.length?t.map(p=>g0(p)?s:new Cm(a(p),p)):xx)}const m=rd({callback:f});return dr(()=>{m==null||m.disconnect(),f(),t.forEach(p=>m==null?void 0:m.observe(p))},[t]),o}function E0(t){if(!t)return null;if(t.children.length>1)return t;const a=t.children[0];return Po(a)?a:t}function kj(t){let{measure:a}=t;const[l,s]=v.useState(null),o=v.useCallback(g=>{for(const{target:x}of g)if(Po(x)){s(y=>{const N=a(x);return y?{...y,width:N.width,height:N.height}:N});break}},[a]),u=rd({callback:o}),f=v.useCallback(g=>{const x=E0(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),s(x?a(x):null)},[a,u]),[m,p]=_c(f);return v.useMemo(()=>({nodeRef:m,rect:l,setRef:p}),[l,m,p])}const Oj=[{sensor:Dm,options:{}},{sensor:S0,options:{}}],Mj={current:{}},Nc={draggable:{measure:dx},droppable:{measure:dx,strategy:_o.WhileDragging,frequency:Kh.Optimized},dragOverlay:{measure:yi}};class Co extends Map{get(a){var l;return a!=null&&(l=super.get(a))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:l}=a;return!l})}getNodeFor(a){var l,s;return(l=(s=this.get(a))==null?void 0:s.node.current)!=null?l:void 0}}const _j={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Co,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Bc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Nc,measureDroppableContainers:Bc,windowRect:null,measuringScheduled:!1},N0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Bc,draggableNodes:new Map,over:null,measureDroppableContainers:Bc},Qo=v.createContext(N0),R0=v.createContext(_j);function Lj(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Co}}}function zj(t,a){switch(a.type){case Un.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case Un.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:a.coordinates.x-t.draggable.initialCoordinates.x,y:a.coordinates.y-t.draggable.initialCoordinates.y}}};case Un.DragEnd:case Un.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Un.RegisterDroppable:{const{element:l}=a,{id:s}=l,o=new Co(t.droppable.containers);return o.set(s,l),{...t,droppable:{...t.droppable,containers:o}}}case Un.SetDroppableDisabled:{const{id:l,key:s,disabled:o}=a,u=t.droppable.containers.get(l);if(!u||s!==u.key)return t;const f=new Co(t.droppable.containers);return f.set(l,{...u,disabled:o}),{...t,droppable:{...t.droppable,containers:f}}}case Un.UnregisterDroppable:{const{id:l,key:s}=a,o=t.droppable.containers.get(l);if(!o||s!==o.key)return t;const u=new Co(t.droppable.containers);return u.delete(l),{...t,droppable:{...t.droppable,containers:u}}}default:return t}}function Uj(t){let{disabled:a}=t;const{active:l,activatorEvent:s,draggableNodes:o}=v.useContext(Qo),u=Lc(s),f=Lc(l==null?void 0:l.id);return v.useEffect(()=>{if(!a&&!s&&u&&f!=null){if(!ad(u)||document.activeElement===u.target)return;const m=o.get(f);if(!m)return;const{activatorNode:p,node:g}=m;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[p.current,g.current]){if(!x)continue;const y=A2(x);if(y){y.focus();break}}})}},[s,a,o,f,u]),null}function j0(t,a){let{transform:l,...s}=a;return t!=null&&t.length?t.reduce((o,u)=>u({transform:o,...s}),l):l}function Bj(t){return v.useMemo(()=>({draggable:{...Nc.draggable,...t==null?void 0:t.draggable},droppable:{...Nc.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Nc.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function Hj(t){let{activeNode:a,measure:l,initialRect:s,config:o=!0}=t;const u=v.useRef(!1),{x:f,y:m}=typeof o=="boolean"?{x:o,y:o}:o;dr(()=>{if(!f&&!m||!a){u.current=!1;return}if(u.current||!s)return;const g=a==null?void 0:a.node.current;if(!g||g.isConnected===!1)return;const x=l(g),y=d0(x,s);if(f||(y.x=0),m||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const N=h0(g);N&&N.scrollBy({top:y.y,left:y.x})}},[a,f,m,s,l])}const ld=v.createContext({...fr,scaleX:1,scaleY:1});var _l;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(_l||(_l={}));const $j=v.memo(function(a){var l,s,o,u;let{id:f,accessibility:m,autoScroll:p=!0,children:g,sensors:x=Oj,collisionDetection:y=X2,measuring:N,modifiers:w,...S}=a;const A=v.useReducer(zj,void 0,Lj),[R,L]=A,[I,q]=L2(),[X,W]=v.useState(_l.Uninitialized),ae=X===_l.Initialized,{draggable:{active:z,nodes:T,translate:ee},droppable:{containers:fe}}=R,be=z!=null?T.get(z):null,ye=v.useRef({initial:null,translated:null}),te=v.useMemo(()=>{var yt;return z!=null?{id:z,data:(yt=be==null?void 0:be.data)!=null?yt:Mj,rect:ye}:null},[z,be]),re=v.useRef(null),[ge,U]=v.useState(null),[B,ue]=v.useState(null),de=Mo(S,Object.values(S)),we=Xo("DndDescribedBy",f),C=v.useMemo(()=>fe.getEnabled(),[fe]),V=Bj(N),{droppableRects:ne,measureDroppableContainers:me,measuringScheduled:Ne}=Sj(C,{dragging:ae,dependencies:[ee.x,ee.y],config:V.droppable}),je=xj(T,z),ze=v.useMemo(()=>B?Uc(B):null,[B]),ut=vt(),Ge=wj(je,V.draggable.measure);Hj({activeNode:z!=null?T.get(z):null,config:ut.layoutShiftCompensation,initialRect:Ge,measure:V.draggable.measure});const nt=gx(je,V.draggable.measure,Ge),Sn=gx(je?je.parentElement:null),Xt=v.useRef({activatorEvent:null,active:null,activeNode:je,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:fe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ft=fe.getNodeFor((l=Xt.current.over)==null?void 0:l.id),oe=kj({measure:V.dragOverlay.measure}),$e=(s=oe.nodeRef.current)!=null?s:je,at=ae?(o=oe.rect)!=null?o:nt:null,Ut=!!(oe.nodeRef.current&&oe.rect),pn=Rj(Ut?null:nt),jt=w0($e?pa($e):null),_t=jj(ae?ft??je:null),Qt=Dj(_t),Hn=j0(w,{transform:{x:ee.x-pn.x,y:ee.y-pn.y,scaleX:1,scaleY:1},activatorEvent:B,active:te,activeNodeRect:nt,containerNodeRect:Sn,draggingNodeRect:at,over:Xt.current.over,overlayNodeRect:oe.rect,scrollableAncestors:_t,scrollableAncestorRects:Qt,windowRect:jt}),$n=ze?di(ze,ee):null,tn=Tj(_t),da=yx(tn),fa=yx(tn,[nt]),Wn=di(Hn,da),qn=at?Z2(at,Hn):null,he=te&&qn?y({active:te,collisionRect:qn,droppableRects:ne,droppableContainers:C,pointerCoordinates:$n}):null,Ce=F2(he,"id"),[Ae,Pe]=v.useState(null),qe=Ut?Hn:di(Hn,fa),Z=Q2(qe,(u=Ae==null?void 0:Ae.rect)!=null?u:null,nt),Tt=v.useRef(null),Kt=v.useCallback((yt,St)=>{let{sensor:Bt,options:Ct}=St;if(re.current==null)return;const nn=T.get(re.current);if(!nn)return;const Zt=yt.nativeEvent,Ht=new Bt({active:re.current,activeNode:nn,event:Zt,options:Ct,context:Xt,onAbort(Je){if(!T.get(Je))return;const{onDragAbort:kn}=de.current,D={id:Je};kn==null||kn(D),I({type:"onDragAbort",event:D})},onPending(Je,wn,kn,D){if(!T.get(Je))return;const{onDragPending:$}=de.current,K={id:Je,constraint:wn,initialCoordinates:kn,offset:D};$==null||$(K),I({type:"onDragPending",event:K})},onStart(Je){const wn=re.current;if(wn==null)return;const kn=T.get(wn);if(!kn)return;const{onDragStart:D}=de.current,M={activatorEvent:Zt,active:{id:wn,data:kn.data,rect:ye}};rl.unstable_batchedUpdates(()=>{D==null||D(M),W(_l.Initializing),L({type:Un.DragStart,initialCoordinates:Je,active:wn}),I({type:"onDragStart",event:M}),U(Tt.current),ue(Zt)})},onMove(Je){L({type:Un.DragMove,coordinates:Je})},onEnd:ht(Un.DragEnd),onCancel:ht(Un.DragCancel)});Tt.current=Ht;function ht(Je){return async function(){const{active:kn,collisions:D,over:M,scrollAdjustedTranslate:$}=Xt.current;let K=null;if(kn&&$){const{cancelDrop:se}=de.current;K={activatorEvent:Zt,active:kn,collisions:D,delta:$,over:M},Je===Un.DragEnd&&typeof se=="function"&&await Promise.resolve(se(K))&&(Je=Un.DragCancel)}re.current=null,rl.unstable_batchedUpdates(()=>{L({type:Je}),W(_l.Uninitialized),Pe(null),U(null),ue(null),Tt.current=null;const se=Je===Un.DragEnd?"onDragEnd":"onDragCancel";if(K){const Te=de.current[se];Te==null||Te(K),I({type:se,event:K})}})}}},[T]),Yn=v.useCallback((yt,St)=>(Bt,Ct)=>{const nn=Bt.nativeEvent,Zt=T.get(Ct);if(re.current!==null||!Zt||nn.dndKit||nn.defaultPrevented)return;const Ht={active:Zt};yt(Bt,St.options,Ht)===!0&&(nn.dndKit={capturedBy:St.sensor},re.current=Ct,Kt(Bt,St))},[T,Kt]),gn=bj(x,Yn);Cj(x),dr(()=>{nt&&X===_l.Initializing&&W(_l.Initialized)},[nt,X]),v.useEffect(()=>{const{onDragMove:yt}=de.current,{active:St,activatorEvent:Bt,collisions:Ct,over:nn}=Xt.current;if(!St||!Bt)return;const Zt={active:St,activatorEvent:Bt,collisions:Ct,delta:{x:Wn.x,y:Wn.y},over:nn};rl.unstable_batchedUpdates(()=>{yt==null||yt(Zt),I({type:"onDragMove",event:Zt})})},[Wn.x,Wn.y]),v.useEffect(()=>{const{active:yt,activatorEvent:St,collisions:Bt,droppableContainers:Ct,scrollAdjustedTranslate:nn}=Xt.current;if(!yt||re.current==null||!St||!nn)return;const{onDragOver:Zt}=de.current,Ht=Ct.get(Ce),ht=Ht&&Ht.rect.current?{id:Ht.id,rect:Ht.rect.current,data:Ht.data,disabled:Ht.disabled}:null,Je={active:yt,activatorEvent:St,collisions:Bt,delta:{x:nn.x,y:nn.y},over:ht};rl.unstable_batchedUpdates(()=>{Pe(ht),Zt==null||Zt(Je),I({type:"onDragOver",event:Je})})},[Ce]),dr(()=>{Xt.current={activatorEvent:B,active:te,activeNode:je,collisionRect:qn,collisions:he,droppableRects:ne,draggableNodes:T,draggingNode:$e,draggingNodeRect:at,droppableContainers:fe,over:Ae,scrollableAncestors:_t,scrollAdjustedTranslate:Wn},ye.current={initial:at,translated:qn}},[te,je,he,qn,T,$e,at,ne,fe,Ae,_t,Wn]),gj({...ut,delta:ee,draggingRect:qn,pointerCoordinates:$n,scrollableAncestors:_t,scrollableAncestorRects:Qt});const Ba=v.useMemo(()=>({active:te,activeNode:je,activeNodeRect:nt,activatorEvent:B,collisions:he,containerNodeRect:Sn,dragOverlay:oe,draggableNodes:T,droppableContainers:fe,droppableRects:ne,over:Ae,measureDroppableContainers:me,scrollableAncestors:_t,scrollableAncestorRects:Qt,measuringConfiguration:V,measuringScheduled:Ne,windowRect:jt}),[te,je,nt,B,he,Sn,oe,T,fe,ne,Ae,me,_t,Qt,V,Ne,jt]),Me=v.useMemo(()=>({activatorEvent:B,activators:gn,active:te,activeNodeRect:nt,ariaDescribedById:{draggable:we},dispatch:L,draggableNodes:T,over:Ae,measureDroppableContainers:me}),[B,gn,te,nt,L,we,T,Ae,me]);return un.createElement(c0.Provider,{value:q},un.createElement(Qo.Provider,{value:Me},un.createElement(R0.Provider,{value:Ba},un.createElement(ld.Provider,{value:Z},g)),un.createElement(Uj,{disabled:(m==null?void 0:m.restoreFocus)===!1})),un.createElement(B2,{...m,hiddenTextDescribedById:we}));function vt(){const yt=(ge==null?void 0:ge.autoScrollEnabled)===!1,St=typeof p=="object"?p.enabled===!1:p===!1,Bt=ae&&!yt&&!St;return typeof p=="object"?{...p,enabled:Bt}:{enabled:Bt}}}),qj=v.createContext(null),bx="button",Ij="Draggable";function Vj(t){let{id:a,data:l,disabled:s=!1,attributes:o}=t;const u=Xo(Ij),{activators:f,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:y,over:N}=v.useContext(Qo),{role:w=bx,roleDescription:S="draggable",tabIndex:A=0}=o??{},R=(p==null?void 0:p.id)===a,L=v.useContext(R?ld:qj),[I,q]=_c(),[X,W]=_c(),ae=Aj(f,a),z=Mo(l);dr(()=>(y.set(a,{id:a,key:u,node:I,activatorNode:X,data:z}),()=>{const ee=y.get(a);ee&&ee.key===u&&y.delete(a)}),[y,a]);const T=v.useMemo(()=>({role:w,tabIndex:A,"aria-disabled":s,"aria-pressed":R&&w===bx?!0:void 0,"aria-roledescription":S,"aria-describedby":x.draggable}),[s,w,A,R,S,x.draggable]);return{active:p,activatorEvent:m,activeNodeRect:g,attributes:T,isDragging:R,listeners:s?void 0:ae,node:I,over:N,setNodeRef:q,setActivatorNodeRef:W,transform:L}}function T0(){return v.useContext(R0)}const Yj="Droppable",Fj={timeout:25};function Pj(t){let{data:a,disabled:l=!1,id:s,resizeObserverConfig:o}=t;const u=Xo(Yj),{active:f,dispatch:m,over:p,measureDroppableContainers:g}=v.useContext(Qo),x=v.useRef({disabled:l}),y=v.useRef(!1),N=v.useRef(null),w=v.useRef(null),{disabled:S,updateMeasurementsFor:A,timeout:R}={...Fj,...o},L=Mo(A??s),I=v.useCallback(()=>{if(!y.current){y.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{g(Array.isArray(L.current)?L.current:[L.current]),w.current=null},R)},[R]),q=rd({callback:I,disabled:S||!f}),X=v.useCallback((T,ee)=>{q&&(ee&&(q.unobserve(ee),y.current=!1),T&&q.observe(T))},[q]),[W,ae]=_c(X),z=Mo(a);return v.useEffect(()=>{!q||!W.current||(q.disconnect(),y.current=!1,q.observe(W.current))},[W,q]),v.useEffect(()=>(m({type:Un.RegisterDroppable,element:{id:s,key:u,disabled:l,node:W,rect:N,data:z}}),()=>m({type:Un.UnregisterDroppable,key:u,id:s})),[s]),v.useEffect(()=>{l!==x.current.disabled&&(m({type:Un.SetDroppableDisabled,id:s,key:u,disabled:l}),x.current.disabled=l)},[s,u,l,m]),{active:f,rect:N,isOver:(p==null?void 0:p.id)===s,node:W,over:p,setNodeRef:ae}}function Gj(t){let{animation:a,children:l}=t;const[s,o]=v.useState(null),[u,f]=v.useState(null),m=Lc(l);return!l&&!s&&m&&o(m),dr(()=>{if(!u)return;const p=s==null?void 0:s.key,g=s==null?void 0:s.props.id;if(p==null||g==null){o(null);return}Promise.resolve(a(g,u)).then(()=>{o(null)})},[a,s,u]),un.createElement(un.Fragment,null,l,s?v.cloneElement(s,{ref:f}):null)}const Xj={x:0,y:0,scaleX:1,scaleY:1};function Qj(t){let{children:a}=t;return un.createElement(Qo.Provider,{value:N0},un.createElement(ld.Provider,{value:Xj},a))}const Kj={position:"fixed",touchAction:"none"},Zj=t=>ad(t)?"transform 250ms ease":void 0,Jj=v.forwardRef((t,a)=>{let{as:l,activatorEvent:s,adjustScale:o,children:u,className:f,rect:m,style:p,transform:g,transition:x=Zj}=t;if(!m)return null;const y=o?g:{...g,scaleX:1,scaleY:1},N={...Kj,width:m.width,height:m.height,top:m.top,left:m.left,transform:Hl.Transform.toString(y),transformOrigin:o&&s?I2(s,m):void 0,transition:typeof x=="function"?x(s):x,...p};return un.createElement(l,{className:f,style:N,ref:a},u)}),Wj=t=>a=>{let{active:l,dragOverlay:s}=a;const o={},{styles:u,className:f}=t;if(u!=null&&u.active)for(const[m,p]of Object.entries(u.active))p!==void 0&&(o[m]=l.node.style.getPropertyValue(m),l.node.style.setProperty(m,p));if(u!=null&&u.dragOverlay)for(const[m,p]of Object.entries(u.dragOverlay))p!==void 0&&s.node.style.setProperty(m,p);return f!=null&&f.active&&l.node.classList.add(f.active),f!=null&&f.dragOverlay&&s.node.classList.add(f.dragOverlay),function(){for(const[p,g]of Object.entries(o))l.node.style.setProperty(p,g);f!=null&&f.active&&l.node.classList.remove(f.active)}},eT=t=>{let{transform:{initial:a,final:l}}=t;return[{transform:Hl.Transform.toString(a)},{transform:Hl.Transform.toString(l)}]},tT={duration:250,easing:"ease",keyframes:eT,sideEffects:Wj({styles:{active:{opacity:"0"}}})};function nT(t){let{config:a,draggableNodes:l,droppableContainers:s,measuringConfiguration:o}=t;return nd((u,f)=>{if(a===null)return;const m=l.get(u);if(!m)return;const p=m.node.current;if(!p)return;const g=E0(f);if(!g)return;const{transform:x}=pa(f).getComputedStyle(f),y=f0(x);if(!y)return;const N=typeof a=="function"?a:aT(a);return x0(p,o.draggable.measure),N({active:{id:u,data:m.data,node:p,rect:o.draggable.measure(p)},draggableNodes:l,dragOverlay:{node:f,rect:o.dragOverlay.measure(g)},droppableContainers:s,measuringConfiguration:o,transform:y})})}function aT(t){const{duration:a,easing:l,sideEffects:s,keyframes:o}={...tT,...t};return u=>{let{active:f,dragOverlay:m,transform:p,...g}=u;if(!a)return;const x={x:m.rect.left-f.rect.left,y:m.rect.top-f.rect.top},y={scaleX:p.scaleX!==1?f.rect.width*p.scaleX/m.rect.width:1,scaleY:p.scaleY!==1?f.rect.height*p.scaleY/m.rect.height:1},N={x:p.x-x.x,y:p.y-x.y,...y},w=o({...g,active:f,dragOverlay:m,transform:{initial:p,final:N}}),[S]=w,A=w[w.length-1];if(JSON.stringify(S)===JSON.stringify(A))return;const R=s==null?void 0:s({active:f,dragOverlay:m,...g}),L=m.node.animate(w,{duration:a,easing:l,fill:"forwards"});return new Promise(I=>{L.onfinish=()=>{R==null||R(),I()}})}}let Sx=0;function rT(t){return v.useMemo(()=>{if(t!=null)return Sx++,Sx},[t])}const lT=un.memo(t=>{let{adjustScale:a=!1,children:l,dropAnimation:s,style:o,transition:u,modifiers:f,wrapperElement:m="div",className:p,zIndex:g=999}=t;const{activatorEvent:x,active:y,activeNodeRect:N,containerNodeRect:w,draggableNodes:S,droppableContainers:A,dragOverlay:R,over:L,measuringConfiguration:I,scrollableAncestors:q,scrollableAncestorRects:X,windowRect:W}=T0(),ae=v.useContext(ld),z=rT(y==null?void 0:y.id),T=j0(f,{activatorEvent:x,active:y,activeNodeRect:N,containerNodeRect:w,draggingNodeRect:R.rect,over:L,overlayNodeRect:R.rect,scrollableAncestors:q,scrollableAncestorRects:X,transform:ae,windowRect:W}),ee=km(N),fe=nT({config:s,draggableNodes:S,droppableContainers:A,measuringConfiguration:I}),be=ee?R.setRef:void 0;return un.createElement(Qj,null,un.createElement(Gj,{animation:fe},y&&z?un.createElement(Jj,{key:z,id:y.id,ref:be,as:m,activatorEvent:x,adjustScale:a,className:p,transition:u,rect:ee,style:{zIndex:g,...o},transform:T},l):null))});function Ao(t,a,l){const s=t.slice();return s.splice(l<0?s.length+l:l,0,s.splice(a,1)[0]),s}function sT(t,a){return t.reduce((l,s,o)=>{const u=a.get(s);return u&&(l[o]=u),l},Array(t.length))}function fc(t){return t!==null&&t>=0}function iT(t,a){if(t===a)return!0;if(t.length!==a.length)return!1;for(let l=0;l<t.length;l++)if(t[l]!==a[l])return!1;return!0}function oT(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const C0=t=>{let{rects:a,activeIndex:l,overIndex:s,index:o}=t;const u=Ao(a,s,l),f=a[o],m=u[o];return!m||!f?null:{x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height}},hc={scaleX:1,scaleY:1},Om=t=>{var a;let{activeIndex:l,activeNodeRect:s,index:o,rects:u,overIndex:f}=t;const m=(a=u[l])!=null?a:s;if(!m)return null;if(o===l){const g=u[f];return g?{x:0,y:l<f?g.top+g.height-(m.top+m.height):g.top-m.top,...hc}:null}const p=uT(u,o,l);return o>l&&o<=f?{x:0,y:-m.height-p,...hc}:o<l&&o>=f?{x:0,y:m.height+p,...hc}:{x:0,y:0,...hc}};function uT(t,a,l){const s=t[a],o=t[a-1],u=t[a+1];return s?l<a?o?s.top-(o.top+o.height):u?u.top-(s.top+s.height):0:u?u.top-(s.top+s.height):o?s.top-(o.top+o.height):0:0}const A0="Sortable",D0=un.createContext({activeIndex:-1,containerId:A0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:C0,disabled:{draggable:!1,droppable:!1}});function Mm(t){let{children:a,id:l,items:s,strategy:o=C0,disabled:u=!1}=t;const{active:f,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=T0(),y=Xo(A0,l),N=m.rect!==null,w=v.useMemo(()=>s.map(ae=>typeof ae=="object"&&"id"in ae?ae.id:ae),[s]),S=f!=null,A=f?w.indexOf(f.id):-1,R=g?w.indexOf(g.id):-1,L=v.useRef(w),I=!iT(w,L.current),q=R!==-1&&A===-1||I,X=oT(u);dr(()=>{I&&S&&x(w)},[I,w,S,x]),v.useEffect(()=>{L.current=w},[w]);const W=v.useMemo(()=>({activeIndex:A,containerId:y,disabled:X,disableTransforms:q,items:w,overIndex:R,useDragOverlay:N,sortedRects:sT(w,p),strategy:o}),[A,y,X.draggable,X.droppable,q,w,R,p,N,o]);return un.createElement(D0.Provider,{value:W},a)}const cT=t=>{let{id:a,items:l,activeIndex:s,overIndex:o}=t;return Ao(l,s,o).indexOf(a)},dT=t=>{let{containerId:a,isSorting:l,wasDragging:s,index:o,items:u,newIndex:f,previousItems:m,previousContainerId:p,transition:g}=t;return!g||!s||m!==u&&o===f?!1:l?!0:f!==o&&a===p},fT={duration:200,easing:"ease"},k0="transform",hT=Hl.Transition.toString({property:k0,duration:0,easing:"linear"}),mT={roleDescription:"sortable"};function pT(t){let{disabled:a,index:l,node:s,rect:o}=t;const[u,f]=v.useState(null),m=v.useRef(l);return dr(()=>{if(!a&&l!==m.current&&s.current){const p=o.current;if(p){const g=yi(s.current,{ignoreTransform:!0}),x={x:p.left-g.left,y:p.top-g.top,scaleX:p.width/g.width,scaleY:p.height/g.height};(x.x||x.y)&&f(x)}}l!==m.current&&(m.current=l)},[a,l,s,o]),v.useEffect(()=>{u&&f(null)},[u]),u}function gT(t){let{animateLayoutChanges:a=dT,attributes:l,disabled:s,data:o,getNewIndex:u=cT,id:f,strategy:m,resizeObserverConfig:p,transition:g=fT}=t;const{items:x,containerId:y,activeIndex:N,disabled:w,disableTransforms:S,sortedRects:A,overIndex:R,useDragOverlay:L,strategy:I}=v.useContext(D0),q=vT(s,w),X=x.indexOf(f),W=v.useMemo(()=>({sortable:{containerId:y,index:X,items:x},...o}),[y,o,X,x]),ae=v.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:z,node:T,isOver:ee,setNodeRef:fe}=Pj({id:f,data:W,disabled:q.droppable,resizeObserverConfig:{updateMeasurementsFor:ae,...p}}),{active:be,activatorEvent:ye,activeNodeRect:te,attributes:re,setNodeRef:ge,listeners:U,isDragging:B,over:ue,setActivatorNodeRef:de,transform:we}=Vj({id:f,data:W,attributes:{...mT,...l},disabled:q.draggable}),C=R2(fe,ge),V=!!be,ne=V&&!S&&fc(N)&&fc(R),me=!L&&B,Ne=me&&ne?we:null,ze=ne?Ne??(m??I)({rects:A,activeNodeRect:te,activeIndex:N,overIndex:R,index:X}):null,ut=fc(N)&&fc(R)?u({id:f,items:x,activeIndex:N,overIndex:R}):X,Ge=be==null?void 0:be.id,nt=v.useRef({activeId:Ge,items:x,newIndex:ut,containerId:y}),Sn=x!==nt.current.items,Xt=a({active:be,containerId:y,isDragging:B,isSorting:V,id:f,index:X,items:x,newIndex:nt.current.newIndex,previousItems:nt.current.items,previousContainerId:nt.current.containerId,transition:g,wasDragging:nt.current.activeId!=null}),ft=pT({disabled:!Xt,index:X,node:T,rect:z});return v.useEffect(()=>{V&&nt.current.newIndex!==ut&&(nt.current.newIndex=ut),y!==nt.current.containerId&&(nt.current.containerId=y),x!==nt.current.items&&(nt.current.items=x)},[V,ut,y,x]),v.useEffect(()=>{if(Ge===nt.current.activeId)return;if(Ge!=null&&nt.current.activeId==null){nt.current.activeId=Ge;return}const $e=setTimeout(()=>{nt.current.activeId=Ge},50);return()=>clearTimeout($e)},[Ge]),{active:be,activeIndex:N,attributes:re,data:W,rect:z,index:X,newIndex:ut,items:x,isOver:ee,isSorting:V,isDragging:B,listeners:U,node:T,overIndex:R,over:ue,setNodeRef:C,setActivatorNodeRef:de,setDroppableNodeRef:fe,setDraggableNodeRef:ge,transform:ft??ze,transition:oe()};function oe(){if(ft||Sn&&nt.current.newIndex===X)return hT;if(!(me&&!ad(ye)||!g)&&(V||Xt))return Hl.Transition.toString({...g,property:k0})}}function vT(t,a){var l,s;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(l=t==null?void 0:t.draggable)!=null?l:a.draggable,droppable:(s=t==null?void 0:t.droppable)!=null?s:a.droppable}}Mt.Down,Mt.Right,Mt.Up,Mt.Left;const yT=[{value:"priority",label:"Priority"},{value:"number",label:"Number"},{value:"createdAt",label:"Created date"},{value:"updatedAt",label:"Updated date"},{value:"title",label:"Title"},{value:"shortId",label:"Short ID"},{value:"status",label:"Status"},{value:"startedAt",label:"Started"},{value:"completedAt",label:"Completed"}];function _m({sort:t,onChange:a,label:l="Sort by"}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("label",{htmlFor:"sort-control",className:"hidden text-xs text-[var(--text-muted)] sm:inline",children:l}),c.jsxs("div",{className:"inline-flex h-9 items-center gap-1 rounded-lg border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1 shadow-sm",children:[c.jsxs("div",{className:"relative",children:[c.jsx("select",{id:"sort-control",value:t.key,onChange:s=>a({key:s.target.value,direction:t.direction}),className:"h-7 w-full min-w-[7.5rem] cursor-pointer appearance-none border-0 bg-transparent pr-6 pl-1 text-xs font-medium text-[var(--text)] outline-none hover:text-[var(--accent)] sm:w-auto",children:yT.map(s=>c.jsx("option",{value:s.value,children:s.label},s.value))}),c.jsx(xs,{className:"pointer-events-none absolute right-0 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]","aria-hidden":"true"})]}),c.jsx("button",{type:"button",onClick:()=>a({key:t.key,direction:t.direction==="asc"?"desc":"asc"}),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[var(--text-muted)] transition hover:bg-[var(--surface-strong)] hover:text-[var(--text)]","aria-label":`Sort direction: ${t.direction}`,title:`Sort direction: ${t.direction}`,children:t.direction==="asc"?c.jsx(pN,{className:"h-3.5 w-3.5","aria-hidden":"true"}):c.jsx(fN,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})}const sd=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],id=[{value:"draft",label:"Draft"},{value:"discovery",label:"Discovery"},{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],Ko=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],O0=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],po=sd.map(t=>t.value),go=id.map(t=>t.value),vo=Ko.map(t=>t.value);function Th(t,a,l){if(t.includes(a)){const s=t.filter(o=>o!==a);return s.length===0?[...l]:s}return[...t,a]}function ei(t,a){return a.includes(t)}function ir(t,a){return`agent-plan:dashboard:${t}:${a}`}function Ch(t,a,l){if(typeof window>"u")return a;try{const s=window.localStorage.getItem(t);if(!s)return a;const o=JSON.parse(s);if(!Array.isArray(o))return a;const u=`${t}-schema`,f=l.slice().sort().join(",");if(window.localStorage.getItem(u)!==f)return window.localStorage.setItem(u,f),a;const p=o.filter(g=>typeof g=="string"&&l.includes(g));return p.length>0?p:a}catch{return a}}function Ah(t,a,l){typeof window>"u"||(window.localStorage.setItem(t,JSON.stringify(a)),window.localStorage.setItem(`${t}-schema`,l.slice().sort().join(",")))}function Dh(t,a){if(typeof window>"u")return a;const l=window.localStorage.getItem(t);return l===null?a:l==="true"}const wx={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},Ex=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function M0(t){return t.split(",").map(a=>a.trim()).filter(a=>a.length>0)}function xT(t){return new Set(M0(t).map(a=>Number(a)).filter(a=>Number.isFinite(a)&&a>0))}function Nx(t){const a=t.toUpperCase();return a==="AND"||a==="OR"}function kh(t,a){const l=t??new Set;for(const s of xT(a))l.add(s);return l}function bT(t,a){const l=t??new Set;for(const s of M0(a).map(o=>o.toUpperCase()))l.add(s);return l}function ST(t){const a=t.trim();if(!a)return{...wx};const l={...wx},s=[],o=[];let u=0;for(;u<a.length;){const m=a[u];if(m==='"'){const p=a.indexOf('"',u+1);if(p===-1){o.push(a.slice(u+1));break}o.push(a.slice(u+1,p)),u=p+1}else if(m===" ")u+=1;else{let p=u;for(;p<a.length&&a[p]!==" ";)p+=1;o.push(a.slice(u,p)),u=p}}let f=0;for(;f<o.length;){const m=o[f];if(Nx(m)){f+=1;continue}const p=m.match(Ex);if(p){const g=(p[1]??"").toLowerCase();let x=p[2]??"";if(x.trim()===""&&f+1<o.length){let y=f+1;for(;y<o.length&&Nx(o[y]);)y+=1;y<o.length&&!o[y].match(Ex)&&(x=o[y],f=y)}if(g==="feature"){const y=kh(l.featureNumbers,x);y.size&&(l.featureNumbers=y)}else if(g==="phase"){const y=kh(l.phaseNumbers,x);y.size&&(l.phaseNumbers=y)}else if(g==="task"){const y=kh(l.taskNumbers,x);y.size&&(l.taskNumbers=y)}else if(g==="id"){const y=bT(l.shortIds,x);y.size&&(l.shortIds=y)}else g==="status"?x.trim()&&(l.status=x.toLowerCase()):g==="feature-status"?x.trim()&&(l.featureStatus=x.toLowerCase()):g==="phase-status"?x.trim()&&(l.phaseStatus=x.toLowerCase()):g==="title"&&x.trim()&&(l.text=x.toLowerCase())}else s.push(m.toLowerCase());f+=1}return s.length>0&&!l.text&&(l.text=s.join(" ")),l}function wT(t){return!!(t.featureNumbers||t.phaseNumbers||t.taskNumbers||t.shortIds||t.status||t.featureStatus||t.phaseStatus||t.text)}function _0(t){const a=l=>String(l).padStart(3,"0");return[t.task.title,t.task.shortName??"",t.task.shortId??"",String(t.task.number),`T${a(t.task.number)}`,t.task.description??"",t.task.notes??"",t.phase.title,t.phase.slug??"",t.phase.shortId??"",String(t.phase.number),`P${a(t.phase.number)}`,t.phase.description??"",t.phase.summary??"",t.phase.notes??"",t.feature.name,t.feature.shortId??"",String(t.feature.number),`F${a(t.feature.number)}`,t.feature.description??""].join(" ").toLowerCase()}function ET(t,a,l){if(t.featureNumbers&&!t.featureNumbers.has(a.feature.number)||t.phaseNumbers&&!t.phaseNumbers.has(a.phase.number)||t.taskNumbers&&!t.taskNumbers.has(a.task.number)||t.shortIds&&!(t.shortIds.has(a.task.shortId??"")||t.shortIds.has(a.phase.shortId??"")||t.shortIds.has(a.feature.shortId??""))||t.status&&a.task.status!==t.status||t.featureStatus&&a.feature.status!==t.featureStatus||t.phaseStatus&&a.phase.status!==t.phaseStatus)return!1;if(t.text){const s=t.text;if(!(l??_0(a)).includes(s))return!1}return!0}function NT({features:t,phases:a,projectStorageScope:l}){const s=ir(l,"show-all-features"),o=ir(l,"tree-open-mode"),u=ir(l,"expanded-features"),f=ir(l,"expanded-phases"),m=ir(l,"feature-status-filters"),p=ir(l,"phase-status-filters"),g=ir(l,"task-status-filters"),x=ir(l,"hide-done"),y=ir(l,"hide-planned"),N=ir(l,"only-active-branches"),w=ir(l,"work-tree-sort"),[S,A]=v.useState(""),[R,L]=v.useState(()=>{if(typeof window>"u")return Eo;try{const he=window.localStorage.getItem(w);if(!he)return Eo;const Ce=JSON.parse(he);if(Ce.key&&Ce.direction)return{key:Ce.key,direction:Ce.direction}}catch{}return Eo}),I=v.useMemo(()=>E2(t,a,R),[t,a,R]),q=v.useMemo(()=>ST(S),[S]),X=wT(q),W=v.useMemo(()=>{if(!X||!q.text)return null;const he=new Map;for(const Ce of I)for(const Ae of Ce.allPhases)for(const Pe of Ae.allTasks)he.set(Pe.id,_0({feature:Ce.feature,phase:Ae.phase,task:Pe}));return he},[X,q.text,I]),{matchedTaskIds:ae,matchedFeatureIds:z,matchedPhaseIds:T}=v.useMemo(()=>{const he=new Set,Ce=new Set,Ae=new Set;if(!X)return{matchedTaskIds:he,matchedFeatureIds:Ce,matchedPhaseIds:Ae};for(const Pe of I)for(const qe of Pe.allPhases)for(const Z of qe.allTasks)ET(q,{feature:Pe.feature,phase:qe.phase,task:Z},W==null?void 0:W.get(Z.id))&&(he.add(Z.id),Ce.add(Pe.feature.id),Ae.add(qe.phase.id));return{matchedTaskIds:he,matchedFeatureIds:Ce,matchedPhaseIds:Ae}},[X,q,I,W]),[ee,fe]=v.useState(()=>{if(typeof window>"u")return!0;const he=window.localStorage.getItem(s);return he===null?!0:he==="true"}),[be,ye]=v.useState(()=>{if(typeof window>"u")return"all";const he=window.localStorage.getItem(o);return he==="smart"||he==="none"||he==="all"?he:"all"}),[te,re]=v.useState(()=>{if(typeof window>"u")return[];try{const he=window.localStorage.getItem(u);return he?JSON.parse(he):[]}catch{return[]}}),[ge,U]=v.useState(()=>{if(typeof window>"u")return[];try{const he=window.localStorage.getItem(f);return he?JSON.parse(he):[]}catch{return[]}}),[B,ue]=v.useState(()=>Ch(m,po,po)),[de,we]=v.useState(()=>Ch(p,go,go)),[C,V]=v.useState(()=>Ch(g,vo,vo)),[ne,me]=v.useState(()=>Dh(x,!1)),[Ne,je]=v.useState(()=>Dh(y,!1)),[ze,ut]=v.useState(()=>Dh(N,!1)),[Ge,nt]=v.useState([]),[Sn,Xt]=v.useState([]),[ft,oe]=v.useState([]),$e=v.useRef({});v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(s,String(ee))},[ee,s]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(o,be)},[be,o]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(u,JSON.stringify(te))},[te,u]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(f,JSON.stringify(ge))},[ge,f]),v.useEffect(()=>{typeof window>"u"||Ah(m,B,po)},[B,m]),v.useEffect(()=>{typeof window>"u"||Ah(p,de,go)},[de,p]),v.useEffect(()=>{typeof window>"u"||Ah(g,C,vo)},[C,g]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(x,String(ne))},[ne,x]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(y,String(Ne))},[Ne,y]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(N,String(ze))},[ze,N]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(w,JSON.stringify(R))},[R,w]),v.useEffect(()=>()=>{Object.values($e.current).forEach(he=>window.clearTimeout(he)),$e.current={}},[]);const at=v.useMemo(()=>{let he=[...B];return ne&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned")),he},[B,ne,Ne]),Ut=v.useMemo(()=>{let he=[...de];return ne&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned"&&Ce!=="draft")),he},[de,ne,Ne]),pn=v.useMemo(()=>{let he=[...C];return ne&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned")),he},[C,ne,Ne]),jt=v.useMemo(()=>{if(X)return I.filter(Ae=>ei(Ae.feature.status,at)).map(Ae=>({...Ae,allPhases:Ae.allPhases.filter(Pe=>ei(Pe.phase.status,Ut)).map(Pe=>({...Pe,allTasks:Pe.allTasks.filter(qe=>ae.has(qe.id)&&ei(qe.status,pn))})).filter(Pe=>Pe.allTasks.length>0)})).filter(Ae=>Ae.allPhases.length>0);const he=!ee||ze;return(ee?I:I.filter(Ae=>Ae.isActive)).filter(({feature:Ae})=>ei(Ae.status,at)).map(Ae=>({...Ae,allPhases:Ae.allPhases.filter(({phase:Pe,hasActiveTask:qe})=>ei(Pe.status,Ut)?he?Pe.status==="in-progress"||Pe.status==="discovery"||qe:!0:!1).map(Pe=>({...Pe,allTasks:Pe.allTasks.filter(qe=>!!ei(qe.status,pn))})).filter(Pe=>Pe.allTasks.length>0||ee||!he)})).filter(({hasActiveTask:Ae,allPhases:Pe})=>he?Ae||Pe.some(qe=>qe.hasActiveTask):Pe.length>0||ee)},[X,ae,I,at,Ut,pn,ze,ee]);v.useEffect(()=>{if(be==="none"){re([]),U([]);return}if(be==="all"){re(jt.filter(({feature:Ae})=>Ae.status!=="done").map(({feature:Ae})=>Ae.id)),U(jt.flatMap(({allPhases:Ae})=>Ae.map(({phase:Pe})=>Pe.id)));return}const he=new Set(jt.map(({feature:Ae})=>Ae.id)),Ce=new Set(jt.flatMap(({allPhases:Ae})=>Ae.map(({phase:Pe})=>Pe.id)));re(Ae=>Ae.filter(Pe=>he.has(Pe))),U(Ae=>Ae.filter(Pe=>Ce.has(Pe)))},[jt,be]),v.useEffect(()=>{X&&(ye("smart"),re(Array.from(z)),U(Array.from(T)))},[X,z,T]);const _t=he=>{ye("smart"),re(Ce=>Ce.includes(he)?Ce.filter(Ae=>Ae!==he):[...Ce,he])},Qt=he=>{ye("smart"),U(Ce=>Ce.includes(he)?Ce.filter(Ae=>Ae!==he):[...Ce,he])},Hn=()=>{ye("smart"),re(jt.map(({feature:he})=>he.id)),U(jt.flatMap(({allPhases:he})=>he.map(({phase:Ce})=>Ce.id)))},$n=()=>{ye("smart"),re([]),U([])},tn=v.useMemo(()=>{const he=new Set(jt.map(({feature:qe})=>qe.id)),Ce=new Set(jt.flatMap(({allPhases:qe})=>qe.map(({phase:Z})=>Z.id)));if(he.size===0)return!1;const Ae=Array.from(he).every(qe=>te.includes(qe)),Pe=Array.from(Ce).every(qe=>ge.includes(qe));return Ae&&Pe},[jt,te,ge]);return v.useEffect(()=>{const he=(Ae,Pe)=>{const qe=Pe.filter(Z=>!!Z);for(const Z of qe){const Tt=`${Ae}:${Z}`,Kt=Ae==="feature"?nt:Ae==="phase"?Xt:oe;Kt(Yn=>Yn.includes(Z)?Yn:[...Yn,Z]),$e.current[Tt]!==void 0&&window.clearTimeout($e.current[Tt]),$e.current[Tt]=window.setTimeout(()=>{Kt(Yn=>Yn.filter(gn=>gn!==Z)),delete $e.current[Tt]},y2)}},Ce=Ae=>{var Z,Tt,Kt,Yn,gn,Ba;const qe=Ae.detail;if(qe!=null&&qe.type){if(qe.type==="features-updated"){const Me=((Z=qe.data)==null?void 0:Z.featureId)??((Tt=qe.data)==null?void 0:Tt.id);he("feature",[Me]),Me&&(ye("smart"),re(vt=>vt.includes(Me)?vt:[...vt,Me]));return}if(qe.type==="phases-updated"){const Me=(Kt=qe.data)==null?void 0:Kt.featureId,vt=((Yn=qe.data)==null?void 0:Yn.phaseId)??((gn=qe.data)==null?void 0:gn.id);he("phase",[vt]),he("feature",[Me]),he("task",[(Ba=qe.data)==null?void 0:Ba.taskId]),ye("smart"),Me&&re(yt=>yt.includes(Me)?yt:[...yt,Me]),vt&&U(yt=>yt.includes(vt)?yt:[...yt,vt])}}};return window.addEventListener("agent-plan:ws-event",Ce),()=>{window.removeEventListener("agent-plan:ws-event",Ce)}},[]),{workTree:I,displayedWorkTree:jt,treeOpenMode:be,setTreeOpenMode:ye,expandAll:Hn,collapseAll:$n,isAllExpanded:tn,expandedFeatureIds:te,expandedPhaseIds:ge,setExpandedFeatureIds:re,setExpandedPhaseIds:U,toggleExpandedFeature:_t,toggleExpandedPhase:Qt,recentFeatureIds:Ge,recentPhaseIds:Sn,recentTaskIds:ft,setRecentTaskIds:oe,showAllFeatures:ee,setShowAllFeatures:fe,featureStatusFilters:B,phaseStatusFilters:de,taskStatusFilters:C,hideDone:ne,setHideDone:me,hidePlanned:Ne,setHidePlanned:je,onlyActiveBranches:ze,setOnlyActiveBranches:ut,resetFilters:()=>{A(""),fe(!0),me(!1),je(!1),ue(po),we(go),V(vo),ut(!1),L(Eo),ye("all")},toggleFeatureStatusFilter:he=>ue(Ce=>Th(Ce,he,po)),togglePhaseStatusFilter:he=>we(Ce=>Th(Ce,he,go)),toggleTaskStatusFilter:he=>V(Ce=>Th(Ce,he,vo)),searchQuery:S,setSearchQuery:A,searchActive:X,matchedTaskIds:ae,matchedFeatureIds:z,matchedPhaseIds:T,sort:R,setSort:L}}function xi({id:t,status:a,variant:l="header",className:s,children:o,ariaLabel:u}){const f=l==="surface"?l2(a):s2(a),m=wm(a),p=["status-item",l==="surface"?"status-item--surface":"status-item--header",m,s??""].filter(Boolean).join(" ");return c.jsx("div",{id:t,className:p,style:f,"aria-label":u,"data-status":a,children:o})}function Bl(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function sl({value:t,className:a=""}){if(!t)return null;const l=`Last updated ${Bl(t)}`;return c.jsx("time",{dateTime:t,title:l,"aria-label":l,className:`text-[11px] text-[var(--text-subtle)] ${a}`.trim(),children:l})}const L0=v.createContext(null);function Lm({id:t,children:a}){const l=gT({id:t}),s={transform:Hl.Transform.toString(l.transform),transition:l.transition};return c.jsx(L0.Provider,{value:l,children:c.jsx("div",{ref:l.setNodeRef,style:s,className:l.isDragging?"ap-sortable--dragging":"",children:a})})}function zm(){const t=v.useContext(L0);return t?c.jsx("button",{type:"button",className:"drag-handle","aria-label":"Drag to reorder",title:"Drag to reorder",...t.listeners,...t.attributes,children:c.jsx(IN,{className:"h-4 w-4"})}):null}function z0({phaseId:t,phaseTitle:a,count:l,className:s=""}){if(l<1)return null;const o=`${l} linked requirement${l===1?"":"s"} for phase ${a}`;return c.jsxs(Ye,{to:`/requirements#phase-${t}`,"aria-label":o,title:o,className:`inline-flex min-h-7 items-center gap-1 rounded-md border border-[var(--border)] bg-[var(--surface-elevated)] px-1.5 text-xs font-semibold text-[var(--text-muted)] transition hover:border-[var(--accent)] hover:text-[var(--accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] ${s}`,children:[c.jsx(Vo,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{"aria-hidden":"true",children:l})]})}const Um="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function RT(){return c.jsx("span",{className:"rounded-full bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Updated"})}function Rx({status:t,doneTasks:a,totalTasks:l,recentlyChanged:s,className:o}){const u=a!=null&&l!=null;return c.jsxs("div",{className:o,children:[s?c.jsx(RT,{}):null,u?c.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",a,"/",l||0,")"]}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(ur,{status:t})})]})}function jT({entry:t,expanded:a,recentlyChanged:l,onToggle:s,isPhaseExpanded:o,onTogglePhase:u,isPhaseRecentlyChanged:f,isTaskRecentlyChanged:m,highlightedTaskIds:p}){const{feature:g,totalTasks:x,doneTasks:y,allPhases:N,hasActiveTask:w}=t;return c.jsxs("div",{className:`surface-card min-w-0 rounded-[10px] px-3 py-3 transition-colors sm:px-4 ${l?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[c.jsxs(xi,{status:t.display.displayStatus,variant:"header",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${l?"bg-[color:color-mix(in_srgb,var(--accent)_10%,transparent)]":""}`,children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[c.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),s()},onPointerDown:S=>S.stopPropagation(),className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":a?`Collapse feature ${g.name}`:`Expand feature ${g.name}`,"aria-expanded":a,children:c.jsx(Lb,{className:`h-4 w-4 transition ${a?"rotate-90":"rotate-0"}`})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(zm,{}),c.jsx(cr,{featureNum:g.number,featureId:g.id}),c.jsx(mr,{id:$l({featureNum:g.number}),children:c.jsx("span",{className:"sr-only",children:"Copy feature path"})}),g.shortId?c.jsx(ql,{shortId:g.shortId}):null,w?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Mc,{status:t.display.displayStatus,breakdown:t.display.breakdown,doneTasks:y,totalTasks:x,recentlyChanged:l,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Ye,{to:`/features/${g.id}`,className:`entity-link--feature ${Um} underline-offset-4 hover:underline`,children:g.name}),c.jsx(sl,{value:g.updatedAt,className:"mt-1 block"})]})]}),c.jsx(Mc,{status:t.display.displayStatus,breakdown:t.display.breakdown,doneTasks:y,totalTasks:x,recentlyChanged:l,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),a&&N.length>0?c.jsx("div",{className:"mt-2 ml-1.5 grid grid-cols-1 gap-2 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:t0(t.display.displayStatus)},children:c.jsx(Mm,{items:N.map(S=>S.phase.id),strategy:Om,children:N.map(S=>c.jsx(Lm,{id:S.phase.id,children:c.jsx(TT,{feature:g,phaseEntry:S,expanded:o(S.phase.id),recentlyChanged:f(S.phase.id),onToggle:()=>u(S.phase.id),isTaskRecentlyChanged:m,highlightedTaskIds:p})},S.phase.id))})}):null]})}function TT({feature:t,phaseEntry:a,expanded:l,recentlyChanged:s,onToggle:o,isTaskRecentlyChanged:u,highlightedTaskIds:f}){var N;const{phase:m,totalTasks:p,doneTasks:g,allTasks:x,hasActiveTask:y}=a;return c.jsxs("div",{className:`work-tree-row grid min-w-0 grid-cols-1 gap-2 rounded-[10px] p-3 transition-colors ${s?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[c.jsxs(xi,{status:a.display.displayStatus,variant:"header",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${s?"bg-[color:color-mix(in_srgb,var(--accent)_8%,transparent)]":""}`,children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[c.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),o()},onPointerDown:w=>w.stopPropagation(),className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":l?`Collapse phase ${m.title}`:`Expand phase ${m.title}`,"aria-expanded":l,children:c.jsx(Lb,{className:`h-4 w-4 transition ${l?"rotate-90":"rotate-0"}`})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(zm,{}),c.jsx(cr,{featureNum:t==null?void 0:t.number,phaseNum:m.number,featureId:t.id,phaseId:m.id}),c.jsx(mr,{id:$l({featureNum:t==null?void 0:t.number,phaseNum:m.number}),children:c.jsx("span",{className:"sr-only",children:"Copy phase path"})}),m.shortId?c.jsx(ql,{shortId:m.shortId}):null,m.handoff?c.jsx(Sm,{phaseId:m.id,updatedAt:m.handoffUpdatedAt}):null,c.jsx(z0,{phaseId:m.id,phaseTitle:m.title,count:((N=m.linkedRequirements)==null?void 0:N.length)??0}),y?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Mc,{status:a.display.displayStatus,breakdown:a.display.breakdown,doneTasks:g,totalTasks:p,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Ye,{to:`/features/${t.id}/phases/${m.id}`,className:`entity-link--phase ${Um} underline-offset-4 hover:underline`,children:m.title}),c.jsx(sl,{value:m.updatedAt,className:"mt-1 block"})]})]}),c.jsx(Mc,{status:a.display.displayStatus,breakdown:a.display.breakdown,doneTasks:g,totalTasks:p,recentlyChanged:s,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),l?x.length>0?c.jsx("div",{className:"ml-1.5 grid grid-cols-1 gap-1 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:t0(a.display.displayStatus)},children:c.jsx(Mm,{items:x.map(w=>w.id),strategy:Om,children:x.map(w=>c.jsx(Lm,{id:w.id,children:c.jsx(CT,{feature:t,phase:m,task:w,recentlyChanged:u(w.id),highlighted:f==null?void 0:f.has(w.id)})},w.id))})}):c.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function CT({feature:t,phase:a,task:l,recentlyChanged:s,highlighted:o}){return c.jsxs(xi,{id:`task-row-${l.number}`,status:l.status,variant:"surface",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-2 py-2 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${s?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""} ${o?"ap-search-hit":""}`,children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(zm,{}),c.jsx(cr,{featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number,featureId:t.id,phaseId:a.id,taskId:l.id}),c.jsx(mr,{id:$l({featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),l.shortId?c.jsx(ql,{shortId:l.shortId}):null,l.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Rx,{status:l.status,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Ye,{to:`/features/${t.id}/phases/${a.id}/tasks/${l.id}`,className:`entity-link--task ${Um} underline-offset-4 hover:underline`,children:l.title}),c.jsx(sl,{value:l.updatedAt,className:"mt-1 block"})]}),c.jsx(Rx,{status:l.status,recentlyChanged:s,className:"hidden shrink-0 items-center gap-2 sm:flex"})]})}var O=(function(t){return t.FIELD_NAME="FIELD_NAME",t.COLON="COLON",t.VALUE="VALUE",t.QUOTED_VALUE="QUOTED_VALUE",t.AND="AND",t.OR="OR",t.NOT="NOT",t.COMPARISON_OP="COMPARISON_OP",t.LPAREN="LPAREN",t.RPAREN="RPAREN",t.SAVED_SEARCH="SAVED_SEARCH",t.HISTORY_REF="HISTORY_REF",t.PREFIX_OP="PREFIX_OP",t.WILDCARD="WILDCARD",t.REGEX="REGEX",t.RANGE="RANGE",t.TILDE="TILDE",t.BOOST="BOOST",t.WHITESPACE="WHITESPACE",t.UNKNOWN="UNKNOWN",t})({}),ia=(function(t){return t[t.EXPECT_TERM=0]="EXPECT_TERM",t[t.EXPECT_VALUE=1]="EXPECT_VALUE",t})(ia||{}),ui=class{constructor(t,a){hn(this,"input");hn(this,"pos");hn(this,"state");hn(this,"tokens");hn(this,"options");this.input=t,this.pos=0,this.state=ia.EXPECT_TERM,this.tokens=[],this.options=a||{}}tokenize(){for(this.tokens=[],this.pos=0,this.state=ia.EXPECT_TERM;this.pos<this.input.length;)this.state===ia.EXPECT_VALUE?this.readValue():this.readTerm();return this.tokens}peek(){return this.input[this.pos]}peekAt(t){return this.input[this.pos+t]}advance(){return this.input[this.pos++]}isWhitespace(t){return t===" "||t===" "||t===`
278
+ `||t==="\r"}isAlpha(t){return/[a-zA-Z_]/.test(t)}isAlphaNumeric(t){return/[a-zA-Z0-9_.\-]/.test(t)}readWhitespace(){const t=this.pos;for(;this.pos<this.input.length&&this.isWhitespace(this.peek());)this.advance();this.tokens.push({type:O.WHITESPACE,value:this.input.slice(t,this.pos),start:t,end:this.pos})}readQuotedString(){const t=this.pos,a=this.advance();for(;this.pos<this.input.length;){const l=this.advance();if(l==="\\"&&this.pos<this.input.length)this.advance();else if(l===a)break}this.tokens.push({type:O.QUOTED_VALUE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.tryReadModifier(),this.state=ia.EXPECT_TERM}readTerm(){const t=this.peek();if(this.isWhitespace(t)){this.readWhitespace();return}if(t==='"'){this.readQuotedString();return}if(t==="("){this.tokens.push({type:O.LPAREN,value:"(",start:this.pos,end:this.pos+1}),this.advance();return}if(t===")"){this.tokens.push({type:O.RPAREN,value:")",start:this.pos,end:this.pos+1}),this.advance();return}if(t==="~"||t==="^"){const l=this.pos,s=t==="~"?O.TILDE:O.BOOST;for(this.advance();this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:s,value:this.input.slice(l,this.pos),start:l,end:this.pos});return}if(t==="["||t==="{"){this.readRangeValue();return}if(t==="#"&&this.options.savedSearches){this.readSavedSearch();return}if(t==="!"&&this.options.historySearch){this.readHistoryRef();return}if(t==="-"||t==="+"){const l=this.peekAt(1);if(l&&(this.isAlpha(l)||l==='"'||l==="("||l==="#"||l==="!"||l==="["||l==="{")||!l||l===")"||l===" "||l===" "||l===`
279
+ `||l==="\r"){this.tokens.push({type:O.PREFIX_OP,value:t,start:this.pos,end:this.pos+1}),this.advance();return}}if(t==="&"&&this.peekAt(1)==="&"){this.tokens.push({type:O.AND,value:"&&",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if(t==="|"&&this.peekAt(1)==="|"){this.tokens.push({type:O.OR,value:"||",start:this.pos,end:this.pos+2}),this.advance(),this.advance();return}if((t===">"||t==="<")&&this.state===ia.EXPECT_TERM){const l=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:O.COMPARISON_OP,value:this.input.slice(l,this.pos),start:l,end:this.pos}),this.state=ia.EXPECT_VALUE;return}if(t==="/"){this.readRegex();return}const a=this.pos;for(;this.pos<this.input.length&&!this.isWhitespace(this.peek())&&this.peek()!=="("&&this.peek()!==")"&&this.peek()!=='"'&&this.peek()!=="~"&&this.peek()!=="^"&&!(this.peek()==="&"&&this.peekAt(1)==="&")&&!(this.peek()==="|"&&this.peekAt(1)==="|");){if(this.peek()==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}if(this.peek()===":"){this.pos>a&&this.tokens.push({type:O.FIELD_NAME,value:this.input.slice(a,this.pos),start:a,end:this.pos}),this.tokens.push({type:O.COLON,value:":",start:this.pos,end:this.pos+1}),this.advance(),this.state=ia.EXPECT_VALUE;return}this.advance()}if(this.pos>a){const l=this.input.slice(a,this.pos),s=l.toUpperCase();s==="AND"?this.tokens.push({type:O.AND,value:l,start:a,end:this.pos}):s==="OR"?this.tokens.push({type:O.OR,value:l,start:a,end:this.pos}):s==="NOT"?this.tokens.push({type:O.NOT,value:l,start:a,end:this.pos}):l.includes("*")||l.includes("?")?this.tokens.push({type:O.WILDCARD,value:l,start:a,end:this.pos}):this.tokens.push({type:O.VALUE,value:l,start:a,end:this.pos}),this.tryReadModifier()}}readValue(){const t=this.peek();if(this.isWhitespace(t)){this.readWhitespace(),this.state=ia.EXPECT_TERM;return}if(t==='"'){this.readQuotedString(),this.state=ia.EXPECT_TERM;return}if(t==="("||t===")"){this.state=ia.EXPECT_TERM,this.readTerm();return}if(t===">"||t==="<"){const l=this.pos;this.advance(),this.pos<this.input.length&&this.peek()==="="&&this.advance(),this.tokens.push({type:O.COMPARISON_OP,value:this.input.slice(l,this.pos),start:l,end:this.pos});return}if(t==="["||t==="{"){this.readRangeValue();return}if(t==="/"){this.readRegex(),this.state=ia.EXPECT_TERM;return}const a=this.pos;for(;this.pos<this.input.length&&!this.isWhitespace(this.peek())&&this.peek()!==")"&&this.peek()!=="("&&this.peek()!=='"'&&this.peek()!=="~"&&this.peek()!=="^";){if(this.peek()==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}this.advance()}if(this.pos>a){const l=this.input.slice(a,this.pos);l.includes("*")||l.includes("?")?this.tokens.push({type:O.WILDCARD,value:l,start:a,end:this.pos}):this.tokens.push({type:O.VALUE,value:l,start:a,end:this.pos}),this.tryReadModifier()}this.state=ia.EXPECT_TERM}readRangeValue(){const t=this.pos;for(this.advance();this.pos<this.input.length&&this.peek()!=="]"&&this.peek()!=="}";)this.advance();this.pos<this.input.length&&(this.peek()==="]"||this.peek()==="}")&&this.advance(),this.tokens.push({type:O.RANGE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.state=ia.EXPECT_TERM}tryReadModifier(){for(;this.pos<this.input.length&&(this.peek()==="~"||this.peek()==="^");){const t=this.pos,a=this.advance()==="~"?O.TILDE:O.BOOST;for(;this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:a,value:this.input.slice(t,this.pos),start:t,end:this.pos})}}readRegex(){const t=this.pos;for(this.advance();this.pos<this.input.length;){const a=this.peek();if(a==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}if(a==="/"){this.advance(),this.tokens.push({type:O.REGEX,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.tryReadModifier(),this.state=ia.EXPECT_TERM;return}this.advance()}this.tokens.push({type:O.VALUE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.state=ia.EXPECT_TERM}readSavedSearch(){const t=this.pos;for(this.advance();this.pos<this.input.length&&this.isAlphaNumeric(this.peek());)this.advance();this.tokens.push({type:O.SAVED_SEARCH,value:this.input.slice(t,this.pos),start:t,end:this.pos})}readHistoryRef(){const t=this.pos;for(this.advance();this.pos<this.input.length&&this.isAlphaNumeric(this.peek());)this.advance();this.tokens.push({type:O.HISTORY_REF,value:this.input.slice(t,this.pos),start:t,end:this.pos})}},ms=class{constructor(t){hn(this,"tokens");hn(this,"pos");hn(this,"nonWsTokens");hn(this,"errors",[]);this.tokens=t,this.nonWsTokens=t.filter(a=>a.type!==O.WHITESPACE),this.pos=0}getErrors(){return this.errors}isUnclosedQuote(t){if(t.type!==O.QUOTED_VALUE)return!1;const a=t.value;if(a.length<2)return!0;const l=a[0];return a[a.length-1]!==l}stripQuotes(t){const a=t.value;return this.isUnclosedQuote(t)?a.slice(1):a.slice(1,-1)}checkUnclosedQuote(t){this.isUnclosedQuote(t)&&this.errors.push({type:"Error",value:t.value[0],message:"Missing closing quote",start:t.start,end:t.start+1})}parse(){if(this.nonWsTokens.length===0)return null;let t=this.parseOr();for(;this.peek();){const a=this.peek();if(a.type===O.RPAREN)this.advance(),this.errors.push({type:"Error",value:a.value,message:"Unexpected closing parenthesis",start:a.start,end:a.end});else{const l=this.parseOr();t={type:"BooleanExpr",operator:"AND",left:t,right:l,implicit:!0,start:t.start,end:l.end}}}return t}peek(){return this.nonWsTokens[this.pos]}advance(){return this.nonWsTokens[this.pos++]}match(t){var a;if(((a=this.peek())==null?void 0:a.type)===t)return this.advance()}parseOr(){var a;let t=this.parseAnd();for(;((a=this.peek())==null?void 0:a.type)===O.OR;){const l=this.advance(),s=this.parseAnd();if(s.type==="Error"&&s.value===""){this.errors.push({type:"Error",value:l.value,message:"Missing search term after OR",start:l.start,end:l.end});break}t={type:"BooleanExpr",operator:"OR",left:t,right:s,sourceOperator:l.value,start:t.start,end:s.end}}return t}parseAnd(){let t=this.parseNot();for(;;){const a=this.peek();if(!a)break;if(a.type===O.AND){const l=this.advance(),s=this.parseNot();if(s.type==="Error"&&s.value===""){this.errors.push({type:"Error",value:l.value,message:"Missing search term after AND",start:l.start,end:l.end});break}t={type:"BooleanExpr",operator:"AND",left:t,right:s,sourceOperator:l.value,start:t.start,end:s.end}}else{if(a.type===O.OR||a.type===O.RPAREN)break;{const l=this.parseNot();t={type:"BooleanExpr",operator:"AND",left:t,right:l,implicit:!0,start:t.start,end:l.end}}}}return t}parseNot(){var t;if(((t=this.peek())==null?void 0:t.type)===O.NOT){const a=this.advance(),l=this.parsePrimary();return l.type==="Error"&&l.value===""?(this.errors.push({type:"Error",value:a.value,message:"Missing search term after NOT",start:a.start,end:a.end}),l):{type:"Not",expression:l,sourceOperator:a.value,start:a.start,end:l.end}}return this.parsePrimary()}applyGroupBoost(t){var a;if(((a=this.peek())==null?void 0:a.type)===O.BOOST){const l=this.advance(),s=l.value.slice(1),o=parseFloat(s);t.boost=isNaN(o)?1:o,t.end=l.end}return t}applyModifiers(t){var a,l;if(t.type!=="BareTerm"&&t.type!=="FieldValue")return t;if(((a=this.peek())==null?void 0:a.type)===O.TILDE){const s=this.advance(),o=s.value.slice(1),u=parseInt(o,10);t.quoted?t.proximity=isNaN(u)?0:u:t.fuzzy=isNaN(u)?0:u,t.end=s.end}if(((l=this.peek())==null?void 0:l.type)===O.BOOST){const s=this.advance(),o=s.value.slice(1),u=parseFloat(o);t.boost=isNaN(u)?1:u,t.end=s.end}return t}parseRangeBound(t,a){const l=t.length-t.trimStart().length,s=t.trim();return s.startsWith('"')&&s.endsWith('"')&&s.length>=2?{value:s.slice(1,-1),quoted:!0,valueStart:a+l,valueEnd:a+l+s.length}:s.startsWith('"')?{value:s.slice(1),quoted:!0,valueStart:a+l,valueEnd:a+l+s.length}:{value:s,quoted:!1,valueStart:a+l,valueEnd:a+l+s.length}}parseRange(t){const a=t.value,l=a[0],s=l==="[",o=a[a.length-1],u=o==="]"||o==="}",f=o==="]";u||this.errors.push({type:"Error",value:l,message:"Unclosed range expression",start:t.start,end:t.start+1});const m=u?a.slice(1,-1):a.slice(1),p=m.match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/),g=t.start+1;if(!p){this.errors.push({type:"Error",value:a,message:"Range expression missing TO keyword",start:t.start,end:t.end});const w=this.parseRangeBound(m,g);return{type:"Range",lower:w.value,upper:"",lowerInclusive:s,upperInclusive:u?f:!0,lowerQuoted:w.quoted,upperQuoted:!1,lowerStart:w.valueStart,lowerEnd:w.valueEnd,upperStart:t.end,upperEnd:t.end,start:t.start,end:t.end}}const x=this.parseRangeBound(p[1],g),y=g+p[1].length+(m.length-p[1].length-p[2].length),N=this.parseRangeBound(p[2],y);return{type:"Range",lower:x.value,upper:N.value,lowerInclusive:s,upperInclusive:u?f:!0,lowerQuoted:x.quoted,upperQuoted:N.quoted,lowerStart:x.valueStart,lowerEnd:x.valueEnd,upperStart:N.valueStart,upperEnd:N.valueEnd,start:t.start,end:t.end}}parsePrimary(){var l,s,o;const t=this.peek();if(!t)return{type:"Error",value:"",message:"Unexpected end of input",start:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0,end:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0};if(t.type===O.AND){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected AND",start:u.start,end:u.end}),this.parsePrimary()}if(t.type===O.OR){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected OR",start:u.start,end:u.end}),this.parsePrimary()}if(t.type===O.PREFIX_OP){const u=this.advance(),f=this.parsePrimary();return u.value==="-"?{type:"Not",expression:f,sourceOperator:u.value,start:u.start,end:f.end}:{...f,start:u.start}}if(t.type===O.LPAREN){const u=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const g=this.match(O.RPAREN);g||this.errors.push({type:"Error",value:u.value,message:"Unclosed parenthesis",start:u.start,end:u.end});const x={type:"Group",expression:{type:"BareTerm",value:"",quoted:!1,start:u.end,end:u.end},start:u.start,end:g?g.end:u.end};return this.applyGroupBoost(x)}const f=this.parseOr(),m=this.match(O.RPAREN);m||this.errors.push({type:"Error",value:u.value,message:"Missing closing parenthesis",start:u.start,end:u.end});const p={type:"Group",expression:f,start:u.start,end:m?m.end:f.end};return this.applyGroupBoost(p)}if(t.type===O.SAVED_SEARCH){const u=this.advance();return{type:"SavedSearch",name:u.value.slice(1),start:u.start,end:u.end}}if(t.type===O.HISTORY_REF){const u=this.advance();return{type:"HistoryRef",ref:u.value.slice(1),start:u.start,end:u.end}}if(t.type===O.FIELD_NAME){const u=this.advance(),f=this.match(O.COLON);if(f){let m=":";const p=this.match(O.COMPARISON_OP);if(p&&(m=p.value),((l=this.peek())==null?void 0:l.type)===O.LPAREN){const x=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const S=this.match(O.RPAREN);S||this.errors.push({type:"Error",value:x.value,message:"Unclosed parenthesis",start:x.start,end:x.end});const A={type:"FieldGroup",field:u.value,expression:{type:"BareTerm",value:"",quoted:!1,start:x.end,end:x.end},start:u.start,end:S?S.end:x.end};return this.applyGroupBoost(A)}const y=this.parseOr(),N=this.match(O.RPAREN);N||this.errors.push({type:"Error",value:x.value,message:"Missing closing parenthesis",start:x.start,end:x.end});const w={type:"FieldGroup",field:u.value,expression:y,start:u.start,end:N?N.end:y.end};return this.applyGroupBoost(w)}if(((s=this.peek())==null?void 0:s.type)===O.RANGE){const x=this.advance(),y=this.parseRange(x);return y.field=u.value,y.start=u.start,y}if(((o=this.peek())==null?void 0:o.type)===O.REGEX){const x=this.advance();return{type:"Regex",pattern:x.value.slice(1,-1),start:u.start,end:x.end}}const g=this.peek();if(g&&(g.type===O.VALUE||g.type===O.QUOTED_VALUE||g.type===O.WILDCARD)){const x=this.advance(),y=x.type===O.QUOTED_VALUE;y&&this.checkUnclosedQuote(x);const N=y?this.stripQuotes(x):x.value;return this.applyModifiers({type:"FieldValue",field:u.value,operator:m,value:N,quoted:y,start:u.start,end:x.end})}return{type:"FieldValue",field:u.value,operator:m,value:"",quoted:!1,start:u.start,end:p?p.end:f.end}}return{type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end}}if(t.type===O.COMPARISON_OP){const u=this.advance(),f=this.peek();if(f&&(f.type===O.VALUE||f.type===O.QUOTED_VALUE)){const m=this.advance();return{type:"BareTerm",value:u.value+m.value,quoted:!1,start:u.start,end:m.end}}return{type:"Error",value:u.value,message:"Comparison operator without value",start:u.start,end:u.end}}if(t.type===O.QUOTED_VALUE){const u=this.advance();return this.checkUnclosedQuote(u),this.applyModifiers({type:"BareTerm",value:this.stripQuotes(u),quoted:!0,start:u.start,end:u.end})}if(t.type===O.WILDCARD){const u=this.advance();return this.applyModifiers({type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end})}if(t.type===O.RANGE){const u=this.advance();return this.parseRange(u)}if(t.type===O.REGEX){const u=this.advance();return{type:"Regex",pattern:u.value.slice(1,-1),start:u.start,end:u.end}}if(t.type===O.VALUE){const u=this.advance();return this.applyModifiers({type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end})}if(t.type===O.RPAREN){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected closing parenthesis",start:u.start,end:u.end}),{type:"Error",value:u.value,message:"Unexpected closing parenthesis",start:u.start,end:u.end}}const a=this.advance();return{type:"Error",value:a.value,message:`Unexpected token: ${a.value}`,start:a.start,end:a.end}}static getCursorContext(t,a){let l,s;for(const u of t)if(u.type!==O.WHITESPACE){if(a>=u.start&&a<=u.end){l=u;break}u.end<=a&&(s=u)}const o=u=>{let f=0;for(let m=u;m>=0;m--){const p=t[m];if(p.type!==O.WHITESPACE){if(p.type===O.RPAREN){f++;continue}if(p.type===O.LPAREN){if(f>0){f--;continue}for(let g=m-1;g>=0;g--)if(t[g].type!==O.WHITESPACE){if(t[g].type===O.COLON){for(let x=g-1;x>=0;x--)if(t[x].type!==O.WHITESPACE){if(t[x].type===O.FIELD_NAME)return t[x].value;break}}break}}}}return""};if((l==null?void 0:l.type)===O.COLON){let u="";const f=t.indexOf(l);for(let m=f-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){u=t[m].value;break}if(t[m].type!==O.WHITESPACE)break}if(!u&&a===l.start)return{type:"FIELD_NAME",partial:"",token:l};if(a===l.end){for(let m=f+1;m<t.length;m++)if(t[m].type!==O.WHITESPACE){if(t[m].type===O.VALUE||t[m].type===O.QUOTED_VALUE||t[m].type===O.WILDCARD||t[m].type===O.RANGE)return{type:"FIELD_VALUE",partial:t[m].type===O.QUOTED_VALUE?t[m].value.slice(1,t[m].value.endsWith('"')||t[m].value.endsWith("'")?-1:void 0):t[m].value,fieldName:u,token:t[m]};break}}return{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}}if((l==null?void 0:l.type)===O.SAVED_SEARCH)return{type:"SAVED_SEARCH",partial:l.value.slice(1),token:l};if((l==null?void 0:l.type)===O.HISTORY_REF)return{type:"HISTORY_REF",partial:l.value.slice(1),token:l};if((l==null?void 0:l.type)===O.RANGE){const u=t.indexOf(l);let f="";for(let m=u-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){f=t[m].value;break}if(!(t[m].type===O.WHITESPACE||t[m].type===O.COLON))break}return{type:"RANGE",partial:"",fieldName:f,token:l}}if((s==null?void 0:s.type)===O.COLON||(s==null?void 0:s.type)===O.COMPARISON_OP){const u=t.indexOf(s);let f="";for(let m=u-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){f=t[m].value;break}if(!(t[m].type===O.WHITESPACE||t[m].type===O.COLON||t[m].type===O.COMPARISON_OP))break}return l&&(l.type===O.VALUE||l.type===O.QUOTED_VALUE||l.type===O.WILDCARD)?{type:"FIELD_VALUE",partial:l.type===O.QUOTED_VALUE?l.value.slice(1,l.value.endsWith('"')||l.value.endsWith("'")?-1:void 0):l.value,fieldName:f,token:l}:{type:"FIELD_VALUE",partial:"",fieldName:f,token:s}}if((l==null?void 0:l.type)===O.VALUE||(l==null?void 0:l.type)===O.QUOTED_VALUE||(l==null?void 0:l.type)===O.WILDCARD){const u=t.indexOf(l);for(let f=u-1;f>=0;f--)if(t[f].type!==O.WHITESPACE){if(t[f].type===O.COLON||t[f].type===O.COMPARISON_OP){let m="";for(let p=f-1;p>=0;p--){if(t[p].type===O.FIELD_NAME){m=t[p].value;break}if(!(t[p].type===O.WHITESPACE||t[p].type===O.COLON||t[p].type===O.COMPARISON_OP))break}return{type:"FIELD_VALUE",partial:l.type===O.QUOTED_VALUE?l.value.slice(1,l.value.endsWith('"')||l.value.endsWith("'")?-1:void 0):l.value,fieldName:m,token:l}}break}}if((l==null?void 0:l.type)===O.QUOTED_VALUE)return{type:"FIELD_NAME",partial:l.value,token:l};if((l==null?void 0:l.type)===O.FIELD_NAME||(l==null?void 0:l.type)===O.VALUE){const u=o(t.indexOf(l));return u?{type:"FIELD_VALUE",partial:l.value,fieldName:u,token:l}:{type:"FIELD_NAME",partial:l.value,token:l}}if((s==null?void 0:s.type)===O.PREFIX_OP){const u=o(t.indexOf(s));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(s&&(s.type===O.AND||s.type===O.OR||s.type===O.NOT)){const u=o(t.indexOf(s));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(t.length===0||t.every(u=>u.type===O.WHITESPACE))return{type:"EMPTY",partial:""};if((l==null?void 0:l.type)===O.LPAREN||(s==null?void 0:s.type)===O.LPAREN){const u=(l==null?void 0:l.type)===O.LPAREN?l:s,f=o(t.indexOf(u));return f?{type:"FIELD_VALUE",partial:"",fieldName:f,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if((l==null?void 0:l.type)===O.TILDE||(l==null?void 0:l.type)===O.BOOST)return{type:"OPERATOR",partial:""};if(s&&(s.type===O.VALUE||s.type===O.QUOTED_VALUE||s.type===O.RPAREN||s.type===O.RANGE||s.type===O.TILDE||s.type===O.BOOST)){const u=o(t.indexOf(s));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"OPERATOR",partial:""}}return{type:"FIELD_NAME",partial:"",token:void 0}}};function Zh(t,a){if(a<t.start||a>t.end)return null;if(t.type==="BooleanExpr"){const l=Zh(t.left,a);if(l)return l;const s=Zh(t.right,a);return s||null}return t}function AT(t,a,l){if(!t)return null;const s=Zh(t,l);if(!s)return null;let o=s.start,u=s.end;const f=a.slice(u).match(/^(\s+(?:AND|OR|&&|\|\|)\s+|\s+)(?=\S)/i);if(f)return u+=f[0].length,{start:o,end:u};const m=a.slice(0,o).match(/(\s+(?:AND|OR|&&|\|\|)\s+|\s+)$/i);return m&&m.index!==void 0&&m.index>0&&(o-=m[0].length),{start:o,end:u}}var DT={fieldName:"#0550ae",fieldValue:"#1a7f37",operator:"#cf222e",booleanOp:"#8250df",quoted:"#0a3069",paren:"#656d76",savedSearch:"#bf8700",historyRef:"#6639ba",wildcard:"#953800",error:"#cf222e",background:"#ffffff",text:"#1f2328",placeholder:"#656d76",cursor:"#1f2328",dropdownSelected:"#0969da",dropdownHover:"#f6f8fa",regexDelimiter:"#cf222e",regexCharClass:"#0550ae",regexGroup:"#656d76",regexEscape:"#953800",regexQuantifier:"#8250df",regexAnchor:"#cf222e",regexAlternation:"#8250df",regexText:"#0a3069",matchedParenBg:"#fff3cd",warning:"#d4a72c",valueTypes:{}},kT={fontFamily:"'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace",fontSize:"14px",lineHeight:"1.5",inputMinHeight:"40px",inputPadding:"8px 12px",inputBorderWidth:"2px",inputBorderColor:"#d0d7de",inputBorderRadius:"8px",inputFocusBorderColor:"#0969da",inputFocusShadow:"0 0 0 3px rgba(9, 105, 218, 0.3)",dropdownBorderColor:"#d0d7de",dropdownBorderRadius:"8px",dropdownShadow:"0 8px 24px rgba(0, 0, 0, 0.12)",dropdownMaxHeight:"300px",dropdownMinWidth:"200px",dropdownMaxWidth:"400px",dropdownZIndex:99999,dropdownItemPadding:"6px 12px",dropdownItemFontSize:"13px",dropdownItemContentGap:"8px",typeBadgeBg:"#eef1f5",typeBadgeSelectedBg:"rgba(255,255,255,0.2)",typeBadgeColor:"#656d76",typeBadgeSelectedColor:"#ffffff"},OT=["AND","OR","NOT"];function jx(t){return t.replace(/\r\n/g,`
280
+ `).replace(/\r/g,`
281
+ `).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036\u00AB\u00BB]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\u2013\u2014]/g,"-").replace(/\u2026/g,"...").replace(/[\u00A0\u202F\u2007]/g," ").replace(/[\uFF01-\uFF5E]/g,a=>String.fromCharCode(a.charCodeAt(0)-65248))}var Tx={"(":")","[":"]",'"':'"',"'":"'"};function MT(t,a,l,s,o){const u=t.slice(0,a),f=t.slice(a,l),m=t.slice(l);return{newValue:u+s+f+o+m,newCursorPos:l+2,newSelStart:a+1,newSelEnd:l+1}}function _T(t){if(!t.textContent)return"";const a=[];function l(s){var o;if(s.nodeType===Node.TEXT_NODE)a.push(s.textContent||"");else if(s.nodeName==="BR")(o=s.hasAttribute)!=null&&o.call(s,"data-sentinel")||a.push(`
282
+ `);else for(let u=0;u<s.childNodes.length;u++)l(s.childNodes[u])}return l(t),a.join("")}function Cx(t,a,l){let s=-1,o=-1;for(let u=0;u<t.length;u++){const f=t[u];a>=f.start&&a<=f.end&&(s=u),o===-1&&l>=f.start&&l<=f.end&&(o=u)}return[s,o]}function LT(t,a,l){if(t){let s=t.end;if(t.type===O.FIELD_NAME&&l){const o=l.indexOf(t);if(o>=0){for(let u=o+1;u<l.length;u++)if(l[u].type!==O.WHITESPACE){l[u].type===O.COLON&&(s=l[u].end);break}}}return{start:t.start,end:s}}return{start:a,end:a}}var Oh=class U0{constructor(a,l=[],s=[],o=10,u={}){hn(this,"fields");hn(this,"fieldMap");hn(this,"savedSearches");hn(this,"searchHistory");hn(this,"maxSuggestions");hn(this,"options");hn(this,"defaultFieldName");hn(this,"defaultFieldShowFieldSuggs",!1);this.fields=a,this.fieldMap=new Map(a.map(f=>[f.name,f]));for(const f of a)if(f.aliases)for(const m of f.aliases)this.fieldMap.set(m,f);this.savedSearches=l,this.searchHistory=s,this.maxSuggestions=o,this.options={showSavedSearchHint:u.showSavedSearchHint??!1,showHistoryHint:u.showHistoryHint??!1}}resolveField(a){return this.fieldMap.get(a)}updateSavedSearches(a){this.savedSearches=a}updateSearchHistory(a){this.searchHistory=a}setDefaultField(a){this.defaultFieldName=a==null?void 0:a.name,this.defaultFieldShowFieldSuggs=(a==null?void 0:a.showFieldSuggestions)??!1}getSuggestions(a,l){let s=ms.getCursorContext(a,l);const o=LT(s.token,l,a);if(this.defaultFieldName&&(s.type==="FIELD_NAME"||s.type==="EMPTY")){s={...s,type:"FIELD_VALUE",fieldName:this.defaultFieldName};const u=this.resolveField(this.defaultFieldName);if((u==null?void 0:u.type)==="date")return{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:s};const f=this.getValueSuggestions(u,s.partial,o.start,o.end);if(this.defaultFieldShowFieldSuggs){const m=this.getFieldSuggestions(s.partial,o.start,o.end);return{suggestions:[...f,...m],showDatePicker:!1,context:s}}return{suggestions:f,showDatePicker:!1,context:s}}switch(s.type){case"FIELD_NAME":case"EMPTY":{const u=this.getFieldSuggestions(s.partial,o.start,o.end),f=!s.partial&&u.length>0?this.getSpecialHints(o.start,o.end):[];return{suggestions:this.sortByPriority([...u,...f]),showDatePicker:!1,context:s}}case"FIELD_VALUE":{const u=s.fieldName?this.resolveField(s.fieldName):void 0;return(u==null?void 0:u.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:s}:{suggestions:this.getValueSuggestions(u,s.partial,o.start,o.end),showDatePicker:!1,context:s}}case"OPERATOR":{const u=this.getOperatorSuggestions(s.partial,o.start,o.end),f=this.getFieldSuggestions("",o.start,o.end),m=this.getSpecialHints(o.start,o.end);return{suggestions:this.sortByPriority([...u,...f,...m]),showDatePicker:!1,context:s}}case"SAVED_SEARCH":return{suggestions:this.getSavedSearchSuggestions(s.partial,o.start,o.end),showDatePicker:!1,context:s};case"HISTORY_REF":return{suggestions:this.getHistorySuggestions(s.partial,o.start,o.end),showDatePicker:!1,context:s};case"RANGE":{const u=s.fieldName?this.resolveField(s.fieldName):void 0;return(u==null?void 0:u.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:s}:{suggestions:[],showDatePicker:!1,context:s}}default:return{suggestions:[],showDatePicker:!1,context:s}}}getFieldSuggestions(a,l,s){const o=a.toLowerCase();return this.fields.filter(u=>!u.hide).map(u=>{const f=u.name.toLowerCase(),m=(u.label||"").toLowerCase(),p=(u.aliases||[]).map(x=>x.toLowerCase());let g=0;return f.startsWith(o)?g=4:m.startsWith(o)||p.some(x=>x.startsWith(o))?g=3:f.includes(o)?g=2:(m.includes(o)||p.some(x=>x.includes(o)))&&(g=1),{field:u,score:g}}).filter(u=>u.score>0).sort((u,f)=>f.score-u.score).slice(0,this.maxSuggestions).map(u=>({text:u.field.name+":",label:u.field.label||u.field.name,description:u.field.description,type:u.field.type,replaceStart:l,replaceEnd:s,matchPartial:a,priority:10}))}getValueSuggestions(a,l,s,o){if(!a)return[];if(a.type==="boolean")return["true","false"].filter(u=>u.startsWith(l.toLowerCase())).map(u=>({text:u,label:u,type:"boolean",replaceStart:s,replaceEnd:o,matchPartial:l}));if(a.placeholder!==!1){const u=a.placeholder||{number:"Enter a number",ip:"Enter an IP address"}[a.type];if(u)return[{text:"",label:u,type:"hint",replaceStart:s,replaceEnd:o}]}return[]}getOperatorSuggestions(a,l,s){const o=a.toLowerCase();return OT.filter(u=>u.toLowerCase().startsWith(o)).map(u=>({text:u+" ",label:u,description:u==="AND"?"Both conditions must match":u==="OR"?"Either condition must match":"Negate the following condition",type:"operator",replaceStart:l,replaceEnd:s,matchPartial:a,priority:30}))}sortByPriority(a){return a.sort((l,s)=>(s.priority??0)-(l.priority??0))}getSpecialHints(a,l){const s=[],o=this.savedSearches.length>0||this.options.hasSavedSearchProvider,u=this.searchHistory.length>0||this.options.hasHistoryProvider;return this.options.showSavedSearchHint&&o&&s.push({text:"#",label:"#saved-search",description:"Type # to use a saved search",type:"hint",replaceStart:a,replaceEnd:l,priority:20}),this.options.showHistoryHint&&u&&s.push({text:"!",label:"!history",description:"Type ! to search history",type:"hint",replaceStart:a,replaceEnd:l,priority:20}),s}getSavedSearchSuggestions(a,l,s){return this.savedSearches.slice(0,this.maxSuggestions).map(o=>({text:o.query,label:o.label||o.query,description:o.description,type:"savedSearch",replaceStart:l,replaceEnd:s,matchPartial:a,sourceData:o}))}getHistorySuggestions(a,l,s){return this.searchHistory.slice(0,this.maxSuggestions).map(o=>({text:U0.wrapHistoryQuery(o.query),label:o.label||o.query,description:o.description,type:"history",replaceStart:l,replaceEnd:s,matchPartial:a,sourceData:o}))}static wrapHistoryQuery(a){try{const l=new ms(new ui(a).tokenize()).parse();if(l&&l.type==="BooleanExpr")return"("+a+")"}catch{}return a}};function mc(t){if(t==="")return null;const a=Number(t);return isNaN(a)?`"${t}" is not a valid number`:null}var zT=[/^\d{4}-\d{2}-\d{2}$/,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{2}\/\d{2}\/\d{4}$/,/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,/^now$/i,/^now[+-]\d+[dhms]$/i];function UT(t){for(const a of zT)if(a.test(t))return!0;return!isNaN(Date.parse(t))}function Mh(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function BT(t){if(/^now$/i.test(t))return new Date;const a=t.match(/^now([+-])(\d+)([dhms])$/i);if(a){const o=new Date,u=a[1]==="+"?1:-1,f=parseInt(a[2],10);switch(a[3].toLowerCase()){case"d":o.setDate(o.getDate()+u*f);break;case"h":o.setHours(o.getHours()+u*f);break;case"m":o.setMinutes(o.getMinutes()+u*f);break;case"s":o.setSeconds(o.getSeconds()+u*f);break}return o}const l=t.match(/^(\d{4})[-/](\d{2})[-/](\d{2})$/);if(l)return new Date(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10));const s=new Date(t);return isNaN(s.getTime())?null:s}function Ax(t,a){return new Date(t,a+1,0).getDate()}function HT(t,a){return new Date(t,a,1).getDay()}function yo(t,a){return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()}function Dx(t,a,l){if(!a||!l)return!1;const s=t.getTime(),o=a.getTime(),u=l.getTime();return s>=Math.min(o,u)&&s<=Math.max(o,u)}var $T=["January","February","March","April","May","June","July","August","September","October","November","December"];function qT(t){return $T[t]}function pc(t,a){if(t==="")return null;const l=t.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(l){const s=_h(l[1].trim(),a);if(s)return`Range start: ${s}`;const o=_h(l[2].trim(),a);return o?`Range end: ${o}`:null}return _h(t,a)}function _h(t,a){return/^now(\/[dhms])?$/i.test(t)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(t)||a&&a(t)!==null||UT(t)?null:`"${t}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function gc(t){return t==null?null:typeof t=="string"?{message:t,severity:"error"}:t}var vc={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function yc(t){if(t.length<=1)return t;const a=[...t].sort((s,o)=>{const u=vc[s.type??"SYNTAX_ERROR"],f=vc[o.type??"SYNTAX_ERROR"];return u!==f?u-f:s.start-o.start}),l=[];for(const s of a)l.some(o=>vc[o.type??"SYNTAX_ERROR"]<vc[s.type??"SYNTAX_ERROR"]&&o.start<=s.start&&o.end>=s.end)||l.push(s);return l}var kx=class{constructor(t){hn(this,"fields");this.fields=new Map(t.map(a=>[a.name,a]));for(const a of t)if(a.aliases)for(const l of a.aliases)this.fields.set(l,a)}validate(t,a,l,s){if(!t)return[];const o=[],u=s?this.fields.get(s):void 0;return this.walkNode(t,o,a,l,u),this.checkAmbiguousPrecedence(t,o),o}walkNode(t,a,l,s,o){switch(t.type){case"BareTerm":if(t.fuzzy!==void 0&&t.fuzzy>2&&a.push({message:`Fuzzy edit distance must be 0, 1, or 2 (got ${t.fuzzy})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),t.proximity!==void 0&&t.proximity<0&&a.push({message:`Proximity value must be non-negative (got ${t.proximity})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),o&&t.value!==""){let u=null;switch(o.type){case"number":u=mc(t.value);break;case"date":u=pc(t.value,s);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(u=`Expected "true" or "false", got "${t.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(t.value)&&!t.value.includes("*")&&(u=`"${t.value}" is not a valid IP address`);break}u&&a.push({message:u,start:t.start,end:t.end,field:o.name,type:"INVALID_VALUE"})}if(l&&t.value!==""){const u=gc(l({value:t.value,position:"bare_term",quoted:t.quoted,fieldName:o==null?void 0:o.name,fieldConfig:o}));u&&a.push({message:u.message,start:t.start,end:t.end,severity:u.severity,type:"CUSTOM"})}break;case"Regex":break;case"Range":if(this.validateEmptyRangeBounds(t,a),t.field&&t.field!=="*"){const u=this.fields.get(t.field);u?this.validateRangeBounds(u,t,a,l,s):a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"})}break;case"FieldValue":{if(t.field==="*")return;if(t.value===""){const m=t.operator===":"?":":t.operator;a.push({message:`Missing value after "${t.field}${m}"`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"});return}const u=this.fields.get(t.field);if(!u){a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"});return}t.fuzzy!==void 0&&t.fuzzy>2&&a.push({message:`Fuzzy edit distance must be 0, 1, or 2 (got ${t.fuzzy})`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"}),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"});let f=null;switch(u.type){case"number":f=mc(t.value);break;case"date":f=pc(t.value,s);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(f=`Expected "true" or "false", got "${t.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(t.value)&&!t.value.includes("*")&&(f=`"${t.value}" is not a valid IP address`);break}if(t.operator!==":"&&u.type!=="number"&&u.type!=="date"&&(f=`Comparison operator "${t.operator}" is not valid for ${u.type} fields`),!f&&l){const m=gc(l({value:t.value,position:"field_value",fieldName:u.name,fieldConfig:u,quoted:t.quoted,operator:t.operator!==":"?t.operator:void 0}));if(m){const p=t.end-t.value.length;a.push({message:m.message,start:p,end:t.end,field:t.field,severity:m.severity,type:"CUSTOM"})}}if(f){const m=t.end-t.value.length,p=t.operator!==":"&&u.type!=="number"&&u.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";a.push({message:f,start:m,end:t.end,field:t.field,type:p})}break}case"FieldGroup":if(t.field==="*")this.walkNode(t.expression,a,l,s,o);else{const u=this.fields.get(t.field);u?this.walkFieldGroup(t.expression,u,a,l,s):a.push({message:`Unknown field: "${t.field}"`,start:t.start,end:t.start+t.field.length,field:t.field,type:"UNKNOWN_FIELD"})}t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break;case"BooleanExpr":this.walkNode(t.left,a,l,s,o),this.walkNode(t.right,a,l,s,o);break;case"Group":this.walkNode(t.expression,a,l,s,o),t.boost!==void 0&&t.boost<=0&&a.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break;case"Not":this.walkNode(t.expression,a,l,s,o);break;case"Error":a.push({message:t.message,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(t,a,l,s,o){switch(t.type){case"BareTerm":if(t.value==="")return;this.validateFieldValue(a,t.value,t.quoted,":",t.start,t.end,l,s,o);break;case"FieldValue":this.walkNode(t,l,s,o);break;case"Range":this.validateRangeBounds(a,t,l,s,o);break;case"BooleanExpr":this.walkFieldGroup(t.left,a,l,s,o),this.walkFieldGroup(t.right,a,l,s,o);break;case"Group":this.walkFieldGroup(t.expression,a,l,s,o);break;case"Not":this.walkFieldGroup(t.expression,a,l,s,o);break;default:this.walkNode(t,l,s,o);break}}validateFieldValue(t,a,l,s,o,u,f,m,p){let g=null;switch(t.type){case"number":g=mc(a);break;case"date":g=pc(a,p);break;case"boolean":a!=="true"&&a!=="false"&&(g=`Expected "true" or "false", got "${a}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(a)&&!a.includes("*")&&(g=`"${a}" is not a valid IP address`);break}if(s!==":"&&t.type!=="number"&&t.type!=="date"&&(g=`Comparison operator "${s}" is not valid for ${t.type} fields`),!g&&m){const x=gc(m({value:a,position:"field_group_term",fieldName:t.name,fieldConfig:t,quoted:l,operator:s!==":"?s:void 0}));x&&f.push({message:x.message,start:o,end:u,field:t.name,severity:x.severity,type:"CUSTOM"})}if(g){const x=s!==":"&&t.type!=="number"&&t.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";f.push({message:g,start:o,end:u,field:t.name,type:x})}}validateEmptyRangeBounds(t,a){t.lower!=="*"&&t.lower.trim()===""&&a.push({message:"Missing lower bound in range",start:t.start,end:t.start+1,field:t.field,type:"SYNTAX_ERROR"}),t.upper!=="*"&&t.upper.trim()===""&&a.push({message:"Missing upper bound in range",start:t.end-1,end:t.end,field:t.field,type:"SYNTAX_ERROR"})}validateRangeBounds(t,a,l,s,o){const u=[];a.lower!=="*"&&a.lower.trim()!==""&&u.push({value:a.lower,label:"Range start",start:a.lowerStart,end:a.lowerEnd,position:"range_start",inclusive:a.lowerInclusive}),a.upper!=="*"&&a.upper.trim()!==""&&u.push({value:a.upper,label:"Range end",start:a.upperStart,end:a.upperEnd,position:"range_end",inclusive:a.upperInclusive});for(const f of u){let m=null;switch(t.type){case"number":m=mc(f.value),m&&(m=`${f.label}: ${m}`);break;case"date":m=pc(f.value,o),m&&(m=`${f.label}: ${m}`);break;case"boolean":m="Range queries are not supported for boolean fields";break}if(!m&&s){const p=gc(s({value:f.value,position:f.position,fieldName:t.name,fieldConfig:t,quoted:!1,inclusive:f.inclusive}));p&&l.push({message:p.message,start:f.start,end:f.end,field:t.name,severity:p.severity,type:"CUSTOM"})}if(m){const p=t.type==="boolean"?"SYNTAX_ERROR":"INVALID_VALUE";l.push({message:m,start:f.start,end:f.end,field:t.name,type:p})}}}checkAmbiguousPrecedence(t,a){const l=new Set;this.findAndFlagAmbiguity(t,a,l)}findAndFlagAmbiguity(t,a,l){if(t.type==="BooleanExpr"&&!l.has(t)){const s=new Set,o=[];this.collectBoolOps(t,s,o),s.size>1&&(a.push({message:"Ambiguous precedence: mix of AND and OR without parentheses. Add parentheses to clarify.",start:t.start,end:t.end,severity:"warning",type:"AMBIGUOUS_PRECEDENCE"}),o.forEach(u=>l.add(u))),this.collectLeaves(t).forEach(u=>this.findAndFlagAmbiguity(u,a,l))}else t.type==="Group"||t.type==="FieldGroup"?this.findAndFlagAmbiguity(t.expression,a,l):t.type==="Not"?this.findAndFlagAmbiguity(t.expression,a,l):t.type==="BooleanExpr"&&this.collectLeaves(t).forEach(s=>this.findAndFlagAmbiguity(s,a,l))}collectBoolOps(t,a,l){t.type==="BooleanExpr"&&(a.add(t.operator),l.push(t),this.collectBoolOps(t.left,a,l),this.collectBoolOps(t.right,a,l))}collectLeaves(t){return t.type!=="BooleanExpr"?[t]:[...this.collectLeaves(t.left),...this.collectLeaves(t.right)]}};function za(...t){return t.filter(Boolean).join(" ")}function Zo(t){return{...DT,...t}}function Jo(t){return{...kT,...t}}function IT(t,a){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...a}}function VT(t,a){return{flex:1,minHeight:a.inputMinHeight,padding:a.inputPadding,borderWidth:a.inputBorderWidth,borderStyle:"solid",borderColor:a.inputBorderColor,borderRadius:a.inputBorderRadius,outline:"none",fontSize:a.fontSize,fontFamily:a.fontFamily,lineHeight:a.lineHeight,backgroundColor:t.background,color:t.text,caretColor:t.cursor,whiteSpace:"pre-wrap",wordWrap:"break-word",overflowWrap:"break-word",overflow:"auto",cursor:"text"}}function YT(t){return{borderColor:t.inputFocusBorderColor,boxShadow:t.inputFocusShadow}}function FT(t,a){const l=a.inputPadding.split(/\s+/),s=l[0]||"8px";return{position:"absolute",top:s,left:l.length>=4?l[3]:l.length>=2?l[1]:s,right:l.length>=4||l.length>=2?l[1]:s,color:t.placeholder,pointerEvents:"none",fontSize:a.fontSize,fontFamily:a.fontFamily,lineHeight:a.lineHeight,userSelect:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}function B0(t,a){return{position:"absolute",zIndex:a.dropdownZIndex,backgroundColor:t.background,border:`1px solid ${a.dropdownBorderColor}`,borderRadius:a.dropdownBorderRadius,boxShadow:a.dropdownShadow,maxHeight:a.dropdownMaxHeight,overflowY:"auto",width:"max-content",minWidth:a.dropdownMinWidth,maxWidth:a.dropdownMaxWidth,padding:"4px 0"}}function Ox(t,a,l){return{padding:l.dropdownItemPadding,cursor:"pointer",fontSize:l.dropdownItemFontSize,fontFamily:l.fontFamily,backgroundColor:t?a.dropdownSelected:"transparent",color:t?"#ffffff":a.text,display:"flex",alignItems:"center",gap:l.dropdownItemContentGap,lineHeight:"1.4"}}function ti(t){return{flex:1,fontWeight:500}}function Lh(t){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function PT(t,a){return{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:t?a.typeBadgeSelectedBg:a.typeBadgeBg,color:t?a.typeBadgeSelectedColor:a.typeBadgeColor,flexShrink:0}}function GT(t,a){return{container:{padding:"12px",backgroundColor:t.background,minWidth:"280px",fontFamily:a.fontFamily},header:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},navButton:{backgroundColor:"transparent",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:t.text,borderRadius:"4px"},monthLabel:{fontWeight:600,fontSize:a.fontSize,color:t.text},weekDays:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},weekDay:{textAlign:"center",fontSize:"11px",color:t.placeholder,padding:"4px",fontWeight:600},days:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},day:{textAlign:"center",padding:"6px",cursor:"pointer",fontSize:a.dropdownItemFontSize,borderRadius:"4px",color:t.text,border:"none",backgroundColor:"transparent"},dayHover:{backgroundColor:t.dropdownHover},daySelected:{backgroundColor:t.dropdownSelected,color:"#ffffff"},dayInRange:{backgroundColor:"rgba(9, 105, 218, 0.1)"},dayOtherMonth:{opacity:.45},dayToday:{fontWeight:700,textDecoration:"underline"},rangeToggle:{display:"flex",gap:"4px",marginBottom:"8px",padding:"2px",backgroundColor:a.typeBadgeBg,borderRadius:"6px"},rangeToggleButton:{flex:1,padding:"4px 8px",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:500,backgroundColor:"transparent",color:t.text},rangeToggleButtonActive:{backgroundColor:t.background,boxShadow:"0 1px 2px rgba(0,0,0,0.1)"},quickOptions:{borderTop:`1px solid ${a.dropdownBorderColor}`,marginTop:"8px",paddingTop:"8px"},quickOption:{display:"block",width:"100%",textAlign:"left",padding:"4px 8px",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:"12px",color:t.dropdownSelected,borderRadius:"4px"}}}var XT={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function QT(t){const a=[];let l=0,s="";function o(){s&&(a.push({type:"text",text:s}),s="")}t.startsWith("/")&&(a.push({type:"delimiter",text:"/"}),l=1);const u=t.lastIndexOf("/"),f=u>0?u:t.length;for(;l<f;){const m=t[l];if(m==="\\"&&l+1<f){o(),a.push({type:"escape",text:t.slice(l,l+2)}),l+=2;continue}if(m==="["){o();let p=l+1;for(p<f&&t[p]==="^"&&p++,p<f&&t[p]==="]"&&p++;p<f&&t[p]!=="]";)t[p]==="\\"&&p+1<f&&p++,p++;p<f&&p++,a.push({type:"charClass",text:t.slice(l,p)}),l=p;continue}if(m==="("){o();let p="(";if(l+1<f&&t[l+1]==="?"){let g=l+2;for(;g<f&&g<l+4&&/[:<>=!]/.test(t[g]);)g++;p=t.slice(l,g)}a.push({type:"groupOpen",text:p}),l+=p.length;continue}if(m===")"){o(),a.push({type:"groupClose",text:")"}),l++;continue}if(m==="+"||m==="*"||m==="?"){o();let p=m;l+1<f&&t[l+1]==="?"&&(p+="?"),a.push({type:"quantifier",text:p}),l+=p.length;continue}if(m==="{"){o();let p=l+1;for(;p<f&&t[p]!=="}";)p++;p<f&&p++,a.push({type:"quantifier",text:t.slice(l,p)}),l=p;continue}if(m==="^"||m==="$"){o(),a.push({type:"anchor",text:m}),l++;continue}if(m==="|"){o(),a.push({type:"alternation",text:"|"}),l++;continue}s+=m,l++}return o(),u>0&&u<t.length&&a.push({type:"delimiter",text:"/"}),a}function KT(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ZT(t,a,l){const s=QT(t.value).map(o=>{const u=a[XT[o.type]]||a.regexText,f=o.type==="delimiter"?"600":"normal";return`<span class="ei-regex-part ei-regex-part--${o.type}" style="color:${u};font-weight:${f}">${KT(o.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--regex${l?" "+l:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${s}</span>`}var JT={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function WT(t){const a=[];let l=0;l<t.length&&(t[l]==="["||t[l]==="{")&&(a.push({type:"bracket",text:t[l]}),l++);const s=t.length-1,o=s>=0&&(t[s]==="]"||t[s]==="}"),u=o?s:t.length;for(;l<u;){const f=t[l];if(f===" "||f===" "){let p=l;for(;p<u&&(t[p]===" "||t[p]===" ");)p++;a.push({type:"whitespace",text:t.slice(l,p)}),l=p;continue}if((f==="T"||f==="t")&&l+1<u&&(t[l+1]==="O"||t[l+1]==="o")){const p=l===0||t[l-1]===" "||t[l-1]===" "||t[l-1]==="["||t[l-1]==="{",g=l+2>=u||t[l+2]===" "||t[l+2]===" ";if(p&&g){a.push({type:"toKeyword",text:t.slice(l,l+2)}),l+=2;continue}}if(f==='"'){let p=l+1;for(;p<u&&t[p]!=='"';)t[p]==="\\"&&p+1<u&&p++,p++;p<u&&p++,a.push({type:"quotedValue",text:t.slice(l,p)}),l=p;continue}if(f==="*"){a.push({type:"wildcard",text:"*"}),l++;continue}let m=l;for(;m<u&&t[m]!==" "&&t[m]!==" "&&t[m]!=='"';)m++;if(m>l){const p=t.slice(l,m);a.push({type:"bareValue",text:p}),l=m}else a.push({type:"bareValue",text:f}),l++}return o&&a.push({type:"bracket",text:t[s]}),a}function Mx(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function eC(t,a,l){const s=WT(t.value).map(o=>{if(o.type==="whitespace")return Mx(o.text);const u=a[JT[o.type]]||a.fieldValue,f=o.type==="toKeyword"||o.type==="bracket"?"600":"normal";return`<span class="ei-range-part ei-range-part--${o.type}" style="color:${u};font-weight:${f}">${Mx(o.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--range${l?" "+l:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${s}</span>`}function H0(t,a){if(a<0)return null;const l=t.filter(u=>u.type===O.LPAREN||u.type===O.RPAREN);if(l.length===0)return null;const s=l.find(u=>u.end===a);if(s){const u=_x(l,s);if(u)return u}const o=l.find(u=>u.start===a);if(o){const u=_x(l,o);if(u)return u}return null}function _x(t,a){if(a.type===O.LPAREN){const l=t.indexOf(a);let s=0;for(let o=l;o<t.length;o++)if(t[o].type===O.LPAREN?s++:t[o].type===O.RPAREN&&s--,s===0)return{openStart:a.start,closeStart:t[o].start}}else{const l=t.indexOf(a);let s=0;for(let o=l;o>=0;o--)if(t[o].type===O.RPAREN?s++:t[o].type===O.LPAREN&&s--,s===0)return{openStart:t[o].start,closeStart:a.start}}return null}var tC={[O.FIELD_NAME]:"field-name",[O.COLON]:"colon",[O.VALUE]:"value",[O.QUOTED_VALUE]:"quoted-value",[O.AND]:"and",[O.OR]:"or",[O.NOT]:"not",[O.COMPARISON_OP]:"comparison-op",[O.LPAREN]:"lparen",[O.RPAREN]:"rparen",[O.SAVED_SEARCH]:"saved-search",[O.HISTORY_REF]:"history-ref",[O.PREFIX_OP]:"prefix-op",[O.WILDCARD]:"wildcard",[O.REGEX]:"regex",[O.RANGE]:"range",[O.TILDE]:"tilde",[O.BOOST]:"boost",[O.WHITESPACE]:"whitespace",[O.UNKNOWN]:"unknown"},nC={[O.FIELD_NAME]:"fieldName",[O.COLON]:"operator",[O.VALUE]:"fieldValue",[O.QUOTED_VALUE]:"quoted",[O.AND]:"booleanOp",[O.OR]:"booleanOp",[O.NOT]:"booleanOp",[O.COMPARISON_OP]:"operator",[O.LPAREN]:"paren",[O.RPAREN]:"paren",[O.SAVED_SEARCH]:"savedSearch",[O.HISTORY_REF]:"historyRef",[O.PREFIX_OP]:"operator",[O.WILDCARD]:"wildcard",[O.REGEX]:"quoted",[O.RANGE]:"fieldValue",[O.TILDE]:"operator",[O.BOOST]:"operator",[O.WHITESPACE]:"text",[O.UNKNOWN]:"error"};function ni(t,a,l){const s=Zo(a);if(t.length===0)return"";const o=(l==null?void 0:l.cursorOffset)!==void 0?H0(t,l.cursorOffset):null,u=a==null?void 0:a.valueTypes,f=l==null?void 0:l.fieldTypeMap;let m;if(u&&f){m=new Array(t.length);let g,x=!1;const y=[];for(let N=0;N<t.length;N++){const w=t[N];w.type===O.FIELD_NAME?(g=w.value,x=!1):w.type===O.COLON&&g?x=!0:w.type===O.WHITESPACE||(w.type===O.LPAREN?(x&&g?y.push(f.get(g.toLowerCase())):y.push(void 0),g=void 0,x=!1):w.type===O.RPAREN?(y.pop(),g=void 0,x=!1):w.type===O.VALUE||w.type===O.QUOTED_VALUE||w.type===O.RANGE||w.type===O.REGEX||w.type===O.WILDCARD?(x&&g?m[N]=f.get(g.toLowerCase()):y.length>0&&(m[N]=y[y.length-1]),g=void 0,x=!1):(w.type===O.AND||w.type===O.OR||(w.type,O.NOT),g=void 0,x=!1))}}let p=t.map((g,x)=>{let y=s[nC[g.type]||"text"]||s.text;if(u&&m){const A=m[x];A&&u[A]&&(y=u[A])}const N=aC(g.value);if(g.type===O.WHITESPACE)return N.replace(/\n/g,"<br>");if(g.type===O.REGEX)return ZT(g,s,l==null?void 0:l.tokenClassName);if(g.type===O.RANGE)return eC(g,s,l==null?void 0:l.tokenClassName);let w="normal";(g.type===O.AND||g.type===O.OR||g.type===O.NOT)&&(w="600"),g.type===O.FIELD_NAME&&(w="500");let S="";return o&&(g.type===O.LPAREN||g.type===O.RPAREN)&&(g.start===o.openStart||g.start===o.closeStart)&&(w="700",S=`background-color:${s.matchedParenBg};border-radius:2px;`),`<span class="${`ei-token ei-token--${tC[g.type]}${l!=null&&l.tokenClassName?" "+l.tokenClassName:""}`}" style="color:${y};font-weight:${w};${S}" data-token-start="${g.start}" data-token-end="${g.end}">${N}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function aC(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}if(typeof document<"u"){const t="elastic-input-keyframes";if(!document.getElementById(t)){const a=document.createElement("style");a.id=t,a.textContent="@keyframes elastic-input-spin { to { transform: rotate(360deg); } }",document.head.appendChild(a)}}function Lx(t,a,l){if(!a||a.length===0)return t;const s=t.toLowerCase(),o=a.toLowerCase(),u=s.indexOf(o);if(u===-1)return t;const f=t.slice(0,u),m=t.slice(u,u+a.length),p=t.slice(u+a.length),g={fontWeight:700,textDecoration:"underline",textDecorationColor:l?"rgba(255,255,255,0.6)":"#0969da",textUnderlineOffset:"2px"};return v.createElement(v.Fragment,null,f,v.createElement("span",{className:"ei-highlight-match",style:g},m),p)}function rC({suggestions:t,selectedIndex:a,onSelect:l,position:s,colors:o,styles:u,visible:f,fixedWidth:m,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:x,cursorContext:y,listRefCallback:N,renderType:w,classNames:S}){const A=v.useRef(null),R=v.useRef(null);v.useEffect(()=>{const z=document.createElement("div");return document.body.appendChild(z),A.current=z,()=>{document.body.removeChild(z),A.current=null}},[]);const L=x&&y?x(y):null,I=L!=null;if(v.useEffect(()=>{if(R.current){const z=I?a+1:a,T=R.current.children[z];T&&T.scrollIntoView({block:"nearest"})}},[a,I]),!A.current||!f||t.length===0||!s)return null;const q=Zo(o),X=Jo(u),W={...B0(q,X),top:`${s.top}px`,left:`${s.left}px`,...m!=null?{width:`${m}px`,minWidth:"unset",maxWidth:"unset"}:{}},ae=v.createElement("div",{className:za("ei-dropdown",S==null?void 0:S.dropdown),style:W,ref:z=>{R.current=z,N==null||N(z)},onMouseDown:z=>z.preventDefault()},I&&v.createElement("div",{className:za("ei-dropdown-header",S==null?void 0:S.dropdownHeader),style:{padding:X.dropdownItemPadding||"4px 10px",fontSize:"11px",color:q.placeholder,borderBottom:`1px solid ${q.dropdownHover}`,userSelect:"none"}},L),t.map((z,T)=>{const ee=T===a,fe=Ox(ee,q,X),be=(U,B,ue)=>({key:T,className:za("ei-dropdown-item",U,ee&&"ei-dropdown-item--selected",S==null?void 0:S.dropdownItem),style:{...fe,...B},title:ue,onClick:()=>l(z),onMouseEnter:de=>{de.currentTarget.style.backgroundColor=ee?q.dropdownSelected:q.dropdownHover},onMouseLeave:de=>{de.currentTarget.style.backgroundColor=ee?q.dropdownSelected:"transparent"}}),ye=U=>{if(w===!1||!z.type||z.type==="hint")return null;const B=typeof w=="function"?w(z.type,{text:z.text,label:z.label,description:z.description,type:z.type}):z.type;return B!=null?v.createElement("span",{className:"ei-dropdown-item-type",style:{...PT(ee,X),...U}},B):null},te={flexDirection:"column",alignItems:"flex-start"},re={display:"flex",alignItems:"center",gap:X.dropdownItemContentGap,width:"100%"};if(z.type==="hint"&&(z.text==="#"||z.text==="!"))return v.createElement("div",{...be("ei-dropdown-item--hint",{opacity:ee?1:.7}),onMouseEnter:U=>{U.currentTarget.style.backgroundColor=ee?q.dropdownSelected:q.dropdownHover,U.currentTarget.style.opacity="1"},onMouseLeave:U=>{U.currentTarget.style.backgroundColor=ee?q.dropdownSelected:"transparent",U.currentTarget.style.opacity=ee?"1":"0.7"}},v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},z.label),z.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:Lh()},z.description));if(z.type==="error")return v.createElement("div",{key:T,className:za("ei-dropdown-item","ei-dropdown-item--error",S==null?void 0:S.dropdownItem),style:{...fe,cursor:"default",opacity:.8}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),color:q.error}},z.label||"Error loading suggestions"));if(z.type==="noResults")return v.createElement("div",{key:T,className:za("ei-dropdown-item","ei-dropdown-item--no-results",S==null?void 0:S.dropdownItem),style:{...fe,cursor:"default",opacity:.7}},z.customContent);if(z.type==="loading")return v.createElement("div",{key:T,className:za("ei-dropdown-item","ei-dropdown-item--loading",S==null?void 0:S.dropdownItem),style:{...fe,cursor:"default",opacity:.6,justifyContent:"center"}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),fontStyle:"italic"}},z.label||"Searching..."),v.createElement("span",{className:"ei-dropdown-spinner",style:{marginLeft:"6px",display:"inline-block",animation:"elastic-input-spin 1s linear infinite",width:"14px",height:"14px",border:"2px solid",borderColor:`${q.placeholder} transparent ${q.placeholder} transparent`,borderRadius:"50%"}}));if(z.type==="hint"){const U=Ox(!1,q,X);return v.createElement("div",{key:T,className:za("ei-dropdown-item","ei-dropdown-item--hint",S==null?void 0:S.dropdownItem),style:{...U,cursor:"default",opacity:z.customContent?1:.6}},z.customContent?z.customContent:v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},z.label))}if(z.type==="history"&&p&&z.sourceData){const U=p(z.sourceData,ee);if(U!=null)return v.createElement("div",be("ei-dropdown-item--history",te),U)}if(z.type==="savedSearch"&&g&&z.sourceData){const U=g(z.sourceData,ee);if(U!=null)return v.createElement("div",be("ei-dropdown-item--saved-search"),U)}if((z.type==="history"||z.type==="savedSearch")&&z.description!=null){const U=z.type==="history"?"ei-dropdown-item--history":"ei-dropdown-item--saved-search";let B;const ue=z.text.startsWith("(")&&z.text.endsWith(")")?z.text.slice(1,-1):z.text;return z.label!==ue&&(B=z.text),v.createElement("div",be(U,te,B),v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},Lx(z.label,z.matchPartial,ee)),v.createElement("span",{style:re},v.createElement("span",{className:"ei-dropdown-item-desc",style:{...Lh(),flex:1}},z.description),ye({marginLeft:"auto"})))}const ge=z.type==="savedSearch"?"ei-dropdown-item--saved-search":void 0;return v.createElement("div",be(ge),v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},Lx(z.label,z.matchPartial,ee)),z.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:Lh()},z.description),ye())}));return rl.createPortal(ae,A.current)}var lC=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function zh(t){return Math.floor(t/10)*10}function sC({onSelect:t,colors:a,styles:l,initialMode:s,initialStart:o,initialEnd:u,presets:f,className:m}){const p=s==="range"&&u?u:o??new Date,[g,x]=v.useState(s??"single"),[y,N]=v.useState("days"),[w,S]=v.useState(p.getFullYear()),[A,R]=v.useState(p.getMonth()),[L,I]=v.useState(o??null),[q,X]=v.useState(u??null),[W,ae]=v.useState(null),z=Zo(a),T=GT(z,Jo(l)),ee=()=>{y==="days"?A===0?(R(11),S(oe=>oe-1)):R(oe=>oe-1):S(y==="months"?oe=>oe-1:oe=>oe-10)},fe=()=>{y==="days"?A===11?(R(0),S(oe=>oe+1)):R(oe=>oe+1):S(y==="months"?oe=>oe+1:oe=>oe+10)},be=()=>{S(y==="days"?oe=>oe-1:y==="months"?oe=>oe-10:oe=>oe-100)},ye=()=>{S(y==="days"?oe=>oe+1:y==="months"?oe=>oe+10:oe=>oe+100)},te=()=>{y==="days"?N("months"):y==="months"&&N("years")},re=oe=>{R(oe),N("days")},ge=oe=>{S(oe),N("months")},U=oe=>{if(g==="single"){t(Mh(oe));return}if(!L||q)I(oe),X(null),ae(null);else{const[$e,at]=L<=oe?[L,oe]:[oe,L];I($e),X(at),ae(null),t(`[${Mh($e)} TO ${Mh(at)}]`)}},B=L&&!q?W:q,ue=oe=>{x(oe),I(null),X(null),ae(null)},de=y==="days"?`${qT(A)} ${w}`:y==="months"?`${w}`:`${zh(w)}–${zh(w)+9}`,we=y!=="years",C=new Date,V=Ax(w,A),ne=HT(w,A),me=["Su","Mo","Tu","We","Th","Fr","Sa"],Ne=[],je=(oe,$e,at)=>{const Ut=yo(oe,C),pn=L&&yo(oe,L),jt=B&&yo(oe,B),_t=Dx(oe,L,B),Qt=pn||jt,Hn={...T.day,...at?T.dayOtherMonth:{},...Ut?T.dayToday:{},..._t?T.dayInRange:{},...Qt?T.daySelected:{}},$n=g==="range"&&L&&!q;return v.createElement("button",{key:$e,className:"ei-datepicker-day",style:Hn,onClick:()=>U(oe),onMouseEnter:tn=>{$n?ae(oe):Qt||(tn.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:tn=>{!$n&&!Qt&&(tn.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},oe.getDate())};if(ne>0){const oe=Ax(w,A-1);for(let $e=ne-1;$e>=0;$e--){const at=oe-$e,Ut=new Date(w,A-1,at);Ne.push(je(Ut,`prev${at}`,!0))}}for(let oe=1;oe<=V;oe++){const $e=new Date(w,A,oe);Ne.push(je($e,String(oe),!1))}const ze=Ne.length%7;if(ze>0){const oe=7-ze;for(let $e=1;$e<=oe;$e++){const at=new Date(w,A+1,$e);Ne.push(je(at,`next${$e}`,!0))}}const ut={...T.day,padding:"10px 4px",fontSize:"13px"},Ge={...ut,...T.dayToday},nt=f??[{label:"Today",value:"[now/d TO now]",type:"range"},{label:"Yesterday",value:"[now-1d/d TO now/d]",type:"range"},{label:"Last 7 days",value:"[now-7d TO now]",type:"range"},{label:"Last 30 days",value:"[now-30d TO now]",type:"range"},{label:"Last 90 days",value:"[now-90d TO now]",type:"range"},{label:"Last 1 year",value:"[now-365d TO now]",type:"range"}],Sn={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},Xt=oe=>{oe.currentTarget.style.backgroundColor="#eef1f5"},ft=oe=>{oe.currentTarget.style.backgroundColor="transparent"};return v.createElement("div",{className:za("ei-datepicker",m),style:T.container,onMouseDown:oe=>oe.preventDefault(),onMouseLeave:()=>ae(null)},v.createElement("div",{className:"ei-datepicker-toggle",style:T.rangeToggle},["single","range"].map(oe=>v.createElement("button",{key:oe,style:{...T.rangeToggleButton,...g===oe?T.rangeToggleButtonActive:{}},onClick:()=>ue(oe)},oe.charAt(0).toUpperCase()+oe.slice(1)))),v.createElement("div",{className:"ei-datepicker-header",style:T.header},v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:be,onMouseEnter:Xt,onMouseLeave:ft},"«"),v.createElement("button",{style:T.navButton,onClick:ee,onMouseEnter:Xt,onMouseLeave:ft},"‹")),v.createElement("button",{style:{...T.monthLabel,backgroundColor:"transparent",border:"none",cursor:we?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:we?te:void 0,onMouseEnter:oe=>{we&&(oe.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:oe=>{oe.currentTarget.style.backgroundColor="transparent"}},de),v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:fe,onMouseEnter:Xt,onMouseLeave:ft},"›"),v.createElement("button",{style:T.navButton,onClick:ye,onMouseEnter:Xt,onMouseLeave:ft},"»"))),y==="days"&&v.createElement(v.Fragment,null,v.createElement("div",{style:T.weekDays},me.map(oe=>v.createElement("div",{key:oe,style:T.weekDay},oe))),v.createElement("div",{className:"ei-datepicker-days",style:T.days},Ne)),y==="months"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},lC.map((oe,$e)=>{const at=new Date(w,$e,1),Ut=Dx(at,L,B),pn=L&&yo(new Date(L.getFullYear(),L.getMonth(),1),at)||B&&yo(new Date(B.getFullYear(),B.getMonth(),1),at),jt=$e===C.getMonth()&&w===C.getFullYear(),_t=g==="range"&&L&&!q;return v.createElement("button",{key:oe,style:{...jt?Ge:ut,...Ut?T.dayInRange:{},...pn?T.daySelected:{}},onClick:()=>re($e),onMouseEnter:Qt=>{_t?ae(at):pn||(Qt.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:Qt=>{!_t&&!pn&&(Qt.currentTarget.style.backgroundColor=Ut?"rgba(9, 105, 218, 0.1)":"transparent")}},oe)})),y==="years"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(oe,$e)=>{const at=zh(w)-1+$e,Ut=$e===0||$e===11,pn=at===C.getFullYear(),jt=new Date(at,0,1),_t=L&&B&&at>=Math.min(L.getFullYear(),B.getFullYear())&&at<=Math.max(L.getFullYear(),B.getFullYear()),Qt=L&&L.getFullYear()===at||B&&B.getFullYear()===at,Hn=g==="range"&&L&&!q;return v.createElement("button",{key:at,style:{...pn?Ge:ut,...Ut?T.dayOtherMonth:{},..._t?T.dayInRange:{},...Qt?T.daySelected:{}},onClick:()=>ge(at),onMouseEnter:$n=>{Hn?ae(jt):Qt||($n.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:$n=>{!Hn&&!Qt&&($n.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},at)})),(()=>{const oe=nt.filter($e=>!$e.type||$e.type===g);return oe.length>0&&v.createElement("div",{className:"ei-datepicker-presets",style:{...T.quickOptions,...Sn}},oe.map($e=>v.createElement("button",{key:`${$e.type??"both"}-${$e.value}`,style:T.quickOption,onClick:()=>t($e.value)},$e.label)))})())}var iC=30,oC=150;function zx(t,a){let l=0;const s=o=>{if(o.nodeType===Node.TEXT_NODE){const u=(o.textContent||"").length;return l+u>=a?{node:o,offset:a-l}:(l+=u,null)}if(o.nodeName==="BR"){if(l+1>=a){const u=o.parentNode;if(u)return{node:u,offset:Array.from(u.childNodes).indexOf(o)+1}}return l+=1,null}for(let u=0;u<o.childNodes.length;u++){const f=s(o.childNodes[u]);if(f)return f}return null};return s(t)}function uC(t,a,l){const s=zx(t,a),o=zx(t,l);if(!s||!o)return[];const u=document.createRange();u.setStart(s.node,s.offset),u.setEnd(o.node,o.offset);const f=t.getBoundingClientRect(),m=u.getClientRects();if(m.length===0)return[];const p=[];for(let g=0;g<m.length;g++){const x=m[g];x.width<1||p.push({left:x.left-f.left,top:x.top-f.top,width:Math.max(x.width,6),height:x.height})}return p}function cC(t,a,l){if(!a||t.length===0)return[];const s=[];let o=0;for(const u of t){if(o>=iC)break;if(l>=u.start&&l<=u.end)continue;const f=uC(a,u.start,u.end);for(const m of f)s.push({left:m.left,top:m.top,width:m.width,height:m.height,error:u});o++}return s}var Ux=28,Bx=4;function dC(t){return`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath d='M0 2 Q2 0 4 2 Q6 4 8 2' stroke='${t.replace("#","%23")}' fill='none' stroke-width='0.8'/%3E%3C/svg%3E")`}function fC({errors:t,editorRef:a,cursorOffset:l,colors:s,styles:o,containerRef:u,classNames:f}){const[m,p]=v.useState(null),[g,x]=v.useState({x:0,clientY:0}),[y,N]=v.useState([]),w=v.useRef([]),S=v.useRef(null),A=v.useRef(null);if(v.useEffect(()=>{if(A.current&&clearTimeout(A.current),t.length===0){N([]),w.current=[],p(null);return}return A.current=setTimeout(()=>{const q=cC(t,a,l);N(q),w.current=q},oC),()=>{A.current&&clearTimeout(A.current)}},[t,a,l]),v.useEffect(()=>{const q=u;if(!q||!a)return;const X=z=>{const T=a.getBoundingClientRect(),ee=z.clientX-T.left,fe=z.clientY-T.top;let be=-1;for(let ye=0;ye<w.current.length;ye++){const te=w.current[ye];if(ee>=te.left&&ee<=te.left+te.width&&fe>=te.top&&fe<=te.top+te.height+6){be=ye;break}}be>=0?(p(be),x({x:ee,clientY:z.clientY})):p(null)},W=()=>{p(null)},ae=new AbortController;return q.addEventListener("mousemove",X,{signal:ae.signal}),q.addEventListener("mouseleave",W,{signal:ae.signal}),()=>ae.abort()},[u,a]),v.useEffect(()=>{const q=S.current;if(!q||m==null)return;const X=q.getBoundingClientRect();if(X.right>window.innerWidth-8){const W=X.right-window.innerWidth+8;q.style.transform=`translateX(-${W}px)`}else q.style.transform=""}),y.length===0)return null;const R=Zo(s),L=Jo(o),I=m!=null?y[m]:null;return v.createElement(v.Fragment,null,y.map((q,X)=>{const W=q.error.severity==="warning",ae=dC(W?R.warning:R.error),z=q.top+q.height-2;return v.createElement("div",{key:`wave-${X}`,className:za("ei-squiggly",W?"ei-squiggly--warning":"ei-squiggly--error",f==null?void 0:f.squiggly),style:{position:"absolute",left:`${q.left}px`,top:`${z}px`,width:`${q.width}px`,height:"4px",zIndex:1,backgroundImage:ae,backgroundRepeat:"repeat-x",backgroundPosition:"left top",backgroundSize:"auto 4px",pointerEvents:"none"}})}),I!=null&&(()=>{const q=I.error.severity==="warning"?R.warning:R.error,X=a==null?void 0:a.getBoundingClientRect(),W=((X==null?void 0:X.left)??0)+g.x,ae=((X==null?void 0:X.top)??0)+I.top+I.height+2,z=((X==null?void 0:X.top)??0)+I.top,T=window.innerHeight-g.clientY<Ux+20?z-Ux-Bx:ae+Bx;return rl.createPortal(v.createElement("div",{ref:S,className:za("ei-tooltip",f==null?void 0:f.tooltip),style:{position:"fixed",top:`${T}px`,left:`${W}px`,zIndex:L.dropdownZIndex,backgroundColor:R.background,color:q,border:`1px solid ${q}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",fontFamily:L.fontFamily,lineHeight:"1.4",whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",maxWidth:"90vw"}},I.error.message),document.body)})())}function Lo(t,a,l){let s=0,o=!1;function u(f){var m;if(o)return!0;if(f===a){if(f.nodeType===Node.TEXT_NODE)s+=l;else for(let p=0;p<l&&p<f.childNodes.length;p++)if(u(f.childNodes[p]))return!0;return o=!0,!0}if(f.nodeType===Node.TEXT_NODE)return s+=(f.textContent||"").length,!1;if(f.nodeName==="BR")return(m=f.hasAttribute)!=null&&m.call(f,"data-sentinel")||(s+=1),!1;for(let p=0;p<f.childNodes.length;p++)if(u(f.childNodes[p]))return!0;return!1}return u(t),s}function Ol(t){const a=window.getSelection();if(!a||a.rangeCount===0)return 0;const l=a.getRangeAt(0);return Lo(t,l.startContainer,l.startOffset)}function Rr(t){const a=window.getSelection();if(!a||a.rangeCount===0)return{start:0,end:0};const l=a.getRangeAt(0);return{start:Lo(t,l.startContainer,l.startOffset),end:Lo(t,l.endContainer,l.endOffset)}}function al(t,a){const l=window.getSelection();if(!l)return;const s=Jh(t,a);if(!s)return;const o=document.createRange();o.setStart(s.node,s.offset),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}function nl(t,a,l){if(a===l){al(t,a);return}const s=window.getSelection();if(!s)return;const o=Jh(t,a),u=Jh(t,l);if(!o||!u)return;const f=document.createRange();f.setStart(o.node,o.offset),f.setEnd(u.node,u.offset),s.removeAllRanges(),s.addRange(f)}function Jh(t,a){let l=0;function s(f){var m;if(f.nodeType===Node.TEXT_NODE){const p=(f.textContent||"").length;return l+p>=a?{node:f,offset:a-l}:(l+=p,null)}if(f.nodeName==="BR"){if((m=f.hasAttribute)!=null&&m.call(f,"data-sentinel"))return null;if(l+1>=a){const p=f.parentNode;if(p)return{node:p,offset:Array.from(p.childNodes).indexOf(f)+1}}return l+=1,null}for(let p=0;p<f.childNodes.length;p++){const g=s(f.childNodes[p]);if(g)return g}return null}const o=s(t);if(o)return o;const u=$0(t);return u?{node:u,offset:(u.textContent||"").length}:{node:t,offset:0}}function $0(t){if(t.nodeType===Node.TEXT_NODE)return t;for(let a=t.childNodes.length-1;a>=0;a--){const l=$0(t.childNodes[a]);if(l)return l}return null}function hC(t){const a=window.getSelection();if(!a||a.rangeCount===0)return;const l=a.getRangeAt(0);l.deleteContents();const s=document.createTextNode(t);l.insertNode(s),l.setStartAfter(s),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}function mC(){const t=window.getSelection();if(!t||t.rangeCount===0)return;const a=t.getRangeAt(0);a.deleteContents();const l=document.createElement("br");a.insertNode(l),a.setStartAfter(l),a.collapse(!0),t.removeAllRanges(),t.addRange(a)}function xc(t){var m;const a=window.getSelection();if(!a||a.rangeCount===0)return;const l=a.getRangeAt(0);let s=l.getBoundingClientRect();if(s.width===0&&s.height===0){const p=document.createElement("span");p.textContent="​",l.insertNode(p),s=p.getBoundingClientRect(),(m=p.parentNode)==null||m.removeChild(p),a.removeAllRanges(),a.addRange(l)}const o=t.getBoundingClientRect(),u=s.top-o.top+t.scrollTop,f=s.bottom-o.top+t.scrollTop;f>t.scrollTop+t.clientHeight?t.scrollTop=f-t.clientHeight:u<t.scrollTop&&(t.scrollTop=u)}function Uh(){var s,o;const t=window.getSelection();if(!t||t.rangeCount===0)return null;const a=t.getRangeAt(0),l=a.getBoundingClientRect();if(l.width===0&&l.height===0||a.collapsed&&a.startContainer.nodeType===Node.ELEMENT_NODE&&a.startOffset>0&&((s=a.startContainer.childNodes[a.startOffset-1])==null?void 0:s.nodeName)==="BR"){const u=document.createElement("span");u.textContent="​",a.insertNode(u);const f=u.getBoundingClientRect();return(o=u.parentNode)==null||o.removeChild(u),t.removeAllRanges(),t.addRange(a),f}return l}function Hx(t,a){return Math.min(t,a)}function Bh(t,a,l){const s=window.innerHeight,o=window.innerWidth;let u=t.bottom+window.scrollY+4,f=t.left+window.scrollX;return t.bottom+a+4>s&&(u=t.top+window.scrollY-a-4),f+l>o&&(f=o-l-8),f<8&&(f=8),{top:u,left:f}}var pC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD]);function gC(t,a,l){for(const s of t)if(a>=s.start&&a<=s.end&&pC.has(s.type))return a===s.start&&l===s.end?null:{start:s.start,end:s.end};return null}var vC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD,O.FIELD_NAME,O.RANGE,O.SAVED_SEARCH,O.HISTORY_REF,O.REGEX]);function yC(t,a,l){const s=[];for(const o of a)if(l>=o.start&&l<=o.end&&vC.has(o.type)){s.push({start:o.start,end:o.end});break}return t&&Rc(t,l,s),xC(s)}function Rc(t,a,l){if(a<t.start||a>t.end)return!1;let s=!1;switch(t.type){case"BooleanExpr":s=Rc(t.left,a,l)||s,s=Rc(t.right,a,l)||s;break;case"Group":case"Not":case"FieldGroup":s=Rc(t.expression,a,l)||s;break}return l.push({start:t.start,end:t.end}),!0}function xC(t){t.sort((l,s)=>l.end-l.start-(s.end-s.start)||l.start-s.start);const a=[];for(const l of t){const s=a[a.length-1];s&&s.start===l.start&&s.end===l.end||a.push(l)}return a}var bC=60,SC=" ";function wC(t,a){const l=(a==null?void 0:a.maxLineLength)??bC,s=(a==null?void 0:a.indent)??SC,o={whitespace:a==null?void 0:a.whitespaceOperator,and:a==null?void 0:a.andOperator,or:a==null?void 0:a.orOperator,not:a==null?void 0:a.notOperator};let u;return typeof t=="string"?u=new ms(new ui(t,{savedSearches:!0,historySearch:!0}).tokenize()).parse():u=t,u?Tc(u,0,l,s,o):""}function EC(t,a){return t.implicit?a.whitespace??"":t.operator==="AND"?a.and??t.sourceOperator??"AND":a.or??t.sourceOperator??"OR"}function q0(t,a){const l=a.not??t.sourceOperator??"NOT";return{op:l,sep:/^[a-zA-Z]/.test(l)?" ":""}}function Tr(t,a){switch(t.type){case"FieldValue":{const l=t.quoted?`"${t.value}"`:t.value,s=t.operator===":"?":":`:${t.operator}`;let o=`${t.field}${s}${l}`;return t.fuzzy!=null&&(o+=`~${t.fuzzy}`),t.proximity!=null&&(o+=`~${t.proximity}`),t.boost!=null&&(o+=`^${t.boost}`),o}case"BareTerm":{let l=t.quoted?`"${t.value}"`:t.value;return t.fuzzy!=null&&(l+=`~${t.fuzzy}`),t.proximity!=null&&(l+=`~${t.proximity}`),t.boost!=null&&(l+=`^${t.boost}`),l}case"Range":{const l=t.lowerInclusive?"[":"{",s=t.upperInclusive?"]":"}",o=`${l}${t.lowerQuoted?`"${t.lower}"`:t.lower} TO ${t.upperQuoted?`"${t.upper}"`:t.upper}${s}`;return t.field?`${t.field}:${o}`:o}case"Regex":return`/${t.pattern}/`;case"SavedSearch":return`#${t.name}`;case"HistoryRef":return`!${t.ref}`;case"Not":{const{op:l,sep:s}=q0(t,a);return`${l}${s}${Tr(t.expression,a)}`}case"Group":{let l=`(${Tr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"FieldGroup":{let l=`${t.field}:(${Tr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"BooleanExpr":{const l=EC(t,a),s=l?` ${l} `:" ";return`${Tr(t.left,a)}${s}${Tr(t.right,a)}`}case"Error":return t.value}}function NC(t){const a=t.operator,l=!!t.implicit,s=[],o=u=>{u.type==="BooleanExpr"&&u.operator===a&&!!u.implicit===l?(o(u.left),o(u.right)):s.push(u)};return o(t),{operator:a,implicit:l,sourceOperator:t.sourceOperator,operands:s}}function jc(t){return t.type==="Group"||t.type==="FieldGroup"?!0:t.type==="BooleanExpr"?jc(t.left)||jc(t.right):t.type==="Not"?jc(t.expression):!1}var RC={and:"AND",or:"OR",not:"NOT"};function jC(t,a){return!!(Tr(t,RC).length>a||jc(t))}function Tc(t,a,l,s,o){const u=s.repeat(a);switch(t.type){case"BooleanExpr":{const{operator:f,implicit:m,sourceOperator:p,operands:g}=NC(t),x=m?o.whitespace??"":f==="AND"?o.and??p??"AND":o.or??p??"OR",y=x?` ${x} `:" ",N=g.map(w=>Tr(w,o)).join(y);return N.length<=l?N:g.map((w,S)=>{const A=Tc(w,a,l,s,o);return S===0?A:x?`${u}${x} ${A}`:`${u}${A}`}).join(`
283
+ `)}case"Group":{if(!jC(t.expression,l)){let m=`(${Tr(t.expression,o)})`;return t.boost!=null&&(m+=`^${t.boost}`),m}let f=`(
284
+ ${TC(Tc(t.expression,a+1,l,s,o),a+1,s)}
285
+ ${u})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"FieldGroup":{let f=`${t.field}:(${Tr(t.expression,o)})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"Not":{const{op:f,sep:m}=q0(t,o);return`${f}${m}${Tc(t.expression,a,l,s,o)}`}default:return Tr(t,o)}}function TC(t,a,l){const s=l.repeat(a);return t.split(`
286
+ `).map(o=>o.startsWith(s)?o:s+o).join(`
287
+ `)}function CC(t){return t?Do(t):[]}function $x(t){return t.type==="BooleanExpr"}function Do(t){switch(t.type){case"BooleanExpr":return Wh(t);case"Group":{const a=[],l=t.expression;return $x(l)?(a.push({start:t.start,end:t.end}),a.push(...Do(l)),a.push({start:t.start,end:t.end})):a.push({start:t.start,end:t.end}),a}case"FieldGroup":{const a=[];a.push({start:t.start,end:t.end});const l=t.expression;return $x(l)&&a.push(...Do(l)),a}case"Not":{const a=[];return a.push({start:t.start,end:t.end}),a.push(...Do(t.expression)),a}case"FieldValue":case"BareTerm":case"SavedSearch":case"HistoryRef":case"Regex":case"Range":case"Error":return[{start:t.start,end:t.end}]}}function Wh(t){return t.type==="BooleanExpr"?[...Wh(t.left),...Wh(t.right)]:Do(t)}function AC(t,a,l,s){if(t.length===0)return null;if(a>=0&&a<t.length){const o=s==="forward"?a+1:a-1;return o>=0&&o<t.length?{stop:t[o],index:o}:null}if(s==="forward"){for(let o=0;o<t.length;o++)if(t[o].start>=l)return{stop:t[o],index:o};return{stop:t[t.length-1],index:t.length-1}}else{for(let o=t.length-1;o>=0;o--)if(t[o].end<=l)return{stop:t[o],index:o};return{stop:t[0],index:0}}}var DC=class{constructor(t=100){hn(this,"stack",[]);hn(this,"index",-1);hn(this,"maxSize");this.maxSize=t}push(t){if(this.index>=0&&this.stack[this.index].value===t.value){this.stack[this.index].cursorPos=t.cursorPos;return}this.stack=this.stack.slice(0,this.index+1),this.stack.push(t),this.stack.length>this.maxSize&&this.stack.shift(),this.index=this.stack.length-1}replaceCurrent(t){this.index>=0?this.stack[this.index]=t:this.push(t)}undo(){return this.index<=0?null:(this.index--,this.stack[this.index])}redo(){return this.index>=this.stack.length-1?null:(this.index++,this.stack[this.index])}canUndo(){return this.index>0}canRedo(){return this.index<this.stack.length-1}current(){return this.index>=0?this.stack[this.index]:null}clear(){this.stack=[],this.index=-1}get length(){return this.stack.length}};function kC(t,a){const l=s=>(a==null?void 0:a(s))??BT(s);if(t.type==="RANGE"&&t.token){const s=t.token.value,o=(s.endsWith("]")||s.endsWith("}")?s.slice(1,-1):s.slice(1)).match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/);if(o)return{mode:"range",start:l(o[1].trim()),end:l(o[2].trim())}}if(t.type==="FIELD_VALUE"&&t.partial){const s=l(t.partial);if(s)return{mode:"single",start:s,end:null}}return null}function OC(t,a){var l,s,o,u;return((t==null?void 0:t.mode)??"single")!==((a==null?void 0:a.mode)??"single")||(((l=t==null?void 0:t.start)==null?void 0:l.getTime())??0)!==(((s=a==null?void 0:a.start)==null?void 0:s.getTime())??0)?!0:(((o=t==null?void 0:t.end)==null?void 0:o.getTime())??0)!==(((u=a==null?void 0:a.end)==null?void 0:u.getTime())??0)}function MC({position:t,colors:a,onSelect:l,colorConfig:s,styleConfig:o,datePickerInit:u,fixedWidth:f,datePresets:m,datePickerClassName:p}){const g=v.useRef(null),[x,y]=v.useState(!1);if(v.useEffect(()=>{const S=document.createElement("div");return document.body.appendChild(S),g.current=S,y(!0),()=>{document.body.removeChild(S),g.current=null}},[]),!x||!g.current)return null;const N=Jo(o),w={position:"absolute",zIndex:N.dropdownZIndex,...B0(a,N),top:`${t.top}px`,left:`${t.left}px`,maxHeight:"none",overflowY:"visible",...f!=null?{width:`${f}px`,minWidth:"unset",maxWidth:"unset"}:{}};return rl.createPortal(v.createElement("div",{className:"ei-datepicker-portal",style:w,onMouseDown:S=>S.preventDefault()},v.createElement(sC,{onSelect:l,colors:s,styles:o,initialMode:u==null?void 0:u.mode,initialStart:u==null?void 0:u.start,initialEnd:u==null?void 0:u.end,presets:m,className:p})),g.current)}function _C(t){const{fields:a,onSearch:l,onChange:s,onValidationChange:o,value:u,defaultValue:f,savedSearches:m,searchHistory:p,fetchSuggestions:g,colors:x,styles:y,placeholder:N,className:w,classNames:S,style:A,dropdown:R,features:L,inputRef:I,datePresets:q,onKeyDown:X,onFocus:W,onBlur:ae,onTab:z,validateValue:T,parseDate:ee,plainModeLength:fe,interceptPaste:be,defaultField:ye,trailingSpaceOnAccept:te=!0,collapseOnBlur:re=!1}=t,ge=typeof ye=="string"?{name:ye,showFieldSuggestions:!1}:ye?{showFieldSuggestions:!1,...ye}:void 0,U=ge==null?void 0:ge.name,B=(R==null?void 0:R.open)??(R==null?void 0:R.mode)??"always",ue=typeof B=="function",de=ue?null:B,we=(R==null?void 0:R.alignToInput)??!1,C=R==null?void 0:R.maxSuggestions,V=C||10,ne=R==null?void 0:R.suggestDebounceMs,me=parseInt((y==null?void 0:y.dropdownMaxHeight)||"300",10)||300,Ne=(L==null?void 0:L.savedSearches)??!!m,je=(L==null?void 0:L.historySearch)??!!p,ze=(R==null?void 0:R.showSavedSearchHint)??Ne,ut=(R==null?void 0:R.showHistoryHint)??je,Ge=(R==null?void 0:R.showOperators)!==!1,nt=(ue||de!=="input")&&(R==null?void 0:R.onNavigation)!==!1,Sn=(R==null?void 0:R.navigationDelay)??0,Xt=(R==null?void 0:R.loadingDelay)??0,ft=R==null?void 0:R.renderFieldHint,oe=R==null?void 0:R.renderHistoryItem,$e=R==null?void 0:R.renderSavedSearchItem,at=R==null?void 0:R.renderHeader,Ut=R==null?void 0:R.renderNoResults,pn=R==null?void 0:R.renderType,jt=(R==null?void 0:R.autoSelect)??!1,_t=(R==null?void 0:R.homeEndKeys)??!1,Qt=(L==null?void 0:L.multiline)!==!1,Hn=(L==null?void 0:L.smartSelectAll)??!1,$n=(L==null?void 0:L.expandSelection)??!1,tn=(L==null?void 0:L.wildcardWrap)??!1,da=(L==null?void 0:L.clauseNavigation)??!1,fa=L==null?void 0:L.formatQuery,Wn=!!fa,qn=typeof fa=="object"?fa:void 0,he=v.useMemo(()=>({savedSearches:Ne,historySearch:je}),[Ne,je]),Ce=Array.isArray(a)?a:[],[Ae,Pe]=v.useState(Ce);v.useEffect(()=>{if(Array.isArray(a)){Pe(a);return}let j=!1;return a().then(P=>{j||Pe(P)}),()=>{j=!0}},[a]);const qe=v.useMemo(()=>{const j=new Map;for(const P of Ae)if(j.set(P.name.toLowerCase(),P.type),P.aliases)for(const Ee of P.aliases)j.set(Ee.toLowerCase(),P.type);return j},[Ae]),Z=v.useRef(null),[Tt,Kt]=v.useState(null),Yn=v.useCallback(j=>{Z.current=j,Kt(j)},[]),gn=v.useRef(null),Ba=v.useRef(null),Me=v.useRef(u||f||""),vt=v.useRef(null),yt=v.useRef(!1),St=v.useRef(!1),Bt=v.useRef(new DC),Ct=v.useRef(null),nn=v.useRef(new Set),Zt=v.useRef(null),Ht=v.useRef(null),ht=v.useRef(null),Je=v.useRef(null),wn=v.useRef(!1),kn=v.useRef(null),D=v.useRef(null),M=v.useRef(null),$=v.useRef("input"),K=v.useRef(null),se=v.useRef(-1),Te=v.useRef(()=>{}),ve=v.useRef(new Oh(Ce,[],[],C||10,{showSavedSearchHint:ze,showHistoryHint:ut,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}));ve.current.setDefaultField(ge);const De=v.useRef(new kx(Ce)),Re=v.useRef(T);Re.current=T;const[_e,Ue]=v.useState([]),[Xe,ke]=v.useState(null),[Ze,Ie]=v.useState([]),[$t,We]=v.useState(-1),[ct,it]=v.useState(!1),[dt,Jt]=v.useState(!1),[Fn,En]=v.useState(null),[On,Mn]=v.useState([]),[Pn,ga]=v.useState(!1),[il,ea]=v.useState(!Me.current),[pr,Qe]=v.useState(fe!=null&&Me.current.length>=fe),[Nt,Wt]=v.useState(0),[ta,_n]=v.useState(0),[Mr,Rt]=v.useState(""),[ja,Gn]=v.useState(null),[Fl,bi]=v.useState(null),At=v.useRef({tokens:_e,ast:Xe,suggestions:Ze,selectedSuggestionIndex:$t,showDropdown:ct,showDatePicker:dt,cursorOffset:Nt,selectionEnd:ta,autocompleteContext:Mr,validationErrors:On,cursorContext:ja});At.current={tokens:_e,ast:Xe,suggestions:Ze,selectedSuggestionIndex:$t,showDropdown:ct,showDatePicker:dt,cursorOffset:Nt,selectionEnd:ta,autocompleteContext:Mr,validationErrors:On,cursorContext:ja};const gr=v.useCallback((j,P)=>{if(we&&gn.current){const xe=gn.current.getBoundingClientRect();return{top:xe.bottom+window.scrollY+4,left:xe.left+window.scrollX}}const Ee=Uh();return Ee?Bh(Ee,j,P):null},[we]),Wo=v.useCallback(()=>{if(!(!we||!gn.current))return gn.current.getBoundingClientRect().width},[we]),nr=v.useCallback((j,P,Ee="dropdown")=>{const xe=Ee==="datePicker"?j:Hx(j,me);if(we&&Ee!=="datePicker"){it(!0),En(gr(xe,P));return}const Fe=requestAnimationFrame(()=>{nn.current.delete(Fe),Ee==="datePicker"?Jt(!0):it(!0);const ce=Uh();En(ce?Bh(ce,xe,P):null)});nn.current.add(Fe)},[we,gr,me]),ol=80,cd=60,Ss=v.useCallback((j,P)=>{if(!Z.current)return;const Ee=ni(j,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=Ee,document.activeElement===Z.current&&al(Z.current,P)},[x]),va=v.useCallback((j,P)=>{const Ee=fe!=null&&j.length>=fe;if(Qe(Ee),Ee){if(Ue([]),ke(null),Mn([]),ea(j.length===0),Ie([]),At.current.tokens=[],it(!1),Jt(!1),Z.current){const Se=Ol(Z.current);Z.current.querySelector("span")&&(Z.current.textContent=j,al(Z.current,Se)),Wt(Se),_n(Se)}s&&s(j,null),o&&o([]);return}const xe=new ui(j,he).tokenize(),Fe=new ms(xe),ce=Fe.parse(),pe=yc([...Fe.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...De.current.validate(ce,Re.current,ee,U)]);if(Z.current){const Se=Ol(Z.current);P&&xe.length>ol?(Ht.current&&clearTimeout(Ht.current),Ht.current=setTimeout(()=>{Ht.current=null,Z.current&&Ss(xe,Ol(Z.current))},cd)):(Ht.current&&(clearTimeout(Ht.current),Ht.current=null),Ss(xe,Se)),Ue(xe),ke(ce),Mn(pe),ea(j.length===0),Wt(Se),_n(Se),At.current.tokens=xe,P&&Te.current(xe,Se)}else Ue(xe),ke(ce),Mn(pe),ea(j.length===0),At.current.tokens=xe;s&&s(j,ce),o&&o(pe)},[x,s,o,Ss,fe]),Pl=v.useCallback((j,P)=>{if(!ft||P.type!=="FIELD_VALUE"||!P.fieldName)return j;const Ee=ve.current.resolveField(P.fieldName);if(!Ee)return j;const xe=ft(Ee,P.partial);return xe==null?j:j.some(Fe=>Fe.type==="hint")?j.map(Fe=>Fe.type==="hint"?{...Fe,customContent:xe}:Fe):[{text:"",label:"",type:"hint",customContent:xe,replaceStart:P.start??0,replaceEnd:P.end??0},...j]},[ft]),ws=v.useCallback(j=>{if(!Ut)return!1;const P=Ut({cursorContext:j,partial:j.partial});return P==null?!1:(Ie([{text:"",label:"",type:"noResults",customContent:P,replaceStart:0,replaceEnd:0}]),We(-1),Jt(!1),nr(32,300),!0)},[Ut]),ya=v.useCallback((j,P,Ee)=>{var Se,Ke,rt;const xe=ve.current.getSuggestions(j,P);Ge||(xe.suggestions=xe.suggestions.filter(Be=>Be.type!=="operator"));const Fe=xe.context.type;if(Gn(xe.context),ue){if(B({trigger:$.current,context:xe.context,suggestions:xe.suggestions,isOpen:At.current.showDropdown||At.current.showDatePicker,value:Me.current,selectionStart:P,selectionEnd:Ee??P})===!1){it(!1),Jt(!1),Ie([]);return}}else{if(de==="never"){it(!1),Jt(!1),Ie([]);return}if(de==="manual"){if(M.current&&M.current!==Fe){M.current=null,it(!1),Jt(!1),Ie([]);return}if(!M.current){it(!1),Jt(!1),Ie([]);return}}if(de==="input"&&$.current!=="input"&&$.current!=="ctrlSpace"){it(!1),Jt(!1),Ie([]);return}if(de==="always"&&j.some(Be=>(Be.type===O.AND||Be.type===O.OR||Be.type===O.NOT||Be.type===O.TILDE||Be.type===O.BOOST)&&P>=Be.start&&P<=Be.end)){it(!1),Jt(!1),Ie([]);return}}const ce=xe.context.fieldName?ve.current.resolveField(xe.context.fieldName):void 0,pe=!!(g&&xe.context.type==="FIELD_VALUE"&&xe.context.fieldName&&(ce==null?void 0:ce.type)!=="boolean"&&(ce==null?void 0:ce.suggestions)!==!1)||typeof m=="function"&&xe.context.type==="SAVED_SEARCH"||typeof p=="function"&&xe.context.type==="HISTORY_REF";if(xe.showDatePicker){wn.current=!1,(Se=Zt.current)==null||Se.abort(),vt.current&&clearTimeout(vt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const Be=kC(xe.context,ee),Nn=kn.current;kn.current=Be,bi(Be);const Lt=xe.context.token;Lt&&(Lt.type==="COLON"||Lt.type==="COMPARISON_OP")?D.current={start:Lt.end,end:Lt.end}:Lt?D.current={start:Lt.start,end:Lt.end}:D.current={start:P,end:P},At.current.showDatePicker&&OC(Nn,Be)&&Jt(!1),Ie([]),we||it(!1),Rt(Fe),nr(350,300,"datePicker");return}if(pe){const Be=xe.context.token,Nn=Be?Be.start:P,Lt=Be?Be.end:P,ra=()=>{Je.current=null,Ie([{text:"",label:"Searching...",type:"loading",replaceStart:Nn,replaceEnd:Lt}]),we||it(!1),Jt(!1),We(-1),nr(32,300)};Je.current&&clearTimeout(Je.current),Xt>0?Je.current=setTimeout(ra,Xt):ra(),Rt(Fe)}else{wn.current=!1,(Ke=Zt.current)==null||Ke.abort(),vt.current&&clearTimeout(vt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const Be=Pl(xe.suggestions,xe.context);Be.length>0?(Ie(Be),we||it(!1),Jt(!1),We(xe.context.partial||jt?0:-1),Rt(Fe),nr(Be.length*32,300)):(Rt(Fe),ws(xe.context)||(it(!1),Jt(!1),Ie([])))}if(pe){const Be=xe.context.partial,Nn=ne||200;wn.current=!0,vt.current&&clearTimeout(vt.current),(rt=Zt.current)==null||rt.abort();const Lt=new AbortController;Zt.current=Lt,vt.current=setTimeout(async()=>{const ra=xe.context.token,la=ra?ra.start:P,xa=ra?ra.end:P;try{let Rn;if(xe.context.type==="SAVED_SEARCH"&&typeof m=="function"){const cn=await m(Be);if(Lt.signal.aborted)return;Rn=cn.map(zt=>({text:zt.query,label:zt.label||zt.query,description:zt.description,type:"savedSearch",replaceStart:la,replaceEnd:xa,matchPartial:Be,sourceData:zt}))}else if(xe.context.type==="HISTORY_REF"&&typeof p=="function"){const cn=await p(Be);if(Lt.signal.aborted)return;Rn=cn.map(zt=>({text:Oh.wrapHistoryQuery(zt.query),label:zt.label||zt.query,description:zt.description,type:"history",replaceStart:la,replaceEnd:xa,matchPartial:Be,sourceData:zt}))}else{const cn=xe.context.fieldName,zt=ve.current.resolveField(cn),Kl=await g(zt?zt.name:cn,Be);if(Lt.signal.aborted)return;Rn=Kl.map(xr=>({text:xr.text,label:xr.label||xr.text,description:xr.description,type:xr.type,replaceStart:la,replaceEnd:xa,matchPartial:Be}))}if(Je.current&&(clearTimeout(Je.current),Je.current=null),Rn=Rn.slice(0,V),Rn.length>0){if(ge!=null&&ge.showFieldSuggestions){const cn=ve.current.getFieldSuggestions(Be,la,xa);Rn=[...Rn,...cn].slice(0,V)}Ie(Rn),We(Be||jt?0:-1),nr(Rn.length*32,300)}else{const cn=ve.current.getSuggestions(At.current.tokens,At.current.cursorOffset);if(!(Be&&ws(cn.context))){const zt=Pl(cn.suggestions.filter(Kl=>Kl.type==="hint"),cn.context);zt.length>0?(Ie(zt),We(cn.context.partial||jt?0:-1),nr(zt.length*32,300)):ws(cn.context)||(it(!1),Ie([]))}}}catch(Rn){Je.current&&(clearTimeout(Je.current),Je.current=null),Lt.signal.aborted||(Ie([{text:"",label:Rn instanceof Error?Rn.message:"Error loading suggestions",type:"error",replaceStart:la,replaceEnd:xa}]),We(-1),nr(32,300),wn.current=!1)}},Nn)}},[g,m,p,ne,Pl,gr,nr,we,B,ue,de,Ge,V,Xt,jt,ws]);Te.current=ya;const an=v.useCallback(()=>{var j;it(!1),Jt(!1),bi(null),kn.current=null,D.current=null,Ie([]),We(-1),wn.current=!1,(j=Zt.current)==null||j.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),ht.current&&(clearTimeout(ht.current),ht.current=null),M.current=null},[]),na=v.useCallback((j,P,Ee)=>{if(ht.current&&(clearTimeout(ht.current),ht.current=null),!nt){(At.current.showDropdown||At.current.showDatePicker)&&an();return}$.current="navigation",Sn>0?ht.current=setTimeout(()=>{ht.current=null,ya(j,P,Ee)},Sn):ya(j,P,Ee)},[nt,Sn,ya,an]),Ta=v.useCallback((j,P,Ee)=>{Me.current=j,Ct.current&&(clearTimeout(Ct.current),Ct.current=null),Bt.current.push({value:j,cursorPos:P});const xe=new ui(j,he).tokenize(),Fe=new ms(xe),ce=Fe.parse(),pe=yc([...Fe.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...De.current.validate(ce,Re.current,ee,U)]);if(Z.current){const Se=ni(xe,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=Se,al(Z.current,P)}if(Ue(xe),ke(ce),Mn(pe),ea(j.length===0),Wt(P),_n(P),it(!1),Jt(!1),s&&s(j,ce),o&&o(pe),Ee){const Se=requestAnimationFrame(()=>{nn.current.delete(Se),Ee(xe,ce)});nn.current.add(Se)}},[x,s,o]),_r=v.useCallback((j,P="Enter",Ee,xe)=>{if(!j)return;const Fe=At.current,ce=Fe.autocompleteContext,pe=ce==="FIELD_VALUE"||ce==="SAVED_SEARCH"||ce==="HISTORY_REF";if(pe&&($.current="navigation"),j.type==="hint"&&(j.text==="#"||j.text==="!")){const cn=j.text,zt=j.replaceStart,Kl=Math.max(j.replaceEnd,Fe.selectionEnd),xr=Me.current.slice(0,zt),fd=Me.current.slice(Kl),au=xr+cn+fd,ru=xr.length+cn.length;Ta(au,ru,(hd,md)=>{Ee?Ee(au,md):ya(hd,ru)});return}if(j.type==="hint")return;const Se=Fe.autocompleteContext==="FIELD_VALUE",Ke=Math.min(j.replaceStart,Fe.cursorOffset),rt=Math.max(j.replaceEnd,Fe.selectionEnd),Be=Me.current.slice(0,Ke),Nn=Me.current.slice(rt);let Lt="",ra=Nn;pe&&te&&(Nn.length===0?Lt=" ":/^[ \t\r\n]+$/.test(Nn)&&!Nn.startsWith("\\ ")&&(Lt=" ",ra=""));const la=Be+j.text+Lt+ra,xa=Be.length+j.text.length+Lt.length,Rn=P==="Enter"&&Se;Ta(la,xa,(cn,zt)=>{Ee?Ee(la,zt):Rn?l&&l(la,zt,xe):ya(cn,xa)})},[Ta,ya,l,te]);v.useEffect(()=>{Array.isArray(m)&&ve.current.updateSavedSearches(m),Array.isArray(p)&&ve.current.updateSearchHistory(p)},[m,p]),v.useEffect(()=>{ve.current=new Oh(Ae,[],[],C||10,{showSavedSearchHint:ze,showHistoryHint:ut,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}),ve.current.setDefaultField(ge),De.current=new kx(Ae),Array.isArray(m)&&ve.current.updateSavedSearches(m),Array.isArray(p)&&ve.current.updateSearchHistory(p),Me.current&&va(Me.current,!1)},[Ae,C,ze,ut]),v.useEffect(()=>{I&&I({getValue:()=>Me.current,setValue:j=>{Me.current=j,va(j,!1)},focus:()=>{var j;return(j=Z.current)==null?void 0:j.focus()},blur:()=>{var j;return(j=Z.current)==null?void 0:j.blur()},getAST:()=>At.current.ast,getValidationErrors:()=>At.current.validationErrors,setSelection:(j,P)=>{Z.current&&(Z.current.focus(),nl(Z.current,j,P),Wt(j),_n(P))}})},[I,va]),v.useEffect(()=>{const j=Me.current;Bt.current.push({value:j,cursorPos:j.length}),j&&va(j,!1)},[]),v.useEffect(()=>{u!==void 0&&u!==Me.current&&(Me.current=u,va(u,!1))},[u,va]),v.useEffect(()=>()=>{var j;vt.current&&clearTimeout(vt.current),Ht.current&&clearTimeout(Ht.current),ht.current&&clearTimeout(ht.current),Je.current&&clearTimeout(Je.current),nn.current.forEach(P=>cancelAnimationFrame(P)),nn.current.clear(),(j=Zt.current)==null||j.abort()},[]),v.useEffect(()=>{if(ue){const j=At.current;j.cursorContext&&B({trigger:"modeChange",context:j.cursorContext,suggestions:j.suggestions,isOpen:j.showDropdown||j.showDatePicker,value:Me.current,selectionStart:j.cursorOffset,selectionEnd:j.selectionEnd})===!1&&(it(!1),Jt(!1),Ie([]))}else de==="never"&&(it(!1),Jt(!1),Ie([]));M.current=null},[B]);const vr=v.useRef(!1);v.useLayoutEffect(()=>{if(vr.current){vr.current=!1;return}const j=Ba.current;if(!j||!Fn)return;const P=j.getBoundingClientRect(),Ee=window.innerWidth;if(P.right>Ee-8){const xe=P.right-Ee+8;vr.current=!0,En(Fe=>Fe&&{...Fe,left:Math.max(8,Fe.left-xe)})}},[Fn,ct,dt,Ze]),v.useEffect(()=>{const j=()=>{const P=At.current;if(!(!P.showDropdown&&!P.showDatePicker))if(P.showDropdown&&we&&gn.current){const Ee=gn.current.getBoundingClientRect();En({top:Ee.bottom+window.scrollY+4,left:Ee.left+window.scrollX})}else{const Ee=Uh();Ee&&En(Bh(Ee,P.showDatePicker?350:Hx(P.suggestions.length*32,me),300))}};return window.addEventListener("resize",j),window.addEventListener("scroll",j,!0),()=>{window.removeEventListener("resize",j),window.removeEventListener("scroll",j,!0)}},[we,me]),v.useEffect(()=>{const j=Z.current;if(!j)return;const P=()=>{(At.current.showDropdown||At.current.showDatePicker)&&an()};return j.addEventListener("scroll",P),()=>j.removeEventListener("scroll",P)},[an]);const Lr=v.useRef(null),Si=v.useRef(x);v.useEffect(()=>{if(!Z.current)return;const j=At.current.tokens;if(j.length===0||Pn&&ta!==Nt)return;const P=Pn?Nt:-1,Ee=x!==Si.current;Si.current=x;const xe=H0(j,P),Fe=xe?`${xe.openStart},${xe.closeStart}`:null;if(Fe===Lr.current&&!Ee)return;Lr.current=Fe;const ce=Pn?Ol(Z.current):-1,pe=ni(j,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=pe,Pn&&ce>=0&&al(Z.current,ce)},[Nt,ta,Pn,x]);const yr=re&&!Pn,wi=v.useRef(yr);v.useEffect(()=>{if(!Z.current)return;const j=wi.current;if(wi.current=yr,j!==yr)if(yr)Z.current.innerHTML=Z.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const P=At.current.tokens;if(P.length>0){const Ee=Pn?Ol(Z.current):-1,xe=ni(P,x,{cursorOffset:Ee,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=xe,Pn&&Ee>=0&&al(Z.current,Ee)}}},[yr,x]);const Ha=v.useCallback(()=>{if(yt.current||!Z.current)return;K.current=null,se.current=-1,ht.current&&(clearTimeout(ht.current),ht.current=null);let j=_T(Z.current);if(j===Me.current)return;let P=Ol(Z.current);const Ee=jx(j);Ee!==j&&(j=Ee,P=Math.min(P,j.length)),Me.current=j;const xe=Bt.current,Fe=xe.current();if(Fe&&Math.abs(j.length-Fe.value.length)<=2&&Ct.current?xe.replaceCurrent({value:j,cursorPos:P}):xe.push({value:j,cursorPos:P}),Ct.current&&clearTimeout(Ct.current),Ct.current=setTimeout(()=>{Ct.current=null},300),$.current="input",!ue&&de==="input"){const ce=P>0?j[P-1]:"";if(!ce||ce.trim()===""){va(j,!1),an(),Z.current&&xc(Z.current);return}}va(j,!0),Z.current&&xc(Z.current)},[va,ue,de,an]),ar=v.useCallback(()=>{yt.current=!0},[]),Ei=v.useCallback(()=>{yt.current=!1,Ha()},[Ha]),zr=v.useCallback(j=>{if(!j)return;Me.current=j.value;const P=new ui(j.value,he).tokenize(),Ee=new ms(P),xe=Ee.parse(),Fe=yc([...Ee.getErrors().map(pe=>({message:pe.message,start:pe.start,end:pe.end,type:"SYNTAX_ERROR"})),...De.current.validate(xe,Re.current,ee,U)]),ce=j.selStart!=null&&j.selStart!==j.cursorPos;if(Z.current){const pe=ni(P,x,{cursorOffset:j.cursorPos,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=pe,ce?nl(Z.current,j.selStart,j.cursorPos):al(Z.current,j.cursorPos)}Ue(P),ke(xe),Mn(Fe),ea(j.value.length===0),Wt(ce?j.selStart:j.cursorPos),_n(j.cursorPos),an(),s&&s(j.value,xe),o&&o(Fe)},[x,s,o,an]),$a=v.useCallback(()=>{const j=Ba.current;if(!j)return 10;const P=j.clientHeight,Ee=j.querySelectorAll(".ei-dropdown-item")[0];if(!Ee)return 10;const xe=Ee.offsetHeight;return xe<=0?10:Math.max(1,Math.floor(P/xe))},[]),Ni=v.useCallback(j=>{var xe,Fe;if(X&&X(j),j.defaultPrevented)return;const P=At.current,Ee=j.nativeEvent.code;if(Wn&&Ee==="KeyF"&&j.altKey&&j.shiftKey&&!j.ctrlKey&&!j.metaKey){j.preventDefault();const ce=wC(Me.current,qn);ce!==Me.current&&Ta(ce,ce.length);return}if(Z.current&&Z.current.childNodes.length>40){const ce=window.getSelection();if(ce!=null&&!ce.isCollapsed){const pe=Rr(Z.current);if(pe.end-pe.start>20){const Se=j.key==="Backspace"||j.key==="Delete"||j.key==="x"&&(j.ctrlKey||j.metaKey),Ke=!j.ctrlKey&&!j.metaKey&&!j.altKey&&j.key.length===1;(Se||Ke)&&(Z.current.textContent=Me.current,nl(Z.current,pe.start,pe.end))}}}{let ce=null,pe=null;if(Tx[j.key])ce=j.key,pe=Tx[j.key];else if(tn&&j.key==="*"&&Z.current){const Se=Rr(Z.current);if(Se.start!==Se.end){const[Ke,rt]=Cx(P.tokens,Se.start,Se.end);if(Ke>=0&&Ke===rt){const Be=P.tokens[Ke];(Be.type===O.VALUE||Be.type===O.WILDCARD)&&(ce="*",pe="*")}}}if(ce&&pe&&Z.current){const Se=Rr(Z.current);if(Se.start!==Se.end){j.preventDefault();const{newValue:Ke,newSelStart:rt,newSelEnd:Be}=MT(Me.current,Se.start,Se.end,ce,pe),Nn=Bt.current,Lt=Nn.current();Lt&&Lt.value===Me.current&&(Lt.selStart=Se.start,Lt.cursorPos=Se.end),Me.current=Ke,Ct.current&&(clearTimeout(Ct.current),Ct.current=null),Nn.push({value:Ke,cursorPos:Be,selStart:rt});const ra=new ui(Ke,he).tokenize(),la=new ms(ra),xa=la.parse(),Rn=yc([...la.getErrors().map(zt=>({message:zt.message,start:zt.start,end:zt.end,type:"SYNTAX_ERROR"})),...De.current.validate(xa,Re.current,ee,U)]),cn=ni(ra,x,{cursorOffset:Be,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=cn,nl(Z.current,rt,Be),Ue(ra),ke(xa),Mn(Rn),ea(!1),Wt(rt),_n(Be),an(),s&&s(Ke,xa),o&&o(Rn);return}}}if(j.key==="z"&&(j.ctrlKey||j.metaKey)&&!j.shiftKey){j.preventDefault(),zr(Bt.current.undo());return}if(j.key==="y"&&(j.ctrlKey||j.metaKey)||j.key==="z"&&(j.ctrlKey||j.metaKey)&&j.shiftKey){j.preventDefault(),zr(Bt.current.redo());return}if(j.key==="a"&&(j.ctrlKey||j.metaKey)&&Hn&&Z.current){const ce=Rr(Z.current),pe=gC(P.tokens,ce.start,ce.end);if(pe){j.preventDefault(),nl(Z.current,pe.start,pe.end),Wt(pe.start),_n(pe.end);return}}if($n&&j.altKey&&j.shiftKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&Z.current){const ce=Ee==="ArrowRight";let pe=K.current;if(!pe){const Ke=Rr(Z.current),rt=yC(P.ast,P.tokens,Ke.start);if(rt.length===0)return;pe={ranges:rt,level:-1},K.current=pe}const Se=ce?Math.min(pe.level+1,pe.ranges.length-1):Math.max(pe.level-1,-1);if(Se===pe.level)return;if(pe.level=Se,Se<0){const Ke=Rr(Z.current);al(Z.current,Ke.start),K.current=null}else{j.preventDefault();const Ke=pe.ranges[Se];nl(Z.current,Ke.start,Ke.end),Wt(Ke.start),_n(Ke.end)}return}if(K.current=null,da&&j.ctrlKey&&j.altKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&Z.current){j.preventDefault();const ce=Ee==="ArrowRight"?"forward":"backward",pe=CC(P.ast),Se=Rr(Z.current),Ke=ce==="forward"?Se.end:Se.start,rt=AC(pe,se.current,Ke,ce);rt&&(se.current=rt.index,nl(Z.current,rt.stop.start,rt.stop.end),Wt(rt.stop.start),_n(rt.stop.end));return}if(se.current=-1,j.key===" "&&(j.ctrlKey||j.metaKey)){j.preventDefault(),$.current="ctrlSpace",!ue&&de==="manual"&&(M.current=ve.current.getSuggestions(P.tokens,P.cursorOffset).context.type),ya(P.tokens,P.cursorOffset);return}if(j.key==="Enter"&&(j.ctrlKey||j.metaKey)){j.preventDefault(),an(),l&&l(Me.current,P.ast,j);return}if(j.key==="Enter"&&j.shiftKey&&Qt){j.preventDefault(),mC();const ce=Z.current?Ol(Z.current):Me.current.length+1,pe=Me.current,Se=pe.slice(0,ce-1)+`
288
+ `+pe.slice(ce-1);Me.current=Se,K.current=null,ht.current&&(clearTimeout(ht.current),ht.current=null),$.current="input",Bt.current.push({value:Se,cursorPos:ce}),va(Se,!0),Z.current&&xc(Z.current);return}if((j.key==="Backspace"||j.key==="Delete")&&Z.current&&!Z.current.textContent){const ce=Me.current;if(!ce)return;const{start:pe,end:Se}=Rr(Z.current);let Ke,rt;if(pe!==Se)Ke=ce.slice(0,pe)+ce.slice(Se),rt=pe;else if(j.key==="Backspace"&&pe>0)Ke=ce.slice(0,pe-1)+ce.slice(pe),rt=pe-1;else if(j.key==="Delete"&&pe<ce.length)Ke=ce.slice(0,pe)+ce.slice(pe+1),rt=pe;else return;j.preventDefault(),Me.current=Ke,K.current=null,ht.current&&(clearTimeout(ht.current),ht.current=null),$.current="input",Bt.current.push({value:Ke,cursorPos:rt}),al(Z.current,rt),va(Ke,!0),Z.current&&xc(Z.current);return}if(St.current=!1,P.showDropdown&&P.suggestions.length>0)switch(j.key){case"ArrowDown":j.preventDefault(),St.current=!0,We(ce=>ce>=P.suggestions.length-1?0:ce+1);return;case"ArrowUp":j.preventDefault(),St.current=!0,We(ce=>ce<=0?P.suggestions.length-1:ce-1);return;case"PageDown":{j.preventDefault(),St.current=!0;const ce=$a();We(pe=>Math.min(pe+ce,P.suggestions.length-1));return}case"PageUp":{j.preventDefault(),St.current=!0;const ce=$a();We(pe=>Math.max(pe-ce,0));return}case"Home":if(_t&&P.selectedSuggestionIndex>=0){j.preventDefault(),St.current=!0,We(0);return}break;case"End":if(_t&&P.selectedSuggestionIndex>=0){j.preventDefault(),St.current=!0,We(P.suggestions.length-1);return}break;case"Enter":if(P.selectedSuggestionIndex>=0){const ce=P.suggestions[P.selectedSuggestionIndex];if(ce.type==="loading"||ce.type==="error"){j.preventDefault(),an(),l&&l(Me.current,P.ast,j);return}if(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!"){j.preventDefault(),an();const pe=Me.current,Se=P.cursorOffset;if(Se<=pe.length&&pe[Se]!==" "){const Ke=pe.slice(0,Se),rt=pe.slice(Se),Be=Ke+" "+rt;Ta(Be,Se+1,()=>{l&&l(Be,P.ast,j)})}else l&&l(pe,P.ast,j);return}j.preventDefault(),_r(ce,"Enter",void 0,j);return}j.preventDefault(),an(),l&&l(Me.current,P.ast,j);return;case"Tab":if(z){j.preventDefault();const ce=P.selectedSuggestionIndex>=0?P.suggestions[P.selectedSuggestionIndex]:null,pe=ce&&ce.type!=="loading"&&ce.type!=="error"&&!(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!")?ce:null,Se=z({suggestion:pe,cursorContext:P.cursorContext||{type:"EMPTY",partial:""},query:Me.current});Se.accept&&pe?_r(pe,"Tab",(Ke,rt)=>{var Be;Se.submit&&l&&l(Ke,rt,j),Se.blur&&((Be=Z.current)==null||Be.blur())},j):(an(),Se.submit&&l&&l(Me.current,P.ast,j),Se.blur&&((xe=Z.current)==null||xe.blur()));return}if(P.selectedSuggestionIndex>=0){const ce=P.suggestions[P.selectedSuggestionIndex];if(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!"){j.preventDefault(),an();const pe=Me.current,Se=P.cursorOffset;if(Se<=pe.length&&pe[Se]!==" "){const Ke=pe.slice(0,Se),rt=pe.slice(Se),Be=Ke+" "+rt,Nn=Se+1;Ta(Be,Nn,Lt=>{ya(Lt,Nn)})}return}j.preventDefault(),_r(ce,"Tab",void 0,j);return}break;case"Escape":j.preventDefault(),an();return}if(j.key==="Tab"&&z){j.preventDefault();const ce=z({suggestion:null,cursorContext:P.cursorContext||{type:"EMPTY",partial:""},query:Me.current});ce.submit&&l&&l(Me.current,P.ast,j),ce.blur&&((Fe=Z.current)==null||Fe.blur());return}if(P.showDatePicker&&j.key==="Escape"){j.preventDefault(),an();return}if(j.key==="Enter"&&!P.showDropdown&&!P.showDatePicker){j.preventDefault(),l&&l(Me.current,P.ast,j);return}},[l,an,_r,Ta,zr,Qt,ue,de,ya,X,z,Hn,$n,da,_t,$a,Wn]),Es=v.useCallback(j=>{if(St.current){St.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(j.key)){if(!Z.current)return;const P=Rr(Z.current);Wt(P.start),_n(P.end),na(At.current.tokens,P.start,P.end)}},[na]),eu=v.useCallback(()=>{ga(!0),W==null||W();const j=requestAnimationFrame(()=>{if(nn.current.delete(j),Z.current){const P=At.current.tokens,Ee=P.length>0?Ol(Z.current):0;Wt(Ee),_n(Ee),na(P,Ee)}});nn.current.add(j)},[Ha,na,W]),Ns=v.useCallback(()=>{var j;ga(!1),it(!1),Jt(!1),Ie([]),wn.current=!1,(j=Zt.current)==null||j.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),Je.current&&(clearTimeout(Je.current),Je.current=null),Wt(-1),ae==null||ae()},[ae]),Ur=v.useRef(!1),tu=v.useCallback(j=>{if(!Z.current||j.detail!==2&&j.detail!==3)return;if(j.detail===3){if(!At.current.ast)return;const Se=document.caretRangeFromPoint(j.clientX,j.clientY);if(!Se)return;const Ke=Lo(Z.current,Se.startContainer,Se.startOffset),rt=AT(At.current.ast,Me.current,Ke);if(!rt||rt.start>=rt.end)return;j.preventDefault(),Ur.current=!0,nl(Z.current,rt.start,rt.end);return}j.preventDefault(),Ur.current=!0;const P=document.caretRangeFromPoint(j.clientX,j.clientY);if(!P)return;const Ee=Lo(Z.current,P.startContainer,P.startOffset),xe=Me.current,Fe=Se=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(Se);let ce=Ee;for(;ce>0&&Fe(xe[ce-1]);)ce--;let pe=Ee;for(;pe<xe.length&&Fe(xe[pe]);)pe++;ce<pe&&nl(Z.current,ce,pe)},[]),aa=v.useCallback(j=>{Ur.current&&(j.preventDefault(),Ur.current=!1)},[]),Br=v.useCallback(()=>{if(!Z.current)return;const j=Rr(Z.current);if(Wt(j.start),_n(j.end),j.start!==j.end){const[P,Ee]=Cx(At.current.tokens,j.start,j.end);if(P!==Ee){an();return}}na(At.current.tokens,j.start,j.end)},[na,an]),Hr=v.useCallback(j=>{Ct.current&&(clearTimeout(Ct.current),Ct.current=null),hC(j),Ha()},[Ha]),Gl=v.useCallback(j=>{j.preventDefault();const P=jx(j.clipboardData.getData("text/plain"));if(be){const Ee=be(P,j);Ee!=null&&typeof(Ee==null?void 0:Ee.then)=="function"?Ee.then(xe=>{xe!=null&&Hr(xe)}).catch(()=>{}):Ee!=null&&Hr(Ee)}else Hr(P)},[be,Hr]),dd=v.useCallback(j=>{$.current="navigation";const P=At.current,Ee=D.current,xe=Ee?Ee.start:P.cursorOffset,Fe=Ee?Ee.end:P.cursorOffset,ce=Me.current.slice(0,xe),pe=Me.current.slice(Fe);let Se="",Ke=pe;te&&j.length>0&&(pe.length===0?Se=" ":/^[ \t\r\n]+$/.test(pe)&&!pe.startsWith("\\ ")&&(Se=" ",Ke=""));const rt=ce+j+Se+Ke,Be=ce.length+j.length+Se.length;Ta(rt,Be,Nn=>{Z.current&&Z.current.focus(),ya(Nn,Be)})},[Ta,ya,te]),ul=Zo(x),Xl=Jo(y),Ql=IT(ul,A),$r={...VT(ul,Xl),...Pn?YT(Xl):{}};yr&&($r.whiteSpace="nowrap",$r.overflow="hidden",$r.textOverflow="ellipsis");const nu=FT(ul,Xl);return v.createElement("div",{ref:gn,style:Ql,className:za("ei-container",w,S==null?void 0:S.container)},v.createElement("div",{ref:Yn,contentEditable:!0,suppressContentEditableWarning:!0,className:za("ei-editor",S==null?void 0:S.editor),style:$r,onInput:Ha,onKeyDown:Ni,onKeyUp:Es,onMouseDown:tu,onMouseUp:aa,onFocus:eu,onBlur:Ns,onClick:Br,onPaste:Gl,onCompositionStart:ar,onCompositionEnd:Ei,spellCheck:!1}),il&&!Pn?v.createElement("div",{className:za("ei-placeholder",S==null?void 0:S.placeholder),style:nu},N):null,v.createElement(fC,{errors:On,editorRef:Tt,cursorOffset:Nt,colors:x,styles:y,containerRef:gn.current,classNames:S?{squiggly:S.squiggly,tooltip:S.tooltip}:void 0}),v.createElement(rC,{suggestions:Ze,selectedIndex:$t,onSelect:j=>_r(j,"Tab"),position:Fn,colors:x,styles:y,visible:ct,fixedWidth:Wo(),renderHistoryItem:oe,renderSavedSearchItem:$e,renderDropdownHeader:at,cursorContext:ja,listRefCallback:j=>{Ba.current=j},renderType:pn,classNames:S?{dropdown:S.dropdown,dropdownHeader:S.dropdownHeader,dropdownItem:S.dropdownItem}:void 0}),dt&&Fn?v.createElement(MC,{position:Fn,colors:ul,onSelect:dd,colorConfig:x,styleConfig:y,datePickerInit:Fl,fixedWidth:void 0,datePresets:q,datePickerClassName:S==null?void 0:S.datePicker}):null)}const LC=["planned","in-progress","done","blocked","canceled","rejected","deferred","waiting"];function qx(t){var o;const a=window.getSelection();if(!a||a.rangeCount===0)return((o=t.textContent)==null?void 0:o.length)??0;const l=a.getRangeAt(0),s=l.cloneRange();return s.selectNodeContents(t),s.setEnd(l.endContainer,l.endOffset),s.toString().length}function zC(t){return a=>{if(!(a.ctrlKey&&!a.metaKey&&!a.altKey))return;const l=a.key.toLowerCase(),s=a.currentTarget,o=s.isContentEditable?s:s.querySelector("[contenteditable='true'], [contenteditable]")??s,u=t.current;if(l==="h"&&u){a.preventDefault();const m=u.getValue();let p=qx(o);(p<0||p>m.length)&&(p=m.length),p>0&&(u.setValue(m.slice(0,p-1)+m.slice(p)),u.setSelection(p-1,p-1));return}if(l==="u"&&u){a.preventDefault();const m=u.getValue();let p=qx(o);if((p<0||p>m.length)&&(p=m.length),p===0)return;let g=p;for(;g>0&&/\s/.test(m[g-1]??"");)g--;if(g===p)for(;g>0&&!/\s/.test(m[g-1]??"");)g--;g<p&&(u.setValue(m.slice(0,g)+m.slice(p)),u.setSelection(g,g));return}const f=l==="j"?"ArrowDown":l==="k"?"ArrowUp":null;f&&(a.preventDefault(),o.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0,cancelable:!0})))}}function Hh(t){return String(t>0?t:0).padStart(3,"0")}function UC({features:t,phases:a,query:l,onQuery:s}){const o=v.useRef(null),u=zC(o),f=v.useMemo(()=>[{name:"feature",label:"Feature",type:"number",description:"Feature number, e.g. 1 (F001)"},{name:"phase",label:"Phase",type:"number",description:"Phase number, e.g. 2 (P002)"},{name:"task",label:"Task",type:"number",description:"Task number, e.g. 10 (T010). Comma-list supported."},{name:"id",label:"Short ID",type:"string",description:"Global 5-char short id, e.g. UUXD1"},{name:"status",label:"Status",type:"string",description:"Task status"},{name:"feature-status",label:"Feature status",type:"string",description:"Status of the feature"},{name:"phase-status",label:"Phase status",type:"string",description:"Status of the phase"},{name:"title",label:"Title",type:"string",description:"Substring match on title"}],[]),m=v.useMemo(()=>{const y=[...new Set(t.map(R=>R.number))].sort((R,L)=>R-L),N=[...new Set(a.map(R=>R.number))].sort((R,L)=>R-L),w=[...new Set(a.flatMap(R=>R.tasks.map(L=>L.number)))].sort((R,L)=>R-L),S=[...new Set([...t.map(R=>R.shortId),...a.flatMap(R=>[R.shortId,...R.tasks.map(L=>L.shortId)])].filter(Boolean))],A=[...new Set(a.flatMap(R=>R.tasks.map(L=>L.title)))];return{featureNums:y,phaseNums:N,taskNums:w,shortIds:S,titles:A}},[t,a]),p=v.useCallback(async(y,N)=>{const w=N.toLowerCase();return y==="feature"?m.featureNums.filter(S=>String(S).startsWith(N)).slice(0,20).map(S=>({text:String(S),label:`F${Hh(S)}`})):y==="phase"?m.phaseNums.filter(S=>String(S).startsWith(N)).slice(0,20).map(S=>({text:String(S),label:`P${Hh(S)}`})):y==="task"?m.taskNums.filter(S=>String(S).startsWith(N)).slice(0,20).map(S=>({text:String(S),label:`T${Hh(S)}`})):y==="id"?m.shortIds.filter(S=>S.toLowerCase().startsWith(w)).slice(0,20).map(S=>({text:S,label:S})):y==="status"||y==="feature-status"||y==="phase-status"?LC.filter(S=>S.startsWith(w)).map(S=>({text:S,label:S})):y==="title"?m.titles.filter(S=>S.toLowerCase().includes(w)).slice(0,20).map(S=>({text:S,label:S.length>44?S.slice(0,44)+"…":S})):[]},[m]),g=v.useCallback(y=>s(y),[s]),x=v.useCallback(y=>{o.current=y},[]);return c.jsx("div",{className:"search-bar",children:c.jsx(_C,{fields:f,value:l,onChange:g,onSearch:g,fetchSuggestions:p,onKeyDown:u,inputRef:x,placeholder:"Search Work Tree… e.g. feature:1 id:UUXD1 title:auth status:in-progress"})})}function BC(t,a){if(Object.keys(a).length===0)return t;const l=u=>{const f=a[u];return f?new Map(f.map((m,p)=>[m,p])):null},s=l("__features__");return(s?[...t].sort((u,f)=>(s.get(u.feature.id)??1/0)-(s.get(f.feature.id)??1/0)):t).map(u=>{const f=l(`phase-scope:${u.feature.id}`),m=f?[...u.allPhases].sort((p,g)=>(f.get(p.phase.id)??1/0)-(f.get(g.phase.id)??1/0)):u.allPhases;return{...u,allPhases:m.map(p=>{const g=l(`task-scope:${p.phase.id}`),x=g?[...p.allTasks].sort((y,N)=>(g.get(y.id)??1/0)-(g.get(N.id)??1/0)):p.allTasks;return{...p,allTasks:x}})}})}function ai({active:t=!1,disabled:a=!1,onClick:l,children:s}){return c.jsx("button",{type:"button",disabled:a,onClick:l,className:`inline-flex h-8 min-h-8 w-full items-center justify-center rounded-[10px] border px-2.5 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] ${t?"border-transparent bg-[var(--accent)] text-white":"border-[var(--border)] bg-[var(--surface-card)] text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"} ${a?"cursor-not-allowed opacity-60":""}`,children:s})}function HC({features:t,phases:a,activeTasks:l,projectStorageScope:s}){const o=NT({features:t,phases:a,projectStorageScope:s}),[u,f]=v.useState({});v.useEffect(()=>{f({})},[o.displayedWorkTree]);const m=v.useMemo(()=>BC(o.displayedWorkTree,u),[o.displayedWorkTree,u]),[p,g]=v.useState(!1),[x,y]=v.useState(null),[N,w]=v.useState(null),S=te=>w(String(te.active.id)),[A,R]=v.useState(0);v.useEffect(()=>{const te=document.querySelector("header");if(!te)return;const re=()=>R(te.offsetHeight);re();const ge=new ResizeObserver(re);return ge.observe(te),window.addEventListener("resize",re),()=>{ge.disconnect(),window.removeEventListener("resize",re)}},[]),v.useEffect(()=>{const te=window.setTimeout(()=>{const re=document.querySelector(".ap-search-sticky"),ge=document.querySelector("header");if(!re||!ge)return;const U=re.getBoundingClientRect();if(U.top<0){const B=U.top+window.scrollY-ge.offsetHeight;window.scrollTo({top:Math.max(0,B),behavior:"smooth"})}},60);return()=>window.clearTimeout(te)},[o.searchQuery,o.hideDone,o.hidePlanned,o.onlyActiveBranches]);const L=$2(H2(Dm,{activationConstraint:{distance:5}})),I=async te=>{const{active:re,over:ge}=te;if(w(null),!ge||re.id===ge.id)return;const U=String(re.id),B=String(ge.id),ue=m.map(de=>de.feature.id);if(ue.includes(U)&&ue.includes(B)){const de=Ao(ue,ue.indexOf(U),ue.indexOf(B)),we=de.indexOf(U),C=we>0?de[we-1]??null:null,V=we<de.length-1?de[we+1]??null:null;f(ne=>({...ne,__features__:de})),await wh("feature",U,C,V).catch(()=>{});return}for(const de of m){const we=de.allPhases.map(C=>C.phase.id);if(we.includes(U)&&we.includes(B)){const C=Ao(we,we.indexOf(U),we.indexOf(B)),V=C.indexOf(U),ne=V>0?C[V-1]??null:null,me=V<C.length-1?C[V+1]??null:null;f(Ne=>({...Ne,[`phase-scope:${de.feature.id}`]:C})),await wh("phase",U,ne,me).catch(()=>{});return}}for(const de of m)for(const we of de.allPhases){const C=we.allTasks.map(V=>V.id);if(C.includes(U)&&C.includes(B)){const V=Ao(C,C.indexOf(U),C.indexOf(B)),ne=V.indexOf(U),me=ne>0?V[ne-1]??null:null,Ne=ne<V.length-1?V[ne+1]??null:null;f(je=>({...je,[`task-scope:${we.phase.id}`]:V})),await wh("task",U,me,Ne).catch(()=>{});return}}},q=te=>o.expandedPhaseIds.includes(te),X=te=>o.recentPhaseIds.includes(te),W=te=>o.recentTaskIds.includes(te),[ae,z]=Io(),[T,ee]=v.useState(null),fe=ae.get("locate"),be=fe?parseInt(fe.replace(/^T/i,""),10):null;v.useEffect(()=>{if(be==null||Number.isNaN(be))return;const te=a.flatMap(B=>B.tasks.map(ue=>({t:ue,p:B}))).find(({t:B})=>B.number===be);if(!te){z(B=>(B.delete("locate"),B),{replace:!0});return}const{t:re,p:ge}=te;if(o.onlyActiveBranches&&o.setOnlyActiveBranches(!1),o.hideDone&&o.setHideDone(!1),o.searchQuery&&o.setSearchQuery(""),o.setTreeOpenMode("smart"),ge.featureId){const B=ge.featureId;o.expandedFeatureIds.includes(B)||o.setExpandedFeatureIds(ue=>ue.includes(B)?ue:[...ue,B])}o.expandedPhaseIds.includes(ge.id)||o.setExpandedPhaseIds(B=>B.includes(ge.id)?B:[...B,ge.id]);const U=document.getElementById(`task-row-${be}`);if(U){const B=document.querySelector("header"),ue=document.querySelector(".ap-search-sticky"),de=((B==null?void 0:B.offsetHeight)??0)+((ue==null?void 0:ue.offsetHeight)??0)+12,we=U.getBoundingClientRect().top+window.scrollY-de;window.scrollTo({top:Math.max(0,we),behavior:"smooth"}),ee(re.id);const C=window.setTimeout(()=>ee(null),2500);return z(V=>(V.delete("locate"),V),{replace:!0}),()=>window.clearTimeout(C)}},[be,a,o.expandedFeatureIds,o.expandedPhaseIds,o.onlyActiveBranches,o.hideDone,o.searchQuery,o.treeOpenMode]);const ye=()=>{if(!N)return null;for(const te of m){if(te.feature.id===N)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(cr,{featureNum:te.feature.number}),c.jsx(ur,{status:te.feature.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:te.feature.name})]});for(const re of te.allPhases){if(re.phase.id===N)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(cr,{featureNum:te.feature.number,phaseNum:re.phase.number}),c.jsx(ur,{status:re.phase.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:re.phase.title})]});for(const ge of re.allTasks)if(ge.id===N)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(cr,{featureNum:te.feature.number,phaseNum:re.phase.number,taskNum:ge.number}),c.jsx(ur,{status:ge.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:ge.title})]})}}return null};return c.jsxs(Pt,{className:"grid gap-4",children:[c.jsx("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Work Tree"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Collapsible feature → phase → task tree. Click a feature or phase row to collapse/expand."})]})}),c.jsxs("div",{className:"ap-search-sticky z-20 grid gap-3",style:{top:A},children:[c.jsx(UC,{features:t,phases:a,query:o.searchQuery,onQuery:o.setSearchQuery}),c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsx(_m,{sort:o.sort,onChange:o.setSort}),o.searchActive?c.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:[o.matchedTaskIds.size," match",o.matchedTaskIds.size===1?"":"es"," — clear the box to reset."]}):null]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 rounded-[14px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 sm:grid-cols-3 sm:rounded-[18px] sm:px-4 sm:py-3 lg:grid-cols-6",children:[c.jsx(ai,{active:o.isAllExpanded,onClick:()=>o.isAllExpanded?o.collapseAll():o.expandAll(),children:o.isAllExpanded?"Collapse all":"Expand all"}),c.jsx(ai,{active:o.hideDone,onClick:()=>o.setHideDone(te=>!te),children:"Hide done"}),c.jsx(ai,{active:o.hidePlanned,onClick:()=>o.setHidePlanned(te=>!te),children:"Hide planned"}),c.jsx(ai,{active:o.onlyActiveBranches,onClick:()=>o.setOnlyActiveBranches(te=>!te),children:"Only active"}),c.jsx(ai,{onClick:o.resetFilters,children:"Reset"}),c.jsx(ai,{disabled:p,onClick:async()=>{g(!0),y(null);try{const te=await TR(),re=te.migrated,ge=te.integrity.duplicatePhaseIds.length,U=te.integrity.danglingPhaseIds.length;y(`Repair done: renamed ${re.renamed}, repaired ${re.repaired} refs, inferred ${re.inferred}, archived ${te.handoffs.archived} stale handoff(s). Integrity: ${ge} duplicate, ${U} dangling.`)}catch(te){y(`Repair failed: ${te instanceof Error?te.message:String(te)}`)}finally{g(!1)}},children:p?"Repairing…":"Repair"}),x?c.jsx("span",{className:"hidden text-xs text-[var(--text-muted)] sm:inline sm:truncate",children:x}):null]})]}),c.jsx("div",{className:"grid gap-3",children:m.length>0?c.jsxs($j,{sensors:L,collisionDetection:P2,onDragStart:S,onDragEnd:I,children:[c.jsx(Mm,{items:m.map(te=>te.feature.id),strategy:Om,children:m.map(te=>c.jsx(Lm,{id:te.feature.id,children:c.jsx(jT,{entry:te,expanded:o.expandedFeatureIds.includes(te.feature.id),recentlyChanged:o.recentFeatureIds.includes(te.feature.id),onToggle:()=>o.toggleExpandedFeature(te.feature.id),isPhaseExpanded:q,onTogglePhase:o.toggleExpandedPhase,isPhaseRecentlyChanged:X,isTaskRecentlyChanged:W,highlightedTaskIds:(()=>{const re=o.searchActive?o.matchedTaskIds:void 0;if(!T)return re;const ge=new Set(re??[]);return ge.add(T),ge})()})},te.feature.id))}),c.jsx(lT,{dropAnimation:{duration:150,easing:"ease"},children:ye()})]}):l.length>0?l.map(te=>{const re=te.featureId?`/features/${te.featureId}/phases/${te.phaseId}/tasks/${te.id}`:"/features";return c.jsxs(Ye,{to:re,className:"surface-card grid gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 truncate text-sm font-semibold text-[var(--text)]",children:[te.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,c.jsxs("span",{className:"truncate",children:["T",S2(te.number)," — ",te.title]})]}),c.jsx(ur,{status:te.status})]}),c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:te.phaseId})]},te.id)}):c.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function $C(){const{features:t,phases:a,activeTasks:l}=ll(),{project:s}=ys("root"),o=kr(),u=()=>o("/project/edit");Dn("edit",u);const f=s.projectRoot||s.planRoot||s.name||"default";return c.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[c.jsxs(Pt,{className:"grid grid-cols-1 gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsx("h2",{className:"min-w-0 text-lg font-bold text-[var(--text)]",children:"Project Goal"}),c.jsxs(gt,{type:"button",shortcut:"edit",onClick:u,className:"shrink-0",children:[c.jsx(gs,{className:"h-4 w-4"}),"Edit project"]})]}),s.goal?c.jsx(xn,{text:s.goal,className:"max-w-4xl"}):c.jsx("p",{className:"max-w-4xl text-sm text-[var(--text-muted)]",children:"Add a project goal to define the main objective."})]}),c.jsx(r2,{project:s}),c.jsx(N2,{features:t,phases:a}),c.jsx(HC,{features:t,phases:a,activeTasks:l,projectStorageScope:f}),c.jsx(c2,{features:t,phases:a}),c.jsx(f2,{features:t,phases:a})]})}async function qC(){const[t,a]=await Promise.all([Vb(),Jc()]);return{features:t,phases:a}}function zo(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function $c(t){const a=[];return t.active&&a.push(`${t.active} active`),t.planned&&a.push(`${t.planned} planned`),t.done&&a.push(`${t.done} done`),t.blocked&&a.push(`${t.blocked} blocked`),t.canceled&&a.push(`${t.canceled} canceled`),a.join(" · ")}function IC(t){const a=zo();for(const l of t){if(l.status==="in-progress"||l.status==="discovery"){a.active+=1;continue}if(l.status==="planned"||l.status==="draft"){a.planned+=1;continue}if(l.status==="done"){a.done+=1;continue}if(l.status==="blocked"){a.blocked+=1;continue}l.status==="canceled"&&(a.canceled+=1)}return a}function I0(t){const a=zo();for(const l of t){if(l.status==="in-progress"){a.active+=1;continue}if(l.status==="planned"){a.planned+=1;continue}if(l.status==="done"){a.done+=1;continue}if(l.status==="blocked"){a.blocked+=1;continue}l.status==="canceled"&&(a.canceled+=1)}return a}function VC(t){const a=zo();for(const l of t){if(l.status==="in-progress"){a.active+=1;continue}if(l.status==="planned"){a.planned+=1;continue}if(l.status==="done"){a.done+=1;continue}if(l.status==="blocked"){a.blocked+=1;continue}l.status==="canceled"&&(a.canceled+=1)}return a}function YC({feature:t,phases:a,phasesCount:l,tasksCount:s,phaseSummary:o,taskSummary:u,activity:f}){var L;const m=ps(),p=ps(),x=((L=m.formData)==null?void 0:L.get("status"))??t.status,y=m.state!=="idle",N=p.state!=="idle",w=$c(o),S=$c(u),A=s0(a??[]),R=t.description||(f?`${f.doneTasks}/${s} done · ${f.remainingTasks} left${f.blockedTasks?` · ${f.blockedTasks} blocked`:""}`:"");return c.jsxs(xi,{variant:"surface",status:A.displayStatus,className:"px-4 py-2",children:[c.jsxs("div",{className:"grid gap-2 xl:grid-cols-[minmax(0,1fr)_minmax(0,132px)_minmax(0,152px)_124px_44px_44px] xl:items-center",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 xl:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cr,{featureNum:t.number,featureId:t.id}),c.jsx(mr,{id:$l({featureNum:t.number}),children:c.jsx("span",{className:"sr-only",children:"Copy feature path"})}),t.shortId?c.jsx(ql,{shortId:t.shortId}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(Fo,{status:A.displayStatus,breakdown:A.breakdown})})]}),c.jsx(Ye,{to:`/features/${t.id}`,className:"entity-link--feature min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:t.name})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end xl:hidden",children:[c.jsx(Ye,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(p.Form,{method:"post",action:`/features/${t.id}/delete`,onSubmit:I=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||I.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:N||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l," phases"]}),w?c.jsx("div",{className:"mt-0.5 break-words",children:w}):null]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[s," tasks"]}),S?c.jsx("div",{className:"mt-0.5 break-words",children:S}):null]}),c.jsx(m.Form,{method:"post",action:`/features/${t.id}/status`,className:"w-full xl:w-auto",children:c.jsxs("div",{className:"relative",children:[c.jsx("select",{name:"status",value:x,disabled:y||N,"aria-busy":y,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:I=>m.submit(I.currentTarget.form),children:sd.map(I=>c.jsx("option",{value:I.value,children:I.label},I.value))}),c.jsx(xs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Ye,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,className:"hidden xl:block",children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(p.Form,{method:"post",action:`/features/${t.id}/delete`,className:"hidden xl:block",onSubmit:I=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||I.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:N||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]}),c.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:c.jsx(sl,{value:t.updatedAt})}),R?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:R}):null]})}const FC={feature:{label:"Feature",Icon:Dc},phase:{label:"Phase",Icon:$N},task:{label:"Task",Icon:Vo},requirement:{label:"Requirement",Icon:$b}};function V0({kind:t,label:a}){const{Icon:l,label:s}=FC[t];return c.jsxs("span",{className:`entity-badge entity-badge--${t}`,children:[c.jsx(l,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:a??s})]})}function ma({className:t="",...a}){return c.jsx("input",{className:`field-control ${t}`,...a})}function bs({className:t="",...a}){return c.jsx("select",{className:`field-control ${t}`,...a})}function od({query:t,status:a,statusOptions:l,placeholder:s,clearTo:o,resultsLabel:u}){const f=gm(),m=((l==null?void 0:l.length)??0)>0;return c.jsxs(ca,{method:"get",className:`surface-card grid gap-3 p-3 md:items-end sm:p-4 ${m?"md:grid-cols-[minmax(0,1fr)_200px_auto_auto]":"md:grid-cols-[minmax(0,1fr)_auto_auto]"}`,children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"list-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Name"}),c.jsx(ma,{id:"list-filter-query",name:"q",defaultValue:t,placeholder:s,className:"min-h-9 py-2 sm:min-h-11 sm:py-2.5",onChange:p=>f(p.currentTarget.form)})]}),m?c.jsxs("div",{children:[c.jsx("label",{htmlFor:"list-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),c.jsxs("div",{className:"relative",children:[c.jsxs(bs,{id:"list-filter-status",name:"status",defaultValue:a,className:"min-h-9 appearance-none py-2 sm:min-h-11 sm:py-2.5 pr-8",children:[c.jsx("option",{value:"",children:"All statuses"}),l==null?void 0:l.map(p=>c.jsx("option",{value:p.value,children:p.label},p.value))]}),c.jsx(xs,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}):null,c.jsx(gt,{type:"submit",variant:"secondary",children:"Apply filters"}),c.jsx(Ye,{to:o,className:"inline-flex min-h-9 items-center justify-center rounded-[12px] px-3 text-sm font-semibold text-[var(--text-muted)] transition hover:bg-[var(--accent-soft)] hover:text-[var(--text)] sm:min-h-11 sm:rounded-[14px]",children:"Clear"}),c.jsx("div",{className:`text-sm text-[var(--text-muted)] ${m?"md:col-span-4":"md:col-span-3"}`,children:u})]})}function ud(t,a){const l=t.trim().toLowerCase();return l?a.some(s=>s==null?void 0:s.toLowerCase().includes(l)):!0}function PC(t){const a=new Map;for(const f of t)f.featureId&&a.set(f.featureId,[...a.get(f.featureId)??[],f]);const l=new Map,s=new Map,o=new Map,u=new Map;for(const[f,m]of a)l.set(f,m.length),s.set(f,m.reduce((p,g)=>p+g.tasks.length,0)),o.set(f,IC(m)),u.set(f,I0(m.flatMap(p=>p.tasks)));return{phasesByFeature:a,phasesCountByFeature:l,tasksCountByFeature:s,phaseSummaryByFeature:o,taskSummaryByFeature:u}}function GC(){var w,S;const{features:t,phases:a}=ll(),{phasesByFeature:l,phasesCountByFeature:s,tasksCountByFeature:o,phaseSummaryByFeature:u,taskSummaryByFeature:f}=PC(a),m=kr(),[p]=Io(),g=((w=p.get("q"))==null?void 0:w.trim())??"",x=((S=p.get("status"))==null?void 0:S.trim())??"",y=v.useCallback(()=>m("new"),[m]);Dn("create",y);const N=v.useMemo(()=>t.filter(A=>(!x||A.status===x)&&ud(g,[A.name,A.id,A.description])),[t,g,x]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Pt,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx(V0,{kind:"feature",label:"Features"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter by name or status, then inspect child phases and tasks directly from the rows."})]}),c.jsx(Ye,{to:"new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),c.jsx(od,{query:g,status:x,statusOptions:sd,placeholder:"Search feature name, id, or description",clearTo:"/features",resultsLabel:N.length===t.length?`${t.length} features`:`${N.length} of ${t.length} features`}),c.jsx("div",{className:"grid gap-3",children:t.length===0?c.jsxs(Pt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No features yet. ",c.jsx(Ye,{to:"/features/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first feature"})]}):N.length>0?N.map(A=>c.jsx(YC,{feature:A,phases:l.get(A.id),phasesCount:s.get(A.id)??0,tasksCount:o.get(A.id)??0,phaseSummary:u.get(A.id)??zo(),taskSummary:f.get(A.id)??zo()},A.id)):c.jsx(Pt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),c.jsx(pi,{})]})}async function XC(){const[t,a]=await Promise.all([xm(),Jc()]);return{requirements:t,phases:a}}function xo(...t){return t.filter(Boolean).join(" ")}function QC(){return c.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text)] shadow-sm transition group-open:rotate-180 group-hover:border-[var(--accent)] group-hover:text-[var(--accent)]",children:c.jsx(xs,{className:"h-5 w-5"})})}function ua({title:t,subtitle:a,leading:l,actions:s,defaultOpen:o=!0,count:u,className:f,summaryClassName:m,contentClassName:p,titleClassName:g,subtitleClassName:x,children:y}){return c.jsxs("details",{className:xo("group mt-4 overflow-hidden rounded-[10px] border border-[var(--border)]",f),open:o,children:[c.jsxs("summary",{className:xo("flex min-w-0 list-none cursor-pointer items-start justify-between gap-3 bg-[var(--surface-elevated)] p-4 text-left text-[var(--text)] transition-colors select-none hover:bg-[var(--surface-strong)] [&::-webkit-details-marker]:hidden",m),children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l?c.jsx("div",{className:"shrink-0 pt-0.5",children:l}):null,c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:xo("flex flex-wrap items-center gap-2 text-sm font-semibold",g),children:[t,u!==void 0?c.jsxs("span",{className:"text-[var(--text-subtle)]",children:["(",u,")"]}):null]}),a?c.jsx("div",{className:xo("mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",x),children:a}):null]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s,c.jsx(QC,{})]})]}),c.jsx("div",{className:xo("border-t border-[var(--border)] bg-[var(--surface)] p-4",p),children:y})]})}function KC(t,a){const l=new Set(a.map(u=>u.id)),s=a.map(u=>({phase:u,requirements:t.filter(f=>f.linkedPhaseIds.includes(u.id))})).filter(u=>u.requirements.length>0).sort((u,f)=>u.phase.priority-f.phase.priority||u.phase.number-f.phase.number),o=t.filter(u=>!u.linkedPhaseIds.some(f=>l.has(f)));return{phaseGroups:s,unlinkedRequirements:o}}function Ix(t){return`P${String(t.number??0).padStart(3,"0")}`}function Vx({requirement:t}){return c.jsx(Pt,{className:"overflow-hidden p-0",children:c.jsx(ua,{defaultOpen:!1,title:c.jsx("h2",{className:"min-w-0 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:t.title}),count:t.linkedPhaseIds.length,subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[t.linkedPhaseIds.length," linked phase",t.linkedPhaseIds.length===1?"":"s"]}),t.linkedPhaseIds.length>0&&t.macroTasks.length>0?c.jsx("span",{className:"mx-2 text-[var(--text-subtle)]",children:"•"}):null,t.macroTasks.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[t.macroTasks.length," macro task",t.macroTasks.length===1?"":"s"]}):null]}),contentClassName:"grid gap-4",summaryClassName:"hover:bg-[var(--surface-elevated)]/65",children:c.jsxs("div",{className:"flex min-w-0 flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[c.jsx("div",{className:"min-w-0",children:t.description?c.jsx("p",{className:"min-w-0 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.description}):null}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[c.jsx(Ye,{to:`${t.id}/edit`,children:c.jsx(gt,{type:"button",variant:"secondary",children:"Edit"})}),c.jsx(ca,{method:"post",action:`/requirements/${t.id}/delete`,onSubmit:a=>{window.confirm(`Delete requirement "${t.title}"?`)||a.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",children:"Delete"})})]})]})})})}function ZC(){var x;const{requirements:t,phases:a}=ll(),l=kr(),[s]=Io(),o=((x=s.get("q"))==null?void 0:x.trim())??"",u=v.useCallback(()=>l("new"),[l]);Dn("create",u);const f=v.useMemo(()=>new Map(a.map(y=>[y.id,y])),[a]),m=v.useMemo(()=>t.filter(y=>{const N=y.linkedPhaseIds.map(w=>{const S=f.get(w);return S?`${Ix(S)} ${S.title} ${S.summary}`:w});return ud(o,[y.title,y.description,y.id,...N])}),[t,f,o]),{phaseGroups:p,unlinkedRequirements:g}=v.useMemo(()=>KC(m,a),[m,a]);return v.useEffect(()=>{const y=window.location.hash.slice(1);y&&requestAnimationFrame(()=>{var N;return(N=document.getElementById(y))==null?void 0:N.scrollIntoView({block:"start"})})},[p]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Pt,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx(V0,{kind:"requirement",label:"Requirements"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Track top-level outcomes independently from features, grouped below by the phases that deliver them."})]}),c.jsx(Ye,{to:"new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create requirement"})})]}),c.jsx(od,{query:o,placeholder:"Search requirement title, description, id, or linked phase",clearTo:"/requirements",resultsLabel:m.length===t.length?`${t.length} requirements`:`${m.length} of ${t.length} requirements`}),c.jsx("div",{className:"grid gap-6",children:t.length===0?c.jsxs(Pt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No requirements yet. ",c.jsx(Ye,{to:"/requirements/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first requirement"})]}):m.length>0?c.jsxs(c.Fragment,{children:[p.map(({phase:y,requirements:N})=>{const w=y.featureId?`/features/${y.featureId}/phases/${y.id}`:"/features";return c.jsxs("section",{id:`phase-${y.id}`,className:"scroll-mt-28","aria-labelledby":`phase-${y.id}-heading`,children:[c.jsxs("div",{className:"mb-3 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Linked phase"}),c.jsxs(Ye,{id:`phase-${y.id}-heading`,to:w,className:"min-w-0 break-words text-base font-black text-[var(--text)] underline-offset-4 hover:text-[var(--accent)] hover:underline [overflow-wrap:anywhere]",children:[Ix(y)," — ",y.title]})]}),c.jsxs("span",{className:"shrink-0 rounded-full bg-[var(--surface-elevated)] px-2.5 py-1 text-xs font-semibold text-[var(--text-muted)]",children:[N.length," requirement",N.length===1?"":"s"]})]}),c.jsx("div",{className:"grid gap-3",children:N.map(S=>c.jsx(Vx,{requirement:S},S.id))})]},y.id)}),g.length>0?c.jsxs("section",{id:"unlinked-requirements",className:"scroll-mt-28","aria-labelledby":"unlinked-requirements-heading",children:[c.jsxs("div",{className:"mb-3 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Unlinked"}),c.jsx("h2",{id:"unlinked-requirements-heading",className:"text-base font-black text-[var(--text)]",children:"Requirements without a valid phase"})]}),c.jsx("span",{className:"shrink-0 rounded-full bg-[var(--surface-elevated)] px-2.5 py-1 text-xs font-semibold text-[var(--text-muted)]",children:g.length})]}),c.jsx("div",{className:"grid gap-3",children:g.map(y=>c.jsx(Vx,{requirement:y},y.id))})]}):null]}):c.jsx(Pt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No requirements match the current filters."})})]}),c.jsx(pi,{})]})}async function JC({params:t}){const a=t.featureId;if(!a)throw new Response("featureId required",{status:400});const[l,s]=await Promise.all([Yo(a),Jc(a)]);return{feature:l,phases:s}}function WC({featureId:t,feature:a,phase:l}){var y,N;const s=ps(),o=ps(),f=((y=s.formData)==null?void 0:y.get("status"))??l.status,m=s.state!=="idle",p=o.state!=="idle",g=$c(I0(l.tasks)),x=i0(l.tasks);return c.jsxs(xi,{variant:"surface",status:x.displayStatus,className:"px-4 py-2",children:[c.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,150px)_124px_44px_44px] lg:items-center",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cr,{featureNum:a.number,phaseNum:l.number,featureId:a.id,phaseId:l.id}),c.jsx(mr,{id:$l({featureNum:a.number,phaseNum:l.number}),children:c.jsx("span",{className:"sr-only",children:"Copy phase path"})}),l.shortId?c.jsx(ql,{shortId:l.shortId}):null,l.handoff?c.jsx(Sm,{phaseId:l.id,updatedAt:l.handoffUpdatedAt}):null,c.jsx(z0,{phaseId:l.id,phaseTitle:l.title,count:((N=l.linkedRequirements)==null?void 0:N.length)??0}),c.jsx("span",{className:"shrink-0",children:c.jsx(Fo,{status:x.displayStatus,breakdown:x.breakdown})})]}),c.jsx(Ye,{to:`/features/${t}/phases/${l.id}`,className:"entity-link--phase min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:l.title})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[c.jsx(Ye,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,onSubmit:w=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||w.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${l.title}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l.tasks.length," tasks"]}),g?c.jsx("div",{className:"mt-0.5 break-words",children:g}):null]}),c.jsx(s.Form,{method:"post",action:`/features/${t}/phases/${l.id}/status`,className:"w-full lg:w-auto",children:c.jsxs("div",{className:"relative",children:[c.jsx("select",{name:"status",value:f,disabled:m||p,"aria-busy":m,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:w=>s.submit(w.currentTarget.form),children:id.map(w=>c.jsx("option",{value:w.value,children:w.label},w.value))}),c.jsx(xs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Ye,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,className:"hidden lg:block",children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,className:"hidden lg:block",onSubmit:w=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||w.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${l.title}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]}),c.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:c.jsx(sl,{value:l.updatedAt})}),l.summary?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:l.summary}):null]})}function Bm({items:t,className:a="",stacked:l=!1}){return l?c.jsx("nav",{"aria-label":"Breadcrumb",className:`grid gap-1 text-sm ${a}`,children:t.map((s,o)=>{const u=o===t.length-1,f=s.to&&!u?c.jsx(Ye,{to:s.to,className:"font-semibold text-[var(--accent)] hover:underline break-words min-w-0",children:s.label}):c.jsx("span",{className:`break-words min-w-0 ${u?"text-[var(--text)] font-semibold":"text-[var(--text-muted)]"}`,children:s.label});return c.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[s.kind?c.jsxs("span",{className:"shrink-0 text-[var(--text-subtle)] font-medium",children:[s.kind,":"]}):null,c.jsx("span",{className:"min-w-0",children:f})]},`${s.label}-${o}`)})}):c.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${a}`,children:t.map((s,o)=>{const u=o===t.length-1,f=s.to&&!u?c.jsx(Ye,{to:s.to,className:"font-semibold text-[var(--accent)] hover:underline",children:s.label}):c.jsx("span",{className:u?"text-[var(--text)]":"text-[var(--text-muted)]",children:s.label});return c.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[o>0?c.jsx("span",{className:"text-[var(--text-subtle)]",children:"/"}):null,c.jsx("span",{className:"min-w-0 break-words",children:f})]},`${s.label}-${o}`)})})}function Hm({featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:o,taskId:u,shortId:f,children:m}){return c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(cr,{featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:o,taskId:u}),c.jsx(mr,{id:$l({featureNum:t,phaseNum:a,taskNum:l}),children:c.jsx("span",{className:"sr-only",children:"Copy path"})}),f?c.jsx(ql,{shortId:f}):null,m]})}function zn({className:t="",children:a,...l}){return c.jsx("div",{className:`surface-card p-4 ${t}`,...l,children:a})}function Yx(...t){return t.filter(Boolean).join(" ")}function $m({items:t,className:a}){const l=t.filter(s=>s.visible!==!1);return l.length===0?null:c.jsx("div",{className:Yx("grid gap-4 md:grid-cols-2 xl:grid-cols-4",a),children:l.map(s=>c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:s.label}),c.jsx("div",{className:Yx("mt-2 text-sm font-semibold break-words text-[var(--text)] [overflow-wrap:anywhere]",s.valueClassName),children:s.value})]},s.label))})}function qm(t){return t&&t>0?`P${t}`:""}function eA(t,a){return!t&&!a?"":`${t||"Start not set"} → ${a||"End not set"}`}function Im({decisions:t}){return t.length===0?null:c.jsxs("details",{className:"group mt-4",children:[c.jsx("summary",{className:"flex cursor-pointer select-none items-center gap-2 font-semibold text-[var(--text)]",children:c.jsxs("span",{children:["Accepted decisions (",t.length,")"]})}),c.jsx("div",{className:"mt-2 grid gap-3",children:t.map(a=>c.jsxs("div",{className:"surface-card px-4 py-3",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?c.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"}),c.jsx(xn,{text:a.decision,className:"mt-1"})]}):null,a.rationale?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"}),c.jsx(xn,{text:a.rationale,className:"mt-1"})]}):null,a.implementationNotes?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"}),c.jsx(xn,{text:a.implementationNotes,className:"mt-1"})]}):null]},a.id))})]})}const tA={draft:jN,discovery:aR,planned:Vo,"in-progress":Ub,done:vm,blocked:Hb,waiting:zb,deferred:iR,canceled:Mb,rejected:CN};function $h(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Fx(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}const nA=new Set(["canceled","rejected"]);function Vm({statusLog:t,currentStatus:a,backbone:l,createdAt:s,updatedAt:o,startedAt:u,completedAt:f}){const m=[];if(t.length===0){const S=l.indexOf(a);if(S>=0)for(let A=0;A<=S;A++)m.push(l[A]);else m.push(a)}else{const S=t[0];S&&m.push(S.fromStatus);for(const A of t)m[m.length-1]!==A.toStatus&&m.push(A.toStatus)}m[m.length-1]!==a&&m.push(a);const p=new Set(m),g=a==="done"||nA.has(a),x=S=>{var R,L;if(t.length>0){if(S===((R=t[0])==null?void 0:R.fromStatus))return((L=t[0])==null?void 0:L.date)??"";for(const I of t)if(I.toStatus===S)return I.date;return""}const A=l[0];return S===A?s??"":S==="in-progress"?u??o??"":S==="done"?f??o??"":""},y=[...m];if(!g){const S=l.indexOf(a);if(S>=0&&S+1<l.length){const A=l[S+1];p.has(A)||y.push(A)}}const N=t.length===0?y.filter((S,A)=>A===0||S===a||!!x(S)):y,w=S=>p.has(S)?S===a&&!g?"current":"completed":"pending";return c.jsx("ol",{className:"status-stepper",role:"list","aria-label":"Status progress",children:N.map((S,A)=>{const R=w(S),L=tA[S]??Xc,I=p.has(S),q=x(S),X=q?`${$h(S)} — ${Fx(q)}`:$h(S),W=A===0?null:I?"traveled":"pending";return c.jsxs("li",{className:`status-step status-step--${R}`,role:"listitem","aria-current":R==="current"?"step":void 0,style:{"--step-color":`var(--color-status-${S})`},children:[W?c.jsx("span",{className:`status-connector status-connector--${W}`,"aria-hidden":"true"}):null,c.jsx("span",{className:"status-node",title:X,children:c.jsx(L,{className:"status-node-icon"})}),c.jsx("span",{className:"status-step-label",children:$h(S)}),q?c.jsx("span",{className:"status-step-date",children:Fx(q)}):null]},`${S}-${A}`)})})}function Px(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function aA(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}function rA(t,a,l,s,o){if(t.length>0)return t.map(m=>({date:m.date,fromStatus:m.fromStatus,toStatus:m.toStatus,inferred:!1}));const u=l.indexOf(a);if(u<0)return[];const f=[];for(let m=1;m<=u;m++){const p=l[m-1],g=l[m],x=g==="in-progress"?s??"":g==="done"?o??"":"";f.push({date:x,fromStatus:p,toStatus:g,inferred:!0})}return f}function Ym({statusLog:t,currentStatus:a,backbone:l,startedAt:s,completedAt:o}){const u=rA(t??[],a??"",l??[],s,o);return c.jsx(ua,{title:"Status history",count:u.length,defaultOpen:u.length>0,contentClassName:"grid gap-2.5",children:u.length===0?c.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No status changes recorded."}):u.map((f,m)=>c.jsxs("div",{className:"text-sm flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-xs font-mono text-[var(--text-subtle)]",children:aA(f.date)}),c.jsx("span",{className:"font-semibold text-[var(--text-muted)]",children:Px(f.fromStatus)}),c.jsx("span",{className:"text-[var(--text-subtle)]",children:"→"}),c.jsx("span",{className:"font-semibold text-[var(--text)]",children:Px(f.toStatus)})]},m))})}function lA(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function sA(t){let a=0,l=0,s=0,o=0;for(const u of t)for(const f of u.tasks)f.status==="in-progress"&&(a+=1),f.status==="done"&&(l+=1),f.status==="blocked"&&(s+=1),["done","canceled"].includes(f.status)||(o+=1);return{inProgress:a,done:l,blocked:s,remaining:o}}function iA(t){return t.find(a=>["in-progress","discovery","planned","draft"].includes(a.status))}function oA(){var W,ae,z,T;const{feature:t,phases:a}=ll(),l=t.acceptedDecisions??[],s=lA(a),o=sA(a),u=iA(a),f=s0(a),[m,p]=Io(),g=((W=m.get("q"))==null?void 0:W.trim())??"",x=((ae=m.get("status"))==null?void 0:ae.trim())??"",y=((z=m.get("sort"))==null?void 0:z.trim())??"priority",N=((T=m.get("dir"))==null?void 0:T.trim())??"asc",w={key:y==="priority"||y==="number"||y==="createdAt"||y==="updatedAt"||y==="title"||y==="shortId"||y==="status"||y==="startedAt"||y==="completedAt"?y:"priority",direction:N==="desc"?"desc":"asc"},S=v.useMemo(()=>[...a].sort((ee,fe)=>Ro(ee,fe,w.key,w.direction)),[a,w]),A=v.useMemo(()=>S.filter(ee=>(!x||ee.status===x)&&ud(g,[ee.title,ee.id,ee.summary,ee.description])),[S,g,x]),R=kr(),L=v.useRef(null),I=v.useCallback(()=>R("edit"),[R]),q=v.useCallback(()=>R("phases/new"),[R]),X=v.useCallback(()=>{var ee;(ee=L.current)==null||ee.requestSubmit()},[]);return Dn("edit",I),Dn("create",q),Dn("delete",X),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ye,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Gc,{className:"h-4 w-4"})," Back to features"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Bm,{stacked:!0,items:[{label:t.name,kind:"Feature"}]}),c.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:c.jsx(Hm,{featureNum:t.number,featureId:t.id,shortId:t.shortId,children:c.jsx(Fo,{status:f.displayStatus,breakdown:f.breakdown})})}),c.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:t.name}),t.description?c.jsx(ua,{title:c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"Description"}),c.jsx(sl,{value:t.descriptionUpdatedAt})]}),children:c.jsx(xn,{text:t.description,className:"plan-description max-w-4xl"})}):null,c.jsx("div",{className:"mt-4",children:c.jsx(Vm,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"],createdAt:t.createdAt,updatedAt:t.updatedAt})}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Ye,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit feature"})}),c.jsx(ca,{ref:L,method:"post",action:`/features/${t.id}/delete`,className:"inline-flex",onSubmit:ee=>{window.confirm(`Delete feature "${t.name}"?`)||ee.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]})]}),c.jsxs(Pt,{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),c.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(u==null?void 0:u.title)||"No active phase"})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.length})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:s})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),c.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(u==null?void 0:u.title)||"No active phase"})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.inProgress})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.remaining})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.done})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.blocked})]})]}),c.jsx($m,{items:[{label:"Entity last updated",value:Bl(t.updatedAt),visible:!!t.updatedAt},{label:"Priority",value:qm(t.priority),visible:t.priority>0},{label:"Timeline",value:eA(t.startDate,t.endDate),visible:!!(t.startDate||t.endDate)}]}),t.workDone||t.workRemaining?c.jsx(ua,{title:"Planning notes",defaultOpen:!1,children:c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[t.workDone?c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work done"}),c.jsx(xn,{text:t.workDone,className:"mt-2"})]}):null,t.workRemaining?c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work remaining"}),c.jsx(xn,{text:t.workRemaining,className:"mt-2"})]}):null]})}):null,l.length>0?c.jsx(Im,{decisions:l}):null,c.jsx(Ym,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"]})]}),c.jsxs(Pt,{className:"grid gap-5",children:[c.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this feature's phases."})]}),c.jsx(Ye,{to:"phases/new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[c.jsx(_m,{sort:w,onChange:ee=>p(fe=>(fe.set("sort",ee.key),fe.set("dir",ee.direction),fe))}),c.jsx(od,{query:g,status:x,statusOptions:id,placeholder:"Search phase title, id, or summary",clearTo:`/features/${t.id}`,resultsLabel:A.length===a.length?`${a.length} phases`:`${A.length} of ${a.length} phases`})]}),c.jsx("div",{className:"grid gap-3",children:a.length===0?c.jsxs(Pt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No phases yet. ",c.jsx(Ye,{to:`/features/${t.id}/phases/new`,className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a phase"})]}):A.length>0?A.map(ee=>c.jsx(WC,{featureId:t.id,feature:t,phase:ee},ee.id)):c.jsx(Pt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),c.jsx(pi,{})]})}async function uA({params:t}){const{featureId:a,phaseId:l}=t;if(!a||!l)throw new Response("featureId and phaseId required",{status:400});const[s,o,u]=await Promise.all([Yo(a),Wc(l),xm()]),f=u.filter(m=>m.linkedPhaseIds.includes(l));return{feature:s,phase:{...o,linkedRequirements:f}}}function cA({featureId:t,featureNum:a,phaseId:l,phaseNum:s,task:o}){var w;const u=ps(),f=ps(),p=((w=u.formData)==null?void 0:w.get("status"))??o.status,g=u.state!=="idle",x=f.state!=="idle",y=$c(VC(o.subtasks)),N=n0(p);return c.jsxs(xi,{variant:"surface",status:N,className:"px-4 py-2",children:[c.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,168px)_124px_44px_44px] lg:items-center",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cr,{featureNum:a,phaseNum:s,taskNum:o.number,featureId:t,phaseId:l,taskId:o.id}),c.jsx(mr,{id:$l({featureNum:a,phaseNum:s,taskNum:o.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),o.shortId?c.jsx(ql,{shortId:o.shortId}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(ur,{status:p})})]}),c.jsx(Ye,{to:`/features/${t}/phases/${l}/tasks/${o.id}`,className:"entity-link--task min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:o.title})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[c.jsx(Ye,{to:`/features/${t}/phases/${l}/tasks/${o.id}/edit`,"aria-label":`Edit task ${o.title}`,children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(f.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${o.id}/delete`,onSubmit:S=>{window.confirm(`Delete task “${o.title}”? This cannot be undone.`)||S.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:x||g,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${o.title}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[o.subtasks.length," subtasks · ",o.checklist.length," checklist"]}),y?c.jsx("div",{className:"mt-0.5 break-words",children:y}):c.jsx("div",{className:"mt-0.5 break-words",children:"No subtask statuses yet"})]}),c.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${o.id}/status`,className:"w-full lg:w-auto",children:c.jsxs("div",{className:"relative",children:[c.jsx("select",{name:"status",value:p,disabled:g||x,"aria-busy":g,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:S=>u.submit(S.currentTarget.form),children:Ko.map(S=>c.jsx("option",{value:S.value,children:S.label},S.value))}),c.jsx(xs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Ye,{to:`/features/${t}/phases/${l}/tasks/${o.id}/edit`,"aria-label":`Edit task ${o.title}`,className:"hidden lg:block",children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(f.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${o.id}/delete`,className:"hidden lg:block",onSubmit:S=>{window.confirm(`Delete task “${o.title}”? This cannot be undone.`)||S.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:x||g,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${o.title}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]}),c.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--text-subtle)]",children:[c.jsx(sl,{value:o.updatedAt}),o.startedAt?c.jsxs("span",{children:["Started ",Bl(o.startedAt)]}):null,o.completedAt?c.jsxs("span",{children:["Completed ",Bl(o.completedAt)]}):null]}),o.description?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:o.description}):null]})}function dA(t){let a=0,l=0,s=0,o=0;for(const u of t.tasks)u.status==="in-progress"&&(a+=1),u.status==="done"&&(l+=1),u.status==="blocked"&&(s+=1),["done","canceled"].includes(u.status)||(o+=1);return{inProgress:a,done:l,blocked:s,remaining:o}}function fA(){var fe,be,ye,te;const{feature:t,phase:a}=ll(),l=a.decisions??[],s=a.acceptedDecisions??[],o=a.linkedRequirements??[],u=dA(a),f=i0(a.tasks),[m,p]=Io(),g=((fe=m.get("q"))==null?void 0:fe.trim())??"",x=((be=m.get("status"))==null?void 0:be.trim())??"",y=((ye=m.get("sort"))==null?void 0:ye.trim())??"priority",N=((te=m.get("dir"))==null?void 0:te.trim())??"asc",w={key:y==="priority"||y==="number"||y==="createdAt"||y==="updatedAt"||y==="title"||y==="shortId"||y==="status"||y==="startedAt"||y==="completedAt"?y:"priority",direction:N==="desc"?"desc":"asc"},S=v.useMemo(()=>[...a.tasks].sort((re,ge)=>Ro(re,ge,w.key,w.direction)),[a.tasks,w]),A=v.useMemo(()=>S.filter(re=>(!x||re.status===x)&&ud(g,[re.title,re.id,re.description,re.shortName])),[S,g,x]),R=kr(),L=v.useRef(null),[I,q]=v.useState(a.handoff??""),[X,W]=v.useState(!1),ae=v.useCallback(()=>R("edit"),[R]),z=v.useCallback(()=>R("tasks/new"),[R]),T=v.useCallback(()=>{var re;(re=L.current)==null||re.requestSubmit()},[]),ee=v.useCallback(async()=>{if(window.confirm("Clear this phase's handoff?")){W(!0);try{await Gb(a.id),q("")}catch{}finally{W(!1)}}},[a.id]);return Dn("edit",ae),Dn("create",z),Dn("delete",T),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ye,{to:`/features/${t.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Gc,{className:"h-4 w-4"})," Back to feature"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Bm,{stacked:!0,items:[{label:t.name,to:`/features/${t.id}`,kind:"Feature"},{label:a.title,kind:"Phase"}]}),c.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:c.jsxs(Hm,{featureNum:t.number,phaseNum:a.number,featureId:t.id,phaseId:a.id,shortId:a.shortId,children:[I?c.jsx(Sm,{phaseId:a.id,updatedAt:a.handoffUpdatedAt}):null,c.jsx(Fo,{status:f.displayStatus,breakdown:f.breakdown})]})}),c.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:a.title}),a.summary?c.jsx(xn,{text:a.summary,className:"mt-3 max-w-4xl"}):null,c.jsx(Vm,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"],createdAt:a.createdAt,updatedAt:a.updatedAt}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Ye,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit phase"})}),c.jsx(Ye,{to:"tasks/new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})}),c.jsx(ca,{ref:L,method:"post",action:`/features/${t.id}/phases/${a.id}/delete`,className:"inline-flex",onSubmit:re=>{window.confirm(`Delete phase "${a.title}"?`)||re.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]})]}),c.jsxs(Pt,{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.tasks.length})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.inProgress})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.remaining})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.done})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.blocked})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Goals"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.goals.length})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Dependencies"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.dependencies.length})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completion criteria"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.completionCriteria.length})]})]}),c.jsx($m,{items:[{label:"Entity last updated",value:Bl(a.updatedAt),visible:!!a.updatedAt},{label:"Priority",value:qm(a.priority),visible:a.priority>0},{label:"Linked requirements",value:o.length,visible:o.length>0,valueClassName:"text-2xl font-black"},{label:"Risks",value:a.risks.length,visible:a.risks.length>0,valueClassName:"text-2xl font-black"},{label:"Open questions",value:a.openQuestions.length,visible:a.openQuestions.length>0,valueClassName:"text-2xl font-black"}]}),a.notes?c.jsx(ua,{title:"Notes",defaultOpen:!1,children:c.jsx(xn,{text:a.notes,className:"plan-description"})}):null,c.jsx(ua,{title:"Linked requirements",count:o.length,defaultOpen:!1,children:o.length>0?c.jsx("div",{className:"grid gap-3",children:o.map(re=>c.jsx("div",{className:"min-w-0 rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:c.jsxs("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(ur,{status:re.status}),re.macroTasks.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[re.macroTasks.length," macro task",re.macroTasks.length===1?"":"s"]}):null]}),c.jsx("h3",{className:"mt-2 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:re.title}),re.description?c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:re.description}):null]}),c.jsx(Ye,{to:`/requirements#phase-${a.id}`,className:"text-sm font-semibold text-[var(--accent)] hover:underline sm:shrink-0",children:"Open phase requirements →"})]})},re.id))}):c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No linked requirements yet."})}),a.description?c.jsx(ua,{title:c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"Description"}),c.jsx(sl,{value:a.descriptionUpdatedAt})]}),children:c.jsx(xn,{text:a.description,className:"plan-description"})}):null,l.length>0?c.jsx(ua,{title:"Decisions",count:l.length,defaultOpen:!1,children:c.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:l.map((re,ge)=>c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:c.jsx(xn,{text:re})},ge))})}):null,s.length>0?c.jsx(Im,{decisions:s}):null,c.jsx(Ym,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"]})]}),I?c.jsx(Pt,{className:"grid gap-4",children:c.jsx(ua,{title:"Handoff",actions:c.jsx("button",{type:"button",onClick:ee,disabled:X,className:"rounded-lg border border-[var(--border)] px-3 py-1.5 text-sm text-[var(--text-muted)] hover:bg-[var(--surface-card)] disabled:opacity-60",children:X?"Clearing…":"Clear handoff"}),children:c.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:c.jsx(xn,{text:I,className:"formatted-text max-w-none"})})})}):null,c.jsxs(Pt,{className:"grid gap-5",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this phase's tasks."})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[c.jsx(_m,{sort:w,onChange:re=>p(ge=>(ge.set("sort",re.key),ge.set("dir",re.direction),ge))}),c.jsx(od,{query:g,status:x,statusOptions:Ko,placeholder:"Search task title, id, or description",clearTo:`/features/${t.id}/phases/${a.id}`,resultsLabel:A.length===a.tasks.length?`${a.tasks.length} tasks`:`${A.length} of ${a.tasks.length} tasks`})]}),c.jsx("div",{className:"grid gap-3",children:a.tasks.length===0?c.jsxs(Pt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No tasks yet. ",c.jsx(Ye,{to:"tasks/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a task"})]}):A.length>0?A.map(re=>c.jsx(cA,{featureId:t.id,featureNum:t.number,phaseId:a.id,phaseNum:a.number,task:re},re.id)):c.jsx(Pt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),c.jsx(pi,{})]})}async function hA({params:t}){const{featureId:a,phaseId:l,taskId:s}=t;if(!a||!l||!s)throw new Response("featureId, phaseId and taskId required",{status:400});const[o,u,f]=await Promise.all([Yo(a),Wc(l),ed(s)]);return{feature:o,phase:u,task:f}}function mA({featureId:t,phaseId:a,taskId:l,item:s}){const o=ps(),u=o.formData?o.formData.get("checked")==="true":s.checked,f=o.state!=="idle";return c.jsxs("div",{className:"surface-card flex items-start gap-3 px-4 py-3",children:[c.jsx("input",{type:"checkbox",checked:u,onChange:()=>o.submit({checked:s.checked?"false":"true"},{method:"post",action:`/features/${t}/phases/${a}/tasks/${l}/checklist/${s.id}/toggle`}),disabled:f,className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]","aria-label":`Toggle checklist item ${s.title}`}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"checklist-num",children:s.number})," ",c.jsx("span",{className:`text-sm ${u?"text-[var(--text-muted)] line-through":"font-medium text-[var(--text)]"}`,children:s.title})]})]})}function pA(){var x,y;const{feature:t,phase:a,task:l}=ll(),s=l.decisions??[],o=l.acceptedDecisions??[],u=l.checklist??[],f=kr(),m=v.useRef(null),p=v.useCallback(()=>f("edit"),[f]),g=v.useCallback(()=>{var N;(N=m.current)==null||N.requestSubmit()},[]);return Dn("edit",p),Dn("delete",g),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ye,{to:`/features/${t.id}/phases/${a.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Gc,{className:"h-4 w-4"})," Back to phase"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Bm,{stacked:!0,items:[{label:t.name,to:`/features/${t.id}`,kind:"Feature"},{label:a.title,to:`/features/${t.id}/phases/${a.id}`,kind:"Phase"},{label:l.title,kind:"Task"}]}),c.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:c.jsx(Hm,{featureNum:t.number,phaseNum:a.number,taskNum:l.number,featureId:t.id,phaseId:a.id,taskId:l.id,shortId:l.shortId,children:c.jsx(ur,{status:l.status})})}),c.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:l.title}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Ye,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit task"})}),c.jsx(ca,{ref:m,method:"post",action:`/features/${t.id}/phases/${a.id}/tasks/${l.id}/delete`,className:"inline-flex",onSubmit:N=>{window.confirm(`Delete task "${l.title}"?`)||N.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]})]}),c.jsx(Vm,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],createdAt:l.createdAt,updatedAt:l.updatedAt,startedAt:l.startedAt,completedAt:l.completedAt}),c.jsxs(Pt,{className:"grid gap-4",children:[l.description?c.jsx(ua,{title:c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"Description"}),c.jsx(sl,{value:l.descriptionUpdatedAt})]}),children:c.jsx(xn,{text:l.description,className:"plan-description"})}):null,l.notes?c.jsx(ua,{title:"Notes",defaultOpen:!1,children:c.jsx(xn,{text:l.notes})}):null,c.jsx(Ym,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],startedAt:l.startedAt,completedAt:l.completedAt}),s.length>0?c.jsx(ua,{title:"Decisions",count:s.length,defaultOpen:!1,children:c.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:s.map((N,w)=>c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:c.jsx(xn,{text:N})},w))})}):null,o.length>0?c.jsx(Im,{decisions:o}):null,c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Checklist items"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:u.length})]}),c.jsxs(zn,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Subtasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:((x=l.subtasks)==null?void 0:x.length)??0})]})]}),c.jsx($m,{items:[{label:"Entity last updated",value:Bl(l.updatedAt),visible:!!l.updatedAt},{label:"Priority",value:qm(l.priority),visible:l.priority>0},{label:"Short name",value:l.shortName,visible:!!l.shortName},{label:"Started",value:Bl(l.startedAt),visible:!!l.startedAt},{label:"Completed",value:Bl(l.completedAt),visible:!!l.completedAt},{label:"Phase",value:a.title}]}),c.jsxs("div",{className:"grid gap-3",children:[c.jsx("div",{children:c.jsxs("h3",{className:"text-sm font-bold text-[var(--text)]",children:["Steps (",u.length,")"]})}),u.length?c.jsx("div",{className:"grid gap-2",children:u.map(N=>c.jsx(mA,{featureId:t.id,phaseId:a.id,taskId:l.id,item:N},N.id))}):c.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No steps defined."})]}),(y=l.subtasks)!=null&&y.length?c.jsx(ua,{title:"Subtasks",count:l.subtasks.length,defaultOpen:!1,contentClassName:"grid gap-2",children:l.subtasks.map(N=>c.jsxs("div",{className:"surface-card flex items-center justify-between gap-4 px-4 py-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:N.title}),c.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:N.id})]}),c.jsx(ur,{status:N.status})]},N.id))}):null]}),c.jsx(pi,{})]})}const gA=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Vl({title:t,description:a,children:l}){const s=kr(),o=v.useRef(null),u=v.useRef(null);return v.useEffect(()=>{var g;const f=o.current;if(!f)return;const m=document.activeElement;(g=u.current)==null||g.focus();const p=x=>{if(x.key==="Escape"){x.preventDefault(),s(-1);return}if(x.key!=="Tab")return;const y=Array.from(f.querySelectorAll(gA)).filter(A=>A.offsetParent!==null);if(y.length===0){x.preventDefault(),f.focus();return}const N=y[0],w=y[y.length-1],S=document.activeElement;x.shiftKey?(S===N||!f.contains(S))&&(x.preventDefault(),w.focus()):S===w&&(x.preventDefault(),N.focus())};return window.addEventListener("keydown",p),()=>{var x;window.removeEventListener("keydown",p),(x=m==null?void 0:m.focus)==null||x.call(m)}},[s]),c.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto p-4 md:p-6",children:[c.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(-1),"aria-hidden":"true",tabIndex:-1}),c.jsx("div",{className:"relative z-10 flex min-h-full items-start justify-center",children:c.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,className:"surface-panel flex max-h-[calc(100vh-2rem)] w-full max-w-2xl flex-col overflow-hidden p-6 outline-none md:max-h-[calc(100vh-3rem)] md:p-8",children:[c.jsxs("div",{className:"mb-6 flex shrink-0 items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:t}),a?c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:a}):null]}),c.jsx("button",{ref:u,type:"button",onClick:()=>s(-1),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[14px] border border-[var(--border-strong)] text-[var(--text-muted)] transition hover:text-[var(--text)]","aria-label":"Close modal",children:c.jsx(cR,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:l})]})})]})}function Yl({className:t="",children:a,...l}){return c.jsx("div",{className:`sticky bottom-0 mt-2 flex justify-end gap-3 border-t border-[var(--border)] bg-[var(--surface)] px-1 pt-4 pb-1 backdrop-blur-xl ${t}`,...l,children:a})}function lt({label:t,children:a}){return c.jsxs("label",{className:"grid gap-2",children:[c.jsx("span",{className:"text-sm font-semibold text-[var(--text-muted)]",children:t}),a]})}function mn(t){return c.jsx("textarea",{className:"field-control field-textarea",...t})}function vA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return Dn("submit",s,{allowInEditable:!0}),c.jsx(Vl,{title:"Create feature",description:"Top-level container for phases and tasks.",children:c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Feature name",children:c.jsx(ma,{name:"name",placeholder:"Products page implementation",required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(mn,{name:"description",placeholder:"Short context for the feature"})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create feature"})})]})})}function yA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Dn("submit",s,{allowInEditable:!0});const u=ys("feature-detail").feature;return c.jsx(Vl,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Name",children:c.jsx(ma,{name:"name",defaultValue:u.name,required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(mn,{name:"description",defaultValue:u.description})}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsx(lt,{label:"Start date",children:c.jsx(ma,{type:"date",name:"startDate",defaultValue:u.startDate})}),c.jsx(lt,{label:"End date",children:c.jsx(ma,{type:"date",name:"endDate",defaultValue:u.endDate})})]}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:u.status,children:sd.map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})}),c.jsx(lt,{label:"Priority",children:c.jsx(ma,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(ua,{title:"Planning notes",subtitle:"Optional agent-maintained notes for progress tracking.",defaultOpen:!1,className:"mt-0",children:c.jsxs("div",{className:"grid gap-4",children:[c.jsx(lt,{label:"Work done",children:c.jsx(mn,{name:"workDone",defaultValue:u.workDone})}),c.jsx(lt,{label:"Work remaining",children:c.jsx(mn,{name:"workRemaining",defaultValue:u.workRemaining})})]})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save feature"})})]})})}function xA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return Dn("submit",s,{allowInEditable:!0}),c.jsx(Vl,{title:"Create phase",description:"A phase belongs to the current feature.",children:c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Phase title",children:c.jsx(ma,{name:"title",placeholder:"API creation",required:!0})}),c.jsx(lt,{label:"Summary",children:c.jsx(mn,{name:"summary",placeholder:"Brief phase summary"})}),c.jsx(lt,{label:"Description",children:c.jsx(mn,{name:"description",placeholder:"Initial implementation notes"})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create phase"})})]})})}function ri(t){return t.join(`
289
+ `)}function bA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Dn("submit",s,{allowInEditable:!0});const u=ys("phase-detail").phase;return c.jsx(Vl,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Title",children:c.jsx(ma,{name:"title",defaultValue:u.title,required:!0})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:u.status,children:id.map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})}),c.jsx(lt,{label:"Priority",children:c.jsx(ma,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(lt,{label:"Summary",children:c.jsx(mn,{name:"summary",defaultValue:u.summary})}),c.jsx(lt,{label:"Description",children:c.jsx(mn,{name:"description",defaultValue:u.description})}),c.jsx(lt,{label:"Goals (one per line)",children:c.jsx(mn,{name:"goals",defaultValue:ri(u.goals)})}),c.jsx(lt,{label:"Non-goals (one per line)",children:c.jsx(mn,{name:"nonGoals",defaultValue:ri(u.nonGoals)})}),c.jsx(lt,{label:"Dependencies (one per line)",children:c.jsx(mn,{name:"dependencies",defaultValue:ri(u.dependencies)})}),c.jsx(lt,{label:"Risks (one per line)",children:c.jsx(mn,{name:"risks",defaultValue:ri(u.risks)})}),c.jsx(lt,{label:"Open questions (one per line)",children:c.jsx(mn,{name:"openQuestions",defaultValue:ri(u.openQuestions)})}),c.jsx(lt,{label:"Completion criteria (one per line)",children:c.jsx(mn,{name:"completionCriteria",defaultValue:ri(u.completionCriteria)})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save phase"})})]})})}function SA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return Dn("submit",s,{allowInEditable:!0}),c.jsx(Vl,{title:"Create task",description:"A task belongs to the current phase.",children:c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Task title",children:c.jsx(ma,{name:"title",placeholder:"Custom fetcher integration",required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(mn,{name:"description",placeholder:"Initial task context"})}),c.jsx(lt,{label:"Checklist (one per line)",children:c.jsx(mn,{name:"checklist",placeholder:`Step one
290
+ Step two
291
+ Step three`})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:"planned",children:Ko.map(o=>c.jsx("option",{value:o.value,children:o.label},o.value))})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create task"})})]})})}function wA(t){return t.map(a=>a.title).join(`
292
+ `)}function EA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Dn("submit",s,{allowInEditable:!0});const u=ys("task-detail").task;return c.jsx(Vl,{title:"Edit task",description:"Update execution details and checklist items.",children:c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Title",children:c.jsx(ma,{name:"title",defaultValue:u.title,required:!0})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:u.status,children:Ko.map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})}),c.jsx(lt,{label:"Priority",children:c.jsx(ma,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(lt,{label:"Description",children:c.jsx(mn,{name:"description",defaultValue:u.description})}),c.jsx(lt,{label:"Checklist (one per line)",children:c.jsx(mn,{name:"checklist",defaultValue:wA(u.checklist)})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save task"})})]})})}function NA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);Dn("submit",s,{allowInEditable:!0});const{project:o}=ys("root");return c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ye,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Gc,{className:"h-4 w-4"})," Back to dashboard"]}),c.jsxs(Pt,{className:"grid gap-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:"Edit project overview"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Update the short dashboard summary and the longer project goal without changing the rest of the project metadata."})]}),c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Project name",children:c.jsx(ma,{name:"name",defaultValue:o.name,placeholder:"Project name",required:!0})}),c.jsx(lt,{label:"Short description",children:c.jsx(mn,{name:"description",defaultValue:o.description,placeholder:"Summarize the project in a few lines for the dashboard overview"})}),c.jsx(lt,{label:"Project goal",children:c.jsx(mn,{name:"goal",defaultValue:o.goal,placeholder:"Define the main objective, success criteria, and overall direction of the project"})}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx(Ye,{to:"/",children:c.jsx(gt,{type:"button",variant:"ghost",children:"Cancel"})}),c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save project overview"})]})]})]})]})}function RA(t){return`P${String(t.number??0).padStart(3,"0")}`}function Y0({phases:t,selectedIds:a=[]}){const l=new Set(a);return c.jsx(lt,{label:"Linked phases",children:t.length===0?c.jsx("div",{className:"rounded-[14px] border border-dashed border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3 text-sm text-[var(--text-muted)]",children:"No phases available yet. Create phases first if you want to link this requirement to delivery work."}):c.jsxs("div",{className:"grid gap-2 rounded-[16px] border border-[var(--border)] bg-[var(--surface-elevated)] p-3",children:[c.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Select the phases that directly implement or track this requirement."}),c.jsx("div",{className:"grid gap-2 max-h-[32dvh] overflow-y-auto pr-1",children:t.map(s=>c.jsxs("label",{className:"flex items-start gap-3 rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsx("input",{type:"checkbox",name:"linkedPhaseIds",value:s.id,defaultChecked:l.has(s.id),className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]"}),c.jsxs("span",{className:"min-w-0",children:[c.jsxs("span",{className:"block font-semibold",children:[RA(s)," — ",s.title]}),s.summary?c.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-muted)]",children:s.summary}):null]})]},s.id))})]})})}function jA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);Dn("submit",s,{allowInEditable:!0});const{phases:o}=ys("requirements");return c.jsx(Vl,{title:"Create requirement",description:"Capture a top-level outcome that phases can implement and track.",children:c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Requirement title",children:c.jsx(ma,{name:"title",placeholder:"Self-hosted Claude Code plugin marketplace distribution",required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(mn,{name:"description",placeholder:"Describe the user/business outcome this requirement represents"})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:"planned",children:O0.map(u=>c.jsx("option",{value:u.value,children:u.label},u.value))})}),c.jsx(Y0,{phases:o}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create requirement"})})]})})}function TA(){const a=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var p;return(p=l.current)==null?void 0:p.requestSubmit()},[]);Dn("submit",s,{allowInEditable:!0});const{requirementId:o}=rE(),{phases:u,requirements:f}=ys("requirements"),m=f.find(p=>p.id===o);return m?c.jsx(Vl,{title:"Edit requirement",description:"Update status, scope notes, and linked delivery phases.",children:c.jsxs(ca,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Requirement title",children:c.jsx(ma,{name:"title",defaultValue:m.title,required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(mn,{name:"description",defaultValue:m.description})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:m.status,children:O0.map(p=>c.jsx("option",{value:p.value,children:p.label},p.value))})}),c.jsx(Y0,{phases:u,selectedIds:m.linkedPhaseIds}),c.jsx("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3 text-sm text-[var(--text-muted)]",children:"Macro tasks are preserved automatically on save. This screen does not edit the nested macro-task list yet."}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save requirement"})})]})}):null}function Jn(t,a){const l=t.get(a);if(typeof l!="string"||l.trim()==="")throw new Response(`Missing field: ${a}`,{status:400});return l.trim()}function Bn(t,a){const l=t.get(a);return typeof l=="string"?l.trim():""}function Fm(t,a){const l=t.get(a);if(typeof l!="string")return 0;const s=l.trim();if(s==="")return 0;const o=Number(s);return Number.isFinite(o)?o:0}function Ll(t,a){return Bn(t,a).split(`
293
+ `).map(l=>l.trim()).filter(Boolean)}function sn(t,a){const l=t[a];if(!l)throw new Response(`Missing route param: ${a}`,{status:400});return l}async function CA({request:t}){const a=await t.formData();return await gR({name:Jn(a,"name"),description:Bn(a,"description")}),Ua("/features")}async function AA({request:t,params:a}){const l=sn(a,"featureId"),s=await Yo(l),o=await t.formData();return await Yb({...s,name:Jn(o,"name"),description:Bn(o,"description"),startDate:Bn(o,"startDate"),endDate:Bn(o,"endDate"),status:Jn(o,"status"),priority:Fm(o,"priority"),workDone:Bn(o,"workDone"),workRemaining:Bn(o,"workRemaining")}),Ua(`/features/${l}`)}async function DA({params:t}){return await vR(sn(t,"featureId")),Ua("/features")}async function kA({request:t,params:a}){const l=sn(a,"featureId"),s=await Yo(l),o=await t.formData();return await Yb({...s,status:Jn(o,"status")}),null}async function OA({request:t,params:a}){const l=sn(a,"featureId"),s=await t.formData();return await SR({featureId:l,title:Jn(s,"title"),summary:Bn(s,"summary"),description:Bn(s,"description")}),Ua(`/features/${l}`)}async function MA({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),o=await Wc(s),u=await t.formData();return await Fb({...o,title:Jn(u,"title"),status:Jn(u,"status"),priority:Fm(u,"priority"),summary:Bn(u,"summary"),description:Bn(u,"description"),goals:Ll(u,"goals"),nonGoals:Ll(u,"nonGoals"),dependencies:Ll(u,"dependencies"),risks:Ll(u,"risks"),openQuestions:Ll(u,"openQuestions"),completionCriteria:Ll(u,"completionCriteria")}),Ua(`/features/${l}/phases/${s}`)}async function _A({params:t}){const a=sn(t,"featureId"),l=sn(t,"phaseId");return await wR(l),Ua(`/features/${a}`)}async function LA({request:t,params:a}){const l=sn(a,"phaseId"),s=await Wc(l),o=await t.formData();return await Fb({...s,status:Jn(o,"status")}),null}async function zA({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),o=await t.formData(),u=Ll(o,"checklist");return await ER(s,{title:Jn(o,"title"),description:Bn(o,"description"),status:Bn(o,"status")||"planned",...u.length?{checklist:u}:{}}),Ua(`/features/${l}/phases/${s}`)}function UA(t,a){const l=new Map(t.map(o=>[o.id,o])),s=new Map(t.map(o=>[o.title.trim().toLowerCase(),o]));return a.map((o,u)=>{var p;const f=o.trim().toLowerCase(),m=l.get(((p=t[u])==null?void 0:p.id)??"")??s.get(f);return m?{...m,number:u+1,title:o.trim()}:{id:`check-${u+1}-${f.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,number:u+1,title:o.trim(),checked:!1}})}async function BA({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),o=sn(a,"taskId"),u=await ed(o),f=await t.formData();return await bm({...u,phaseId:s,title:Jn(f,"title"),status:Jn(f,"status"),priority:Fm(f,"priority"),description:Bn(f,"description"),checklist:UA(u.checklist,Ll(f,"checklist"))}),Ua(`/features/${l}/phases/${s}/tasks/${o}`)}async function HA({params:t}){const a=sn(t,"featureId"),l=sn(t,"phaseId"),s=sn(t,"taskId");return await NR(s),Ua(`/features/${a}/phases/${l}`)}async function $A({request:t,params:a}){const l=sn(a,"phaseId"),s=sn(a,"taskId"),o=await ed(s),u=await t.formData();return await bm({...o,phaseId:l,status:Jn(u,"status")}),null}async function qA({request:t}){const a=await Ib(),l=await t.formData();return await mR({...a,name:Bn(l,"name")||a.name,description:Bn(l,"description"),goal:Bn(l,"goal")}),Ua("/")}async function IA({request:t}){const a=await t.formData();return await yR({id:crypto.randomUUID(),title:Jn(a,"title"),description:Bn(a,"description"),status:Jn(a,"status"),linkedPhaseIds:a.getAll("linkedPhaseIds").filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean)}),Ua("/requirements")}async function VA({request:t,params:a}){const l=sn(a,"requirementId"),s=(await xm()).find(u=>u.id===l);if(!s)throw new Response(`Requirement not found: ${l}`,{status:404});const o=await t.formData();return await xR({...s,title:Jn(o,"title"),description:Bn(o,"description"),status:Jn(o,"status"),linkedPhaseIds:o.getAll("linkedPhaseIds").filter(u=>typeof u=="string").map(u=>u.trim()).filter(Boolean)}),Ua("/requirements")}async function YA({params:t}){return await bR(sn(t,"requirementId")),Ua("/requirements")}function FA(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function PA(){return{handoffs:await Ph()}}function GA(){const{handoffs:t}=ll(),[a,l]=v.useState(t),[s,o]=v.useState(null),[u,f]=v.useState(""),m=hr();async function p(g){if(!(s||!window.confirm(`Clear handoff for ${g.compositeRef}?`))){o(g.phaseId),f("");try{await Gb(g.phaseId),l(y=>y.filter(N=>N.phaseId!==g.phaseId)),Ph().then(l).catch(()=>{})}catch(y){const N=y instanceof Response?await y.text().catch(()=>""):y instanceof Error?y.message:String(y);f(N||`Failed to clear handoff for ${g.compositeRef}.`)}finally{o(null)}}}return v.useEffect(()=>{const g=x=>{const y=x.detail;((y==null?void 0:y.type)==="handoffUpdated"||(y==null?void 0:y.type)==="handoffCleared")&&Ph().then(l).catch(()=>{})};return window.addEventListener("agent-plan:ws-event",g),()=>window.removeEventListener("agent-plan:ws-event",g)},[]),v.useEffect(()=>{if(!m.hash)return;const g=m.hash.slice(1),x=document.getElementById(g);x&&x.scrollIntoView({behavior:"smooth",block:"start"})},[m.hash,a]),a.length===0?c.jsxs(Pt,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),c.jsx(Ye,{to:"/handoff/archive",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"View archive →"})]}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Pending entity-scoped handoffs on non-completed phases."})]}),u?c.jsx("p",{className:"rounded-[12px] border border-[var(--danger-soft)] bg-[var(--danger-soft)]/50 px-3 py-2 text-sm text-[var(--color-status-blocked)]",children:u}):null,c.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No pending phase handoffs."})]}):c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),c.jsx(Ye,{to:"/handoff/archive",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"View archive →"})]}),c.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Pending entity-scoped handoffs on non-completed phases. ",a.length," pending."]})]}),u?c.jsx("p",{className:"rounded-[12px] border border-[var(--danger-soft)] bg-[var(--danger-soft)]/50 px-3 py-2 text-sm text-[var(--color-status-blocked)]",children:u}):null,a.map(g=>c.jsx("section",{id:g.phaseId,className:"scroll-mt-20",children:c.jsx(Pt,{className:"overflow-hidden p-0",children:c.jsx(ua,{defaultOpen:!1,title:c.jsxs(c.Fragment,{children:[c.jsx(mr,{id:g.compositeRef,children:g.compositeRef}),c.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Updated ",FA(g.updatedAt)]})]}),subtitle:g.firstLine||"Empty handoff content.",summaryClassName:"hover:bg-[var(--surface-hover)]/60 focus-visible:bg-[var(--surface-hover)]/60",actions:c.jsxs(c.Fragment,{children:[c.jsx(gt,{type:"button",variant:"danger",className:"min-h-8 px-2.5 py-1 text-xs sm:min-h-9",disabled:s===g.phaseId,onClick:x=>{x.preventDefault(),x.stopPropagation(),p(g)},children:s===g.phaseId?"Clearing…":"Clear"}),c.jsx(Ye,{to:g.featureId?`/features/${g.featureId}/phases/${g.phaseId}`:"/features",className:"text-xs text-[var(--text-muted)] underline-offset-2 hover:text-[var(--text)] hover:underline",onClick:x=>x.stopPropagation(),children:g.featureId?"Open phase →":"Browse features →"})]}),contentClassName:"px-5 py-5",children:g.firstLine?c.jsx(xn,{text:g.content,className:"formatted-text max-w-none"}):c.jsx("p",{className:"text-sm italic text-[var(--text-muted)]",children:"Empty handoff content."})})})},g.phaseId))]})}function XA(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function QA(){return{archived:await RR()}}function KA(){const{archived:t}=ll();return t.length===0?c.jsxs(Pt,{className:"grid gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Archived handoffs"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Completed, superseded, and manually cleared handoffs."})]}),c.jsx(Ye,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),c.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No archived handoffs."})]}):c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Archived handoffs"}),c.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:[t.length," archived entries. These are history, not pending resume context."]})]}),c.jsx(Ye,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),t.map(a=>c.jsx(Pt,{className:"overflow-hidden p-0",children:c.jsxs(ua,{defaultOpen:!1,title:c.jsxs(c.Fragment,{children:[c.jsx(mr,{id:a.compositeRef,children:a.compositeRef}),c.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Archived ",XA(a.archivedAt)]})]}),subtitle:a.firstLine||"Empty archived handoff.",contentClassName:"px-5 py-5",children:[c.jsxs("div",{className:"mb-3 flex flex-wrap gap-2 text-xs text-[var(--text-muted)]",children:[c.jsxs("span",{children:["Reason: ",a.reason||"unknown"]}),c.jsxs("span",{className:"break-all",children:["File: ",a.file]})]}),c.jsx(xn,{text:a.content||"(archive file unavailable)",className:"formatted-text max-w-none"})]})},`${a.phaseId}:${a.file}`))]})}async function ZA({request:t,params:a}){sn(a,"featureId");const l=sn(a,"phaseId"),s=sn(a,"taskId"),o=sn(a,"itemId"),u=await t.formData(),f=Jn(u,"checked")==="true",m=await ed(s);return await bm({...m,phaseId:l,checklist:m.checklist.map(p=>p.id===o?{...p,checked:f}:p)}),Response.json({ok:!0,taskId:s,itemId:o,checked:f})}const JA=QE([{id:"root",path:"/",loader:ZR,element:c.jsx(JR,{}),errorElement:c.jsx(WR,{}),children:[{index:!0,loader:e2,element:c.jsx($C,{})},{path:"features",id:"features",loader:qC,element:c.jsx(GC,{}),children:[{path:"new",element:c.jsx(vA,{}),action:CA}]},{path:"features/:featureId",id:"feature-detail",loader:JC,element:c.jsx(oA,{}),children:[{path:"edit",element:c.jsx(yA,{}),action:AA},{path:"phases/new",element:c.jsx(xA,{}),action:OA}]},{path:"requirements",id:"requirements",loader:XC,element:c.jsx(ZC,{}),children:[{path:"new",element:c.jsx(jA,{}),action:IA},{path:":requirementId/edit",element:c.jsx(TA,{}),action:VA}]},{path:"project/edit",element:c.jsx(NA,{}),action:qA},{path:"handoff",loader:PA,element:c.jsx(GA,{})},{path:"handoff/archive",loader:QA,element:c.jsx(KA,{})},{path:"features/:featureId/delete",action:DA},{path:"requirements/:requirementId/delete",action:YA},{path:"features/:featureId/status",action:kA},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:uA,element:c.jsx(fA,{}),children:[{path:"edit",element:c.jsx(bA,{}),action:MA},{path:"tasks/new",element:c.jsx(SA,{}),action:zA}]},{path:"features/:featureId/phases/:phaseId/delete",action:_A},{path:"features/:featureId/phases/:phaseId/status",action:LA},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:hA,element:c.jsx(pA,{}),children:[{path:"edit",element:c.jsx(EA,{}),action:BA}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:HA},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:$A},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:ZA}]}]),F0=document.getElementById("root");if(!F0)throw new Error("#root not found");BS.createRoot(F0).render(c.jsx(v.StrictMode,{children:c.jsx(rN,{router:JA})}));