@agent-plan/server 0.2.19-next.2 → 0.2.19-next.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 ES=Object.defineProperty;var NS=(t,a,l)=>a in t?ES(t,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[a]=l;var hn=(t,a,l)=>NS(t,typeof a!="symbol"?a+"":a,l);function RS(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 jS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var oh={exports:{}},so={};/**
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 TS(){if(vy)return so;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 so.Fragment=a,so.jsx=l,so.jsxs=l,so}var yy;function CS(){return yy||(yy=1,oh.exports=TS()),oh.exports}var c=CS(),uh={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 DS(){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"),E=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=E&&C[E]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,R={};function L(C,V,te){this.props=C,this.context=V,this.refs=R,this.updater=te||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,te){this.props=C,this.context=V,this.refs=R,this.updater=te||S}var X=q.prototype=new I;X.constructor=q,D(X,L.prototype),X.isPureReactComponent=!0;var W=Array.isArray;function ne(){}var z={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(C,V,te){var me=te.ref;return{$$typeof:t,type:C,key:V,ref:me!==void 0?me:null,props:te}}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(te){return V[te]})}var ae=/\/+/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(ne,ne):(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,te,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,te,me,Ne)}}if(ze)return Ne=Ne(C),ze=me===""?"."+re(C,0):me,W(Ne)?(te="",ze!=null&&(te=ze.replace(ae,"$&/")+"/"),U(Ne,V,te,"",function(nt){return nt})):Ne!=null&&(be(Ne)&&(Ne=fe(Ne,te+(Ne.key==null||C&&C.key===Ne.key?"":(""+Ne.key).replace(ae,"$&/")+"/")+ze)),V.push(Ne)),1;ze=0;var ut=me===""?".":me+":";if(W(C))for(var Pe=0;Pe<C.length;Pe++)me=C[Pe],je=ut+re(me,Pe),ze+=U(me,V,te,je,Ne);else if(Pe=w(C),typeof Pe=="function")for(C=Pe.call(C),Pe=0;!(me=C.next()).done;)me=me.value,je=ut+re(me,Pe++),ze+=U(me,V,te,je,Ne);else if(je==="object"){if(typeof C.then=="function")return U(ge(C),V,te,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,te){if(C==null)return C;var me=[],Ne=0;return U(C,me,"","",function(je){return V.call(te,je,Ne++)}),me}function ue(C){if(C._status===-1){var V=C._result;V=V(),V.then(function(te){(C._status===0||C._status===-1)&&(C._status=1,C._result=te)},function(te){(C._status===0||C._status===-1)&&(C._status=2,C._result=te)}),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,te){B(C,function(){V.apply(this,arguments)},te)},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,te){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var me=D({},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=te;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,te){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=te;else if(1<ze){for(var ut=Array(ze),Pe=0;Pe<ze;Pe++)ut[Pe]=arguments[Pe+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,te={};z.T=te;try{var me=C(),Ne=z.S;Ne!==null&&Ne(te,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(ne,de)}catch(je){de(je)}finally{V!==null&&te.types!==null&&(V.types=te.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,te){return z.H.useActionState(C,V,te)},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,te){return z.H.useImperativeHandle(C,V,te)},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,te){return z.H.useReducer(C,V,te)},et.useRef=function(C){return z.H.useRef(C)},et.useState=function(C){return z.H.useState(C)},et.useSyncExternalStore=function(C,V,te){return z.H.useSyncExternalStore(C,V,te)},et.useTransition=function(){return z.H.useTransition()},et.version="19.2.7",et}var by;function Jh(){return by||(by=1,uh.exports=DS()),uh.exports}var v=Jh();const un=jS(v),AS=RS({__proto__:null,default:un},[v]);var ch={exports:{}},io={},dh={exports:{}},fh={};/**
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 kS(){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,te=U[V],me=V+1,Ne=U[me];if(0>o(te,ue))me<we&&0>o(Ne,te)?(U[de]=Ne,U[me]=ue,de=me):(U[de]=te,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,E=3,w=!1,S=!1,D=!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(D=!1,X(U),!S)if(l(p)!==null)S=!0,ne||(ne=!0,ye());else{var B=l(g);B!==null&&ge(W,B.startTime-U)}}var ne=!1,z=-1,T=5,ee=-1;function fe(){return R?!0:!(t.unstable_now()-ee<T)}function be(){if(R=!1,ne){var U=t.unstable_now();ee=U;var B=!0;try{e:{S=!1,D&&(D=!1,I(z),z=-1),w=!0;var ue=E;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,E=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,E=ue,w=!1}B=void 0}}finally{B?ye():ne=!1}}}var ye;if(typeof q=="function")ye=function(){q(be)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,re=ae.port2;ae.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 E},t.unstable_next=function(U){switch(E){case 1:case 2:case 3:var B=3;break;default:B=E}var ue=E;E=B;try{return U()}finally{E=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=E;E=U;try{return B()}finally{E=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)&&(D?(I(z),z=-1):D=!0,ge(W,ue-de))):(U.sortIndex=we,a(p,U),S||w||(S=!0,ne||(ne=!0,ye()))),U},t.unstable_shouldYield=fe,t.unstable_wrapCallback=function(U){var B=E;return function(){var ue=E;E=B;try{return U.apply(this,arguments)}finally{E=ue}}}})(fh)),fh}var wy;function OS(){return wy||(wy=1,dh.exports=kS()),dh.exports}var hh={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 MS(){if(Ey)return sa;Ey=1;var t=Jh();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),E=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:E,fetchPriority:w}):x==="script"&&s.d.X(p,{crossOrigin:y,integrity:E,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 Xx(){if(Ny)return hh.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(),hh.exports=MS(),hh.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 _S(){if(Ry)return io;Ry=1;var t=OS(),a=Jh(),l=Xx();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,N=d.child;N;){if(N===r){b=!0,r=d,i=h;break}if(N===i){b=!0,i=d,r=h;break}N=N.sibling}if(!b){for(N=h.child;N;){if(N===r){b=!0,r=h,i=d;break}if(N===i){b=!0,i=h,r=d;break}N=N.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,E=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),D=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"),ne=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 ae=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case L:return"Profiler";case R:return"StrictMode";case W:return"Suspense";case ne: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 te(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(te(je,n),te(Ne,e),te(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),te(me,e)}function Pe(){V(me),V(Ne),V(je)}function nt(e){e.memoizedState!==null&&te(ze,e);var n=me.current,r=qv(n,e.type);n!==r&&(te(Ne,e),te(me,r))}function bn(e){Ne.current===e&&(V(me),V(Ne)),ze.current===e&&(V(ze),no._currentValue=ue)}var Pt,ft;function oe(e){if(Pt===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Pt=n&&n[1]||"",ft=-1<r.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Pt+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],N=h[1];if(b&&N){var k=b.split(`
44
+ `),F=N.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,Gt=t.unstable_cancelCallback,Hn=t.unstable_shouldYield,$n=t.unstable_requestPaint,en=t.unstable_now,ca=t.unstable_getCurrentPriorityLevel,da=t.unstable_ImmediatePriority,Wn=t.unstable_UserBlockingPriority,qn=t.unstable_NormalPriority,he=t.unstable_LowPriority,Ce=t.unstable_IdlePriority,De=t.log,Fe=t.unstable_setDisableYieldValue,qe=null,Z=null;function Tt(e){if(typeof De=="function"&&Fe(e),Z&&typeof Z.setStrictMode=="function")try{Z.setStrictMode(qe,e)}catch{}}var Xt=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 N=i&134217727;return N!==0?(i=N&~h,i!==0?d=St(i):(b&=N,b!==0?d=St(b):r||(r=N&~e,r!==0&&(d=St(r))))):(N=i&~h,N!==0?d=St(N):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 Qt(){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 N=e.entanglements,k=e.expirationTimes,F=e.hiddenUpdates;for(r=b&~r;0<r;){var J=31-Xt(r),ie=1<<J;N[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&&Sn(e,i,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(b&~n))}function Sn(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var i=31-Xt(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-Xt(r),d=1<<i;d&n|e[i]&n&&(e[i]|=n),r&=~d}}function A(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,Ae="__reactProps$"+Te,Re="__reactContainer$"+Te,_e="__reactEvents$"+Te,Ue="__reactListeners$"+Te,Ge="__reactHandles$"+Te,ke="__reactResources$"+Te,Ze="__reactMarker$"+Te;function Ie(e){delete e[ve],delete e[Ae],delete e[_e],delete e[Ue],delete e[Ge]}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 Kt=new Set,Fn={};function wn(e,n){On(e,n),On(e+"Capture",n)}function On(e,n){for(Fn[e]=n,e=0;e<n.length;e++)Kt.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 ll(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(ll(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 hr(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 Xe(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 Zt(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=Zt(e)?"checked":"value";e._valueTracker=ta(e,n,""+e[n])}}function Or(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),i="";return e&&(i=Zt(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 ql(e,n,r,i,d,h,b,N){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?Dt(e,b,Nt(n)):r!=null?Dt(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"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Nt(N):e.removeAttribute("name")}function yi(e,n,r,i,d,h,b,N){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,N||n===e.value||(e.value=n),e.defaultValue=n}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=N?e.checked:!!i,e.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),_n(e)}function Dt(e,n,r){n==="number"&&Rt(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function mr(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 Zo(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 ar(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 sl(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var od=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 xs(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||od.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&&xs(e,d,i)}else for(var h in n)n.hasOwnProperty(h)&&xs(e,h,n[h])}function Il(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 bs=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 Mr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pr=null,_r=null;function xi(e){var n=We(e);if(n&&(e=n.stateNode)){var r=e[Ae]||null;e:switch(e=n.stateNode,n.type){case"input":if(ql(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[Ae]||null;if(!d)throw Error(s(90));ql(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&&Or(i)}break e;case"textarea":Zo(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&mr(e,!!r.multiple,n,!1)}}}var gr=!1;function bi(e,n,r){if(gr)return e(n,r);gr=!0;try{var i=e(n);return i}finally{if(gr=!1,(pr!==null||_r!==null)&&(Bu(),pr&&(n=pr,e=_r,_r=pr=null,xi(n),e)))for(n=0;n<e.length;n++)xi(e[n])}}function Ha(e,n){var r=e.stateNode;if(r===null)return null;var i=r[Ae]||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 rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Si=!1;if(rr)try{var Lr={};Object.defineProperty(Lr,"passive",{get:function(){Si=!0}}),window.addEventListener("test",Lr,Lr),window.removeEventListener("test",Lr,Lr)}catch{Si=!1}var $a=null,wi=null,Ss=null;function Jo(){if(Ss)return Ss;var e,n=wi,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 Ss=d.slice(e,1<i?1-i:void 0)}function ws(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 zr(){return!0}function Wo(){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 N in e)e.hasOwnProperty(N)&&(r=e[N],this[N]=r?r(h):h[N]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?zr:Wo,this.isPropagationStopped=Wo,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=zr)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=zr)},persist:function(){},isPersistent:zr}),n}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Br=aa(Ur),Vl=y({},Ur,{view:0,detail:0}),ud=aa(Vl),il,Yl,Fl,Hr=y({},Vl,{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!==Fl&&(Fl&&e.type==="mousemove"?(il=e.screenX-Fl.screenX,Yl=e.screenY-Fl.screenY):Yl=il=0,Fl=e),il)},movementY:function(e){return"movementY"in e?e.movementY:Yl}}),eu=aa(Hr),j=y({},Hr,{dataTransfer:0}),P=aa(j),Ee=y({},Vl,{relatedTarget:0}),xe=aa(Ee),Ye=y({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),ce=aa(Ye),pe=y({},Ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Se=aa(pe),Qe=y({},Ur,{data:0}),rt=aa(Qe),Be={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},En={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({},Vl,{key:function(e){if(e.key){var n=Be[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=ws(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?En[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"?ws(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ws(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Nn=aa(xa),cn=y({},Hr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zt=aa(cn),Pl=y({},Vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:la}),vr=aa(Pl),cd=y({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),tu=aa(cd),nu=y({},Hr,{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}),dd=aa(nu),fd=y({},Ur,{newState:0,oldState:0}),Y0=aa(fd),F0=[9,13,27,32],hd=rr&&"CompositionEvent"in window,Ei=null;rr&&"documentMode"in document&&(Ei=document.documentMode);var P0=rr&&"TextEvent"in window&&!Ei,Pm=rr&&(!hd||Ei&&8<Ei&&11>=Ei),Gm=" ",Xm=!1;function Qm(e,n){switch(e){case"keyup":return F0.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 Es=!1;function G0(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 X0(e,n){if(Es)return e==="compositionend"||!hd&&Qm(e,n)?(e=Jo(),Ss=wi=$a=null,Es=!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 Q0={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"?!!Q0[e.type]:n==="textarea"}function Jm(e,n,r,i){pr?_r?_r.push(i):_r=[i]:pr=i,n=Fu(n,"onChange"),0<n.length&&(r=new Br("onChange","change",null,r,i),e.push({event:r,listeners:n}))}var Ni=null,Ri=null;function K0(e){_v(e,0)}function au(e){var n=ct(e);if(Or(n))return e}function Wm(e,n){if(e==="change")return n}var ep=!1;if(rr){var md;if(rr){var pd="oninput"in document;if(!pd){var tp=document.createElement("div");tp.setAttribute("oninput","return;"),pd=typeof tp.oninput=="function"}md=pd}else md=!1;ep=md&&(!document.documentMode||9<document.documentMode)}function np(){Ni&&(Ni.detachEvent("onpropertychange",ap),Ri=Ni=null)}function ap(e){if(e.propertyName==="value"&&au(Ri)){var n=[];Jm(n,Ri,e,Mr(e)),bi(K0,n)}}function Z0(e,n,r){e==="focusin"?(np(),Ni=n,Ri=r,Ni.attachEvent("onpropertychange",ap)):e==="focusout"&&np()}function J0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return au(Ri)}function W0(e,n){if(e==="click")return au(n)}function e1(e,n){if(e==="input"||e==="change")return au(n)}function t1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Ca=typeof Object.is=="function"?Object.is:t1;function ji(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 gd(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 n1=rr&&"documentMode"in document&&11>=document.documentMode,Ns=null,vd=null,Ti=null,yd=!1;function op(e,n,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;yd||Ns==null||Ns!==Rt(i)||(i=Ns,"selectionStart"in i&&gd(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}),Ti&&ji(Ti,i)||(Ti=i,i=Fu(vd,"onSelect"),0<i.length&&(n=new Br("onSelect","select",null,n,r),e.push({event:n,listeners:i}),n.target=Ns)))}function Gl(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Rs={animationend:Gl("Animation","AnimationEnd"),animationiteration:Gl("Animation","AnimationIteration"),animationstart:Gl("Animation","AnimationStart"),transitionrun:Gl("Transition","TransitionRun"),transitionstart:Gl("Transition","TransitionStart"),transitioncancel:Gl("Transition","TransitionCancel"),transitionend:Gl("Transition","TransitionEnd")},xd={},up={};rr&&(up=document.createElement("div").style,"AnimationEvent"in window||(delete Rs.animationend.animation,delete Rs.animationiteration.animation,delete Rs.animationstart.animation),"TransitionEvent"in window||delete Rs.transitionend.transition);function Xl(e){if(xd[e])return xd[e];if(!Rs[e])return e;var n=Rs[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in up)return xd[e]=n[r];return e}var cp=Xl("animationend"),dp=Xl("animationiteration"),fp=Xl("animationstart"),a1=Xl("transitionrun"),r1=Xl("transitionstart"),l1=Xl("transitioncancel"),hp=Xl("transitionend"),mp=new Map,bd="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(" ");bd.push("scrollEnd");function lr(e,n){mp.set(e,n),wn(n,[e])}var ru=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=[],js=0,Sd=0;function lu(){for(var e=js,n=Sd=js=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 su(e,n,r,i){qa[js++]=e,qa[js++]=n,qa[js++]=r,qa[js++]=i,Sd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function wd(e,n,r,i){return su(e,n,r,i),iu(e)}function Ql(e,n){return su(e,null,null,n),iu(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-Xt(r),e=h.hiddenUpdates,i=e[d],i===null?e[d]=[n]:i.push(n),n.lane=r|536870912),h):null}function iu(e){if(50<Qi)throw Qi=0,Of=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ts={};function s1(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 Da(e,n,r,i){return new s1(e,n,r,i)}function Ed(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $r(e,n){var r=e.alternate;return r===null?(r=Da(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 ou(e,n,r,i,d,h){var b=0;if(i=e,typeof e=="function")Ed(e)&&(b=1);else if(typeof e=="string")b=dS(e,r,me.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=Da(31,r,n,d),e.elementType=ee,e.lanes=h,e;case D:return Kl(r.children,d,h,n);case R:b=8,d|=24;break;case L:return e=Da(12,r,n,d|2),e.elementType=L,e.lanes=h,e;case W:return e=Da(13,r,n,d),e.elementType=W,e.lanes=h,e;case ne:return e=Da(19,r,n,d),e.elementType=ne,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=Da(b,r,n,d),n.elementType=e,n.type=i,n.lanes=h,n}function Kl(e,n,r,i){return e=Da(7,e,i,n),e.lanes=r,e}function Nd(e,n,r){return e=Da(6,e,null,n),e.lanes=r,e}function vp(e){var n=Da(18,null,null,0);return n.stateNode=e,n}function Rd(e,n,r){return n=Da(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 Cs=[],Ds=0,uu=null,Ci=0,Va=[],Ya=0,ol=null,yr=1,xr="";function qr(e,n){Cs[Ds++]=Ci,Cs[Ds++]=uu,uu=e,Ci=n}function xp(e,n,r){Va[Ya++]=yr,Va[Ya++]=xr,Va[Ya++]=ol,ol=e;var i=yr;e=xr;var d=32-Xt(i)-1;i&=~(1<<d),r+=1;var h=32-Xt(n)+d;if(30<h){var b=d-d%5;h=(i&(1<<b)-1).toString(32),i>>=b,d-=b,yr=1<<32-Xt(n)+d|r<<d|i,xr=h+e}else yr=1<<h|r<<d|i,xr=e}function jd(e){e.return!==null&&(qr(e,1),xp(e,1,0))}function Td(e){for(;e===uu;)uu=Cs[--Ds],Cs[Ds]=null,Ci=Cs[--Ds],Cs[Ds]=null;for(;e===ol;)ol=Va[--Ya],Va[Ya]=null,xr=Va[--Ya],Va[Ya]=null,yr=Va[--Ya],Va[Ya]=null}function bp(e,n){Va[Ya++]=yr,Va[Ya++]=xr,Va[Ya++]=ol,yr=n.id,xr=n.overflow,ol=e}var Xn=null,rn=null,wt=!1,ul=null,Fa=!1,Cd=Error(s(519));function cl(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Di(Ia(n,e)),Cd}function Sp(e){var n=e.stateNode,r=e.type,i=e.memoizedProps;switch(n[ve]=e,n[Ae]=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<Zi.length;r++)pt(Zi[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),yi(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),ar(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||cl(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 As(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")||Gf(e.type,e.memoizedProps)),r=!r),r&&rn&&cl(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,Nl(e.type)?(e=Jf,Jf=null,rn=e):rn=n):rn=Xn?Ga(e.stateNode.nextSibling):null;return!0}function Zl(){rn=Xn=null,wt=!1}function Dd(){var e=ul;return e!==null&&(Ea===null?Ea=e:Ea.push.apply(Ea,e),ul=null),e}function Di(e){ul===null?ul=[e]:ul.push(e)}var Ad=C(null),Jl=null,Ir=null;function dl(e,n,r){te(Ad,n._currentValue),n._currentValue=r}function Vr(e){e._currentValue=Ad.current,V(Ad)}function kd(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 Od(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 N=h;h=d;for(var k=0;k<n.length;k++)if(N.context===n[k]){h.lanes|=r,N=h.alternate,N!==null&&(N.lanes|=r),kd(h.return,r,e),i||(b=null);break e}h=N.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),kd(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 ks(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 N=d.type;Ca(d.pendingProps.value,b.value)||(e!==null?e.push(N):e=[N])}}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(no):e=[no])}d=d.return}e!==null&&Od(n,e,r,i),n.flags|=262144}function cu(e){for(e=e.firstContext;e!==null;){if(!Ca(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wl(e){Jl=e,Ir=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qn(e){return Ep(Jl,e)}function du(e,n){return Jl===null&&Wl(e),Ep(e,n)}function Ep(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},Ir===null){if(e===null)throw Error(s(308));Ir=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Ir=Ir.next=n;return r}var i1=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()})}},o1=t.unstable_scheduleCallback,u1=t.unstable_NormalPriority,Rn={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Md(){return{controller:new i1,data:new Map,refCount:0}}function Ai(e){e.refCount--,e.refCount===0&&o1(u1,function(){e.controller.abort()})}var ki=null,_d=0,Os=0,Ms=null;function c1(e,n){if(ki===null){var r=ki=[];_d=0,Os=Bf(),Ms={status:"pending",value:void 0,then:function(i){r.push(i)}}}return _d++,n.then(Np,Np),n}function Np(){if(--_d===0&&ki!==null){Ms!==null&&(Ms.status="fulfilled");var e=ki;ki=null,Os=0,Ms=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function d1(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=en(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&c1(e,n),Rp!==null&&Rp(e,n)};var es=C(null);function Ld(){var e=es.current;return e!==null?e:Jt.pooledCache}function fu(e,n){n===null?te(es,es.current):te(es,n.pool)}function jp(){var e=Ld();return e===null?null:{parent:Rn._currentValue,pool:e}}var _s=Error(s(460)),zd=Error(s(474)),hu=Error(s(542)),mu={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,Ap(e),e;default:if(typeof n.status=="string")n.then(na,na);else{if(e=Jt,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,Ap(e),e}throw ns=n,_s}}function ts(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ns=r,_s):r}}var ns=null;function Dp(){if(ns===null)throw Error(s(459));var e=ns;return ns=null,e}function Ap(e){if(e===_s||e===hu)throw Error(s(483))}var Ls=null,Oi=0;function pu(e){var n=Oi;return Oi+=1,Ls===null&&(Ls=[]),Cp(Ls,e,n)}function Mi(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function gu(e,n){throw n.$$typeof===E?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=$r(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 N(H,_,Y,le){return _===null||_.tag!==6?(_=Nd(Y,H.mode,le),_.return=H,_):(_=d(_,Y),_.return=H,_)}function k(H,_,Y,le){var He=Y.type;return He===D?J(H,_,Y.props.children,le,Y.key):_!==null&&(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&ts(He)===_.type)?(_=d(_,Y.props),Mi(_,Y),_.return=H,_):(_=ou(Y.type,Y.key,Y.props,null,H.mode,le),Mi(_,Y),_.return=H,_)}function F(H,_,Y,le){return _===null||_.tag!==4||_.stateNode.containerInfo!==Y.containerInfo||_.stateNode.implementation!==Y.implementation?(_=Rd(Y,H.mode,le),_.return=H,_):(_=d(_,Y.children||[]),_.return=H,_)}function J(H,_,Y,le,He){return _===null||_.tag!==7?(_=Kl(Y,H.mode,le,He),_.return=H,_):(_=d(_,Y),_.return=H,_)}function ie(H,_,Y){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=Nd(""+_,H.mode,Y),_.return=H,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case w:return Y=ou(_.type,_.key,_.props,null,H.mode,Y),Mi(Y,_),Y.return=H,Y;case S:return _=Rd(_,H.mode,Y),_.return=H,_;case T:return _=ts(_),ie(H,_,Y)}if(ge(_)||ye(_))return _=Kl(_,H.mode,Y,null),_.return=H,_;if(typeof _.then=="function")return ie(H,pu(_),Y);if(_.$$typeof===q)return ie(H,du(H,_),Y);gu(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:N(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=ts(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,_,pu(Y),le);if(Y.$$typeof===q)return G(H,_,du(H,Y),le);gu(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,N(_,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=ts(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,pu(le),He);if(le.$$typeof===q)return Q(H,_,Y,du(_,le),He);gu(_,le)}return null}function Oe(H,_,Y,le){for(var He=null,At=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),At===null?He=kt:At.sibling=kt,At=kt,Le=bt}if(ot===Y.length)return r(H,Le),wt&&qr(H,ot),He;if(Le===null){for(;ot<Y.length;ot++)Le=ie(H,Y[ot],le),Le!==null&&(_=h(Le,_,ot),At===null?He=Le:At.sibling=Le,At=Le);return wt&&qr(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),At===null?He=bt:At.sibling=bt,At=bt);return e&&Le.forEach(function(Dl){return n(H,Dl)}),wt&&qr(H,ot),He}function Ve(H,_,Y,le){if(Y==null)throw Error(s(151));for(var He=null,At=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 Dl=G(H,Le,kt.value,le);if(Dl===null){Le===null&&(Le=bt);break}e&&Le&&Dl.alternate===null&&n(H,Le),_=h(Dl,_,ot),At===null?He=Dl:At.sibling=Dl,At=Dl,Le=bt}if(kt.done)return r(H,Le),wt&&qr(H,ot),He;if(Le===null){for(;!kt.done;ot++,kt=Y.next())kt=ie(H,kt.value,le),kt!==null&&(_=h(kt,_,ot),At===null?He=kt:At.sibling=kt,At=kt);return wt&&qr(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),At===null?He=kt:At.sibling=kt,At=kt);return e&&Le.forEach(function(wS){return n(H,wS)}),wt&&qr(H,ot),He}function Ft(H,_,Y,le){if(typeof Y=="object"&&Y!==null&&Y.type===D&&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===D){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&&ts(He)===_.type){r(H,_.sibling),le=d(_,Y.props),Mi(le,Y),le.return=H,H=le;break e}r(H,_);break}else n(H,_);_=_.sibling}Y.type===D?(le=Kl(Y.props.children,H.mode,le,Y.key),le.return=H,H=le):(le=ou(Y.type,Y.key,Y.props,null,H.mode,le),Mi(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=Rd(Y,H.mode,le),le.return=H,H=le}return b(H);case T:return Y=ts(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,_,pu(Y),le);if(Y.$$typeof===q)return Ft(H,_,du(H,Y),le);gu(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=Nd(Y,H.mode,le),le.return=H,H=le),b(H)):r(H,_)}return function(H,_,Y,le){try{Oi=0;var He=Ft(H,_,Y,le);return Ls=null,He}catch(Le){if(Le===_s||Le===hu)throw Le;var At=Da(29,Le,null,H.mode);return At.lanes=le,At.return=H,At}finally{}}}var as=kp(!0),Op=kp(!1),fl=!1;function Ud(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bd(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 hl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ml(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=iu(e),pp(e,null,r),n}return su(e,i,n,r),iu(e)}function _i(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 Hd(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 $d=!1;function Li(){if($d){var e=Ms;if(e!==null)throw e}}function zi(e,n,r,i){$d=!1;var d=e.updateQueue;fl=!1;var h=d.firstBaseUpdate,b=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var k=N,F=k.next;k.next=null,b===null?h=F:b.next=F,b=k;var J=e.alternate;J!==null&&(J=J.updateQueue,N=J.lastBaseUpdate,N!==b&&(N===null?J.firstBaseUpdate=F:N.next=F,J.lastBaseUpdate=k))}if(h!==null){var ie=d.baseState;b=0,J=F=k=null,N=h;do{var G=N.lane&-536870913,Q=G!==N.lane;if(Q?(xt&G)===G:(i&G)===G){G!==0&&G===Os&&($d=!0),J!==null&&(J=J.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Oe=e,Ve=N;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:fl=!0}}G=N.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:N.tag,payload:N.payload,callback:N.callback,next:null},J===null?(F=J=Q,k=ie):J=J.next=Q,b|=G;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;Q=N,N=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),xl|=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 zs=C(null),vu=C(0);function Lp(e,n){e=Jr,te(vu,e),te(zs,n),Jr=e|n.baseLanes}function qd(){te(vu,Jr),te(zs,zs.current)}function Id(){Jr=vu.current,V(zs),V(vu)}var Aa=C(null),Pa=null;function pl(e){var n=e.alternate;te(vn,vn.current&1),te(Aa,e),Pa===null&&(n===null||zs.current!==null||n.memoizedState!==null)&&(Pa=e)}function Vd(e){te(vn,vn.current),te(Aa,e),Pa===null&&(Pa=e)}function zp(e){e.tag===22?(te(vn,vn.current),te(Aa,e),Pa===null&&(Pa=e)):gl()}function gl(){te(vn,vn.current),te(Aa,Aa.current)}function ka(e){V(Aa),Pa===e&&(Pa=null),V(vn)}var vn=C(0);function yu(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Kf(r)||Zf(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 Yr=0,st=null,Vt=null,jn=null,xu=!1,Us=!1,rs=!1,bu=0,Ui=0,Bs=null,f1=0;function dn(){throw Error(s(321))}function Yd(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 Fd(e,n,r,i,d,h){return Yr=h,st=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,U.H=e===null||e.memoizedState===null?xg:sf,rs=!1,h=r(i,d),rs=!1,Us&&(h=Bp(n,r,i,d)),Up(e),h}function Up(e){U.H=$i;var n=Vt!==null&&Vt.next!==null;if(Yr=0,jn=Vt=st=null,xu=!1,Ui=0,Bs=null,n)throw Error(s(300));e===null||Tn||(e=e.dependencies,e!==null&&cu(e)&&(Tn=!0))}function Bp(e,n,r,i){st=e;var d=0;do{if(Us&&(Bs=null),Ui=0,Us=!1,25<=d)throw Error(s(301));if(d+=1,jn=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(Us);return h}function h1(){var e=U.H,n=e.useState()[0];return n=typeof n.then=="function"?Bi(n):n,e=e.useState()[0],(Vt!==null?Vt.memoizedState:null)!==e&&(st.flags|=1024),n}function Pd(){var e=bu!==0;return bu=0,e}function Gd(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Xd(e){if(xu){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}xu=!1}Yr=0,jn=Vt=st=null,Us=!1,Ui=bu=0,Bs=null}function fa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?st.memoizedState=jn=e:jn=jn.next=e,jn}function yn(){if(Vt===null){var e=st.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var n=jn===null?st.memoizedState:jn.next;if(n!==null)jn=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},jn===null?st.memoizedState=jn=e:jn=jn.next=e}return jn}function Su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bi(e){var n=Ui;return Ui+=1,Bs===null&&(Bs=[]),e=Cp(Bs,e,n),n=st,(jn===null?n.memoizedState:jn.next)===null&&(n=n.alternate,U.H=n===null||n.memoizedState===null?xg:sf),e}function wu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Bi(e);if(e.$$typeof===q)return Qn(e)}throw Error(s(438,String(e)))}function Qd(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=Su(),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 Fr(e,n){return typeof n=="function"?n(e):n}function Eu(e){var n=yn();return Kd(n,Vt,e)}function Kd(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 N=b=null,k=null,F=n,J=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(xt&ie)===ie:(Yr&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===Os&&(J=!0);else if((Yr&G)===G){F=F.next,G===Os&&(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?(N=k=ie,b=h):k=k.next=ie,st.lanes|=G,xl|=G;ie=F.action,rs&&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?(N=k=G,b=h):k=k.next=G,st.lanes|=ie,xl|=ie;F=F.next}while(F!==null&&F!==n);if(k===null?b=h:k.next=N,!Ca(h,e.memoizedState)&&(Tn=!0,J&&(r=Ms,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 Zd(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)||(Tn=!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,Tn=!0),d=d.queue,ef(Ip.bind(null,i,d,e),[e]),d.getSnapshot!==n||b||jn!==null&&jn.memoizedState.tag&1){if(i.flags|=2048,Hs(9,{destroy:void 0},qp.bind(null,i,d,r,n),null),Jt===null)throw Error(s(349));h||(Yr&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=Su(),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=Ql(e,2);n!==null&&Na(n,e,2)}function Jd(e){var n=fa();if(typeof e=="function"){var r=e;if(e=r(),rs){Tt(!0);try{r()}finally{Tt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:e},n}function Fp(e,n,r,i){return e.baseState=r,Kd(e,Vt,typeof i=="function"?i:Fr)}function m1(e,n,r,i,d){if(ju(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 N=r(d,i),k=U.S;k!==null&&k(b,N),Gp(e,n,N)}catch(F){Wd(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){Wd(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 Wd(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 Wd(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=Jt.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}}cl(i)}i=!1}i&&(n=r[0])}}return r=fa(),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=Jd(!1),h=lf.bind(null,st,!1,i.queue),i=fa(),d={state:n,dispatch:null,action:e,pending:null},i.queue=d,r=m1.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=Kd(e,n,Kp)[0],e=Eu(Fr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=Bi(n)}catch(b){throw b===_s?hu:b}else i=n;n=yn();var d=n.queue,h=d.dispatch;return r!==n.memoizedState&&(st.flags|=2048,Hs(9,{destroy:void 0},p1.bind(null,d,r),null)),[i,h,e]}function p1(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 Hs(e,n,r,i){return e={tag:e,create:r,deps:i,inst:n,next:null},n=st.updateQueue,n===null&&(n=Su(),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 Nu(e,n,r,i){var d=fa();st.flags|=e,d.memoizedState=Hs(1|n,{destroy:void 0},r,i===void 0?null:i)}function Ru(e,n,r,i){var d=yn();i=i===void 0?null:i;var h=d.memoizedState.inst;Vt!==null&&i!==null&&Yd(i,Vt.memoizedState.deps)?d.memoizedState=Hs(n,h,r,i):(st.flags|=e,d.memoizedState=Hs(1|n,h,r,i))}function ng(e,n){Nu(8390656,8,e,n)}function ef(e,n){Ru(2048,8,e,n)}function g1(e){st.flags|=4;var n=st.updateQueue;if(n===null)n=Su(),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 g1({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 Ru(4,2,e,n)}function lg(e,n){return Ru(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,Ru(4,4,sg.bind(null,n,e),r)}function tf(){}function og(e,n){var r=yn();n=n===void 0?null:n;var i=r.memoizedState;return n!==null&&Yd(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&&Yd(n,i[1]))return i[0];if(i=e(),rs){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[i,n],i}function nf(e,n,r){return r===void 0||(Yr&1073741824)!==0&&(xt&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=cv(),st.lanes|=e,xl|=e,r)}function cg(e,n,r,i){return Ca(r,n)?r:zs.current!==null?(e=nf(e,r,i),Ca(e,n)||(Tn=!0),e):(Yr&42)===0||(Yr&1073741824)!==0&&(xt&261930)===0?(Tn=!0,e.memoizedState=r):(e=cv(),st.lanes|=e,xl|=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,N={};U.T=N,lf(e,!1,n,r);try{var k=d(),F=U.S;if(F!==null&&F(N,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var J=d1(k,i);Hi(e,n,J,_a(e))}else Hi(e,n,i,_a(e))}catch(ie){Hi(e,n,{then:function(){},status:"rejected",reason:ie},_a())}finally{B.p=h,b!==null&&N.types!==null&&(b.types=N.types),U.T=b}}function v1(){}function af(e,n,r,i){if(e.tag!==5)throw Error(s(476));var d=fg(e).queue;dg(e,d,n,ue,r===null?v1: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:Fr,lastRenderedState:ue},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,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),Hi(e,n.next.queue,{},_a())}function rf(){return Qn(no)}function mg(){return yn().memoizedState}function pg(){return yn().memoizedState}function y1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=_a();e=hl(r);var i=ml(n,e,r);i!==null&&(Na(i,n,r),_i(i,n,r)),n={cache:Md()},e.payload=n;return}n=n.return}}function x1(e,n,r){var i=_a();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ju(e)?vg(n,r):(r=wd(e,n,r,i),r!==null&&(Na(r,e,i),yg(r,n,i)))}function gg(e,n,r){var i=_a();Hi(e,n,r,i)}function Hi(e,n,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(ju(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,N=h(b,r);if(d.hasEagerState=!0,d.eagerState=N,Ca(N,b))return su(e,n,d,0),Jt===null&&lu(),!1}catch{}finally{}if(r=wd(e,n,d,i),r!==null)return Na(r,e,i),yg(r,n,i),!0}return!1}function lf(e,n,r,i){if(i={lane:2,revertLane:Bf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ju(e)){if(n)throw Error(s(479))}else n=wd(e,r,i,2),n!==null&&Na(n,e,2)}function ju(e){var n=e.alternate;return e===st||n!==null&&n===st}function vg(e,n){Us=xu=!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 $i={readContext:Qn,use:wu,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};$i.useEffectEvent=dn;var xg={readContext:Qn,use:wu,useCallback:function(e,n){return fa().memoizedState=[e,n===void 0?null:n],e},useContext:Qn,useEffect:ng,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Nu(4194308,4,sg.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Nu(4194308,4,e,n)},useInsertionEffect:function(e,n){Nu(4,2,e,n)},useMemo:function(e,n){var r=fa();n=n===void 0?null:n;var i=e();if(rs){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[i,n],i},useReducer:function(e,n,r){var i=fa();if(r!==void 0){var d=r(n);if(rs){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=x1.bind(null,st,e),[i.memoizedState,e]},useRef:function(e){var n=fa();return e={current:e},n.memoizedState=e},useState:function(e){e=Jd(e);var n=e.queue,r=gg.bind(null,st,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:tf,useDeferredValue:function(e,n){var r=fa();return nf(r,e,n)},useTransition:function(){var e=Jd(!1);return e=dg.bind(null,st,e.queue,!0,!1),fa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var i=st,d=fa();if(wt){if(r===void 0)throw Error(s(407));r=r()}else{if(r=n(),Jt===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,Hs(9,{destroy:void 0},qp.bind(null,i,h,r,n),null),r},useId:function(){var e=fa(),n=Jt.identifierPrefix;if(wt){var r=xr,i=yr;r=(i&~(1<<32-Xt(i)-1)).toString(32)+r,n="_"+n+"R_"+r,r=bu++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=f1++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:rf,useFormState:Zp,useActionState:Zp,useOptimistic:function(e){var n=fa();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=lf.bind(null,st,!0,r),r.dispatch=n,[e,n]},useMemoCache:Qd,useCacheRefresh:function(){return fa().memoizedState=y1.bind(null,st)},useEffectEvent:function(e){var n=fa(),r={impl:e};return n.memoizedState=r,function(){if((Ot&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},sf={readContext:Qn,use:wu,useCallback:og,useContext:Qn,useEffect:ef,useImperativeHandle:ig,useInsertionEffect:rg,useLayoutEffect:lg,useMemo:ug,useReducer:Eu,useRef:tg,useState:function(){return Eu(Fr)},useDebugValue:tf,useDeferredValue:function(e,n){var r=yn();return cg(r,Vt.memoizedState,e,n)},useTransition:function(){var e=Eu(Fr)[0],n=yn().memoizedState;return[typeof e=="boolean"?e:Bi(e),n]},useSyncExternalStore:Hp,useId:mg,useHostTransitionStatus:rf,useFormState:Jp,useActionState:Jp,useOptimistic:function(e,n){var r=yn();return Fp(r,Vt,e,n)},useMemoCache:Qd,useCacheRefresh:pg};sf.useEffectEvent=ag;var bg={readContext:Qn,use:wu,useCallback:og,useContext:Qn,useEffect:ef,useImperativeHandle:ig,useInsertionEffect:rg,useLayoutEffect:lg,useMemo:ug,useReducer:Zd,useRef:tg,useState:function(){return Zd(Fr)},useDebugValue:tf,useDeferredValue:function(e,n){var r=yn();return Vt===null?nf(r,e,n):cg(r,Vt.memoizedState,e,n)},useTransition:function(){var e=Zd(Fr)[0],n=yn().memoizedState;return[typeof e=="boolean"?e:Bi(e),n]},useSyncExternalStore:Hp,useId:mg,useHostTransitionStatus:rf,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:Qd,useCacheRefresh:pg};bg.useEffectEvent=ag;function of(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 uf={enqueueSetState:function(e,n,r){e=e._reactInternals;var i=_a(),d=hl(i);d.payload=n,r!=null&&(d.callback=r),n=ml(e,d,i),n!==null&&(Na(n,e,i),_i(n,e,i))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var i=_a(),d=hl(i);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=ml(e,d,i),n!==null&&(Na(n,e,i),_i(n,e,i))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=_a(),i=hl(r);i.tag=2,n!=null&&(i.callback=n),n=ml(e,i,r),n!==null&&(Na(n,e,r),_i(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?!ji(r,i)||!ji(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&&uf.enqueueReplaceState(n,n.state,null)}function ls(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){ru(e)}function Ng(e){console.error(e)}function Rg(e){ru(e)}function Tu(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 cf(e,n,r){return r=hl(r),r.tag=3,r.payload={element:null},r.callback=function(){Tu(e,n)},r}function Tg(e){return e=hl(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"&&(bl===null?bl=new Set([this]):bl.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function b1(e,n,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=r.alternate,n!==null&&ks(n,r,d,!0),r=Aa.current,r!==null){switch(r.tag){case 31:case 13:return Pa===null?Hu():r.alternate===null&&fn===0&&(fn=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===mu?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([i]):n.add(i),Lf(e,i,d)),!1;case 22:return r.flags|=65536,i===mu?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)),Lf(e,i,d)),!1}throw Error(s(435,r.tag))}return Lf(e,i,d),Hu(),!1}if(wt)return n=Aa.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,i!==Cd&&(e=Error(s(422),{cause:i}),Di(Ia(e,r)))):(i!==Cd&&(n=Error(s(423),{cause:i}),Di(Ia(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=Ia(i,r),d=cf(e.stateNode,i,d),Hd(e,d),fn!==4&&(fn=2)),!1;var h=Error(s(520),{cause:i});if(h=Ia(h,r),Xi===null?Xi=[h]:Xi.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=cf(r.stateNode,i,e),Hd(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"&&(bl===null||!bl.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Tg(d),Cg(d,e,r,i),Hd(r,d),!1}r=r.return}while(r!==null);return!1}var df=Error(s(461)),Tn=!1;function Kn(e,n,r,i){n.child=e===null?Op(n,null,r,i):as(n,e.child,r,i)}function Dg(e,n,r,i,d){r=r.render;var h=n.ref;if("ref"in i){var b={};for(var N in i)N!=="ref"&&(b[N]=i[N])}else b=i;return Wl(n),i=Fd(e,n,r,b,h,d),N=Pd(),e!==null&&!Tn?(Gd(e,n,d),Pr(e,n,d)):(wt&&N&&jd(n),n.flags|=1,Kn(e,n,i,d),n.child)}function Ag(e,n,r,i,d){if(e===null){var h=r.type;return typeof h=="function"&&!Ed(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,kg(e,n,h,i,d)):(e=ou(r.type,null,i,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!xf(e,d)){var b=h.memoizedProps;if(r=r.compare,r=r!==null?r:ji,r(b,i)&&e.ref===n.ref)return Pr(e,n,d)}return n.flags|=1,e=$r(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(ji(h,i)&&e.ref===n.ref)if(Tn=!1,n.pendingProps=i=h,xf(e,d))(e.flags&131072)!==0&&(Tn=!0);else return n.lanes=e.lanes,Pr(e,n,d)}return ff(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&&fu(n,h!==null?h.cachePool:null),h!==null?Lp(n,h):qd(),zp(n);else return i=n.lanes=536870912,Mg(e,n,h!==null?h.baseLanes|r:r,r,i)}else h!==null?(fu(n,h.cachePool),Lp(n,h),gl(),n.memoizedState=null):(e!==null&&fu(n,null),qd(),gl());return Kn(e,n,d,r),n.child}function qi(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=Ld();return h=h===null?null:{parent:Rn._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&fu(n,null),qd(),zp(n),e!==null&&ks(e,n,i,!0),n.childLanes=d,null}function Cu(e,n){return n=Au({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 as(n,e.child,null,r),e=Cu(n,n.pendingProps),e.flags|=2,ka(n),n.memoizedState=null,e}function S1(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=Cu(n,i),n.lanes=536870912,qi(null,e);if(Vd(n),(e=rn)?(e=Pv(e,Fa),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ol!==null?{id:yr,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},r=vp(e),r.return=n,n.child=r,Xn=n,rn=null)):e=null,e===null)throw cl(n);return n.lanes=536870912,null}return Cu(n,i)}var h=e.memoizedState;if(h!==null){var b=h.dehydrated;if(Vd(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(Tn||ks(e,n,r,!1),d=(r&e.childLanes)!==0,Tn||d){if(i=Jt,i!==null&&(b=A(i,r),b!==0&&b!==h.retryLane))throw h.retryLane=b,Ql(e,b),Na(i,e,b),df;Hu(),n=_g(e,n,r)}else e=h.treeContext,rn=Ga(b.nextSibling),Xn=n,wt=!0,ul=null,Fa=!1,e!==null&&bp(n,e),n=Cu(n,i),n.flags|=4096;return n}return e=$r(e.child,{mode:i.mode,children:i.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Du(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 ff(e,n,r,i,d){return Wl(n),r=Fd(e,n,r,i,void 0,d),i=Pd(),e!==null&&!Tn?(Gd(e,n,d),Pr(e,n,d)):(wt&&i&&jd(n),n.flags|=1,Kn(e,n,r,d),n.child)}function Lg(e,n,r,i,d,h){return Wl(n),n.updateQueue=null,r=Bp(n,i,r,d),Up(e),i=Pd(),e!==null&&!Tn?(Gd(e,n,h),Pr(e,n,h)):(wt&&i&&jd(n),n.flags|=1,Kn(e,n,r,h),n.child)}function zg(e,n,r,i,d){if(Wl(n),n.stateNode===null){var h=Ts,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=uf,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=i,h.state=n.memoizedState,h.refs={},Ud(n),b=r.contextType,h.context=typeof b=="object"&&b!==null?Qn(b):Ts,h.state=n.memoizedState,b=r.getDerivedStateFromProps,typeof b=="function"&&(of(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&&uf.enqueueReplaceState(h,h.state,null),zi(n,i,h,d),Li(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(e===null){h=n.stateNode;var N=n.memoizedProps,k=ls(r,N);h.props=k;var F=h.context,J=r.contextType;b=Ts,typeof J=="object"&&J!==null&&(b=Qn(J));var ie=r.getDerivedStateFromProps;J=typeof ie=="function"||typeof h.getSnapshotBeforeUpdate=="function",N=n.pendingProps!==N,J||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(N||F!==b)&&wg(n,h,i,b),fl=!1;var G=n.memoizedState;h.state=G,zi(n,i,h,d),Li(),F=n.memoizedState,N||G!==F||fl?(typeof ie=="function"&&(of(n,r,ie,i),F=n.memoizedState),(k=fl||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,Bd(e,n),b=n.memoizedProps,J=ls(r,b),h.props=J,ie=n.pendingProps,G=h.context,F=r.contextType,k=Ts,typeof F=="object"&&F!==null&&(k=Qn(F)),N=r.getDerivedStateFromProps,(F=typeof N=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==ie||G!==k)&&wg(n,h,i,k),fl=!1,G=n.memoizedState,h.state=G,zi(n,i,h,d),Li();var Q=n.memoizedState;b!==ie||G!==Q||fl||e!==null&&e.dependencies!==null&&cu(e.dependencies)?(typeof N=="function"&&(of(n,r,N,i),Q=n.memoizedState),(J=fl||Sg(n,r,J,i,G,Q,k)||e!==null&&e.dependencies!==null&&cu(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,Du(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=as(n,e.child,null,d),n.child=as(n,null,r,d)):Kn(e,n,r,d),n.memoizedState=h.state,e=n.child):e=Pr(e,n,d),e}function Ug(e,n,r,i){return Zl(),n.flags|=256,Kn(e,n,r,i),n.child}var hf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mf(e){return{baseLanes:e,cachePool:jp()}}function pf(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?pl(n):gl(),(e=rn)?(e=Pv(e,Fa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:ol!==null?{id:yr,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},r=vp(e),r.return=n,n.child=r,Xn=n,rn=null)):e=null,e===null)throw cl(n);return Zf(e)?n.lanes=32:n.lanes=536870912,null}var N=i.children;return i=i.fallback,d?(gl(),d=n.mode,N=Au({mode:"hidden",children:N},d),i=Kl(i,d,r,null),N.return=n,i.return=n,N.sibling=i,n.child=N,i=n.child,i.memoizedState=mf(r),i.childLanes=pf(e,b,r),n.memoizedState=hf,qi(null,i)):(pl(n),gf(n,N))}var k=e.memoizedState;if(k!==null&&(N=k.dehydrated,N!==null)){if(h)n.flags&256?(pl(n),n.flags&=-257,n=vf(e,n,r)):n.memoizedState!==null?(gl(),n.child=e.child,n.flags|=128,n=null):(gl(),N=i.fallback,d=n.mode,i=Au({mode:"visible",children:i.children},d),N=Kl(N,d,r,null),N.flags|=2,i.return=n,N.return=n,i.sibling=N,n.child=i,as(n,e.child,null,r),i=n.child,i.memoizedState=mf(r),i.childLanes=pf(e,b,r),n.memoizedState=hf,n=qi(null,i));else if(pl(n),Zf(N)){if(b=N.nextSibling&&N.nextSibling.dataset,b)var F=b.dgst;b=F,i=Error(s(419)),i.stack="",i.digest=b,Di({value:i,source:null,stack:null}),n=vf(e,n,r)}else if(Tn||ks(e,n,r,!1),b=(r&e.childLanes)!==0,Tn||b){if(b=Jt,b!==null&&(i=A(b,r),i!==0&&i!==k.retryLane))throw k.retryLane=i,Ql(e,i),Na(b,e,i),df;Kf(N)||Hu(),n=vf(e,n,r)}else Kf(N)?(n.flags|=192,n.child=e.child,n=null):(e=k.treeContext,rn=Ga(N.nextSibling),Xn=n,wt=!0,ul=null,Fa=!1,e!==null&&bp(n,e),n=gf(n,i.children),n.flags|=4096);return n}return d?(gl(),N=i.fallback,d=n.mode,k=e.child,F=k.sibling,i=$r(k,{mode:"hidden",children:i.children}),i.subtreeFlags=k.subtreeFlags&65011712,F!==null?N=$r(F,N):(N=Kl(N,d,r,null),N.flags|=2),N.return=n,i.return=n,i.sibling=N,n.child=i,qi(null,i),i=n.child,N=e.child.memoizedState,N===null?N=mf(r):(d=N.cachePool,d!==null?(k=Rn._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=jp(),N={baseLanes:N.baseLanes|r,cachePool:d}),i.memoizedState=N,i.childLanes=pf(e,b,r),n.memoizedState=hf,qi(e.child,i)):(pl(n),r=e.child,e=r.sibling,r=$r(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 gf(e,n){return n=Au({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Au(e,n){return e=Da(22,e,null,n),e.lanes=0,e}function vf(e,n,r){return as(n,e.child,null,r),e=gf(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),kd(e.return,n,r)}function yf(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,N=(b&2)!==0;if(N?(b=b&1|2,n.flags|=128):b&=1,te(vn,b),Kn(e,n,i,r),i=wt?Ci:0,!N&&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&&yu(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),yf(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&&yu(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}yf(n,!0,r,null,h,i);break;case"together":yf(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function Pr(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),xl|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(ks(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=$r(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=$r(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function xf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&cu(e)))}function w1(e,n,r){switch(n.tag){case 3:ut(n,n.stateNode.containerInfo),dl(n,Rn,e.memoizedState.cache),Zl();break;case 27:case 5:nt(n);break;case 4:ut(n,n.stateNode.containerInfo);break;case 10:dl(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Vd(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(pl(n),n.flags|=128,null):(r&n.child.childLanes)!==0?Bg(e,n,r):(pl(n),e=Pr(e,n,r),e!==null?e.sibling:null);pl(n);break;case 19:var d=(e.flags&128)!==0;if(i=(r&n.childLanes)!==0,i||(ks(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),te(vn,vn.current),i)break;return null;case 22:return n.lanes=0,Og(e,n,r,n.pendingProps);case 24:dl(n,Rn,e.memoizedState.cache)}return Pr(e,n,r)}function qg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)Tn=!0;else{if(!xf(e,r)&&(n.flags&128)===0)return Tn=!1,w1(e,n,r);Tn=(e.flags&131072)!==0}else Tn=!1,wt&&(n.flags&1048576)!==0&&xp(n,Ci,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(e=ts(n.elementType),n.type=e,typeof e=="function")Ed(e)?(i=ls(e,i),n.tag=1,n=zg(null,n,e,i,r)):(n.tag=0,n=ff(null,n,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===X){n.tag=11,n=Dg(null,n,e,i,r);break e}else if(d===z){n.tag=14,n=Ag(null,n,e,i,r);break e}}throw n=re(e)||e,Error(s(306,n,""))}}return n;case 0:return ff(e,n,n.type,n.pendingProps,r);case 1:return i=n.type,d=ls(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,Bd(e,n),zi(n,i,null,r);var b=n.memoizedState;if(i=b.cache,dl(n,Rn,i),i!==h.cache&&Od(n,[Rn],r,!0),Li(),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),Di(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,ul=null,Fa=!0,r=Op(n,null,i,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Zl(),i===d){n=Pr(e,n,r);break e}Kn(e,n,i,r)}n=n.child}return n;case 26:return Du(e,n),e===null?(r=Jv(n.type,null,n.pendingProps,null))?n.memoizedState=r:wt||(r=n.type,e=n.pendingProps,i=Pu(je.current).createElement(r),i[ve]=n,i[Ae]=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,Nl(n.type)?(Jf=d,rn=Ga(i.firstChild)):rn=d),Kn(e,n,n.pendingProps.children,r),Du(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&wt&&((d=i=rn)&&(i=J1(i,n.type,n.pendingProps,Fa),i!==null?(n.stateNode=i,Xn=n,rn=Ga(i.firstChild),Fa=!1,d=!0):d=!1),d||cl(n)),nt(n),d=n.type,h=n.pendingProps,b=e!==null?e.memoizedProps:null,i=h.children,Gf(d,h)?i=null:b!==null&&Gf(d,b)&&(n.flags|=32),n.memoizedState!==null&&(d=Fd(e,n,h1,null,null,r),no._currentValue=d),Du(e,n),Kn(e,n,i,r),n.child;case 6:return e===null&&wt&&((e=r=rn)&&(r=W1(r,n.pendingProps,Fa),r!==null?(n.stateNode=r,Xn=n,rn=null,e=!0):e=!1),e||cl(n)),null;case 13:return Bg(e,n,r);case 4:return ut(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=as(n,null,i,r):Kn(e,n,i,r),n.child;case 11:return Dg(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,dl(n,n.type,i.value),Kn(e,n,i.children,r),n.child;case 9:return d=n.type._context,i=n.pendingProps.children,Wl(n),d=Qn(d),i=i(d),n.flags|=1,Kn(e,n,i,r),n.child;case 14:return Ag(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 S1(e,n,r);case 22:return Og(e,n,r,n.pendingProps);case 24:return Wl(n),i=Qn(Rn),e===null?(d=Ld(),d===null&&(d=Jt,h=Md(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),n.memoizedState={parent:i,cache:d},Ud(n),dl(n,Rn,d)):((e.lanes&r)!==0&&(Bd(e,n),zi(n,null,null,r),Li()),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),dl(n,Rn,i)):(i=h.cache,dl(n,Rn,i),i!==d.cache&&Od(n,[Rn],r,!0))),Kn(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function Gr(e){e.flags|=4}function bf(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 ns=mu,zd}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 ns=mu,zd}function ku(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Qt():536870912,e.lanes|=n,Vs|=n)}function Ii(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 E1(e,n,r){var i=n.pendingProps;switch(Td(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),Vr(Rn),Pe(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(As(n)?Gr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Dd())),ln(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(Gr(n),h!==null?(ln(n),Ig(n,h)):(ln(n),bf(n,d,null,i,r))):h?h!==e.memoizedState?(Gr(n),ln(n),Ig(n,h)):(ln(n),n.flags&=-16777217):(e=e.memoizedProps,e!==i&&Gr(n),ln(n),bf(n,d,e,i,r)),null;case 27:if(bn(n),r=je.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Gr(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return ln(n),null}e=me.current,As(n)?Sp(n):(e=Qv(d,i,r),n.stateNode=e,Gr(n))}return ln(n),null;case 5:if(bn(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Gr(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return ln(n),null}if(h=me.current,As(n))Sp(n);else{var b=Pu(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[Ae]=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&&Gr(n)}}return ln(n),bf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==i&&Gr(n);else{if(typeof i!="string"&&n.stateNode===null)throw Error(s(166));if(e=je.current,As(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||cl(n,!0)}else e=Pu(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=As(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 Zl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ln(n),e=!1}else r=Dd(),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=As(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 Zl(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ln(n),d=!1}else d=Dd(),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),ku(n,n.updateQueue),ln(n),null);case 4:return Pe(),e===null&&If(n.stateNode.containerInfo),ln(n),null;case 10:return Vr(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)Ii(i,!1);else{if(fn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=yu(e),h!==null){for(n.flags|=128,Ii(i,!1),e=h.updateQueue,n.updateQueue=e,ku(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)gp(r,e),r=r.sibling;return te(vn,vn.current&1|2),wt&&qr(n,i.treeForkCount),n.child}e=e.sibling}i.tail!==null&&en()>zu&&(n.flags|=128,d=!0,Ii(i,!1),n.lanes=4194304)}else{if(!d)if(e=yu(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,ku(n,e),Ii(i,!0),i.tail===null&&i.tailMode==="hidden"&&!h.alternate&&!wt)return ln(n),null}else 2*en()-i.renderingStartTime>zu&&r!==536870912&&(n.flags|=128,d=!0,Ii(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=en(),e.sibling=null,r=vn.current,te(vn,d?r&1|2:r&1),wt&&qr(n,i.treeForkCount),e):(ln(n),null);case 22:case 23:return ka(n),Id(),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&&ku(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(es),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Vr(Rn),ln(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function N1(e,n){switch(Td(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Vr(Rn),Pe(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return bn(n),null;case 31:if(n.memoizedState!==null){if(ka(n),n.alternate===null)throw Error(s(340));Zl()}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));Zl()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return V(vn),null;case 4:return Pe(),null;case 10:return Vr(n.type),null;case 22:case 23:return ka(n),Id(),e!==null&&V(es),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Vr(Rn),null;case 25:return null;default:return null}}function Vg(e,n){switch(Td(n),n.tag){case 3:Vr(Rn),Pe();break;case 26:case 27:case 5:bn(n);break;case 4:Pe();break;case 31:n.memoizedState!==null&&ka(n);break;case 13:ka(n);break;case 19:V(vn);break;case 10:Vr(n.type);break;case 22:case 23:ka(n),Id(),e!==null&&V(es);break;case 24:Vr(Rn)}}function Vi(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(N){It(n,n.return,N)}}function vl(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,N=b.destroy;if(N!==void 0){b.destroy=void 0,d=n;var k=r,F=N;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=ls(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){It(e,n,i)}}function Yi(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 br(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 Sf(e,n,r){try{var i=e.stateNode;P1(i,e.type,r,n),i[Ae]=n}catch(d){It(e,e.return,d)}}function Gg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Nl(e.type)||e.tag===4}function wf(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&&Nl(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 Ef(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&&Nl(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(Ef(e,n,r),e=e.sibling;e!==null;)Ef(e,n,r),e=e.sibling}function Ou(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&&Nl(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Ou(e,n,r),e=e.sibling;e!==null;)Ou(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[Ae]=r}catch(h){It(e,e.return,h)}}var Xr=!1,Cn=!1,Nf=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,In=null;function R1(e,n){if(e=e.containerInfo,Ff=Wu,e=ip(e),gd(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,N=-1,k=-1,F=0,J=0,ie=e,G=null;t:for(;;){for(var Q;ie!==r||d!==0&&ie.nodeType!==3||(N=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&&(N=b),G===h&&++J===i&&(k=b),(Q=ie.nextSibling)!==null)break;ie=G,G=ie.parentNode}ie=Q}r=N===-1||k===-1?null:{start:N,end:k}}else r=null}r=r||{start:0,end:0}}else r=null;for(Pf={focusedElem:e,selectionRange:r},Wu=!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=ls(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)Qf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Qf(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:Kr(e,r),i&4&&Vi(5,r);break;case 1:if(Kr(e,r),i&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(b){It(r,r.return,b)}else{var d=ls(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&&Yi(r,r.return);break;case 3:if(Kr(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:Kr(e,r),n===null&&i&4&&Pg(r),i&512&&Yi(r,r.return);break;case 12:Kr(e,r);break;case 31:Kr(e,r),i&4&&Wg(e,r);break;case 13:Kr(e,r),i&4&&ev(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=_1.bind(null,r),eS(e,r))));break;case 22:if(i=r.memoizedState!==null||Xr,!i){n=n!==null&&n.memoizedState!==null||Cn,d=Xr;var h=Cn;Xr=i,(Cn=n)&&!h?Zr(e,r,(r.subtreeFlags&8772)!==0):Kr(e,r),Xr=d,Cn=h}break;case 30:break;default:Kr(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 Qr(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:Cn||br(r,n),Qr(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Cn||br(r,n);var i=on,d=ba;Nl(r.type)&&(on=r.stateNode,ba=!1),Qr(e,n,r),Wi(r.stateNode),on=i,ba=d;break;case 5:Cn||br(r,n);case 6:if(i=on,d=ba,on=null,Qr(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),Zs(e)):Yv(on,r.stateNode));break;case 4:i=on,d=ba,on=r.stateNode.containerInfo,ba=!0,Qr(e,n,r),on=i,ba=d;break;case 0:case 11:case 14:case 15:vl(2,r,n),Cn||vl(4,r,n),Qr(e,n,r);break;case 1:Cn||(br(r,n),i=r.stateNode,typeof i.componentWillUnmount=="function"&&Fg(r,n,i)),Qr(e,n,r);break;case 21:Qr(e,n,r);break;case 22:Cn=(i=Cn)||r.memoizedState!==null,Qr(e,n,r),Cn=i;break;default:Qr(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{Zs(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{Zs(e)}catch(r){It(n,n.return,r)}}function j1(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 Mu(e,n){var r=j1(e);n.forEach(function(i){if(!r.has(i)){r.add(i);var d=L1.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,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(Nl(N.type)){on=N.stateNode,ba=!1;break e}break;case 5:on=N.stateNode,ba=!1;break e;case 3:case 4:on=N.stateNode.containerInfo,ba=!0;break e}N=N.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 sr=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&&(vl(3,e,e.return),Vi(3,e),vl(5,e,e.return));break;case 1:Sa(n,e),wa(e),i&512&&(Cn||r===null||br(r,r.return)),i&64&&Xr&&(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=sr;if(Sa(n,e),wa(e),i&512&&(Cn||r===null||br(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 N=0;N<b.length;N++)if(h=b[N],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(N,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(N=0;N<b.length;N++)if(h=b[N],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(N,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&&Sf(e,e.memoizedProps,r.memoizedProps)}break;case 27:Sa(n,e),wa(e),i&512&&(Cn||r===null||br(r,r.return)),r!==null&&i&4&&Sf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Sa(n,e),wa(e),i&512&&(Cn||r===null||br(r,r.return)),e.flags&32){d=e.stateNode;try{sl(d,"")}catch(Oe){It(e,e.return,Oe)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,Sf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(Nf=!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(Qu=null,d=sr,sr=Gu(n.containerInfo),Sa(n,e),sr=d,wa(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Zs(n.containerInfo)}catch(Oe){It(e,e.return,Oe)}Nf&&(Nf=!1,nv(e));break;case 4:i=sr,sr=Gu(e.stateNode.containerInfo),Sa(n,e),wa(e),sr=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,Mu(e,i)));break;case 13:Sa(n,e),wa(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Lu=en()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Mu(e,i)));break;case 22:d=e.memoizedState!==null;var k=r!==null&&r.memoizedState!==null,F=Xr,J=Cn;if(Xr=F||d,Cn=J||k,Sa(n,e),Cn=J,Xr=F,wa(e),i&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(r===null||k||Xr||Cn||ss(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{N=k.stateNode;var ie=k.memoizedProps.style,G=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;N.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,Mu(e,r))));break;case 19:Sa(n,e),wa(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Mu(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=wf(e);Ou(e,h,d);break;case 5:var b=r.stateNode;r.flags&32&&(sl(b,""),r.flags&=-33);var N=wf(e);Ou(e,N,b);break;case 3:case 4:var k=r.stateNode.containerInfo,F=wf(e);Ef(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 Kr(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Kg(e,n.alternate,n),n=n.sibling}function ss(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:vl(4,n,n.return),ss(n);break;case 1:br(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Fg(n,n.return,r),ss(n);break;case 27:Wi(n.stateNode);case 26:case 5:br(n,n.return),ss(n);break;case 22:n.memoizedState===null&&ss(n);break;case 30:ss(n);break;default:ss(n)}e=e.sibling}}function Zr(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:Zr(d,h,r),Vi(4,h);break;case 1:if(Zr(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 N=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],N)}catch(F){It(i,i.return,F)}}r&&b&64&&Yg(h),Yi(h,h.return);break;case 27:Xg(h);case 26:case 5:Zr(d,h,r),r&&i===null&&b&4&&Pg(h),Yi(h,h.return);break;case 12:Zr(d,h,r);break;case 31:Zr(d,h,r),r&&b&4&&Wg(d,h);break;case 13:Zr(d,h,r),r&&b&4&&ev(d,h);break;case 22:h.memoizedState===null&&Zr(d,h,r),Yi(h,h.return);break;case 30:break;default:Zr(d,h,r)}n=n.sibling}}function Rf(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&&Ai(r))}function jf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Ai(e))}function ir(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:ir(e,n,r,i),d&2048&&Vi(9,n);break;case 1:ir(e,n,r,i);break;case 3:ir(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&&Ai(e)));break;case 12:if(d&2048){ir(e,n,r,i),e=n.stateNode;try{var h=n.memoizedProps,b=h.id,N=h.onPostCommit;typeof N=="function"&&N(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){It(n,n.return,k)}}else ir(e,n,r,i);break;case 31:ir(e,n,r,i);break;case 13:ir(e,n,r,i);break;case 23:break;case 22:h=n.stateNode,b=n.alternate,n.memoizedState!==null?h._visibility&2?ir(e,n,r,i):Fi(e,n):h._visibility&2?ir(e,n,r,i):(h._visibility|=2,$s(e,n,r,i,(n.subtreeFlags&10256)!==0||!1)),d&2048&&Rf(b,n);break;case 24:ir(e,n,r,i),d&2048&&jf(n.alternate,n);break;default:ir(e,n,r,i)}}function $s(e,n,r,i,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,b=n,N=r,k=i,F=b.flags;switch(b.tag){case 0:case 11:case 15:$s(h,b,N,k,d),Vi(8,b);break;case 23:break;case 22:var J=b.stateNode;b.memoizedState!==null?J._visibility&2?$s(h,b,N,k,d):Fi(h,b):(J._visibility|=2,$s(h,b,N,k,d)),d&&F&2048&&Rf(b.alternate,b);break;case 24:$s(h,b,N,k,d),d&&F&2048&&jf(b.alternate,b);break;default:$s(h,b,N,k,d)}n=n.sibling}}function Fi(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:Fi(r,i),d&2048&&Rf(i.alternate,i);break;case 24:Fi(r,i),d&2048&&jf(i.alternate,i);break;default:Fi(r,i)}n=n.sibling}}var Pi=8192;function qs(e,n,r){if(e.subtreeFlags&Pi)for(e=e.child;e!==null;)rv(e,n,r),e=e.sibling}function rv(e,n,r){switch(e.tag){case 26:qs(e,n,r),e.flags&Pi&&e.memoizedState!==null&&fS(r,sr,e.memoizedState,e.memoizedProps);break;case 5:qs(e,n,r);break;case 3:case 4:var i=sr;sr=Gu(e.stateNode.containerInfo),qs(e,n,r),sr=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Pi,Pi=16777216,qs(e,n,r),Pi=i):qs(e,n,r));break;default:qs(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 Gi(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:Gi(e),e.flags&2048&&vl(9,e,e.return);break;case 3:Gi(e);break;case 12:Gi(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,_u(e)):Gi(e);break;default:Gi(e)}}function _u(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:vl(8,n,n.return),_u(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,_u(n));break;default:_u(n)}e=e.sibling}}function iv(e,n){for(;In!==null;){var r=In;switch(r.tag){case 0:case 11:case 15:vl(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:Ai(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 T1={getCacheForType:function(e){var n=Qn(Rn),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return Qn(Rn).controller.signal}},C1=typeof WeakMap=="function"?WeakMap:Map,Ot=0,Jt=null,mt=null,xt=0,qt=0,Oa=null,yl=!1,Is=!1,Tf=!1,Jr=0,fn=0,xl=0,is=0,Cf=0,Ma=0,Vs=0,Xi=null,Ea=null,Df=!1,Lu=0,ov=0,zu=1/0,Uu=null,bl=null,Ln=0,Sl=null,Ys=null,Wr=0,Af=0,kf=null,uv=null,Qi=0,Of=null;function _a(){return(Ot&2)!==0&&xt!==0?xt&-xt:U.T!==null?Bf():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=Aa.current,e!==null&&(e.flags|=32),Ma}function Na(e,n,r){(e===Jt&&(qt===2||qt===9)||e.cancelPendingCommit!==null)&&(Fs(e,0),wl(e,xt,Ma,!1)),ht(e,r),((Ot&2)===0||e!==Jt)&&(e===Jt&&((Ot&2)===0&&(is|=r),fn===4&&wl(e,xt,Ma,!1)),Sr(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?k1(e,n):_f(e,n,!0),h=i;do{if(d===0){Is&&!i&&wl(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!D1(r)){d=_f(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 N=e;d=Xi;var k=N.current.memoizedState.isDehydrated;if(k&&(Fs(N,b).flags|=256),b=_f(N,b,!1),b!==2){if(Tf&&!k){N.errorRecoveryDisabledLanes|=h,is|=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){Fs(e,0),wl(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:wl(i,n,Ma,!yl);break e;case 2:Ea=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(d=Lu+300-en(),10<d)){if(wl(i,n,Ma,!yl),Bt(i,0,!0)!==0)break e;Wr=n,i.timeoutHandle=Iv(fv.bind(null,i,r,Ea,Uu,Df,n,Ma,is,Vs,yl,h,"Throttled",-0,0),d);break e}fv(i,r,Ea,Uu,Df,n,Ma,is,Vs,yl,h,null,-0,0)}}break}while(!0);Sr(e)}function fv(e,n,r,i,d,h,b,N,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?Lu-en():(h&4194048)===h?ov-en():0;if(Oe=hS(ie,Oe),Oe!==null){Wr=h,e.cancelPendingCommit=Oe(bv.bind(null,e,n,h,r,i,d,b,N,k,J,ie,null,G,Q)),wl(e,h,b,!F);return}}bv(e,n,h,r,i,d,b,N,k)}function D1(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 wl(e,n,r,i){n&=~Cf,n&=~is,e.suspendedLanes|=n,e.pingedLanes&=~n,i&&(e.warmLanes|=n),i=e.expirationTimes;for(var d=n;0<d;){var h=31-Xt(d),b=1<<h;i[h]=-1,d&=~b}r!==0&&Sn(e,r,n)}function Bu(){return(Ot&6)===0?(Ki(0),!1):!0}function Mf(){if(mt!==null){if(qt===0)var e=mt.return;else e=mt,Ir=Jl=null,Xd(e),Ls=null,Oi=0,e=mt;for(;e!==null;)Vg(e.alternate,e),e=e.return;mt=null}}function Fs(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,Q1(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Wr=0,Mf(),Jt=e,mt=r=$r(e.current,null),xt=n,qt=0,Oa=null,yl=!1,Is=Ct(e,n),Tf=!1,Vs=Ma=Cf=is=xl=fn=0,Ea=Xi=null,Df=!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-Xt(i),h=1<<d;n|=e[d],i&=~h}return Jr=n,lu(),r}function hv(e,n){st=null,U.H=$i,n===_s||n===hu?(n=Dp(),qt=3):n===zd?(n=Dp(),qt=4):qt=n===df?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Oa=n,mt===null&&(fn=1,Tu(e,Ia(n,e.current)))}function mv(){var e=Aa.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=$i,e===null?$i:e}function gv(){var e=U.A;return U.A=T1,e}function Hu(){fn=4,yl||(xt&4194048)!==xt&&Aa.current!==null||(Is=!0),(xl&134217727)===0&&(is&134217727)===0||Jt===null||wl(Jt,xt,Ma,!1)}function _f(e,n,r){var i=Ot;Ot|=2;var d=pv(),h=gv();(Jt!==e||xt!==n)&&(Uu=null,Fs(e,n)),n=!1;var b=fn;e:do try{if(qt!==0&&mt!==null){var N=mt,k=Oa;switch(qt){case 8:Mf(),b=6;break e;case 3:case 2:case 9:case 6:Aa.current===null&&(n=!0);var F=qt;if(qt=0,Oa=null,Ps(e,N,k,F),r&&Is){b=0;break e}break;default:F=qt,qt=0,Oa=null,Ps(e,N,k,F)}}A1(),b=fn;break}catch(J){hv(e,J)}while(!0);return n&&e.shellSuspendCounter++,Ir=Jl=null,Ot=i,U.H=d,U.A=h,mt===null&&(Jt=null,xt=0,lu()),b}function A1(){for(;mt!==null;)vv(mt)}function k1(e,n){var r=Ot;Ot|=2;var i=pv(),d=gv();Jt!==e||xt!==n?(Uu=null,zu=en()+500,Fs(e,n)):Is=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,Ps(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||Jt!==e||(qt=7),Sr(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,Ps(e,n,h,7));break;case 5:var b=null;switch(mt.tag){case 26:b=mt.memoizedState;case 5:case 27:var N=mt;if(b?ay(b):N.stateNode.complete){qt=0,Oa=null;var k=N.sibling;if(k!==null)mt=k;else{var F=N.return;F!==null?(mt=F,$u(F)):mt=null}break t}}qt=0,Oa=null,Ps(e,n,h,5);break;case 6:qt=0,Oa=null,Ps(e,n,h,6);break;case 8:Mf(),fn=6;break e;default:throw Error(s(462))}}O1();break}catch(J){hv(e,J)}while(!0);return Ir=Jl=null,U.H=i,U.A=d,Ot=r,mt!==null?0:(Jt=null,xt=0,lu(),fn)}function O1(){for(;mt!==null&&!Hn();)vv(mt)}function vv(e){var n=qg(e.alternate,e,Jr);e.memoizedProps=e.pendingProps,n===null?$u(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:Xd(n);default:Vg(r,n),n=mt=gp(n,Jr),n=qg(r,n,Jr)}e.memoizedProps=e.pendingProps,n===null?$u(e):mt=n}function Ps(e,n,r,i){Ir=Jl=null,Xd(n),Ls=null,Oi=0;var d=n.return;try{if(b1(e,d,n,r,xt)){fn=1,Tu(e,Ia(r,e.current)),mt=null;return}}catch(h){if(d!==null)throw mt=d,h;fn=1,Tu(e,Ia(r,e.current)),mt=null;return}n.flags&32768?(wt||i===1?e=!0:Is||(xt&536870912)!==0?e=!1:(yl=e=!0,(i===2||i===9||i===3||i===6)&&(i=Aa.current,i!==null&&i.tag===13&&(i.flags|=16384))),xv(n,e)):$u(n)}function $u(e){var n=e;do{if((n.flags&32768)!==0){xv(n,yl);return}e=n.return;var r=E1(n.alternate,n,Jr);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=N1(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,N,k){e.cancelPendingCommit=null;do qu();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|=Sd,Je(e,r,h,b,N,k),e===Jt&&(mt=Jt=null,xt=0),Ys=n,Sl=e,Wr=r,Af=h,kf=d,uv=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,z1(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{R1(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=Sl,n=Ys,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=Pf,b=ip(e.containerInfo),N=h.focusedElem,k=h.selectionRange;if(b!==N&&N&&N.ownerDocument&&sp(N.ownerDocument.documentElement,N)){if(k!==null&&gd(N)){var F=k.start,J=k.end;if(J===void 0&&(J=F),"selectionStart"in N)N.selectionStart=F,N.selectionEnd=Math.min(J,N.value.length);else{var ie=N.ownerDocument||document,G=ie&&ie.defaultView||window;if(G.getSelection){var Q=G.getSelection(),Oe=N.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(N,Ve),_=lp(N,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=N;Q=Q.parentNode;)Q.nodeType===1&&ie.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ie.length;N++){var le=ie[N];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Wu=!!Ff,Pf=Ff=null}finally{Ot=d,B.p=i,U.T=r}}e.current=n,Ln=2}}function wv(){if(Ln===2){Ln=0;var e=Sl,n=Ys,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=Sl,n=Ys,r=Wr,i=uv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ln=5:(Ln=0,Ys=Sl=null,Nv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(bl=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 N=i[b];h(N.value,{componentStack:N.stack})}}finally{U.T=n,B.p=d}}(Wr&3)!==0&&qu(),Sr(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Of?Qi++:(Qi=0,Of=e):Qi=0,Ki(0)}}function Nv(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Ai(n)))}function qu(){return Sv(),wv(),Ev(),Rv()}function Rv(){if(Ln!==5)return!1;var e=Sl,n=Af;Af=0;var r=$(Wr),i=U.T,d=B.p;try{B.p=32>r?32:r,U.T=null,r=kf,kf=null;var h=Sl,b=Wr;if(Ln=0,Ys=Sl=null,Wr=0,(Ot&6)!==0)throw Error(s(331));var N=Ot;if(Ot|=4,sv(h.current),av(h,h.current,b,r),Ot=N,Ki(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=cf(e.stateNode,n,2),e=ml(e,n,2),e!==null&&(ht(e,2),Sr(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"&&(bl===null||!bl.has(i))){e=Ia(r,e),r=Tg(2),i=ml(n,r,2),i!==null&&(Cg(r,i,n,e),ht(i,2),Sr(i));break}}n=n.return}}function Lf(e,n,r){var i=e.pingCache;if(i===null){i=e.pingCache=new C1;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)||(Tf=!0,d.add(r),e=M1.bind(null,e,n,r),n.then(e,e))}function M1(e,n,r){var i=e.pingCache;i!==null&&i.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Jt===e&&(xt&r)===r&&(fn===4||fn===3&&(xt&62914560)===xt&&300>en()-Lu?(Ot&2)===0&&Fs(e,0):Cf|=r,Vs===xt&&(Vs=0)),Sr(e)}function Tv(e,n){n===0&&(n=Qt()),e=Ql(e,n),e!==null&&(ht(e,n),Sr(e))}function _1(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),Tv(e,r)}function L1(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 z1(e,n){return _t(e,n)}var Iu=null,Gs=null,zf=!1,Vu=!1,Uf=!1,El=0;function Sr(e){e!==Gs&&e.next===null&&(Gs===null?Iu=Gs=e:Gs=Gs.next=e),Vu=!0,zf||(zf=!0,B1())}function Ki(e,n){if(!Uf&&Vu){Uf=!0;do for(var r=!1,i=Iu;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var h=0;else{var b=i.suspendedLanes,N=i.pingedLanes;h=(1<<31-Xt(42|e)+1)-1,h&=d&~(b&~N),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,kv(i,h))}else h=xt,h=Bt(i,i===Jt?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(h&3)===0||Ct(i,h)||(r=!0,kv(i,h));i=i.next}while(r);Uf=!1}}function U1(){Cv()}function Cv(){Vu=zf=!1;var e=0;El!==0&&X1()&&(e=El);for(var n=en(),r=null,i=Iu;i!==null;){var d=i.next,h=Dv(i,n);h===0?(i.next=null,r===null?Iu=d:r.next=d,d===null&&(Gs=r)):(r=i,(e!==0||(h&3)!==0)&&(Vu=!0)),i=d}Ln!==0&&Ln!==5||Ki(e),El!==0&&(El=0)}function Dv(e,n){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var b=31-Xt(h),N=1<<b,k=d[b];k===-1?((N&r)===0||(N&i)!==0)&&(d[b]=nn(N,n)):k<=n&&(e.expiredLanes|=N),h&=~N}if(n=Jt,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&&Gt(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&&Gt(i),$(r)){case 2:case 8:r=Wn;break;case 32:r=qn;break;case 268435456:r=Ce;break;default:r=qn}return i=Av.bind(null,e),r=_t(r,i),e.callbackPriority=n,e.callbackNode=r,n}return i!==null&&i!==null&&Gt(i),e.callbackPriority=2,e.callbackNode=null,2}function Av(e,n){if(Ln!==0&&Ln!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(qu()&&e.callbackNode!==r)return null;var i=xt;return i=Bt(e,e===Jt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(dv(e,i,n),Dv(e,en()),e.callbackNode!=null&&e.callbackNode===r?Av.bind(null,e):null)}function kv(e,n){if(qu())return null;dv(e,n,!0)}function B1(){K1(function(){(Ot&6)!==0?_t(da,U1):Cv()})}function Bf(){if(El===0){var e=Os;e===0&&(e=Me,Me<<=1,(Me&261888)===0&&(Me=256)),El=e}return El}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 H1(e,n,r,i,d){if(n==="submit"&&r&&r.stateNode===d){var h=Ov((d[Ae]||null).action),b=i.submitter;b&&(n=(n=b[Ae]||null)?Ov(n.formAction):b.getAttribute("formAction"),n!==null&&(h=n,b=null));var N=new Br("action","action",null,i,d);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(El!==0){var k=b?Mv(d,b):new FormData(d);af(r,{pending:!0,data:k,method:d.method,action:h},null,k)}}else typeof h=="function"&&(N.preventDefault(),k=b?Mv(d,b):new FormData(d),af(r,{pending:!0,data:k,method:d.method,action:h},h,k))},currentTarget:d}]})}}for(var Hf=0;Hf<bd.length;Hf++){var $f=bd[Hf],$1=$f.toLowerCase(),q1=$f[0].toUpperCase()+$f.slice(1);lr($1,"on"+q1)}lr(cp,"onAnimationEnd"),lr(dp,"onAnimationIteration"),lr(fp,"onAnimationStart"),lr("dblclick","onDoubleClick"),lr("focusin","onFocus"),lr("focusout","onBlur"),lr(a1,"onTransitionRun"),lr(r1,"onTransitionStart"),lr(l1,"onTransitionCancel"),lr(hp,"onTransitionEnd"),On("onMouseEnter",["mouseout","mouseover"]),On("onMouseLeave",["mouseout","mouseover"]),On("onPointerEnter",["pointerout","pointerover"]),On("onPointerLeave",["pointerout","pointerover"]),wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wn("onBeforeInput",["compositionend","keypress","textInput","paste"]),wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zi="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(" "),I1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zi));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 N=i[b],k=N.instance,F=N.currentTarget;if(N=N.listener,k!==h&&d.isPropagationStopped())break e;h=N,d.currentTarget=F;try{h(d)}catch(J){ru(J)}d.currentTarget=null,h=k}else for(b=0;b<i.length;b++){if(N=i[b],k=N.instance,F=N.currentTarget,N=N.listener,k!==h&&d.isPropagationStopped())break e;h=N,d.currentTarget=F;try{h(d)}catch(J){ru(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 qf(e,n,r){var i=0;n&&(i|=4),Lv(r,e,i,n)}var Yu="_reactListening"+Math.random().toString(36).slice(2);function If(e){if(!e[Yu]){e[Yu]=!0,Kt.forEach(function(r){r!=="selectionchange"&&(I1.has(r)||qf(r,!1,e),qf(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Yu]||(n[Yu]=!0,qf("selectionchange",!1,n))}}function Lv(e,n,r,i){switch(cy(n)){case 2:var d=gS;break;case 8:d=vS;break;default:d=ah}r=d.bind(null,n,r,e),d=void 0,!Si||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 Vf(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 N=i.stateNode.containerInfo;if(N===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(;N!==null;){if(b=$t(N),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){i=h=b;continue e}N=N.parentNode}}i=i.return}bi(function(){var F=h,J=Mr(r),ie=[];e:{var G=mp.get(e);if(G!==void 0){var Q=Br,Oe=e;switch(e){case"keypress":if(ws(r)===0)break e;case"keydown":case"keyup":Q=Nn;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=eu;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=vr;break;case cp:case dp:case fp:Q=ce;break;case hp:Q=tu;break;case"scroll":case"scrollend":Q=ud;break;case"wheel":Q=dd;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=Y0}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(Ji(_,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=eu,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=V1,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 At=Wm;else if(Zm(G))if(ep)At=e1;else{At=J0;var Le=Z0}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?F&&Il(F.elementType)&&(At=Wm):At=W0;if(At&&(At=At(e,F))){Jm(ie,At,r,J);break e}Le&&Le(e,G,F),e==="focusout"&&F&&G.type==="number"&&F.memoizedProps.value!=null&&Dt(G,"number",G.value)}switch(Le=F?ct(F):window,e){case"focusin":(Zm(Le)||Le.contentEditable==="true")&&(Ns=Le,vd=F,Ti=null);break;case"focusout":Ti=vd=Ns=null;break;case"mousedown":yd=!0;break;case"contextmenu":case"mouseup":case"dragend":yd=!1,op(ie,r,J);break;case"selectionchange":if(n1)break;case"keydown":case"keyup":op(ie,r,J)}var ot;if(hd)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 Es?Qm(e,r)&&(bt="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(bt="onCompositionStart");bt&&(Pm&&r.locale!=="ko"&&(Es||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Es&&(ot=Jo()):($a=J,wi="value"in $a?$a.value:$a.textContent,Es=!0)),Le=Fu(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=P0?G0(e,r):X0(e,r))&&(bt=Fu(F,"onBeforeInput"),0<bt.length&&(Le=new rt("onBeforeInput","beforeinput",null,r,J),ie.push({event:Le,listeners:bt}),Le.data=ot)),H1(ie,e,F,r,J)}_v(ie,n)})}function Ji(e,n,r){return{instance:e,listener:n,currentTarget:r}}function Fu(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(Ji(e,d,h)),d=Ha(e,n),d!=null&&i.push(Ji(e,d,h))),e.tag===3)return i;e=e.return}return[]}function V1(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 N=r,k=N.alternate,F=N.stateNode;if(N=N.tag,k!==null&&k===i)break;N!==5&&N!==26&&N!==27||F===null||(k=F,d?(F=Ha(r,h),F!=null&&b.unshift(Ji(r,F,k))):d||(F=Ha(r,h),F!=null&&b.push(Ji(r,F,k)))),r=r.return}b.length!==0&&e.push({event:n,listeners:b})}var Y1=/\r\n?/g,F1=/\u0000|\uFFFD/g;function Uv(e){return(typeof e=="string"?e:""+e).replace(Y1,`
49
+ `).replace(F1,"")}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===""||sl(e,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&sl(e,""+i);break;case"className":hr(e,"class",i);break;case"tabIndex":hr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":hr(e,r,i);break;case"style":va(e,i,h);break;case"data":if(n!=="object"){hr(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":Xe(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Xe(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Xe(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Xe(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Xe(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Xe(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Xe(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Xe(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Xe(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=bs.get(r)||r,ea(e,r,i))}}function Yf(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"?sl(e,i):(typeof i=="number"||typeof i=="bigint")&&sl(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[Ae]||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 N=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":N=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(s(137,n));break;default:Yt(e,n,i,J,r,null)}}yi(e,h,N,k,F,b,d,!1);return;case"select":pt("invalid",e),i=b=h=null;for(d in r)if(r.hasOwnProperty(d)&&(N=r[d],N!=null))switch(d){case"value":h=N;break;case"defaultValue":b=N;break;case"multiple":i=N;default:Yt(e,n,d,N,r,null)}n=h,r=b,e.multiple=!!i,n!=null?mr(e,!!i,n,!1):r!=null&&mr(e,!!i,r,!0);return;case"textarea":pt("invalid",e),h=d=i=null;for(b in r)if(r.hasOwnProperty(b)&&(N=r[b],N!=null))switch(b){case"value":i=N;break;case"defaultValue":d=N;break;case"children":h=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(s(91));break;default:Yt(e,n,b,N,r,null)}ar(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<Zi.length;i++)pt(Zi[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(Il(n)){for(J in r)r.hasOwnProperty(J)&&(i=r[J],i!==void 0&&Yf(e,n,J,i,r,void 0));return}}for(N in r)r.hasOwnProperty(N)&&(i=r[N],i!=null&&Yt(e,n,N,i,r,null))}function P1(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,N=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":N=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)}}ql(e,b,N,k,F,J,h,d);return;case"select":Q=b=N=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":N=h;break;case"multiple":b=h;default:h!==k&&Yt(e,n,d,h,i,k)}n=N,r=b,i=Q,G!=null?mr(e,!!r,G,!1):!!i!=!!r&&(n!=null?mr(e,!!r,n,!0):mr(e,!!r,r?[]:"",!1));return;case"textarea":Q=G=null;for(N in r)if(d=r[N],r.hasOwnProperty(N)&&d!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Yt(e,n,N,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)}Zo(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(Il(n)){for(var Ft in r)G=r[Ft],r.hasOwnProperty(Ft)&&G!==void 0&&!i.hasOwnProperty(Ft)&&Yf(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||Yf(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 G1(){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,N=d.duration;if(h&&N&&Hv(b)){for(b=0,N=d.responseEnd,i+=1;i<r.length;i++){var k=r[i],F=k.startTime;if(F>N)break;var J=k.transferSize,ie=k.initiatorType;J&&Hv(ie)&&(k=k.responseEnd,b+=J*(k<N?1:(N-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 Ff=null,Pf=null;function Pu(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 Gf(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 Xf=null;function X1(){var e=window.event;return e&&e.type==="popstate"?e===Xf?!1:(Xf=e,!0):(Xf=null,!1)}var Iv=typeof setTimeout=="function"?setTimeout:void 0,Q1=typeof clearTimeout=="function"?clearTimeout:void 0,Vv=typeof Promise=="function"?Promise:void 0,K1=typeof queueMicrotask=="function"?queueMicrotask:typeof Vv<"u"?function(e){return Vv.resolve(null).then(e).catch(Z1)}:Iv;function Z1(e){setTimeout(function(){throw e})}function Nl(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),Zs(n);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")Wi(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Wi(r);for(var h=r.firstChild;h;){var b=h.nextSibling,N=h.nodeName;h[Ze]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=b}}else r==="body"&&Wi(e.ownerDocument.body);r=d}while(r);Zs(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 Qf(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":Qf(r),Ie(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function J1(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 W1(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 Kf(e){return e.data==="$?"||e.data==="$~"}function Zf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function eS(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 Jf=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=Pu(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 Wi(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ie(e)}var Xa=new Map,Kv=new Set;function Gu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var el=B.d;B.d={f:tS,r:nS,D:aS,C:rS,L:lS,m:sS,X:oS,S:iS,M:uS};function tS(){var e=el.f(),n=Bu();return e||n}function nS(e){var n=We(e);n!==null&&n.tag===5&&n.type==="form"?hg(n):el.r(e)}var Xs=typeof document>"u"?null:document;function Zv(e,n,r){var i=Xs;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 aS(e){el.D(e),Zv("dns-prefetch",e,null)}function rS(e,n){el.C(e,n),Zv("preconnect",e,n)}function lS(e,n,r){el.L(e,n,r);var i=Xs;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=Qs(e);break;case"script":h=Ks(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(eo(h))||n==="script"&&i.querySelector(to(h))||(n=i.createElement("link"),Zn(n,"link",e),dt(n),i.head.appendChild(n)))}}function sS(e,n){el.m(e,n);var r=Xs;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=Ks(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(to(h)))return}i=r.createElement("link"),Zn(i,"link",e),dt(i),r.head.appendChild(i)}}}function iS(e,n,r){el.S(e,n,r);var i=Xs;if(i&&e){var d=it(i).hoistableStyles,h=Qs(e);n=n||"default";var b=d.get(h);if(!b){var N={loading:0,preload:null};if(b=i.querySelector(eo(h)))N.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Xa.get(h))&&Wf(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(){N.loading|=1}),k.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Xu(b,n,i)}b={type:"stylesheet",instance:b,count:1,state:N},d.set(h,b)}}}function oS(e,n){el.X(e,n);var r=Xs;if(r&&e){var i=it(r).hoistableScripts,d=Ks(e),h=i.get(d);h||(h=r.querySelector(to(d)),h||(e=y({src:e,async:!0},n),(n=Xa.get(d))&&eh(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 uS(e,n){el.M(e,n);var r=Xs;if(r&&e){var i=it(r).hoistableScripts,d=Ks(e),h=i.get(d);h||(h=r.querySelector(to(d)),h||(e=y({src:e,async:!0,type:"module"},n),(n=Xa.get(d))&&eh(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)?Gu(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=Qs(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=Qs(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(eo(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||cS(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=Ks(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 Qs(e){return'href="'+Gn(e)+'"'}function eo(e){return'link[rel="stylesheet"]['+e+"]"}function Wv(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function cS(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 Ks(e){return'[src="'+Gn(e)+'"]'}function to(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),Xu(i,r.precedence,e),n.instance=i;case"stylesheet":d=Qs(r.href);var h=e.querySelector(eo(d));if(h)return n.state.loading|=4,n.instance=h,dt(h),h;i=Wv(r),(d=Xa.get(d))&&Wf(i,d),h=(e.ownerDocument||e).createElement("link"),dt(h);var b=h;return b._p=new Promise(function(N,k){b.onload=N,b.onerror=k}),Zn(h,"link",i),n.state.loading|=4,Xu(h,r.precedence,e),n.instance=h;case"script":return h=Ks(r.src),(d=e.querySelector(to(h)))?(n.instance=d,dt(d),d):(i=r,(d=Xa.get(h))&&(i=y({},r),eh(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,Xu(i,r.precedence,e));return n.instance}function Xu(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 N=i[b];if(N.dataset.precedence===n)h=N;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 Wf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function eh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Qu=null;function ty(e,n,r){if(Qu===null){var i=new Map,d=Qu=new Map;d.set(r,i)}else d=Qu,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 N=i.get(b);N?N.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 dS(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 fS(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=Qs(i.href),h=n.querySelector(eo(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Ku.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))&&Wf(i,d),h=h.createElement("link"),dt(h);var b=h;b._p=new Promise(function(N,k){b.onload=N,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=Ku.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var th=0;function hS(e,n){return e.stylesheets&&e.count===0&&Ju(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&Ju(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&th===0&&(th=62500*G1());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ju(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>th?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function Ku(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ju(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zu=null;function Ju(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zu=new Map,n.forEach(mS,e),Zu=null,Ku.call(e))}function mS(e,n){if(!(n.state.loading&4)){var r=Zu.get(e);if(r)var i=r.get(null);else{r=new Map,Zu.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=Ku.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 no={$$typeof:q,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function pS(e,n,r,i,d,h,b,N,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,N,k,F,J,ie){return e=new pS(e,n,r,b,k,F,J,ie,N),n=1,h===!0&&(n|=24),h=Da(3,null,null,n),e.current=h,h.stateNode=e,n=Md(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:i,isDehydrated:r,cache:n},Ud(h),e}function ly(e){return e?(e=Ts,e):Ts}function sy(e,n,r,i,d,h){d=ly(d),i.context===null?i.context=d:i.pendingContext=d,i=hl(n),i.payload={element:r},h=h===void 0?null:h,h!==null&&(i.callback=h),r=ml(e,i,n),r!==null&&(Na(r,e,n),_i(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 nh(e,n){iy(e,n),(e=e.alternate)&&iy(e,n)}function oy(e){if(e.tag===13||e.tag===31){var n=Ql(e,67108864);n!==null&&Na(n,e,67108864),nh(e,67108864)}}function uy(e){if(e.tag===13||e.tag===31){var n=_a();n=M(n);var r=Ql(e,n);r!==null&&Na(r,e,n),nh(e,n)}}var Wu=!0;function gS(e,n,r,i){var d=U.T;U.T=null;var h=B.p;try{B.p=2,ah(e,n,r,i)}finally{B.p=h,U.T=d}}function vS(e,n,r,i){var d=U.T;U.T=null;var h=B.p;try{B.p=8,ah(e,n,r,i)}finally{B.p=h,U.T=d}}function ah(e,n,r,i){if(Wu){var d=rh(i);if(d===null)Vf(e,n,i,ec,r),dy(e,i);else if(xS(d,e,n,r,i))i.stopPropagation();else if(dy(e,i),n&4&&-1<yS.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 N=h;for(N.pendingLanes|=2,N.entangledLanes|=2;b;){var k=1<<31-Xt(b);N.entanglements[1]|=k,b&=~k}Sr(h),(Ot&6)===0&&(zu=en()+500,Ki(0))}}break;case 31:case 13:N=Ql(h,2),N!==null&&Na(N,h,2),Bu(),nh(h,2)}if(h=rh(i),h===null&&Vf(e,n,i,ec,r),h===d)break;d=h}d!==null&&i.stopPropagation()}else Vf(e,n,i,null,r)}}function rh(e){return e=Mr(e),lh(e)}var ec=null;function lh(e){if(ec=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 ec=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(ca()){case da:return 2;case Wn:return 8;case qn:case he:return 32;case Ce:return 268435456;default:return 32}default:return 32}}var sh=!1,Rl=null,jl=null,Tl=null,ao=new Map,ro=new Map,Cl=[],yS="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":Rl=null;break;case"dragenter":case"dragleave":jl=null;break;case"mouseover":case"mouseout":Tl=null;break;case"pointerover":case"pointerout":ao.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ro.delete(n.pointerId)}}function lo(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 xS(e,n,r,i,d){switch(n){case"focusin":return Rl=lo(Rl,e,n,r,i,d),!0;case"dragenter":return jl=lo(jl,e,n,r,i,d),!0;case"mouseover":return Tl=lo(Tl,e,n,r,i,d),!0;case"pointerover":var h=d.pointerId;return ao.set(h,lo(ao.get(h)||null,e,n,r,i,d)),!0;case"gotpointercapture":return h=d.pointerId,ro.set(h,lo(ro.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 tc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=rh(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){tc(e)&&r.delete(n)}function bS(){sh=!1,Rl!==null&&tc(Rl)&&(Rl=null),jl!==null&&tc(jl)&&(jl=null),Tl!==null&&tc(Tl)&&(Tl=null),ao.forEach(hy),ro.forEach(hy)}function nc(e,n){e.blockedOn===n&&(e.blockedOn=null,sh||(sh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,bS)))}var ac=null;function my(e){ac!==e&&(ac=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ac===e&&(ac=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(lh(i||r)===null)continue;break}var h=We(r);h!==null&&(e.splice(n,3),n-=3,af(h,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Zs(e){function n(k){return nc(k,e)}Rl!==null&&nc(Rl,e),jl!==null&&nc(jl,e),Tl!==null&&nc(Tl,e),ao.forEach(n),ro.forEach(n);for(var r=0;r<Cl.length;r++){var i=Cl[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Cl.length&&(r=Cl[0],r.blockedOn===null);)fy(r),r.blockedOn===null&&Cl.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[Ae]||null;if(typeof h=="function")b||my(r);else if(b){var N=null;if(h&&h.hasAttribute("formAction")){if(d=h,b=h[Ae]||null)N=b.formAction;else if(lh(d)!==null)continue}else N=b.action;typeof N=="function"?r[i+1]=N:(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 ih(e){this._internalRoot=e}rc.prototype.render=ih.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)},rc.prototype.unmount=ih.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),Bu(),n[Re]=null}};function rc(e){this._internalRoot=e}rc.prototype.unstable_scheduleHydration=function(e){if(e){var n=K();e={blockedOn:null,target:e,priority:n};for(var r=0;r<Cl.length&&n!==0&&n<Cl[r].priority;r++);Cl.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 SS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lc.isDisabled&&lc.supportsFiber)try{qe=lc.inject(SS),Z=lc}catch{}}return io.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,If(e),new ih(n)},io.hydrateRoot=function(e,n,r){if(!o(e))throw Error(s(299));var i=!1,d="",h=Eg,b=Ng,N=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&&(N=r.onRecoverableError),r.formState!==void 0&&(k=r.formState)),n=ry(e,1,!0,n,r??null,i,d,k,h,b,N,py),n.context=ly(null),r=n.current,i=_a(),i=M(i),d=hl(i),d.callback=null,ml(r,d,i),r=i,n.current.lanes=r,ht(n,r),Sr(n),e[Re]=n.current,If(e),new rc(n)},io.version="19.2.7",io}var jy;function LS(){if(jy)return ch.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(),ch.exports=_S(),ch.exports}var zS=LS();/**
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 Qx=t=>{throw TypeError(t)},Kx=(t,a,l)=>a.has(t)||Qx("Cannot "+l),Qa=(t,a,l)=>(Kx(t,a,"read from private field"),l?l.call(t):a.get(t)),yo=(t,a,l)=>a.has(t)?Qx("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,l),wr=(t,a,l,s)=>(Kx(t,a,"write to private field"),a.set(t,l),l),Bc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Wh=/^[\\/]{2}/;function Zx(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 US(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 Do("",{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:Cr(o)}return HS(a,l,null,t)}function tt(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function xn(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function BS(){return Math.random().toString(36).substring(2,10)}function Dy(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 Do(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||BS(),mask:o}}function Cr({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 HS(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:D.location,delta:L})}function E(R,L){m="PUSH";let I=Cy(R)?R:Do(D.location,R,L);g=x()+1;let q=Dy(I,g),X=D.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:D.location,delta:1})}function w(R,L){m="REPLACE";let I=Cy(R)?R:Do(D.location,R,L);g=x();let q=Dy(I,g),X=D.createHref(I.mask||I);f.replaceState(q,"",X),u&&p&&p({action:m,location:D.location,delta:0})}function S(R){return Jx(o,R)}let D={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:E,replace:w,go(R){return f.go(R)}};return D}function Jx(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:Cr(a);return o=o.replace(/ $/,"%20"),!l&&Wh.test(o)&&(o=s+o),new URL(o,s)}var xo,Ay=class{constructor(t){if(yo(this,xo,new Map),t)for(let[a,l]of t)this.set(a,l)}get(t){if(Qa(this,xo).has(t))return Qa(this,xo).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Qa(this,xo).set(t,a)}};xo=new WeakMap;var $S=new Set(["lazy","caseSensitive","path","id","index","children"]);function qS(t){return $S.has(t)}var IS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function VS(t){return IS.has(t)}function YS(t){return t.index===!0}function Ao(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`),YS(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=Ao(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 Wx(t,a,l="/"){return ur(t,a,l,!1)}function ur(t,a,l,s,o){let u=typeof a=="string"?Dr(a):a,f=er(u.pathname||"/",l);if(f==null)return null;let m=o??yc(t),p=null,g=nw(f);for(let x=0;p==null&&x<m.length;++x)p=tw(m[x],g,s);return p}function FS(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 yc(t){let a=eb(t);return PS(a),a}function eb(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=Wa([s,x.relativePath]),E=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}".`),eb(f.children,a,E,y,p)),!(f.path==null&&!f.index)&&a.push({path:y,score:WS(y,f.index),routesMeta:E.map((w,S)=>{let[D,R]=ab(w.relativePath,w.caseSensitive,S===E.length-1);return{...w,matcher:D,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 tb(f.path))u(f,m,!0,g)}),a}function tb(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=tb(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 PS(t){t.sort((a,l)=>a.score!==l.score?l.score-a.score:ew(a.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}var GS=/^:[\w-]+$/,XS=3,QS=2,KS=1,ZS=10,JS=-2,Oy=t=>t==="*";function WS(t,a){let l=t.split("/"),s=l.length;return l.some(Oy)&&(s+=JS),a&&(s+=QS),l.filter(o=>!Oy(o)).reduce((o,u)=>o+(GS.test(u)?XS:u===""?KS:ZS),s)}function ew(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 tw(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},E=p.matcher&&p.compiledParams?nb(y,x,p.matcher,p.compiledParams):jc(y,x),w=p.route;if(!E&&g&&l&&!s[s.length-1].route.index&&(E=jc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!E)return null;Object.assign(o,E.params),f.push({params:o,pathname:Wa([u,E.pathname]),pathnameBase:lw(Wa([u,E.pathnameBase])),route:w}),E.pathnameBase!=="/"&&(u=Wa([u,E.pathnameBase]))}return f}function jc(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[l,s]=ab(t.path,t.caseSensitive,t.end);return nb(t,a,l,s)}function nb(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},E)=>{if(x==="*"){let S=m[E]||"";f=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const w=m[E];return y&&!w?g[x]=void 0:g[x]=(w||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:t}}function ab(t,a=!1,l=!0){xn(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 nw(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return xn(!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 er(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 aw({basename:t,pathname:a}){return a==="/"?t:Wa([t,a])}var em=t=>Bc.test(t);function rw(t,a="/"){let{pathname:l,search:s="",hash:o=""}=typeof t=="string"?Dr(t):t,u;return l?(l=nm(l),l.startsWith("/")?u=My(l.substring(1),"/"):u=My(l,a)):u=a,{pathname:u,search:sw(s),hash:iw(o)}}function My(t,a){let l=Tc(a).split("/");return t.split("/").forEach(o=>{o===".."?l.length>1&&l.pop():o!=="."&&l.push(o)}),l.length>1?l.join("/"):"/"}function mh(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 rb(t){return t.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function tm(t){let a=rb(t);return a.map((l,s)=>s===a.length-1?l.pathname:l.pathnameBase)}function Hc(t,a,l,s=!1){let o;typeof t=="string"?o=Dr(t):(o={...t},tt(!o.pathname||!o.pathname.includes("?"),mh("?","pathname","search",o)),tt(!o.pathname||!o.pathname.includes("#"),mh("#","pathname","hash",o)),tt(!o.search||!o.search.includes("#"),mh("#","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 E=f.split("/");for(;E[0]==="..";)E.shift(),y-=1;o.pathname=E.join("/")}m=y>=0?a[y]:"/"}let p=rw(o,m),g=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var nm=t=>t.replace(/[\\/]{2,}/g,"/"),Wa=t=>nm(t.join("/")),Tc=t=>t.replace(/\/+$/,""),lw=t=>Tc(t).replace(/^\/*/,"/"),sw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,iw=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})},ow=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],zo=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 ci(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Uo(t){let a=t.map(l=>l.route.path).filter(Boolean);return Wa(a)||"/"}var lb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sb(t,a){let l=t;if(typeof l!="string"||!Bc.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let s=l,o=!1;if(lb)try{let u=new URL(window.location.href),f=Wh.test(l)?new URL(Zx(l,u.protocol)):new URL(l),m=er(f.pathname,a);f.origin===u.origin&&m!=null?l=m+f.search+f.hash:o=!0}catch{xn(!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 Ll=Symbol("Uninstrumented");function uw(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=si(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=si(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[Ll]??u,m=si(l[o],f,(...p)=>_y(p[0]));m&&(o==="loader"&&f.hydrate===!0&&(m.hydrate=!0),m[Ll]=f,s[o]=m)}}),a.middleware&&a.middleware.length>0&&l.middleware.length>0&&(s.middleware=a.middleware.map(o=>{let u=o[Ll]??o,f=si(l.middleware,u,(...m)=>_y(m[0]));return f?(f[Ll]=u,f):o})),s}function cw(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[Ll]??t.navigate,o=si(l.navigate,s,(...u)=>{let[f,m]=u;return{to:typeof f=="number"||typeof f=="string"?f:f?Cr(f):".",...Ly(t,m??{})}});o&&(o[Ll]=s,t.navigate=o)}if(l.fetch.length>0){let s=t.fetch[Ll]??t.fetch,o=si(l.fetch,s,(...u)=>{let[f,,m,p]=u;return{href:m??".",fetcherKey:f,...Ly(t,p??{})}});o&&(o[Ll]=s,t.fetch=o)}return t}function si(t,a,l){return t.length===0?null:async(...s)=>{let o=await ib(t,l(...s),()=>a(...s),t.length-1);if(o.type==="error")throw o.value;return o.value}}async function ib(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=ib(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:dw(a),params:{...s},pattern:o,context:fw(l)}}function Ly(t,a){return{currentUrl:Cr(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 dw(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function fw(t){if(mw(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var hw=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function mw(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")===hw}var ob=["POST","PUT","PATCH","DELETE"],pw=new Set(ob),gw=["GET",...ob],vw=new Set(gw),ub=new Set([301,302,303,307,308]),yw=new Set([307,308]),ph={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},cb={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},oo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},xw=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),db="remix-router-transitions",fb=Symbol("ResetLoaderData"),os,ai,kl,ri,bw=class{constructor(t){yo(this,os),yo(this,ai),yo(this,kl),yo(this,ri),wr(this,os,t),wr(this,ai,yc(t))}get stableRoutes(){return Qa(this,os)}get activeRoutes(){return Qa(this,kl)??Qa(this,os)}get branches(){return Qa(this,ri)??Qa(this,ai)}get hasHMRRoutes(){return Qa(this,kl)!=null}setRoutes(t){wr(this,os,t),wr(this,ai,yc(t))}setHmrRoutes(t){wr(this,kl,t),wr(this,ri,yc(t))}commitHmrRoutes(){Qa(this,kl)&&(wr(this,os,Qa(this,kl)),wr(this,ai,Qa(this,ri)),wr(this,kl,void 0),wr(this,ri,void 0))}};os=new WeakMap;ai=new WeakMap;kl=new WeakMap;ri=new WeakMap;function Sw(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||xw,u=o;if(t.instrumentations){let A=t.instrumentations;u=M=>({...o(M),...uw(A.map($=>$.route).filter(Boolean),M)})}let f={},m=new bw(Ao(t.routes,u,void 0,f)),p=t.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=t.dataStrategy||jw,x={...t.future},y=null,E=new Set,w=null,S=null,D=null,R=null,L=t.hydrationData!=null,I=ur(m.activeRoutes,t.history.location,p,!1,m.branches),q=!1,X=null,W,ne;if(I==null&&!t.patchRoutesOnNavigation){let A=Ka(404,{pathname:t.history.location.pathname}),{matches:M,route:$}=sc(m.activeRoutes);W=!0,ne=!W,I=M,X={[$.id]:A}}else if(I&&!t.hydrationData&&Ht(I,m.activeRoutes,t.history.location.pathname).active&&(I=null),I)if(I.some(A=>A.route.lazy))W=!1,ne=!W;else if(!I.some(A=>am(A.route)))W=!0,ne=!W;else{let A=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)}ne=!1,W=!0,$.forEach(K=>{let se=hb(K.route,A,M);ne=ne||se.renderFallback,W=W&&!se.shouldLoad})}else{W=!1,ne=!W,I=[];let A=Ht(null,m.activeRoutes,t.history.location.pathname);A.active&&A.matches&&(q=!0,I=A.matches)}let z,T={historyAction:t.history.action,location:t.history.location,matches:I,initialized:W,renderFallback:ne,navigation:ph,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,ae=!1,re=new Map,ge=null,U=!1,B=!1,ue=new Set,de=new Map,we=0,C=-1,V=new Map,te=new Set,me=new Map,Ne=new Map,je=new Set,ze=new Map,ut,Pe=null;function nt(){if(y=t.history.listen(({action:A,location:M,delta:$})=>{if(ut){ut(),ut=void 0;return}xn(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:A});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,oo),ft({blockers:Te})}}),fe==null||fe.resolve(),fe=null;return}return Ut(A,M)}),l){Fw(a,re);let A=()=>Pw(a,re);a.addEventListener("pagehide",A),ge=()=>a.removeEventListener("pagehide",A)}return T.initialized||Ut("POP",T.location,{initialHydration:!0}),z}function bn(){y&&y(),ge&&ge(),E.clear(),ye&&ye.abort(),T.fetchers.forEach((A,M)=>qe(T.fetchers,M)),T.blockers.forEach((A,M)=>Me(M))}function Pt(A){if(E.add(A),w){let{newErrors:M}=w;w=null,A(T,{deletedFetchers:[],newErrors:M,viewTransitionOpts:void 0,flushSync:!1})}return()=>E.delete(A)}function ft(A,M={}){A.matches&&(A.matches=A.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,...A};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)}),E.size===0&&(w={newErrors:A.errors??null}),[...E].forEach(se=>se(T,{deletedFetchers:$,newErrors:A.errors??null,viewTransitionOpts:M.viewTransitionOpts,flushSync:M.flushSync===!0})),$.forEach(se=>qe(T.fetchers,se)),K.forEach(se=>T.fetchers.delete(se))}function oe(A,M,{flushSync:$}={}){var Ue,Ge;let K=T.actionData!=null&&T.navigation.formMethod!=null&&oa(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Ue=A.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,oo)));let Ae=U?!1:Qt(A,M.matches||T.matches),Re=be===!0||T.navigation.formMethod!=null&&oa(T.navigation.formMethod)&&((Ge=A.state)==null?void 0:Ge._isRedirect)!==!0;m.commitHmrRoutes(),U||ee==="POP"||(ee==="PUSH"?t.history.push(A,A.state):ee==="REPLACE"&&t.history.replace(A,A.state));let _e;if(ee==="POP"){let ke=re.get(T.location.pathname);ke&&ke.has(A.pathname)?_e={currentLocation:T.location,nextLocation:A}:re.has(A.pathname)&&(_e={currentLocation:A,nextLocation:T.location})}else if(ae){let ke=re.get(T.location.pathname);ke?ke.add(A.pathname):(ke=new Set([A.pathname]),re.set(T.location.pathname,ke)),_e={currentLocation:T.location,nextLocation:A}}ft({...M,actionData:se,loaderData:Te,historyAction:ee,location:A,initialized:!0,renderFallback:!1,navigation:ph,revalidation:"idle",restoreScrollPosition:Ae,preventScrollReset:Re,blockers:ve},{viewTransitionOpts:_e,flushSync:$===!0}),ee="POP",be=!1,ae=!1,U=!1,B=!1,fe==null||fe.resolve(),fe=null,Pe==null||Pe.resolve(),Pe=null}async function $e(A,M){if(fe==null||fe.resolve(),fe=null,typeof A=="number"){fe||(fe=Qy());let Ie=fe.promise;return t.history.go(A),Ie}let $=Hh(T.location,T.matches,p,A,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 Ae=T.location,Re=Do(Ae,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 Ge=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,ke=(M&&M.flushSync)===!0,Ze=yt({currentLocation:Ae,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(A,M)},reset(){let Ie=new Map(T.blockers);Ie.set(Ze,oo),ft({blockers:Ie})}});return}await Ut(Ue,Re,{submission:se,pendingError:Te,preventScrollReset:Ge,replace:M&&M.replace,enableViewTransition:M&&M.viewTransition,flushSync:ke,callSiteDefaultShouldRevalidate:M&&M.defaultShouldRevalidate})}function at(){Pe||(Pe=Qy()),qn(),ft({revalidation:"loading"});let A=Pe.promise;return T.navigation.state==="submitting"?A:T.navigation.state==="idle"?(Ut(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),A):(Ut(ee||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ae===!0}),A)}async function Ut(A,M,$){ye&&ye.abort(),ye=null,ee=A,U=($&&$.startUninterruptedRevalidation)===!0,nn(T.location,T.matches),be=($&&$.preventScrollReset)===!0,ae=($&&$.enableViewTransition)===!0;let K=m.activeRoutes,se=$!=null&&$.initialHydration&&T.matches&&T.matches.length>0&&!q?T.matches:ur(K,M,p,!1,m.branches),Te=($&&$.flushSync)===!0;if(se&&T.initialized&&!B&&Lw(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 Ae=$&&$.overrideNavigation?{...$.overrideNavigation,matches:se,historyAction:A}:void 0;ye=new AbortController;let Re=li(t.history,M,ye.signal,$&&$.submission),_e=t.getContext?await t.getContext():new Ay,Ue;if($&&$.pendingError)Ue=[_l(se).route.id,{type:"error",error:$.pendingError}];else if($&&$.submission&&oa($.submission.formMethod)){let We=await pn(Re,M,$.submission,se,A,_e,ve.active,$&&$.initialHydration===!0,{replace:$.replace,flushSync:Te});if(We.shortCircuited)return;if(We.pendingActionResult){let[ct,it]=We.pendingActionResult;if(La(it)&&ci(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,Ae=gh(M,se,A,$.submission),Te=!1,ve.active=!1,Re=li(t.history,Re.url,Re.signal)}let{shortCircuited:Ge,matches:ke,loaderData:Ze,errors:Ie,workingFetchers:$t}=await jt(Re,M,se,A,_e,ve.active,Ae,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,Te,Ue,$&&$.callSiteDefaultShouldRevalidate);Ge||(ye=null,oe(M,{matches:ke||se,...Py(Ue),loaderData:Ze,errors:Ie,...$t?{fetchers:$t}:{}}))}async function pn(A,M,$,K,se,Te,ve,Ae,Re={}){qn();let _e=Vw(M,K,se,$);if(ft({navigation:_e},{flushSync:Re.flushSync===!0}),ve){let ke=await ht(K,M.pathname,A.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){if(ke.partialMatches.length===0){let{matches:Ie,route:$t}=sc(m.activeRoutes);return{matches:Ie,pendingActionResult:[$t.id,{type:"error",error:ke.error}]}}let Ze=_l(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,Ge=xc(K,M);if(!Ge.route.action&&!Ge.route.lazy)Ue={type:"error",error:Ka(405,{method:A.method,pathname:M.pathname,routeId:Ge.route.id})};else{let ke=oi(u,f,A,M,K,Ge,Ae?[]:s,Te),Ze=await da(A,M,ke,Te,null);if(Ue=Ze[Ge.route.id],!Ue){for(let Ie of K)if(Ze[Ie.route.id]){Ue=Ze[Ie.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(us(Ue)){let ke;return Re&&Re.replace!=null?ke=Re.replace:ke=Iy(Ue.response.headers.get("Location"),new URL(A.url),p,t.history)===T.location.pathname+T.location.search,await ca(A,Ue,!0,{submission:$,replace:ke}),{shortCircuited:!0}}if(La(Ue)){let ke=_l(K,Ge.route.id);return(Re&&Re.replace)!==!0&&(ee="PUSH"),{matches:K,pendingActionResult:[ke.route.id,Ue,Ge.route.id]}}return{matches:K,pendingActionResult:[Ge.route.id,Ue]}}async function jt(A,M,$,K,se,Te,ve,Ae,Re,_e,Ue,Ge,ke,Ze){let Ie=ve||gh(M,$,K,Ae),$t=Ae||Re||Xy(Ie),We=!U&&!Ue;if(Te){if(We){let Nt=_t(ke);ft({navigation:Ie,...Nt!==void 0?{actionData:Nt}:{}},{flushSync:Ge})}let Xe=await ht($,M.pathname,A.signal);if(Xe.type==="aborted")return{shortCircuited:!0};if(Xe.type==="error"){if(Xe.partialMatches.length===0){let{matches:Zt,route:ta}=sc(m.activeRoutes);return{matches:Zt,loaderData:{},errors:{[ta.id]:Xe.error}}}let Nt=_l(Xe.partialMatches).route.id;return{matches:Xe.partialMatches,loaderData:{},errors:{[Nt]:Xe.error}}}else if(Xe.matches)$=Xe.matches;else{let{error:Nt,notFoundMatches:Zt,route:ta}=St(M.pathname);return{matches:Zt,loaderData:{},errors:{[ta.id]:Nt}}}}let ct=m.activeRoutes,{dsMatches:it,revalidatingFetchers:dt}=Uy(A,se,u,f,t.history,T,$,$t,M,Ue?[]:s,Ue===!0,B,ue,je,me,te,ct,p,t.patchRoutesOnNavigation!=null,m.branches,ke,Ze);if(C=++we,!t.dataStrategy&&!it.some(Xe=>Xe.shouldLoad)&&!it.some(Xe=>Xe.route.middleware&&Xe.route.middleware.length>0)&&dt.length===0){let Xe=new Map(T.fetchers),Nt=Yn(Xe);return oe(M,{matches:$,loaderData:{},errors:ke&&La(ke[1])?{[ke[0]]:ke[1].error}:null,...Py(ke),...Nt?{fetchers:Xe}:{}},{flushSync:Ge}),{shortCircuited:!0}}if(We){let Xe={};if(!Te){Xe.navigation=Ie;let Nt=_t(ke);Nt!==void 0&&(Xe.actionData=Nt)}dt.length>0&&(Xe.fetchers=Gt(dt)),ft(Xe,{flushSync:Ge})}dt.forEach(Xe=>{Tt(Xe.key),Xe.controller&&de.set(Xe.key,Xe.controller)});let Kt=()=>dt.forEach(Xe=>Tt(Xe.key));ye&&ye.signal.addEventListener("abort",Kt);let{loaderResults:Fn,fetcherResults:wn}=await Wn(it,dt,A,M,se);if(A.signal.aborted)return{shortCircuited:!0};ye&&ye.signal.removeEventListener("abort",Kt),dt.forEach(Xe=>de.delete(Xe.key));let On=ic(Fn);if(On)return await ca(A,On.result,!0,{replace:_e}),{shortCircuited:!0};if(On=ic(wn),On)return te.add(On.key),await ca(A,On.result,!0,{replace:_e}),{shortCircuited:!0};let Mn=new Map(T.fetchers),{loaderData:Pn,errors:ga}=Yy(T,$,Fn,ke,dt,wn,Mn);Ue&&T.errors&&(ga={...T.errors,...ga});let ll=Yn(Mn),ea=gn(C,Mn),hr=ll||ea||dt.length>0;return{matches:$,loaderData:Pn,errors:ga,...hr?{workingFetchers:Mn}:{}}}function _t(A){if(A&&!La(A[1]))return{[A[0]]:A[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Gt(A){let M=new Map(T.fetchers);return A.forEach($=>{let K=M.get($.key),se=uo(void 0,K?K.data:void 0);M.set($.key,se)}),M}async function Hn(A,M,$,K){Tt(A);let se=(K&&K.flushSync)===!0,Te=m.activeRoutes,ve=Hh(T.location,T.matches,p,$,M,K==null?void 0:K.relative),Ae=ur(Te,ve,p,!1,m.branches),Re=Ht(Ae,Te,ve);if(Re.active&&Re.matches&&(Ae=Re.matches),!Ae){Ce(A,M,Ka(404,{pathname:ve}),{flushSync:se});return}let{path:_e,submission:Ue,error:Ge}=zy(!0,ve,K);if(Ge){Ce(A,M,Ge,{flushSync:se});return}let ke=t.getContext?await t.getContext():new Ay,Ze=(K&&K.preventScrollReset)===!0;if(Ue&&oa(Ue.formMethod)){await $n(A,M,_e,Ae,ke,Re.active,se,Ze,Ue,K&&K.defaultShouldRevalidate);return}me.set(A,{routeId:M,path:_e}),await en(A,M,_e,Ae,ke,Re.active,se,Ze,Ue)}async function $n(A,M,$,K,se,Te,ve,Ae,Re,_e){qn(),me.delete(A);let Ue=T.fetchers.get(A);he(A,Yw(Re,Ue),{flushSync:ve});let Ge=new AbortController,ke=li(t.history,$,Ge.signal,Re);if(Te){let Rt=await ht(K,new URL(ke.url).pathname,ke.signal,A);if(Rt.type==="aborted")return;if(Rt.type==="error"){Ce(A,M,Rt.error,{flushSync:ve});return}else if(Rt.matches)K=Rt.matches;else{Ce(A,M,Ka(404,{pathname:$}),{flushSync:ve});return}}let Ze=xc(K,$);if(!Ze.route.action&&!Ze.route.lazy){let Rt=Ka(405,{method:Re.formMethod,pathname:$,routeId:M});Ce(A,M,Rt,{flushSync:ve});return}de.set(A,Ge);let Ie=we,$t=oi(u,f,ke,$,K,Ze,s,se),We=await da(ke,$,$t,se,A),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(A)===Ge&&de.delete(A);return}if(je.has(A)){if(us(ct)||La(ct)){he(A,Nr(void 0));return}}else{if(us(ct))if(de.delete(A),C>Ie){he(A,Nr(void 0));return}else return te.add(A),he(A,uo(Re)),ca(ke,ct,!1,{fetcherSubmission:Re,preventScrollReset:Ae});if(La(ct)){Ce(A,M,ct.error);return}}let it=T.navigation.location||T.location,dt=li(t.history,it,Ge.signal),Kt=m.activeRoutes,Fn=T.navigation.state!=="idle"?ur(Kt,T.navigation.location,p,!1,m.branches):T.matches;tt(Fn,"Didn't find any matches after fetcher action");let wn=++we;V.set(A,wn);let{dsMatches:On,revalidatingFetchers:Mn}=Uy(dt,se,u,f,t.history,T,Fn,Re,it,s,!1,B,ue,je,me,te,Kt,p,t.patchRoutesOnNavigation!=null,m.branches,[Ze.route.id,ct],_e),Pn=uo(Re,ct.data),ga=new Map(T.fetchers);ga.set(A,Pn),Mn.filter(Rt=>Rt.key!==A).forEach(Rt=>{let ja=Rt.key,Gn=ga.get(ja),ql=uo(void 0,Gn?Gn.data:void 0);ga.set(ja,ql),Tt(ja),Rt.controller&&de.set(ja,Rt.controller)}),ft({fetchers:ga});let ll=()=>Mn.forEach(Rt=>Tt(Rt.key));Ge.signal.addEventListener("abort",ll);let{loaderResults:ea,fetcherResults:hr}=await Wn(On,Mn,dt,it,se);if(Ge.signal.aborted)return;Ge.signal.removeEventListener("abort",ll),V.delete(A),de.delete(A),Mn.forEach(Rt=>de.delete(Rt.key));let Xe=T.fetchers.has(A),Nt=Rt=>{if(!Xe)return Rt;let ja=new Map(Rt.fetchers);return ja.set(A,Nr(ct.data)),{...Rt,fetchers:ja}},Zt=ic(ea);if(Zt)return T=Nt(T),ca(dt,Zt.result,!1,{preventScrollReset:Ae});if(Zt=ic(hr),Zt)return te.add(Zt.key),T=Nt(T),ca(dt,Zt.result,!1,{preventScrollReset:Ae});let ta=new Map(T.fetchers);Xe&&ta.set(A,Nr(ct.data));let{loaderData:_n,errors:Or}=Yy(T,Fn,ea,void 0,Mn,hr,ta);gn(wn,ta),T.navigation.state==="loading"&&wn>C?(tt(ee,"Expected pending action"),ye&&ye.abort(),oe(T.navigation.location,{matches:Fn,loaderData:_n,errors:Or,fetchers:ta})):(ft({errors:Or,loaderData:Fy(T.loaderData,_n,Fn,Or),fetchers:ta}),B=!1)}async function en(A,M,$,K,se,Te,ve,Ae,Re){let _e=T.fetchers.get(A);he(A,uo(Re,_e?_e.data:void 0),{flushSync:ve});let Ue=new AbortController,Ge=li(t.history,$,Ue.signal);if(Te){let ct=await ht(K,new URL(Ge.url).pathname,Ge.signal,A);if(ct.type==="aborted")return;if(ct.type==="error"){Ce(A,M,ct.error,{flushSync:ve});return}else if(ct.matches)K=ct.matches;else{Ce(A,M,Ka(404,{pathname:$}),{flushSync:ve});return}}let ke=xc(K,$);de.set(A,Ue);let Ze=we,Ie=oi(u,f,Ge,$,K,ke,s,se),$t=await da(Ge,$,Ie,se,A),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(A)===Ue&&de.delete(A),!Ge.signal.aborted){if(je.has(A)){he(A,Nr(void 0));return}if(us(We))if(C>Ze){he(A,Nr(void 0));return}else{te.add(A),await ca(Ge,We,!1,{preventScrollReset:Ae});return}if(La(We)){Ce(A,M,We.error);return}he(A,Nr(We.data))}}async function ca(A,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 Ae=M.response.headers.get("Location");tt(Ae,"Expected a Location header on the redirect Response"),Ae=Iy(Ae,new URL(A.url),p,t.history);let Re=Do(T.location,Ae,{_isRedirect:!0});if(l){let Ie=!1;if(M.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(em(Ae)){const $t=Jx(a,Ae,!0);Ie=$t.origin!==a.location.origin||er($t.pathname,p)==null}if(Ie){ve?a.location.replace(Ae):a.location.assign(Ae);return}}ye=null;let _e=ve===!0||M.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Ge,formEncType:ke}=T.navigation;!K&&!se&&Ue&&Ge&&ke&&(K=Xy(T.navigation));let Ze=K||se;if(yw.has(M.response.status)&&Ze&&oa(Ze.formMethod))await Ut(_e,Re,{submission:{...Ze,formAction:Ae},preventScrollReset:Te||be,enableViewTransition:$?ae:void 0});else{let Ie=gh(Re,[],_e,K);await Ut(_e,Re,{overrideNavigation:Ie,fetcherSubmission:se,preventScrollReset:Te||be,enableViewTransition:$?ae:void 0})}}async function da(A,M,$,K,se){var Ae;let Te,ve={};try{Te=await Cw(g,A,M,$,se,K,!1)}catch(Re){return $.filter(_e=>_e.shouldLoad).forEach(_e=>{ve[_e.route.id]={type:"error",error:Re}}),ve}if(A.signal.aborted)return ve;if(!oa(A.method))for(let Re of $){if(((Ae=Te[Re.route.id])==null?void 0:Ae.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(Hw(_e)){let Ue=_e.result;ve[Re]={type:"redirect",response:Ow(Ue,A,Re,$,p)}}else ve[Re]=await kw(_e);return ve}async function Wn(A,M,$,K,se){let Te=da($,K,A,se,null),ve=Promise.all(M.map(async _e=>{if(_e.matches&&_e.match&&_e.request&&_e.controller){let Ge=(await da(_e.request,_e.path,_e.matches,se,_e.key))[_e.match.route.id];return{[_e.key]:Ge}}else return Promise.resolve({[_e.key]:{type:"error",error:Ka(404,{pathname:_e.path})}})})),Ae=await Te,Re=(await ve).reduce((_e,Ue)=>Object.assign(_e,Ue),{});return{loaderResults:Ae,fetcherResults:Re}}function qn(){B=!0,me.forEach((A,M)=>{de.has(M)&&ue.add(M),Tt(M)})}function he(A,M,$={}){let K=new Map(T.fetchers);K.set(A,M),ft({fetchers:K},{flushSync:($&&$.flushSync)===!0})}function Ce(A,M,$,K={}){let se=_l(T.matches,M),Te=new Map(T.fetchers);qe(Te,A),ft({errors:{[se.route.id]:$},fetchers:Te},{flushSync:(K&&K.flushSync)===!0})}function De(A){return Ne.set(A,(Ne.get(A)||0)+1),je.has(A)&&je.delete(A),T.fetchers.get(A)||cb}function Fe(A,M){Tt(A,M==null?void 0:M.reason),he(A,Nr(null))}function qe(A,M){let $=T.fetchers.get(M);de.has(M)&&!($&&$.state==="loading"&&V.has(M))&&Tt(M),me.delete(M),V.delete(M),te.delete(M),je.delete(M),ue.delete(M),A.delete(M)}function Z(A){let M=(Ne.get(A)||0)-1;M<=0?(Ne.delete(A),je.add(A)):Ne.set(A,M),ft({fetchers:new Map(T.fetchers)})}function Tt(A,M){let $=de.get(A);$&&($.abort(M),de.delete(A))}function Xt(A,M){for(let $ of A){let K=M.get($);tt(K,`Expected fetcher: ${$}`);let se=Nr(K.data);M.set($,se)}}function Yn(A){let M=[],$=!1;for(let K of te){let se=A.get(K);tt(se,`Expected fetcher: ${K}`),se.state==="loading"&&(te.delete(K),M.push(K),$=!0)}return Xt(M,A),$}function gn(A,M){let $=[];for(let[K,se]of V)if(se<A){let Te=M.get(K);tt(Te,`Expected fetcher: ${K}`),Te.state==="loading"&&(Tt(K),V.delete(K),$.push(K))}return Xt($,M),$.length>0}function Ba(A,M){let $=T.blockers.get(A)||oo;return ze.get(A)!==M&&ze.set(A,M),$}function Me(A){T.blockers.delete(A),ze.delete(A)}function vt(A,M){let $=T.blockers.get(A)||oo;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(A,M),ft({blockers:K})}function yt({currentLocation:A,nextLocation:M,historyAction:$}){if(ze.size===0)return;ze.size>1&&xn(!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:A,nextLocation:M,historyAction:$}))return se}function St(A){let M=Ka(404,{pathname:A}),$=m.activeRoutes,{matches:K,route:se}=sc($);return{notFoundMatches:K,route:se,error:M}}function Bt(A,M,$){if(S=A,R=M,D=$||null,!L&&T.navigation===ph){L=!0;let K=Qt(T.location,T.matches);K!=null&&ft({restoreScrollPosition:K})}return()=>{S=null,R=null,D=null}}function Ct(A,M){return D&&D(A,M.map(K=>FS(K,T.loaderData)))||A.key}function nn(A,M){if(S&&R){let $=Ct(A,M);S[$]=R()}}function Qt(A,M){if(S){let $=Ct(A,M),K=S[$];if(typeof K=="number")return K}return null}function Ht(A,M,$){if(t.patchRoutesOnNavigation){let K=m.branches;if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:ur(M,$,p,!0,K)}}else return{active:!0,matches:ur(M,$,p,!0,K)||[]}}return{active:!1,matches:null}}async function ht(A,M,$,K){if(!t.patchRoutesOnNavigation)return{type:"success",matches:A};let se=A;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,Ae=ur(m.activeRoutes,M,p,!1,ve),Re=null;if(Ae){if(Object.keys(Ae[0].params).length===0)return{type:"success",matches:Ae};if(Re=ur(m.activeRoutes,M,p,!0,ve),!(Re&&se.length<Re.length&&Je(se,Re.slice(0,se.length))))return{type:"success",matches:Ae}}if(Re||(Re=ur(m.activeRoutes,M,p,!0,ve)),!Re||Je(se,Re))return{type:"success",matches:null};se=Re}}function Je(A,M){return A.length===M.length&&A.every(($,K)=>$.route.id===M[K].route.id)}function Sn(A){f={},m.setHmrRoutes(Ao(A,u,void 0,f))}function kn(A,M,$=!1){By(A,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:Pt,enableScrollRestoration:Bt,navigate:$e,fetch:Hn,revalidate:at,createHref:A=>t.history.createHref(A),encodeLocation:A=>t.history.encodeLocation(A),getFetcher:De,resetFetcher:Fe,deleteFetcher:Z,dispose:bn,getBlocker:Ba,deleteBlocker:Me,patchRoutes:kn,_internalFetchControllers:de,_internalSetRoutes:Sn,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){ft(A)}},t.instrumentations&&(z=cw(z,t.instrumentations.map(A=>A.router).filter(Boolean))),z}function ww(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Hh(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=Hc(s||".",tm(f),er(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=lm(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 E=x.toString();p.search=E?`?${E}`:""}}return l!=="/"&&(p.pathname=aw({basename:l,pathname:p.pathname})),Cr(p)}function zy(t,a,l){if(!l||!ww(l))return{path:a};if(l.formMethod&&!Iw(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=bb(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((E,[w,S])=>`${E}${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=Ih(l.formData),p=l.formData;else if(l.body instanceof FormData)m=Ih(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&&lm(x.search)&&m.append("index",""),x.search=`?${m}`,{path:Cr(x),submission:g}}function Uy(t,a,l,s,o,u,f,m,p,g,x,y,E,w,S,D,R,L,I,q,X,W){var U;let ne=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:ne,actionStatus:fe},ae=Uo(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(!am(de))we=!1;else if(x){let{shouldLoad:me}=hb(de,u.loaderData,u.errors);we=me}else Ew(u.loaderData,u.matches[ue],B)&&(we=!0);if(we!==null)return $h(l,s,t,p,ae,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||Nw(u.matches[ue],B))&&(C=!0);let V={...ye,defaultShouldRevalidate:C},te=wo(B,V);return $h(l,s,t,p,ae,B,g,a,te,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=ur(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(D.has(ue))return;let V=xc(C,B.path),te=new AbortController,me=li(o,B.path,te.signal),Ne=null;if(E.has(ue))E.delete(ue),Ne=oi(l,s,me,B.path,C,V,g,a);else if(we)y&&(Ne=oi(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};wo(V,ze)&&(Ne=oi(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:te})}),{dsMatches:re,revalidatingFetchers:ge}}function am(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function hb(t,a,l){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!am(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 Ew(t,a,l){let s=!a||l.route.id!==a.route.id,o=!t.hasOwnProperty(l.route.id);return s||o}function Nw(t,a){let l=t.route.path;return t.pathname!==a.pathname||l!=null&&l.endsWith("*")&&t.params["*"]!==a.params["*"]}function wo(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=>mb(g,y));x?p.push({existingRoute:x,newRoute:g}):m.push(g)}),m.length>0){let g=Ao(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],E=x,[w]=Ao([y],o,[],{},!0);Object.assign(E,{element:w.element?w.element:E.element,errorElement:w.errorElement?w.errorElement:E.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:E.hydrateFallbackElement})}l.hasHMRRoutes||l.setRoutes([...l.activeRoutes])}function mb(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=>mb(s,f))}))??!1:!1}var Hy=new WeakMap,pb=({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=qS(t),y=o[t]!==void 0&&t!=="hasErrorBoundary";if(g)xn(!g,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),f[t]=Promise.resolve();else if(y)xn(!1,`Route "${o.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let E=await u();E!=null&&(Object.assign(o,{[t]:E}),Object.assign(o,s(o)))}typeof o.lazy=="object"&&(o.lazy[t]=void 0,Object.values(o.lazy).every(E=>E===void 0)&&(o.lazy=void 0))})();return f[t]=p,p},$y=new WeakMap;function Rw(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 E=await t.lazy(),w={};for(let S in E){let D=E[S];if(D===void 0)continue;let R=VS(S),I=u[S]!==void 0&&S!=="hasErrorBoundary";R?xn(!R,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):I?xn(!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]=D}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=pb({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 jw(t){return t.matches.some(a=>a.route.middleware)?gb(t,()=>qy(t)):qy(t)}function gb(t,a){return Tw(t,a,s=>{if(qw(s))throw s;return s},Uw,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=_l(f,f[m].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:s}})}}}async function Tw(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 vb(f,m,a,l,s,o)}async function vb(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,E=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await vb(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,E),S=w!=null?s(w):void 0;return o(S)?S:y?S??y.value:(y={value:await E()},y.value)}catch(w){return await u(w,g,y)}}function yb(t,a,l,s,o){let u=pb({key:"middleware",route:s.route,manifest:a,mapRouteProperties:t}),f=Rw(s.route,oa(l.method)?"action":"loader",a,t,o);return{middleware:u,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function $h(t,a,l,s,o,u,f,m,p,g=null,x){let y=!1,E=yb(t,a,l,u,f);return{...u,_lazyPromises:E,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(w){return y=!0,g?typeof x=="boolean"?wo(u,{...g,defaultShouldRevalidate:x}):typeof w=="boolean"?wo(u,{...g,defaultShouldRevalidate:w}):wo(u,g):p},resolve(w){let{lazy:S,loader:D,middleware:R}=u.route,L=y||p||w&&!oa(l.method)&&(S||D),I=R&&R.length>0&&!D&&!S;return L&&(oa(l.method)||!I)?Dw({request:l,path:s,pattern:o,match:u,lazyHandlerPromise:E==null?void 0:E.handler,lazyRoutePromise:E==null?void 0:E.route,handlerOverride:w,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function oi(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:yb(t,a,l,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:$h(t,a,l,s,Uo(o),g,f,m,!0,p))}async function Cw(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:xb(a,l),pattern:Uo(s),params:s[0].params,context:u,matches:s},g=await t({...m,fetcherKey:o,runClientMiddleware:x=>{let y=m;return gb(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,E;return[(y=x._lazyPromises)==null?void 0:y.handler,(E=x._lazyPromises)==null?void 0:E.route]}))}catch{}return g}async function Dw({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",E=w=>{let S,D=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:xb(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,D])};try{let w=x?s.route.action:s.route.loader;if(o||u)if(w){let S,[D]=await Promise.all([E(w).catch(R=>{S=R}),o,u]);if(S!==void 0)throw S;p=D}else{await o;let S=x?s.route.action:s.route.loader;if(S)[p]=await Promise.all([E(S),u]);else if(y==="action"){let D=new URL(t.url),R=D.pathname+D.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 E(w);else{let S=new URL(t.url),D=S.pathname+S.search;throw Ka(404,{pathname:D})}}catch(w){return{type:"error",result:w}}finally{g&&t.signal.removeEventListener("abort",g)}return p}async function Aw(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 kw(t){var s,o,u,f,m;let{result:a,type:l}=t;if(rm(a)){let p;try{p=await Aw(a)}catch(g){return{type:"error",error:g}}return l==="error"?{type:"error",error:new zo(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:zw(a),statusCode:ci(a)?a.status:void 0,headers:(u=a.init)!=null&&u.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:ci(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 Ow(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"),!em(u)){let f=s.slice(0,s.findIndex(m=>m.route.id===l)+1);u=Hh(new URL(a.url),f,o,u),t.headers.set("Location",u)}return t}var Mw=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function qh(t){try{return Mw.includes(new URL(t).protocol)}catch{return!1}}function Iy(t,a,l,s){if(em(t)){let o=t,u=Wh.test(o)?new URL(Zx(o,a.protocol)):new URL(o);if(qh(u.toString()))throw new Error("Invalid redirect location");let f=er(u.pathname,l)!=null;if(u.origin===a.origin&&f)return nm(u.pathname)+u.search+u.hash}try{let o=s.createURL(t);if(qh(o.toString()))throw new Error("Invalid redirect location")}catch{}return t}function li(t,a,l,s){let o=t.createURL(bb(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=Ih(s.formData):u.body=s.formData}return new Request(o,u)}function xb(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 Ih(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 _w(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 E=y.route.id,w=a[E];if(tt(!us(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[E]=S;else{let D=_l(t,E);f[D.route.id]==null&&(f[D.route.id]=S)}s||(u[E]=fb),p||(p=!0,m=ci(w.error)?w.error.status:500),w.headers&&(g[E]=w.headers)}else u[E]=w.data,w.statusCode&&w.statusCode!==200&&!p&&(m=w.statusCode),w.headers&&(g[E]=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}=_w(a,l,s);return o.filter(g=>!g.matches||g.matches.some(x=>x.shouldLoad)).forEach(g=>{let{key:x,match:y,controller:E}=g;if(E&&E.signal.aborted)return;let w=u[x];if(tt(w,"Did not find corresponding fetcher result"),La(w)){let S=_l(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(us(w))tt(!1,"Unhandled fetcher revalidation redirect");else{let S=Nr(w.data);f.set(x,S)}}),{loaderData:m,errors:p}}function Fy(t,a,l,s){let o=Object.entries(a).filter(([,u])=>u!==fb).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 _l(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 sc(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 zo(t||500,f,new Error(m),!0)}function ic(t){let a=Object.entries(t);for(let l=a.length-1;l>=0;l--){let[s,o]=a[l];if(us(o))return{key:s,result:o}}}function bb(t){let a=typeof t=="string"?Dr(t):t;return Cr({...a,hash:""})}function Lw(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function zw(t){var a,l;return new zo(((a=t.init)==null?void 0:a.status)??500,((l=t.init)==null?void 0:l.statusText)??"Internal Server Error",t.data)}function Uw(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,l])=>typeof a=="string"&&Bw(l))}function Bw(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function Hw(t){return rm(t.result)&&ub.has(t.result.status)}function La(t){return t.type==="error"}function us(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 rm(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function $w(t){return ub.has(t)}function qw(t){return rm(t)&&$w(t.status)&&t.headers.has("Location")}function Iw(t){return vw.has(t.toUpperCase())}function oa(t){return pw.has(t.toUpperCase())}function lm(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function xc(t,a){let l=typeof a=="string"?Dr(a).search:a.search;if(t[t.length-1].route.index&&lm(l||""))return t[t.length-1];let s=rb(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 gh(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 Vw(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 uo(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 Yw(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 Nr(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 Fw(t,a){try{let l=t.sessionStorage.getItem(db);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 Pw(t,a){if(a.size>0){let l={};for(let[s,o]of a)l[s]=[...o];try{t.sessionStorage.setItem(db,JSON.stringify(l))}catch(s){xn(!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 hs=v.createContext(null);hs.displayName="DataRouter";var fi=v.createContext(null);fi.displayName="DataRouterState";var Sb=v.createContext(!1);function wb(){return v.useContext(Sb)}var sm=v.createContext({isTransitioning:!1});sm.displayName="ViewTransition";var im=v.createContext(new Map);im.displayName="Fetchers";var Gw=v.createContext(null);Gw.displayName="Await";var tr=v.createContext(null);tr.displayName="Navigation";var $c=v.createContext(null);$c.displayName="Location";var nr=v.createContext({outlet:null,matches:[],isDataRoute:!1});nr.displayName="Route";var om=v.createContext(null);om.displayName="RouteError";var Eb="REACT_ROUTER_ERROR",Xw="REDIRECT",Qw="ROUTE_ERROR_RESPONSE";function Kw(t){if(t.startsWith(`${Eb}:${Xw}:{`))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 Zw(t){if(t.startsWith(`${Eb}:${Qw}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new zo(a.status,a.statusText,a.data)}catch{}}function Jw(t,{relative:a}={}){tt(Bo(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:s}=v.useContext(tr),{hash:o,pathname:u,search:f}=Ho(t,{relative:a}),m=u;return l!=="/"&&(m=u==="/"?l:Wa([l,u])),s.createHref({pathname:m,search:f,hash:o})}function Bo(){return v.useContext($c)!=null}function fr(){return tt(Bo(),"useLocation() may be used only in the context of a <Router> component."),v.useContext($c).location}var Nb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rb(t){v.useContext(tr).static||v.useLayoutEffect(t)}function Ar(){let{isDataRoute:t}=v.useContext(nr);return t?fE():Ww()}function Ww(){tt(Bo(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(hs),{basename:a,navigator:l}=v.useContext(tr),{matches:s}=v.useContext(nr),{pathname:o}=fr(),u=JSON.stringify(tm(s)),f=v.useRef(!1);return Rb(()=>{f.current=!0}),v.useCallback((p,g={})=>{if(xn(f.current,Nb),!f.current)return;if(typeof p=="number"){l.go(p);return}let x=Hc(p,JSON.parse(u),o,g.relative==="path");t==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Wa([a,x.pathname])),(g.replace?l.replace:l.push)(x,g.state,g)},[a,l,u,o,t])}var eE=v.createContext(null);function tE(t){let a=v.useContext(nr).outlet;return v.useMemo(()=>a&&v.createElement(eE.Provider,{value:t},a),[a,t])}function nE(){let{matches:t}=v.useContext(nr),a=t[t.length-1];return(a==null?void 0:a.params)??{}}function Ho(t,{relative:a}={}){let{matches:l}=v.useContext(nr),{pathname:s}=fr(),o=JSON.stringify(tm(l));return v.useMemo(()=>Hc(t,JSON.parse(o),s,a==="path"),[t,o,s,a])}function aE(t,a,l){tt(Bo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(tr),{matches:o}=v.useContext(nr),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||"";Db(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=fr(),y;y=x;let E=y.pathname||"/",w=E;if(p!=="/"){let R=p.replace(/^\//,"").split("/");w="/"+E.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})):Wx(t,{pathname:w});return xn(g||S!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),xn(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.`),oE(S&&S.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Wa([p,s.encodeLocation?s.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:Wa([p,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),o,l)}function rE(){let t=Cb(),a=ci(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 lE=v.createElement(rE,null),jb=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=Zw(t.digest);l&&(t=l)}let a=t!==void 0?v.createElement(nr.Provider,{value:this.props.routeContext},v.createElement(om.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(sE,{error:t},a):a}};jb.contextType=Sb;var vh=new WeakMap;function sE({children:t,error:a}){let{basename:l}=v.useContext(tr);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let s=Kw(a.digest);if(s){let o=vh.get(a);if(o)throw o;let u=sb(s.location,l),f=u.absoluteURL||u.to;if(qh(f))throw new Error("Invalid redirect location");if(lb&&!vh.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 vh.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return t}function iE({routeContext:t,match:a,children:l}){let s=v.useContext(hs);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(nr.Provider,{value:t},l)}function oE(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:E,errors:w}=s,S=y.route.loader&&!E.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 E,w;p(x,{location:s.location,params:((w=(E=s.matches)==null?void 0:E[0])==null?void 0:w.params)??{},pattern:Uo(s.matches),errorInfo:y})}:void 0;return o.reduceRight((x,y,E)=>{let w,S=!1,D=null,R=null;s&&(w=u&&y.route.id?u[y.route.id]:void 0,D=y.route.errorElement||lE,f&&(m<0&&E===0?(Db("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,R=null):m===E&&(S=!0,R=y.route.hydrateFallbackElement||null)));let L=a.concat(o.slice(0,E+1)),I=()=>{let q;return w?q=D:S?q=R:y.route.Component?q=v.createElement(y.route.Component,null):y.route.element?q=y.route.element:q=x,v.createElement(iE,{match:y,routeContext:{outlet:x,matches:L,isDataRoute:s!=null},children:q})};return s&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?v.createElement(jb,{location:s.location,revalidation:s.revalidation,component:D,error:w,children:I(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:g}):I()},null)}function um(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Tb(t){let a=v.useContext(hs);return tt(a,um(t)),a}function $o(t){let a=v.useContext(fi);return tt(a,um(t)),a}function uE(t){let a=v.useContext(nr);return tt(a,um(t)),a}function qc(t){let a=uE(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 cE(){return qc("useRouteId")}function kr(){let t=$o("useNavigation");return v.useMemo(()=>{let{matches:a,historyAction:l,...s}=t.navigation;return s},[t.navigation])}function dE(){let t=Tb("useRevalidator"),a=$o("useRevalidator"),l=v.useCallback(async()=>{await t.router.revalidate()},[t.router]);return v.useMemo(()=>({revalidate:l,state:a.revalidation}),[l,a.revalidation])}function Ul(){let t=$o("useLoaderData"),a=qc("useLoaderData");return t.loaderData[a]}function ms(t){return $o("useRouteLoaderData").loaderData[t]}function Cb(){var s;let t=v.useContext(om),a=$o("useRouteError"),l=qc("useRouteError");return t!==void 0?t:(s=a.errors)==null?void 0:s[l]}function fE(){let{router:t}=Tb("useNavigate"),a=qc("useNavigate"),l=v.useRef(!1);return Rb(()=>{l.current=!0}),v.useCallback(async(o,u={})=>{xn(l.current,Nb),l.current&&(typeof o=="number"?await t.navigate(o):await t.navigate(o,{fromRouteId:a,...u}))},[t,a])}var Ky={};function Db(t,a,l){!a&&!Ky[t]&&(Ky[t]=!0,xn(!1,l))}var Zy={};function Jy(t,a){!t&&!Zy[a]&&(Zy[a]=!0,console.warn(a))}var hE="useOptimistic",Wy=AS[hE],mE=()=>{};function pE(t){return Wy?Wy(t):[t,mE]}function gE(t){let a={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&xn(!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&&xn(!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&&xn(!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 vE=["HydrateFallback","hydrateFallbackElement"],yE=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 xE({router:t,flushSync:a,onError:l,useTransitions:s}){s=wb()||s;let[u,f]=v.useState(t.state),[m,p]=pE(u),[g,x]=v.useState(),[y,E]=v.useState({isTransitioning:!1}),[w,S]=v.useState(),[D,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:Uo(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 ae=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(Jy(ye==null||ae,"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||!ae){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(()=>{D&&(w==null||w.resolve(),D.skipTransition()),E({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),E({isTransitioning:!1})})}),a(()=>R(re));return}D?(w==null||w.resolve(),D.skipTransition(),I({state:T,currentLocation:ye.currentLocation,nextLocation:ye.nextLocation})):(x(T),E({isTransitioning:!0,flushSync:!1,currentLocation:ye.currentLocation,nextLocation:ye.nextLocation}))},[t.window,a,D,w,s,p,l]);v.useLayoutEffect(()=>t.subscribe(X),[t,X]),v.useEffect(()=>{y.isTransitioning&&!y.flushSync&&S(new yE)},[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),E({isTransitioning:!1})}),R(fe)}},[g,w,t.window,s,p]),v.useEffect(()=>{w&&g&&m.location.key===g.location.key&&w.resolve()},[w,D,m.location,g]),v.useEffect(()=>{!y.isTransitioning&&L&&(x(L.state),E({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]),ne=t.basename||"/",z=v.useMemo(()=>({router:t,navigator:W,static:!1,basename:ne,onError:l}),[t,W,ne,l]);return v.createElement(v.Fragment,null,v.createElement(hs.Provider,{value:z},v.createElement(fi.Provider,{value:m},v.createElement(im.Provider,{value:q.current},v.createElement(sm.Provider,{value:y},v.createElement(wE,{basename:ne,location:m.location,navigationType:m.historyAction,navigator:W,useTransitions:s},v.createElement(bE,{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 bE=v.memo(SE);function SE({routes:t,manifest:a,future:l,state:s,isStatic:o,onError:u}){return aE(t,void 0,{manifest:a,state:s,isStatic:o,onError:u})}function hi(t){return tE(t.context)}function wE({basename:t="/",children:a=null,location:l,navigationType:s="POP",navigator:o,static:u=!1,useTransitions:f}){tt(!Bo(),"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:E=null,key:w="default",mask:S}=l,D=v.useMemo(()=>{let R=er(g,m);return R==null?null:{location:{pathname:R,search:x,hash:y,state:E,key:w,mask:S},navigationType:s}},[m,g,x,y,E,w,s,S]);return xn(D!=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.`),D==null?null:v.createElement(tr.Provider,{value:p},v.createElement($c.Provider,{children:a,value:D}))}var bc="get",Sc="application/x-www-form-urlencoded";function Ic(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function EE(t){return Ic(t)&&t.tagName.toLowerCase()==="button"}function NE(t){return Ic(t)&&t.tagName.toLowerCase()==="form"}function RE(t){return Ic(t)&&t.tagName.toLowerCase()==="input"}function jE(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function TE(t,a){return t.button===0&&(!a||a==="_self")&&!jE(t)}function Vh(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 CE(t,a){let l=Vh(t);return a&&a.forEach((s,o)=>{l.has(o)||a.getAll(o).forEach(u=>{l.append(o,u)})}),l}var oc=null;function DE(){if(oc===null)try{new FormData(document.createElement("form"),0),oc=!1}catch{oc=!0}return oc}var AE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function yh(t){return t!=null&&!AE.has(t)?(xn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sc}"`),null):t}function kE(t,a){let l,s,o,u,f;if(NE(t)){let m=t.getAttribute("action");s=m?er(m,a):null,l=t.getAttribute("method")||bc,o=yh(t.getAttribute("enctype"))||Sc,u=new FormData(t)}else if(EE(t)||RE(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?er(p,a):null,l=t.getAttribute("formmethod")||m.getAttribute("method")||bc,o=yh(t.getAttribute("formenctype"))||yh(m.getAttribute("enctype"))||Sc,u=new FormData(m,t),!DE()){let{name:g,type:x,value:y}=t;if(x==="image"){let E=g?`${g}.`:"";u.append(`${E}x`,"0"),u.append(`${E}y`,"0")}else g&&u.append(g,y)}}else{if(Ic(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=bc,s=null,o=Sc,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 cm(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&&er(o.pathname,a)==="/"?o.pathname=`${Tc(a)}/_root.${s}`:o.pathname=`${Tc(o.pathname)}.${s}`,o}async function OE(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 ME(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 _E(t,a,l){let s=await Promise.all(t.map(async o=>{let u=a.routes[o.route.id];if(u){let f=await OE(u,l);return f.links?f.links():[]}return[]}));return BE(s.flat(1).filter(ME).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 E=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 E=="boolean")return E}return!0}):[]}function LE(t,a,{includeHydrateFallback:l}={}){return zE(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 zE(t){return[...new Set(t)]}function UE(t){let a={},l=Object.keys(t).sort();for(let s of l)a[s]=t[s];return a}function BE(t,a){let l=new Set;return new Set(a),t.reduce((s,o)=>{let u=JSON.stringify(UE(o));return l.has(u)||(l.add(u),s.push({key:u,link:o})),s},[])}function dm(){let t=v.useContext(hs);return cm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function HE(){let t=v.useContext(fi);return cm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var fm=v.createContext(void 0);fm.displayName="FrameworkContext";function Vc(){let t=v.useContext(fm);return cm(t,"You must render this element inside a <HydratedRouter> element"),t}function $E(t,a){let l=v.useContext(fm),[s,o]=v.useState(!1),[u,f]=v.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:y}=a,E=v.useRef(null);v.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let D=L=>{L.forEach(I=>{f(I.isIntersecting)})},R=new IntersectionObserver(D,{threshold:.5});return E.current&&R.observe(E.current),()=>{R.disconnect()}}},[t]),v.useEffect(()=>{if(s){let D=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(D)}}},[s]);let w=()=>{o(!0)},S=()=>{o(!1),f(!1)};return l?t!=="intent"?[u,E,{}]:[u,E,{onFocus:co(m,w),onBlur:co(p,S),onMouseEnter:co(g,w),onMouseLeave:co(x,S),onTouchStart:co(y,w)}]:[!1,E,{}]}function co(t,a){return l=>{t&&t(l),l.defaultPrevented||a(l)}}function qE({page:t,...a}){let l=wb(),{nonce:s}=Vc(),{router:o}=dm(),u=v.useMemo(()=>Wx(o.routes,t,o.basename),[o.routes,t,o.basename]);return u?(a.nonce==null&&s&&(a={...a,nonce:s}),l?v.createElement(VE,{page:t,matches:u,...a}):v.createElement(YE,{page:t,matches:u,...a})):null}function IE(t){let{manifest:a,routeModules:l}=Vc(),[s,o]=v.useState([]);return v.useEffect(()=>{let u=!1;return _E(t,a,l).then(f=>{u||o(f)}),()=>{u=!0}},[t,a,l]),s}function VE({page:t,matches:a,...l}){let s=fr(),{future:o}=Vc(),{basename:u}=dm(),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 YE({page:t,matches:a,...l}){let s=fr(),{future:o,manifest:u,routeModules:f}=Vc(),{basename:m}=dm(),{loaderData:p,matches:g}=HE(),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]),E=v.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let D=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:D.add(I.route.id))}),D.size===0)return[];let L=Ab(t,m,o.v8_trailingSlashAwareDataRequests,"data");return R&&D.size>0&&L.searchParams.set("_routes",a.filter(I=>D.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(()=>LE(y,u),[y,u]),S=IE(y);return v.createElement(v.Fragment,null,E.map(D=>v.createElement("link",{key:D,rel:"prefetch",as:"fetch",href:D,...l})),w.map(D=>v.createElement("link",{key:D,rel:"modulepreload",href:D,...l})),S.map(({key:D,link:R})=>v.createElement("link",{key:D,nonce:l.nonce,...R,crossOrigin:R.crossOrigin??l.crossOrigin})))}function FE(...t){return a=>{t.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var PE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{PE&&(window.__reactRouterVersion="7.18.0")}catch{}function GE(t,a){return Sw({basename:a==null?void 0:a.basename,getContext:a==null?void 0:a.getContext,future:a==null?void 0:a.future,history:US({window:a==null?void 0:a.window}),hydrationData:XE(),routes:t,mapRouteProperties:gE,hydrationRouteProperties:vE,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 XE(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:QE(t.errors)}),t}function QE(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 zo(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&ow.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 Ke=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:E,defaultShouldRevalidate:w,...S},D){let{basename:R,navigator:L,useTransitions:I}=v.useContext(tr),q=typeof x=="string"&&Bc.test(x),X=sb(x,R);x=X.to;let W=Jw(x,{relative:o}),ne=fr(),z=null;if(m){let ge=Hc(m,[],ne.mask?ne.mask.pathname:"/",!0);R!=="/"&&(ge.pathname=ge.pathname==="/"?R:Wa([R,ge.pathname])),z=L.createHref(ge)}let[T,ee,fe]=$E(s,S),be=ZE(x,{replace:f,mask:m,state:p,target:g,preventScrollReset:y,relative:o,viewTransition:E,defaultShouldRevalidate:w,useTransitions:I});function ye(ge){a&&a(ge),ge.defaultPrevented||be(ge)}let ae=!(X.isExternal||u),re=v.createElement("a",{...S,...fe,href:(ae?z:void 0)||X.absoluteURL||W,onClick:ae?ye:a,ref:FE(D,ee),target:g,"data-discover":!q&&l==="render"?"true":void 0});return T&&!q?v.createElement(v.Fragment,null,re,v.createElement(qE,{page:W})):re});Ke.displayName="Link";var kb=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=Ho(f,{relative:g.relative}),E=fr(),w=v.useContext(fi),{navigator:S,basename:D}=v.useContext(tr),R=w!=null&&tN(y)&&m===!0,L=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,I=E.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&&D&&(q=er(q,D)||q);const X=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let W=I===L||!o&&I.startsWith(L)&&I.charAt(X)==="/",ne=q!=null&&(q===L||!o&&q.startsWith(L)&&q.charAt(L.length)==="/"),z={isActive:W,isPending:ne,isTransitioning:R},T=W?a:void 0,ee;typeof s=="function"?ee=s(z):ee=[s,W?"active":null,ne?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let fe=typeof u=="function"?u(z):u;return v.createElement(Ke,{...g,"aria-current":T,className:ee,ref:x,style:fe,to:f,viewTransition:m},typeof p=="function"?p(z):p)});kb.displayName="NavLink";var ua=v.forwardRef(({discover:t="render",fetcherKey:a,navigate:l,reloadDocument:s,replace:o,state:u,method:f=bc,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:E,...w},S)=>{let{useTransitions:D}=v.useContext(tr),R=mm(),L=eN(m,{relative:g}),I=f.toLowerCase()==="get"?"get":"post",q=typeof m=="string"&&Bc.test(m),X=W=>{if(p&&p(W),W.defaultPrevented)return;W.preventDefault();let ne=W.nativeEvent.submitter,z=(ne==null?void 0:ne.getAttribute("formmethod"))||f,T=()=>R(ne||W.currentTarget,{fetcherKey:a,method:z,navigate:l,replace:o,state:u,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:E});D&&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})});ua.displayName="Form";function Ob(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hm(t){let a=v.useContext(hs);return tt(a,Ob(t)),a}function KE(t){let a=v.useContext(fi);return tt(a,Ob(t)),a}function ZE(t,{target:a,replace:l,mask:s,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=Ar(),y=fr(),E=Ho(t,{relative:f});return v.useCallback(w=>{if(TE(w,a)){w.preventDefault();let S=l!==void 0?l:Cr(y)===Cr(E),D=()=>x(t,{replace:S,mask:s,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p});g?v.startTransition(()=>D()):D()}},[y,x,E,l,s,o,a,t,u,f,m,p,g])}function qo(t){xn(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(Vh(t)),l=v.useRef(!1),s=fr(),o=v.useMemo(()=>CE(s.search,l.current?null:a.current),[s.search]),u=Ar(),f=v.useCallback((m,p)=>{const g=Vh(typeof m=="function"?m(new URLSearchParams(o)):m);l.current=!0,u("?"+g,p)},[u,o]);return[o,f]}var JE=0,WE=()=>`__${String(++JE)}__`;function mm(){let{router:t}=hm("useSubmit"),{basename:a}=v.useContext(tr),l=cE(),s=t.fetch,o=t.navigate;return v.useCallback(async(u,f={})=>{let{action:m,method:p,encType:g,formData:x,body:y}=kE(u,a);if(f.navigate===!1){let E=f.fetcherKey||WE();await s(E,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 eN(t,{relative:a}={}){let{basename:l}=v.useContext(tr),s=v.useContext(nr);tt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),u={...Ho(t||".",{relative:a})},f=fr();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:Wa([l,u.pathname])),Cr(u)}function ds({key:t}={}){var W;let{router:a}=hm("useFetcher"),l=KE("useFetcher"),s=v.useContext(im),o=v.useContext(nr),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:E}=a;v.useEffect(()=>(x(m),()=>g(m)),[g,x,m]);let w=v.useCallback(async(ne,z)=>{tt(u,"No routeId available for fetcher.load()"),await E(m,u,ne,z)},[m,u,E]),S=mm(),D=v.useCallback(async(ne,z)=>{await S(ne,{...z,navigate:!1,fetcherKey:m})},[m,S]),R=v.useCallback(ne=>y(m,ne),[y,m]),L=v.useMemo(()=>{let ne=v.forwardRef((z,T)=>v.createElement(ua,{...z,navigate:!1,fetcherKey:m,ref:T}));return ne.displayName="fetcher.Form",ne},[m]),I=l.fetchers.get(m)||cb,q=s.get(m);return v.useMemo(()=>({Form:L,submit:D,load:w,reset:R,...I,data:q}),[L,D,w,R,I,q])}function tN(t,{relative:a}={}){let l=v.useContext(sm);tt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=hm("useViewTransitionState"),o=Ho(t,{relative:a});if(!l.isTransitioning)return!1;let u=er(l.currentLocation.pathname,s)||l.currentLocation.pathname,f=er(l.nextLocation.pathname,s)||l.nextLocation.pathname;return jc(o.pathname,f)!=null||jc(o.pathname,u)!=null}var al=Xx();function nN(t){return v.createElement(xE,{flushSync:al.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 Mb=(...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 aN=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 rN=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=rN(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 xh={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 lN=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},sN=v.createContext({}),iN=()=>v.useContext(sN),oN=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:E="currentColor",className:w=""}=iN()??{},S=s??y?Number(l??x)*24/Number(a??g):l??x;return v.createElement("svg",{ref:p,...xh,width:a??g??xh.width,height:a??g??xh.height,stroke:t??E,strokeWidth:S,className:Mb("lucide",w,o),...!u&&!lN(m)&&{"aria-hidden":"true"},...m},[...f.map(([D,R])=>v.createElement(D,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(oN,{ref:u,iconNode:a,className:Mb(`lucide-${aN(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 uN=[["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"}]],cN=Et("arrow-down-wide-narrow",uN);/**
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 dN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Yc=Et("arrow-left",dN);/**
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 fN=[["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"}]],hN=Et("arrow-up-narrow-wide",fN);/**
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 mN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],_b=Et("ban",mN);/**
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 pN=[["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"}]],gN=Et("chart-column",pN);/**
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 vN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Lb=Et("check",vN);/**
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 yN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ps=Et("chevron-down",yN);/**
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 xN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],zb=Et("chevron-right",xN);/**
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 bN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],SN=Et("circle-check-big",bN);/**
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 wN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],pm=Et("circle-check",wN);/**
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 EN=[["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"}]],NN=Et("circle-dashed",EN);/**
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 RN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],jN=Et("circle-minus",RN);/**
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 TN=[["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"}]],Ub=Et("circle-pause",TN);/**
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 CN=[["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"}]],Bb=Et("circle-play",CN);/**
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 DN=[["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"}]],AN=Et("circle-x",DN);/**
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 kN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Fc=Et("circle",kN);/**
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 ON=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],MN=Et("clock",ON);/**
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 _N=[["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"}]],Hb=Et("copy",_N);/**
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 LN=[["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"}]],zN=Et("download",LN);/**
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 UN=[["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"}]],BN=Et("git-branch",UN);/**
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 HN=[["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"}]],$N=Et("grip-vertical",HN);/**
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 qN=[["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"}]],IN=Et("house",qN);/**
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 VN=[["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"}]],Cc=Et("layers",VN);/**
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 YN=[["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"}]],Pc=Et("list-todo",YN);/**
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 FN=[["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"}]],PN=Et("locate-fixed",FN);/**
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 GN=[["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"}]],XN=Et("moon",GN);/**
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 QN=[["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"}]],$b=Et("octagon-alert",QN);/**
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 KN=[["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"}]],fs=Et("pencil",KN);/**
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 ZN=[["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"}]],JN=Et("play",ZN);/**
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 WN=[["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"}]],qb=Et("scroll-text",WN);/**
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 eR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tR=Et("search",eR);/**
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 nR=[["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"}]],aR=Et("sun",nR);/**
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 rR=[["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"}]],lR=Et("timer-reset",rR);/**
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 sR=[["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"}]],di=Et("trash-2",sR);/**
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 iR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],oR=Et("x",iR),uR="/api",cR=120,dR=40;function Gc(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??""}}function Xc(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(Gc),linkedRequirements:t.linkedRequirements??[],handoff:t.handoff??"",handoffUpdatedAt:t.handoffUpdatedAt??""}}function Qc(t){return{...t,number:t.number??0,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",acceptedDecisions:t.acceptedDecisions??[],phaseIds:t.phaseIds??[]}}function Ib(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 gm(t){return{...t,description:t.description??"",macroTasks:t.macroTasks??[],linkedPhaseIds:t.linkedPhaseIds??[]}}async function ax(t,a){try{return await fetch(`${uR}${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 Wt(t,a){let l=await ax(t,a),s=0;for(;l.status===503&&s<dR;)await new Promise(o=>setTimeout(o,cR)),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 Vb(){return Ib(await Wt("/project"))}async function fR(t){return Ib(await Wt("/project",{method:"PUT",body:JSON.stringify(t)}))}async function hR(){return Wt("/ui-config")}async function Yb(){return(await Wt("/features")).map(Qc)}async function Io(t){return Qc(await Wt(`/features/${t}`))}async function mR(t){return Qc(await Wt("/features",{method:"POST",body:JSON.stringify(t)}))}async function Fb(t){return Qc(await Wt(`/features/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function pR(t){return Wt(`/features/${t}`,{method:"DELETE"})}async function vm(){return(await Wt("/requirements")).requirements.map(gm)}async function gR(t){const a=new Date().toISOString();return gm(await Wt("/requirements",{method:"POST",body:JSON.stringify({...t,macroTasks:[],createdAt:a,updatedAt:a})}))}async function vR(t){return gm(await Wt(`/requirements/${t.id}`,{method:"PUT",body:JSON.stringify({...t,updatedAt:new Date().toISOString()})}))}async function yR(t){return Wt(`/requirements/${t}`,{method:"DELETE"})}async function Kc(t){const a=t?`?featureId=${encodeURIComponent(t)}`:"";return(await Wt(`/phases${a}`)).map(Xc)}async function Zc(t){return Xc(await Wt(`/phases/${t}`))}async function xR(t){return Xc(await Wt("/phases",{method:"POST",body:JSON.stringify(t)}))}async function Pb(t){return Xc(await Wt(`/phases/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function bR(t){return Wt(`/phases/${t}`,{method:"DELETE"})}async function SR(t,a){return Gc(await Wt(`/phases/${t}/tasks`,{method:"POST",body:JSON.stringify(a)}))}async function Jc(t){return Gc(await Wt(`/tasks/${t}`))}async function ym(t){return Gc(await Wt(`/tasks/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function wR(t){return Wt(`/tasks/${t}`,{method:"DELETE"})}async function Gb(){return Wt("/tasks/active")}async function Yh(){return(await Wt("/handoffs")).handoffs??[]}async function Xb(t){return Wt(`/phases/${t}/handoff`,{method:"DELETE"})}async function ER(t=!1){return Wt(`/export?full=${t?"true":"false"}`)}async function NR(){return Wt("/repair",{method:"POST"})}async function bh(t,a,l,s){return Wt("/reorder",{method:"POST",body:JSON.stringify({kind:t,movedId:a,beforeId:l,afterId:s})})}function RR(){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 jR({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 TR({projectName:t,projectRoot:a,planRoot:l,liveStatus:s}){const{theme:o,toggleTheme:u}=RR(),[f,m]=v.useState(!1),[p,g]=v.useState(!1),[x,y]=v.useState(null),E=[{to:"/",label:"Dashboard",icon:IN},{to:"/features",label:"Features",icon:Cc},{to:"/requirements",label:"Requirements",icon:Pc},{to:"/handoff",label:"Handoff",icon:qb}];async function w(S){y(S?"full":"summary");try{const R=await ER(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(Ke,{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(Cc,{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(Lb,{className:"h-3.5 w-3.5"}):c.jsx(Hb,{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(jR,{liveStatus:s})}),c.jsx("nav",{className:"flex items-center gap-1.5 sm:gap-2",children:E.map(S=>c.jsxs(kb,{to:S.to,end:S.to==="/",className:({isActive:D})=>`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 ${D?"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,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(zN,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Export"}),c.jsx(ps,{className:`h-4 w-4 transition-transform ${p?"rotate-180":""}`})]}),p?c.jsxs("div",{role:"menu",onKeyDown:S=>{var I;const D=Array.from(S.currentTarget.querySelectorAll("[role=menuitem]")).filter(q=>!q.hasAttribute("disabled"));if(D.length===0)return;const R=D.indexOf(document.activeElement);let L=R;if(S.key==="ArrowDown")L=R===-1?0:(R+1)%D.length;else if(S.key==="ArrowUp")L=R===-1?D.length-1:(R-1+D.length)%D.length;else if(S.key==="Home")L=0;else if(S.key==="End")L=D.length-1;else return;S.preventDefault(),(I=D[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(aR,{className:"h-4 w-4"}):c.jsx(XN,{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 fo(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 CR(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:fo(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:fo(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:fo(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:fo(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:fo(t,`p-${a}`)},`p-${a}`)}function Dn({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)=>CR(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 jr(t){return String(t&&t>0?t:0).padStart(3,"0")}function gs({featureNum:t,phaseNum:a,taskNum:l}){const s=[];return t!==void 0&&s.push(`F${jr(t)}`),a!==void 0&&s.push(`P${jr(a)}`),l!==void 0&&s.push(`T${jr(l)}`),s.join("/")}async function DR(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 xm({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():"?",jr(a)]})}function ko({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",jr(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",jr(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",jr(l)]})]})]}):null}function Tr({featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:o,taskId:u}){const f=s?({children:g})=>c.jsx(Ke,{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(Ke,{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(Ke,{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",jr(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",jr(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",jr(l)]})]}):null]})}function rl({id:t,children:a}){const[l,s]=v.useState(!1);return c.jsxs("button",{type:"button",onClick:async o=>{o.preventDefault(),o.stopPropagation(),await DR(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(Lb,{className:"h-3 w-3 text-emerald-500"}):c.jsx(Hb,{className:"h-3 w-3"})})]})}function vs({shortId:t}){return c.jsx(rl,{id:t,children:c.jsx("span",{className:"short-id-badge",children:t})})}function bm({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 AR({activeTasks:t}){const a=Ar(),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:[c.jsxs(Ke,{to:o,className:"flex min-w-0 flex-1 items-center gap-2",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.jsx(xm,{type:"task",number:s.number}),c.jsx(ko,{type:"task",phaseNum:s.phaseNumber,featureNum:s.featureNumber}),c.jsx("span",{className:"min-w-0 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(PN,{className:"h-4 w-4"})})]},s.id)})})]})})})}function kR({project:t,activeTasks:a,serverInfo:l}){const s=kr(),[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(TR,{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(AR,{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(Ke,{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(Dn,{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(hi,{})]})]})}const Ra=32,Qb=4,OR=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 MR(){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 _R(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+OR),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 LR(){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 zR(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=LR()),s.current||(s.current=MR()),!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=_R(l.current,o.current))},100);return()=>{window.clearInterval(f),u.href=s.current}},[t])}const bo={create:{key:"n",primary:!0},edit:{key:"e",primary:!0},delete:{key:"d",primary:!0},submit:{key:"Enter",primary:!0}},Zb=v.createContext(bo);function Jb(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function UR(t){return typeof t!="string"}function BR(t){return{create:(t==null?void 0:t.create)??bo.create,edit:(t==null?void 0:t.edit)??bo.edit,delete:(t==null?void 0:t.delete)??bo.delete,submit:(t==null?void 0:t.submit)??bo.submit}}function HR(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 $R(t){return t instanceof HTMLElement?!!t.closest("input, textarea, select, [contenteditable='true']"):!1}function qR(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 IR({shortcuts:t,children:a}){return v.createElement(Zb.Provider,{value:BR(t)},a)}function Wb(t){const a=v.useContext(Zb);if(t)return UR(t)?t:a[t]}function An(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)&&$R(u.target)||qR(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 VR=1500,YR=80,FR=12e3,PR=5e3;function GR(){const{revalidate:t}=dE(),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)},E=()=>{g(),s.current=window.setTimeout(()=>{t()},YR)},w=()=>{!f||l.current!==null||(m("reconnecting"),l.current=window.setTimeout(()=>{l.current=null,R()},VR))},S=()=>{y(),x();const X=a.current;if(a.current=null,X&&(X.readyState===WebSocket.OPEN||X.readyState===WebSocket.CONNECTING))try{X.close()}catch{}},D=()=>{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()},PR)}},FR)},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",ne=new WebSocket(`${W}://${window.location.host}/ws`);a.current=ne,ne.onopen=()=>{p(),m("live"),D()},ne.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":E();break;default:break}}catch{}},ne.onclose=()=>{y(),x(),a.current===ne&&(a.current=null),f&&w()},ne.onerror=()=>{try{ne.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 XR(){const[t,a,l]=await Promise.all([Vb(),hR(),Gb()]);return{project:t,uiConfig:a,activeTasks:l}}function QR(){const{project:t,uiConfig:a,activeTasks:l}=Ul();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]),zR(l.length>0),c.jsxs(IR,{shortcuts:a.shortcuts,children:[c.jsx(GR,{}),c.jsx(kR,{project:t,activeTasks:l,serverInfo:a.server})]})}function KR(){const t=Cb(),a=ci(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 ZR(){const[t,a,l]=await Promise.all([Yb(),Kc(),Gb()]);return{features:t,phases:a,activeTasks:l}}function JR({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:HR(a)}):null}const WR={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 ${WR[t]} ${a}`,...o,children:[c.jsx("span",{className:"inline-flex items-center gap-1.5 sm:gap-2",children:l}),s?c.jsx(JR,{shortcut:s}):null]})}function tn({className:t="",children:a,...l}){return c.jsx("div",{className:`surface-card p-6 ${t}`,...l,children:a})}function e2({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(Dn,{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(Dn,{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(Dn,{text:a.implementationNotes})]}):null]},a.id))})]})}function t2({project:t}){var x,y,E;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:((E=t.workflowRules)==null?void 0:E.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(tn,{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(e2,{decisions:m})]})]})}):null}const Fh={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 Bl(t){return Fh[t]??Fh.planned}function Dc(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 n2(t){const a=Bl(t);return{backgroundColor:Dc(a,"bg"),borderStyle:a.borderStyle,borderColor:Dc(a,"border"),borderWidth:"1px"}}function a2(t){const a=Bl(t);return{backgroundColor:Dc(a,"bg"),borderStyle:a.borderStyle,borderColor:Dc(a,"border"),borderWidth:"1px"}}function Sm(t){const{pattern:a}=Bl(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(${Bl(t).colorVar}) ${a}%, transparent)`}function n0(t){return t in Fh?t:"planned"}function r2(t,a){const s=[Bl(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:Fc,"play-start":JN,play:Bb,clock:MN,stop:$b,pause:Ub,check:pm,"check-mixed":SN,ban:_b,x:AN};function l2({status:t,className:a=""}){const l=Bl(t),s=a0[l.icon]??Fc;return c.jsx(s,{className:`h-4 w-4 shrink-0 ${a}`.trim(),"aria-hidden":"true"})}function Ja({status:t}){const a=n0(t),l=Bl(a);return c.jsxs("span",{className:`status-chip ${e0(a)} ${Sm(a)}`,title:l.description,"aria-label":l.description,children:[c.jsx(l2,{status:a,className:"h-3.5 w-3.5"}),c.jsx("span",{children:l.label})]})}function Vo({status:t,breakdown:a,size:l="md",children:s}){const o=Bl(t),u=a0[o.icon]??Fc,f=Sm(t),m=a?r2(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 Ac({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(Vo,{status:t,breakdown:a})]})}function s2(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function i2({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(tn,{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(Ke,{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(xm,{type:"task",number:s.number}),c.jsx(ko,{type:"task",phaseNum:o.number,featureNum:u==null?void 0:u.number}),c.jsx("span",{className:"shrink-0",children:c.jsx(Ja,{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(ko,{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 ",s2(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 o2(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 u2({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(tn,{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(Ke,{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(xm,{type:"task",number:u.number}),c.jsx(ko,{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(Ja,{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(ko,{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 ",o2(g)]})]},u.id))})]})}const c2=new Set(["in-progress"]),d2=new Set(["planned","waiting","blocked","deferred"]),f2=new Set(["done","canceled","rejected"]);function r0(t){return t==="discovery"?"in-progress":t==="draft"?"planned":t}function h2(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 m2(){return{planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0}}function l0(t){const a=t,l=h2(a),s=a.length;if(s===0)return{displayStatus:"planned",breakdown:m2(),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=>c2.has(g)))return{displayStatus:"in-progress",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u};if(a.every(g=>f2.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=>d2.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 wm(t){const a=t.map(l=>r0(l.status));return l0(a)}function Em(t){const a=t.map(l=>r0(l.status));return l0(a)}function s0(t){return Em(t)}function i0(t){return wm(t)}const So={key:"priority",direction:"asc"},p2=4200;function g2(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function v2(t){return t.reduce((a,l)=>a+l.tasks.filter(s=>s.status==="done").length,0)}function y2(t){return String(t&&t>0?t:0).padStart(3,"0")}const x2={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 x2[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 Eo(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 b2(t,a,l=So){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(E=>E.status==="done").length,0),p=u.map(x=>{const y=[...x.tasks].sort((w,S)=>Eo(w,S,l.key,l.direction)),E=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:E,display:wm(y)}}),g=p.some(({phase:x,allTasks:y})=>x.status==="in-progress"||x.status==="discovery"||y.some(E=>E.status==="in-progress"));return{feature:o,totalTasks:f,doneTasks:m,allPhases:p.sort((x,y)=>Eo(x.phase,y.phase,l.key,l.direction)),hasActiveTask:p.some(x=>x.hasActiveTask),isActive:g,display:Em(p.map(x=>x.phase))}}).sort((o,u)=>Eo(o.feature,u.feature,l.key,l.direction))}function uc({title:t,value:a,valueSuffix:l,subtitle:s,icon:o,valueClassName:u,iconClassName:f}){return c.jsxs(tn,{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 S2({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 E=l.get(y.id)??[];return Em(E).displayStatus==="done"}).length,o=Math.max(t.length-s,0),u=a.filter(y=>wm(y.tasks).displayStatus==="done").length,f=Math.max(a.length-u,0),m=g2(a),p=v2(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(uc,{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(Cc,{className:"h-4 w-4"})}),c.jsx(uc,{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(gN,{className:"h-4 w-4"})}),c.jsx(uc,{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(Pc,{className:"h-4 w-4"})}),c.jsx(uc,{title:"Completion",value:`${x}%`,subtitle:"Task completion rate",valueClassName:ox(x),iconClassName:ox(x),icon:c.jsx(pm,{className:"h-4 w-4"})})]})}function w2(){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 Wc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mi(t){const a=Object.prototype.toString.call(t);return a==="[object Window]"||a==="[object global]"}function Nm(t){return"nodeType"in t}function pa(t){var a,l;return t?mi(t)?t:Nm(t)&&(a=(l=t.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function Rm(t){const{Document:a}=pa(t);return t instanceof a}function Yo(t){return mi(t)?!1:t instanceof pa(t).HTMLElement}function o0(t){return t instanceof pa(t).SVGElement}function pi(t){return t?mi(t)?t.document:Nm(t)?Rm(t)?t:Yo(t)||o0(t)?t.ownerDocument:document:document:document}const cr=Wc?v.useLayoutEffect:v.useEffect;function ed(t){const a=v.useRef(t);return cr(()=>{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 E2(){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 Oo(t,a){a===void 0&&(a=[t]);const l=v.useRef(t);return cr(()=>{l.current!==t&&(l.current=t)},a),l}function Fo(t,a){const l=v.useRef();return v.useMemo(()=>{const s=t(l.current);return l.current=s,s},[...a])}function kc(t){const a=ed(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 Oc(t){const a=v.useRef();return v.useEffect(()=>{a.current=t},[t]),a.current}let Sh={};function Po(t,a){return v.useMemo(()=>{if(a)return a;const l=Sh[t]==null?0:Sh[t]+1;return Sh[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 ui=u0(1),Mc=u0(-1);function N2(t){return"clientX"in t&&"clientY"in t}function td(t){if(!t)return!1;const{KeyboardEvent:a}=pa(t.target);return a&&t instanceof a}function R2(t){if(!t)return!1;const{TouchEvent:a}=pa(t.target);return a&&t instanceof a}function _c(t){if(R2(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 N2(t)?{x:t.clientX,y:t.clientY}:null}const zl=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[zl.Translate.toString(t),zl.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 j2(t){return t.matches(ux)?t:t.querySelector(ux)}const T2={display:"none"};function C2(t){let{id:a,value:l}=t;return un.createElement("div",{id:a,style:T2},l)}function D2(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 A2(){const[t,a]=v.useState("");return{announce:v.useCallback(s=>{s!=null&&a(s)},[]),announcement:t}}const c0=v.createContext(null);function k2(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 O2(){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 M2={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
+ `},_2={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 L2(t){let{announcements:a=_2,container:l,hiddenTextDescribedById:s,screenReaderInstructions:o=M2}=t;const{announce:u,announcement:f}=A2(),m=Po("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),k2(v.useMemo(()=>({onDragStart(y){let{active:E}=y;u(a.onDragStart({active:E}))},onDragMove(y){let{active:E,over:w}=y;a.onDragMove&&u(a.onDragMove({active:E,over:w}))},onDragOver(y){let{active:E,over:w}=y;u(a.onDragOver({active:E,over:w}))},onDragEnd(y){let{active:E,over:w}=y;u(a.onDragEnd({active:E,over:w}))},onDragCancel(y){let{active:E,over:w}=y;u(a.onDragCancel({active:E,over:w}))}}),[u,a])),!p)return null;const x=un.createElement(un.Fragment,null,un.createElement(C2,{id:s,value:o.draggable}),un.createElement(D2,{id:m,announcement:f}));return l?al.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 Lc(){}function z2(t,a){return v.useMemo(()=>({sensor:t,options:a??{}}),[t,a])}function U2(){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 dr=Object.freeze({x:0,y:0});function B2(t,a){return Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))}function H2(t,a){const l=_c(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 $2(t,a){let{data:{value:l}}=t,{data:{value:s}}=a;return l-s}function q2(t,a){let{data:{value:l}}=t,{data:{value:s}}=a;return s-l}function I2(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 V2=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=B2(cx(p),o);u.push({id:m,data:{droppableContainer:f,value:g}})}}return u.sort($2)};function Y2(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 F2=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=Y2(m,a);p>0&&o.push({id:f,data:{droppableContainer:u,value:p}})}}return o.sort(q2)};function P2(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}:dr}function G2(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 X2=G2(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 Q2(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 K2={ignoreTransform:!1};function gi(t,a){a===void 0&&(a=K2);let l=t.getBoundingClientRect();if(a.ignoreTransform){const{transform:g,transformOrigin:x}=pa(t).getComputedStyle(t);g&&(l=Q2(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 gi(t,{ignoreTransform:!0})}function Z2(t){const a=t.innerWidth,l=t.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function J2(t,a){return a===void 0&&(a=pa(t).getComputedStyle(t)),a.position==="fixed"}function W2(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 jm(t,a){const l=[];function s(o){if(a!=null&&l.length>=a||!o)return l;if(Rm(o)&&o.scrollingElement!=null&&!l.includes(o.scrollingElement))return l.push(o.scrollingElement),l;if(!Yo(o)||o0(o)||l.includes(o))return l;const u=pa(t).getComputedStyle(o);return o!==t&&W2(o,u)&&l.push(o),J2(o,u)?l:s(o.parentNode)}return t?s(t):l}function h0(t){const[a]=jm(t,1);return a??null}function wh(t){return!Wc||!t?null:mi(t)?t:Nm(t)?Rm(t)||t===pi(t).scrollingElement?window:Yo(t)?t:null:null}function m0(t){return mi(t)?t.scrollX:t.scrollLeft}function p0(t){return mi(t)?t.scrollY:t.scrollTop}function Ph(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!Wc||!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 ej={x:.2,y:.2};function tj(t,a,l,s,o){let{top:u,left:f,right:m,bottom:p}=l;s===void 0&&(s=10),o===void 0&&(o=ej);const{isTop:g,isBottom:x,isLeft:y,isRight:E}=v0(t),w={x:0,y:0},S={x:0,y:0},D={height:a.height*o.y,width:a.width*o.x};return!g&&u<=a.top+D.height?(w.y=Vn.Backward,S.y=s*Math.abs((a.top+D.height-u)/D.height)):!x&&p>=a.bottom-D.height&&(w.y=Vn.Forward,S.y=s*Math.abs((a.bottom-D.height-p)/D.height)),!E&&m>=a.right-D.width?(w.x=Vn.Forward,S.x=s*Math.abs((a.right-D.width-m)/D.width)):!y&&f<=a.left+D.width&&(w.x=Vn.Backward,S.x=s*Math.abs((a.left+D.width-f)/D.width)),{direction:w,speed:S}}function nj(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)=>ui(a,Ph(l)),dr)}function aj(t){return t.reduce((a,l)=>a+m0(l),0)}function rj(t){return t.reduce((a,l)=>a+p0(l),0)}function x0(t,a){if(a===void 0&&(a=gi),!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 lj=[["x",["left","right"],aj],["y",["top","bottom"],rj]];class Tm{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=jm(l),o=y0(s);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,m]of lj)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 No{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 sj(t){const{EventTarget:a}=pa(t);return t instanceof a?t:pi(t)}function Eh(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 ij(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]},oj=(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 No(pi(l)),this.windowListeners=new No(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(dr)}handleKeyDown(a){if(td(a)){const{active:l,context:s,options:o}=this.props,{keyboardCodes:u=b0,coordinateGetter:f=oj,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}:dr;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:s.current,currentCoordinates:x});if(y){const E=Mc(y,x),w={x:0,y:0},{scrollableAncestors:S}=s.current;for(const D of S){const R=a.code,{isTop:L,isRight:I,isLeft:q,isBottom:X,maxScroll:W,minScroll:ne}=v0(D),z=nj(D),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=D.scrollLeft+E.x,ye=R===Mt.Right&&be<=W.x||R===Mt.Left&&be>=ne.x;if(ye&&!E.y){D.scrollTo({left:be,behavior:m});return}ye?w.x=D.scrollLeft-be:w.x=R===Mt.Right?D.scrollLeft-W.x:D.scrollLeft-ne.x,w.x&&D.scrollBy({left:-w.x,behavior:m});break}else if(fe&&T.y!==y.y){const be=D.scrollTop+E.y,ye=R===Mt.Down&&be<=W.y||R===Mt.Up&&be>=ne.y;if(ye&&!E.x){D.scrollTo({top:be,behavior:m});return}ye?w.y=D.scrollTop-be:w.y=R===Mt.Down?D.scrollTop-W.y:D.scrollTop-ne.y,w.y&&D.scrollBy({top:-w.y,behavior:m});break}}this.handleMove(a,ui(Mc(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 Cm{constructor(a,l,s){var o;s===void 0&&(s=sj(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=pi(f),this.documentListeners=new No(this.document),this.listeners=new No(s),this.windowListeners=new No(pa(f)),this.initialCoordinates=(o=_c(u))!=null?o:dr,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,ij,{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=_c(a))!=null?l:dr,g=Mc(o,p);if(!s&&m){if(hx(m)){if(m.tolerance!=null&&Eh(g,m.tolerance))return this.handleCancel();if(Eh(g,m.distance))return this.handleStart()}if(mx(m)&&Eh(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 uj={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dm extends Cm{constructor(a){const{event:l}=a,s=pi(l.target);super(a,uj,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 cj={move:{name:"mousemove"},end:{name:"mouseup"}};var Gh;(function(t){t[t.RightClick=2]="RightClick"})(Gh||(Gh={}));class dj extends Cm{constructor(a){super(a,cj,pi(a.event.target))}}dj.activators=[{eventName:"onMouseDown",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:s}=a;return l.button===Gh.RightClick?!1:(s==null||s({event:l}),!0)}}];const Nh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class fj extends Cm{constructor(a){super(a,Nh)}static setup(){return window.addEventListener(Nh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Nh.move.name,a)};function a(){}}}fj.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 Ro;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Ro||(Ro={}));var zc;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(zc||(zc={}));function hj(t){let{acceleration:a,activator:l=Ro.Pointer,canScroll:s,draggingRect:o,enabled:u,interval:f=5,order:m=zc.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:y,threshold:E}=t;const w=pj({delta:y,disabled:!u}),[S,D]=E2(),R=v.useRef({x:0,y:0}),L=v.useRef({x:0,y:0}),I=v.useMemo(()=>{switch(l){case Ro.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case Ro.DraggableRect:return o}},[l,o,p]),q=v.useRef(null),X=v.useCallback(()=>{const ne=q.current;if(!ne)return;const z=R.current.x*L.current.x,T=R.current.y*L.current.y;ne.scrollBy(z,T)},[]),W=v.useMemo(()=>m===zc.TreeOrder?[...g].reverse():g,[m,g]);v.useEffect(()=>{if(!u||!g.length||!I){D();return}for(const ne of W){if((s==null?void 0:s(ne))===!1)continue;const z=g.indexOf(ne),T=x[z];if(!T)continue;const{direction:ee,speed:fe}=tj(ne,T,I,a,E);for(const be of["x","y"])w[be][ee[be]]||(fe[be]=0,ee[be]=0);if(fe.x>0||fe.y>0){D(),q.current=ne,S(X,f),R.current=fe,L.current=ee;return}}R.current={x:0,y:0},L.current={x:0,y:0},D()},[a,X,s,D,u,f,JSON.stringify(I),JSON.stringify(w),S,g,W,x,JSON.stringify(E)])}const mj={x:{[Vn.Backward]:!1,[Vn.Forward]:!1},y:{[Vn.Backward]:!1,[Vn.Forward]:!1}};function pj(t){let{delta:a,disabled:l}=t;const s=Oc(a);return Fo(o=>{if(l||!s||!o)return mj;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 gj(t,a){const l=a!=null?t.get(a):void 0,s=l?l.node.current:null;return Fo(o=>{var u;return a==null?null:(u=s??o)!=null?u:null},[s,a])}function vj(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 Mo;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Mo||(Mo={}));var Xh;(function(t){t.Optimized="optimized"})(Xh||(Xh={}));const px=new Map;function yj(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(),E=Oo(y),w=v.useCallback(function(L){L===void 0&&(L=[]),!E.current&&f(I=>I===null?L:I.concat(L.filter(q=>!I.includes(q))))},[E]),S=v.useRef(null),D=Fo(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 Tm(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:D,measureDroppableContainers:w,measuringScheduled:u!=null};function R(){switch(g){case Mo.Always:return!1;case Mo.BeforeDragging:return l;default:return!l}}}function Am(t,a){return Fo(l=>t?l||(typeof a=="function"?a(t):t):null,[a,t])}function xj(t,a){return Am(t,a)}function bj(t){let{callback:a,disabled:l}=t;const s=ed(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 nd(t){let{callback:a,disabled:l}=t;const s=ed(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 Sj(t){return new Tm(gi(t),t)}function gx(t,a,l){a===void 0&&(a=Sj);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=bj({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=nd({callback:u});return cr(()=>{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 wj(t){const a=Am(t);return d0(t,a)}const vx=[];function Ej(t){const a=v.useRef(t),l=Fo(s=>t?s&&s!==vx&&t&&a.current&&t.parentNode===a.current.parentNode?s:jm(t):vx,[t]);return v.useEffect(()=>{a.current=t},[t]),l}function Nj(t){const[a,l]=v.useState(null),s=v.useRef(t),o=v.useCallback(u=>{const f=wh(u.target);f&&l(m=>m?(m.set(f,Ph(f)),new Map(m)):null)},[]);return v.useEffect(()=>{const u=s.current;if(t!==u){f(u);const m=t.map(p=>{const g=wh(p);return g?(g.addEventListener("scroll",o,{passive:!0}),[g,Ph(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=wh(p);g==null||g.removeEventListener("scroll",o)})}},[o,t]),v.useMemo(()=>t.length?a?Array.from(a.values()).reduce((u,f)=>ui(u,f),dr):y0(t):dr,[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!==dr;s&&!l.current&&(l.current=t),!s&&l.current&&(l.current=null)},[t]),l.current?Mc(t,l.current):dr}function Rj(t){v.useEffect(()=>{if(!Wc)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 jj(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?Z2(t):null,[t])}const xx=[];function Tj(t,a){a===void 0&&(a=gi);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 Tm(a(p),p)):xx)}const m=nd({callback:f});return cr(()=>{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 Yo(a)?a:t}function Cj(t){let{measure:a}=t;const[l,s]=v.useState(null),o=v.useCallback(g=>{for(const{target:x}of g)if(Yo(x)){s(y=>{const E=a(x);return y?{...y,width:E.width,height:E.height}:E});break}},[a]),u=nd({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]=kc(f);return v.useMemo(()=>({nodeRef:m,rect:l,setRef:p}),[l,m,p])}const Dj=[{sensor:Dm,options:{}},{sensor:S0,options:{}}],Aj={current:{}},wc={draggable:{measure:dx},droppable:{measure:dx,strategy:Mo.WhileDragging,frequency:Xh.Optimized},dragOverlay:{measure:gi}};class jo 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 kj={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Lc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:wc,measureDroppableContainers:Lc,windowRect:null,measuringScheduled:!1},N0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Lc,draggableNodes:new Map,over:null,measureDroppableContainers:Lc},Go=v.createContext(N0),R0=v.createContext(kj);function Oj(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jo}}}function Mj(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 jo(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 jo(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 jo(t.droppable.containers);return u.delete(l),{...t,droppable:{...t.droppable,containers:u}}}default:return t}}function _j(t){let{disabled:a}=t;const{active:l,activatorEvent:s,draggableNodes:o}=v.useContext(Go),u=Oc(s),f=Oc(l==null?void 0:l.id);return v.useEffect(()=>{if(!a&&!s&&u&&f!=null){if(!td(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=j2(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 Lj(t){return v.useMemo(()=>({draggable:{...wc.draggable,...t==null?void 0:t.draggable},droppable:{...wc.droppable,...t==null?void 0:t.droppable},dragOverlay:{...wc.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 zj(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;cr(()=>{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 E=h0(g);E&&E.scrollBy({top:y.y,left:y.x})}},[a,f,m,s,l])}const ad=v.createContext({...dr,scaleX:1,scaleY:1});var Ol;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ol||(Ol={}));const Uj=v.memo(function(a){var l,s,o,u;let{id:f,accessibility:m,autoScroll:p=!0,children:g,sensors:x=Dj,collisionDetection:y=F2,measuring:E,modifiers:w,...S}=a;const D=v.useReducer(Mj,void 0,Oj),[R,L]=D,[I,q]=O2(),[X,W]=v.useState(Ol.Uninitialized),ne=X===Ol.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}),ae=v.useMemo(()=>{var yt;return z!=null?{id:z,data:(yt=be==null?void 0:be.data)!=null?yt:Aj,rect:ye}:null},[z,be]),re=v.useRef(null),[ge,U]=v.useState(null),[B,ue]=v.useState(null),de=Oo(S,Object.values(S)),we=Po("DndDescribedBy",f),C=v.useMemo(()=>fe.getEnabled(),[fe]),V=Lj(E),{droppableRects:te,measureDroppableContainers:me,measuringScheduled:Ne}=yj(C,{dragging:ne,dependencies:[ee.x,ee.y],config:V.droppable}),je=gj(T,z),ze=v.useMemo(()=>B?_c(B):null,[B]),ut=vt(),Pe=xj(je,V.draggable.measure);zj({activeNode:z!=null?T.get(z):null,config:ut.layoutShiftCompensation,initialRect:Pe,measure:V.draggable.measure});const nt=gx(je,V.draggable.measure,Pe),bn=gx(je?je.parentElement:null),Pt=v.useRef({activatorEvent:null,active:null,activeNode:je,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:fe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ft=fe.getNodeFor((l=Pt.current.over)==null?void 0:l.id),oe=Cj({measure:V.dragOverlay.measure}),$e=(s=oe.nodeRef.current)!=null?s:je,at=ne?(o=oe.rect)!=null?o:nt:null,Ut=!!(oe.nodeRef.current&&oe.rect),pn=wj(Ut?null:nt),jt=w0($e?pa($e):null),_t=Ej(ne?ft??je:null),Gt=Tj(_t),Hn=j0(w,{transform:{x:ee.x-pn.x,y:ee.y-pn.y,scaleX:1,scaleY:1},activatorEvent:B,active:ae,activeNodeRect:nt,containerNodeRect:bn,draggingNodeRect:at,over:Pt.current.over,overlayNodeRect:oe.rect,scrollableAncestors:_t,scrollableAncestorRects:Gt,windowRect:jt}),$n=ze?ui(ze,ee):null,en=Nj(_t),ca=yx(en),da=yx(en,[nt]),Wn=ui(Hn,ca),qn=at?X2(at,Hn):null,he=ae&&qn?y({active:ae,collisionRect:qn,droppableRects:te,droppableContainers:C,pointerCoordinates:$n}):null,Ce=I2(he,"id"),[De,Fe]=v.useState(null),qe=Ut?Hn:ui(Hn,da),Z=P2(qe,(u=De==null?void 0:De.rect)!=null?u:null,nt),Tt=v.useRef(null),Xt=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 Qt=yt.nativeEvent,Ht=new Bt({active:re.current,activeNode:nn,event:Qt,options:Ct,context:Pt,onAbort(Je){if(!T.get(Je))return;const{onDragAbort:kn}=de.current,A={id:Je};kn==null||kn(A),I({type:"onDragAbort",event:A})},onPending(Je,Sn,kn,A){if(!T.get(Je))return;const{onDragPending:$}=de.current,K={id:Je,constraint:Sn,initialCoordinates:kn,offset:A};$==null||$(K),I({type:"onDragPending",event:K})},onStart(Je){const Sn=re.current;if(Sn==null)return;const kn=T.get(Sn);if(!kn)return;const{onDragStart:A}=de.current,M={activatorEvent:Qt,active:{id:Sn,data:kn.data,rect:ye}};al.unstable_batchedUpdates(()=>{A==null||A(M),W(Ol.Initializing),L({type:Un.DragStart,initialCoordinates:Je,active:Sn}),I({type:"onDragStart",event:M}),U(Tt.current),ue(Qt)})},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:A,over:M,scrollAdjustedTranslate:$}=Pt.current;let K=null;if(kn&&$){const{cancelDrop:se}=de.current;K={activatorEvent:Qt,active:kn,collisions:A,delta:$,over:M},Je===Un.DragEnd&&typeof se=="function"&&await Promise.resolve(se(K))&&(Je=Un.DragCancel)}re.current=null,al.unstable_batchedUpdates(()=>{L({type:Je}),W(Ol.Uninitialized),Fe(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,Qt=T.get(Ct);if(re.current!==null||!Qt||nn.dndKit||nn.defaultPrevented)return;const Ht={active:Qt};yt(Bt,St.options,Ht)===!0&&(nn.dndKit={capturedBy:St.sensor},re.current=Ct,Xt(Bt,St))},[T,Xt]),gn=vj(x,Yn);Rj(x),cr(()=>{nt&&X===Ol.Initializing&&W(Ol.Initialized)},[nt,X]),v.useEffect(()=>{const{onDragMove:yt}=de.current,{active:St,activatorEvent:Bt,collisions:Ct,over:nn}=Pt.current;if(!St||!Bt)return;const Qt={active:St,activatorEvent:Bt,collisions:Ct,delta:{x:Wn.x,y:Wn.y},over:nn};al.unstable_batchedUpdates(()=>{yt==null||yt(Qt),I({type:"onDragMove",event:Qt})})},[Wn.x,Wn.y]),v.useEffect(()=>{const{active:yt,activatorEvent:St,collisions:Bt,droppableContainers:Ct,scrollAdjustedTranslate:nn}=Pt.current;if(!yt||re.current==null||!St||!nn)return;const{onDragOver:Qt}=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};al.unstable_batchedUpdates(()=>{Fe(ht),Qt==null||Qt(Je),I({type:"onDragOver",event:Je})})},[Ce]),cr(()=>{Pt.current={activatorEvent:B,active:ae,activeNode:je,collisionRect:qn,collisions:he,droppableRects:te,draggableNodes:T,draggingNode:$e,draggingNodeRect:at,droppableContainers:fe,over:De,scrollableAncestors:_t,scrollAdjustedTranslate:Wn},ye.current={initial:at,translated:qn}},[ae,je,he,qn,T,$e,at,te,fe,De,_t,Wn]),hj({...ut,delta:ee,draggingRect:qn,pointerCoordinates:$n,scrollableAncestors:_t,scrollableAncestorRects:Gt});const Ba=v.useMemo(()=>({active:ae,activeNode:je,activeNodeRect:nt,activatorEvent:B,collisions:he,containerNodeRect:bn,dragOverlay:oe,draggableNodes:T,droppableContainers:fe,droppableRects:te,over:De,measureDroppableContainers:me,scrollableAncestors:_t,scrollableAncestorRects:Gt,measuringConfiguration:V,measuringScheduled:Ne,windowRect:jt}),[ae,je,nt,B,he,bn,oe,T,fe,te,De,me,_t,Gt,V,Ne,jt]),Me=v.useMemo(()=>({activatorEvent:B,activators:gn,active:ae,activeNodeRect:nt,ariaDescribedById:{draggable:we},dispatch:L,draggableNodes:T,over:De,measureDroppableContainers:me}),[B,gn,ae,nt,L,we,T,De,me]);return un.createElement(c0.Provider,{value:q},un.createElement(Go.Provider,{value:Me},un.createElement(R0.Provider,{value:Ba},un.createElement(ad.Provider,{value:Z},g)),un.createElement(_j,{disabled:(m==null?void 0:m.restoreFocus)===!1})),un.createElement(L2,{...m,hiddenTextDescribedById:we}));function vt(){const yt=(ge==null?void 0:ge.autoScrollEnabled)===!1,St=typeof p=="object"?p.enabled===!1:p===!1,Bt=ne&&!yt&&!St;return typeof p=="object"?{...p,enabled:Bt}:{enabled:Bt}}}),Bj=v.createContext(null),bx="button",Hj="Draggable";function $j(t){let{id:a,data:l,disabled:s=!1,attributes:o}=t;const u=Po(Hj),{activators:f,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:y,over:E}=v.useContext(Go),{role:w=bx,roleDescription:S="draggable",tabIndex:D=0}=o??{},R=(p==null?void 0:p.id)===a,L=v.useContext(R?ad:Bj),[I,q]=kc(),[X,W]=kc(),ne=jj(f,a),z=Oo(l);cr(()=>(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:D,"aria-disabled":s,"aria-pressed":R&&w===bx?!0:void 0,"aria-roledescription":S,"aria-describedby":x.draggable}),[s,w,D,R,S,x.draggable]);return{active:p,activatorEvent:m,activeNodeRect:g,attributes:T,isDragging:R,listeners:s?void 0:ne,node:I,over:E,setNodeRef:q,setActivatorNodeRef:W,transform:L}}function T0(){return v.useContext(R0)}const qj="Droppable",Ij={timeout:25};function Vj(t){let{data:a,disabled:l=!1,id:s,resizeObserverConfig:o}=t;const u=Po(qj),{active:f,dispatch:m,over:p,measureDroppableContainers:g}=v.useContext(Go),x=v.useRef({disabled:l}),y=v.useRef(!1),E=v.useRef(null),w=v.useRef(null),{disabled:S,updateMeasurementsFor:D,timeout:R}={...Ij,...o},L=Oo(D??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=nd({callback:I,disabled:S||!f}),X=v.useCallback((T,ee)=>{q&&(ee&&(q.unobserve(ee),y.current=!1),T&&q.observe(T))},[q]),[W,ne]=kc(X),z=Oo(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:E,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:E,isOver:(p==null?void 0:p.id)===s,node:W,over:p,setNodeRef:ne}}function Yj(t){let{animation:a,children:l}=t;const[s,o]=v.useState(null),[u,f]=v.useState(null),m=Oc(l);return!l&&!s&&m&&o(m),cr(()=>{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 Fj={x:0,y:0,scaleX:1,scaleY:1};function Pj(t){let{children:a}=t;return un.createElement(Go.Provider,{value:N0},un.createElement(ad.Provider,{value:Fj},a))}const Gj={position:"fixed",touchAction:"none"},Xj=t=>td(t)?"transform 250ms ease":void 0,Qj=v.forwardRef((t,a)=>{let{as:l,activatorEvent:s,adjustScale:o,children:u,className:f,rect:m,style:p,transform:g,transition:x=Xj}=t;if(!m)return null;const y=o?g:{...g,scaleX:1,scaleY:1},E={...Gj,width:m.width,height:m.height,top:m.top,left:m.left,transform:zl.Transform.toString(y),transformOrigin:o&&s?H2(s,m):void 0,transition:typeof x=="function"?x(s):x,...p};return un.createElement(l,{className:f,style:E,ref:a},u)}),Kj=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)}},Zj=t=>{let{transform:{initial:a,final:l}}=t;return[{transform:zl.Transform.toString(a)},{transform:zl.Transform.toString(l)}]},Jj={duration:250,easing:"ease",keyframes:Zj,sideEffects:Kj({styles:{active:{opacity:"0"}}})};function Wj(t){let{config:a,draggableNodes:l,droppableContainers:s,measuringConfiguration:o}=t;return ed((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 E=typeof a=="function"?a:eT(a);return x0(p,o.draggable.measure),E({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 eT(t){const{duration:a,easing:l,sideEffects:s,keyframes:o}={...Jj,...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},E={x:p.x-x.x,y:p.y-x.y,...y},w=o({...g,active:f,dragOverlay:m,transform:{initial:p,final:E}}),[S]=w,D=w[w.length-1];if(JSON.stringify(S)===JSON.stringify(D))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 tT(t){return v.useMemo(()=>{if(t!=null)return Sx++,Sx},[t])}const nT=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:E,containerNodeRect:w,draggableNodes:S,droppableContainers:D,dragOverlay:R,over:L,measuringConfiguration:I,scrollableAncestors:q,scrollableAncestorRects:X,windowRect:W}=T0(),ne=v.useContext(ad),z=tT(y==null?void 0:y.id),T=j0(f,{activatorEvent:x,active:y,activeNodeRect:E,containerNodeRect:w,draggingNodeRect:R.rect,over:L,overlayNodeRect:R.rect,scrollableAncestors:q,scrollableAncestorRects:X,transform:ne,windowRect:W}),ee=Am(E),fe=Wj({config:s,draggableNodes:S,droppableContainers:D,measuringConfiguration:I}),be=ee?R.setRef:void 0;return un.createElement(Pj,null,un.createElement(Yj,{animation:fe},y&&z?un.createElement(Qj,{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 To(t,a,l){const s=t.slice();return s.splice(l<0?s.length+l:l,0,s.splice(a,1)[0]),s}function aT(t,a){return t.reduce((l,s,o)=>{const u=a.get(s);return u&&(l[o]=u),l},Array(t.length))}function cc(t){return t!==null&&t>=0}function rT(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 lT(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=To(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}},dc={scaleX:1,scaleY:1},km=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,...dc}:null}const p=sT(u,o,l);return o>l&&o<=f?{x:0,y:-m.height-p,...dc}:o<l&&o>=f?{x:0,y:m.height+p,...dc}:{x:0,y:0,...dc}};function sT(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 D0="Sortable",A0=un.createContext({activeIndex:-1,containerId:D0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:C0,disabled:{draggable:!1,droppable:!1}});function Om(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=Po(D0,l),E=m.rect!==null,w=v.useMemo(()=>s.map(ne=>typeof ne=="object"&&"id"in ne?ne.id:ne),[s]),S=f!=null,D=f?w.indexOf(f.id):-1,R=g?w.indexOf(g.id):-1,L=v.useRef(w),I=!rT(w,L.current),q=R!==-1&&D===-1||I,X=lT(u);cr(()=>{I&&S&&x(w)},[I,w,S,x]),v.useEffect(()=>{L.current=w},[w]);const W=v.useMemo(()=>({activeIndex:D,containerId:y,disabled:X,disableTransforms:q,items:w,overIndex:R,useDragOverlay:E,sortedRects:aT(w,p),strategy:o}),[D,y,X.draggable,X.droppable,q,w,R,p,E,o]);return un.createElement(A0.Provider,{value:W},a)}const iT=t=>{let{id:a,items:l,activeIndex:s,overIndex:o}=t;return To(l,s,o).indexOf(a)},oT=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},uT={duration:200,easing:"ease"},k0="transform",cT=zl.Transition.toString({property:k0,duration:0,easing:"linear"}),dT={roleDescription:"sortable"};function fT(t){let{disabled:a,index:l,node:s,rect:o}=t;const[u,f]=v.useState(null),m=v.useRef(l);return cr(()=>{if(!a&&l!==m.current&&s.current){const p=o.current;if(p){const g=gi(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 hT(t){let{animateLayoutChanges:a=oT,attributes:l,disabled:s,data:o,getNewIndex:u=iT,id:f,strategy:m,resizeObserverConfig:p,transition:g=uT}=t;const{items:x,containerId:y,activeIndex:E,disabled:w,disableTransforms:S,sortedRects:D,overIndex:R,useDragOverlay:L,strategy:I}=v.useContext(A0),q=mT(s,w),X=x.indexOf(f),W=v.useMemo(()=>({sortable:{containerId:y,index:X,items:x},...o}),[y,o,X,x]),ne=v.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:z,node:T,isOver:ee,setNodeRef:fe}=Vj({id:f,data:W,disabled:q.droppable,resizeObserverConfig:{updateMeasurementsFor:ne,...p}}),{active:be,activatorEvent:ye,activeNodeRect:ae,attributes:re,setNodeRef:ge,listeners:U,isDragging:B,over:ue,setActivatorNodeRef:de,transform:we}=$j({id:f,data:W,attributes:{...dT,...l},disabled:q.draggable}),C=w2(fe,ge),V=!!be,te=V&&!S&&cc(E)&&cc(R),me=!L&&B,Ne=me&&te?we:null,ze=te?Ne??(m??I)({rects:D,activeNodeRect:ae,activeIndex:E,overIndex:R,index:X}):null,ut=cc(E)&&cc(R)?u({id:f,items:x,activeIndex:E,overIndex:R}):X,Pe=be==null?void 0:be.id,nt=v.useRef({activeId:Pe,items:x,newIndex:ut,containerId:y}),bn=x!==nt.current.items,Pt=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=fT({disabled:!Pt,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(Pe===nt.current.activeId)return;if(Pe!=null&&nt.current.activeId==null){nt.current.activeId=Pe;return}const $e=setTimeout(()=>{nt.current.activeId=Pe},50);return()=>clearTimeout($e)},[Pe]),{active:be,activeIndex:E,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||bn&&nt.current.newIndex===X)return cT;if(!(me&&!td(ye)||!g)&&(V||Pt))return zl.Transition.toString({...g,property:k0})}}function mT(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 pT=[{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 Mm({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:pT.map(s=>c.jsx("option",{value:s.value,children:s.label},s.value))}),c.jsx(ps,{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(hN,{className:"h-3.5 w-3.5","aria-hidden":"true"}):c.jsx(cN,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})}const rd=[{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"}],ld=[{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"}],Xo=[{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"}],_m=[{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"}],ho=rd.map(t=>t.value),mo=ld.map(t=>t.value),po=Xo.map(t=>t.value);function Rh(t,a,l){if(t.includes(a)){const s=t.filter(o=>o!==a);return s.length===0?[...l]:s}return[...t,a]}function Js(t,a){return a.includes(t)}function or(t,a){return`agent-plan:dashboard:${t}:${a}`}function jh(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 Th(t,a,l){typeof window>"u"||(window.localStorage.setItem(t,JSON.stringify(a)),window.localStorage.setItem(`${t}-schema`,l.slice().sort().join(",")))}function Ch(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 O0(t){return t.split(",").map(a=>a.trim()).filter(a=>a.length>0)}function gT(t){return new Set(O0(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 Dh(t,a){const l=t??new Set;for(const s of gT(a))l.add(s);return l}function vT(t,a){const l=t??new Set;for(const s of O0(a).map(o=>o.toUpperCase()))l.add(s);return l}function yT(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=Dh(l.featureNumbers,x);y.size&&(l.featureNumbers=y)}else if(g==="phase"){const y=Dh(l.phaseNumbers,x);y.size&&(l.phaseNumbers=y)}else if(g==="task"){const y=Dh(l.taskNumbers,x);y.size&&(l.taskNumbers=y)}else if(g==="id"){const y=vT(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 xT(t){return!!(t.featureNumbers||t.phaseNumbers||t.taskNumbers||t.shortIds||t.status||t.featureStatus||t.phaseStatus||t.text)}function M0(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 bT(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??M0(a)).includes(s))return!1}return!0}function ST({features:t,phases:a,projectStorageScope:l}){const s=or(l,"show-all-features"),o=or(l,"tree-open-mode"),u=or(l,"expanded-features"),f=or(l,"expanded-phases"),m=or(l,"feature-status-filters"),p=or(l,"phase-status-filters"),g=or(l,"task-status-filters"),x=or(l,"hide-done"),y=or(l,"hide-planned"),E=or(l,"only-active-branches"),w=or(l,"work-tree-sort"),[S,D]=v.useState(""),[R,L]=v.useState(()=>{if(typeof window>"u")return So;try{const he=window.localStorage.getItem(w);if(!he)return So;const Ce=JSON.parse(he);if(Ce.key&&Ce.direction)return{key:Ce.key,direction:Ce.direction}}catch{}return So}),I=v.useMemo(()=>b2(t,a,R),[t,a,R]),q=v.useMemo(()=>yT(S),[S]),X=xT(q),W=v.useMemo(()=>{if(!X||!q.text)return null;const he=new Map;for(const Ce of I)for(const De of Ce.allPhases)for(const Fe of De.allTasks)he.set(Fe.id,M0({feature:Ce.feature,phase:De.phase,task:Fe}));return he},[X,q.text,I]),{matchedTaskIds:ne,matchedFeatureIds:z,matchedPhaseIds:T}=v.useMemo(()=>{const he=new Set,Ce=new Set,De=new Set;if(!X)return{matchedTaskIds:he,matchedFeatureIds:Ce,matchedPhaseIds:De};for(const Fe of I)for(const qe of Fe.allPhases)for(const Z of qe.allTasks)bT(q,{feature:Fe.feature,phase:qe.phase,task:Z},W==null?void 0:W.get(Z.id))&&(he.add(Z.id),Ce.add(Fe.feature.id),De.add(qe.phase.id));return{matchedTaskIds:he,matchedFeatureIds:Ce,matchedPhaseIds:De}},[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"}),[ae,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(()=>jh(m,ho,ho)),[de,we]=v.useState(()=>jh(p,mo,mo)),[C,V]=v.useState(()=>jh(g,po,po)),[te,me]=v.useState(()=>Ch(x,!1)),[Ne,je]=v.useState(()=>Ch(y,!1)),[ze,ut]=v.useState(()=>Ch(E,!1)),[Pe,nt]=v.useState([]),[bn,Pt]=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(ae))},[ae,u]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(f,JSON.stringify(ge))},[ge,f]),v.useEffect(()=>{typeof window>"u"||Th(m,B,ho)},[B,m]),v.useEffect(()=>{typeof window>"u"||Th(p,de,mo)},[de,p]),v.useEffect(()=>{typeof window>"u"||Th(g,C,po)},[C,g]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(x,String(te))},[te,x]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(y,String(Ne))},[Ne,y]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(E,String(ze))},[ze,E]),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 te&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned")),he},[B,te,Ne]),Ut=v.useMemo(()=>{let he=[...de];return te&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned"&&Ce!=="draft")),he},[de,te,Ne]),pn=v.useMemo(()=>{let he=[...C];return te&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned")),he},[C,te,Ne]),jt=v.useMemo(()=>{if(X)return I.filter(De=>Js(De.feature.status,at)).map(De=>({...De,allPhases:De.allPhases.filter(Fe=>Js(Fe.phase.status,Ut)).map(Fe=>({...Fe,allTasks:Fe.allTasks.filter(qe=>ne.has(qe.id)&&Js(qe.status,pn))})).filter(Fe=>Fe.allTasks.length>0)})).filter(De=>De.allPhases.length>0);const he=!ee||ze;return(ee?I:I.filter(De=>De.isActive)).filter(({feature:De})=>Js(De.status,at)).map(De=>({...De,allPhases:De.allPhases.filter(({phase:Fe,hasActiveTask:qe})=>Js(Fe.status,Ut)?he?Fe.status==="in-progress"||Fe.status==="discovery"||qe:!0:!1).map(Fe=>({...Fe,allTasks:Fe.allTasks.filter(qe=>!!Js(qe.status,pn))})).filter(Fe=>Fe.allTasks.length>0||ee||!he)})).filter(({hasActiveTask:De,allPhases:Fe})=>he?De||Fe.some(qe=>qe.hasActiveTask):Fe.length>0||ee)},[X,ne,I,at,Ut,pn,ze,ee]);v.useEffect(()=>{if(be==="none"){re([]),U([]);return}if(be==="all"){re(jt.filter(({feature:De})=>De.status!=="done").map(({feature:De})=>De.id)),U(jt.flatMap(({allPhases:De})=>De.map(({phase:Fe})=>Fe.id)));return}const he=new Set(jt.map(({feature:De})=>De.id)),Ce=new Set(jt.flatMap(({allPhases:De})=>De.map(({phase:Fe})=>Fe.id)));re(De=>De.filter(Fe=>he.has(Fe))),U(De=>De.filter(Fe=>Ce.has(Fe)))},[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(De=>De!==he):[...Ce,he])},Gt=he=>{ye("smart"),U(Ce=>Ce.includes(he)?Ce.filter(De=>De!==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([])},en=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 De=Array.from(he).every(qe=>ae.includes(qe)),Fe=Array.from(Ce).every(qe=>ge.includes(qe));return De&&Fe},[jt,ae,ge]);return v.useEffect(()=>{const he=(De,Fe)=>{const qe=Fe.filter(Z=>!!Z);for(const Z of qe){const Tt=`${De}:${Z}`,Xt=De==="feature"?nt:De==="phase"?Pt:oe;Xt(Yn=>Yn.includes(Z)?Yn:[...Yn,Z]),$e.current[Tt]!==void 0&&window.clearTimeout($e.current[Tt]),$e.current[Tt]=window.setTimeout(()=>{Xt(Yn=>Yn.filter(gn=>gn!==Z)),delete $e.current[Tt]},p2)}},Ce=De=>{var Z,Tt,Xt,Yn,gn,Ba;const qe=De.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=(Xt=qe.data)==null?void 0:Xt.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:en,expandedFeatureIds:ae,expandedPhaseIds:ge,setExpandedFeatureIds:re,setExpandedPhaseIds:U,toggleExpandedFeature:_t,toggleExpandedPhase:Gt,recentFeatureIds:Pe,recentPhaseIds:bn,recentTaskIds:ft,setRecentTaskIds:oe,showAllFeatures:ee,setShowAllFeatures:fe,featureStatusFilters:B,phaseStatusFilters:de,taskStatusFilters:C,hideDone:te,setHideDone:me,hidePlanned:Ne,setHidePlanned:je,onlyActiveBranches:ze,setOnlyActiveBranches:ut,resetFilters:()=>{D(""),fe(!0),me(!1),je(!1),ue(ho),we(mo),V(po),ut(!1),L(So),ye("all")},toggleFeatureStatusFilter:he=>ue(Ce=>Rh(Ce,he,ho)),togglePhaseStatusFilter:he=>we(Ce=>Rh(Ce,he,mo)),toggleTaskStatusFilter:he=>V(Ce=>Rh(Ce,he,po)),searchQuery:S,setSearchQuery:D,searchActive:X,matchedTaskIds:ne,matchedFeatureIds:z,matchedPhaseIds:T,sort:R,setSort:L}}function vi({id:t,status:a,variant:l="header",className:s,children:o,ariaLabel:u}){const f=l==="surface"?n2(a):a2(a),m=Sm(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})}const _0=v.createContext(null);function Lm({id:t,children:a}){const l=hT({id:t}),s={transform:zl.Transform.toString(l.transform),transition:l.transition};return c.jsx(_0.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(_0);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($N,{className:"h-4 w-4"})}):null}const Um="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function wT(){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(wT,{}):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(Ja,{status:t})})]})}function ET({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:E,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(vi,{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(zb,{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(Tr,{featureNum:g.number,featureId:g.id}),c.jsx(rl,{id:gs({featureNum:g.number}),children:c.jsx("span",{className:"sr-only",children:"Copy feature path"})}),g.shortId?c.jsx(vs,{shortId:g.shortId}):null,w?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Ac,{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(Ke,{to:`/features/${g.id}`,className:`entity-link--feature ${Um} underline-offset-4 hover:underline`,children:g.name})]})]}),c.jsx(Ac,{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&&E.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(Om,{items:E.map(S=>S.phase.id),strategy:km,children:E.map(S=>c.jsx(Lm,{id:S.phase.id,children:c.jsx(NT,{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 NT({feature:t,phaseEntry:a,expanded:l,recentlyChanged:s,onToggle:o,isTaskRecentlyChanged:u,highlightedTaskIds:f}){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(vi,{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:E=>{E.stopPropagation(),o()},onPointerDown:E=>E.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(zb,{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(Tr,{featureNum:t==null?void 0:t.number,phaseNum:m.number,featureId:t.id,phaseId:m.id}),c.jsx(rl,{id:gs({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(vs,{shortId:m.shortId}):null,m.handoff?c.jsx(bm,{phaseId:m.id,updatedAt:m.handoffUpdatedAt}):null,y?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Ac,{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(Ke,{to:`/features/${t.id}/phases/${m.id}`,className:`entity-link--phase ${Um} underline-offset-4 hover:underline`,children:m.title})]})]}),c.jsx(Ac,{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(Om,{items:x.map(E=>E.id),strategy:km,children:x.map(E=>c.jsx(Lm,{id:E.id,children:c.jsx(RT,{feature:t,phase:m,task:E,recentlyChanged:u(E.id),highlighted:f==null?void 0:f.has(E.id)})},E.id))})}):c.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function RT({feature:t,phase:a,task:l,recentlyChanged:s,highlighted:o}){return c.jsxs(vi,{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(Tr,{featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number,featureId:t.id,phaseId:a.id,taskId:l.id}),c.jsx(rl,{id:gs({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(vs,{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(Ke,{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(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||{}),ii=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})}},cs=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),E=this.parseRangeBound(p[2],y);return{type:"Range",lower:x.value,upper:E.value,lowerInclusive:s,upperInclusive:u?f:!0,lowerQuoted:x.quoted,upperQuoted:E.quoted,lowerStart:x.valueStart,lowerEnd:x.valueEnd,upperStart:E.valueStart,upperEnd:E.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 D={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(D)}const y=this.parseOr(),E=this.match(O.RPAREN);E||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:E?E.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 E=y?this.stripQuotes(x):x.value;return this.applyModifiers({type:"FieldValue",field:u.value,operator:m,value:E,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 Qh(t,a){if(a<t.start||a>t.end)return null;if(t.type==="BooleanExpr"){const l=Qh(t.left,a);if(l)return l;const s=Qh(t.right,a);return s||null}return t}function jT(t,a,l){if(!t)return null;const s=Qh(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 TT={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:{}},CT={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"},DT=["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 AT(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 kT(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 OT(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 Ah=class L0{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=cs.getCursorContext(a,l);const o=OT(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 DT.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:L0.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 cs(new ii(a).tokenize()).parse();if(l&&l.type==="BooleanExpr")return"("+a+")"}catch{}return a}};function fc(t){if(t==="")return null;const a=Number(t);return isNaN(a)?`"${t}" is not a valid number`:null}var MT=[/^\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 _T(t){for(const a of MT)if(a.test(t))return!0;return!isNaN(Date.parse(t))}function kh(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function LT(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 Dx(t,a){return new Date(t,a+1,0).getDate()}function zT(t,a){return new Date(t,a,1).getDay()}function go(t,a){return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()}function Ax(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 UT=["January","February","March","April","May","June","July","August","September","October","November","December"];function BT(t){return UT[t]}function hc(t,a){if(t==="")return null;const l=t.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(l){const s=Oh(l[1].trim(),a);if(s)return`Range start: ${s}`;const o=Oh(l[2].trim(),a);return o?`Range end: ${o}`:null}return Oh(t,a)}function Oh(t,a){return/^now(\/[dhms])?$/i.test(t)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(t)||a&&a(t)!==null||_T(t)?null:`"${t}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function mc(t){return t==null?null:typeof t=="string"?{message:t,severity:"error"}:t}var pc={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function gc(t){if(t.length<=1)return t;const a=[...t].sort((s,o)=>{const u=pc[s.type??"SYNTAX_ERROR"],f=pc[o.type??"SYNTAX_ERROR"];return u!==f?u-f:s.start-o.start}),l=[];for(const s of a)l.some(o=>pc[o.type??"SYNTAX_ERROR"]<pc[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=fc(t.value);break;case"date":u=hc(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=mc(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=fc(t.value);break;case"date":f=hc(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=mc(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=fc(a);break;case"date":g=hc(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=mc(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=fc(f.value),m&&(m=`${f.label}: ${m}`);break;case"date":m=hc(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=mc(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 Qo(t){return{...TT,...t}}function Ko(t){return{...CT,...t}}function HT(t,a){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...a}}function $T(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 qT(t){return{borderColor:t.inputFocusBorderColor,boxShadow:t.inputFocusShadow}}function IT(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 z0(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 Ws(t){return{flex:1,fontWeight:500}}function Mh(t){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function VT(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 YT(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 FT={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function PT(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 GT(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function XT(t,a,l){const s=PT(t.value).map(o=>{const u=a[FT[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}">${GT(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 QT={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function KT(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 ZT(t,a,l){const s=KT(t.value).map(o=>{if(o.type==="whitespace")return Mx(o.text);const u=a[QT[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 U0(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 JT={[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"},WT={[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 ei(t,a,l){const s=Qo(a);if(t.length===0)return"";const o=(l==null?void 0:l.cursorOffset)!==void 0?U0(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 E=0;E<t.length;E++){const w=t[E];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[E]=f.get(g.toLowerCase()):y.length>0&&(m[E]=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[WT[g.type]||"text"]||s.text;if(u&&m){const D=m[x];D&&u[D]&&(y=u[D])}const E=eC(g.value);if(g.type===O.WHITESPACE)return E.replace(/\n/g,"<br>");if(g.type===O.REGEX)return XT(g,s,l==null?void 0:l.tokenClassName);if(g.type===O.RANGE)return ZT(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--${JT[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}">${E}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function eC(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 tC({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:E,renderType:w,classNames:S}){const D=v.useRef(null),R=v.useRef(null);v.useEffect(()=>{const z=document.createElement("div");return document.body.appendChild(z),D.current=z,()=>{document.body.removeChild(z),D.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]),!D.current||!f||t.length===0||!s)return null;const q=Qo(o),X=Ko(u),W={...z0(q,X),top:`${s.top}px`,left:`${s.left}px`,...m!=null?{width:`${m}px`,minWidth:"unset",maxWidth:"unset"}:{}},ne=v.createElement("div",{className:za("ei-dropdown",S==null?void 0:S.dropdown),style:W,ref:z=>{R.current=z,E==null||E(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:{...VT(ee,X),...U}},B):null},ae={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:Ws()},z.label),z.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:Mh()},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:{...Ws(),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:{...Ws(),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:Ws()},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",ae),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,ae,B),v.createElement("span",{className:"ei-dropdown-item-label",style:{...Ws(),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:{...Mh(),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:Ws()},Lx(z.label,z.matchPartial,ee)),z.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:Mh()},z.description),ye())}));return al.createPortal(ne,D.current)}var nC=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _h(t){return Math.floor(t/10)*10}function aC({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,E]=v.useState("days"),[w,S]=v.useState(p.getFullYear()),[D,R]=v.useState(p.getMonth()),[L,I]=v.useState(o??null),[q,X]=v.useState(u??null),[W,ne]=v.useState(null),z=Qo(a),T=YT(z,Ko(l)),ee=()=>{y==="days"?D===0?(R(11),S(oe=>oe-1)):R(oe=>oe-1):S(y==="months"?oe=>oe-1:oe=>oe-10)},fe=()=>{y==="days"?D===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)},ae=()=>{y==="days"?E("months"):y==="months"&&E("years")},re=oe=>{R(oe),E("days")},ge=oe=>{S(oe),E("months")},U=oe=>{if(g==="single"){t(kh(oe));return}if(!L||q)I(oe),X(null),ne(null);else{const[$e,at]=L<=oe?[L,oe]:[oe,L];I($e),X(at),ne(null),t(`[${kh($e)} TO ${kh(at)}]`)}},B=L&&!q?W:q,ue=oe=>{x(oe),I(null),X(null),ne(null)},de=y==="days"?`${BT(D)} ${w}`:y==="months"?`${w}`:`${_h(w)}–${_h(w)+9}`,we=y!=="years",C=new Date,V=Dx(w,D),te=zT(w,D),me=["Su","Mo","Tu","We","Th","Fr","Sa"],Ne=[],je=(oe,$e,at)=>{const Ut=go(oe,C),pn=L&&go(oe,L),jt=B&&go(oe,B),_t=Ax(oe,L,B),Gt=pn||jt,Hn={...T.day,...at?T.dayOtherMonth:{},...Ut?T.dayToday:{},..._t?T.dayInRange:{},...Gt?T.daySelected:{}},$n=g==="range"&&L&&!q;return v.createElement("button",{key:$e,className:"ei-datepicker-day",style:Hn,onClick:()=>U(oe),onMouseEnter:en=>{$n?ne(oe):Gt||(en.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:en=>{!$n&&!Gt&&(en.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},oe.getDate())};if(te>0){const oe=Dx(w,D-1);for(let $e=te-1;$e>=0;$e--){const at=oe-$e,Ut=new Date(w,D-1,at);Ne.push(je(Ut,`prev${at}`,!0))}}for(let oe=1;oe<=V;oe++){const $e=new Date(w,D,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,D+1,$e);Ne.push(je(at,`next${$e}`,!0))}}const ut={...T.day,padding:"10px 4px",fontSize:"13px"},Pe={...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"}],bn={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},Pt=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:()=>ne(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:Pt,onMouseLeave:ft},"«"),v.createElement("button",{style:T.navButton,onClick:ee,onMouseEnter:Pt,onMouseLeave:ft},"‹")),v.createElement("button",{style:{...T.monthLabel,backgroundColor:"transparent",border:"none",cursor:we?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:we?ae: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:Pt,onMouseLeave:ft},"›"),v.createElement("button",{style:T.navButton,onClick:ye,onMouseEnter:Pt,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"}},nC.map((oe,$e)=>{const at=new Date(w,$e,1),Ut=Ax(at,L,B),pn=L&&go(new Date(L.getFullYear(),L.getMonth(),1),at)||B&&go(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?Pe:ut,...Ut?T.dayInRange:{},...pn?T.daySelected:{}},onClick:()=>re($e),onMouseEnter:Gt=>{_t?ne(at):pn||(Gt.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:Gt=>{!_t&&!pn&&(Gt.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=_h(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()),Gt=L&&L.getFullYear()===at||B&&B.getFullYear()===at,Hn=g==="range"&&L&&!q;return v.createElement("button",{key:at,style:{...pn?Pe:ut,...Ut?T.dayOtherMonth:{},..._t?T.dayInRange:{},...Gt?T.daySelected:{}},onClick:()=>ge(at),onMouseEnter:$n=>{Hn?ne(jt):Gt||($n.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:$n=>{!Hn&&!Gt&&($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,...bn}},oe.map($e=>v.createElement("button",{key:`${$e.type??"both"}-${$e.value}`,style:T.quickOption,onClick:()=>t($e.value)},$e.label)))})())}var rC=30,lC=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 sC(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 iC(t,a,l){if(!a||t.length===0)return[];const s=[];let o=0;for(const u of t){if(o>=rC)break;if(l>=u.start&&l<=u.end)continue;const f=sC(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 oC(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 uC({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,E]=v.useState([]),w=v.useRef([]),S=v.useRef(null),D=v.useRef(null);if(v.useEffect(()=>{if(D.current&&clearTimeout(D.current),t.length===0){E([]),w.current=[],p(null);return}return D.current=setTimeout(()=>{const q=iC(t,a,l);E(q),w.current=q},lC),()=>{D.current&&clearTimeout(D.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 ae=w.current[ye];if(ee>=ae.left&&ee<=ae.left+ae.width&&fe>=ae.top&&fe<=ae.top+ae.height+6){be=ye;break}}be>=0?(p(be),x({x:ee,clientY:z.clientY})):p(null)},W=()=>{p(null)},ne=new AbortController;return q.addEventListener("mousemove",X,{signal:ne.signal}),q.addEventListener("mouseleave",W,{signal:ne.signal}),()=>ne.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=Qo(s),L=Ko(o),I=m!=null?y[m]:null;return v.createElement(v.Fragment,null,y.map((q,X)=>{const W=q.error.severity==="warning",ne=oC(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:ne,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,ne=((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:ne+Bx;return al.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 _o(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 Al(t){const a=window.getSelection();if(!a||a.rangeCount===0)return 0;const l=a.getRangeAt(0);return _o(t,l.startContainer,l.startOffset)}function Er(t){const a=window.getSelection();if(!a||a.rangeCount===0)return{start:0,end:0};const l=a.getRangeAt(0);return{start:_o(t,l.startContainer,l.startOffset),end:_o(t,l.endContainer,l.endOffset)}}function nl(t,a){const l=window.getSelection();if(!l)return;const s=Kh(t,a);if(!s)return;const o=document.createRange();o.setStart(s.node,s.offset),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}function tl(t,a,l){if(a===l){nl(t,a);return}const s=window.getSelection();if(!s)return;const o=Kh(t,a),u=Kh(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 Kh(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=B0(t);return u?{node:u,offset:(u.textContent||"").length}:{node:t,offset:0}}function B0(t){if(t.nodeType===Node.TEXT_NODE)return t;for(let a=t.childNodes.length-1;a>=0;a--){const l=B0(t.childNodes[a]);if(l)return l}return null}function cC(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 dC(){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 vc(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 Lh(){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 zh(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 fC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD]);function hC(t,a,l){for(const s of t)if(a>=s.start&&a<=s.end&&fC.has(s.type))return a===s.start&&l===s.end?null:{start:s.start,end:s.end};return null}var mC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD,O.FIELD_NAME,O.RANGE,O.SAVED_SEARCH,O.HISTORY_REF,O.REGEX]);function pC(t,a,l){const s=[];for(const o of a)if(l>=o.start&&l<=o.end&&mC.has(o.type)){s.push({start:o.start,end:o.end});break}return t&&Ec(t,l,s),gC(s)}function Ec(t,a,l){if(a<t.start||a>t.end)return!1;let s=!1;switch(t.type){case"BooleanExpr":s=Ec(t.left,a,l)||s,s=Ec(t.right,a,l)||s;break;case"Group":case"Not":case"FieldGroup":s=Ec(t.expression,a,l)||s;break}return l.push({start:t.start,end:t.end}),!0}function gC(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 vC=60,yC=" ";function xC(t,a){const l=(a==null?void 0:a.maxLineLength)??vC,s=(a==null?void 0:a.indent)??yC,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 cs(new ii(t,{savedSearches:!0,historySearch:!0}).tokenize()).parse():u=t,u?Rc(u,0,l,s,o):""}function bC(t,a){return t.implicit?a.whitespace??"":t.operator==="AND"?a.and??t.sourceOperator??"AND":a.or??t.sourceOperator??"OR"}function H0(t,a){const l=a.not??t.sourceOperator??"NOT";return{op:l,sep:/^[a-zA-Z]/.test(l)?" ":""}}function Rr(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}=H0(t,a);return`${l}${s}${Rr(t.expression,a)}`}case"Group":{let l=`(${Rr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"FieldGroup":{let l=`${t.field}:(${Rr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"BooleanExpr":{const l=bC(t,a),s=l?` ${l} `:" ";return`${Rr(t.left,a)}${s}${Rr(t.right,a)}`}case"Error":return t.value}}function SC(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 Nc(t){return t.type==="Group"||t.type==="FieldGroup"?!0:t.type==="BooleanExpr"?Nc(t.left)||Nc(t.right):t.type==="Not"?Nc(t.expression):!1}var wC={and:"AND",or:"OR",not:"NOT"};function EC(t,a){return!!(Rr(t,wC).length>a||Nc(t))}function Rc(t,a,l,s,o){const u=s.repeat(a);switch(t.type){case"BooleanExpr":{const{operator:f,implicit:m,sourceOperator:p,operands:g}=SC(t),x=m?o.whitespace??"":f==="AND"?o.and??p??"AND":o.or??p??"OR",y=x?` ${x} `:" ",E=g.map(w=>Rr(w,o)).join(y);return E.length<=l?E:g.map((w,S)=>{const D=Rc(w,a,l,s,o);return S===0?D:x?`${u}${x} ${D}`:`${u}${D}`}).join(`
283
+ `)}case"Group":{if(!EC(t.expression,l)){let m=`(${Rr(t.expression,o)})`;return t.boost!=null&&(m+=`^${t.boost}`),m}let f=`(
284
+ ${NC(Rc(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}:(${Rr(t.expression,o)})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"Not":{const{op:f,sep:m}=H0(t,o);return`${f}${m}${Rc(t.expression,a,l,s,o)}`}default:return Rr(t,o)}}function NC(t,a,l){const s=l.repeat(a);return t.split(`
286
+ `).map(o=>o.startsWith(s)?o:s+o).join(`
287
+ `)}function RC(t){return t?Co(t):[]}function $x(t){return t.type==="BooleanExpr"}function Co(t){switch(t.type){case"BooleanExpr":return Zh(t);case"Group":{const a=[],l=t.expression;return $x(l)?(a.push({start:t.start,end:t.end}),a.push(...Co(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(...Co(l)),a}case"Not":{const a=[];return a.push({start:t.start,end:t.end}),a.push(...Co(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 Zh(t){return t.type==="BooleanExpr"?[...Zh(t.left),...Zh(t.right)]:Co(t)}function jC(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 TC=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 CC(t,a){const l=s=>(a==null?void 0:a(s))??LT(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 DC(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 AC({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 E=Ko(o),w={position:"absolute",zIndex:E.dropdownZIndex,...z0(a,E),top:`${t.top}px`,left:`${t.left}px`,maxHeight:"none",overflowY:"visible",...f!=null?{width:`${f}px`,minWidth:"unset",maxWidth:"unset"}:{}};return al.createPortal(v.createElement("div",{className:"ei-datepicker-portal",style:w,onMouseDown:S=>S.preventDefault()},v.createElement(aC,{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 kC(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:E,className:w,classNames:S,style:D,dropdown:R,features:L,inputRef:I,datePresets:q,onKeyDown:X,onFocus:W,onBlur:ne,onTab:z,validateValue:T,parseDate:ee,plainModeLength:fe,interceptPaste:be,defaultField:ye,trailingSpaceOnAccept:ae=!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,te=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,Pe=(R==null?void 0:R.showOperators)!==!1,nt=(ue||de!=="input")&&(R==null?void 0:R.onNavigation)!==!1,bn=(R==null?void 0:R.navigationDelay)??0,Pt=(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,Gt=(L==null?void 0:L.multiline)!==!1,Hn=(L==null?void 0:L.smartSelectAll)??!1,$n=(L==null?void 0:L.expandSelection)??!1,en=(L==null?void 0:L.wildcardWrap)??!1,ca=(L==null?void 0:L.clauseNavigation)??!1,da=L==null?void 0:L.formatQuery,Wn=!!da,qn=typeof da=="object"?da:void 0,he=v.useMemo(()=>({savedSearches:Ne,historySearch:je}),[Ne,je]),Ce=Array.isArray(a)?a:[],[De,Fe]=v.useState(Ce);v.useEffect(()=>{if(Array.isArray(a)){Fe(a);return}let j=!1;return a().then(P=>{j||Fe(P)}),()=>{j=!0}},[a]);const qe=v.useMemo(()=>{const j=new Map;for(const P of De)if(j.set(P.name.toLowerCase(),P.type),P.aliases)for(const Ee of P.aliases)j.set(Ee.toLowerCase(),P.type);return j},[De]),Z=v.useRef(null),[Tt,Xt]=v.useState(null),Yn=v.useCallback(j=>{Z.current=j,Xt(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 TC),Ct=v.useRef(null),nn=v.useRef(new Set),Qt=v.useRef(null),Ht=v.useRef(null),ht=v.useRef(null),Je=v.useRef(null),Sn=v.useRef(!1),kn=v.useRef(null),A=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 Ah(Ce,[],[],C||10,{showSavedSearchHint:ze,showHistoryHint:ut,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}));ve.current.setDefaultField(ge);const Ae=v.useRef(new kx(Ce)),Re=v.useRef(T);Re.current=T;const[_e,Ue]=v.useState([]),[Ge,ke]=v.useState(null),[Ze,Ie]=v.useState([]),[$t,We]=v.useState(-1),[ct,it]=v.useState(!1),[dt,Kt]=v.useState(!1),[Fn,wn]=v.useState(null),[On,Mn]=v.useState([]),[Pn,ga]=v.useState(!1),[ll,ea]=v.useState(!Me.current),[hr,Xe]=v.useState(fe!=null&&Me.current.length>=fe),[Nt,Zt]=v.useState(0),[ta,_n]=v.useState(0),[Or,Rt]=v.useState(""),[ja,Gn]=v.useState(null),[ql,yi]=v.useState(null),Dt=v.useRef({tokens:_e,ast:Ge,suggestions:Ze,selectedSuggestionIndex:$t,showDropdown:ct,showDatePicker:dt,cursorOffset:Nt,selectionEnd:ta,autocompleteContext:Or,validationErrors:On,cursorContext:ja});Dt.current={tokens:_e,ast:Ge,suggestions:Ze,selectedSuggestionIndex:$t,showDropdown:ct,showDatePicker:dt,cursorOffset:Nt,selectionEnd:ta,autocompleteContext:Or,validationErrors:On,cursorContext:ja};const mr=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=Lh();return Ee?zh(Ee,j,P):null},[we]),Zo=v.useCallback(()=>{if(!(!we||!gn.current))return gn.current.getBoundingClientRect().width},[we]),ar=v.useCallback((j,P,Ee="dropdown")=>{const xe=Ee==="datePicker"?j:Hx(j,me);if(we&&Ee!=="datePicker"){it(!0),wn(mr(xe,P));return}const Ye=requestAnimationFrame(()=>{nn.current.delete(Ye),Ee==="datePicker"?Kt(!0):it(!0);const ce=Lh();wn(ce?zh(ce,xe,P):null)});nn.current.add(Ye)},[we,mr,me]),sl=80,od=60,xs=v.useCallback((j,P)=>{if(!Z.current)return;const Ee=ei(j,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=Ee,document.activeElement===Z.current&&nl(Z.current,P)},[x]),va=v.useCallback((j,P)=>{const Ee=fe!=null&&j.length>=fe;if(Xe(Ee),Ee){if(Ue([]),ke(null),Mn([]),ea(j.length===0),Ie([]),Dt.current.tokens=[],it(!1),Kt(!1),Z.current){const Se=Al(Z.current);Z.current.querySelector("span")&&(Z.current.textContent=j,nl(Z.current,Se)),Zt(Se),_n(Se)}s&&s(j,null),o&&o([]);return}const xe=new ii(j,he).tokenize(),Ye=new cs(xe),ce=Ye.parse(),pe=gc([...Ye.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...Ae.current.validate(ce,Re.current,ee,U)]);if(Z.current){const Se=Al(Z.current);P&&xe.length>sl?(Ht.current&&clearTimeout(Ht.current),Ht.current=setTimeout(()=>{Ht.current=null,Z.current&&xs(xe,Al(Z.current))},od)):(Ht.current&&(clearTimeout(Ht.current),Ht.current=null),xs(xe,Se)),Ue(xe),ke(ce),Mn(pe),ea(j.length===0),Zt(Se),_n(Se),Dt.current.tokens=xe,P&&Te.current(xe,Se)}else Ue(xe),ke(ce),Mn(pe),ea(j.length===0),Dt.current.tokens=xe;s&&s(j,ce),o&&o(pe)},[x,s,o,xs,fe]),Il=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(Ye=>Ye.type==="hint")?j.map(Ye=>Ye.type==="hint"?{...Ye,customContent:xe}:Ye):[{text:"",label:"",type:"hint",customContent:xe,replaceStart:P.start??0,replaceEnd:P.end??0},...j]},[ft]),bs=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),Kt(!1),ar(32,300),!0)},[Ut]),ya=v.useCallback((j,P,Ee)=>{var Se,Qe,rt;const xe=ve.current.getSuggestions(j,P);Pe||(xe.suggestions=xe.suggestions.filter(Be=>Be.type!=="operator"));const Ye=xe.context.type;if(Gn(xe.context),ue){if(B({trigger:$.current,context:xe.context,suggestions:xe.suggestions,isOpen:Dt.current.showDropdown||Dt.current.showDatePicker,value:Me.current,selectionStart:P,selectionEnd:Ee??P})===!1){it(!1),Kt(!1),Ie([]);return}}else{if(de==="never"){it(!1),Kt(!1),Ie([]);return}if(de==="manual"){if(M.current&&M.current!==Ye){M.current=null,it(!1),Kt(!1),Ie([]);return}if(!M.current){it(!1),Kt(!1),Ie([]);return}}if(de==="input"&&$.current!=="input"&&$.current!=="ctrlSpace"){it(!1),Kt(!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),Kt(!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){Sn.current=!1,(Se=Qt.current)==null||Se.abort(),vt.current&&clearTimeout(vt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const Be=CC(xe.context,ee),En=kn.current;kn.current=Be,yi(Be);const Lt=xe.context.token;Lt&&(Lt.type==="COLON"||Lt.type==="COMPARISON_OP")?A.current={start:Lt.end,end:Lt.end}:Lt?A.current={start:Lt.start,end:Lt.end}:A.current={start:P,end:P},Dt.current.showDatePicker&&DC(En,Be)&&Kt(!1),Ie([]),we||it(!1),Rt(Ye),ar(350,300,"datePicker");return}if(pe){const Be=xe.context.token,En=Be?Be.start:P,Lt=Be?Be.end:P,ra=()=>{Je.current=null,Ie([{text:"",label:"Searching...",type:"loading",replaceStart:En,replaceEnd:Lt}]),we||it(!1),Kt(!1),We(-1),ar(32,300)};Je.current&&clearTimeout(Je.current),Pt>0?Je.current=setTimeout(ra,Pt):ra(),Rt(Ye)}else{Sn.current=!1,(Qe=Qt.current)==null||Qe.abort(),vt.current&&clearTimeout(vt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const Be=Il(xe.suggestions,xe.context);Be.length>0?(Ie(Be),we||it(!1),Kt(!1),We(xe.context.partial||jt?0:-1),Rt(Ye),ar(Be.length*32,300)):(Rt(Ye),bs(xe.context)||(it(!1),Kt(!1),Ie([])))}if(pe){const Be=xe.context.partial,En=te||200;Sn.current=!0,vt.current&&clearTimeout(vt.current),(rt=Qt.current)==null||rt.abort();const Lt=new AbortController;Qt.current=Lt,vt.current=setTimeout(async()=>{const ra=xe.context.token,la=ra?ra.start:P,xa=ra?ra.end:P;try{let Nn;if(xe.context.type==="SAVED_SEARCH"&&typeof m=="function"){const cn=await m(Be);if(Lt.signal.aborted)return;Nn=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;Nn=cn.map(zt=>({text:Ah.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),Pl=await g(zt?zt.name:cn,Be);if(Lt.signal.aborted)return;Nn=Pl.map(vr=>({text:vr.text,label:vr.label||vr.text,description:vr.description,type:vr.type,replaceStart:la,replaceEnd:xa,matchPartial:Be}))}if(Je.current&&(clearTimeout(Je.current),Je.current=null),Nn=Nn.slice(0,V),Nn.length>0){if(ge!=null&&ge.showFieldSuggestions){const cn=ve.current.getFieldSuggestions(Be,la,xa);Nn=[...Nn,...cn].slice(0,V)}Ie(Nn),We(Be||jt?0:-1),ar(Nn.length*32,300)}else{const cn=ve.current.getSuggestions(Dt.current.tokens,Dt.current.cursorOffset);if(!(Be&&bs(cn.context))){const zt=Il(cn.suggestions.filter(Pl=>Pl.type==="hint"),cn.context);zt.length>0?(Ie(zt),We(cn.context.partial||jt?0:-1),ar(zt.length*32,300)):bs(cn.context)||(it(!1),Ie([]))}}}catch(Nn){Je.current&&(clearTimeout(Je.current),Je.current=null),Lt.signal.aborted||(Ie([{text:"",label:Nn instanceof Error?Nn.message:"Error loading suggestions",type:"error",replaceStart:la,replaceEnd:xa}]),We(-1),ar(32,300),Sn.current=!1)}},En)}},[g,m,p,te,Il,mr,ar,we,B,ue,de,Pe,V,Pt,jt,bs]);Te.current=ya;const an=v.useCallback(()=>{var j;it(!1),Kt(!1),yi(null),kn.current=null,A.current=null,Ie([]),We(-1),Sn.current=!1,(j=Qt.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){(Dt.current.showDropdown||Dt.current.showDatePicker)&&an();return}$.current="navigation",bn>0?ht.current=setTimeout(()=>{ht.current=null,ya(j,P,Ee)},bn):ya(j,P,Ee)},[nt,bn,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 ii(j,he).tokenize(),Ye=new cs(xe),ce=Ye.parse(),pe=gc([...Ye.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...Ae.current.validate(ce,Re.current,ee,U)]);if(Z.current){const Se=ei(xe,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=Se,nl(Z.current,P)}if(Ue(xe),ke(ce),Mn(pe),ea(j.length===0),Zt(P),_n(P),it(!1),Kt(!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]),Mr=v.useCallback((j,P="Enter",Ee,xe)=>{if(!j)return;const Ye=Dt.current,ce=Ye.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,Pl=Math.max(j.replaceEnd,Ye.selectionEnd),vr=Me.current.slice(0,zt),cd=Me.current.slice(Pl),tu=vr+cn+cd,nu=vr.length+cn.length;Ta(tu,nu,(dd,fd)=>{Ee?Ee(tu,fd):ya(dd,nu)});return}if(j.type==="hint")return;const Se=Ye.autocompleteContext==="FIELD_VALUE",Qe=Math.min(j.replaceStart,Ye.cursorOffset),rt=Math.max(j.replaceEnd,Ye.selectionEnd),Be=Me.current.slice(0,Qe),En=Me.current.slice(rt);let Lt="",ra=En;pe&&ae&&(En.length===0?Lt=" ":/^[ \t\r\n]+$/.test(En)&&!En.startsWith("\\ ")&&(Lt=" ",ra=""));const la=Be+j.text+Lt+ra,xa=Be.length+j.text.length+Lt.length,Nn=P==="Enter"&&Se;Ta(la,xa,(cn,zt)=>{Ee?Ee(la,zt):Nn?l&&l(la,zt,xe):ya(cn,xa)})},[Ta,ya,l,ae]);v.useEffect(()=>{Array.isArray(m)&&ve.current.updateSavedSearches(m),Array.isArray(p)&&ve.current.updateSearchHistory(p)},[m,p]),v.useEffect(()=>{ve.current=new Ah(De,[],[],C||10,{showSavedSearchHint:ze,showHistoryHint:ut,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}),ve.current.setDefaultField(ge),Ae.current=new kx(De),Array.isArray(m)&&ve.current.updateSavedSearches(m),Array.isArray(p)&&ve.current.updateSearchHistory(p),Me.current&&va(Me.current,!1)},[De,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:()=>Dt.current.ast,getValidationErrors:()=>Dt.current.validationErrors,setSelection:(j,P)=>{Z.current&&(Z.current.focus(),tl(Z.current,j,P),Zt(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=Qt.current)==null||j.abort()},[]),v.useEffect(()=>{if(ue){const j=Dt.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),Kt(!1),Ie([]))}else de==="never"&&(it(!1),Kt(!1),Ie([]));M.current=null},[B]);const pr=v.useRef(!1);v.useLayoutEffect(()=>{if(pr.current){pr.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;pr.current=!0,wn(Ye=>Ye&&{...Ye,left:Math.max(8,Ye.left-xe)})}},[Fn,ct,dt,Ze]),v.useEffect(()=>{const j=()=>{const P=Dt.current;if(!(!P.showDropdown&&!P.showDatePicker))if(P.showDropdown&&we&&gn.current){const Ee=gn.current.getBoundingClientRect();wn({top:Ee.bottom+window.scrollY+4,left:Ee.left+window.scrollX})}else{const Ee=Lh();Ee&&wn(zh(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=()=>{(Dt.current.showDropdown||Dt.current.showDatePicker)&&an()};return j.addEventListener("scroll",P),()=>j.removeEventListener("scroll",P)},[an]);const _r=v.useRef(null),xi=v.useRef(x);v.useEffect(()=>{if(!Z.current)return;const j=Dt.current.tokens;if(j.length===0||Pn&&ta!==Nt)return;const P=Pn?Nt:-1,Ee=x!==xi.current;xi.current=x;const xe=U0(j,P),Ye=xe?`${xe.openStart},${xe.closeStart}`:null;if(Ye===_r.current&&!Ee)return;_r.current=Ye;const ce=Pn?Al(Z.current):-1,pe=ei(j,x,{cursorOffset:P,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=pe,Pn&&ce>=0&&nl(Z.current,ce)},[Nt,ta,Pn,x]);const gr=re&&!Pn,bi=v.useRef(gr);v.useEffect(()=>{if(!Z.current)return;const j=bi.current;if(bi.current=gr,j!==gr)if(gr)Z.current.innerHTML=Z.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const P=Dt.current.tokens;if(P.length>0){const Ee=Pn?Al(Z.current):-1,xe=ei(P,x,{cursorOffset:Ee,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=xe,Pn&&Ee>=0&&nl(Z.current,Ee)}}},[gr,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=kT(Z.current);if(j===Me.current)return;let P=Al(Z.current);const Ee=jx(j);Ee!==j&&(j=Ee,P=Math.min(P,j.length)),Me.current=j;const xe=Bt.current,Ye=xe.current();if(Ye&&Math.abs(j.length-Ye.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&&vc(Z.current);return}}va(j,!0),Z.current&&vc(Z.current)},[va,ue,de,an]),rr=v.useCallback(()=>{yt.current=!0},[]),Si=v.useCallback(()=>{yt.current=!1,Ha()},[Ha]),Lr=v.useCallback(j=>{if(!j)return;Me.current=j.value;const P=new ii(j.value,he).tokenize(),Ee=new cs(P),xe=Ee.parse(),Ye=gc([...Ee.getErrors().map(pe=>({message:pe.message,start:pe.start,end:pe.end,type:"SYNTAX_ERROR"})),...Ae.current.validate(xe,Re.current,ee,U)]),ce=j.selStart!=null&&j.selStart!==j.cursorPos;if(Z.current){const pe=ei(P,x,{cursorOffset:j.cursorPos,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=pe,ce?tl(Z.current,j.selStart,j.cursorPos):nl(Z.current,j.cursorPos)}Ue(P),ke(xe),Mn(Ye),ea(j.value.length===0),Zt(ce?j.selStart:j.cursorPos),_n(j.cursorPos),an(),s&&s(j.value,xe),o&&o(Ye)},[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))},[]),wi=v.useCallback(j=>{var xe,Ye;if(X&&X(j),j.defaultPrevented)return;const P=Dt.current,Ee=j.nativeEvent.code;if(Wn&&Ee==="KeyF"&&j.altKey&&j.shiftKey&&!j.ctrlKey&&!j.metaKey){j.preventDefault();const ce=xC(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=Er(Z.current);if(pe.end-pe.start>20){const Se=j.key==="Backspace"||j.key==="Delete"||j.key==="x"&&(j.ctrlKey||j.metaKey),Qe=!j.ctrlKey&&!j.metaKey&&!j.altKey&&j.key.length===1;(Se||Qe)&&(Z.current.textContent=Me.current,tl(Z.current,pe.start,pe.end))}}}{let ce=null,pe=null;if(Tx[j.key])ce=j.key,pe=Tx[j.key];else if(en&&j.key==="*"&&Z.current){const Se=Er(Z.current);if(Se.start!==Se.end){const[Qe,rt]=Cx(P.tokens,Se.start,Se.end);if(Qe>=0&&Qe===rt){const Be=P.tokens[Qe];(Be.type===O.VALUE||Be.type===O.WILDCARD)&&(ce="*",pe="*")}}}if(ce&&pe&&Z.current){const Se=Er(Z.current);if(Se.start!==Se.end){j.preventDefault();const{newValue:Qe,newSelStart:rt,newSelEnd:Be}=AT(Me.current,Se.start,Se.end,ce,pe),En=Bt.current,Lt=En.current();Lt&&Lt.value===Me.current&&(Lt.selStart=Se.start,Lt.cursorPos=Se.end),Me.current=Qe,Ct.current&&(clearTimeout(Ct.current),Ct.current=null),En.push({value:Qe,cursorPos:Be,selStart:rt});const ra=new ii(Qe,he).tokenize(),la=new cs(ra),xa=la.parse(),Nn=gc([...la.getErrors().map(zt=>({message:zt.message,start:zt.start,end:zt.end,type:"SYNTAX_ERROR"})),...Ae.current.validate(xa,Re.current,ee,U)]),cn=ei(ra,x,{cursorOffset:Be,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});Z.current.innerHTML=cn,tl(Z.current,rt,Be),Ue(ra),ke(xa),Mn(Nn),ea(!1),Zt(rt),_n(Be),an(),s&&s(Qe,xa),o&&o(Nn);return}}}if(j.key==="z"&&(j.ctrlKey||j.metaKey)&&!j.shiftKey){j.preventDefault(),Lr(Bt.current.undo());return}if(j.key==="y"&&(j.ctrlKey||j.metaKey)||j.key==="z"&&(j.ctrlKey||j.metaKey)&&j.shiftKey){j.preventDefault(),Lr(Bt.current.redo());return}if(j.key==="a"&&(j.ctrlKey||j.metaKey)&&Hn&&Z.current){const ce=Er(Z.current),pe=hC(P.tokens,ce.start,ce.end);if(pe){j.preventDefault(),tl(Z.current,pe.start,pe.end),Zt(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 Qe=Er(Z.current),rt=pC(P.ast,P.tokens,Qe.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 Qe=Er(Z.current);nl(Z.current,Qe.start),K.current=null}else{j.preventDefault();const Qe=pe.ranges[Se];tl(Z.current,Qe.start,Qe.end),Zt(Qe.start),_n(Qe.end)}return}if(K.current=null,ca&&j.ctrlKey&&j.altKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&Z.current){j.preventDefault();const ce=Ee==="ArrowRight"?"forward":"backward",pe=RC(P.ast),Se=Er(Z.current),Qe=ce==="forward"?Se.end:Se.start,rt=jC(pe,se.current,Qe,ce);rt&&(se.current=rt.index,tl(Z.current,rt.stop.start,rt.stop.end),Zt(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&&Gt){j.preventDefault(),dC();const ce=Z.current?Al(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&&vc(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}=Er(Z.current);let Qe,rt;if(pe!==Se)Qe=ce.slice(0,pe)+ce.slice(Se),rt=pe;else if(j.key==="Backspace"&&pe>0)Qe=ce.slice(0,pe-1)+ce.slice(pe),rt=pe-1;else if(j.key==="Delete"&&pe<ce.length)Qe=ce.slice(0,pe)+ce.slice(pe+1),rt=pe;else return;j.preventDefault(),Me.current=Qe,K.current=null,ht.current&&(clearTimeout(ht.current),ht.current=null),$.current="input",Bt.current.push({value:Qe,cursorPos:rt}),nl(Z.current,rt),va(Qe,!0),Z.current&&vc(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 Qe=pe.slice(0,Se),rt=pe.slice(Se),Be=Qe+" "+rt;Ta(Be,Se+1,()=>{l&&l(Be,P.ast,j)})}else l&&l(pe,P.ast,j);return}j.preventDefault(),Mr(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?Mr(pe,"Tab",(Qe,rt)=>{var Be;Se.submit&&l&&l(Qe,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 Qe=pe.slice(0,Se),rt=pe.slice(Se),Be=Qe+" "+rt,En=Se+1;Ta(Be,En,Lt=>{ya(Lt,En)})}return}j.preventDefault(),Mr(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&&((Ye=Z.current)==null||Ye.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,Mr,Ta,Lr,Gt,ue,de,ya,X,z,Hn,$n,ca,_t,$a,Wn]),Ss=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=Er(Z.current);Zt(P.start),_n(P.end),na(Dt.current.tokens,P.start,P.end)}},[na]),Jo=v.useCallback(()=>{ga(!0),W==null||W();const j=requestAnimationFrame(()=>{if(nn.current.delete(j),Z.current){const P=Dt.current.tokens,Ee=P.length>0?Al(Z.current):0;Zt(Ee),_n(Ee),na(P,Ee)}});nn.current.add(j)},[Ha,na,W]),ws=v.useCallback(()=>{var j;ga(!1),it(!1),Kt(!1),Ie([]),Sn.current=!1,(j=Qt.current)==null||j.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),Je.current&&(clearTimeout(Je.current),Je.current=null),Zt(-1),ne==null||ne()},[ne]),zr=v.useRef(!1),Wo=v.useCallback(j=>{if(!Z.current||j.detail!==2&&j.detail!==3)return;if(j.detail===3){if(!Dt.current.ast)return;const Se=document.caretRangeFromPoint(j.clientX,j.clientY);if(!Se)return;const Qe=_o(Z.current,Se.startContainer,Se.startOffset),rt=jT(Dt.current.ast,Me.current,Qe);if(!rt||rt.start>=rt.end)return;j.preventDefault(),zr.current=!0,tl(Z.current,rt.start,rt.end);return}j.preventDefault(),zr.current=!0;const P=document.caretRangeFromPoint(j.clientX,j.clientY);if(!P)return;const Ee=_o(Z.current,P.startContainer,P.startOffset),xe=Me.current,Ye=Se=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(Se);let ce=Ee;for(;ce>0&&Ye(xe[ce-1]);)ce--;let pe=Ee;for(;pe<xe.length&&Ye(xe[pe]);)pe++;ce<pe&&tl(Z.current,ce,pe)},[]),aa=v.useCallback(j=>{zr.current&&(j.preventDefault(),zr.current=!1)},[]),Ur=v.useCallback(()=>{if(!Z.current)return;const j=Er(Z.current);if(Zt(j.start),_n(j.end),j.start!==j.end){const[P,Ee]=Cx(Dt.current.tokens,j.start,j.end);if(P!==Ee){an();return}}na(Dt.current.tokens,j.start,j.end)},[na,an]),Br=v.useCallback(j=>{Ct.current&&(clearTimeout(Ct.current),Ct.current=null),cC(j),Ha()},[Ha]),Vl=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&&Br(xe)}).catch(()=>{}):Ee!=null&&Br(Ee)}else Br(P)},[be,Br]),ud=v.useCallback(j=>{$.current="navigation";const P=Dt.current,Ee=A.current,xe=Ee?Ee.start:P.cursorOffset,Ye=Ee?Ee.end:P.cursorOffset,ce=Me.current.slice(0,xe),pe=Me.current.slice(Ye);let Se="",Qe=pe;ae&&j.length>0&&(pe.length===0?Se=" ":/^[ \t\r\n]+$/.test(pe)&&!pe.startsWith("\\ ")&&(Se=" ",Qe=""));const rt=ce+j+Se+Qe,Be=ce.length+j.length+Se.length;Ta(rt,Be,En=>{Z.current&&Z.current.focus(),ya(En,Be)})},[Ta,ya,ae]),il=Qo(x),Yl=Ko(y),Fl=HT(il,D),Hr={...$T(il,Yl),...Pn?qT(Yl):{}};gr&&(Hr.whiteSpace="nowrap",Hr.overflow="hidden",Hr.textOverflow="ellipsis");const eu=IT(il,Yl);return v.createElement("div",{ref:gn,style:Fl,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:Hr,onInput:Ha,onKeyDown:wi,onKeyUp:Ss,onMouseDown:Wo,onMouseUp:aa,onFocus:Jo,onBlur:ws,onClick:Ur,onPaste:Vl,onCompositionStart:rr,onCompositionEnd:Si,spellCheck:!1}),ll&&!Pn?v.createElement("div",{className:za("ei-placeholder",S==null?void 0:S.placeholder),style:eu},E):null,v.createElement(uC,{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(tC,{suggestions:Ze,selectedIndex:$t,onSelect:j=>Mr(j,"Tab"),position:Fn,colors:x,styles:y,visible:ct,fixedWidth:Zo(),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(AC,{position:Fn,colors:il,onSelect:ud,colorConfig:x,styleConfig:y,datePickerInit:ql,fixedWidth:void 0,datePresets:q,datePickerClassName:S==null?void 0:S.datePicker}):null)}const OC=["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 MC(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 Uh(t){return String(t>0?t:0).padStart(3,"0")}function _C({features:t,phases:a,query:l,onQuery:s}){const o=v.useRef(null),u=MC(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),E=[...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))],D=[...new Set(a.flatMap(R=>R.tasks.map(L=>L.title)))];return{featureNums:y,phaseNums:E,taskNums:w,shortIds:S,titles:D}},[t,a]),p=v.useCallback(async(y,E)=>{const w=E.toLowerCase();return y==="feature"?m.featureNums.filter(S=>String(S).startsWith(E)).slice(0,20).map(S=>({text:String(S),label:`F${Uh(S)}`})):y==="phase"?m.phaseNums.filter(S=>String(S).startsWith(E)).slice(0,20).map(S=>({text:String(S),label:`P${Uh(S)}`})):y==="task"?m.taskNums.filter(S=>String(S).startsWith(E)).slice(0,20).map(S=>({text:String(S),label:`T${Uh(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"?OC.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(kC,{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 LC(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,E)=>(g.get(y.id)??1/0)-(g.get(E.id)??1/0)):p.allTasks;return{...p,allTasks:x}})}})}function ti({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 zC({features:t,phases:a,activeTasks:l,projectStorageScope:s}){const o=ST({features:t,phases:a,projectStorageScope:s}),[u,f]=v.useState({});v.useEffect(()=>{f({})},[o.displayedWorkTree]);const m=v.useMemo(()=>LC(o.displayedWorkTree,u),[o.displayedWorkTree,u]),[p,g]=v.useState(!1),[x,y]=v.useState(null),[E,w]=v.useState(null),S=ae=>w(String(ae.active.id)),[D,R]=v.useState(0);v.useEffect(()=>{const ae=document.querySelector("header");if(!ae)return;const re=()=>R(ae.offsetHeight);re();const ge=new ResizeObserver(re);return ge.observe(ae),window.addEventListener("resize",re),()=>{ge.disconnect(),window.removeEventListener("resize",re)}},[]),v.useEffect(()=>{const ae=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(ae)},[o.searchQuery,o.hideDone,o.hidePlanned,o.onlyActiveBranches]);const L=U2(z2(Dm,{activationConstraint:{distance:5}})),I=async ae=>{const{active:re,over:ge}=ae;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=To(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(te=>({...te,__features__:de})),await bh("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=To(we,we.indexOf(U),we.indexOf(B)),V=C.indexOf(U),te=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 bh("phase",U,te,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=To(C,C.indexOf(U),C.indexOf(B)),te=V.indexOf(U),me=te>0?V[te-1]??null:null,Ne=te<V.length-1?V[te+1]??null:null;f(je=>({...je,[`task-scope:${we.phase.id}`]:V})),await bh("task",U,me,Ne).catch(()=>{});return}}},q=ae=>o.expandedPhaseIds.includes(ae),X=ae=>o.recentPhaseIds.includes(ae),W=ae=>o.recentTaskIds.includes(ae),[ne,z]=qo(),[T,ee]=v.useState(null),fe=ne.get("locate"),be=fe?parseInt(fe.replace(/^T/i,""),10):null;v.useEffect(()=>{if(be==null||Number.isNaN(be))return;const ae=a.flatMap(B=>B.tasks.map(ue=>({t:ue,p:B}))).find(({t:B})=>B.number===be);if(!ae){z(B=>(B.delete("locate"),B),{replace:!0});return}const{t:re,p:ge}=ae;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(!E)return null;for(const ae of m){if(ae.feature.id===E)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(Tr,{featureNum:ae.feature.number}),c.jsx(Ja,{status:ae.feature.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:ae.feature.name})]});for(const re of ae.allPhases){if(re.phase.id===E)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(Tr,{featureNum:ae.feature.number,phaseNum:re.phase.number}),c.jsx(Ja,{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===E)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(Tr,{featureNum:ae.feature.number,phaseNum:re.phase.number,taskNum:ge.number}),c.jsx(Ja,{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(tn,{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:D},children:[c.jsx(_C,{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(Mm,{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(ti,{active:o.isAllExpanded,onClick:()=>o.isAllExpanded?o.collapseAll():o.expandAll(),children:o.isAllExpanded?"Collapse all":"Expand all"}),c.jsx(ti,{active:o.hideDone,onClick:()=>o.setHideDone(ae=>!ae),children:"Hide done"}),c.jsx(ti,{active:o.hidePlanned,onClick:()=>o.setHidePlanned(ae=>!ae),children:"Hide planned"}),c.jsx(ti,{active:o.onlyActiveBranches,onClick:()=>o.setOnlyActiveBranches(ae=>!ae),children:"Only active"}),c.jsx(ti,{onClick:o.resetFilters,children:"Reset"}),c.jsx(ti,{disabled:p,onClick:async()=>{g(!0),y(null);try{const ae=await NR(),re=ae.migrated,ge=ae.integrity.duplicatePhaseIds.length,U=ae.integrity.danglingPhaseIds.length;y(`Repair done: renamed ${re.renamed}, repaired ${re.repaired} refs, inferred ${re.inferred}. Integrity: ${ge} duplicate, ${U} dangling.`)}catch(ae){y(`Repair failed: ${ae instanceof Error?ae.message:String(ae)}`)}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(Uj,{sensors:L,collisionDetection:V2,onDragStart:S,onDragEnd:I,children:[c.jsx(Om,{items:m.map(ae=>ae.feature.id),strategy:km,children:m.map(ae=>c.jsx(Lm,{id:ae.feature.id,children:c.jsx(ET,{entry:ae,expanded:o.expandedFeatureIds.includes(ae.feature.id),recentlyChanged:o.recentFeatureIds.includes(ae.feature.id),onToggle:()=>o.toggleExpandedFeature(ae.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})()})},ae.feature.id))}),c.jsx(nT,{dropAnimation:{duration:150,easing:"ease"},children:ye()})]}):l.length>0?l.map(ae=>{const re=ae.featureId?`/features/${ae.featureId}/phases/${ae.phaseId}/tasks/${ae.id}`:"/features";return c.jsxs(Ke,{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:[ae.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,c.jsxs("span",{className:"truncate",children:["T",y2(ae.number)," — ",ae.title]})]}),c.jsx(Ja,{status:ae.status})]}),c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:ae.phaseId})]},ae.id)}):c.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function UC(){const{features:t,phases:a,activeTasks:l}=Ul(),{project:s}=ms("root"),o=Ar(),u=()=>o("/project/edit");An("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(tn,{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(fs,{className:"h-4 w-4"}),"Edit project"]})]}),s.goal?c.jsx(Dn,{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(t2,{project:s}),c.jsx(S2,{features:t,phases:a}),c.jsx(zC,{features:t,phases:a,activeTasks:l,projectStorageScope:f}),c.jsx(i2,{features:t,phases:a}),c.jsx(u2,{features:t,phases:a})]})}async function BC(){const[t,a]=await Promise.all([Yb(),Kc()]);return{features:t,phases:a}}function Lo(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function Uc(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 HC(t){const a=Lo();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 $0(t){const a=Lo();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 $C(t){const a=Lo();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 qC({feature:t,phases:a,phasesCount:l,tasksCount:s,phaseSummary:o,taskSummary:u,activity:f}){var L;const m=ds(),p=ds(),x=((L=m.formData)==null?void 0:L.get("status"))??t.status,y=m.state!=="idle",E=p.state!=="idle",w=Uc(o),S=Uc(u),D=s0(a??[]),R=t.description||(f?`${f.doneTasks}/${s} done · ${f.remainingTasks} left${f.blockedTasks?` · ${f.blockedTasks} blocked`:""}`:"");return c.jsxs(vi,{variant:"surface",status:D.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(Tr,{featureNum:t.number,featureId:t.id}),c.jsx(rl,{id:gs({featureNum:t.number}),children:c.jsx("span",{className:"sr-only",children:"Copy feature path"})}),t.shortId?c.jsx(vs,{shortId:t.shortId}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(Vo,{status:D.displayStatus,breakdown:D.breakdown})})]}),c.jsx(Ke,{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(Ke,{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(fs,{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:E||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:c.jsx(di,{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||E,"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:rd.map(I=>c.jsx("option",{value:I.value,children:I.label},I.value))}),c.jsx(ps,{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(Ke,{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(fs,{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:E||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:c.jsx(di,{className:"h-4 w-4"})})})]}),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 IC={feature:{label:"Feature",Icon:Cc},phase:{label:"Phase",Icon:BN},task:{label:"Task",Icon:Pc},requirement:{label:"Requirement",Icon:qb}};function q0({kind:t,label:a}){const{Icon:l,label:s}=IC[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 ys({className:t="",...a}){return c.jsx("select",{className:`field-control ${t}`,...a})}function sd({query:t,status:a,statusOptions:l,placeholder:s,clearTo:o,resultsLabel:u}){const f=mm();return c.jsxs(ua,{method:"get",className:"surface-card grid gap-3 p-3 md:grid-cols-[minmax(0,1fr)_200px_auto_auto] md:items-end sm:p-4",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:m=>f(m.currentTarget.form)})]}),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(ys,{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.map(m=>c.jsx("option",{value:m.value,children:m.label},m.value))]}),c.jsx(ps,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}),c.jsx(gt,{type:"submit",variant:"secondary",children:"Apply filters"}),c.jsx(Ke,{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)] md:col-span-4",children:u})]})}function id(t,a){const l=t.trim().toLowerCase();return l?a.some(s=>s==null?void 0:s.toLowerCase().includes(l)):!0}function VC(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,HC(m)),u.set(f,$0(m.flatMap(p=>p.tasks)));return{phasesByFeature:a,phasesCountByFeature:l,tasksCountByFeature:s,phaseSummaryByFeature:o,taskSummaryByFeature:u}}function YC(){var w,S;const{features:t,phases:a}=Ul(),{phasesByFeature:l,phasesCountByFeature:s,tasksCountByFeature:o,phaseSummaryByFeature:u,taskSummaryByFeature:f}=VC(a),m=Ar(),[p]=qo(),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]);An("create",y);const E=v.useMemo(()=>t.filter(D=>(!x||D.status===x)&&id(g,[D.name,D.id,D.description])),[t,g,x]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(tn,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx(q0,{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(Ke,{to:"new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),c.jsx(sd,{query:g,status:x,statusOptions:rd,placeholder:"Search feature name, id, or description",clearTo:"/features",resultsLabel:E.length===t.length?`${t.length} features`:`${E.length} of ${t.length} features`}),c.jsx("div",{className:"grid gap-3",children:t.length===0?c.jsxs(tn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No features yet. ",c.jsx(Ke,{to:"/features/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first feature"})]}):E.length>0?E.map(D=>c.jsx(qC,{feature:D,phases:l.get(D.id),phasesCount:s.get(D.id)??0,tasksCount:o.get(D.id)??0,phaseSummary:u.get(D.id)??Lo(),taskSummary:f.get(D.id)??Lo()},D.id)):c.jsx(tn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),c.jsx(hi,{})]})}async function FC(){const[t,a]=await Promise.all([vm(),Kc()]);return{requirements:t,phases:a}}function vo(...t){return t.filter(Boolean).join(" ")}function PC(){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(ps,{className:"h-5 w-5"})})}function ha({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:vo("group mt-4 overflow-hidden rounded-[10px] border border-[var(--border)]",f),open:o,children:[c.jsxs("summary",{className:vo("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:vo("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:vo("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(PC,{})]})]}),c.jsx("div",{className:vo("border-t border-[var(--border)] bg-[var(--surface)] p-4",p),children:y})]})}function Ix(t){return`P${String(t.number??0).padStart(3,"0")}`}function GC(){var g,x;const{requirements:t,phases:a}=Ul(),l=Ar(),[s]=qo(),o=((g=s.get("q"))==null?void 0:g.trim())??"",u=((x=s.get("status"))==null?void 0:x.trim())??"",f=v.useCallback(()=>l("new"),[l]);An("create",f);const m=v.useMemo(()=>new Map(a.map(y=>[y.id,y])),[a]),p=v.useMemo(()=>t.filter(y=>{const E=y.linkedPhaseIds.map(w=>{const S=m.get(w);return S?`${Ix(S)} ${S.title} ${S.summary}`:w});return(!u||y.status===u)&&id(o,[y.title,y.description,y.id,...E])}),[t,m,o,u]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(tn,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx(q0,{kind:"requirement",label:"Requirements"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Track top-level outcomes independently from features, then link them to the phases that deliver them."})]}),c.jsx(Ke,{to:"new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create requirement"})})]}),c.jsx(sd,{query:o,status:u,statusOptions:_m,placeholder:"Search requirement title, description, id, or linked phase",clearTo:"/requirements",resultsLabel:p.length===t.length?`${t.length} requirements`:`${p.length} of ${t.length} requirements`}),c.jsx("div",{className:"grid gap-3",children:t.length===0?c.jsxs(tn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No requirements yet. ",c.jsx(Ke,{to:"/requirements/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first requirement"})]}):p.length>0?p.map(y=>{const E=y.linkedPhaseIds.map(w=>m.get(w)).filter(Boolean);return c.jsx(tn,{className:"overflow-hidden p-0",children:c.jsxs(ha,{defaultOpen:!1,leading:c.jsx(Ja,{status:y.status}),title:c.jsx("h2",{className:"min-w-0 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:y.title}),count:E.length,contentClassName:"grid gap-4",subtitle:c.jsxs(c.Fragment,{children:[E.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[E.length," linked phase",E.length===1?"":"s"]}):null,E.length>0&&y.macroTasks.length>0?c.jsx("span",{className:"mx-2 text-[var(--text-subtle)]",children:"•"}):null,y.macroTasks.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[y.macroTasks.length," macro task",y.macroTasks.length===1?"":"s"]}):null]}),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:y.description?c.jsx("p",{className:"min-w-0 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:y.description}):null}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[c.jsx(Ke,{to:`${y.id}/edit`,children:c.jsx(gt,{type:"button",variant:"secondary",children:"Edit"})}),c.jsx(ua,{method:"post",action:`/requirements/${y.id}/delete`,onSubmit:w=>{window.confirm(`Delete requirement "${y.title}"?`)||w.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",children:"Delete"})})]})]}),E.length>0?c.jsxs("div",{className:"grid gap-2",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Linked phases"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:E.map(w=>{const S=w.featureId?`/features/${w.featureId}/phases/${w.id}`:"/features";return c.jsx(Ke,{to:S,className:"inline-flex max-w-full items-center rounded-full border border-[var(--border)] bg-[var(--surface-elevated)] px-3 py-1.5 text-sm text-[var(--text)] transition hover:border-[var(--accent)] hover:text-[var(--accent)]",children:c.jsxs("span",{className:"[overflow-wrap:anywhere]",children:[Ix(w)," — ",w.title]})},w.id)})})]}):c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:"No linked phases yet."})]})},y.id)}):c.jsx(tn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No requirements match the current filters."})})]}),c.jsx(hi,{})]})}async function XC({params:t}){const a=t.featureId;if(!a)throw new Response("featureId required",{status:400});const[l,s]=await Promise.all([Io(a),Kc(a)]);return{feature:l,phases:s}}function QC({featureId:t,feature:a,phase:l}){var y;const s=ds(),o=ds(),f=((y=s.formData)==null?void 0:y.get("status"))??l.status,m=s.state!=="idle",p=o.state!=="idle",g=Uc($0(l.tasks)),x=i0(l.tasks);return c.jsxs(vi,{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(Tr,{featureNum:a.number,phaseNum:l.number,featureId:a.id,phaseId:l.id}),c.jsx(rl,{id:gs({featureNum:a.number,phaseNum:l.number}),children:c.jsx("span",{className:"sr-only",children:"Copy phase path"})}),l.shortId?c.jsx(vs,{shortId:l.shortId}):null,l.handoff?c.jsx(bm,{phaseId:l.id,updatedAt:l.handoffUpdatedAt}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(Vo,{status:x.displayStatus,breakdown:x.breakdown})})]}),c.jsx(Ke,{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(Ke,{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(fs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,onSubmit:E=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||E.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(di,{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:E=>s.submit(E.currentTarget.form),children:ld.map(E=>c.jsx("option",{value:E.value,children:E.label},E.value))}),c.jsx(ps,{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(Ke,{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(fs,{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:E=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||E.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(di,{className:"h-4 w-4"})})})]}),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(Ke,{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(Ke,{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(Tr,{featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:o,taskId:u}),c.jsx(rl,{id:gs({featureNum:t,phaseNum:a,taskNum:l}),children:c.jsx("span",{className:"sr-only",children:"Copy path"})}),f?c.jsx(vs,{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 Vx(...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:Vx("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:Vx("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 KC(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(Dn,{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(Dn,{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(Dn,{text:a.implementationNotes,className:"mt-1"})]}):null]},a.id))})]})}const ZC={draft:NN,discovery:tR,planned:Pc,"in-progress":Bb,done:pm,blocked:$b,waiting:Ub,deferred:lR,canceled:_b,rejected:jN};function Bh(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Yx(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}const JC=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 D=0;D<=S;D++)m.push(l[D]);else m.push(a)}else{const S=t[0];S&&m.push(S.fromStatus);for(const D of t)m[m.length-1]!==D.toStatus&&m.push(D.toStatus)}m[m.length-1]!==a&&m.push(a);const p=new Set(m),g=a==="done"||JC.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 D=l[0];return S===D?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 D=l[S+1];p.has(D)||y.push(D)}}const E=t.length===0?y.filter((S,D)=>D===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:E.map((S,D)=>{const R=w(S),L=ZC[S]??Fc,I=p.has(S),q=x(S),X=q?`${Bh(S)} — ${Yx(q)}`:Bh(S),W=D===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:Bh(S)}),q?c.jsx("span",{className:"status-step-date",children:Yx(q)}):null]},`${S}-${D}`)})})}function Fx(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function WC(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}function eD(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=eD(t??[],a??"",l??[],s,o);return c.jsx(ha,{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:WC(f.date)}),c.jsx("span",{className:"font-semibold text-[var(--text-muted)]",children:Fx(f.fromStatus)}),c.jsx("span",{className:"text-[var(--text-subtle)]",children:"→"}),c.jsx("span",{className:"font-semibold text-[var(--text)]",children:Fx(f.toStatus)})]},m))})}function tD(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function nD(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 aD(t){return t.find(a=>["in-progress","discovery","planned","draft"].includes(a.status))}function rD(){var W,ne,z,T;const{feature:t,phases:a}=Ul(),l=t.acceptedDecisions??[],s=tD(a),o=nD(a),u=aD(a),f=s0(a),[m,p]=qo(),g=((W=m.get("q"))==null?void 0:W.trim())??"",x=((ne=m.get("status"))==null?void 0:ne.trim())??"",y=((z=m.get("sort"))==null?void 0:z.trim())??"priority",E=((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:E==="desc"?"desc":"asc"},S=v.useMemo(()=>[...a].sort((ee,fe)=>Eo(ee,fe,w.key,w.direction)),[a,w]),D=v.useMemo(()=>S.filter(ee=>(!x||ee.status===x)&&id(g,[ee.title,ee.id,ee.summary,ee.description])),[S,g,x]),R=Ar(),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 An("edit",I),An("create",q),An("delete",X),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ke,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Yc,{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(Vo,{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(ha,{title:"Description",children:c.jsx(Dn,{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(Ke,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit feature"})}),c.jsx(ua,{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(tn,{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:"Priority",value:qm(t.priority),visible:t.priority>0},{label:"Timeline",value:KC(t.startDate,t.endDate),visible:!!(t.startDate||t.endDate)}]}),t.workDone||t.workRemaining?c.jsx(ha,{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(Dn,{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(Dn,{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(tn,{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(Ke,{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(Mm,{sort:w,onChange:ee=>p(fe=>(fe.set("sort",ee.key),fe.set("dir",ee.direction),fe))}),c.jsx(sd,{query:g,status:x,statusOptions:ld,placeholder:"Search phase title, id, or summary",clearTo:`/features/${t.id}`,resultsLabel:D.length===a.length?`${a.length} phases`:`${D.length} of ${a.length} phases`})]}),c.jsx("div",{className:"grid gap-3",children:a.length===0?c.jsxs(tn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No phases yet. ",c.jsx(Ke,{to:`/features/${t.id}/phases/new`,className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a phase"})]}):D.length>0?D.map(ee=>c.jsx(QC,{featureId:t.id,feature:t,phase:ee},ee.id)):c.jsx(tn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),c.jsx(hi,{})]})}async function lD({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([Io(a),Zc(l),vm()]),f=u.filter(m=>m.linkedPhaseIds.includes(l));return{feature:s,phase:{...o,linkedRequirements:f}}}function Px(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function sD({featureId:t,featureNum:a,phaseId:l,phaseNum:s,task:o}){var w;const u=ds(),f=ds(),p=((w=u.formData)==null?void 0:w.get("status"))??o.status,g=u.state!=="idle",x=f.state!=="idle",y=Uc($C(o.subtasks)),E=n0(p);return c.jsxs(vi,{variant:"surface",status:E,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(Tr,{featureNum:a,phaseNum:s,taskNum:o.number,featureId:t,phaseId:l,taskId:o.id}),c.jsx(rl,{id:gs({featureNum:a,phaseNum:s,taskNum:o.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),o.shortId?c.jsx(vs,{shortId:o.shortId}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(Ja,{status:p})})]}),c.jsx(Ke,{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(Ke,{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(fs,{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(di,{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:Xo.map(S=>c.jsx("option",{value:S.value,children:S.label},S.value))}),c.jsx(ps,{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(Ke,{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(fs,{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(di,{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:[o.startedAt?c.jsxs("span",{children:["Started ",Px(o.startedAt)]}):null,o.completedAt?c.jsxs("span",{children:["Completed ",Px(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 iD(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 oD(){var fe,be,ye,ae;const{feature:t,phase:a}=Ul(),l=a.decisions??[],s=a.acceptedDecisions??[],o=a.linkedRequirements??[],u=iD(a),f=i0(a.tasks),[m,p]=qo(),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",E=((ae=m.get("dir"))==null?void 0:ae.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:E==="desc"?"desc":"asc"},S=v.useMemo(()=>[...a.tasks].sort((re,ge)=>Eo(re,ge,w.key,w.direction)),[a.tasks,w]),D=v.useMemo(()=>S.filter(re=>(!x||re.status===x)&&id(g,[re.title,re.id,re.description,re.shortName])),[S,g,x]),R=Ar(),L=v.useRef(null),[I,q]=v.useState(a.handoff??""),[X,W]=v.useState(!1),ne=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 Xb(a.id),q("")}catch{}finally{W(!1)}}},[a.id]);return An("edit",ne),An("create",z),An("delete",T),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ke,{to:`/features/${t.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Yc,{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(bm,{phaseId:a.id,updatedAt:a.handoffUpdatedAt}):null,c.jsx(Vo,{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(Dn,{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(Ke,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit phase"})}),c.jsx(Ke,{to:"tasks/new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})}),c.jsx(ua,{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(tn,{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:"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(ha,{title:"Notes",defaultOpen:!1,children:c.jsx(Dn,{text:a.notes,className:"plan-description"})}):null,c.jsx(ha,{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(Ja,{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(Ke,{to:`/requirements?q=${encodeURIComponent(re.title)}`,className:"text-sm font-semibold text-[var(--accent)] hover:underline sm:shrink-0",children:"Open in requirements →"})]})},re.id))}):c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No linked requirements yet."})}),a.description?c.jsx(ha,{title:"Description",children:c.jsx(Dn,{text:a.description,className:"plan-description"})}):null,l.length>0?c.jsx(ha,{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(Dn,{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(tn,{className:"grid gap-4",children:c.jsx(ha,{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(Dn,{text:I,className:"formatted-text max-w-none"})})})}):null,c.jsxs(tn,{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(Mm,{sort:w,onChange:re=>p(ge=>(ge.set("sort",re.key),ge.set("dir",re.direction),ge))}),c.jsx(sd,{query:g,status:x,statusOptions:Xo,placeholder:"Search task title, id, or description",clearTo:`/features/${t.id}/phases/${a.id}`,resultsLabel:D.length===a.tasks.length?`${a.tasks.length} tasks`:`${D.length} of ${a.tasks.length} tasks`})]}),c.jsx("div",{className:"grid gap-3",children:a.tasks.length===0?c.jsxs(tn,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No tasks yet. ",c.jsx(Ke,{to:"tasks/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a task"})]}):D.length>0?D.map(re=>c.jsx(sD,{featureId:t.id,featureNum:t.number,phaseId:a.id,phaseNum:a.number,task:re},re.id)):c.jsx(tn,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),c.jsx(hi,{})]})}async function uD({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([Io(a),Zc(l),Jc(s)]);return{feature:o,phase:u,task:f}}function Gx(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function cD({featureId:t,phaseId:a,taskId:l,item:s}){const o=ds(),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 dD(){var x,y;const{feature:t,phase:a,task:l}=Ul(),s=l.decisions??[],o=l.acceptedDecisions??[],u=l.checklist??[],f=Ar(),m=v.useRef(null),p=v.useCallback(()=>f("edit"),[f]),g=v.useCallback(()=>{var E;(E=m.current)==null||E.requestSubmit()},[]);return An("edit",p),An("delete",g),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ke,{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(Yc,{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(Ja,{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(Ke,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit task"})}),c.jsx(ua,{ref:m,method:"post",action:`/features/${t.id}/phases/${a.id}/tasks/${l.id}/delete`,className:"inline-flex",onSubmit:E=>{window.confirm(`Delete task "${l.title}"?`)||E.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(tn,{className:"grid gap-4",children:[l.description?c.jsx(ha,{title:"Description",children:c.jsx(Dn,{text:l.description,className:"plan-description"})}):null,l.notes?c.jsx(ha,{title:"Notes",defaultOpen:!1,children:c.jsx(Dn,{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(ha,{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((E,w)=>c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:c.jsx(Dn,{text:E})},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:"Priority",value:qm(l.priority),visible:l.priority>0},{label:"Short name",value:l.shortName,visible:!!l.shortName},{label:"Started",value:Gx(l.startedAt),visible:!!l.startedAt},{label:"Completed",value:Gx(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(E=>c.jsx(cD,{featureId:t.id,phaseId:a.id,taskId:l.id,item:E},E.id))}):c.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No steps defined."})]}),(y=l.subtasks)!=null&&y.length?c.jsx(ha,{title:"Subtasks",count:l.subtasks.length,defaultOpen:!1,contentClassName:"grid gap-2",children:l.subtasks.map(E=>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:E.title}),c.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:E.id})]}),c.jsx(Ja,{status:E.status})]},E.id))}):null]}),c.jsx(hi,{})]})}const fD=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Hl({title:t,description:a,children:l}){const s=Ar(),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(fD)).filter(D=>D.offsetParent!==null);if(y.length===0){x.preventDefault(),f.focus();return}const E=y[0],w=y[y.length-1],S=document.activeElement;x.shiftKey?(S===E||!f.contains(S))&&(x.preventDefault(),w.focus()):S===w&&(x.preventDefault(),E.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-label":"Close modal",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(oR,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:l})]})})]})}function $l({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 hD(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return An("submit",s,{allowInEditable:!0}),c.jsx(Hl,{title:"Create feature",description:"Top-level container for phases and tasks.",children:c.jsxs(ua,{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($l,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create feature"})})]})})}function mD(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);An("submit",s,{allowInEditable:!0});const u=ms("feature-detail").feature;return c.jsx(Hl,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:c.jsxs(ua,{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(ys,{name:"status",defaultValue:u.status,children:rd.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(ha,{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($l,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save feature"})})]})})}function pD(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return An("submit",s,{allowInEditable:!0}),c.jsx(Hl,{title:"Create phase",description:"A phase belongs to the current feature.",children:c.jsxs(ua,{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($l,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create phase"})})]})})}function ni(t){return t.join(`
289
+ `)}function gD(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);An("submit",s,{allowInEditable:!0});const u=ms("phase-detail").phase;return c.jsx(Hl,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:c.jsxs(ua,{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(ys,{name:"status",defaultValue:u.status,children:ld.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:ni(u.goals)})}),c.jsx(lt,{label:"Non-goals (one per line)",children:c.jsx(mn,{name:"nonGoals",defaultValue:ni(u.nonGoals)})}),c.jsx(lt,{label:"Dependencies (one per line)",children:c.jsx(mn,{name:"dependencies",defaultValue:ni(u.dependencies)})}),c.jsx(lt,{label:"Risks (one per line)",children:c.jsx(mn,{name:"risks",defaultValue:ni(u.risks)})}),c.jsx(lt,{label:"Open questions (one per line)",children:c.jsx(mn,{name:"openQuestions",defaultValue:ni(u.openQuestions)})}),c.jsx(lt,{label:"Completion criteria (one per line)",children:c.jsx(mn,{name:"completionCriteria",defaultValue:ni(u.completionCriteria)})}),c.jsx($l,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save phase"})})]})})}function vD(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return An("submit",s,{allowInEditable:!0}),c.jsx(Hl,{title:"Create task",description:"A task belongs to the current phase.",children:c.jsxs(ua,{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(ys,{name:"status",defaultValue:"planned",children:Xo.map(o=>c.jsx("option",{value:o.value,children:o.label},o.value))})}),c.jsx($l,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create task"})})]})})}function yD(t){return t.map(a=>a.title).join(`
292
+ `)}function xD(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);An("submit",s,{allowInEditable:!0});const u=ms("task-detail").task;return c.jsx(Hl,{title:"Edit task",description:"Update execution details and checklist items.",children:c.jsxs(ua,{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(ys,{name:"status",defaultValue:u.status,children:Xo.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:yD(u.checklist)})}),c.jsx($l,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save task"})})]})})}function bD(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);An("submit",s,{allowInEditable:!0});const{project:o}=ms("root");return c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ke,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Yc,{className:"h-4 w-4"})," Back to dashboard"]}),c.jsxs(tn,{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(ua,{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(Ke,{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 SD(t){return`P${String(t.number??0).padStart(3,"0")}`}function I0({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:[SD(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 wD(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);An("submit",s,{allowInEditable:!0});const{phases:o}=ms("requirements");return c.jsx(Hl,{title:"Create requirement",description:"Capture a top-level outcome that phases can implement and track.",children:c.jsxs(ua,{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(ys,{name:"status",defaultValue:"planned",children:_m.map(u=>c.jsx("option",{value:u.value,children:u.label},u.value))})}),c.jsx(I0,{phases:o}),c.jsx($l,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create requirement"})})]})})}function ED(){const a=kr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var p;return(p=l.current)==null?void 0:p.requestSubmit()},[]);An("submit",s,{allowInEditable:!0});const{requirementId:o}=nE(),{phases:u,requirements:f}=ms("requirements"),m=f.find(p=>p.id===o);return m?c.jsx(Hl,{title:"Edit requirement",description:"Update status, scope notes, and linked delivery phases.",children:c.jsxs(ua,{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(ys,{name:"status",defaultValue:m.status,children:_m.map(p=>c.jsx("option",{value:p.value,children:p.label},p.value))})}),c.jsx(I0,{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($l,{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 Ml(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 ND({request:t}){const a=await t.formData();return await mR({name:Jn(a,"name"),description:Bn(a,"description")}),Ua("/features")}async function RD({request:t,params:a}){const l=sn(a,"featureId"),s=await Io(l),o=await t.formData();return await Fb({...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 jD({params:t}){return await pR(sn(t,"featureId")),Ua("/features")}async function TD({request:t,params:a}){const l=sn(a,"featureId"),s=await Io(l),o=await t.formData();return await Fb({...s,status:Jn(o,"status")}),null}async function CD({request:t,params:a}){const l=sn(a,"featureId"),s=await t.formData();return await xR({featureId:l,title:Jn(s,"title"),summary:Bn(s,"summary"),description:Bn(s,"description")}),Ua(`/features/${l}`)}async function DD({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),o=await Zc(s),u=await t.formData();return await Pb({...o,title:Jn(u,"title"),status:Jn(u,"status"),priority:Fm(u,"priority"),summary:Bn(u,"summary"),description:Bn(u,"description"),goals:Ml(u,"goals"),nonGoals:Ml(u,"nonGoals"),dependencies:Ml(u,"dependencies"),risks:Ml(u,"risks"),openQuestions:Ml(u,"openQuestions"),completionCriteria:Ml(u,"completionCriteria")}),Ua(`/features/${l}/phases/${s}`)}async function AD({params:t}){const a=sn(t,"featureId"),l=sn(t,"phaseId");return await bR(l),Ua(`/features/${a}`)}async function kD({request:t,params:a}){const l=sn(a,"phaseId"),s=await Zc(l),o=await t.formData();return await Pb({...s,status:Jn(o,"status")}),null}async function OD({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),o=await t.formData(),u=Ml(o,"checklist");return await SR(s,{title:Jn(o,"title"),description:Bn(o,"description"),status:Bn(o,"status")||"planned",...u.length?{checklist:u}:{}}),Ua(`/features/${l}/phases/${s}`)}function MD(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 _D({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),o=sn(a,"taskId"),u=await Jc(o),f=await t.formData();return await ym({...u,phaseId:s,title:Jn(f,"title"),status:Jn(f,"status"),priority:Fm(f,"priority"),description:Bn(f,"description"),checklist:MD(u.checklist,Ml(f,"checklist"))}),Ua(`/features/${l}/phases/${s}/tasks/${o}`)}async function LD({params:t}){const a=sn(t,"featureId"),l=sn(t,"phaseId"),s=sn(t,"taskId");return await wR(s),Ua(`/features/${a}/phases/${l}`)}async function zD({request:t,params:a}){const l=sn(a,"phaseId"),s=sn(a,"taskId"),o=await Jc(s),u=await t.formData();return await ym({...o,phaseId:l,status:Jn(u,"status")}),null}async function UD({request:t}){const a=await Vb(),l=await t.formData();return await fR({...a,name:Bn(l,"name")||a.name,description:Bn(l,"description"),goal:Bn(l,"goal")}),Ua("/")}async function BD({request:t}){const a=await t.formData();return await gR({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 HD({request:t,params:a}){const l=sn(a,"requirementId"),s=(await vm()).find(u=>u.id===l);if(!s)throw new Response(`Requirement not found: ${l}`,{status:404});const o=await t.formData();return await vR({...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 $D({params:t}){return await yR(sn(t,"requirementId")),Ua("/requirements")}function qD(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function ID(){return{handoffs:await Yh()}}function VD(){const{handoffs:t}=Ul(),[a,l]=v.useState(t),[s,o]=v.useState(null),[u,f]=v.useState(""),m=fr();async function p(g){if(!(s||!window.confirm(`Clear handoff for ${g.compositeRef}?`))){o(g.phaseId),f("");try{await Xb(g.phaseId),l(y=>y.filter(E=>E.phaseId!==g.phaseId)),Yh().then(l).catch(()=>{})}catch(y){const E=y instanceof Error?y.message:String(y);f(E||`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")&&Yh().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(tn,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),c.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Entity-scoped handoffs written on phases (",c.jsx("code",{children:"phase.handoff"}),")."]})]}),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.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),c.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Entity-scoped handoffs written on phases (",c.jsx("code",{children:"phase.handoff"}),"). ",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(tn,{className:"overflow-hidden p-0",children:c.jsx(ha,{defaultOpen:!1,title:c.jsxs(c.Fragment,{children:[c.jsx(rl,{id:g.compositeRef,children:g.compositeRef}),c.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Updated ",qD(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(Ke,{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(Dn,{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))]})}async function YD({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 Jc(s);return await ym({...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 FD=GE([{id:"root",path:"/",loader:XR,element:c.jsx(QR,{}),errorElement:c.jsx(KR,{}),children:[{index:!0,loader:ZR,element:c.jsx(UC,{})},{path:"features",id:"features",loader:BC,element:c.jsx(YC,{}),children:[{path:"new",element:c.jsx(hD,{}),action:ND}]},{path:"features/:featureId",id:"feature-detail",loader:XC,element:c.jsx(rD,{}),children:[{path:"edit",element:c.jsx(mD,{}),action:RD},{path:"phases/new",element:c.jsx(pD,{}),action:CD}]},{path:"requirements",id:"requirements",loader:FC,element:c.jsx(GC,{}),children:[{path:"new",element:c.jsx(wD,{}),action:BD},{path:":requirementId/edit",element:c.jsx(ED,{}),action:HD}]},{path:"project/edit",element:c.jsx(bD,{}),action:UD},{path:"handoff",loader:ID,element:c.jsx(VD,{})},{path:"features/:featureId/delete",action:jD},{path:"requirements/:requirementId/delete",action:$D},{path:"features/:featureId/status",action:TD},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:lD,element:c.jsx(oD,{}),children:[{path:"edit",element:c.jsx(gD,{}),action:DD},{path:"tasks/new",element:c.jsx(vD,{}),action:OD}]},{path:"features/:featureId/phases/:phaseId/delete",action:AD},{path:"features/:featureId/phases/:phaseId/status",action:kD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:uD,element:c.jsx(dD,{}),children:[{path:"edit",element:c.jsx(xD,{}),action:_D}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:LD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:zD},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:YD}]}]),V0=document.getElementById("root");if(!V0)throw new Error("#root not found");zS.createRoot(V0).render(c.jsx(v.StrictMode,{children:c.jsx(nN,{router:FD})}));