@agent-plan/server 0.2.21 → 0.2.22-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +65 -25
- package/package.json +2 -2
- package/web-ui-dist/assets/index-B2Nv9Ykv.css +1 -0
- package/web-ui-dist/assets/index-MvITvgH7.js +298 -0
- package/web-ui-dist/index.html +2 -2
- package/web-ui-dist/assets/index-B97B4wii.js +0 -298
- package/web-ui-dist/assets/index-Bi9ehfxU.css +0 -1
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
var US=Object.defineProperty;var BS=(t,a,l)=>a in t?US(t,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[a]=l;var mn=(t,a,l)=>BS(t,typeof a!="symbol"?a+"":a,l);function HS(t,a){for(var l=0;l<a.length;l++){const s=a[l];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in t)){const o=Object.getOwnPropertyDescriptor(s,c);o&&Object.defineProperty(t,c,o.get?o:{enumerable:!0,get:()=>s[c]})}}}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 c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const o of c)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const o={};return c.integrity&&(o.integrity=c.integrity),c.referrerPolicy&&(o.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?o.credentials="include":c.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(c){if(c.ep)return;c.ep=!0;const o=l(c);fetch(c.href,o)}})();function $S(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var dh={exports:{}},co={};/**
|
|
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 Ey;function qS(){if(Ey)return co;Ey=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(s,c,o){var f=null;if(o!==void 0&&(f=""+o),c.key!==void 0&&(f=""+c.key),"key"in c){o={};for(var m in c)m!=="key"&&(o[m]=c[m])}else o=c;return c=o.ref,{$$typeof:t,type:s,key:f,ref:c!==void 0?c:null,props:o}}return co.Fragment=a,co.jsx=l,co.jsxs=l,co}var Ny;function IS(){return Ny||(Ny=1,dh.exports=qS()),dh.exports}var u=IS(),fh={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 Ry;function PS(){if(Ry)return et;Ry=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),N=Symbol.iterator;function w(D){return D===null||typeof D!="object"?null:(D=N&&D[N]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,R={};function z(D,P,te){this.props=D,this.context=P,this.refs=R,this.updater=te||S}z.prototype.isReactComponent={},z.prototype.setState=function(D,P){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,P,"setState")},z.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function I(){}I.prototype=z.prototype;function q(D,P,te){this.props=D,this.context=P,this.refs=R,this.updater=te||S}var X=q.prototype=new I;X.constructor=q,j(X,z.prototype),X.isPureReactComponent=!0;var ee=Array.isArray;function ne(){}var M={H:null,A:null,T:null,S:null},C=Object.prototype.hasOwnProperty;function ue(D,P,te){var he=te.ref;return{$$typeof:t,type:D,key:P,ref:he!==void 0?he:null,props:te}}function me(D,P){return ue(D.type,P,D.props)}function ye(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function ae(D){var P={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(te){return P[te]})}var K=/\/+/g;function ge(D,P){return typeof D=="object"&&D!==null&&D.key!=null?ae(""+D.key):P.toString(36)}function be(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(ne,ne):(D.status="pending",D.then(function(P){D.status==="pending"&&(D.status="fulfilled",D.value=P)},function(P){D.status==="pending"&&(D.status="rejected",D.reason=P)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function U(D,P,te,he,Ne){var je=typeof D;(je==="undefined"||je==="boolean")&&(D=null);var ze=!1;if(D===null)ze=!0;else switch(je){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(D.$$typeof){case t:case a:ze=!0;break;case x:return ze=D._init,U(ze(D._payload),P,te,he,Ne)}}if(ze)return Ne=Ne(D),ze=he===""?"."+ge(D,0):he,ee(Ne)?(te="",ze!=null&&(te=ze.replace(K,"$&/")+"/"),U(Ne,P,te,"",function(nt){return nt})):Ne!=null&&(ye(Ne)&&(Ne=me(Ne,te+(Ne.key==null||D&&D.key===Ne.key?"":(""+Ne.key).replace(K,"$&/")+"/")+ze)),P.push(Ne)),1;ze=0;var ct=he===""?".":he+":";if(ee(D))for(var Ge=0;Ge<D.length;Ge++)he=D[Ge],je=ct+ge(he,Ge),ze+=U(he,P,te,je,Ne);else if(Ge=w(D),typeof Ge=="function")for(D=Ge.call(D),Ge=0;!(he=D.next()).done;)he=he.value,je=ct+ge(he,Ge++),ze+=U(he,P,te,je,Ne);else if(je==="object"){if(typeof D.then=="function")return U(be(D),P,te,he,Ne);throw P=String(D),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return ze}function B(D,P,te){if(D==null)return D;var he=[],Ne=0;return U(D,he,"","",function(je){return P.call(te,je,Ne++)}),he}function oe(D){if(D._status===-1){var P=D._result;P=P(),P.then(function(te){(D._status===0||D._status===-1)&&(D._status=1,D._result=te)},function(te){(D._status===0||D._status===-1)&&(D._status=2,D._result=te)}),D._status===-1&&(D._status=0,D._result=P)}if(D._status===1)return D._result.default;throw D._result}var de=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},we={map:B,forEach:function(D,P,te){B(D,function(){P.apply(this,arguments)},te)},count:function(D){var P=0;return B(D,function(){P++}),P},toArray:function(D){return B(D,function(P){return P})||[]},only:function(D){if(!ye(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return et.Activity=y,et.Children=we,et.Component=z,et.Fragment=l,et.Profiler=c,et.PureComponent=q,et.StrictMode=s,et.Suspense=p,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,et.__COMPILER_RUNTIME={__proto__:null,c:function(D){return M.H.useMemoCache(D)}},et.cache=function(D){return function(){return D.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(D,P,te){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var he=j({},D.props),Ne=D.key;if(P!=null)for(je in P.key!==void 0&&(Ne=""+P.key),P)!C.call(P,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&P.ref===void 0||(he[je]=P[je]);var je=arguments.length-2;if(je===1)he.children=te;else if(1<je){for(var ze=Array(je),ct=0;ct<je;ct++)ze[ct]=arguments[ct+2];he.children=ze}return ue(D.type,Ne,he)},et.createContext=function(D){return D={$$typeof:f,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:o,_context:D},D},et.createElement=function(D,P,te){var he,Ne={},je=null;if(P!=null)for(he in P.key!==void 0&&(je=""+P.key),P)C.call(P,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Ne[he]=P[he]);var ze=arguments.length-2;if(ze===1)Ne.children=te;else if(1<ze){for(var ct=Array(ze),Ge=0;Ge<ze;Ge++)ct[Ge]=arguments[Ge+2];Ne.children=ct}if(D&&D.defaultProps)for(he in ze=D.defaultProps,ze)Ne[he]===void 0&&(Ne[he]=ze[he]);return ue(D,je,Ne)},et.createRef=function(){return{current:null}},et.forwardRef=function(D){return{$$typeof:m,render:D}},et.isValidElement=ye,et.lazy=function(D){return{$$typeof:x,_payload:{_status:-1,_result:D},_init:oe}},et.memo=function(D,P){return{$$typeof:g,type:D,compare:P===void 0?null:P}},et.startTransition=function(D){var P=M.T,te={};M.T=te;try{var he=D(),Ne=M.S;Ne!==null&&Ne(te,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(ne,de)}catch(je){de(je)}finally{P!==null&&te.types!==null&&(P.types=te.types),M.T=P}},et.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},et.use=function(D){return M.H.use(D)},et.useActionState=function(D,P,te){return M.H.useActionState(D,P,te)},et.useCallback=function(D,P){return M.H.useCallback(D,P)},et.useContext=function(D){return M.H.useContext(D)},et.useDebugValue=function(){},et.useDeferredValue=function(D,P){return M.H.useDeferredValue(D,P)},et.useEffect=function(D,P){return M.H.useEffect(D,P)},et.useEffectEvent=function(D){return M.H.useEffectEvent(D)},et.useId=function(){return M.H.useId()},et.useImperativeHandle=function(D,P,te){return M.H.useImperativeHandle(D,P,te)},et.useInsertionEffect=function(D,P){return M.H.useInsertionEffect(D,P)},et.useLayoutEffect=function(D,P){return M.H.useLayoutEffect(D,P)},et.useMemo=function(D,P){return M.H.useMemo(D,P)},et.useOptimistic=function(D,P){return M.H.useOptimistic(D,P)},et.useReducer=function(D,P,te){return M.H.useReducer(D,P,te)},et.useRef=function(D){return M.H.useRef(D)},et.useState=function(D){return M.H.useState(D)},et.useSyncExternalStore=function(D,P,te){return M.H.useSyncExternalStore(D,P,te)},et.useTransition=function(){return M.H.useTransition()},et.version="19.2.7",et}var jy;function rm(){return jy||(jy=1,fh.exports=PS()),fh.exports}var v=rm();const cn=$S(v),VS=HS({__proto__:null,default:cn},[v]);var hh={exports:{}},uo={},mh={exports:{}},ph={};/**
|
|
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 Ty;function FS(){return Ty||(Ty=1,(function(t){function a(U,B){var oe=U.length;U.push(B);e:for(;0<oe;){var de=oe-1>>>1,we=U[de];if(0<c(we,B))U[de]=B,U[oe]=we,oe=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],oe=U.pop();if(oe!==B){U[0]=oe;e:for(var de=0,we=U.length,D=we>>>1;de<D;){var P=2*(de+1)-1,te=U[P],he=P+1,Ne=U[he];if(0>c(te,oe))he<we&&0>c(Ne,te)?(U[de]=Ne,U[he]=oe,de=he):(U[de]=te,U[P]=oe,de=P);else if(he<we&&0>c(Ne,oe))U[de]=Ne,U[he]=oe,de=he;else break e}}return B}function c(U,B){var oe=U.sortIndex-B.sortIndex;return oe!==0?oe:U.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var f=Date,m=f.now();t.unstable_now=function(){return f.now()-m}}var p=[],g=[],x=1,y=null,N=3,w=!1,S=!1,j=!1,R=!1,z=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 ee(U){if(j=!1,X(U),!S)if(l(p)!==null)S=!0,ne||(ne=!0,ae());else{var B=l(g);B!==null&&be(ee,B.startTime-U)}}var ne=!1,M=-1,C=5,ue=-1;function me(){return R?!0:!(t.unstable_now()-ue<C)}function ye(){if(R=!1,ne){var U=t.unstable_now();ue=U;var B=!0;try{e:{S=!1,j&&(j=!1,I(M),M=-1),w=!0;var oe=N;try{t:{for(X(U),y=l(p);y!==null&&!(y.expirationTime>U&&me());){var de=y.callback;if(typeof de=="function"){y.callback=null,N=y.priorityLevel;var we=de(y.expirationTime<=U);if(U=t.unstable_now(),typeof we=="function"){y.callback=we,X(U),B=!0;break t}y===l(p)&&s(p),X(U)}else s(p);y=l(p)}if(y!==null)B=!0;else{var D=l(g);D!==null&&be(ee,D.startTime-U),B=!1}}break e}finally{y=null,N=oe,w=!1}B=void 0}}finally{B?ae():ne=!1}}}var ae;if(typeof q=="function")ae=function(){q(ye)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,ge=K.port2;K.port1.onmessage=ye,ae=function(){ge.postMessage(null)}}else ae=function(){z(ye,0)};function be(U,B){M=z(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"):C=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_next=function(U){switch(N){case 1:case 2:case 3:var B=3;break;default:B=N}var oe=N;N=B;try{return U()}finally{N=oe}},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 oe=N;N=U;try{return B()}finally{N=oe}},t.unstable_scheduleCallback=function(U,B,oe){var de=t.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?de+oe:de):oe=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=oe+we,U={id:x++,callback:B,priorityLevel:U,startTime:oe,expirationTime:we,sortIndex:-1},oe>de?(U.sortIndex=oe,a(g,U),l(p)===null&&U===l(g)&&(j?(I(M),M=-1):j=!0,be(ee,oe-de))):(U.sortIndex=we,a(p,U),S||w||(S=!0,ne||(ne=!0,ae()))),U},t.unstable_shouldYield=me,t.unstable_wrapCallback=function(U){var B=N;return function(){var oe=N;N=B;try{return U.apply(this,arguments)}finally{N=oe}}}})(ph)),ph}var Cy;function YS(){return Cy||(Cy=1,mh.exports=FS()),mh.exports}var gh={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 Dy;function GS(){if(Dy)return sa;Dy=1;var t=rm();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},c=Symbol.for("react.portal");function o(p,g,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,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 o(p,g,null,x)},sa.flushSync=function(p){var g=f.T,x=s.p;try{if(f.T=null,s.p=2,p)return p()}finally{f.T=g,s.p=x,s.d.f()}},sa.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(p,g))},sa.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},sa.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var x=g.as,y=m(x,g.crossOrigin),N=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?s.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:N,fetchPriority:w}):x==="script"&&s.d.X(p,{crossOrigin:y,integrity:N,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},sa.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var x=m(g.as,g.crossOrigin);s.d.M(p,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&s.d.M(p)},sa.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,y=m(x,g.crossOrigin);s.d.L(p,x,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},sa.preloadModule=function(p,g){if(typeof p=="string")if(g){var x=m(g.as,g.crossOrigin);s.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else s.d.m(p)},sa.requestFormReset=function(p){s.d.r(p)},sa.unstable_batchedUpdates=function(p,g){return p(g)},sa.useFormState=function(p,g,x){return f.H.useFormState(p,g,x)},sa.useFormStatus=function(){return f.H.useHostTransitionStatus()},sa.version="19.2.7",sa}var Ay;function eb(){if(Ay)return gh.exports;Ay=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(),gh.exports=GS(),gh.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 ky;function XS(){if(ky)return uo;ky=1;var t=YS(),a=rm(),l=eb();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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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(o(e)!==e)throw Error(s(188))}function g(e){var n=e.alternate;if(!n){if(n=o(e),n===null)throw Error(s(188));return n!==e?null:e}for(var r=e,i=n;;){var d=r.return;if(d===null)break;var h=d.alternate;if(h===null){if(i=d.return,i!==null){r=i;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===r)return p(d),e;if(h===i)return p(d),n;h=h.sibling}throw Error(s(188))}if(r.return!==i.return)r=d,i=h;else{for(var b=!1,E=d.child;E;){if(E===r){b=!0,r=d,i=h;break}if(E===i){b=!0,i=d,r=h;break}E=E.sibling}if(!b){for(E=h.child;E;){if(E===r){b=!0,r=h,i=d;break}if(E===i){b=!0,i=h,r=d;break}E=E.sibling}if(!b)throw Error(s(189))}}if(r.alternate!==i)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?e:n}function x(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=x(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,N=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),q=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),ye=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=ye&&e[ye]||e["@@iterator"],typeof e=="function"?e:null)}var K=Symbol.for("react.client.reference");function ge(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===K?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case z:return"Profiler";case R:return"StrictMode";case ee:return"Suspense";case ne:return"SuspenseList";case ue: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 M:return n=e.displayName||null,n!==null?n:ge(e.type)||"Memo";case C:n=e._payload,e=e._init;try{return ge(e(n))}catch{}}return null}var be=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,oe={pending:!1,data:null,method:null,action:null},de=[],we=-1;function D(e){return{current:e}}function P(e){0>we||(e.current=de[we],de[we]=null,we--)}function te(e,n){we++,de[we]=e.current,e.current=n}var he=D(null),Ne=D(null),je=D(null),ze=D(null);function ct(e,n){switch(te(je,n),te(Ne,e),te(he,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Yv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Yv(n),e=Gv(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(he),te(he,e)}function Ge(){P(he),P(Ne),P(je)}function nt(e){e.memoizedState!==null&&te(ze,e);var n=he.current,r=Gv(n,e.type);n!==r&&(te(Ne,e),te(he,r))}function Sn(e){Ne.current===e&&(P(he),P(Ne)),ze.current===e&&(P(ze),lo._currentValue=oe)}var Xt,ft;function ie(e){if(Xt===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Xt=n&&n[1]||"",ft=-1<r.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Xt+e+ft}var $e=!1;function at(e,n){if(!e||$e)return"";$e=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(Q){var G=Q}Reflect.construct(e,[],se)}else{try{se.call()}catch(Q){G=Q}e.call(se.prototype)}}else{try{throw Error()}catch(Q){G=Q}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=i.DetermineComponentFrameRoot(),b=h[0],E=h[1];if(b&&E){var k=b.split(`
|
|
44
|
+
`),F=E.split(`
|
|
45
|
+
`);for(d=i=0;i<k.length&&!k[i].includes("DetermineComponentFrameRoot");)i++;for(;d<F.length&&!F[d].includes("DetermineComponentFrameRoot");)d++;if(i===k.length||d===F.length)for(i=k.length-1,d=F.length-1;1<=i&&0<=d&&k[i]!==F[d];)d--;for(;1<=i&&0<=d;i--,d--)if(k[i]!==F[d]){if(i!==1||d!==1)do if(i--,d--,0>d||k[i]!==F[d]){var W=`
|
|
46
|
+
`+k[i].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=i&&0<=d);break}}}finally{$e=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?ie(r):""}function Ut(e,n){switch(e.tag){case 26:case 27:case 5:return ie(e.type);case 16:return ie("Lazy");case 13:return e.child!==n&&n!==null?ie("Suspense Fallback"):ie("Suspense");case 19:return ie("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 ie("Activity");default:return""}}function gn(e){try{var n="",r=null;do n+=Ut(e,r),r=e,e=e.return;while(e);return n}catch(i){return`
|
|
47
|
+
Error generating stack: `+i.message+`
|
|
48
|
+
`+i.stack}}var jt=Object.prototype.hasOwnProperty,_t=t.unstable_scheduleCallback,Qt=t.unstable_cancelCallback,Hn=t.unstable_shouldYield,$n=t.unstable_requestPaint,tn=t.unstable_now,fa=t.unstable_getCurrentPriorityLevel,ha=t.unstable_ImmediatePriority,Wn=t.unstable_UserBlockingPriority,qn=t.unstable_NormalPriority,fe=t.unstable_LowPriority,Ce=t.unstable_IdlePriority,De=t.log,Ye=t.unstable_setDisableYieldValue,qe=null,J=null;function Tt(e){if(typeof De=="function"&&Ye(e),J&&typeof J.setStrictMode=="function")try{J.setStrictMode(qe,e)}catch{}}var Kt=Math.clz32?Math.clz32:qa,Vn=Math.log,vn=Math.LN2;function qa(e){return e>>>=0,e===0?32:31-(Vn(e)/vn|0)|0}var Me=256,vt=262144,yt=4194304;function wt(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Bt(e,n,r){var i=e.pendingLanes;if(i===0)return 0;var d=0,h=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var E=i&134217727;return E!==0?(i=E&~h,i!==0?d=wt(i):(b&=E,b!==0?d=wt(b):r||(r=E&~e,r!==0&&(d=wt(r))))):(E=i&~h,E!==0?d=wt(E):b!==0?d=wt(b):r||(r=i&~e,r!==0&&(d=wt(r)))),d===0?0:n!==0&&n!==d&&(n&h)===0&&(h=d&-d,r=n&-n,h>=r||h===32&&(r&4194048)!==0)?n:d}function Ct(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function nn(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zt(){var e=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),e}function Ht(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function ht(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,n,r,i,d,h){var b=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var E=e.entanglements,k=e.expirationTimes,F=e.hiddenUpdates;for(r=b&~r;0<r;){var W=31-Kt(r),se=1<<W;E[W]=0,k[W]=-1;var G=F[W];if(G!==null)for(F[W]=null,W=0;W<G.length;W++){var Q=G[W];Q!==null&&(Q.lane&=-536870913)}r&=~se}i!==0&&wn(e,i,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(b&~n))}function wn(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var i=31-Kt(n);e.entangledLanes|=n,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function kn(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var i=31-Kt(r),d=1<<i;d&n|e[i]&n&&(e[i]|=n),r&=~d}}function A(e,n){var r=n&-n;return r=(r&42)!==0?1:_(r),(r&(e.suspendedLanes|n))!==0?0:r}function _(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 Z(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:gy(e.type))}function le(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,Xe="__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[Xe]}function $t(e){var n=e[ve];if(n)return n;for(var r=e.parentNode;r;){if(n=r[Re]||r[ve]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=ey(e);e!==null;){if(r=e[ve])return r;e=ey(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 ut(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(s(33))}function it(e){var n=e[ke];return n||(n=e[ke]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function dt(e){e[Ze]=!0}var Jt=new Set,Fn={};function En(e,n){On(e,n),On(e+"Capture",n)}function On(e,n){for(Fn[e]=n,e=0;e<n.length;e++)Jt.add(n[e])}var Mn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Yn={},ga={};function ul(e){return jt.call(ga,e)?!0:jt.call(Yn,e)?!1:Mn.test(e)?ga[e]=!0:(Yn[e]=!0,!1)}function ea(e,n,r){if(ul(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 gr(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function Qe(e,n,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+i)}}function Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wt(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ta(e,n,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,h=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(b){r=""+b,h.call(this,b)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(b){r=""+b},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function _n(e){if(!e._valueTracker){var n=Wt(e)?"checked":"value";e._valueTracker=ta(e,n,""+e[n])}}function Or(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),i="";return e&&(i=Wt(e)?e.checked?"true":"false":e.value),e=i,e!==r?(n.setValue(e),!0):!1}function Rt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ta=/[\n"\\]/g;function Gn(e){return e.replace(Ta,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Yl(e,n,r,i,d,h,b,E){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),n!=null?b==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Nt(n)):e.value!==""+Nt(n)&&(e.value=""+Nt(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?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"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+Nt(E):e.removeAttribute("name")}function Si(e,n,r,i,d,h,b,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){_n(e);return}r=r!=null?""+Nt(r):"",n=n!=null?""+Nt(n):r,E||n===e.value||(e.value=n),e.defaultValue=n}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=E?e.checked:!!i,e.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),_n(e)}function Dt(e,n,r){n==="number"&&Rt(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function vr(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 Jo(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 sr(e,n,r,i){if(n==null){if(i!=null){if(r!=null)throw Error(s(92));if(be(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 dl(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var dd=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ss(e,n,r){var i=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?i?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":i?e.setProperty(n,r):typeof r!="number"||r===0||dd.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function va(e,n,r){if(n!=null&&typeof n!="object")throw Error(s(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||n!=null&&n.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in n)i=n[d],n.hasOwnProperty(d)&&r[d]!==i&&Ss(e,d,i)}else for(var h in n)n.hasOwnProperty(h)&&Ss(e,h,n[h])}function Gl(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ws=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ya=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function an(e){return ya.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function na(){}var Ca=null;function Mr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yr=null,_r=null;function wi(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(Yl(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));Yl(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":Jo(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&vr(e,!!r.multiple,n,!1)}}}var xr=!1;function Ei(e,n,r){if(xr)return e(n,r);xr=!0;try{var i=e(n);return i}finally{if(xr=!1,(yr!==null||_r!==null)&&(Hc(),yr&&(n=yr,e=_r,_r=yr=null,wi(n),e)))for(n=0;n<e.length;n++)wi(e[n])}}function Ia(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 ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ni=!1;if(ir)try{var Lr={};Object.defineProperty(Lr,"passive",{get:function(){Ni=!0}}),window.addEventListener("test",Lr,Lr),window.removeEventListener("test",Lr,Lr)}catch{Ni=!1}var Pa=null,Ri=null,Es=null;function Wo(){if(Es)return Es;var e,n=Ri,r=n.length,i,d="value"in Pa?Pa.value:Pa.textContent,h=d.length;for(e=0;e<r&&n[e]===d[e];e++);var b=r-e;for(i=1;i<=b&&n[r-i]===d[h-i];i++);return Es=d.slice(e,1<i?1-i:void 0)}function Ns(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function zr(){return!0}function ec(){return!1}function aa(e){function n(r,i,d,h,b){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(r=e[E],this[E]=r?r(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?zr:ec,this.isPropagationStopped=ec,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),Xl=y({},Ur,{view:0,detail:0}),fd=aa(Xl),fl,Ql,Kl,Hr=y({},Xl,{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!==Kl&&(Kl&&e.type==="mousemove"?(fl=e.screenX-Kl.screenX,Ql=e.screenY-Kl.screenY):Ql=fl=0,Kl=e),fl)},movementY:function(e){return"movementY"in e?e.movementY:Ql}}),tc=aa(Hr),T=y({},Hr,{dataTransfer:0}),Y=aa(T),Ee=y({},Xl,{relatedTarget:0}),xe=aa(Ee),Fe=y({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),ce=aa(Fe),pe=y({},Ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Se=aa(pe),Ke=y({},Ur,{data:0}),rt=aa(Ke),Be={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Lt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ra(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Lt[e])?!!n[e]:!1}function la(){return ra}var xa=y({},Xl,{key:function(e){if(e.key){var n=Be[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Ns(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:la,charCode:function(e){return e.type==="keypress"?Ns(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ns(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rn=aa(xa),un=y({},Hr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zt=aa(un),Zl=y({},Xl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:la}),br=aa(Zl),hd=y({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),nc=aa(hd),ac=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}),md=aa(ac),pd=y({},Ur,{newState:0,oldState:0}),r1=aa(pd),l1=[9,13,27,32],gd=ir&&"CompositionEvent"in window,ji=null;ir&&"documentMode"in document&&(ji=document.documentMode);var s1=ir&&"TextEvent"in window&&!ji,Jm=ir&&(!gd||ji&&8<ji&&11>=ji),Wm=" ",ep=!1;function tp(e,n){switch(e){case"keyup":return l1.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function np(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rs=!1;function i1(e,n){switch(e){case"compositionend":return np(n);case"keypress":return n.which!==32?null:(ep=!0,Wm);case"textInput":return e=n.data,e===Wm&&ep?null:e;default:return null}}function o1(e,n){if(Rs)return e==="compositionend"||!gd&&tp(e,n)?(e=Wo(),Es=Ri=Pa=null,Rs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Jm&&n.locale!=="ko"?null:n.data;default:return null}}var c1={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 ap(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!c1[e.type]:n==="textarea"}function rp(e,n,r,i){yr?_r?_r.push(i):_r=[i]:yr=i,n=Yc(n,"onChange"),0<n.length&&(r=new Br("onChange","change",null,r,i),e.push({event:r,listeners:n}))}var Ti=null,Ci=null;function u1(e){$v(e,0)}function rc(e){var n=ut(e);if(Or(n))return e}function lp(e,n){if(e==="change")return n}var sp=!1;if(ir){var vd;if(ir){var yd="oninput"in document;if(!yd){var ip=document.createElement("div");ip.setAttribute("oninput","return;"),yd=typeof ip.oninput=="function"}vd=yd}else vd=!1;sp=vd&&(!document.documentMode||9<document.documentMode)}function op(){Ti&&(Ti.detachEvent("onpropertychange",cp),Ci=Ti=null)}function cp(e){if(e.propertyName==="value"&&rc(Ci)){var n=[];rp(n,Ci,e,Mr(e)),Ei(u1,n)}}function d1(e,n,r){e==="focusin"?(op(),Ti=n,Ci=r,Ti.attachEvent("onpropertychange",cp)):e==="focusout"&&op()}function f1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rc(Ci)}function h1(e,n){if(e==="click")return rc(n)}function m1(e,n){if(e==="input"||e==="change")return rc(n)}function p1(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Da=typeof Object.is=="function"?Object.is:p1;function Di(e,n){if(Da(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)||!Da(e[d],n[d]))return!1}return!0}function up(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dp(e,n){var r=up(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=up(r)}}function fp(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?fp(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function hp(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 xd(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 g1=ir&&"documentMode"in document&&11>=document.documentMode,js=null,bd=null,Ai=null,Sd=!1;function mp(e,n,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Sd||js==null||js!==Rt(i)||(i=js,"selectionStart"in i&&xd(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ai&&Di(Ai,i)||(Ai=i,i=Yc(bd,"onSelect"),0<i.length&&(n=new Br("onSelect","select",null,n,r),e.push({event:n,listeners:i}),n.target=js)))}function Jl(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var Ts={animationend:Jl("Animation","AnimationEnd"),animationiteration:Jl("Animation","AnimationIteration"),animationstart:Jl("Animation","AnimationStart"),transitionrun:Jl("Transition","TransitionRun"),transitionstart:Jl("Transition","TransitionStart"),transitioncancel:Jl("Transition","TransitionCancel"),transitionend:Jl("Transition","TransitionEnd")},wd={},pp={};ir&&(pp=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function Wl(e){if(wd[e])return wd[e];if(!Ts[e])return e;var n=Ts[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in pp)return wd[e]=n[r];return e}var gp=Wl("animationend"),vp=Wl("animationiteration"),yp=Wl("animationstart"),v1=Wl("transitionrun"),y1=Wl("transitionstart"),x1=Wl("transitioncancel"),xp=Wl("transitionend"),bp=new Map,Ed="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(" ");Ed.push("scrollEnd");function or(e,n){bp.set(e,n),En(n,[e])}var lc=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)},Va=[],Cs=0,Nd=0;function sc(){for(var e=Cs,n=Nd=Cs=0;n<e;){var r=Va[n];Va[n++]=null;var i=Va[n];Va[n++]=null;var d=Va[n];Va[n++]=null;var h=Va[n];if(Va[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&&Sp(r,d,h)}}function ic(e,n,r,i){Va[Cs++]=e,Va[Cs++]=n,Va[Cs++]=r,Va[Cs++]=i,Nd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Rd(e,n,r,i){return ic(e,n,r,i),oc(e)}function es(e,n){return ic(e,null,null,n),oc(e)}function Sp(e,n,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var d=!1,h=e.return;h!==null;)h.childLanes|=r,i=h.alternate,i!==null&&(i.childLanes|=r),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&n!==null&&(d=31-Kt(r),e=h.hiddenUpdates,i=e[d],i===null?e[d]=[n]:i.push(n),n.lane=r|536870912),h):null}function oc(e){if(50<Ji)throw Ji=0,Lf=null,Error(s(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ds={};function b1(e,n,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Aa(e,n,r,i){return new b1(e,n,r,i)}function jd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $r(e,n){var r=e.alternate;return r===null?(r=Aa(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function wp(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 cc(e,n,r,i,d,h){var b=0;if(i=e,typeof e=="function")jd(e)&&(b=1);else if(typeof e=="string")b=RS(e,r,he.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ue:return e=Aa(31,r,n,d),e.elementType=ue,e.lanes=h,e;case j:return ts(r.children,d,h,n);case R:b=8,d|=24;break;case z:return e=Aa(12,r,n,d|2),e.elementType=z,e.lanes=h,e;case ee:return e=Aa(13,r,n,d),e.elementType=ee,e.lanes=h,e;case ne:return e=Aa(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 M:b=14;break e;case C:b=16,i=null;break e}b=29,r=Error(s(130,e===null?"null":typeof e,"")),i=null}return n=Aa(b,r,n,d),n.elementType=e,n.type=i,n.lanes=h,n}function ts(e,n,r,i){return e=Aa(7,e,i,n),e.lanes=r,e}function Td(e,n,r){return e=Aa(6,e,null,n),e.lanes=r,e}function Ep(e){var n=Aa(18,null,null,0);return n.stateNode=e,n}function Cd(e,n,r){return n=Aa(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Np=new WeakMap;function Fa(e,n){if(typeof e=="object"&&e!==null){var r=Np.get(e);return r!==void 0?r:(n={value:e,source:n,stack:gn(n)},Np.set(e,n),n)}return{value:e,source:n,stack:gn(n)}}var As=[],ks=0,uc=null,ki=0,Ya=[],Ga=0,hl=null,Sr=1,wr="";function qr(e,n){As[ks++]=ki,As[ks++]=uc,uc=e,ki=n}function Rp(e,n,r){Ya[Ga++]=Sr,Ya[Ga++]=wr,Ya[Ga++]=hl,hl=e;var i=Sr;e=wr;var d=32-Kt(i)-1;i&=~(1<<d),r+=1;var h=32-Kt(n)+d;if(30<h){var b=d-d%5;h=(i&(1<<b)-1).toString(32),i>>=b,d-=b,Sr=1<<32-Kt(n)+d|r<<d|i,wr=h+e}else Sr=1<<h|r<<d|i,wr=e}function Dd(e){e.return!==null&&(qr(e,1),Rp(e,1,0))}function Ad(e){for(;e===uc;)uc=As[--ks],As[ks]=null,ki=As[--ks],As[ks]=null;for(;e===hl;)hl=Ya[--Ga],Ya[Ga]=null,wr=Ya[--Ga],Ya[Ga]=null,Sr=Ya[--Ga],Ya[Ga]=null}function jp(e,n){Ya[Ga++]=Sr,Ya[Ga++]=wr,Ya[Ga++]=hl,Sr=n.id,wr=n.overflow,hl=e}var Xn=null,rn=null,Et=!1,ml=null,Xa=!1,kd=Error(s(519));function pl(e){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Oi(Fa(n,e)),kd}function Tp(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<eo.length;r++)pt(eo[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),Si(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),sr(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||Vv(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||pl(e,!0)}function Cp(e){for(Xn=e.return;Xn;)switch(Xn.tag){case 5:case 31:case 13:Xa=!1;return;case 27:case 3:Xa=!0;return;default:Xn=Xn.return}}function Os(e){if(e!==Xn)return!1;if(!Et)return Cp(e),Et=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Kf(e.type,e.memoizedProps)),r=!r),r&&rn&&pl(e),Cp(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));rn=Wv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));rn=Wv(e)}else n===27?(n=rn,Dl(e.type)?(e=th,th=null,rn=e):rn=n):rn=Xn?Ka(e.stateNode.nextSibling):null;return!0}function ns(){rn=Xn=null,Et=!1}function Od(){var e=ml;return e!==null&&(Ea===null?Ea=e:Ea.push.apply(Ea,e),ml=null),e}function Oi(e){ml===null?ml=[e]:ml.push(e)}var Md=D(null),as=null,Ir=null;function gl(e,n,r){te(Md,n._currentValue),n._currentValue=r}function Pr(e){e._currentValue=Md.current,P(Md)}function _d(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 Ld(e,n,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var b=d.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=d;for(var k=0;k<n.length;k++)if(E.context===n[k]){h.lanes|=r,E=h.alternate,E!==null&&(E.lanes|=r),_d(h.return,r,e),i||(b=null);break e}h=E.next}}else if(d.tag===18){if(b=d.return,b===null)throw Error(s(341));b.lanes|=r,h=b.alternate,h!==null&&(h.lanes|=r),_d(b,r,e),b=null}else b=d.child;if(b!==null)b.return=d;else for(b=d;b!==null;){if(b===e){b=null;break}if(d=b.sibling,d!==null){d.return=b.return,b=d;break}b=b.return}d=b}}function Ms(e,n,r,i){e=null;for(var d=n,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var b=d.alternate;if(b===null)throw Error(s(387));if(b=b.memoizedProps,b!==null){var E=d.type;Da(d.pendingProps.value,b.value)||(e!==null?e.push(E):e=[E])}}else if(d===ze.current){if(b=d.alternate,b===null)throw Error(s(387));b.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(lo):e=[lo])}d=d.return}e!==null&&Ld(n,e,r,i),n.flags|=262144}function dc(e){for(e=e.firstContext;e!==null;){if(!Da(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rs(e){as=e,Ir=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qn(e){return Dp(as,e)}function fc(e,n){return as===null&&rs(e),Dp(e,n)}function Dp(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 S1=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()})}},w1=t.unstable_scheduleCallback,E1=t.unstable_NormalPriority,jn={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zd(){return{controller:new S1,data:new Map,refCount:0}}function Mi(e){e.refCount--,e.refCount===0&&w1(E1,function(){e.controller.abort()})}var _i=null,Ud=0,_s=0,Ls=null;function N1(e,n){if(_i===null){var r=_i=[];Ud=0,_s=qf(),Ls={status:"pending",value:void 0,then:function(i){r.push(i)}}}return Ud++,n.then(Ap,Ap),n}function Ap(){if(--Ud===0&&_i!==null){Ls!==null&&(Ls.status="fulfilled");var e=_i;_i=null,_s=0,Ls=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function R1(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 kp=U.S;U.S=function(e,n){mv=tn(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&N1(e,n),kp!==null&&kp(e,n)};var ls=D(null);function Bd(){var e=ls.current;return e!==null?e:en.pooledCache}function hc(e,n){n===null?te(ls,ls.current):te(ls,n.pool)}function Op(){var e=Bd();return e===null?null:{parent:jn._currentValue,pool:e}}var zs=Error(s(460)),Hd=Error(s(474)),mc=Error(s(542)),pc={then:function(){}};function Mp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function _p(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,zp(e),e;default:if(typeof n.status=="string")n.then(na,na);else{if(e=en,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=n,e.status="pending",e.then(function(i){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=i}},function(i){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=i}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,zp(e),e}throw is=n,zs}}function ss(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(is=r,zs):r}}var is=null;function Lp(){if(is===null)throw Error(s(459));var e=is;return is=null,e}function zp(e){if(e===zs||e===mc)throw Error(s(483))}var Us=null,Li=0;function gc(e){var n=Li;return Li+=1,Us===null&&(Us=[]),_p(Us,e,n)}function zi(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function vc(e,n){throw n.$$typeof===N?Error(s(525)):(e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Up(e){function n(H,L){if(e){var V=H.deletions;V===null?(H.deletions=[L],H.flags|=16):V.push(L)}}function r(H,L){if(!e)return null;for(;L!==null;)n(H,L),L=L.sibling;return null}function i(H){for(var L=new Map;H!==null;)H.key!==null?L.set(H.key,H):L.set(H.index,H),H=H.sibling;return L}function d(H,L){return H=$r(H,L),H.index=0,H.sibling=null,H}function h(H,L,V){return H.index=V,e?(V=H.alternate,V!==null?(V=V.index,V<L?(H.flags|=67108866,L):V):(H.flags|=67108866,L)):(H.flags|=1048576,L)}function b(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function E(H,L,V,re){return L===null||L.tag!==6?(L=Td(V,H.mode,re),L.return=H,L):(L=d(L,V),L.return=H,L)}function k(H,L,V,re){var He=V.type;return He===j?W(H,L,V.props.children,re,V.key):L!==null&&(L.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===C&&ss(He)===L.type)?(L=d(L,V.props),zi(L,V),L.return=H,L):(L=cc(V.type,V.key,V.props,null,H.mode,re),zi(L,V),L.return=H,L)}function F(H,L,V,re){return L===null||L.tag!==4||L.stateNode.containerInfo!==V.containerInfo||L.stateNode.implementation!==V.implementation?(L=Cd(V,H.mode,re),L.return=H,L):(L=d(L,V.children||[]),L.return=H,L)}function W(H,L,V,re,He){return L===null||L.tag!==7?(L=ts(V,H.mode,re,He),L.return=H,L):(L=d(L,V),L.return=H,L)}function se(H,L,V){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Td(""+L,H.mode,V),L.return=H,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case w:return V=cc(L.type,L.key,L.props,null,H.mode,V),zi(V,L),V.return=H,V;case S:return L=Cd(L,H.mode,V),L.return=H,L;case C:return L=ss(L),se(H,L,V)}if(be(L)||ae(L))return L=ts(L,H.mode,V,null),L.return=H,L;if(typeof L.then=="function")return se(H,gc(L),V);if(L.$$typeof===q)return se(H,fc(H,L),V);vc(H,L)}return null}function G(H,L,V,re){var He=L!==null?L.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return He!==null?null:E(H,L,""+V,re);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case w:return V.key===He?k(H,L,V,re):null;case S:return V.key===He?F(H,L,V,re):null;case C:return V=ss(V),G(H,L,V,re)}if(be(V)||ae(V))return He!==null?null:W(H,L,V,re,null);if(typeof V.then=="function")return G(H,L,gc(V),re);if(V.$$typeof===q)return G(H,L,fc(H,V),re);vc(H,V)}return null}function Q(H,L,V,re,He){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return H=H.get(V)||null,E(L,H,""+re,He);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return H=H.get(re.key===null?V:re.key)||null,k(L,H,re,He);case S:return H=H.get(re.key===null?V:re.key)||null,F(L,H,re,He);case C:return re=ss(re),Q(H,L,V,re,He)}if(be(re)||ae(re))return H=H.get(V)||null,W(L,H,re,He,null);if(typeof re.then=="function")return Q(H,L,V,gc(re),He);if(re.$$typeof===q)return Q(H,L,V,fc(L,re),He);vc(L,re)}return null}function Oe(H,L,V,re){for(var He=null,At=null,Le=L,ot=L=0,bt=null;Le!==null&&ot<V.length;ot++){Le.index>ot?(bt=Le,Le=null):bt=Le.sibling;var kt=G(H,Le,V[ot],re);if(kt===null){Le===null&&(Le=bt);break}e&&Le&&kt.alternate===null&&n(H,Le),L=h(kt,L,ot),At===null?He=kt:At.sibling=kt,At=kt,Le=bt}if(ot===V.length)return r(H,Le),Et&&qr(H,ot),He;if(Le===null){for(;ot<V.length;ot++)Le=se(H,V[ot],re),Le!==null&&(L=h(Le,L,ot),At===null?He=Le:At.sibling=Le,At=Le);return Et&&qr(H,ot),He}for(Le=i(Le);ot<V.length;ot++)bt=Q(Le,H,ot,V[ot],re),bt!==null&&(e&&bt.alternate!==null&&Le.delete(bt.key===null?ot:bt.key),L=h(bt,L,ot),At===null?He=bt:At.sibling=bt,At=bt);return e&&Le.forEach(function(_l){return n(H,_l)}),Et&&qr(H,ot),He}function Pe(H,L,V,re){if(V==null)throw Error(s(151));for(var He=null,At=null,Le=L,ot=L=0,bt=null,kt=V.next();Le!==null&&!kt.done;ot++,kt=V.next()){Le.index>ot?(bt=Le,Le=null):bt=Le.sibling;var _l=G(H,Le,kt.value,re);if(_l===null){Le===null&&(Le=bt);break}e&&Le&&_l.alternate===null&&n(H,Le),L=h(_l,L,ot),At===null?He=_l:At.sibling=_l,At=_l,Le=bt}if(kt.done)return r(H,Le),Et&&qr(H,ot),He;if(Le===null){for(;!kt.done;ot++,kt=V.next())kt=se(H,kt.value,re),kt!==null&&(L=h(kt,L,ot),At===null?He=kt:At.sibling=kt,At=kt);return Et&&qr(H,ot),He}for(Le=i(Le);!kt.done;ot++,kt=V.next())kt=Q(Le,H,ot,kt.value,re),kt!==null&&(e&&kt.alternate!==null&&Le.delete(kt.key===null?ot:kt.key),L=h(kt,L,ot),At===null?He=kt:At.sibling=kt,At=kt);return e&&Le.forEach(function(zS){return n(H,zS)}),Et&&qr(H,ot),He}function Yt(H,L,V,re){if(typeof V=="object"&&V!==null&&V.type===j&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case w:e:{for(var He=V.key;L!==null;){if(L.key===He){if(He=V.type,He===j){if(L.tag===7){r(H,L.sibling),re=d(L,V.props.children),re.return=H,H=re;break e}}else if(L.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===C&&ss(He)===L.type){r(H,L.sibling),re=d(L,V.props),zi(re,V),re.return=H,H=re;break e}r(H,L);break}else n(H,L);L=L.sibling}V.type===j?(re=ts(V.props.children,H.mode,re,V.key),re.return=H,H=re):(re=cc(V.type,V.key,V.props,null,H.mode,re),zi(re,V),re.return=H,H=re)}return b(H);case S:e:{for(He=V.key;L!==null;){if(L.key===He)if(L.tag===4&&L.stateNode.containerInfo===V.containerInfo&&L.stateNode.implementation===V.implementation){r(H,L.sibling),re=d(L,V.children||[]),re.return=H,H=re;break e}else{r(H,L);break}else n(H,L);L=L.sibling}re=Cd(V,H.mode,re),re.return=H,H=re}return b(H);case C:return V=ss(V),Yt(H,L,V,re)}if(be(V))return Oe(H,L,V,re);if(ae(V)){if(He=ae(V),typeof He!="function")throw Error(s(150));return V=He.call(V),Pe(H,L,V,re)}if(typeof V.then=="function")return Yt(H,L,gc(V),re);if(V.$$typeof===q)return Yt(H,L,fc(H,V),re);vc(H,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,L!==null&&L.tag===6?(r(H,L.sibling),re=d(L,V),re.return=H,H=re):(r(H,L),re=Td(V,H.mode,re),re.return=H,H=re),b(H)):r(H,L)}return function(H,L,V,re){try{Li=0;var He=Yt(H,L,V,re);return Us=null,He}catch(Le){if(Le===zs||Le===mc)throw Le;var At=Aa(29,Le,null,H.mode);return At.lanes=re,At.return=H,At}finally{}}}var os=Up(!0),Bp=Up(!1),vl=!1;function $d(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qd(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 yl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xl(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=oc(e),Sp(e,null,r),n}return ic(e,i,n,r),oc(e)}function Ui(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 Id(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 Pd=!1;function Bi(){if(Pd){var e=Ls;if(e!==null)throw e}}function Hi(e,n,r,i){Pd=!1;var d=e.updateQueue;vl=!1;var h=d.firstBaseUpdate,b=d.lastBaseUpdate,E=d.shared.pending;if(E!==null){d.shared.pending=null;var k=E,F=k.next;k.next=null,b===null?h=F:b.next=F,b=k;var W=e.alternate;W!==null&&(W=W.updateQueue,E=W.lastBaseUpdate,E!==b&&(E===null?W.firstBaseUpdate=F:E.next=F,W.lastBaseUpdate=k))}if(h!==null){var se=d.baseState;b=0,W=F=k=null,E=h;do{var G=E.lane&-536870913,Q=G!==E.lane;if(Q?(xt&G)===G:(i&G)===G){G!==0&&G===_s&&(Pd=!0),W!==null&&(W=W.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Oe=e,Pe=E;G=n;var Yt=r;switch(Pe.tag){case 1:if(Oe=Pe.payload,typeof Oe=="function"){se=Oe.call(Yt,se,G);break e}se=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Pe.payload,G=typeof Oe=="function"?Oe.call(Yt,se,G):Oe,G==null)break e;se=y({},se,G);break e;case 2:vl=!0}}G=E.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=d.callbacks,Q===null?d.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:E.tag,payload:E.payload,callback:E.callback,next:null},W===null?(F=W=Q,k=se):W=W.next=Q,b|=G;if(E=E.next,E===null){if(E=d.shared.pending,E===null)break;Q=E,E=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);W===null&&(k=se),d.baseState=k,d.firstBaseUpdate=F,d.lastBaseUpdate=W,h===null&&(d.shared.lanes=0),Nl|=b,e.lanes=b,e.memoizedState=se}}function Hp(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++)Hp(r[e],n)}var Bs=D(null),yc=D(0);function qp(e,n){e=Jr,te(yc,e),te(Bs,n),Jr=e|n.baseLanes}function Vd(){te(yc,Jr),te(Bs,Bs.current)}function Fd(){Jr=yc.current,P(Bs),P(yc)}var ka=D(null),Qa=null;function bl(e){var n=e.alternate;te(yn,yn.current&1),te(ka,e),Qa===null&&(n===null||Bs.current!==null||n.memoizedState!==null)&&(Qa=e)}function Yd(e){te(yn,yn.current),te(ka,e),Qa===null&&(Qa=e)}function Ip(e){e.tag===22?(te(yn,yn.current),te(ka,e),Qa===null&&(Qa=e)):Sl()}function Sl(){te(yn,yn.current),te(ka,ka.current)}function Oa(e){P(ka),Qa===e&&(Qa=null),P(yn)}var yn=D(0);function xc(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Wf(r)||eh(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 Vr=0,st=null,Vt=null,Tn=null,bc=!1,Hs=!1,cs=!1,Sc=0,$i=0,$s=null,j1=0;function fn(){throw Error(s(321))}function Gd(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!Da(e[r],n[r]))return!1;return!0}function Xd(e,n,r,i,d,h){return Vr=h,st=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,U.H=e===null||e.memoizedState===null?Rg:uf,cs=!1,h=r(i,d),cs=!1,Hs&&(h=Vp(n,r,i,d)),Pp(e),h}function Pp(e){U.H=Pi;var n=Vt!==null&&Vt.next!==null;if(Vr=0,Tn=Vt=st=null,bc=!1,$i=0,$s=null,n)throw Error(s(300));e===null||Cn||(e=e.dependencies,e!==null&&dc(e)&&(Cn=!0))}function Vp(e,n,r,i){st=e;var d=0;do{if(Hs&&($s=null),$i=0,Hs=!1,25<=d)throw Error(s(301));if(d+=1,Tn=Vt=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}U.H=jg,h=n(r,i)}while(Hs);return h}function T1(){var e=U.H,n=e.useState()[0];return n=typeof n.then=="function"?qi(n):n,e=e.useState()[0],(Vt!==null?Vt.memoizedState:null)!==e&&(st.flags|=1024),n}function Qd(){var e=Sc!==0;return Sc=0,e}function Kd(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Zd(e){if(bc){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}bc=!1}Vr=0,Tn=Vt=st=null,Hs=!1,$i=Sc=0,$s=null}function ma(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?st.memoizedState=Tn=e:Tn=Tn.next=e,Tn}function xn(){if(Vt===null){var e=st.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var n=Tn===null?st.memoizedState:Tn.next;if(n!==null)Tn=n,Vt=e;else{if(e===null)throw st.alternate===null?Error(s(467)):Error(s(310));Vt=e,e={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Tn===null?st.memoizedState=Tn=e:Tn=Tn.next=e}return Tn}function wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qi(e){var n=$i;return $i+=1,$s===null&&($s=[]),e=_p($s,e,n),n=st,(Tn===null?n.memoizedState:Tn.next)===null&&(n=n.alternate,U.H=n===null||n.memoizedState===null?Rg:uf),e}function Ec(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return qi(e);if(e.$$typeof===q)return Qn(e)}throw Error(s(438,String(e)))}function Jd(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=wc(),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]=me;return n.index++,r}function Fr(e,n){return typeof n=="function"?n(e):n}function Nc(e){var n=xn();return Wd(n,Vt,e)}function Wd(e,n,r){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=r;var d=e.baseQueue,h=i.pending;if(h!==null){if(d!==null){var b=d.next;d.next=h.next,h.next=b}n.baseQueue=d=h,i.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{n=d.next;var E=b=null,k=null,F=n,W=!1;do{var se=F.lane&-536870913;if(se!==F.lane?(xt&se)===se:(Vr&se)===se){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}),se===_s&&(W=!0);else if((Vr&G)===G){F=F.next,G===_s&&(W=!0);continue}else se={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},k===null?(E=k=se,b=h):k=k.next=se,st.lanes|=G,Nl|=G;se=F.action,cs&&r(h,se),h=F.hasEagerState?F.eagerState:r(h,se)}else G={lane:se,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},k===null?(E=k=G,b=h):k=k.next=G,st.lanes|=se,Nl|=se;F=F.next}while(F!==null&&F!==n);if(k===null?b=h:k.next=E,!Da(h,e.memoizedState)&&(Cn=!0,W&&(r=Ls,r!==null)))throw r;e.memoizedState=h,e.baseState=b,e.baseQueue=k,i.lastRenderedState=h}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function ef(e){var n=xn(),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);Da(h,n.memoizedState)||(Cn=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),r.lastRenderedState=h}return[h,i]}function Fp(e,n,r){var i=st,d=xn(),h=Et;if(h){if(r===void 0)throw Error(s(407));r=r()}else r=n();var b=!Da((Vt||d).memoizedState,r);if(b&&(d.memoizedState=r,Cn=!0),d=d.queue,af(Xp.bind(null,i,d,e),[e]),d.getSnapshot!==n||b||Tn!==null&&Tn.memoizedState.tag&1){if(i.flags|=2048,qs(9,{destroy:void 0},Gp.bind(null,i,d,r,n),null),en===null)throw Error(s(349));h||(Vr&127)!==0||Yp(i,n,r)}return r}function Yp(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=st.updateQueue,n===null?(n=wc(),st.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function Gp(e,n,r,i){n.value=r,n.getSnapshot=i,Qp(n)&&Kp(e)}function Xp(e,n,r){return r(function(){Qp(n)&&Kp(e)})}function Qp(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!Da(e,r)}catch{return!0}}function Kp(e){var n=es(e,2);n!==null&&Na(n,e,2)}function tf(e){var n=ma();if(typeof e=="function"){var r=e;if(e=r(),cs){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 Zp(e,n,r,i){return e.baseState=r,Wd(e,Vt,typeof i=="function"?i:Fr)}function C1(e,n,r,i,d){if(Tc(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,Jp(n,h)):(h.next=r.next,n.pending=r.next=h)}}function Jp(e,n){var r=n.action,i=n.payload,d=e.state;if(n.isTransition){var h=U.T,b={};U.T=b;try{var E=r(d,i),k=U.S;k!==null&&k(b,E),Wp(e,n,E)}catch(F){nf(e,n,F)}finally{h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}else try{h=r(d,i),Wp(e,n,h)}catch(F){nf(e,n,F)}}function Wp(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){eg(e,n,i)},function(i){return nf(e,n,i)}):eg(e,n,r)}function eg(e,n,r){n.status="fulfilled",n.value=r,tg(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,Jp(e,r)))}function nf(e,n,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do n.status="rejected",n.reason=r,tg(n),n=n.next;while(n!==i)}e.action=null}function tg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function ng(e,n){return n}function ag(e,n){if(Et){var r=en.formState;if(r!==null){e:{var i=st;if(Et){if(rn){t:{for(var d=rn,h=Xa;d.nodeType!==8;){if(!h){d=null;break t}if(d=Ka(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){rn=Ka(d.nextSibling),i=d.data==="F!";break e}}pl(i)}i=!1}i&&(n=r[0])}}return r=ma(),r.memoizedState=r.baseState=n,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ng,lastRenderedState:n},r.queue=i,r=wg.bind(null,st,i),i.dispatch=r,i=tf(!1),h=cf.bind(null,st,!1,i.queue),i=ma(),d={state:n,dispatch:null,action:e,pending:null},i.queue=d,r=C1.bind(null,st,d,h,r),d.dispatch=r,i.memoizedState=e,[n,r,!1]}function rg(e){var n=xn();return lg(n,Vt,e)}function lg(e,n,r){if(n=Wd(e,n,ng)[0],e=Nc(Fr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var i=qi(n)}catch(b){throw b===zs?mc:b}else i=n;n=xn();var d=n.queue,h=d.dispatch;return r!==n.memoizedState&&(st.flags|=2048,qs(9,{destroy:void 0},D1.bind(null,d,r),null)),[i,h,e]}function D1(e,n){e.action=n}function sg(e){var n=xn(),r=Vt;if(r!==null)return lg(n,r,e);xn(),n=n.memoizedState,r=xn();var i=r.queue.dispatch;return r.memoizedState=e,[n,i,!1]}function qs(e,n,r,i){return e={tag:e,create:r,deps:i,inst:n,next:null},n=st.updateQueue,n===null&&(n=wc(),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 ig(){return xn().memoizedState}function Rc(e,n,r,i){var d=ma();st.flags|=e,d.memoizedState=qs(1|n,{destroy:void 0},r,i===void 0?null:i)}function jc(e,n,r,i){var d=xn();i=i===void 0?null:i;var h=d.memoizedState.inst;Vt!==null&&i!==null&&Gd(i,Vt.memoizedState.deps)?d.memoizedState=qs(n,h,r,i):(st.flags|=e,d.memoizedState=qs(1|n,h,r,i))}function og(e,n){Rc(8390656,8,e,n)}function af(e,n){jc(2048,8,e,n)}function A1(e){st.flags|=4;var n=st.updateQueue;if(n===null)n=wc(),st.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function cg(e){var n=xn().memoizedState;return A1({ref:n,nextImpl:e}),function(){if((Ot&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function ug(e,n){return jc(4,2,e,n)}function dg(e,n){return jc(4,4,e,n)}function fg(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 hg(e,n,r){r=r!=null?r.concat([e]):null,jc(4,4,fg.bind(null,n,e),r)}function rf(){}function mg(e,n){var r=xn();n=n===void 0?null:n;var i=r.memoizedState;return n!==null&&Gd(n,i[1])?i[0]:(r.memoizedState=[e,n],e)}function pg(e,n){var r=xn();n=n===void 0?null:n;var i=r.memoizedState;if(n!==null&&Gd(n,i[1]))return i[0];if(i=e(),cs){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[i,n],i}function lf(e,n,r){return r===void 0||(Vr&1073741824)!==0&&(xt&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=gv(),st.lanes|=e,Nl|=e,r)}function gg(e,n,r,i){return Da(r,n)?r:Bs.current!==null?(e=lf(e,r,i),Da(e,n)||(Cn=!0),e):(Vr&42)===0||(Vr&1073741824)!==0&&(xt&261930)===0?(Cn=!0,e.memoizedState=r):(e=gv(),st.lanes|=e,Nl|=e,n)}function vg(e,n,r,i,d){var h=B.p;B.p=h!==0&&8>h?h:8;var b=U.T,E={};U.T=E,cf(e,!1,n,r);try{var k=d(),F=U.S;if(F!==null&&F(E,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var W=R1(k,i);Ii(e,n,W,La(e))}else Ii(e,n,i,La(e))}catch(se){Ii(e,n,{then:function(){},status:"rejected",reason:se},La())}finally{B.p=h,b!==null&&E.types!==null&&(b.types=E.types),U.T=b}}function k1(){}function sf(e,n,r,i){if(e.tag!==5)throw Error(s(476));var d=yg(e).queue;vg(e,d,n,oe,r===null?k1:function(){return xg(e),r(i)})}function yg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:oe},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 xg(e){var n=yg(e);n.next===null&&(n=e.alternate.memoizedState),Ii(e,n.next.queue,{},La())}function of(){return Qn(lo)}function bg(){return xn().memoizedState}function Sg(){return xn().memoizedState}function O1(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=La();e=yl(r);var i=xl(n,e,r);i!==null&&(Na(i,n,r),Ui(i,n,r)),n={cache:zd()},e.payload=n;return}n=n.return}}function M1(e,n,r){var i=La();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Tc(e)?Eg(n,r):(r=Rd(e,n,r,i),r!==null&&(Na(r,e,i),Ng(r,n,i)))}function wg(e,n,r){var i=La();Ii(e,n,r,i)}function Ii(e,n,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Tc(e))Eg(n,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var b=n.lastRenderedState,E=h(b,r);if(d.hasEagerState=!0,d.eagerState=E,Da(E,b))return ic(e,n,d,0),en===null&&sc(),!1}catch{}finally{}if(r=Rd(e,n,d,i),r!==null)return Na(r,e,i),Ng(r,n,i),!0}return!1}function cf(e,n,r,i){if(i={lane:2,revertLane:qf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Tc(e)){if(n)throw Error(s(479))}else n=Rd(e,r,i,2),n!==null&&Na(n,e,2)}function Tc(e){var n=e.alternate;return e===st||n!==null&&n===st}function Eg(e,n){Hs=bc=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Ng(e,n,r){if((r&4194048)!==0){var i=n.lanes;i&=e.pendingLanes,r|=i,n.lanes=r,kn(e,r)}}var Pi={readContext:Qn,use:Ec,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn,useHostTransitionStatus:fn,useFormState:fn,useActionState:fn,useOptimistic:fn,useMemoCache:fn,useCacheRefresh:fn};Pi.useEffectEvent=fn;var Rg={readContext:Qn,use:Ec,useCallback:function(e,n){return ma().memoizedState=[e,n===void 0?null:n],e},useContext:Qn,useEffect:og,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,Rc(4194308,4,fg.bind(null,n,e),r)},useLayoutEffect:function(e,n){return Rc(4194308,4,e,n)},useInsertionEffect:function(e,n){Rc(4,2,e,n)},useMemo:function(e,n){var r=ma();n=n===void 0?null:n;var i=e();if(cs){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[i,n],i},useReducer:function(e,n,r){var i=ma();if(r!==void 0){var d=r(n);if(cs){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=M1.bind(null,st,e),[i.memoizedState,e]},useRef:function(e){var n=ma();return e={current:e},n.memoizedState=e},useState:function(e){e=tf(e);var n=e.queue,r=wg.bind(null,st,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:rf,useDeferredValue:function(e,n){var r=ma();return lf(r,e,n)},useTransition:function(){var e=tf(!1);return e=vg.bind(null,st,e.queue,!0,!1),ma().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var i=st,d=ma();if(Et){if(r===void 0)throw Error(s(407));r=r()}else{if(r=n(),en===null)throw Error(s(349));(xt&127)!==0||Yp(i,n,r)}d.memoizedState=r;var h={value:r,getSnapshot:n};return d.queue=h,og(Xp.bind(null,i,h,e),[e]),i.flags|=2048,qs(9,{destroy:void 0},Gp.bind(null,i,h,r,n),null),r},useId:function(){var e=ma(),n=en.identifierPrefix;if(Et){var r=wr,i=Sr;r=(i&~(1<<32-Kt(i)-1)).toString(32)+r,n="_"+n+"R_"+r,r=Sc++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=j1++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:of,useFormState:ag,useActionState:ag,useOptimistic:function(e){var n=ma();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=cf.bind(null,st,!0,r),r.dispatch=n,[e,n]},useMemoCache:Jd,useCacheRefresh:function(){return ma().memoizedState=O1.bind(null,st)},useEffectEvent:function(e){var n=ma(),r={impl:e};return n.memoizedState=r,function(){if((Ot&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},uf={readContext:Qn,use:Ec,useCallback:mg,useContext:Qn,useEffect:af,useImperativeHandle:hg,useInsertionEffect:ug,useLayoutEffect:dg,useMemo:pg,useReducer:Nc,useRef:ig,useState:function(){return Nc(Fr)},useDebugValue:rf,useDeferredValue:function(e,n){var r=xn();return gg(r,Vt.memoizedState,e,n)},useTransition:function(){var e=Nc(Fr)[0],n=xn().memoizedState;return[typeof e=="boolean"?e:qi(e),n]},useSyncExternalStore:Fp,useId:bg,useHostTransitionStatus:of,useFormState:rg,useActionState:rg,useOptimistic:function(e,n){var r=xn();return Zp(r,Vt,e,n)},useMemoCache:Jd,useCacheRefresh:Sg};uf.useEffectEvent=cg;var jg={readContext:Qn,use:Ec,useCallback:mg,useContext:Qn,useEffect:af,useImperativeHandle:hg,useInsertionEffect:ug,useLayoutEffect:dg,useMemo:pg,useReducer:ef,useRef:ig,useState:function(){return ef(Fr)},useDebugValue:rf,useDeferredValue:function(e,n){var r=xn();return Vt===null?lf(r,e,n):gg(r,Vt.memoizedState,e,n)},useTransition:function(){var e=ef(Fr)[0],n=xn().memoizedState;return[typeof e=="boolean"?e:qi(e),n]},useSyncExternalStore:Fp,useId:bg,useHostTransitionStatus:of,useFormState:sg,useActionState:sg,useOptimistic:function(e,n){var r=xn();return Vt!==null?Zp(r,Vt,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Jd,useCacheRefresh:Sg};jg.useEffectEvent=cg;function df(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 ff={enqueueSetState:function(e,n,r){e=e._reactInternals;var i=La(),d=yl(i);d.payload=n,r!=null&&(d.callback=r),n=xl(e,d,i),n!==null&&(Na(n,e,i),Ui(n,e,i))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var i=La(),d=yl(i);d.tag=1,d.payload=n,r!=null&&(d.callback=r),n=xl(e,d,i),n!==null&&(Na(n,e,i),Ui(n,e,i))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=La(),i=yl(r);i.tag=2,n!=null&&(i.callback=n),n=xl(e,i,r),n!==null&&(Na(n,e,r),Ui(n,e,r))}};function Tg(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?!Di(r,i)||!Di(d,h):!0}function Cg(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&&ff.enqueueReplaceState(n,n.state,null)}function us(e,n){var r=n;if("ref"in n){r={};for(var i in n)i!=="ref"&&(r[i]=n[i])}if(e=e.defaultProps){r===n&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function Dg(e){lc(e)}function Ag(e){console.error(e)}function kg(e){lc(e)}function Cc(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(i){setTimeout(function(){throw i})}}function Og(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 hf(e,n,r){return r=yl(r),r.tag=3,r.payload={element:null},r.callback=function(){Cc(e,n)},r}function Mg(e){return e=yl(e),e.tag=3,e}function _g(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(){Og(n,r,i)}}var b=r.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Og(n,r,i),typeof d!="function"&&(Rl===null?Rl=new Set([this]):Rl.add(this));var E=i.stack;this.componentDidCatch(i.value,{componentStack:E!==null?E:""})})}function _1(e,n,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(n=r.alternate,n!==null&&Ms(n,r,d,!0),r=ka.current,r!==null){switch(r.tag){case 31:case 13:return Qa===null?$c():r.alternate===null&&hn===0&&(hn=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===pc?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([i]):n.add(i),Bf(e,i,d)),!1;case 22:return r.flags|=65536,i===pc?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)),Bf(e,i,d)),!1}throw Error(s(435,r.tag))}return Bf(e,i,d),$c(),!1}if(Et)return n=ka.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,i!==kd&&(e=Error(s(422),{cause:i}),Oi(Fa(e,r)))):(i!==kd&&(n=Error(s(423),{cause:i}),Oi(Fa(n,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=Fa(i,r),d=hf(e.stateNode,i,d),Id(e,d),hn!==4&&(hn=2)),!1;var h=Error(s(520),{cause:i});if(h=Fa(h,r),Zi===null?Zi=[h]:Zi.push(h),hn!==4&&(hn=2),n===null)return!0;i=Fa(i,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=hf(r.stateNode,i,e),Id(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"&&(Rl===null||!Rl.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=Mg(d),_g(d,e,r,i),Id(r,d),!1}r=r.return}while(r!==null);return!1}var mf=Error(s(461)),Cn=!1;function Kn(e,n,r,i){n.child=e===null?Bp(n,null,r,i):os(n,e.child,r,i)}function Lg(e,n,r,i,d){r=r.render;var h=n.ref;if("ref"in i){var b={};for(var E in i)E!=="ref"&&(b[E]=i[E])}else b=i;return rs(n),i=Xd(e,n,r,b,h,d),E=Qd(),e!==null&&!Cn?(Kd(e,n,d),Yr(e,n,d)):(Et&&E&&Dd(n),n.flags|=1,Kn(e,n,i,d),n.child)}function zg(e,n,r,i,d){if(e===null){var h=r.type;return typeof h=="function"&&!jd(h)&&h.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=h,Ug(e,n,h,i,d)):(e=cc(r.type,null,i,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!wf(e,d)){var b=h.memoizedProps;if(r=r.compare,r=r!==null?r:Di,r(b,i)&&e.ref===n.ref)return Yr(e,n,d)}return n.flags|=1,e=$r(h,i),e.ref=n.ref,e.return=n,n.child=e}function Ug(e,n,r,i,d){if(e!==null){var h=e.memoizedProps;if(Di(h,i)&&e.ref===n.ref)if(Cn=!1,n.pendingProps=i=h,wf(e,d))(e.flags&131072)!==0&&(Cn=!0);else return n.lanes=e.lanes,Yr(e,n,d)}return pf(e,n,r,i,d)}function Bg(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 Hg(e,n,h,r,i)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&hc(n,h!==null?h.cachePool:null),h!==null?qp(n,h):Vd(),Ip(n);else return i=n.lanes=536870912,Hg(e,n,h!==null?h.baseLanes|r:r,r,i)}else h!==null?(hc(n,h.cachePool),qp(n,h),Sl(),n.memoizedState=null):(e!==null&&hc(n,null),Vd(),Sl());return Kn(e,n,d,r),n.child}function Vi(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Hg(e,n,r,i,d){var h=Bd();return h=h===null?null:{parent:jn._currentValue,pool:h},n.memoizedState={baseLanes:r,cachePool:h},e!==null&&hc(n,null),Vd(),Ip(n),e!==null&&Ms(e,n,i,!0),n.childLanes=d,null}function Dc(e,n){return n=kc({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 os(n,e.child,null,r),e=Dc(n,n.pendingProps),e.flags|=2,Oa(n),n.memoizedState=null,e}function L1(e,n,r){var i=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Et){if(i.mode==="hidden")return e=Dc(n,i),n.lanes=536870912,Vi(null,e);if(Yd(n),(e=rn)?(e=Jv(e,Xa),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:hl!==null?{id:Sr,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},r=Ep(e),r.return=n,n.child=r,Xn=n,rn=null)):e=null,e===null)throw pl(n);return n.lanes=536870912,null}return Dc(n,i)}var h=e.memoizedState;if(h!==null){var b=h.dehydrated;if(Yd(n),d)if(n.flags&256)n.flags&=-257,n=$g(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(s(558));else if(Cn||Ms(e,n,r,!1),d=(r&e.childLanes)!==0,Cn||d){if(i=en,i!==null&&(b=A(i,r),b!==0&&b!==h.retryLane))throw h.retryLane=b,es(e,b),Na(i,e,b),mf;$c(),n=$g(e,n,r)}else e=h.treeContext,rn=Ka(b.nextSibling),Xn=n,Et=!0,ml=null,Xa=!1,e!==null&&jp(n,e),n=Dc(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 Ac(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 pf(e,n,r,i,d){return rs(n),r=Xd(e,n,r,i,void 0,d),i=Qd(),e!==null&&!Cn?(Kd(e,n,d),Yr(e,n,d)):(Et&&i&&Dd(n),n.flags|=1,Kn(e,n,r,d),n.child)}function qg(e,n,r,i,d,h){return rs(n),n.updateQueue=null,r=Vp(n,i,r,d),Pp(e),i=Qd(),e!==null&&!Cn?(Kd(e,n,h),Yr(e,n,h)):(Et&&i&&Dd(n),n.flags|=1,Kn(e,n,r,h),n.child)}function Ig(e,n,r,i,d){if(rs(n),n.stateNode===null){var h=Ds,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=ff,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=i,h.state=n.memoizedState,h.refs={},$d(n),b=r.contextType,h.context=typeof b=="object"&&b!==null?Qn(b):Ds,h.state=n.memoizedState,b=r.getDerivedStateFromProps,typeof b=="function"&&(df(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&&ff.enqueueReplaceState(h,h.state,null),Hi(n,i,h,d),Bi(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),i=!0}else if(e===null){h=n.stateNode;var E=n.memoizedProps,k=us(r,E);h.props=k;var F=h.context,W=r.contextType;b=Ds,typeof W=="object"&&W!==null&&(b=Qn(W));var se=r.getDerivedStateFromProps;W=typeof se=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,W||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||F!==b)&&Cg(n,h,i,b),vl=!1;var G=n.memoizedState;h.state=G,Hi(n,i,h,d),Bi(),F=n.memoizedState,E||G!==F||vl?(typeof se=="function"&&(df(n,r,se,i),F=n.memoizedState),(k=vl||Tg(n,r,k,i,G,F,b))?(W||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,qd(e,n),b=n.memoizedProps,W=us(r,b),h.props=W,se=n.pendingProps,G=h.context,F=r.contextType,k=Ds,typeof F=="object"&&F!==null&&(k=Qn(F)),E=r.getDerivedStateFromProps,(F=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==se||G!==k)&&Cg(n,h,i,k),vl=!1,G=n.memoizedState,h.state=G,Hi(n,i,h,d),Bi();var Q=n.memoizedState;b!==se||G!==Q||vl||e!==null&&e.dependencies!==null&&dc(e.dependencies)?(typeof E=="function"&&(df(n,r,E,i),Q=n.memoizedState),(W=vl||Tg(n,r,W,i,G,Q,k)||e!==null&&e.dependencies!==null&&dc(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=W):(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,Ac(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=os(n,e.child,null,d),n.child=os(n,null,r,d)):Kn(e,n,r,d),n.memoizedState=h.state,e=n.child):e=Yr(e,n,d),e}function Pg(e,n,r,i){return ns(),n.flags|=256,Kn(e,n,r,i),n.child}var gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vf(e){return{baseLanes:e,cachePool:Op()}}function yf(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=_a),e}function Vg(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:(yn.current&2)!==0),b&&(d=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(Et){if(d?bl(n):Sl(),(e=rn)?(e=Jv(e,Xa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:hl!==null?{id:Sr,overflow:wr}:null,retryLane:536870912,hydrationErrors:null},r=Ep(e),r.return=n,n.child=r,Xn=n,rn=null)):e=null,e===null)throw pl(n);return eh(e)?n.lanes=32:n.lanes=536870912,null}var E=i.children;return i=i.fallback,d?(Sl(),d=n.mode,E=kc({mode:"hidden",children:E},d),i=ts(i,d,r,null),E.return=n,i.return=n,E.sibling=i,n.child=E,i=n.child,i.memoizedState=vf(r),i.childLanes=yf(e,b,r),n.memoizedState=gf,Vi(null,i)):(bl(n),xf(n,E))}var k=e.memoizedState;if(k!==null&&(E=k.dehydrated,E!==null)){if(h)n.flags&256?(bl(n),n.flags&=-257,n=bf(e,n,r)):n.memoizedState!==null?(Sl(),n.child=e.child,n.flags|=128,n=null):(Sl(),E=i.fallback,d=n.mode,i=kc({mode:"visible",children:i.children},d),E=ts(E,d,r,null),E.flags|=2,i.return=n,E.return=n,i.sibling=E,n.child=i,os(n,e.child,null,r),i=n.child,i.memoizedState=vf(r),i.childLanes=yf(e,b,r),n.memoizedState=gf,n=Vi(null,i));else if(bl(n),eh(E)){if(b=E.nextSibling&&E.nextSibling.dataset,b)var F=b.dgst;b=F,i=Error(s(419)),i.stack="",i.digest=b,Oi({value:i,source:null,stack:null}),n=bf(e,n,r)}else if(Cn||Ms(e,n,r,!1),b=(r&e.childLanes)!==0,Cn||b){if(b=en,b!==null&&(i=A(b,r),i!==0&&i!==k.retryLane))throw k.retryLane=i,es(e,i),Na(b,e,i),mf;Wf(E)||$c(),n=bf(e,n,r)}else Wf(E)?(n.flags|=192,n.child=e.child,n=null):(e=k.treeContext,rn=Ka(E.nextSibling),Xn=n,Et=!0,ml=null,Xa=!1,e!==null&&jp(n,e),n=xf(n,i.children),n.flags|=4096);return n}return d?(Sl(),E=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?E=$r(F,E):(E=ts(E,d,r,null),E.flags|=2),E.return=n,i.return=n,i.sibling=E,n.child=i,Vi(null,i),i=n.child,E=e.child.memoizedState,E===null?E=vf(r):(d=E.cachePool,d!==null?(k=jn._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=Op(),E={baseLanes:E.baseLanes|r,cachePool:d}),i.memoizedState=E,i.childLanes=yf(e,b,r),n.memoizedState=gf,Vi(e.child,i)):(bl(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 xf(e,n){return n=kc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function kc(e,n){return e=Aa(22,e,null,n),e.lanes=0,e}function bf(e,n,r){return os(n,e.child,null,r),e=xf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Fg(e,n,r){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n),_d(e.return,n,r)}function Sf(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 Yg(e,n,r){var i=n.pendingProps,d=i.revealOrder,h=i.tail;i=i.children;var b=yn.current,E=(b&2)!==0;if(E?(b=b&1|2,n.flags|=128):b&=1,te(yn,b),Kn(e,n,i,r),i=Et?ki:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fg(e,r,n);else if(e.tag===19)Fg(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&&xc(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=n.child,n.child=null):(d=r.sibling,r.sibling=null),Sf(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&&xc(e)===null){n.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}Sf(n,!0,r,null,h,i);break;case"together":Sf(n,!1,null,null,void 0,i);break;default:n.memoizedState=null}return n.child}function Yr(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),Nl|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(Ms(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,r=$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 wf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&dc(e)))}function z1(e,n,r){switch(n.tag){case 3:ct(n,n.stateNode.containerInfo),gl(n,jn,e.memoizedState.cache),ns();break;case 27:case 5:nt(n);break;case 4:ct(n,n.stateNode.containerInfo);break;case 10:gl(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Yd(n),null;break;case 13:var i=n.memoizedState;if(i!==null)return i.dehydrated!==null?(bl(n),n.flags|=128,null):(r&n.child.childLanes)!==0?Vg(e,n,r):(bl(n),e=Yr(e,n,r),e!==null?e.sibling:null);bl(n);break;case 19:var d=(e.flags&128)!==0;if(i=(r&n.childLanes)!==0,i||(Ms(e,n,r,!1),i=(r&n.childLanes)!==0),d){if(i)return Yg(e,n,r);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),te(yn,yn.current),i)break;return null;case 22:return n.lanes=0,Bg(e,n,r,n.pendingProps);case 24:gl(n,jn,e.memoizedState.cache)}return Yr(e,n,r)}function Gg(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)Cn=!0;else{if(!wf(e,r)&&(n.flags&128)===0)return Cn=!1,z1(e,n,r);Cn=(e.flags&131072)!==0}else Cn=!1,Et&&(n.flags&1048576)!==0&&Rp(n,ki,n.index);switch(n.lanes=0,n.tag){case 16:e:{var i=n.pendingProps;if(e=ss(n.elementType),n.type=e,typeof e=="function")jd(e)?(i=us(e,i),n.tag=1,n=Ig(null,n,e,i,r)):(n.tag=0,n=pf(null,n,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===X){n.tag=11,n=Lg(null,n,e,i,r);break e}else if(d===M){n.tag=14,n=zg(null,n,e,i,r);break e}}throw n=ge(e)||e,Error(s(306,n,""))}}return n;case 0:return pf(e,n,n.type,n.pendingProps,r);case 1:return i=n.type,d=us(i,n.pendingProps),Ig(e,n,i,d,r);case 3:e:{if(ct(n,n.stateNode.containerInfo),e===null)throw Error(s(387));i=n.pendingProps;var h=n.memoizedState;d=h.element,qd(e,n),Hi(n,i,null,r);var b=n.memoizedState;if(i=b.cache,gl(n,jn,i),i!==h.cache&&Ld(n,[jn],r,!0),Bi(),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=Pg(e,n,i,r);break e}else if(i!==d){d=Fa(Error(s(424)),n),Oi(d),n=Pg(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=Ka(e.firstChild),Xn=n,Et=!0,ml=null,Xa=!0,r=Bp(n,null,i,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ns(),i===d){n=Yr(e,n,r);break e}Kn(e,n,i,r)}n=n.child}return n;case 26:return Ac(e,n),e===null?(r=ry(n.type,null,n.pendingProps,null))?n.memoizedState=r:Et||(r=n.type,e=n.pendingProps,i=Gc(je.current).createElement(r),i[ve]=n,i[Ae]=e,Zn(i,r,e),dt(i),n.stateNode=i):n.memoizedState=ry(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return nt(n),e===null&&Et&&(i=n.stateNode=ty(n.type,n.pendingProps,je.current),Xn=n,Xa=!0,d=rn,Dl(n.type)?(th=d,rn=Ka(i.firstChild)):rn=d),Kn(e,n,n.pendingProps.children,r),Ac(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Et&&((d=i=rn)&&(i=fS(i,n.type,n.pendingProps,Xa),i!==null?(n.stateNode=i,Xn=n,rn=Ka(i.firstChild),Xa=!1,d=!0):d=!1),d||pl(n)),nt(n),d=n.type,h=n.pendingProps,b=e!==null?e.memoizedProps:null,i=h.children,Kf(d,h)?i=null:b!==null&&Kf(d,b)&&(n.flags|=32),n.memoizedState!==null&&(d=Xd(e,n,T1,null,null,r),lo._currentValue=d),Ac(e,n),Kn(e,n,i,r),n.child;case 6:return e===null&&Et&&((e=r=rn)&&(r=hS(r,n.pendingProps,Xa),r!==null?(n.stateNode=r,Xn=n,rn=null,e=!0):e=!1),e||pl(n)),null;case 13:return Vg(e,n,r);case 4:return ct(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=os(n,null,i,r):Kn(e,n,i,r),n.child;case 11:return Lg(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,gl(n,n.type,i.value),Kn(e,n,i.children,r),n.child;case 9:return d=n.type._context,i=n.pendingProps.children,rs(n),d=Qn(d),i=i(d),n.flags|=1,Kn(e,n,i,r),n.child;case 14:return zg(e,n,n.type,n.pendingProps,r);case 15:return Ug(e,n,n.type,n.pendingProps,r);case 19:return Yg(e,n,r);case 31:return L1(e,n,r);case 22:return Bg(e,n,r,n.pendingProps);case 24:return rs(n),i=Qn(jn),e===null?(d=Bd(),d===null&&(d=en,h=zd(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),n.memoizedState={parent:i,cache:d},$d(n),gl(n,jn,d)):((e.lanes&r)!==0&&(qd(e,n),Hi(n,null,null,r),Bi()),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),gl(n,jn,i)):(i=h.cache,gl(n,jn,i),i!==d.cache&&Ld(n,[jn],r,!0))),Kn(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function Gr(e){e.flags|=4}function Ef(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(bv())e.flags|=8192;else throw is=pc,Hd}else e.flags&=-16777217}function Xg(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!cy(n))if(bv())e.flags|=8192;else throw is=pc,Hd}function Oc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Zt():536870912,e.lanes|=n,Fs|=n)}function Fi(e,n){if(!Et)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 U1(e,n,r){var i=n.pendingProps;switch(Ad(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(n),null;case 1:return ln(n),null;case 3:return r=n.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Pr(jn),Ge(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Os(n)?Gr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Od())),ln(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(Gr(n),h!==null?(ln(n),Xg(n,h)):(ln(n),Ef(n,d,null,i,r))):h?h!==e.memoizedState?(Gr(n),ln(n),Xg(n,h)):(ln(n),n.flags&=-16777217):(e=e.memoizedProps,e!==i&&Gr(n),ln(n),Ef(n,d,e,i,r)),null;case 27:if(Sn(n),r=je.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==i&&Gr(n);else{if(!i){if(n.stateNode===null)throw Error(s(166));return ln(n),null}e=he.current,Os(n)?Tp(n):(e=ty(d,i,r),n.stateNode=e,Gr(n))}return ln(n),null;case 5:if(Sn(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=he.current,Os(n))Tp(n);else{var b=Gc(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),Ef(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,Os(n)){if(e=n.stateNode,r=n.memoizedProps,i=null,d=Xn,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[ve]=n,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||Vv(e.nodeValue,r)),e||pl(n,!0)}else e=Gc(e).createTextNode(i),e[ve]=n,n.stateNode=e}return ln(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(i=Os(n),r!==null){if(e===null){if(!i)throw Error(s(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[ve]=n}else ns(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ln(n),e=!1}else r=Od(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(Oa(n),n):(Oa(n),null);if((n.flags&128)!==0)throw Error(s(558))}return ln(n),null;case 13:if(i=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Os(n),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(s(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[ve]=n}else ns(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ln(n),d=!1}else d=Od(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Oa(n),n):(Oa(n),null)}return Oa(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),Oc(n,n.updateQueue),ln(n),null);case 4:return Ge(),e===null&&Ff(n.stateNode.containerInfo),ln(n),null;case 10:return Pr(n.type),ln(n),null;case 19:if(P(yn),i=n.memoizedState,i===null)return ln(n),null;if(d=(n.flags&128)!==0,h=i.rendering,h===null)if(d)Fi(i,!1);else{if(hn!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=xc(e),h!==null){for(n.flags|=128,Fi(i,!1),e=h.updateQueue,n.updateQueue=e,Oc(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)wp(r,e),r=r.sibling;return te(yn,yn.current&1|2),Et&&qr(n,i.treeForkCount),n.child}e=e.sibling}i.tail!==null&&tn()>Uc&&(n.flags|=128,d=!0,Fi(i,!1),n.lanes=4194304)}else{if(!d)if(e=xc(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Oc(n,e),Fi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!h.alternate&&!Et)return ln(n),null}else 2*tn()-i.renderingStartTime>Uc&&r!==536870912&&(n.flags|=128,d=!0,Fi(i,!1),n.lanes=4194304);i.isBackwards?(h.sibling=n.child,n.child=h):(e=i.last,e!==null?e.sibling=h:n.child=h,i.last=h)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=tn(),e.sibling=null,r=yn.current,te(yn,d?r&1|2:r&1),Et&&qr(n,i.treeForkCount),e):(ln(n),null);case 22:case 23:return Oa(n),Fd(),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&&Oc(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&&P(ls),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),Pr(jn),ln(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function B1(e,n){switch(Ad(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Pr(jn),Ge(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return Sn(n),null;case 31:if(n.memoizedState!==null){if(Oa(n),n.alternate===null)throw Error(s(340));ns()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Oa(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));ns()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return P(yn),null;case 4:return Ge(),null;case 10:return Pr(n.type),null;case 22:case 23:return Oa(n),Fd(),e!==null&&P(ls),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Pr(jn),null;case 25:return null;default:return null}}function Qg(e,n){switch(Ad(n),n.tag){case 3:Pr(jn),Ge();break;case 26:case 27:case 5:Sn(n);break;case 4:Ge();break;case 31:n.memoizedState!==null&&Oa(n);break;case 13:Oa(n);break;case 19:P(yn);break;case 10:Pr(n.type);break;case 22:case 23:Oa(n),Fd(),e!==null&&P(ls);break;case 24:Pr(jn)}}function Yi(e,n){try{var r=n.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var d=i.next;r=d;do{if((r.tag&e)===e){i=void 0;var h=r.create,b=r.inst;i=h(),b.destroy=i}r=r.next}while(r!==d)}}catch(E){It(n,n.return,E)}}function wl(e,n,r){try{var i=n.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var h=d.next;i=h;do{if((i.tag&e)===e){var b=i.inst,E=b.destroy;if(E!==void 0){b.destroy=void 0,d=n;var k=r,F=E;try{F()}catch(W){It(d,k,W)}}}i=i.next}while(i!==h)}}catch(W){It(n,n.return,W)}}function Kg(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{$p(n,r)}catch(i){It(e,e.return,i)}}}function Zg(e,n,r){r.props=us(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){It(e,n,i)}}function Gi(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 Er(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 Jg(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 Nf(e,n,r){try{var i=e.stateNode;sS(i,e.type,r,n),i[Ae]=n}catch(d){It(e,e.return,d)}}function Wg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Dl(e.type)||e.tag===4}function Rf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wg(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&&Dl(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 jf(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&&Dl(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(jf(e,n,r),e=e.sibling;e!==null;)jf(e,n,r),e=e.sibling}function Mc(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&&Dl(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Mc(e,n,r),e=e.sibling;e!==null;)Mc(e,n,r),e=e.sibling}function ev(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,Dn=!1,Tf=!1,tv=typeof WeakSet=="function"?WeakSet:Set,In=null;function H1(e,n){if(e=e.containerInfo,Xf=eu,e=hp(e),xd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var d=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var b=0,E=-1,k=-1,F=0,W=0,se=e,G=null;t:for(;;){for(var Q;se!==r||d!==0&&se.nodeType!==3||(E=b+d),se!==h||i!==0&&se.nodeType!==3||(k=b+i),se.nodeType===3&&(b+=se.nodeValue.length),(Q=se.firstChild)!==null;)G=se,se=Q;for(;;){if(se===e)break t;if(G===r&&++F===d&&(E=b),G===h&&++W===i&&(k=b),(Q=se.nextSibling)!==null)break;se=G,G=se.parentNode}se=Q}r=E===-1||k===-1?null:{start:E,end:k}}else r=null}r=r||{start:0,end:0}}else r=null;for(Qf={focusedElem:e,selectionRange:r},eu=!1,In=n;In!==null;)if(n=In,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,In=e;else for(;In!==null;){switch(n=In,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,r=n,d=h.memoizedProps,h=h.memoizedState,i=r.stateNode;try{var Oe=us(r.type,d);e=i.getSnapshotBeforeUpdate(Oe,h),i.__reactInternalSnapshotBeforeUpdate=e}catch(Pe){It(r,r.return,Pe)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)Jf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Jf(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 nv(e,n,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:Kr(e,r),i&4&&Yi(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=us(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){It(r,r.return,b)}}i&64&&Kg(r),i&512&&Gi(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&&ev(r);case 26:case 5:Kr(e,r),n===null&&i&4&&Jg(r),i&512&&Gi(r,r.return);break;case 12:Kr(e,r);break;case 31:Kr(e,r),i&4&&lv(e,r);break;case 13:Kr(e,r),i&4&&sv(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=X1.bind(null,r),mS(e,r))));break;case 22:if(i=r.memoizedState!==null||Xr,!i){n=n!==null&&n.memoizedState!==null||Dn,d=Xr;var h=Dn;Xr=i,(Dn=n)&&!h?Zr(e,r,(r.subtreeFlags&8772)!==0):Kr(e,r),Xr=d,Dn=h}break;case 30:break;default:Kr(e,r)}}function av(e){var n=e.alternate;n!==null&&(e.alternate=null,av(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;)rv(e,n,r),r=r.sibling}function rv(e,n,r){if(J&&typeof J.onCommitFiberUnmount=="function")try{J.onCommitFiberUnmount(qe,r)}catch{}switch(r.tag){case 26:Dn||Er(r,n),Qr(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Dn||Er(r,n);var i=on,d=ba;Dl(r.type)&&(on=r.stateNode,ba=!1),Qr(e,n,r),no(r.stateNode),on=i,ba=d;break;case 5:Dn||Er(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,Kv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ws(e)):Kv(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:wl(2,r,n),Dn||wl(4,r,n),Qr(e,n,r);break;case 1:Dn||(Er(r,n),i=r.stateNode,typeof i.componentWillUnmount=="function"&&Zg(r,n,i)),Qr(e,n,r);break;case 21:Qr(e,n,r);break;case 22:Dn=(i=Dn)||r.memoizedState!==null,Qr(e,n,r),Dn=i;break;default:Qr(e,n,r)}}function lv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ws(e)}catch(r){It(n,n.return,r)}}}function sv(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ws(e)}catch(r){It(n,n.return,r)}}function $1(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new tv),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new tv),n;default:throw Error(s(435,e.tag))}}function _c(e,n){var r=$1(e);n.forEach(function(i){if(!r.has(i)){r.add(i);var d=Q1.bind(null,e,i);i.then(d,d)}})}function Sa(e,n){var r=n.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],h=e,b=n,E=b;e:for(;E!==null;){switch(E.tag){case 27:if(Dl(E.type)){on=E.stateNode,ba=!1;break e}break;case 5:on=E.stateNode,ba=!1;break e;case 3:case 4:on=E.stateNode.containerInfo,ba=!0;break e}E=E.return}if(on===null)throw Error(s(160));rv(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;)iv(n,e),n=n.sibling}var cr=null;function iv(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&&(wl(3,e,e.return),Yi(3,e),wl(5,e,e.return));break;case 1:Sa(n,e),wa(e),i&512&&(Dn||r===null||Er(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=cr;if(Sa(n,e),wa(e),i&512&&(Dn||r===null||Er(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=iy("link","href",d).get(i+(r.href||""));if(b){for(var E=0;E<b.length;E++)if(h=b[E],h.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&h.getAttribute("rel")===(r.rel==null?null:r.rel)&&h.getAttribute("title")===(r.title==null?null:r.title)&&h.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){b.splice(E,1);break t}}h=d.createElement(i),Zn(h,i,r),d.head.appendChild(h);break;case"meta":if(b=iy("meta","content",d).get(i+(r.content||""))){for(E=0;E<b.length;E++)if(h=b[E],h.getAttribute("content")===(r.content==null?null:""+r.content)&&h.getAttribute("name")===(r.name==null?null:r.name)&&h.getAttribute("property")===(r.property==null?null:r.property)&&h.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&h.getAttribute("charset")===(r.charSet==null?null:r.charSet)){b.splice(E,1);break t}}h=d.createElement(i),Zn(h,i,r),d.head.appendChild(h);break;default:throw Error(s(468,i))}h[ve]=e,dt(h),i=h}e.stateNode=i}else oy(d,e.type,e.stateNode);else e.stateNode=sy(d,i,e.memoizedProps);else h!==i?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,i===null?oy(d,e.type,e.stateNode):sy(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Nf(e,e.memoizedProps,r.memoizedProps)}break;case 27:Sa(n,e),wa(e),i&512&&(Dn||r===null||Er(r,r.return)),r!==null&&i&4&&Nf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Sa(n,e),wa(e),i&512&&(Dn||r===null||Er(r,r.return)),e.flags&32){d=e.stateNode;try{dl(d,"")}catch(Oe){It(e,e.return,Oe)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,Nf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(Tf=!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(Kc=null,d=cr,cr=Xc(n.containerInfo),Sa(n,e),cr=d,wa(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ws(n.containerInfo)}catch(Oe){It(e,e.return,Oe)}Tf&&(Tf=!1,ov(e));break;case 4:i=cr,cr=Xc(e.stateNode.containerInfo),Sa(n,e),wa(e),cr=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,_c(e,i)));break;case 13:Sa(n,e),wa(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(zc=tn()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,_c(e,i)));break;case 22:d=e.memoizedState!==null;var k=r!==null&&r.memoizedState!==null,F=Xr,W=Dn;if(Xr=F||d,Dn=W||k,Sa(n,e),Dn=W,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||Dn||ds(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){k=r=n;try{if(h=k.stateNode,d)b=h.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{E=k.stateNode;var se=k.memoizedProps.style,G=se!=null&&se.hasOwnProperty("display")?se.display:null;E.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(Oe){It(k,k.return,Oe)}}}else if(n.tag===6){if(r===null){k=n;try{k.stateNode.nodeValue=d?"":k.memoizedProps}catch(Oe){It(k,k.return,Oe)}}}else if(n.tag===18){if(r===null){k=n;try{var Q=k.stateNode;d?Zv(Q,!0):Zv(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,_c(e,r))));break;case 19:Sa(n,e),wa(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,_c(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(Wg(i)){r=i;break}i=i.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var d=r.stateNode,h=Rf(e);Mc(e,h,d);break;case 5:var b=r.stateNode;r.flags&32&&(dl(b,""),r.flags&=-33);var E=Rf(e);Mc(e,E,b);break;case 3:case 4:var k=r.stateNode.containerInfo,F=Rf(e);jf(e,F,k);break;default:throw Error(s(161))}}catch(W){It(e,e.return,W)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function ov(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;ov(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;)nv(e,n.alternate,n),n=n.sibling}function ds(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),ds(n);break;case 1:Er(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Zg(n,n.return,r),ds(n);break;case 27:no(n.stateNode);case 26:case 5:Er(n,n.return),ds(n);break;case 22:n.memoizedState===null&&ds(n);break;case 30:ds(n);break;default:ds(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),Yi(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 E=i.stateNode;try{var k=d.shared.hiddenCallbacks;if(k!==null)for(d.shared.hiddenCallbacks=null,d=0;d<k.length;d++)Hp(k[d],E)}catch(F){It(i,i.return,F)}}r&&b&64&&Kg(h),Gi(h,h.return);break;case 27:ev(h);case 26:case 5:Zr(d,h,r),r&&i===null&&b&4&&Jg(h),Gi(h,h.return);break;case 12:Zr(d,h,r);break;case 31:Zr(d,h,r),r&&b&4&&lv(d,h);break;case 13:Zr(d,h,r),r&&b&4&&sv(d,h);break;case 22:h.memoizedState===null&&Zr(d,h,r),Gi(h,h.return);break;case 30:break;default:Zr(d,h,r)}n=n.sibling}}function Cf(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&&Mi(r))}function Df(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Mi(e))}function ur(e,n,r,i){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)cv(e,n,r,i),n=n.sibling}function cv(e,n,r,i){var d=n.flags;switch(n.tag){case 0:case 11:case 15:ur(e,n,r,i),d&2048&&Yi(9,n);break;case 1:ur(e,n,r,i);break;case 3:ur(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&&Mi(e)));break;case 12:if(d&2048){ur(e,n,r,i),e=n.stateNode;try{var h=n.memoizedProps,b=h.id,E=h.onPostCommit;typeof E=="function"&&E(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){It(n,n.return,k)}}else ur(e,n,r,i);break;case 31:ur(e,n,r,i);break;case 13:ur(e,n,r,i);break;case 23:break;case 22:h=n.stateNode,b=n.alternate,n.memoizedState!==null?h._visibility&2?ur(e,n,r,i):Xi(e,n):h._visibility&2?ur(e,n,r,i):(h._visibility|=2,Is(e,n,r,i,(n.subtreeFlags&10256)!==0||!1)),d&2048&&Cf(b,n);break;case 24:ur(e,n,r,i),d&2048&&Df(n.alternate,n);break;default:ur(e,n,r,i)}}function Is(e,n,r,i,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,b=n,E=r,k=i,F=b.flags;switch(b.tag){case 0:case 11:case 15:Is(h,b,E,k,d),Yi(8,b);break;case 23:break;case 22:var W=b.stateNode;b.memoizedState!==null?W._visibility&2?Is(h,b,E,k,d):Xi(h,b):(W._visibility|=2,Is(h,b,E,k,d)),d&&F&2048&&Cf(b.alternate,b);break;case 24:Is(h,b,E,k,d),d&&F&2048&&Df(b.alternate,b);break;default:Is(h,b,E,k,d)}n=n.sibling}}function Xi(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:Xi(r,i),d&2048&&Cf(i.alternate,i);break;case 24:Xi(r,i),d&2048&&Df(i.alternate,i);break;default:Xi(r,i)}n=n.sibling}}var Qi=8192;function Ps(e,n,r){if(e.subtreeFlags&Qi)for(e=e.child;e!==null;)uv(e,n,r),e=e.sibling}function uv(e,n,r){switch(e.tag){case 26:Ps(e,n,r),e.flags&Qi&&e.memoizedState!==null&&jS(r,cr,e.memoizedState,e.memoizedProps);break;case 5:Ps(e,n,r);break;case 3:case 4:var i=cr;cr=Xc(e.stateNode.containerInfo),Ps(e,n,r),cr=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Qi,Qi=16777216,Ps(e,n,r),Qi=i):Ps(e,n,r));break;default:Ps(e,n,r)}}function dv(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 Ki(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,hv(i,e)}dv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)fv(e),e=e.sibling}function fv(e){switch(e.tag){case 0:case 11:case 15:Ki(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Ki(e);break;case 12:Ki(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Lc(e)):Ki(e);break;default:Ki(e)}}function Lc(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,hv(i,e)}dv(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:wl(8,n,n.return),Lc(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,Lc(n));break;default:Lc(n)}e=e.sibling}}function hv(e,n){for(;In!==null;){var r=In;switch(r.tag){case 0:case 11:case 15:wl(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:Mi(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(av(i),i===r){In=null;break e}if(d!==null){d.return=h,In=d;break e}In=h}}}var q1={getCacheForType:function(e){var n=Qn(jn),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return Qn(jn).controller.signal}},I1=typeof WeakMap=="function"?WeakMap:Map,Ot=0,en=null,mt=null,xt=0,qt=0,Ma=null,El=!1,Vs=!1,Af=!1,Jr=0,hn=0,Nl=0,fs=0,kf=0,_a=0,Fs=0,Zi=null,Ea=null,Of=!1,zc=0,mv=0,Uc=1/0,Bc=null,Rl=null,Ln=0,jl=null,Ys=null,Wr=0,Mf=0,_f=null,pv=null,Ji=0,Lf=null;function La(){return(Ot&2)!==0&&xt!==0?xt&-xt:U.T!==null?qf():Z()}function gv(){if(_a===0)if((xt&536870912)===0||Et){var e=vt;vt<<=1,(vt&3932160)===0&&(vt=262144),_a=e}else _a=536870912;return e=ka.current,e!==null&&(e.flags|=32),_a}function Na(e,n,r){(e===en&&(qt===2||qt===9)||e.cancelPendingCommit!==null)&&(Gs(e,0),Tl(e,xt,_a,!1)),ht(e,r),((Ot&2)===0||e!==en)&&(e===en&&((Ot&2)===0&&(fs|=r),hn===4&&Tl(e,xt,_a,!1)),Nr(e))}function vv(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?F1(e,n):Uf(e,n,!0),h=i;do{if(d===0){Vs&&!i&&Tl(e,n,0,!1);break}else{if(r=e.current.alternate,h&&!P1(r)){d=Uf(e,n,!1),h=!1;continue}if(d===2){if(h=n,e.errorRecoveryDisabledLanes&h)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var E=e;d=Zi;var k=E.current.memoizedState.isDehydrated;if(k&&(Gs(E,b).flags|=256),b=Uf(E,b,!1),b!==2){if(Af&&!k){E.errorRecoveryDisabledLanes|=h,fs|=h,d=4;break e}h=Ea,Ea=d,h!==null&&(Ea===null?Ea=h:Ea.push.apply(Ea,h))}d=b}if(h=!1,d!==2)continue}}if(d===1){Gs(e,0),Tl(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:Tl(i,n,_a,!El);break e;case 2:Ea=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(d=zc+300-tn(),10<d)){if(Tl(i,n,_a,!El),Bt(i,0,!0)!==0)break e;Wr=n,i.timeoutHandle=Xv(yv.bind(null,i,r,Ea,Bc,Of,n,_a,fs,Fs,El,h,"Throttled",-0,0),d);break e}yv(i,r,Ea,Bc,Of,n,_a,fs,Fs,El,h,null,-0,0)}}break}while(!0);Nr(e)}function yv(e,n,r,i,d,h,b,E,k,F,W,se,G,Q){if(e.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},uv(n,h,se);var Oe=(h&62914560)===h?zc-tn():(h&4194048)===h?mv-tn():0;if(Oe=TS(se,Oe),Oe!==null){Wr=h,e.cancelPendingCommit=Oe(jv.bind(null,e,n,h,r,i,d,b,E,k,W,se,null,G,Q)),Tl(e,h,b,!F);return}}jv(e,n,h,r,i,d,b,E,k)}function P1(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(!Da(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 Tl(e,n,r,i){n&=~kf,n&=~fs,e.suspendedLanes|=n,e.pingedLanes&=~n,i&&(e.warmLanes|=n),i=e.expirationTimes;for(var d=n;0<d;){var h=31-Kt(d),b=1<<h;i[h]=-1,d&=~b}r!==0&&wn(e,r,n)}function Hc(){return(Ot&6)===0?(Wi(0),!1):!0}function zf(){if(mt!==null){if(qt===0)var e=mt.return;else e=mt,Ir=as=null,Zd(e),Us=null,Li=0,e=mt;for(;e!==null;)Qg(e.alternate,e),e=e.return;mt=null}}function Gs(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,cS(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Wr=0,zf(),en=e,mt=r=$r(e.current,null),xt=n,qt=0,Ma=null,El=!1,Vs=Ct(e,n),Af=!1,Fs=_a=kf=fs=Nl=hn=0,Ea=Zi=null,Of=!1,(n&8)!==0&&(n|=n&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=n;0<i;){var d=31-Kt(i),h=1<<d;n|=e[d],i&=~h}return Jr=n,sc(),r}function xv(e,n){st=null,U.H=Pi,n===zs||n===mc?(n=Lp(),qt=3):n===Hd?(n=Lp(),qt=4):qt=n===mf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Ma=n,mt===null&&(hn=1,Cc(e,Fa(n,e.current)))}function bv(){var e=ka.current;return e===null?!0:(xt&4194048)===xt?Qa===null:(xt&62914560)===xt||(xt&536870912)!==0?e===Qa:!1}function Sv(){var e=U.H;return U.H=Pi,e===null?Pi:e}function wv(){var e=U.A;return U.A=q1,e}function $c(){hn=4,El||(xt&4194048)!==xt&&ka.current!==null||(Vs=!0),(Nl&134217727)===0&&(fs&134217727)===0||en===null||Tl(en,xt,_a,!1)}function Uf(e,n,r){var i=Ot;Ot|=2;var d=Sv(),h=wv();(en!==e||xt!==n)&&(Bc=null,Gs(e,n)),n=!1;var b=hn;e:do try{if(qt!==0&&mt!==null){var E=mt,k=Ma;switch(qt){case 8:zf(),b=6;break e;case 3:case 2:case 9:case 6:ka.current===null&&(n=!0);var F=qt;if(qt=0,Ma=null,Xs(e,E,k,F),r&&Vs){b=0;break e}break;default:F=qt,qt=0,Ma=null,Xs(e,E,k,F)}}V1(),b=hn;break}catch(W){xv(e,W)}while(!0);return n&&e.shellSuspendCounter++,Ir=as=null,Ot=i,U.H=d,U.A=h,mt===null&&(en=null,xt=0,sc()),b}function V1(){for(;mt!==null;)Ev(mt)}function F1(e,n){var r=Ot;Ot|=2;var i=Sv(),d=wv();en!==e||xt!==n?(Bc=null,Uc=tn()+500,Gs(e,n)):Vs=Ct(e,n);e:do try{if(qt!==0&&mt!==null){n=mt;var h=Ma;t:switch(qt){case 1:qt=0,Ma=null,Xs(e,n,h,1);break;case 2:case 9:if(Mp(h)){qt=0,Ma=null,Nv(n);break}n=function(){qt!==2&&qt!==9||en!==e||(qt=7),Nr(e)},h.then(n,n);break e;case 3:qt=7;break e;case 4:qt=5;break e;case 7:Mp(h)?(qt=0,Ma=null,Nv(n)):(qt=0,Ma=null,Xs(e,n,h,7));break;case 5:var b=null;switch(mt.tag){case 26:b=mt.memoizedState;case 5:case 27:var E=mt;if(b?cy(b):E.stateNode.complete){qt=0,Ma=null;var k=E.sibling;if(k!==null)mt=k;else{var F=E.return;F!==null?(mt=F,qc(F)):mt=null}break t}}qt=0,Ma=null,Xs(e,n,h,5);break;case 6:qt=0,Ma=null,Xs(e,n,h,6);break;case 8:zf(),hn=6;break e;default:throw Error(s(462))}}Y1();break}catch(W){xv(e,W)}while(!0);return Ir=as=null,U.H=i,U.A=d,Ot=r,mt!==null?0:(en=null,xt=0,sc(),hn)}function Y1(){for(;mt!==null&&!Hn();)Ev(mt)}function Ev(e){var n=Gg(e.alternate,e,Jr);e.memoizedProps=e.pendingProps,n===null?qc(e):mt=n}function Nv(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=qg(r,n,n.pendingProps,n.type,void 0,xt);break;case 11:n=qg(r,n,n.pendingProps,n.type.render,n.ref,xt);break;case 5:Zd(n);default:Qg(r,n),n=mt=wp(n,Jr),n=Gg(r,n,Jr)}e.memoizedProps=e.pendingProps,n===null?qc(e):mt=n}function Xs(e,n,r,i){Ir=as=null,Zd(n),Us=null,Li=0;var d=n.return;try{if(_1(e,d,n,r,xt)){hn=1,Cc(e,Fa(r,e.current)),mt=null;return}}catch(h){if(d!==null)throw mt=d,h;hn=1,Cc(e,Fa(r,e.current)),mt=null;return}n.flags&32768?(Et||i===1?e=!0:Vs||(xt&536870912)!==0?e=!1:(El=e=!0,(i===2||i===9||i===3||i===6)&&(i=ka.current,i!==null&&i.tag===13&&(i.flags|=16384))),Rv(n,e)):qc(n)}function qc(e){var n=e;do{if((n.flags&32768)!==0){Rv(n,El);return}e=n.return;var r=U1(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);hn===0&&(hn=5)}function Rv(e,n){do{var r=B1(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);hn=6,mt=null}function jv(e,n,r,i,d,h,b,E,k){e.cancelPendingCommit=null;do Ic();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|=Nd,Je(e,r,h,b,E,k),e===en&&(mt=en=null,xt=0),Ys=n,jl=e,Wr=r,Mf=h,_f=d,pv=i,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,K1(qn,function(){return kv(),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{H1(e,n,r)}finally{Ot=b,B.p=d,U.T=i}}Ln=1,Tv(),Cv(),Dv()}}function Tv(){if(Ln===1){Ln=0;var e=jl,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{iv(n,e);var h=Qf,b=hp(e.containerInfo),E=h.focusedElem,k=h.selectionRange;if(b!==E&&E&&E.ownerDocument&&fp(E.ownerDocument.documentElement,E)){if(k!==null&&xd(E)){var F=k.start,W=k.end;if(W===void 0&&(W=F),"selectionStart"in E)E.selectionStart=F,E.selectionEnd=Math.min(W,E.value.length);else{var se=E.ownerDocument||document,G=se&&se.defaultView||window;if(G.getSelection){var Q=G.getSelection(),Oe=E.textContent.length,Pe=Math.min(k.start,Oe),Yt=k.end===void 0?Pe:Math.min(k.end,Oe);!Q.extend&&Pe>Yt&&(b=Yt,Yt=Pe,Pe=b);var H=dp(E,Pe),L=dp(E,Yt);if(H&&L&&(Q.rangeCount!==1||Q.anchorNode!==H.node||Q.anchorOffset!==H.offset||Q.focusNode!==L.node||Q.focusOffset!==L.offset)){var V=se.createRange();V.setStart(H.node,H.offset),Q.removeAllRanges(),Pe>Yt?(Q.addRange(V),Q.extend(L.node,L.offset)):(V.setEnd(L.node,L.offset),Q.addRange(V))}}}}for(se=[],Q=E;Q=Q.parentNode;)Q.nodeType===1&&se.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<se.length;E++){var re=se[E];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}eu=!!Xf,Qf=Xf=null}finally{Ot=d,B.p=i,U.T=r}}e.current=n,Ln=2}}function Cv(){if(Ln===2){Ln=0;var e=jl,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{nv(e,n.alternate,n)}finally{Ot=d,B.p=i,U.T=r}}Ln=3}}function Dv(){if(Ln===4||Ln===3){Ln=0,$n();var e=jl,n=Ys,r=Wr,i=pv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ln=5:(Ln=0,Ys=jl=null,Av(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Rl=null),$(r),n=n.stateNode,J&&typeof J.onCommitFiberRoot=="function")try{J.onCommitFiberRoot(qe,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=U.T,d=B.p,B.p=2,U.T=null;try{for(var h=e.onRecoverableError,b=0;b<i.length;b++){var E=i[b];h(E.value,{componentStack:E.stack})}}finally{U.T=n,B.p=d}}(Wr&3)!==0&&Ic(),Nr(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Lf?Ji++:(Ji=0,Lf=e):Ji=0,Wi(0)}}function Av(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Mi(n)))}function Ic(){return Tv(),Cv(),Dv(),kv()}function kv(){if(Ln!==5)return!1;var e=jl,n=Mf;Mf=0;var r=$(Wr),i=U.T,d=B.p;try{B.p=32>r?32:r,U.T=null,r=_f,_f=null;var h=jl,b=Wr;if(Ln=0,Ys=jl=null,Wr=0,(Ot&6)!==0)throw Error(s(331));var E=Ot;if(Ot|=4,fv(h.current),cv(h,h.current,b,r),Ot=E,Wi(0,!1),J&&typeof J.onPostCommitFiberRoot=="function")try{J.onPostCommitFiberRoot(qe,h)}catch{}return!0}finally{B.p=d,U.T=i,Av(e,n)}}function Ov(e,n,r){n=Fa(r,n),n=hf(e.stateNode,n,2),e=xl(e,n,2),e!==null&&(ht(e,2),Nr(e))}function It(e,n,r){if(e.tag===3)Ov(e,e,r);else for(;n!==null;){if(n.tag===3){Ov(n,e,r);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Rl===null||!Rl.has(i))){e=Fa(r,e),r=Mg(2),i=xl(n,r,2),i!==null&&(_g(r,i,n,e),ht(i,2),Nr(i));break}}n=n.return}}function Bf(e,n,r){var i=e.pingCache;if(i===null){i=e.pingCache=new I1;var d=new Set;i.set(n,d)}else d=i.get(n),d===void 0&&(d=new Set,i.set(n,d));d.has(r)||(Af=!0,d.add(r),e=G1.bind(null,e,n,r),n.then(e,e))}function G1(e,n,r){var i=e.pingCache;i!==null&&i.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,en===e&&(xt&r)===r&&(hn===4||hn===3&&(xt&62914560)===xt&&300>tn()-zc?(Ot&2)===0&&Gs(e,0):kf|=r,Fs===xt&&(Fs=0)),Nr(e)}function Mv(e,n){n===0&&(n=Zt()),e=es(e,n),e!==null&&(ht(e,n),Nr(e))}function X1(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),Mv(e,r)}function Q1(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),Mv(e,r)}function K1(e,n){return _t(e,n)}var Pc=null,Qs=null,Hf=!1,Vc=!1,$f=!1,Cl=0;function Nr(e){e!==Qs&&e.next===null&&(Qs===null?Pc=Qs=e:Qs=Qs.next=e),Vc=!0,Hf||(Hf=!0,J1())}function Wi(e,n){if(!$f&&Vc){$f=!0;do for(var r=!1,i=Pc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var h=0;else{var b=i.suspendedLanes,E=i.pingedLanes;h=(1<<31-Kt(42|e)+1)-1,h&=d&~(b&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,Uv(i,h))}else h=xt,h=Bt(i,i===en?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(h&3)===0||Ct(i,h)||(r=!0,Uv(i,h));i=i.next}while(r);$f=!1}}function Z1(){_v()}function _v(){Vc=Hf=!1;var e=0;Cl!==0&&oS()&&(e=Cl);for(var n=tn(),r=null,i=Pc;i!==null;){var d=i.next,h=Lv(i,n);h===0?(i.next=null,r===null?Pc=d:r.next=d,d===null&&(Qs=r)):(r=i,(e!==0||(h&3)!==0)&&(Vc=!0)),i=d}Ln!==0&&Ln!==5||Wi(e),Cl!==0&&(Cl=0)}function Lv(e,n){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var b=31-Kt(h),E=1<<b,k=d[b];k===-1?((E&r)===0||(E&i)!==0)&&(d[b]=nn(E,n)):k<=n&&(e.expiredLanes|=E),h&=~E}if(n=en,r=xt,r=Bt(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===n&&(qt===2||qt===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Qt(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ct(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(i!==null&&Qt(i),$(r)){case 2:case 8:r=Wn;break;case 32:r=qn;break;case 268435456:r=Ce;break;default:r=qn}return i=zv.bind(null,e),r=_t(r,i),e.callbackPriority=n,e.callbackNode=r,n}return i!==null&&i!==null&&Qt(i),e.callbackPriority=2,e.callbackNode=null,2}function zv(e,n){if(Ln!==0&&Ln!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Ic()&&e.callbackNode!==r)return null;var i=xt;return i=Bt(e,e===en?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(vv(e,i,n),Lv(e,tn()),e.callbackNode!=null&&e.callbackNode===r?zv.bind(null,e):null)}function Uv(e,n){if(Ic())return null;vv(e,n,!0)}function J1(){uS(function(){(Ot&6)!==0?_t(ha,Z1):_v()})}function qf(){if(Cl===0){var e=_s;e===0&&(e=Me,Me<<=1,(Me&261888)===0&&(Me=256)),Cl=e}return Cl}function Bv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:an(""+e)}function Hv(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 W1(e,n,r,i,d){if(n==="submit"&&r&&r.stateNode===d){var h=Bv((d[Ae]||null).action),b=i.submitter;b&&(n=(n=b[Ae]||null)?Bv(n.formAction):b.getAttribute("formAction"),n!==null&&(h=n,b=null));var E=new Br("action","action",null,i,d);e.push({event:E,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Cl!==0){var k=b?Hv(d,b):new FormData(d);sf(r,{pending:!0,data:k,method:d.method,action:h},null,k)}}else typeof h=="function"&&(E.preventDefault(),k=b?Hv(d,b):new FormData(d),sf(r,{pending:!0,data:k,method:d.method,action:h},h,k))},currentTarget:d}]})}}for(var If=0;If<Ed.length;If++){var Pf=Ed[If],eS=Pf.toLowerCase(),tS=Pf[0].toUpperCase()+Pf.slice(1);or(eS,"on"+tS)}or(gp,"onAnimationEnd"),or(vp,"onAnimationIteration"),or(yp,"onAnimationStart"),or("dblclick","onDoubleClick"),or("focusin","onFocus"),or("focusout","onBlur"),or(v1,"onTransitionRun"),or(y1,"onTransitionStart"),or(x1,"onTransitionCancel"),or(xp,"onTransitionEnd"),On("onMouseEnter",["mouseout","mouseover"]),On("onMouseLeave",["mouseout","mouseover"]),On("onPointerEnter",["pointerout","pointerover"]),On("onPointerLeave",["pointerout","pointerover"]),En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),En("onBeforeInput",["compositionend","keypress","textInput","paste"]),En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eo="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(" "),nS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eo));function $v(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],d=i.event;i=i.listeners;e:{var h=void 0;if(n)for(var b=i.length-1;0<=b;b--){var E=i[b],k=E.instance,F=E.currentTarget;if(E=E.listener,k!==h&&d.isPropagationStopped())break e;h=E,d.currentTarget=F;try{h(d)}catch(W){lc(W)}d.currentTarget=null,h=k}else for(b=0;b<i.length;b++){if(E=i[b],k=E.instance,F=E.currentTarget,E=E.listener,k!==h&&d.isPropagationStopped())break e;h=E,d.currentTarget=F;try{h(d)}catch(W){lc(W)}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)||(qv(n,e,2,!1),r.add(i))}function Vf(e,n,r){var i=0;n&&(i|=4),qv(r,e,i,n)}var Fc="_reactListening"+Math.random().toString(36).slice(2);function Ff(e){if(!e[Fc]){e[Fc]=!0,Jt.forEach(function(r){r!=="selectionchange"&&(nS.has(r)||Vf(r,!1,e),Vf(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Fc]||(n[Fc]=!0,Vf("selectionchange",!1,n))}}function qv(e,n,r,i){switch(gy(n)){case 2:var d=AS;break;case 8:d=kS;break;default:d=sh}r=d.bind(null,n,r,e),d=void 0,!Ni||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 Yf(e,n,r,i,d){var h=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var E=i.stateNode.containerInfo;if(E===d)break;if(b===4)for(b=i.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===d)return;b=b.return}for(;E!==null;){if(b=$t(E),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){i=h=b;continue e}E=E.parentNode}}i=i.return}Ei(function(){var F=h,W=Mr(r),se=[];e:{var G=bp.get(e);if(G!==void 0){var Q=Br,Oe=e;switch(e){case"keypress":if(Ns(r)===0)break e;case"keydown":case"keyup":Q=Rn;break;case"focusin":Oe="focus",Q=xe;break;case"focusout":Oe="blur",Q=xe;break;case"beforeblur":case"afterblur":Q=xe;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=tc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=Y;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=br;break;case gp:case vp:case yp:Q=ce;break;case xp:Q=nc;break;case"scroll":case"scrollend":Q=fd;break;case"wheel":Q=md;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=r1}var Pe=(n&4)!==0,Yt=!Pe&&(e==="scroll"||e==="scrollend"),H=Pe?G!==null?G+"Capture":null:G;Pe=[];for(var L=F,V;L!==null;){var re=L;if(V=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||V===null||H===null||(re=Ia(L,H),re!=null&&Pe.push(to(L,re,V))),Yt)break;L=L.return}0<Pe.length&&(G=new Q(G,Oe,null,r,W),se.push({event:G,listeners:Pe}))}}if((n&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&r!==Ca&&(Oe=r.relatedTarget||r.fromElement)&&($t(Oe)||Oe[Re]))break e;if((Q||G)&&(G=W.window===W?W:(G=W.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(Oe=r.relatedTarget||r.toElement,Q=F,Oe=Oe?$t(Oe):null,Oe!==null&&(Yt=o(Oe),Pe=Oe.tag,Oe!==Yt||Pe!==5&&Pe!==27&&Pe!==6)&&(Oe=null)):(Q=null,Oe=F),Q!==Oe)){if(Pe=tc,re="onMouseLeave",H="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Pe=zt,re="onPointerLeave",H="onPointerEnter",L="pointer"),Yt=Q==null?G:ut(Q),V=Oe==null?G:ut(Oe),G=new Pe(re,L+"leave",Q,r,W),G.target=Yt,G.relatedTarget=V,re=null,$t(W)===F&&(Pe=new Pe(H,L+"enter",Oe,r,W),Pe.target=V,Pe.relatedTarget=Yt,re=Pe),Yt=re,Q&&Oe)t:{for(Pe=aS,H=Q,L=Oe,V=0,re=H;re;re=Pe(re))V++;re=0;for(var He=L;He;He=Pe(He))re++;for(;0<V-re;)H=Pe(H),V--;for(;0<re-V;)L=Pe(L),re--;for(;V--;){if(H===L||L!==null&&H===L.alternate){Pe=H;break t}H=Pe(H),L=Pe(L)}Pe=null}else Pe=null;Q!==null&&Iv(se,G,Q,Pe,!1),Oe!==null&&Yt!==null&&Iv(se,Yt,Oe,Pe,!0)}}e:{if(G=F?ut(F):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var At=lp;else if(ap(G))if(sp)At=m1;else{At=f1;var Le=d1}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?F&&Gl(F.elementType)&&(At=lp):At=h1;if(At&&(At=At(e,F))){rp(se,At,r,W);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?ut(F):window,e){case"focusin":(ap(Le)||Le.contentEditable==="true")&&(js=Le,bd=F,Ai=null);break;case"focusout":Ai=bd=js=null;break;case"mousedown":Sd=!0;break;case"contextmenu":case"mouseup":case"dragend":Sd=!1,mp(se,r,W);break;case"selectionchange":if(g1)break;case"keydown":case"keyup":mp(se,r,W)}var ot;if(gd)e:{switch(e){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Rs?tp(e,r)&&(bt="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(bt="onCompositionStart");bt&&(Jm&&r.locale!=="ko"&&(Rs||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Rs&&(ot=Wo()):(Pa=W,Ri="value"in Pa?Pa.value:Pa.textContent,Rs=!0)),Le=Yc(F,bt),0<Le.length&&(bt=new rt(bt,e,null,r,W),se.push({event:bt,listeners:Le}),ot?bt.data=ot:(ot=np(r),ot!==null&&(bt.data=ot)))),(ot=s1?i1(e,r):o1(e,r))&&(bt=Yc(F,"onBeforeInput"),0<bt.length&&(Le=new rt("onBeforeInput","beforeinput",null,r,W),se.push({event:Le,listeners:bt}),Le.data=ot)),W1(se,e,F,r,W)}$v(se,n)})}function to(e,n,r){return{instance:e,listener:n,currentTarget:r}}function Yc(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=Ia(e,r),d!=null&&i.unshift(to(e,d,h)),d=Ia(e,n),d!=null&&i.push(to(e,d,h))),e.tag===3)return i;e=e.return}return[]}function aS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Iv(e,n,r,i,d){for(var h=n._reactName,b=[];r!==null&&r!==i;){var E=r,k=E.alternate,F=E.stateNode;if(E=E.tag,k!==null&&k===i)break;E!==5&&E!==26&&E!==27||F===null||(k=F,d?(F=Ia(r,h),F!=null&&b.unshift(to(r,F,k))):d||(F=Ia(r,h),F!=null&&b.push(to(r,F,k)))),r=r.return}b.length!==0&&e.push({event:n,listeners:b})}var rS=/\r\n?/g,lS=/\u0000|\uFFFD/g;function Pv(e){return(typeof e=="string"?e:""+e).replace(rS,`
|
|
49
|
+
`).replace(lS,"")}function Vv(e,n){return n=Pv(n),Pv(e)===n}function Ft(e,n,r,i,d,h){switch(r){case"children":typeof i=="string"?n==="body"||n==="textarea"&&i===""||dl(e,i):(typeof i=="number"||typeof i=="bigint")&&n!=="body"&&dl(e,""+i);break;case"className":gr(e,"class",i);break;case"tabIndex":gr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":gr(e,r,i);break;case"style":va(e,i,h);break;case"data":if(n!=="object"){gr(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"&&Ft(e,n,"name",d.name,d,null),Ft(e,n,"formEncType",d.formEncType,d,null),Ft(e,n,"formMethod",d.formMethod,d,null),Ft(e,n,"formTarget",d.formTarget,d,null)):(Ft(e,n,"encType",d.encType,d,null),Ft(e,n,"method",d.method,d,null),Ft(e,n,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=an(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=na);break;case"onScroll":i!=null&&pt("scroll",e);break;case"onScrollEnd":i!=null&&pt("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}r=an(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""+i):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":i===!0?e.setAttribute(r,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,i):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case"popover":pt("beforetoggle",e),pt("toggle",e),ea(e,"popover",i);break;case"xlinkActuate":Qe(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Qe(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Qe(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Qe(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Qe(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Qe(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Qe(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Qe(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Qe(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ea(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=ws.get(r)||r,ea(e,r,i))}}function Gf(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"?dl(e,i):(typeof i=="number"||typeof i=="bigint")&&dl(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:Ft(e,n,h,b,r,null)}}d&&Ft(e,n,"srcSet",r.srcSet,r,null),i&&Ft(e,n,"src",r.src,r,null);return;case"input":pt("invalid",e);var E=h=b=d=null,k=null,F=null;for(i in r)if(r.hasOwnProperty(i)){var W=r[i];if(W!=null)switch(i){case"name":d=W;break;case"type":b=W;break;case"checked":k=W;break;case"defaultChecked":F=W;break;case"value":h=W;break;case"defaultValue":E=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(s(137,n));break;default:Ft(e,n,i,W,r,null)}}Si(e,h,E,k,F,b,d,!1);return;case"select":pt("invalid",e),i=b=h=null;for(d in r)if(r.hasOwnProperty(d)&&(E=r[d],E!=null))switch(d){case"value":h=E;break;case"defaultValue":b=E;break;case"multiple":i=E;default:Ft(e,n,d,E,r,null)}n=h,r=b,e.multiple=!!i,n!=null?vr(e,!!i,n,!1):r!=null&&vr(e,!!i,r,!0);return;case"textarea":pt("invalid",e),h=d=i=null;for(b in r)if(r.hasOwnProperty(b)&&(E=r[b],E!=null))switch(b){case"value":i=E;break;case"defaultValue":d=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(s(91));break;default:Ft(e,n,b,E,r,null)}sr(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:Ft(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<eo.length;i++)pt(eo[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:Ft(e,n,F,i,r,null)}return;default:if(Gl(n)){for(W in r)r.hasOwnProperty(W)&&(i=r[W],i!==void 0&&Gf(e,n,W,i,r,void 0));return}}for(E in r)r.hasOwnProperty(E)&&(i=r[E],i!=null&&Ft(e,n,E,i,r,null))}function sS(e,n,r,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,b=null,E=null,k=null,F=null,W=null;for(Q in r){var se=r[Q];if(r.hasOwnProperty(Q)&&se!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":k=se;default:i.hasOwnProperty(Q)||Ft(e,n,Q,null,i,se)}}for(var G in i){var Q=i[G];if(se=r[G],i.hasOwnProperty(G)&&(Q!=null||se!=null))switch(G){case"type":h=Q;break;case"name":d=Q;break;case"checked":F=Q;break;case"defaultChecked":W=Q;break;case"value":b=Q;break;case"defaultValue":E=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(137,n));break;default:Q!==se&&Ft(e,n,G,Q,i,se)}}Yl(e,b,E,k,F,W,h,d);return;case"select":Q=b=E=G=null;for(h in r)if(k=r[h],r.hasOwnProperty(h)&&k!=null)switch(h){case"value":break;case"multiple":Q=k;default:i.hasOwnProperty(h)||Ft(e,n,h,null,i,k)}for(d in i)if(h=i[d],k=r[d],i.hasOwnProperty(d)&&(h!=null||k!=null))switch(d){case"value":G=h;break;case"defaultValue":E=h;break;case"multiple":b=h;default:h!==k&&Ft(e,n,d,h,i,k)}n=E,r=b,i=Q,G!=null?vr(e,!!r,G,!1):!!i!=!!r&&(n!=null?vr(e,!!r,n,!0):vr(e,!!r,r?[]:"",!1));return;case"textarea":Q=G=null;for(E in r)if(d=r[E],r.hasOwnProperty(E)&&d!=null&&!i.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Ft(e,n,E,null,i,d)}for(b in i)if(d=i[b],h=r[b],i.hasOwnProperty(b)&&(d!=null||h!=null))switch(b){case"value":G=d;break;case"defaultValue":Q=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(s(91));break;default:d!==h&&Ft(e,n,b,d,i,h)}Jo(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:Ft(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:Ft(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 Pe in r)G=r[Pe],r.hasOwnProperty(Pe)&&G!=null&&!i.hasOwnProperty(Pe)&&Ft(e,n,Pe,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:Ft(e,n,F,G,i,Q)}return;default:if(Gl(n)){for(var Yt in r)G=r[Yt],r.hasOwnProperty(Yt)&&G!==void 0&&!i.hasOwnProperty(Yt)&&Gf(e,n,Yt,void 0,i,G);for(W in i)G=i[W],Q=r[W],!i.hasOwnProperty(W)||G===Q||G===void 0&&Q===void 0||Gf(e,n,W,G,i,Q);return}}for(var H in r)G=r[H],r.hasOwnProperty(H)&&G!=null&&!i.hasOwnProperty(H)&&Ft(e,n,H,null,i,G);for(se in i)G=i[se],Q=r[se],!i.hasOwnProperty(se)||G===Q||G==null&&Q==null||Ft(e,n,se,G,i,Q)}function Fv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),i=0;i<r.length;i++){var d=r[i],h=d.transferSize,b=d.initiatorType,E=d.duration;if(h&&E&&Fv(b)){for(b=0,E=d.responseEnd,i+=1;i<r.length;i++){var k=r[i],F=k.startTime;if(F>E)break;var W=k.transferSize,se=k.initiatorType;W&&Fv(se)&&(k=k.responseEnd,b+=W*(k<E?1:(E-F)/(k-F)))}if(--i,n+=8*(h+b)/(d.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Xf=null,Qf=null;function Gc(e){return e.nodeType===9?e:e.ownerDocument}function Yv(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 Gv(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 Kf(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 Zf=null;function oS(){var e=window.event;return e&&e.type==="popstate"?e===Zf?!1:(Zf=e,!0):(Zf=null,!1)}var Xv=typeof setTimeout=="function"?setTimeout:void 0,cS=typeof clearTimeout=="function"?clearTimeout:void 0,Qv=typeof Promise=="function"?Promise:void 0,uS=typeof queueMicrotask=="function"?queueMicrotask:typeof Qv<"u"?function(e){return Qv.resolve(null).then(e).catch(dS)}:Xv;function dS(e){setTimeout(function(){throw e})}function Dl(e){return e==="head"}function Kv(e,n){var r=n,i=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(i===0){e.removeChild(d),Ws(n);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")no(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,no(r);for(var h=r.firstChild;h;){var b=h.nextSibling,E=h.nodeName;h[Ze]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=b}}else r==="body"&&no(e.ownerDocument.body);r=d}while(r);Ws(n)}function Zv(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 Jf(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":Jf(r),Ie(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function fS(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=Ka(e.nextSibling),e===null)break}return null}function hS(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Ka(e.nextSibling),e===null))return null;return e}function Jv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ka(e.nextSibling),e===null))return null;return e}function Wf(e){return e.data==="$?"||e.data==="$~"}function eh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function mS(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 Ka(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 th=null;function Wv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return Ka(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function ey(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 ty(e,n,r){switch(n=Gc(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 no(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ie(e)}var Za=new Map,ny=new Set;function Xc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var el=B.d;B.d={f:pS,r:gS,D:vS,C:yS,L:xS,m:bS,X:wS,S:SS,M:ES};function pS(){var e=el.f(),n=Hc();return e||n}function gS(e){var n=We(e);n!==null&&n.tag===5&&n.type==="form"?xg(n):el.r(e)}var Ks=typeof document>"u"?null:document;function ay(e,n,r){var i=Ks;if(i&&typeof n=="string"&&n){var d=Gn(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),ny.has(d)||(ny.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 vS(e){el.D(e),ay("dns-prefetch",e,null)}function yS(e,n){el.C(e,n),ay("preconnect",e,n)}function xS(e,n,r){el.L(e,n,r);var i=Ks;if(i&&e&&n){var d='link[rel="preload"][as="'+Gn(n)+'"]';n==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+Gn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+Gn(r.imageSizes)+'"]')):d+='[href="'+Gn(e)+'"]';var h=d;switch(n){case"style":h=Zs(e);break;case"script":h=Js(e)}Za.has(h)||(e=y({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Za.set(h,e),i.querySelector(d)!==null||n==="style"&&i.querySelector(ao(h))||n==="script"&&i.querySelector(ro(h))||(n=i.createElement("link"),Zn(n,"link",e),dt(n),i.head.appendChild(n)))}}function bS(e,n){el.m(e,n);var r=Ks;if(r&&e){var i=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+Gn(i)+'"][href="'+Gn(e)+'"]',h=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Js(e)}if(!Za.has(h)&&(e=y({rel:"modulepreload",href:e},n),Za.set(h,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ro(h)))return}i=r.createElement("link"),Zn(i,"link",e),dt(i),r.head.appendChild(i)}}}function SS(e,n,r){el.S(e,n,r);var i=Ks;if(i&&e){var d=it(i).hoistableStyles,h=Zs(e);n=n||"default";var b=d.get(h);if(!b){var E={loading:0,preload:null};if(b=i.querySelector(ao(h)))E.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Za.get(h))&&nh(e,r);var k=b=i.createElement("link");dt(k),Zn(k,"link",e),k._p=new Promise(function(F,W){k.onload=F,k.onerror=W}),k.addEventListener("load",function(){E.loading|=1}),k.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Qc(b,n,i)}b={type:"stylesheet",instance:b,count:1,state:E},d.set(h,b)}}}function wS(e,n){el.X(e,n);var r=Ks;if(r&&e){var i=it(r).hoistableScripts,d=Js(e),h=i.get(d);h||(h=r.querySelector(ro(d)),h||(e=y({src:e,async:!0},n),(n=Za.get(d))&&ah(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 ES(e,n){el.M(e,n);var r=Ks;if(r&&e){var i=it(r).hoistableScripts,d=Js(e),h=i.get(d);h||(h=r.querySelector(ro(d)),h||(e=y({src:e,async:!0,type:"module"},n),(n=Za.get(d))&&ah(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 ry(e,n,r,i){var d=(d=je.current)?Xc(d):null;if(!d)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=Zs(r.href),r=it(d).hoistableStyles,i=r.get(n),i||(i={type:"style",instance:null,count:0,state:null},r.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Zs(r.href);var h=it(d).hoistableStyles,b=h.get(e);if(b||(d=d.ownerDocument||d,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,b),(h=d.querySelector(ao(e)))&&!h._p&&(b.instance=h,b.state.loading=5),Za.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},Za.set(e,r),h||NS(d,e,r,b.state))),n&&i===null)throw Error(s(528,""));return b}if(n&&i!==null)throw Error(s(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Js(r),r=it(d).hoistableScripts,i=r.get(n),i||(i={type:"script",instance:null,count:0,state:null},r.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Zs(e){return'href="'+Gn(e)+'"'}function ao(e){return'link[rel="stylesheet"]['+e+"]"}function ly(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function NS(e,n,r,i){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?i.loading=1:(n=e.createElement("link"),i.preload=n,n.addEventListener("load",function(){return i.loading|=1}),n.addEventListener("error",function(){return i.loading|=2}),Zn(n,"link",r),dt(n),e.head.appendChild(n))}function Js(e){return'[src="'+Gn(e)+'"]'}function ro(e){return"script[async]"+e}function sy(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),Qc(i,r.precedence,e),n.instance=i;case"stylesheet":d=Zs(r.href);var h=e.querySelector(ao(d));if(h)return n.state.loading|=4,n.instance=h,dt(h),h;i=ly(r),(d=Za.get(d))&&nh(i,d),h=(e.ownerDocument||e).createElement("link"),dt(h);var b=h;return b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),Zn(h,"link",i),n.state.loading|=4,Qc(h,r.precedence,e),n.instance=h;case"script":return h=Js(r.src),(d=e.querySelector(ro(h)))?(n.instance=d,dt(d),d):(i=r,(d=Za.get(h))&&(i=y({},r),ah(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,Qc(i,r.precedence,e));return n.instance}function Qc(e,n,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,h=d,b=0;b<i.length;b++){var E=i[b];if(E.dataset.precedence===n)h=E;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function nh(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function ah(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Kc=null;function iy(e,n,r){if(Kc===null){var i=new Map,d=Kc=new Map;d.set(r,i)}else d=Kc,i=d.get(r),i||(i=new Map,d.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var h=r[d];if(!(h[Ze]||h[ve]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var b=h.getAttribute(n)||"";b=e+b;var E=i.get(b);E?E.push(h):i.set(b,[h])}}return i}function oy(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function RS(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 cy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function jS(e,n,r,i){if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Zs(i.href),h=n.querySelector(ao(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Zc.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=h,dt(h);return}h=n.ownerDocument||n,i=ly(i),(d=Za.get(d))&&nh(i,d),h=h.createElement("link"),dt(h);var b=h;b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),Zn(h,"link",i),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Zc.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var rh=0;function TS(e,n){return e.stylesheets&&e.count===0&&Wc(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&Wc(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&rh===0&&(rh=62500*iS());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Wc(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>rh?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function Zc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Jc=null;function Wc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Jc=new Map,n.forEach(CS,e),Jc=null,Zc.call(e))}function CS(e,n){if(!(n.state.loading&4)){var r=Jc.get(e);if(r)var i=r.get(null);else{r=new Map,Jc.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=Zc.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 lo={$$typeof:q,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function DS(e,n,r,i,d,h,b,E,k){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ht(0),this.hiddenUpdates=Ht(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function uy(e,n,r,i,d,h,b,E,k,F,W,se){return e=new DS(e,n,r,b,k,F,W,se,E),n=1,h===!0&&(n|=24),h=Aa(3,null,null,n),e.current=h,h.stateNode=e,n=zd(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:i,isDehydrated:r,cache:n},$d(h),e}function dy(e){return e?(e=Ds,e):Ds}function fy(e,n,r,i,d,h){d=dy(d),i.context===null?i.context=d:i.pendingContext=d,i=yl(n),i.payload={element:r},h=h===void 0?null:h,h!==null&&(i.callback=h),r=xl(e,i,n),r!==null&&(Na(r,e,n),Ui(r,e,n))}function hy(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function lh(e,n){hy(e,n),(e=e.alternate)&&hy(e,n)}function my(e){if(e.tag===13||e.tag===31){var n=es(e,67108864);n!==null&&Na(n,e,67108864),lh(e,67108864)}}function py(e){if(e.tag===13||e.tag===31){var n=La();n=_(n);var r=es(e,n);r!==null&&Na(r,e,n),lh(e,n)}}var eu=!0;function AS(e,n,r,i){var d=U.T;U.T=null;var h=B.p;try{B.p=2,sh(e,n,r,i)}finally{B.p=h,U.T=d}}function kS(e,n,r,i){var d=U.T;U.T=null;var h=B.p;try{B.p=8,sh(e,n,r,i)}finally{B.p=h,U.T=d}}function sh(e,n,r,i){if(eu){var d=ih(i);if(d===null)Yf(e,n,i,tu,r),vy(e,i);else if(MS(d,e,n,r,i))i.stopPropagation();else if(vy(e,i),n&4&&-1<OS.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=wt(h.pendingLanes);if(b!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;b;){var k=1<<31-Kt(b);E.entanglements[1]|=k,b&=~k}Nr(h),(Ot&6)===0&&(Uc=tn()+500,Wi(0))}}break;case 31:case 13:E=es(h,2),E!==null&&Na(E,h,2),Hc(),lh(h,2)}if(h=ih(i),h===null&&Yf(e,n,i,tu,r),h===d)break;d=h}d!==null&&i.stopPropagation()}else Yf(e,n,i,null,r)}}function ih(e){return e=Mr(e),oh(e)}var tu=null;function oh(e){if(tu=null,e=$t(e),e!==null){var n=o(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 tu=e,null}function gy(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(fa()){case ha:return 2;case Wn:return 8;case qn:case fe:return 32;case Ce:return 268435456;default:return 32}default:return 32}}var ch=!1,Al=null,kl=null,Ol=null,so=new Map,io=new Map,Ml=[],OS="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 vy(e,n){switch(e){case"focusin":case"focusout":Al=null;break;case"dragenter":case"dragleave":kl=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":so.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":io.delete(n.pointerId)}}function oo(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&&my(n)),e):(e.eventSystemFlags|=i,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function MS(e,n,r,i,d){switch(n){case"focusin":return Al=oo(Al,e,n,r,i,d),!0;case"dragenter":return kl=oo(kl,e,n,r,i,d),!0;case"mouseover":return Ol=oo(Ol,e,n,r,i,d),!0;case"pointerover":var h=d.pointerId;return so.set(h,oo(so.get(h)||null,e,n,r,i,d)),!0;case"gotpointercapture":return h=d.pointerId,io.set(h,oo(io.get(h)||null,e,n,r,i,d)),!0}return!1}function yy(e){var n=$t(e.target);if(n!==null){var r=o(n);if(r!==null){if(n=r.tag,n===13){if(n=f(r),n!==null){e.blockedOn=n,le(e.priority,function(){py(r)});return}}else if(n===31){if(n=m(r),n!==null){e.blockedOn=n,le(e.priority,function(){py(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 nu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=ih(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Ca=i,r.target.dispatchEvent(i),Ca=null}else return n=We(r),n!==null&&my(n),e.blockedOn=r,!1;n.shift()}return!0}function xy(e,n,r){nu(e)&&r.delete(n)}function _S(){ch=!1,Al!==null&&nu(Al)&&(Al=null),kl!==null&&nu(kl)&&(kl=null),Ol!==null&&nu(Ol)&&(Ol=null),so.forEach(xy),io.forEach(xy)}function au(e,n){e.blockedOn===n&&(e.blockedOn=null,ch||(ch=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,_S)))}var ru=null;function by(e){ru!==e&&(ru=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ru===e&&(ru=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(oh(i||r)===null)continue;break}var h=We(r);h!==null&&(e.splice(n,3),n-=3,sf(h,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Ws(e){function n(k){return au(k,e)}Al!==null&&au(Al,e),kl!==null&&au(kl,e),Ol!==null&&au(Ol,e),so.forEach(n),io.forEach(n);for(var r=0;r<Ml.length;r++){var i=Ml[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ml.length&&(r=Ml[0],r.blockedOn===null);)yy(r),r.blockedOn===null&&Ml.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||by(r);else if(b){var E=null;if(h&&h.hasAttribute("formAction")){if(d=h,b=h[Ae]||null)E=b.formAction;else if(oh(d)!==null)continue}else E=b.action;typeof E=="function"?r[i+1]=E:(r.splice(i,3),i-=3),by(r)}}}function Sy(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(b){return d=b})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function uh(e){this._internalRoot=e}lu.prototype.render=uh.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));var r=n.current,i=La();fy(r,i,e,n,null,null)},lu.prototype.unmount=uh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;fy(e.current,2,null,e,null,null),Hc(),n[Re]=null}};function lu(e){this._internalRoot=e}lu.prototype.unstable_scheduleHydration=function(e){if(e){var n=Z();e={blockedOn:null,target:e,priority:n};for(var r=0;r<Ml.length&&n!==0&&n<Ml[r].priority;r++);Ml.splice(r,0,e),r===0&&yy(e)}};var wy=a.version;if(wy!=="19.2.7")throw Error(s(527,wy,"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 LS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!su.isDisabled&&su.supportsFiber)try{qe=su.inject(LS),J=su}catch{}}return uo.createRoot=function(e,n){if(!c(e))throw Error(s(299));var r=!1,i="",d=Dg,h=Ag,b=kg;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=uy(e,1,!1,null,null,r,i,null,d,h,b,Sy),e[Re]=n.current,Ff(e),new uh(n)},uo.hydrateRoot=function(e,n,r){if(!c(e))throw Error(s(299));var i=!1,d="",h=Dg,b=Ag,E=kg,k=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(h=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(E=r.onRecoverableError),r.formState!==void 0&&(k=r.formState)),n=uy(e,1,!0,n,r??null,i,d,k,h,b,E,Sy),n.context=dy(null),r=n.current,i=La(),i=_(i),d=yl(i),d.callback=null,xl(r,d,i),r=i,n.current.lanes=r,ht(n,r),Nr(n),e[Re]=n.current,Ff(e),new lu(n)},uo.version="19.2.7",uo}var Oy;function QS(){if(Oy)return hh.exports;Oy=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=XS(),hh.exports}var KS=QS();/**
|
|
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 tb=t=>{throw TypeError(t)},nb=(t,a,l)=>a.has(t)||tb("Cannot "+l),Ja=(t,a,l)=>(nb(t,a,"read from private field"),l?l.call(t):a.get(t)),So=(t,a,l)=>a.has(t)?tb("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,l),Rr=(t,a,l,s)=>(nb(t,a,"write to private field"),a.set(t,l),l),qu=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,lm=/^[\\/]{2}/;function ab(t,a){return a+t.replace(/\\/g,"/")}var My="popstate";function _y(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function ZS(t={}){function a(s,c){var g;let o=(g=c.state)==null?void 0:g.masked,{pathname:f,search:m,hash:p}=o||s.location;return Oo("",{pathname:f,search:m,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default",o?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function l(s,c){return typeof c=="string"?c:Dr(c)}return WS(a,l,null,t)}function tt(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function dn(t,a){if(!t){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function JS(){return Math.random().toString(36).substring(2,10)}function Ly(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 Oo(t,a,l=null,s,c){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof a=="string"?Ar(a):a,state:l,key:a&&a.key||s||JS(),mask:c}}function Dr({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 Ar(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 WS(t,a,l,s={}){let{window:c=document.defaultView,v5Compat:o=!1}=s,f=c.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(),z=R==null?null:R-g;g=R,p&&p({action:m,location:j.location,delta:z})}function N(R,z){m="PUSH";let I=_y(R)?R:Oo(j.location,R,z);g=x()+1;let q=Ly(I,g),X=j.createHref(I.mask||I);try{f.pushState(q,"",X)}catch(ee){if(ee instanceof DOMException&&ee.name==="DataCloneError")throw ee;c.location.assign(X)}o&&p&&p({action:m,location:j.location,delta:1})}function w(R,z){m="REPLACE";let I=_y(R)?R:Oo(j.location,R,z);g=x();let q=Ly(I,g),X=j.createHref(I.mask||I);f.replaceState(q,"",X),o&&p&&p({action:m,location:j.location,delta:0})}function S(R){return rb(c,R)}let j={get action(){return m},get location(){return t(c,f)},listen(R){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(My,y),p=R,()=>{c.removeEventListener(My,y),p=null}},createHref(R){return a(c,R)},createURL:S,encodeLocation(R){let z=S(R);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:N,replace:w,go(R){return f.go(R)}};return j}function rb(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 c=typeof a=="string"?a:Dr(a);return c=c.replace(/ $/,"%20"),!l&&lm.test(c)&&(c=s+c),new URL(c,s)}var wo,zy=class{constructor(t){if(So(this,wo,new Map),t)for(let[a,l]of t)this.set(a,l)}get(t){if(Ja(this,wo).has(t))return Ja(this,wo).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,a){Ja(this,wo).set(t,a)}};wo=new WeakMap;var ew=new Set(["lazy","caseSensitive","path","id","index","children"]);function tw(t){return ew.has(t)}var nw=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function aw(t){return nw.has(t)}function rw(t){return t.index===!0}function Mo(t,a,l=[],s={},c=!1){return t.map((o,f)=>{let m=[...l,String(f)],p=typeof o.id=="string"?o.id:m.join("-");if(tt(o.index!==!0||!o.children,"Cannot specify children on an index route"),tt(c||!s[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),rw(o)){let g={...o,id:p};return s[p]=Uy(g,a(g)),g}else{let g={...o,id:p,children:void 0};return s[p]=Uy(g,a(g)),o.children&&(g.children=Mo(o.children,a,m,s,c)),g}})}function Uy(t,a){return Object.assign(t,{...a,...typeof a.lazy=="object"&&a.lazy!=null?{lazy:{...t.lazy,...a.lazy}}:{}})}function lb(t,a,l="/"){return fr(t,a,l,!1)}function fr(t,a,l,s,c){let o=typeof a=="string"?Ar(a):a,f=Ba(o.pathname||"/",l);if(f==null)return null;let m=c??Su(t),p=null,g=pw(f);for(let x=0;p==null&&x<m.length;++x)p=mw(m[x],g,s);return p}function sb(t,a){let{route:l,pathname:s,params:c}=t;return{id:l.id,pathname:s,params:c,data:a[l.id],loaderData:a[l.id],handle:l.handle}}function Su(t){let a=ib(t);return lw(a),a}function ib(t,a=[],l=[],s="",c=!1){let o=(f,m,p=c,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=nr([s,x.relativePath]),N=l.concat(x);f.children&&f.children.length>0&&(tt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),ib(f.children,a,N,y,p)),!(f.path==null&&!f.index)&&a.push({path:y,score:fw(y,f.index),routesMeta:N.map((w,S)=>{let[j,R]=ub(w.relativePath,w.caseSensitive,S===N.length-1);return{...w,matcher:j,compiledParams:R}})})};return t.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))o(f,m);else for(let g of ob(f.path))o(f,m,!0,g)}),a}function ob(t){let a=t.split("/");if(a.length===0)return[];let[l,...s]=a,c=l.endsWith("?"),o=l.replace(/\?$/,"");if(s.length===0)return c?[o,""]:[o];let f=ob(s.join("/")),m=[];return m.push(...f.map(p=>p===""?o:[o,p].join("/"))),c&&m.push(...f),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function lw(t){t.sort((a,l)=>a.score!==l.score?l.score-a.score:hw(a.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}var sw=/^:[\w-]+$/,iw=3,ow=2,cw=1,uw=10,dw=-2,By=t=>t==="*";function fw(t,a){let l=t.split("/"),s=l.length;return l.some(By)&&(s+=dw),a&&(s+=ow),l.filter(c=>!By(c)).reduce((c,o)=>c+(sw.test(o)?iw:o===""?cw:uw),s)}function hw(t,a){return t.length===a.length&&t.slice(0,-1).every((s,c)=>s===a[c])?t[t.length-1]-a[a.length-1]:0}function mw(t,a,l=!1){let{routesMeta:s}=t,c={},o="/",f=[];for(let m=0;m<s.length;++m){let p=s[m],g=m===s.length-1,x=o==="/"?a:a.slice(o.length)||"/",y={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},N=p.matcher&&p.compiledParams?cb(y,x,p.matcher,p.compiledParams):Du(y,x),w=p.route;if(!N&&g&&l&&!s[s.length-1].route.index&&(N=Du({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!N)return null;Object.assign(c,N.params),f.push({params:c,pathname:nr([o,N.pathname]),pathnameBase:yw(nr([o,N.pathnameBase])),route:w}),N.pathnameBase!=="/"&&(o=nr([o,N.pathnameBase]))}return f}function Du(t,a){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[l,s]=ub(t.path,t.caseSensitive,t.end);return cb(t,a,l,s)}function cb(t,a,l,s){let c=a.match(l);if(!c)return null;let o=c[0],f=o.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:s.reduce((g,{paramName:x,isOptional:y},N)=>{if(x==="*"){let S=m[N]||"";f=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const w=m[N];return y&&!w?g[x]=void 0:g[x]=(w||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:f,pattern:t}}function ub(t,a=!1,l=!0){dn(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=[],c="^"+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:"*"}),c+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":t!==""&&t!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),s]}function pw(t){try{return t.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return dn(!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 Ba(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 gw({basename:t,pathname:a}){return a==="/"?t:nr([t,a])}var sm=t=>qu.test(t);function vw(t,a="/"){let{pathname:l,search:s="",hash:c=""}=typeof t=="string"?Ar(t):t,o;return l?(l=om(l),l.startsWith("/")?o=Hy(l.substring(1),"/"):o=Hy(l,a)):o=a,{pathname:o,search:xw(s),hash:bw(c)}}function Hy(t,a){let l=Au(a).split("/");return t.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function vh(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 db(t){return t.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function im(t){let a=db(t);return a.map((l,s)=>s===a.length-1?l.pathname:l.pathnameBase)}function Iu(t,a,l,s=!1){let c;typeof t=="string"?c=Ar(t):(c={...t},tt(!c.pathname||!c.pathname.includes("?"),vh("?","pathname","search",c)),tt(!c.pathname||!c.pathname.includes("#"),vh("#","pathname","hash",c)),tt(!c.search||!c.search.includes("#"),vh("#","search","hash",c)));let o=t===""||c.pathname==="",f=o?"/":c.pathname,m;if(f==null)m=l;else{let y=a.length-1;if(!s&&f.startsWith("..")){let N=f.split("/");for(;N[0]==="..";)N.shift(),y-=1;c.pathname=N.join("/")}m=y>=0?a[y]:"/"}let p=vw(c,m),g=f&&f!=="/"&&f.endsWith("/"),x=(o||f===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var om=t=>t.replace(/[\\/]{2,}/g,"/"),nr=t=>om(t.join("/")),Au=t=>t.replace(/\/+$/,""),yw=t=>Au(t).replace(/^\/*/,"/"),xw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,bw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Ha=(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})},Sw=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Bo=class{constructor(t,a,l,s=!1){this.status=t,this.statusText=a||"",this.internal=s,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function fi(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Ho(t){let a=t.map(l=>l.route.path).filter(Boolean);return nr(a)||"/"}var fb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hb(t,a){let l=t;if(typeof l!="string"||!qu.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let s=l,c=!1;if(fb)try{let o=new URL(window.location.href),f=lm.test(l)?new URL(ab(l,o.protocol)):new URL(l),m=Ba(f.pathname,a);f.origin===o.origin&&m!=null?l=m+f.search+f.hash:c=!0}catch{dn(!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:c,to:l}}var $l=Symbol("Uninstrumented");function ww(t,a){let l={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(c=>c({id:a.id,index:a.index,path:a.path,instrument(o){let f=Object.keys(l);for(let m of f)o[m]&&l[m].push(o[m])}}));let s={};if(typeof a.lazy=="function"&&l.lazy.length>0){let c=oi(l.lazy,a.lazy,()=>{});c&&(s.lazy=c)}if(typeof a.lazy=="object"){let c=a.lazy;["middleware","loader","action"].forEach(o=>{let f=c[o],m=l[`lazy.${o}`];if(typeof f=="function"&&m.length>0){let p=oi(m,f,()=>{});p&&(s.lazy=Object.assign(s.lazy||{},{[o]:p}))}})}return["loader","action"].forEach(c=>{let o=a[c];if(typeof o=="function"&&l[c].length>0){let f=o[$l]??o,m=oi(l[c],f,(...p)=>$y(p[0]));m&&(c==="loader"&&f.hydrate===!0&&(m.hydrate=!0),m[$l]=f,s[c]=m)}}),a.middleware&&a.middleware.length>0&&l.middleware.length>0&&(s.middleware=a.middleware.map(c=>{let o=c[$l]??c,f=oi(l.middleware,o,(...m)=>$y(m[0]));return f?(f[$l]=o,f):c})),s}function Ew(t,a){let l={navigate:[],fetch:[]};if(a.forEach(s=>s({instrument(c){let o=Object.keys(c);for(let f of o)c[f]&&l[f].push(c[f])}})),l.navigate.length>0){let s=t.navigate[$l]??t.navigate,c=oi(l.navigate,s,(...o)=>{let[f,m]=o;return{to:typeof f=="number"||typeof f=="string"?f:f?Dr(f):".",...qy(t,m??{})}});c&&(c[$l]=s,t.navigate=c)}if(l.fetch.length>0){let s=t.fetch[$l]??t.fetch,c=oi(l.fetch,s,(...o)=>{let[f,,m,p]=o;return{href:m??".",fetcherKey:f,...qy(t,p??{})}});c&&(c[$l]=s,t.fetch=c)}return t}function oi(t,a,l){return t.length===0?null:async(...s)=>{let c=await mb(t,l(...s),()=>a(...s),t.length-1);if(c.type==="error")throw c.value;return c.value}}async function mb(t,a,l,s){let c=t[s],o;if(c){let f,m=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=mb(t,a,l,s-1),o=await f,tt(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await c(m,a)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await m(),await f}else try{o={type:"success",value:await l()}}catch(f){o={type:"error",value:f}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function $y(t){let{request:a,context:l,params:s,pattern:c}=t;return{request:Nw(a),params:{...s},pattern:c,context:Rw(l)}}function qy(t,a){return{currentUrl:Dr(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 Nw(t){return{method:t.method,url:t.url,headers:{get:(...a)=>t.headers.get(...a)}}}function Rw(t){if(Tw(t)){let a={...t};return Object.freeze(a),a}else return{get:a=>t.get(a)}}var jw=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Tw(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")===jw}var pb=["POST","PUT","PATCH","DELETE"],Cw=new Set(pb),Dw=["GET",...pb],Aw=new Set(Dw),gb=new Set([301,302,303,307,308]),kw=new Set([307,308]),yh={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},vb={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ow=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),yb="remix-router-transitions",xb=Symbol("ResetLoaderData"),hs,li,zl,si,Mw=class{constructor(t){So(this,hs),So(this,li),So(this,zl),So(this,si),Rr(this,hs,t),Rr(this,li,Su(t))}get stableRoutes(){return Ja(this,hs)}get activeRoutes(){return Ja(this,zl)??Ja(this,hs)}get branches(){return Ja(this,si)??Ja(this,li)}get hasHMRRoutes(){return Ja(this,zl)!=null}setRoutes(t){Rr(this,hs,t),Rr(this,li,Su(t))}setHmrRoutes(t){Rr(this,zl,t),Rr(this,si,Su(t))}commitHmrRoutes(){Ja(this,zl)&&(Rr(this,hs,Ja(this,zl)),Rr(this,li,Ja(this,si)),Rr(this,zl,void 0),Rr(this,si,void 0))}};hs=new WeakMap;li=new WeakMap;zl=new WeakMap;si=new WeakMap;function _w(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||[],c=t.mapRouteProperties||Ow,o=c;if(t.instrumentations){let A=t.instrumentations;o=_=>({...c(_),...ww(A.map($=>$.route).filter(Boolean),_)})}let f={},m=new Mw(Mo(t.routes,o,void 0,f)),p=t.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=t.dataStrategy||Hw,x={...t.future},y=null,N=new Set,w=null,S=null,j=null,R=null,z=t.hydrationData!=null,I=fr(m.activeRoutes,t.history.location,p,!1,m.branches),q=!1,X=null,ee,ne;if(I==null&&!t.patchRoutesOnNavigation){let A=Wa(404,{pathname:t.history.location.pathname}),{matches:_,route:$}=iu(m.activeRoutes);ee=!0,ne=!ee,I=_,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))ee=!1,ne=!ee;else if(!I.some(A=>cm(A.route)))ee=!0,ne=!ee;else{let A=t.hydrationData?t.hydrationData.loaderData:null,_=t.hydrationData?t.hydrationData.errors:null,$=I;if(_){let Z=I.findIndex(le=>_[le.route.id]!==void 0);$=$.slice(0,Z+1)}ne=!1,ee=!0,$.forEach(Z=>{let le=bb(Z.route,A,_);ne=ne||le.renderFallback,ee=ee&&!le.shouldLoad})}else{ee=!1,ne=!ee,I=[];let A=Ht(null,m.activeRoutes,t.history.location.pathname);A.active&&A.matches&&(q=!0,I=A.matches)}let M,C={historyAction:t.history.action,location:t.history.location,matches:I,initialized:ee,renderFallback:ne,navigation:yh,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},ue="POP",me=null,ye=!1,ae,K=!1,ge=new Map,be=null,U=!1,B=!1,oe=new Set,de=new Map,we=0,D=-1,P=new Map,te=new Set,he=new Map,Ne=new Map,je=new Set,ze=new Map,ct,Ge=null;function nt(){if(y=t.history.listen(({action:A,location:_,delta:$})=>{if(ct){ct(),ct=void 0;return}dn(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 Z=yt({currentLocation:C.location,nextLocation:_,historyAction:A});if(Z&&$!=null){let le=new Promise(Te=>{ct=Te});t.history.go($*-1),vt(Z,{state:"blocked",location:_,proceed(){vt(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:_}),le.then(()=>t.history.go($))},reset(){let Te=new Map(C.blockers);Te.set(Z,fo),ft({blockers:Te})}}),me==null||me.resolve(),me=null;return}return Ut(A,_)}),l){rE(a,ge);let A=()=>lE(a,ge);a.addEventListener("pagehide",A),be=()=>a.removeEventListener("pagehide",A)}return C.initialized||Ut("POP",C.location,{initialHydration:!0}),M}function Sn(){y&&y(),be&&be(),N.clear(),ae&&ae.abort(),C.fetchers.forEach((A,_)=>qe(C.fetchers,_)),C.blockers.forEach((A,_)=>Me(_))}function Xt(A){if(N.add(A),w){let{newErrors:_}=w;w=null,A(C,{deletedFetchers:[],newErrors:_,viewTransitionOpts:void 0,flushSync:!1})}return()=>N.delete(A)}function ft(A,_={}){A.matches&&(A.matches=A.matches.map(le=>{let Te=f[le.route.id],ve=le.route;return ve.element!==Te.element||ve.errorElement!==Te.errorElement||ve.hydrateFallbackElement!==Te.hydrateFallbackElement?{...le,route:Te}:le})),C={...C,...A};let $=[],Z=[];C.fetchers.forEach((le,Te)=>{le.state==="idle"&&(je.has(Te)?$.push(Te):Z.push(Te))}),je.forEach(le=>{!C.fetchers.has(le)&&!de.has(le)&&$.push(le)}),N.size===0&&(w={newErrors:A.errors??null}),[...N].forEach(le=>le(C,{deletedFetchers:$,newErrors:A.errors??null,viewTransitionOpts:_.viewTransitionOpts,flushSync:_.flushSync===!0})),$.forEach(le=>qe(C.fetchers,le)),Z.forEach(le=>C.fetchers.delete(le))}function ie(A,_,{flushSync:$}={}){var Ue,Xe;let Z=C.actionData!=null&&C.navigation.formMethod!=null&&oa(C.navigation.formMethod)&&C.navigation.state==="loading"&&((Ue=A.state)==null?void 0:Ue._isRedirect)!==!0,le;_.actionData?Object.keys(_.actionData).length>0?le=_.actionData:le=null:Z?le=C.actionData:le=null;let Te=_.loaderData?Zy(C.loaderData,_.loaderData,_.matches||[],_.errors):C.loaderData,ve=C.blockers;ve.size>0&&(ve=new Map(ve),ve.forEach((ke,Ze)=>ve.set(Ze,fo)));let Ae=U?!1:Zt(A,_.matches||C.matches),Re=ye===!0||C.navigation.formMethod!=null&&oa(C.navigation.formMethod)&&((Xe=A.state)==null?void 0:Xe._isRedirect)!==!0;m.commitHmrRoutes(),U||ue==="POP"||(ue==="PUSH"?t.history.push(A,A.state):ue==="REPLACE"&&t.history.replace(A,A.state));let _e;if(ue==="POP"){let ke=ge.get(C.location.pathname);ke&&ke.has(A.pathname)?_e={currentLocation:C.location,nextLocation:A}:ge.has(A.pathname)&&(_e={currentLocation:A,nextLocation:C.location})}else if(K){let ke=ge.get(C.location.pathname);ke?ke.add(A.pathname):(ke=new Set([A.pathname]),ge.set(C.location.pathname,ke)),_e={currentLocation:C.location,nextLocation:A}}ft({..._,actionData:le,loaderData:Te,historyAction:ue,location:A,initialized:!0,renderFallback:!1,navigation:yh,revalidation:"idle",restoreScrollPosition:Ae,preventScrollReset:Re,blockers:ve},{viewTransitionOpts:_e,flushSync:$===!0}),ue="POP",ye=!1,K=!1,U=!1,B=!1,me==null||me.resolve(),me=null,Ge==null||Ge.resolve(),Ge=null}async function $e(A,_){if(me==null||me.resolve(),me=null,typeof A=="number"){me||(me=tx());let Ie=me.promise;return t.history.go(A),Ie}let $=Ih(C.location,C.matches,p,A,_==null?void 0:_.fromRouteId,_==null?void 0:_.relative),{path:Z,submission:le,error:Te}=Iy(!1,$,_),ve;_!=null&&_.mask&&(ve={pathname:"",search:"",hash:"",...typeof _.mask=="string"?Ar(_.mask):{...C.location.mask,..._.mask}});let Ae=C.location,Re=Oo(Ae,Z,_&&_.state,void 0,ve);Re={...Re,...t.history.encodeLocation(Re)};let _e=_&&_.replace!=null?_.replace:void 0,Ue="PUSH";_e===!0?Ue="REPLACE":_e===!1||le!=null&&oa(le.formMethod)&&le.formAction===C.location.pathname+C.location.search&&(Ue="REPLACE");let Xe=_&&"preventScrollReset"in _?_.preventScrollReset===!0:void 0,ke=(_&&_.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,_)},reset(){let Ie=new Map(C.blockers);Ie.set(Ze,fo),ft({blockers:Ie})}});return}await Ut(Ue,Re,{submission:le,pendingError:Te,preventScrollReset:Xe,replace:_&&_.replace,enableViewTransition:_&&_.viewTransition,flushSync:ke,callSiteDefaultShouldRevalidate:_&&_.defaultShouldRevalidate})}function at(){Ge||(Ge=tx()),qn(),ft({revalidation:"loading"});let A=Ge.promise;return C.navigation.state==="submitting"?A:C.navigation.state==="idle"?(Ut(C.historyAction,C.location,{startUninterruptedRevalidation:!0}),A):(Ut(ue||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:K===!0}),A)}async function Ut(A,_,$){ae&&ae.abort(),ae=null,ue=A,U=($&&$.startUninterruptedRevalidation)===!0,nn(C.location,C.matches),ye=($&&$.preventScrollReset)===!0,K=($&&$.enableViewTransition)===!0;let Z=m.activeRoutes,le=$!=null&&$.initialHydration&&C.matches&&C.matches.length>0&&!q?C.matches:fr(Z,_,p,!1,m.branches),Te=($&&$.flushSync)===!0;if(le&&C.initialized&&!B&&Xw(C.location,_)&&!($&&$.submission&&oa($.submission.formMethod))){ie(_,{matches:le},{flushSync:Te});return}let ve=Ht(le,Z,_.pathname);if(ve.active&&ve.matches&&(le=ve.matches),!le){let{error:We,notFoundMatches:ut,route:it}=wt(_.pathname);ie(_,{matches:ut,loaderData:{},errors:{[it.id]:We}},{flushSync:Te});return}let Ae=$&&$.overrideNavigation?{...$.overrideNavigation,matches:le,historyAction:A}:void 0;ae=new AbortController;let Re=ii(t.history,_,ae.signal,$&&$.submission),_e=t.getContext?await t.getContext():new zy,Ue;if($&&$.pendingError)Ue=[Hl(le).route.id,{type:"error",error:$.pendingError}];else if($&&$.submission&&oa($.submission.formMethod)){let We=await gn(Re,_,$.submission,le,A,_e,ve.active,$&&$.initialHydration===!0,{replace:$.replace,flushSync:Te});if(We.shortCircuited)return;if(We.pendingActionResult){let[ut,it]=We.pendingActionResult;if(za(it)&&fi(it.error)&&it.error.status===404){ae=null,ie(_,{matches:We.matches,loaderData:{},errors:{[ut]:it.error}});return}}le=We.matches||le,Ue=We.pendingActionResult,Ae=xh(_,le,A,$.submission),Te=!1,ve.active=!1,Re=ii(t.history,Re.url,Re.signal)}let{shortCircuited:Xe,matches:ke,loaderData:Ze,errors:Ie,workingFetchers:$t}=await jt(Re,_,le,A,_e,ve.active,Ae,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,Te,Ue,$&&$.callSiteDefaultShouldRevalidate);Xe||(ae=null,ie(_,{matches:ke||le,...Jy(Ue),loaderData:Ze,errors:Ie,...$t?{fetchers:$t}:{}}))}async function gn(A,_,$,Z,le,Te,ve,Ae,Re={}){qn();let _e=nE(_,Z,le,$);if(ft({navigation:_e},{flushSync:Re.flushSync===!0}),ve){let ke=await ht(Z,_.pathname,A.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){if(ke.partialMatches.length===0){let{matches:Ie,route:$t}=iu(m.activeRoutes);return{matches:Ie,pendingActionResult:[$t.id,{type:"error",error:ke.error}]}}let Ze=Hl(ke.partialMatches).route.id;return{matches:ke.partialMatches,pendingActionResult:[Ze,{type:"error",error:ke.error}]}}else if(ke.matches)Z=ke.matches;else{let{notFoundMatches:Ze,error:Ie,route:$t}=wt(_.pathname);return{matches:Ze,pendingActionResult:[$t.id,{type:"error",error:Ie}]}}}let Ue,Xe=wu(Z,_);if(!Xe.route.action&&!Xe.route.lazy)Ue={type:"error",error:Wa(405,{method:A.method,pathname:_.pathname,routeId:Xe.route.id})};else{let ke=ui(o,f,A,_,Z,Xe,Ae?[]:s,Te),Ze=await ha(A,_,ke,Te,null);if(Ue=Ze[Xe.route.id],!Ue){for(let Ie of Z)if(Ze[Ie.route.id]){Ue=Ze[Ie.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(ms(Ue)){let ke;return Re&&Re.replace!=null?ke=Re.replace:ke=Xy(Ue.response.headers.get("Location"),new URL(A.url),p,t.history)===C.location.pathname+C.location.search,await fa(A,Ue,!0,{submission:$,replace:ke}),{shortCircuited:!0}}if(za(Ue)){let ke=Hl(Z,Xe.route.id);return(Re&&Re.replace)!==!0&&(ue="PUSH"),{matches:Z,pendingActionResult:[ke.route.id,Ue,Xe.route.id]}}return{matches:Z,pendingActionResult:[Xe.route.id,Ue]}}async function jt(A,_,$,Z,le,Te,ve,Ae,Re,_e,Ue,Xe,ke,Ze){let Ie=ve||xh(_,$,Z,Ae),$t=Ae||Re||ex(Ie),We=!U&&!Ue;if(Te){if(We){let Nt=_t(ke);ft({navigation:Ie,...Nt!==void 0?{actionData:Nt}:{}},{flushSync:Xe})}let Qe=await ht($,_.pathname,A.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){if(Qe.partialMatches.length===0){let{matches:Wt,route:ta}=iu(m.activeRoutes);return{matches:Wt,loaderData:{},errors:{[ta.id]:Qe.error}}}let Nt=Hl(Qe.partialMatches).route.id;return{matches:Qe.partialMatches,loaderData:{},errors:{[Nt]:Qe.error}}}else if(Qe.matches)$=Qe.matches;else{let{error:Nt,notFoundMatches:Wt,route:ta}=wt(_.pathname);return{matches:Wt,loaderData:{},errors:{[ta.id]:Nt}}}}let ut=m.activeRoutes,{dsMatches:it,revalidatingFetchers:dt}=Py(A,le,o,f,t.history,C,$,$t,_,Ue?[]:s,Ue===!0,B,oe,je,he,te,ut,p,t.patchRoutesOnNavigation!=null,m.branches,ke,Ze);if(D=++we,!t.dataStrategy&&!it.some(Qe=>Qe.shouldLoad)&&!it.some(Qe=>Qe.route.middleware&&Qe.route.middleware.length>0)&&dt.length===0){let Qe=new Map(C.fetchers),Nt=Vn(Qe);return ie(_,{matches:$,loaderData:{},errors:ke&&za(ke[1])?{[ke[0]]:ke[1].error}:null,...Jy(ke),...Nt?{fetchers:Qe}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(We){let Qe={};if(!Te){Qe.navigation=Ie;let Nt=_t(ke);Nt!==void 0&&(Qe.actionData=Nt)}dt.length>0&&(Qe.fetchers=Qt(dt)),ft(Qe,{flushSync:Xe})}dt.forEach(Qe=>{Tt(Qe.key),Qe.controller&&de.set(Qe.key,Qe.controller)});let Jt=()=>dt.forEach(Qe=>Tt(Qe.key));ae&&ae.signal.addEventListener("abort",Jt);let{loaderResults:Fn,fetcherResults:En}=await Wn(it,dt,A,_,le);if(A.signal.aborted)return{shortCircuited:!0};ae&&ae.signal.removeEventListener("abort",Jt),dt.forEach(Qe=>de.delete(Qe.key));let On=ou(Fn);if(On)return await fa(A,On.result,!0,{replace:_e}),{shortCircuited:!0};if(On=ou(En),On)return te.add(On.key),await fa(A,On.result,!0,{replace:_e}),{shortCircuited:!0};let Mn=new Map(C.fetchers),{loaderData:Yn,errors:ga}=Ky(C,$,Fn,ke,dt,En,Mn);Ue&&C.errors&&(ga={...C.errors,...ga});let ul=Vn(Mn),ea=vn(D,Mn),gr=ul||ea||dt.length>0;return{matches:$,loaderData:Yn,errors:ga,...gr?{workingFetchers:Mn}:{}}}function _t(A){if(A&&!za(A[1]))return{[A[0]]:A[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function Qt(A){let _=new Map(C.fetchers);return A.forEach($=>{let Z=_.get($.key),le=ho(void 0,Z?Z.data:void 0);_.set($.key,le)}),_}async function Hn(A,_,$,Z){Tt(A);let le=(Z&&Z.flushSync)===!0,Te=m.activeRoutes,ve=Ih(C.location,C.matches,p,$,_,Z==null?void 0:Z.relative),Ae=fr(Te,ve,p,!1,m.branches),Re=Ht(Ae,Te,ve);if(Re.active&&Re.matches&&(Ae=Re.matches),!Ae){Ce(A,_,Wa(404,{pathname:ve}),{flushSync:le});return}let{path:_e,submission:Ue,error:Xe}=Iy(!0,ve,Z);if(Xe){Ce(A,_,Xe,{flushSync:le});return}let ke=t.getContext?await t.getContext():new zy,Ze=(Z&&Z.preventScrollReset)===!0;if(Ue&&oa(Ue.formMethod)){await $n(A,_,_e,Ae,ke,Re.active,le,Ze,Ue,Z&&Z.defaultShouldRevalidate);return}he.set(A,{routeId:_,path:_e}),await tn(A,_,_e,Ae,ke,Re.active,le,Ze,Ue)}async function $n(A,_,$,Z,le,Te,ve,Ae,Re,_e){qn(),he.delete(A);let Ue=C.fetchers.get(A);fe(A,aE(Re,Ue),{flushSync:ve});let Xe=new AbortController,ke=ii(t.history,$,Xe.signal,Re);if(Te){let Rt=await ht(Z,new URL(ke.url).pathname,ke.signal,A);if(Rt.type==="aborted")return;if(Rt.type==="error"){Ce(A,_,Rt.error,{flushSync:ve});return}else if(Rt.matches)Z=Rt.matches;else{Ce(A,_,Wa(404,{pathname:$}),{flushSync:ve});return}}let Ze=wu(Z,$);if(!Ze.route.action&&!Ze.route.lazy){let Rt=Wa(405,{method:Re.formMethod,pathname:$,routeId:_});Ce(A,_,Rt,{flushSync:ve});return}de.set(A,Xe);let Ie=we,$t=ui(o,f,ke,$,Z,Ze,s,le),We=await ha(ke,$,$t,le,A),ut=We[Ze.route.id];if(!ut){for(let Rt of $t)if(We[Rt.route.id]){ut=We[Rt.route.id];break}}if(ke.signal.aborted){de.get(A)===Xe&&de.delete(A);return}if(je.has(A)){if(ms(ut)||za(ut)){fe(A,Tr(void 0));return}}else{if(ms(ut))if(de.delete(A),D>Ie){fe(A,Tr(void 0));return}else return te.add(A),fe(A,ho(Re)),fa(ke,ut,!1,{fetcherSubmission:Re,preventScrollReset:Ae});if(za(ut)){Ce(A,_,ut.error);return}}let it=C.navigation.location||C.location,dt=ii(t.history,it,Xe.signal),Jt=m.activeRoutes,Fn=C.navigation.state!=="idle"?fr(Jt,C.navigation.location,p,!1,m.branches):C.matches;tt(Fn,"Didn't find any matches after fetcher action");let En=++we;P.set(A,En);let{dsMatches:On,revalidatingFetchers:Mn}=Py(dt,le,o,f,t.history,C,Fn,Re,it,s,!1,B,oe,je,he,te,Jt,p,t.patchRoutesOnNavigation!=null,m.branches,[Ze.route.id,ut],_e),Yn=ho(Re,ut.data),ga=new Map(C.fetchers);ga.set(A,Yn),Mn.filter(Rt=>Rt.key!==A).forEach(Rt=>{let Ta=Rt.key,Gn=ga.get(Ta),Yl=ho(void 0,Gn?Gn.data:void 0);ga.set(Ta,Yl),Tt(Ta),Rt.controller&&de.set(Ta,Rt.controller)}),ft({fetchers:ga});let ul=()=>Mn.forEach(Rt=>Tt(Rt.key));Xe.signal.addEventListener("abort",ul);let{loaderResults:ea,fetcherResults:gr}=await Wn(On,Mn,dt,it,le);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",ul),P.delete(A),de.delete(A),Mn.forEach(Rt=>de.delete(Rt.key));let Qe=C.fetchers.has(A),Nt=Rt=>{if(!Qe)return Rt;let Ta=new Map(Rt.fetchers);return Ta.set(A,Tr(ut.data)),{...Rt,fetchers:Ta}},Wt=ou(ea);if(Wt)return C=Nt(C),fa(dt,Wt.result,!1,{preventScrollReset:Ae});if(Wt=ou(gr),Wt)return te.add(Wt.key),C=Nt(C),fa(dt,Wt.result,!1,{preventScrollReset:Ae});let ta=new Map(C.fetchers);Qe&&ta.set(A,Tr(ut.data));let{loaderData:_n,errors:Or}=Ky(C,Fn,ea,void 0,Mn,gr,ta);vn(En,ta),C.navigation.state==="loading"&&En>D?(tt(ue,"Expected pending action"),ae&&ae.abort(),ie(C.navigation.location,{matches:Fn,loaderData:_n,errors:Or,fetchers:ta})):(ft({errors:Or,loaderData:Zy(C.loaderData,_n,Fn,Or),fetchers:ta}),B=!1)}async function tn(A,_,$,Z,le,Te,ve,Ae,Re){let _e=C.fetchers.get(A);fe(A,ho(Re,_e?_e.data:void 0),{flushSync:ve});let Ue=new AbortController,Xe=ii(t.history,$,Ue.signal);if(Te){let ut=await ht(Z,new URL(Xe.url).pathname,Xe.signal,A);if(ut.type==="aborted")return;if(ut.type==="error"){Ce(A,_,ut.error,{flushSync:ve});return}else if(ut.matches)Z=ut.matches;else{Ce(A,_,Wa(404,{pathname:$}),{flushSync:ve});return}}let ke=wu(Z,$);de.set(A,Ue);let Ze=we,Ie=ui(o,f,Xe,$,Z,ke,s,le),$t=await ha(Xe,$,Ie,le,A),We=$t[ke.route.id];if(!We){for(let ut of Z)if($t[ut.route.id]){We=$t[ut.route.id];break}}if(de.get(A)===Ue&&de.delete(A),!Xe.signal.aborted){if(je.has(A)){fe(A,Tr(void 0));return}if(ms(We))if(D>Ze){fe(A,Tr(void 0));return}else{te.add(A),await fa(Xe,We,!1,{preventScrollReset:Ae});return}if(za(We)){Ce(A,_,We.error);return}fe(A,Tr(We.data))}}async function fa(A,_,$,{submission:Z,fetcherSubmission:le,preventScrollReset:Te,replace:ve}={}){$||(me==null||me.resolve(),me=null),_.response.headers.has("X-Remix-Revalidate")&&(B=!0);let Ae=_.response.headers.get("Location");tt(Ae,"Expected a Location header on the redirect Response"),Ae=Xy(Ae,new URL(A.url),p,t.history);let Re=Oo(C.location,Ae,{_isRedirect:!0});if(l){let Ie=!1;if(_.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(sm(Ae)){const $t=rb(a,Ae,!0);Ie=$t.origin!==a.location.origin||Ba($t.pathname,p)==null}if(Ie){ve?a.location.replace(Ae):a.location.assign(Ae);return}}ae=null;let _e=ve===!0||_.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Xe,formEncType:ke}=C.navigation;!Z&&!le&&Ue&&Xe&&ke&&(Z=ex(C.navigation));let Ze=Z||le;if(kw.has(_.response.status)&&Ze&&oa(Ze.formMethod))await Ut(_e,Re,{submission:{...Ze,formAction:Ae},preventScrollReset:Te||ye,enableViewTransition:$?K:void 0});else{let Ie=xh(Re,[],_e,Z);await Ut(_e,Re,{overrideNavigation:Ie,fetcherSubmission:le,preventScrollReset:Te||ye,enableViewTransition:$?K:void 0})}}async function ha(A,_,$,Z,le){var Ae;let Te,ve={};try{Te=await qw(g,A,_,$,le,Z,!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)&&!C.loaderData.hasOwnProperty(Re.route.id)&&(!C.errors||!C.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(Jw(_e)){let Ue=_e.result;ve[Re]={type:"redirect",response:Fw(Ue,A,Re,$,p)}}else ve[Re]=await Vw(_e);return ve}async function Wn(A,_,$,Z,le){let Te=ha($,Z,A,le,null),ve=Promise.all(_.map(async _e=>{if(_e.matches&&_e.match&&_e.request&&_e.controller){let Xe=(await ha(_e.request,_e.path,_e.matches,le,_e.key))[_e.match.route.id];return{[_e.key]:Xe}}else return Promise.resolve({[_e.key]:{type:"error",error:Wa(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,he.forEach((A,_)=>{de.has(_)&&oe.add(_),Tt(_)})}function fe(A,_,$={}){let Z=new Map(C.fetchers);Z.set(A,_),ft({fetchers:Z},{flushSync:($&&$.flushSync)===!0})}function Ce(A,_,$,Z={}){let le=Hl(C.matches,_),Te=new Map(C.fetchers);qe(Te,A),ft({errors:{[le.route.id]:$},fetchers:Te},{flushSync:(Z&&Z.flushSync)===!0})}function De(A){return Ne.set(A,(Ne.get(A)||0)+1),je.has(A)&&je.delete(A),C.fetchers.get(A)||vb}function Ye(A,_){Tt(A,_==null?void 0:_.reason),fe(A,Tr(null))}function qe(A,_){let $=C.fetchers.get(_);de.has(_)&&!($&&$.state==="loading"&&P.has(_))&&Tt(_),he.delete(_),P.delete(_),te.delete(_),je.delete(_),oe.delete(_),A.delete(_)}function J(A){let _=(Ne.get(A)||0)-1;_<=0?(Ne.delete(A),je.add(A)):Ne.set(A,_),ft({fetchers:new Map(C.fetchers)})}function Tt(A,_){let $=de.get(A);$&&($.abort(_),de.delete(A))}function Kt(A,_){for(let $ of A){let Z=_.get($);tt(Z,`Expected fetcher: ${$}`);let le=Tr(Z.data);_.set($,le)}}function Vn(A){let _=[],$=!1;for(let Z of te){let le=A.get(Z);tt(le,`Expected fetcher: ${Z}`),le.state==="loading"&&(te.delete(Z),_.push(Z),$=!0)}return Kt(_,A),$}function vn(A,_){let $=[];for(let[Z,le]of P)if(le<A){let Te=_.get(Z);tt(Te,`Expected fetcher: ${Z}`),Te.state==="loading"&&(Tt(Z),P.delete(Z),$.push(Z))}return Kt($,_),$.length>0}function qa(A,_){let $=C.blockers.get(A)||fo;return ze.get(A)!==_&&ze.set(A,_),$}function Me(A){C.blockers.delete(A),ze.delete(A)}function vt(A,_){let $=C.blockers.get(A)||fo;tt($.state==="unblocked"&&_.state==="blocked"||$.state==="blocked"&&_.state==="blocked"||$.state==="blocked"&&_.state==="proceeding"||$.state==="blocked"&&_.state==="unblocked"||$.state==="proceeding"&&_.state==="unblocked",`Invalid blocker state transition: ${$.state} -> ${_.state}`);let Z=new Map(C.blockers);Z.set(A,_),ft({blockers:Z})}function yt({currentLocation:A,nextLocation:_,historyAction:$}){if(ze.size===0)return;ze.size>1&&dn(!1,"A router only supports one blocker at a time");let Z=Array.from(ze.entries()),[le,Te]=Z[Z.length-1],ve=C.blockers.get(le);if(!(ve&&ve.state==="proceeding")&&Te({currentLocation:A,nextLocation:_,historyAction:$}))return le}function wt(A){let _=Wa(404,{pathname:A}),$=m.activeRoutes,{matches:Z,route:le}=iu($);return{notFoundMatches:Z,route:le,error:_}}function Bt(A,_,$){if(S=A,R=_,j=$||null,!z&&C.navigation===yh){z=!0;let Z=Zt(C.location,C.matches);Z!=null&&ft({restoreScrollPosition:Z})}return()=>{S=null,R=null,j=null}}function Ct(A,_){return j&&j(A,_.map(Z=>sb(Z,C.loaderData)))||A.key}function nn(A,_){if(S&&R){let $=Ct(A,_);S[$]=R()}}function Zt(A,_){if(S){let $=Ct(A,_),Z=S[$];if(typeof Z=="number")return Z}return null}function Ht(A,_,$){if(t.patchRoutesOnNavigation){let Z=m.branches;if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:fr(_,$,p,!0,Z)}}else return{active:!0,matches:fr(_,$,p,!0,Z)||[]}}return{active:!1,matches:null}}async function ht(A,_,$,Z){if(!t.patchRoutesOnNavigation)return{type:"success",matches:A};let le=A;for(;;){let Te=f;try{await t.patchRoutesOnNavigation({signal:$,path:_,matches:le,fetcherKey:Z,patch:(_e,Ue)=>{$.aborted||Vy(_e,Ue,m,Te,o,!1)}})}catch(_e){return{type:"error",error:_e,partialMatches:le}}if($.aborted)return{type:"aborted"};let ve=m.branches,Ae=fr(m.activeRoutes,_,p,!1,ve),Re=null;if(Ae){if(Object.keys(Ae[0].params).length===0)return{type:"success",matches:Ae};if(Re=fr(m.activeRoutes,_,p,!0,ve),!(Re&&le.length<Re.length&&Je(le,Re.slice(0,le.length))))return{type:"success",matches:Ae}}if(Re||(Re=fr(m.activeRoutes,_,p,!0,ve)),!Re||Je(le,Re))return{type:"success",matches:null};le=Re}}function Je(A,_){return A.length===_.length&&A.every(($,Z)=>$.route.id===_[Z].route.id)}function wn(A){f={},m.setHmrRoutes(Mo(A,o,void 0,f))}function kn(A,_,$=!1){Vy(A,_,m,f,o,$),m.hasHMRRoutes||ft({})}return M={get basename(){return p},get future(){return x},get state(){return C},get routes(){return m.stableRoutes},get branches(){return m.branches},get manifest(){return f},get window(){return a},initialize:nt,subscribe:Xt,enableScrollRestoration:Bt,navigate:$e,fetch:Hn,revalidate:at,createHref:A=>t.history.createHref(A),encodeLocation:A=>t.history.encodeLocation(A),getFetcher:De,resetFetcher:Ye,deleteFetcher:J,dispose:Sn,getBlocker:qa,deleteBlocker:Me,patchRoutes:kn,_internalFetchControllers:de,_internalSetRoutes:wn,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){ft(A)}},t.instrumentations&&(M=Ew(M,t.instrumentations.map(A=>A.router).filter(Boolean))),M}function Lw(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Ih(t,a,l,s,c,o){let f,m;if(c){f=[];for(let g of a)if(f.push(g),g.route.id===c){m=g;break}}else f=a,m=a[a.length-1];let p=Iu(s||".",im(f),Ba(t.pathname,l)||t.pathname,o==="path");if(s==null&&(p.search=t.search,p.hash=t.hash),(s==null||s===""||s===".")&&m){let g=dm(p.search);if(m.route.index&&!g)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!m.route.index&&g){let x=new URLSearchParams(p.search),y=x.getAll("index");x.delete("index"),y.filter(w=>w).forEach(w=>x.append("index",w));let N=x.toString();p.search=N?`?${N}`:""}}return l!=="/"&&(p.pathname=gw({basename:l,pathname:p.pathname})),Dr(p)}function Iy(t,a,l){if(!l||!Lw(l))return{path:a};if(l.formMethod&&!tE(l.formMethod))return{path:a,error:Wa(405,{method:l.formMethod})};let s=()=>({path:a,error:Wa(400,{type:"invalid-body"})}),o=(l.formMethod||"get").toUpperCase(),f=Tb(a);if(l.body!==void 0){if(l.formEncType==="text/plain"){if(!oa(o))return s();let y=typeof l.body=="string"?l.body:l.body instanceof FormData||l.body instanceof URLSearchParams?Array.from(l.body.entries()).reduce((N,[w,S])=>`${N}${w}=${S}
|
|
59
|
+
`,""):String(l.body);return{path:a,submission:{formMethod:o,formAction:f,formEncType:l.formEncType,formData:void 0,json:void 0,text:y}}}else if(l.formEncType==="application/json"){if(!oa(o))return s();try{let y=typeof l.body=="string"?JSON.parse(l.body):l.body;return{path:a,submission:{formMethod:o,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=Fh(l.formData),p=l.formData;else if(l.body instanceof FormData)m=Fh(l.body),p=l.body;else if(l.body instanceof URLSearchParams)m=l.body,p=Qy(m);else if(l.body==null)m=new URLSearchParams,p=new FormData;else try{m=new URLSearchParams(l.body),p=Qy(m)}catch{return s()}let g={formMethod:o,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=Ar(a);return t&&x.search&&dm(x.search)&&m.append("index",""),x.search=`?${m}`,{path:Dr(x),submission:g}}function Py(t,a,l,s,c,o,f,m,p,g,x,y,N,w,S,j,R,z,I,q,X,ee){var U;let ne=X?za(X[1])?X[1].error:X[1].data:void 0,M=c.createURL(o.location),C=c.createURL(p),ue;if(x&&o.errors){let B=Object.keys(o.errors)[0];ue=f.findIndex(oe=>oe.route.id===B)}else if(X&&za(X[1])){let B=X[0];ue=f.findIndex(oe=>oe.route.id===B)-1}let me=X?X[1].statusCode:void 0,ye=me&&me>=400,ae={currentUrl:M,currentParams:((U=o.matches[0])==null?void 0:U.params)||{},nextUrl:C,nextParams:f[0].params,...m,actionResult:ne,actionStatus:me},K=Ho(f),ge=f.map((B,oe)=>{let{route:de}=B,we=null;if(ue!=null&&oe>ue)we=!1;else if(de.lazy)we=!0;else if(!cm(de))we=!1;else if(x){let{shouldLoad:he}=bb(de,o.loaderData,o.errors);we=he}else zw(o.loaderData,o.matches[oe],B)&&(we=!0);if(we!==null)return Ph(l,s,t,p,K,B,g,a,we);let D=!1;typeof ee=="boolean"?D=ee:ye?D=!1:(y||M.pathname+M.search===C.pathname+C.search||M.search!==C.search||Uw(o.matches[oe],B))&&(D=!0);let P={...ae,defaultShouldRevalidate:D},te=Ro(B,P);return Ph(l,s,t,p,K,B,g,a,te,P,ee)}),be=[];return S.forEach((B,oe)=>{if(x||!f.some(je=>je.route.id===B.routeId)||w.has(oe))return;let de=o.fetchers.get(oe),we=de&&de.state!=="idle"&&de.data===void 0,D=fr(R,B.path,z??"/",!1,q);if(!D){if(I&&we)return;be.push({key:oe,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(j.has(oe))return;let P=wu(D,B.path),te=new AbortController,he=ii(c,B.path,te.signal),Ne=null;if(N.has(oe))N.delete(oe),Ne=ui(l,s,he,B.path,D,P,g,a);else if(we)y&&(Ne=ui(l,s,he,B.path,D,P,g,a));else{let je;typeof ee=="boolean"?je=ee:ye?je=!1:je=y;let ze={...ae,defaultShouldRevalidate:je};Ro(P,ze)&&(Ne=ui(l,s,he,B.path,D,P,g,a,ze))}Ne&&be.push({key:oe,routeId:B.routeId,path:B.path,matches:Ne,match:P,request:he,controller:te})}),{dsMatches:ge,revalidatingFetchers:be}}function cm(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function bb(t,a,l){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!cm(t))return{shouldLoad:!1,renderFallback:!1};let s=a!=null&&t.id in a,c=l!=null&&l[t.id]!==void 0;if(!s&&c)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let o=!s&&!c;return{shouldLoad:o,renderFallback:o}}function zw(t,a,l){let s=!a||l.route.id!==a.route.id,c=!t.hasOwnProperty(l.route.id);return s||c}function Uw(t,a){let l=t.route.path;return t.pathname!==a.pathname||l!=null&&l.endsWith("*")&&t.params["*"]!==a.params["*"]}function Ro(t,a){if(t.route.shouldRevalidate){let l=t.route.shouldRevalidate(a);if(typeof l=="boolean")return l}return a.defaultShouldRevalidate}function Vy(t,a,l,s,c,o){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=>Sb(g,y));x?p.push({existingRoute:x,newRoute:g}):m.push(g)}),m.length>0){let g=Mo(m,c,[t||"_","patch",String((f==null?void 0:f.length)||"0")],s);f.push(...g)}if(o&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:x,newRoute:y}=p[g],N=x,[w]=Mo([y],c,[],{},!0);Object.assign(N,{element:w.element?w.element:N.element,errorElement:w.errorElement?w.errorElement:N.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:N.hydrateFallbackElement})}l.hasHMRRoutes||l.setRoutes([...l.activeRoutes])}function Sb(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,c)=>{var o;return(o=a.children)==null?void 0:o.some(f=>Sb(s,f))}))??!1:!1}var Fy=new WeakMap,wb=({key:t,route:a,manifest:l,mapRouteProperties:s})=>{let c=l[a.id];if(tt(c,"No route found in manifest"),!c.lazy||typeof c.lazy!="object")return;let o=c.lazy[t];if(!o)return;let f=Fy.get(c);f||(f={},Fy.set(c,f));let m=f[t];if(m)return m;let p=(async()=>{let g=tw(t),y=c[t]!==void 0&&t!=="hasErrorBoundary";if(g)dn(!g,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),f[t]=Promise.resolve();else if(y)dn(!1,`Route "${c.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let N=await o();N!=null&&(Object.assign(c,{[t]:N}),Object.assign(c,s(c)))}typeof c.lazy=="object"&&(c.lazy[t]=void 0,Object.values(c.lazy).every(N=>N===void 0)&&(c.lazy=void 0))})();return f[t]=p,p},Yy=new WeakMap;function Bw(t,a,l,s,c){let o=l[t.id];if(tt(o,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let x=Yy.get(o);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let y=(async()=>{tt(typeof t.lazy=="function","No lazy route function found");let N=await t.lazy(),w={};for(let S in N){let j=N[S];if(j===void 0)continue;let R=aw(S),I=o[S]!==void 0&&S!=="hasErrorBoundary";R?dn(!R,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):I?dn(!I,`Route "${o.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]=j}Object.assign(o,w),Object.assign(o,{...s(o),lazy:void 0})})();return Yy.set(o,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let f=Object.keys(t.lazy),m=[],p;for(let x of f){if(c&&c.includes(x))continue;let y=wb({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 Gy(t){let a=t.matches.filter(c=>c.shouldLoad),l={};return(await Promise.all(a.map(c=>c.resolve()))).forEach((c,o)=>{l[a[o].route.id]=c}),l}async function Hw(t){return t.matches.some(a=>a.route.middleware)?Eb(t,()=>Gy(t)):Gy(t)}function Eb(t,a){return $w(t,a,s=>{if(eE(s))throw s;return s},Kw,l);function l(s,c,o){if(o)return Promise.resolve(Object.assign(o.value,{[c]:{type:"error",result:s}}));{let{matches:f}=t,m=Math.min(Math.max(f.findIndex(g=>g.route.id===c),0),Math.max(f.findIndex(g=>g.shouldCallHandler()),0)),p=Hl(f,f[m].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:s}})}}}async function $w(t,a,l,s,c){let{matches:o,...f}=t,m=o.flatMap(g=>g.route.middleware?g.route.middleware.map(x=>[g.route.id,x]):[]);return await Nb(f,m,a,l,s,c)}async function Nb(t,a,l,s,c,o,f=0){let{request:m}=t;if(m.signal.aborted)throw m.signal.reason??new Error(`Request aborted: ${m.method} ${m.url}`);let p=a[f];if(!p)return await l();let[g,x]=p,y,N=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await Nb(t,a,l,s,c,o,f+1)},y.value}catch(w){return y={value:await o(w,g,y)},y.value}};try{let w=await x(t,N),S=w!=null?s(w):void 0;return c(S)?S:y?S??y.value:(y={value:await N()},y.value)}catch(w){return await o(w,g,y)}}function Rb(t,a,l,s,c){let o=wb({key:"middleware",route:s.route,manifest:a,mapRouteProperties:t}),f=Bw(s.route,oa(l.method)?"action":"loader",a,t,c);return{middleware:o,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Ph(t,a,l,s,c,o,f,m,p,g=null,x){let y=!1,N=Rb(t,a,l,o,f);return{...o,_lazyPromises:N,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(w){return y=!0,g?typeof x=="boolean"?Ro(o,{...g,defaultShouldRevalidate:x}):typeof w=="boolean"?Ro(o,{...g,defaultShouldRevalidate:w}):Ro(o,g):p},resolve(w){let{lazy:S,loader:j,middleware:R}=o.route,z=y||p||w&&!oa(l.method)&&(S||j),I=R&&R.length>0&&!j&&!S;return z&&(oa(l.method)||!I)?Iw({request:l,path:s,pattern:c,match:o,lazyHandlerPromise:N==null?void 0:N.handler,lazyRoutePromise:N==null?void 0:N.route,handlerOverride:w,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function ui(t,a,l,s,c,o,f,m,p=null){return c.map(g=>g.route.id!==o.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Rb(t,a,l,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ph(t,a,l,s,Ho(c),g,f,m,!0,p))}async function qw(t,a,l,s,c,o,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:jb(a,l),pattern:Ho(s),params:s[0].params,context:o,matches:s},g=await t({...m,fetcherKey:c,runClientMiddleware:x=>{let y=m;return Eb(y,()=>x({...y,fetcherKey:c,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(x=>{var y,N;return[(y=x._lazyPromises)==null?void 0:y.handler,(N=x._lazyPromises)==null?void 0:N.route]}))}catch{}return g}async function Iw({request:t,path:a,pattern:l,match:s,lazyHandlerPromise:c,lazyRoutePromise:o,handlerOverride:f,scopedContext:m}){let p,g,x=oa(t.method),y=x?"action":"loader",N=w=>{let S,j=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:jb(t,a),pattern:l,params:s.params,context:m},...I!==void 0?[I]:[]),z=(async()=>{try{return{type:"data",result:await(f?f(q=>R(q)):R())}}catch(I){return{type:"error",result:I}}})();return Promise.race([z,j])};try{let w=x?s.route.action:s.route.loader;if(c||o)if(w){let S,[j]=await Promise.all([N(w).catch(R=>{S=R}),c,o]);if(S!==void 0)throw S;p=j}else{await c;let S=x?s.route.action:s.route.loader;if(S)[p]=await Promise.all([N(S),o]);else if(y==="action"){let j=new URL(t.url),R=j.pathname+j.search;throw Wa(405,{method:t.method,pathname:R,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(w)p=await N(w);else{let S=new URL(t.url),j=S.pathname+S.search;throw Wa(404,{pathname:j})}}catch(w){return{type:"error",result:w}}finally{g&&t.signal.removeEventListener("abort",g)}return p}async function Pw(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 Vw(t){var s,c,o,f,m;let{result:a,type:l}=t;if(um(a)){let p;try{p=await Pw(a)}catch(g){return{type:"error",error:g}}return l==="error"?{type:"error",error:new Bo(a.status,a.statusText,p),statusCode:a.status,headers:a.headers}:{type:"data",data:p,statusCode:a.status,headers:a.headers}}return l==="error"?Wy(a)?a.data instanceof Error?{type:"error",error:a.data,statusCode:(s=a.init)==null?void 0:s.status,headers:(c=a.init)!=null&&c.headers?new Headers(a.init.headers):void 0}:{type:"error",error:Qw(a),statusCode:fi(a)?a.status:void 0,headers:(o=a.init)!=null&&o.headers?new Headers(a.init.headers):void 0}:{type:"error",error:a,statusCode:fi(a)?a.status:void 0}:Wy(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 Fw(t,a,l,s,c){let o=t.headers.get("Location");if(tt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!sm(o)){let f=s.slice(0,s.findIndex(m=>m.route.id===l)+1);o=Ih(new URL(a.url),f,c,o),t.headers.set("Location",o)}return t}var Yw=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Vh(t){try{return Yw.includes(new URL(t).protocol)}catch{return!1}}function Xy(t,a,l,s){if(sm(t)){let c=t,o=lm.test(c)?new URL(ab(c,a.protocol)):new URL(c);if(Vh(o.toString()))throw new Error("Invalid redirect location");let f=Ba(o.pathname,l)!=null;if(o.origin===a.origin&&f)return om(o.pathname)+o.search+o.hash}try{let c=s.createURL(t);if(Vh(c.toString()))throw new Error("Invalid redirect location")}catch{}return t}function ii(t,a,l,s){let c=t.createURL(Tb(a)).toString(),o={signal:l};if(s&&oa(s.formMethod)){let{formMethod:f,formEncType:m}=s;o.method=f.toUpperCase(),m==="application/json"?(o.headers=new Headers({"Content-Type":m}),o.body=JSON.stringify(s.json)):m==="text/plain"?o.body=s.text:m==="application/x-www-form-urlencoded"&&s.formData?o.body=Fh(s.formData):o.body=s.formData}return new Request(c,o)}function jb(t,a){let l=new URL(t.url),s=typeof a=="string"?Ar(a):a;if(l.pathname=s.pathname||"/",s.search){let c=new URLSearchParams(s.search),o=c.getAll("index");c.delete("index");for(let f of o.filter(Boolean))c.append("index",f);l.search=c.size?`?${c.toString()}`:""}else l.search="";return l.hash=s.hash||"",l}function Fh(t){let a=new URLSearchParams;for(let[l,s]of t.entries())a.append(l,typeof s=="string"?s:s.name);return a}function Qy(t){let a=new FormData;for(let[l,s]of t.entries())a.append(l,s);return a}function Gw(t,a,l,s=!1,c=!1){let o={},f=null,m,p=!1,g={},x=l&&za(l[1])?l[1].error:void 0;return t.forEach(y=>{if(!(y.route.id in a))return;let N=y.route.id,w=a[N];if(tt(!ms(w),"Cannot handle redirect results in processLoaderData"),za(w)){let S=w.error;if(x!==void 0&&(S=x,x=void 0),f=f||{},c)f[N]=S;else{let j=Hl(t,N);f[j.route.id]==null&&(f[j.route.id]=S)}s||(o[N]=xb),p||(p=!0,m=fi(w.error)?w.error.status:500),w.headers&&(g[N]=w.headers)}else o[N]=w.data,w.statusCode&&w.statusCode!==200&&!p&&(m=w.statusCode),w.headers&&(g[N]=w.headers)}),x!==void 0&&l&&(f={[l[0]]:x},l[2]&&(o[l[2]]=void 0)),{loaderData:o,errors:f,statusCode:m||200,loaderHeaders:g}}function Ky(t,a,l,s,c,o,f){let{loaderData:m,errors:p}=Gw(a,l,s);return c.filter(g=>!g.matches||g.matches.some(x=>x.shouldLoad)).forEach(g=>{let{key:x,match:y,controller:N}=g;if(N&&N.signal.aborted)return;let w=o[x];if(tt(w,"Did not find corresponding fetcher result"),za(w)){let S=Hl(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(ms(w))tt(!1,"Unhandled fetcher revalidation redirect");else{let S=Tr(w.data);f.set(x,S)}}),{loaderData:m,errors:p}}function Zy(t,a,l,s){let c=Object.entries(a).filter(([,o])=>o!==xb).reduce((o,[f,m])=>(o[f]=m,o),{});for(let o of l){let f=o.route.id;if(!a.hasOwnProperty(f)&&t.hasOwnProperty(f)&&o.route.loader&&(c[f]=t[f]),s&&s.hasOwnProperty(f))break}return c}function Jy(t){return t?za(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Hl(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 iu(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 Wa(t,{pathname:a,routeId:l,method:s,type:c,message:o}={}){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.`:c==="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 Bo(t||500,f,new Error(m),!0)}function ou(t){let a=Object.entries(t);for(let l=a.length-1;l>=0;l--){let[s,c]=a[l];if(ms(c))return{key:s,result:c}}}function Tb(t){let a=typeof t=="string"?Ar(t):t;return Dr({...a,hash:""})}function Xw(t,a){return t.pathname!==a.pathname||t.search!==a.search?!1:t.hash===""?a.hash!=="":t.hash===a.hash?!0:a.hash!==""}function Qw(t){var a,l;return new Bo(((a=t.init)==null?void 0:a.status)??500,((l=t.init)==null?void 0:l.statusText)??"Internal Server Error",t.data)}function Kw(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([a,l])=>typeof a=="string"&&Zw(l))}function Zw(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function Jw(t){return um(t.result)&&gb.has(t.result.status)}function za(t){return t.type==="error"}function ms(t){return(t&&t.type)==="redirect"}function Wy(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function um(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function Ww(t){return gb.has(t)}function eE(t){return um(t)&&Ww(t.status)&&t.headers.has("Location")}function tE(t){return Aw.has(t.toUpperCase())}function oa(t){return Cw.has(t.toUpperCase())}function dm(t){return new URLSearchParams(t).getAll("index").some(a=>a==="")}function wu(t,a){let l=typeof a=="string"?Ar(a).search:a.search;if(t[t.length-1].route.index&&dm(l||""))return t[t.length-1];let s=db(t);return s[s.length-1]}function ex(t){let{formMethod:a,formAction:l,formEncType:s,text:c,formData:o,json:f}=t;if(!(!a||!l||!s)){if(c!=null)return{formMethod:a,formAction:l,formEncType:s,formData:void 0,json:void 0,text:c};if(o!=null)return{formMethod:a,formAction:l,formEncType:s,formData:o,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 xh(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 nE(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 ho(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 aE(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 Tr(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 rE(t,a){try{let l=t.sessionStorage.getItem(yb);if(l){let s=JSON.parse(l);for(let[c,o]of Object.entries(s||{}))o&&Array.isArray(o)&&a.set(c,new Set(o||[]))}}catch{}}function lE(t,a){if(a.size>0){let l={};for(let[s,c]of a)l[s]=[...c];try{t.sessionStorage.setItem(yb,JSON.stringify(l))}catch(s){dn(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function tx(){let t,a,l=new Promise((s,c)=>{t=async o=>{s(o);try{await l}catch{}},a=async o=>{c(o);try{await l}catch{}}});return{promise:l,resolve:t,reject:a}}var ys=v.createContext(null);ys.displayName="DataRouter";var mi=v.createContext(null);mi.displayName="DataRouterState";var Cb=v.createContext(!1);function Db(){return v.useContext(Cb)}var fm=v.createContext({isTransitioning:!1});fm.displayName="ViewTransition";var hm=v.createContext(new Map);hm.displayName="Fetchers";var sE=v.createContext(null);sE.displayName="Await";var ja=v.createContext(null);ja.displayName="Navigation";var Pu=v.createContext(null);Pu.displayName="Location";var rr=v.createContext({outlet:null,matches:[],isDataRoute:!1});rr.displayName="Route";var mm=v.createContext(null);mm.displayName="RouteError";var Ab="REACT_ROUTER_ERROR",iE="REDIRECT",oE="ROUTE_ERROR_RESPONSE";function cE(t){if(t.startsWith(`${Ab}:${iE}:{`))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 uE(t){if(t.startsWith(`${Ab}:${oE}:{`))try{let a=JSON.parse(t.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Bo(a.status,a.statusText,a.data)}catch{}}function dE(t,{relative:a}={}){tt($o(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:s}=v.useContext(ja),{hash:c,pathname:o,search:f}=qo(t,{relative:a}),m=o;return l!=="/"&&(m=o==="/"?l:nr([l,o])),s.createHref({pathname:m,search:f,hash:c})}function $o(){return v.useContext(Pu)!=null}function $a(){return tt($o(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Pu).location}var kb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ob(t){v.useContext(ja).static||v.useLayoutEffect(t)}function kr(){let{isDataRoute:t}=v.useContext(rr);return t?RE():fE()}function fE(){tt($o(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(ys),{basename:a,navigator:l}=v.useContext(ja),{matches:s}=v.useContext(rr),{pathname:c}=$a(),o=JSON.stringify(im(s)),f=v.useRef(!1);return Ob(()=>{f.current=!0}),v.useCallback((p,g={})=>{if(dn(f.current,kb),!f.current)return;if(typeof p=="number"){l.go(p);return}let x=Iu(p,JSON.parse(o),c,g.relative==="path");t==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:nr([a,x.pathname])),(g.replace?l.replace:l.push)(x,g.state,g)},[a,l,o,c,t])}var hE=v.createContext(null);function mE(t){let a=v.useContext(rr).outlet;return v.useMemo(()=>a&&v.createElement(hE.Provider,{value:t},a),[a,t])}function pE(){let{matches:t}=v.useContext(rr),a=t[t.length-1];return(a==null?void 0:a.params)??{}}function qo(t,{relative:a}={}){let{matches:l}=v.useContext(rr),{pathname:s}=$a(),c=JSON.stringify(im(l));return v.useMemo(()=>Iu(t,JSON.parse(c),s,a==="path"),[t,c,s,a])}function gE(t,a,l){tt($o(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(ja),{matches:c}=v.useContext(rr),o=c[c.length-1],f=o?o.params:{},m=o?o.pathname:"/",p=o?o.pathnameBase:"/",g=o&&o.route;{let R=g&&g.path||"";Ub(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=$a(),y;y=x;let N=y.pathname||"/",w=N;if(p!=="/"){let R=p.replace(/^\//,"").split("/");w="/"+N.replace(/^\//,"").split("/").slice(R.length).join("/")}let S=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):lb(t,{pathname:w});return dn(g||S!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),dn(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.`),SE(S&&S.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:nr([p,s.encodeLocation?s.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:nr([p,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,l)}function vE(){let t=zb(),a=fi(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),l=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:s},o={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:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"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:c},l):null,f)}var yE=v.createElement(vE,null),Mb=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=uE(t.digest);l&&(t=l)}let a=t!==void 0?v.createElement(rr.Provider,{value:this.props.routeContext},v.createElement(mm.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(xE,{error:t},a):a}};Mb.contextType=Cb;var bh=new WeakMap;function xE({children:t,error:a}){let{basename:l}=v.useContext(ja);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let s=cE(a.digest);if(s){let c=bh.get(a);if(c)throw c;let o=hb(s.location,l),f=o.absoluteURL||o.to;if(Vh(f))throw new Error("Invalid redirect location");if(fb&&!bh.get(a))if(o.isExternal||s.reloadDocument)window.location.href=f;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:s.replace}));throw bh.set(a,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return t}function bE({routeContext:t,match:a,children:l}){let s=v.useContext(ys);return s&&s.static&&s.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=a.route.id),v.createElement(rr.Provider,{value:t},l)}function SE(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 c=t,o=s==null?void 0:s.errors;if(o!=null){let x=c.findIndex(y=>y.route.id&&(o==null?void 0:o[y.route.id])!==void 0);tt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let f=!1,m=-1;if(l&&s){f=s.renderFallback;for(let x=0;x<c.length;x++){let y=c[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(m=x),y.route.id){let{loaderData:N,errors:w}=s,S=y.route.loader&&!N.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||S){l.isStatic&&(f=!0),m>=0?c=c.slice(0,m+1):c=[c[0]];break}}}}let p=l==null?void 0:l.onError,g=s&&p?(x,y)=>{var N,w;p(x,{location:s.location,params:((w=(N=s.matches)==null?void 0:N[0])==null?void 0:w.params)??{},pattern:Ho(s.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,N)=>{let w,S=!1,j=null,R=null;s&&(w=o&&y.route.id?o[y.route.id]:void 0,j=y.route.errorElement||yE,f&&(m<0&&N===0?(Ub("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,R=null):m===N&&(S=!0,R=y.route.hydrateFallbackElement||null)));let z=a.concat(c.slice(0,N+1)),I=()=>{let q;return w?q=j:S?q=R:y.route.Component?q=v.createElement(y.route.Component,null):y.route.element?q=y.route.element:q=x,v.createElement(bE,{match:y,routeContext:{outlet:x,matches:z,isDataRoute:s!=null},children:q})};return s&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?v.createElement(Mb,{location:s.location,revalidation:s.revalidation,component:j,error:w,children:I(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:g}):I()},null)}function pm(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _b(t){let a=v.useContext(ys);return tt(a,pm(t)),a}function pi(t){let a=v.useContext(mi);return tt(a,pm(t)),a}function wE(t){let a=v.useContext(rr);return tt(a,pm(t)),a}function Vu(t){let a=wE(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 EE(){return Vu("useRouteId")}function pr(){let t=pi("useNavigation");return v.useMemo(()=>{let{matches:a,historyAction:l,...s}=t.navigation;return s},[t.navigation])}function NE(){let t=_b("useRevalidator"),a=pi("useRevalidator"),l=v.useCallback(async()=>{await t.router.revalidate()},[t.router]);return v.useMemo(()=>({revalidate:l,state:a.revalidation}),[l,a.revalidation])}function Lb(){let{matches:t,loaderData:a}=pi("useMatches");return v.useMemo(()=>t.map(l=>sb(l,a)),[t,a])}function sl(){let t=pi("useLoaderData"),a=Vu("useLoaderData");return t.loaderData[a]}function xs(t){return pi("useRouteLoaderData").loaderData[t]}function zb(){var s;let t=v.useContext(mm),a=pi("useRouteError"),l=Vu("useRouteError");return t!==void 0?t:(s=a.errors)==null?void 0:s[l]}function RE(){let{router:t}=_b("useNavigate"),a=Vu("useNavigate"),l=v.useRef(!1);return Ob(()=>{l.current=!0}),v.useCallback(async(c,o={})=>{dn(l.current,kb),l.current&&(typeof c=="number"?await t.navigate(c):await t.navigate(c,{fromRouteId:a,...o}))},[t,a])}var nx={};function Ub(t,a,l){!a&&!nx[t]&&(nx[t]=!0,dn(!1,l))}var ax={};function rx(t,a){!t&&!ax[a]&&(ax[a]=!0,console.warn(a))}var jE="useOptimistic",lx=VS[jE],TE=()=>{};function CE(t){return lx?lx(t):[t,TE]}function DE(t){let a={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&dn(!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&&dn(!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&&dn(!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 AE=["HydrateFallback","hydrateFallbackElement"],kE=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 OE({router:t,flushSync:a,onError:l,useTransitions:s}){s=Db()||s;let[o,f]=v.useState(t.state),[m,p]=CE(o),[g,x]=v.useState(),[y,N]=v.useState({isTransitioning:!1}),[w,S]=v.useState(),[j,R]=v.useState(),[z,I]=v.useState(),q=v.useRef(new Map),X=v.useCallback((C,{deletedFetchers:ue,newErrors:me,flushSync:ye,viewTransitionOpts:ae})=>{me&&l&&Object.values(me).forEach(ge=>{var be;return l(ge,{location:C.location,params:((be=C.matches[0])==null?void 0:be.params)??{},pattern:Ho(C.matches)})}),C.fetchers.forEach((ge,be)=>{ge.data!==void 0&&q.current.set(be,ge.data)}),ue.forEach(ge=>q.current.delete(ge)),rx(ye===!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 K=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(rx(ae==null||K,"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."),!ae||!K){a&&ye?a(()=>f(C)):s===!1?f(C):v.startTransition(()=>{s===!0&&p(ge=>sx(ge,C)),f(C)});return}if(a&&ye){a(()=>{j&&(w==null||w.resolve(),j.skipTransition()),N({isTransitioning:!0,flushSync:!0,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})});let ge=t.window.document.startViewTransition(()=>{a(()=>f(C))});ge.finished.finally(()=>{a(()=>{S(void 0),R(void 0),x(void 0),N({isTransitioning:!1})})}),a(()=>R(ge));return}j?(w==null||w.resolve(),j.skipTransition(),I({state:C,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation})):(x(C),N({isTransitioning:!0,flushSync:!1,currentLocation:ae.currentLocation,nextLocation:ae.nextLocation}))},[t.window,a,j,w,s,p,l]);v.useLayoutEffect(()=>t.subscribe(X),[t,X]),v.useEffect(()=>{y.isTransitioning&&!y.flushSync&&S(new kE)},[y]),v.useEffect(()=>{if(w&&g&&t.window){let C=g,ue=w.promise,me=t.window.document.startViewTransition(async()=>{s===!1?f(C):v.startTransition(()=>{s===!0&&p(ye=>sx(ye,C)),f(C)}),await ue});me.finished.finally(()=>{S(void 0),R(void 0),x(void 0),N({isTransitioning:!1})}),R(me)}},[g,w,t.window,s,p]),v.useEffect(()=>{w&&g&&m.location.key===g.location.key&&w.resolve()},[w,j,m.location,g]),v.useEffect(()=>{!y.isTransitioning&&z&&(x(z.state),N({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}),I(void 0))},[y.isTransitioning,z]);let ee=v.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:C=>t.navigate(C),push:(C,ue,me)=>t.navigate(C,{state:ue,preventScrollReset:me==null?void 0:me.preventScrollReset}),replace:(C,ue,me)=>t.navigate(C,{replace:!0,state:ue,preventScrollReset:me==null?void 0:me.preventScrollReset})}),[t]),ne=t.basename||"/",M=v.useMemo(()=>({router:t,navigator:ee,static:!1,basename:ne,onError:l}),[t,ee,ne,l]);return v.createElement(v.Fragment,null,v.createElement(ys.Provider,{value:M},v.createElement(mi.Provider,{value:m},v.createElement(hm.Provider,{value:q.current},v.createElement(fm.Provider,{value:y},v.createElement(LE,{basename:ne,location:m.location,navigationType:m.historyAction,navigator:ee,useTransitions:s},v.createElement(ME,{routes:t.routes,manifest:t.manifest,future:t.future,state:m,isStatic:!1,onError:l})))))),null)}function sx(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 ME=v.memo(_E);function _E({routes:t,manifest:a,future:l,state:s,isStatic:c,onError:o}){return gE(t,void 0,{manifest:a,state:s,isStatic:c,onError:o})}function gi(t){return mE(t.context)}function LE({basename:t="/",children:a=null,location:l,navigationType:s="POP",navigator:c,static:o=!1,useTransitions:f}){tt(!$o(),"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:c,static:o,useTransitions:f,future:{}}),[m,c,o,f]);typeof l=="string"&&(l=Ar(l));let{pathname:g="/",search:x="",hash:y="",state:N=null,key:w="default",mask:S}=l,j=v.useMemo(()=>{let R=Ba(g,m);return R==null?null:{location:{pathname:R,search:x,hash:y,state:N,key:w,mask:S},navigationType:s}},[m,g,x,y,N,w,s,S]);return dn(j!=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.`),j==null?null:v.createElement(ja.Provider,{value:p},v.createElement(Pu.Provider,{children:a,value:j}))}var Eu="get",Nu="application/x-www-form-urlencoded";function Fu(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function zE(t){return Fu(t)&&t.tagName.toLowerCase()==="button"}function UE(t){return Fu(t)&&t.tagName.toLowerCase()==="form"}function BE(t){return Fu(t)&&t.tagName.toLowerCase()==="input"}function HE(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function $E(t,a){return t.button===0&&(!a||a==="_self")&&!HE(t)}function Yh(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(c=>[l,c]):[[l,s]])},[]))}function qE(t,a){let l=Yh(t);return a&&a.forEach((s,c)=>{l.has(c)||a.getAll(c).forEach(o=>{l.append(c,o)})}),l}var cu=null;function IE(){if(cu===null)try{new FormData(document.createElement("form"),0),cu=!1}catch{cu=!0}return cu}var PE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sh(t){return t!=null&&!PE.has(t)?(dn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nu}"`),null):t}function VE(t,a){let l,s,c,o,f;if(UE(t)){let m=t.getAttribute("action");s=m?Ba(m,a):null,l=t.getAttribute("method")||Eu,c=Sh(t.getAttribute("enctype"))||Nu,o=new FormData(t)}else if(zE(t)||BE(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?Ba(p,a):null,l=t.getAttribute("formmethod")||m.getAttribute("method")||Eu,c=Sh(t.getAttribute("formenctype"))||Sh(m.getAttribute("enctype"))||Nu,o=new FormData(m,t),!IE()){let{name:g,type:x,value:y}=t;if(x==="image"){let N=g?`${g}.`:"";o.append(`${N}x`,"0"),o.append(`${N}y`,"0")}else g&&o.append(g,y)}}else{if(Fu(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Eu,s=null,c=Nu,f=t}return o&&c==="text/plain"&&(f=o,o=void 0),{action:s,method:l.toLowerCase(),encType:c,formData:o,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var FE={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},YE=/[&><\u2028\u2029]/g;function ix(t){return t.replace(YE,a=>FE[a])}function gm(t,a){if(t===!1||t===null||typeof t>"u")throw new Error(a)}function Bb(t,a,l,s){let c=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return l?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${s}`:c.pathname=`${c.pathname}.${s}`:c.pathname==="/"?c.pathname=`_root.${s}`:a&&Ba(c.pathname,a)==="/"?c.pathname=`${Au(a)}/_root.${s}`:c.pathname=`${Au(c.pathname)}.${s}`,c}async function GE(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 XE(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 QE(t,a,l){let s=await Promise.all(t.map(async c=>{let o=a.routes[c.route.id];if(o){let f=await GE(o,l);return f.links?f.links():[]}return[]}));return WE(s.flat(1).filter(XE).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function ox(t,a,l,s,c,o){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 o==="assets"?a.filter((p,g)=>f(p,g)||m(p,g)):o==="data"?a.filter((p,g)=>{var y;let x=s.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(f(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let N=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof N=="boolean")return N}return!0}):[]}function KE(t,a,{includeHydrateFallback:l}={}){return ZE(t.map(s=>{let c=a.routes[s.route.id];if(!c)return[];let o=[c.module];return c.clientActionModule&&(o=o.concat(c.clientActionModule)),c.clientLoaderModule&&(o=o.concat(c.clientLoaderModule)),l&&c.hydrateFallbackModule&&(o=o.concat(c.hydrateFallbackModule)),c.imports&&(o=o.concat(c.imports)),o}).flat(1))}function ZE(t){return[...new Set(t)]}function JE(t){let a={},l=Object.keys(t).sort();for(let s of l)a[s]=t[s];return a}function WE(t,a){let l=new Set;return new Set(a),t.reduce((s,c)=>{let o=JSON.stringify(JE(c));return l.has(o)||(l.add(o),s.push({key:o,link:c})),s},[])}function vm(){let t=v.useContext(ys);return gm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function eN(){let t=v.useContext(mi);return gm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Yu=v.createContext(void 0);Yu.displayName="FrameworkContext";function Gu(){let t=v.useContext(Yu);return gm(t,"You must render this element inside a <HydratedRouter> element"),t}function tN(t,a){let l=v.useContext(Yu),[s,c]=v.useState(!1),[o,f]=v.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:y}=a,N=v.useRef(null);v.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let j=z=>{z.forEach(I=>{f(I.isIntersecting)})},R=new IntersectionObserver(j,{threshold:.5});return N.current&&R.observe(N.current),()=>{R.disconnect()}}},[t]),v.useEffect(()=>{if(s){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[s]);let w=()=>{c(!0)},S=()=>{c(!1),f(!1)};return l?t!=="intent"?[o,N,{}]:[o,N,{onFocus:mo(m,w),onBlur:mo(p,S),onMouseEnter:mo(g,w),onMouseLeave:mo(x,S),onTouchStart:mo(y,w)}]:[!1,N,{}]}function mo(t,a){return l=>{t&&t(l),l.defaultPrevented||a(l)}}function nN({page:t,...a}){let l=Db(),{nonce:s}=Gu(),{router:c}=vm(),o=v.useMemo(()=>lb(c.routes,t,c.basename),[c.routes,t,c.basename]);return o?(a.nonce==null&&s&&(a={...a,nonce:s}),l?v.createElement(rN,{page:t,matches:o,...a}):v.createElement(lN,{page:t,matches:o,...a})):null}function aN(t){let{manifest:a,routeModules:l}=Gu(),[s,c]=v.useState([]);return v.useEffect(()=>{let o=!1;return QE(t,a,l).then(f=>{o||c(f)}),()=>{o=!0}},[t,a,l]),s}function rN({page:t,matches:a,...l}){let s=$a(),{future:c}=Gu(),{basename:o}=vm(),f=v.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let m=Bb(t,o,c.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]},[o,c.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 lN({page:t,matches:a,...l}){let s=$a(),{future:c,manifest:o,routeModules:f}=Gu(),{basename:m}=vm(),{loaderData:p,matches:g}=eN(),x=v.useMemo(()=>ox(t,a,g,o,s,"data"),[t,a,g,o,s]),y=v.useMemo(()=>ox(t,a,g,o,s,"assets"),[t,a,g,o,s]),N=v.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let j=new Set,R=!1;if(a.forEach(I=>{var X;let q=o.routes[I.route.id];!q||!q.hasLoader||(!x.some(ee=>ee.route.id===I.route.id)&&I.route.id in p&&((X=f[I.route.id])!=null&&X.shouldRevalidate)||q.hasClientLoader?R=!0:j.add(I.route.id))}),j.size===0)return[];let z=Bb(t,m,c.v8_trailingSlashAwareDataRequests,"data");return R&&j.size>0&&z.searchParams.set("_routes",a.filter(I=>j.has(I.route.id)).map(I=>I.route.id).join(",")),[z.pathname+z.search]},[m,c.v8_trailingSlashAwareDataRequests,p,s,o,x,a,t,f]),w=v.useMemo(()=>KE(y,o),[y,o]),S=aN(y);return v.createElement(v.Fragment,null,N.map(j=>v.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...l})),w.map(j=>v.createElement("link",{key:j,rel:"modulepreload",href:j,...l})),S.map(({key:j,link:R})=>v.createElement("link",{key:j,nonce:l.nonce,...R,crossOrigin:R.crossOrigin??l.crossOrigin})))}function sN(...t){return a=>{t.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var iN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{iN&&(window.__reactRouterVersion="7.18.0")}catch{}function oN(t,a){return _w({basename:a==null?void 0:a.basename,getContext:a==null?void 0:a.getContext,future:a==null?void 0:a.future,history:ZS({window:a==null?void 0:a.window}),hydrationData:cN(),routes:t,mapRouteProperties:DE,hydrationRouteProperties:AE,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 cN(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:uN(t.errors)}),t}function uN(t){if(!t)return null;let a=Object.entries(t),l={};for(let[s,c]of a)if(c&&c.__type==="RouteErrorResponse")l[s]=new Bo(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(typeof c.__subType=="string"&&Sw.includes(c.__subType)){let o=window[c.__subType];if(typeof o=="function")try{let f=new o(c.message);f.stack="",l[s]=f}catch{}}if(l[s]==null){let o=new Error(c.message);o.stack="",l[s]=o}}else l[s]=c;return l}var Ve=v.forwardRef(function({onClick:a,discover:l="render",prefetch:s="none",relative:c,reloadDocument:o,replace:f,mask:m,state:p,target:g,to:x,preventScrollReset:y,viewTransition:N,defaultShouldRevalidate:w,...S},j){let{basename:R,navigator:z,useTransitions:I}=v.useContext(ja),q=typeof x=="string"&&qu.test(x),X=hb(x,R);x=X.to;let ee=dE(x,{relative:c}),ne=$a(),M=null;if(m){let be=Iu(m,[],ne.mask?ne.mask.pathname:"/",!0);R!=="/"&&(be.pathname=be.pathname==="/"?R:nr([R,be.pathname])),M=z.createHref(be)}let[C,ue,me]=tN(s,S),ye=dN(x,{replace:f,mask:m,state:p,target:g,preventScrollReset:y,relative:c,viewTransition:N,defaultShouldRevalidate:w,useTransitions:I});function ae(be){a&&a(be),be.defaultPrevented||ye(be)}let K=!(X.isExternal||o),ge=v.createElement("a",{...S,...me,href:(K?M:void 0)||X.absoluteURL||ee,onClick:K?ae:a,ref:sN(j,ue),target:g,"data-discover":!q&&l==="render"?"true":void 0});return C&&!q?v.createElement(v.Fragment,null,ge,v.createElement(nN,{page:ee})):ge});Ve.displayName="Link";var Gh=v.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:s="",end:c=!1,style:o,to:f,viewTransition:m,children:p,...g},x){let y=qo(f,{relative:g.relative}),N=$a(),w=v.useContext(mi),{navigator:S,basename:j}=v.useContext(ja),R=w!=null&&vN(y)&&m===!0,z=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,I=N.pathname,q=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(I=I.toLowerCase(),q=q?q.toLowerCase():null,z=z.toLowerCase()),q&&j&&(q=Ba(q,j)||q);const X=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let ee=I===z||!c&&I.startsWith(z)&&I.charAt(X)==="/",ne=q!=null&&(q===z||!c&&q.startsWith(z)&&q.charAt(z.length)==="/"),M={isActive:ee,isPending:ne,isTransitioning:R},C=ee?a:void 0,ue;typeof s=="function"?ue=s(M):ue=[s,ee?"active":null,ne?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let me=typeof o=="function"?o(M):o;return v.createElement(Ve,{...g,"aria-current":C,className:ue,ref:x,style:me,to:f,viewTransition:m},typeof p=="function"?p(M):p)});Gh.displayName="NavLink";var da=v.forwardRef(({discover:t="render",fetcherKey:a,navigate:l,reloadDocument:s,replace:c,state:o,method:f=Eu,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:N,...w},S)=>{let{useTransitions:j}=v.useContext(ja),R=ym(),z=mN(m,{relative:g}),I=f.toLowerCase()==="get"?"get":"post",q=typeof m=="string"&&qu.test(m),X=ee=>{if(p&&p(ee),ee.defaultPrevented)return;ee.preventDefault();let ne=ee.nativeEvent.submitter,M=(ne==null?void 0:ne.getAttribute("formmethod"))||f,C=()=>R(ne||ee.currentTarget,{fetcherKey:a,method:M,navigate:l,replace:c,state:o,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:N});j&&l!==!1?v.startTransition(()=>C()):C()};return v.createElement("form",{ref:S,method:I,action:z,onSubmit:s?p:X,...w,"data-discover":!q&&t==="render"?"true":void 0})});da.displayName="Form";function Hb({getKey:t,storageKey:a,...l}){let s=v.useContext(Yu),{basename:c}=v.useContext(ja),o=$a(),f=Lb();pN({getKey:t,storageKey:a});let m=v.useMemo(()=>{if(!s||!t)return null;let g=Qh(o,f,c,t);return g!==o.key?g:null},[]);if(!s||s.isSpaMode)return null;let p=((g,x)=>{if(!window.history.state||!window.history.state.key){let y=Math.random().toString(32).slice(2);window.history.replaceState({key:y},"")}try{let N=JSON.parse(sessionStorage.getItem(g)||"{}")[x||window.history.state.key];typeof N=="number"&&window.scrollTo(0,N)}catch(y){console.error(y),sessionStorage.removeItem(g)}}).toString();return l.nonce==null&&(s!=null&&s.nonce)&&(l.nonce=s.nonce),v.createElement("script",{...l,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p})(${ix(JSON.stringify(a||Xh))}, ${ix(JSON.stringify(m))})`}})}Hb.displayName="ScrollRestoration";function $b(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xu(t){let a=v.useContext(ys);return tt(a,$b(t)),a}function qb(t){let a=v.useContext(mi);return tt(a,$b(t)),a}function dN(t,{target:a,replace:l,mask:s,state:c,preventScrollReset:o,relative:f,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=kr(),y=$a(),N=qo(t,{relative:f});return v.useCallback(w=>{if($E(w,a)){w.preventDefault();let S=l!==void 0?l:Dr(y)===Dr(N),j=()=>x(t,{replace:S,mask:s,state:c,preventScrollReset:o,relative:f,viewTransition:m,defaultShouldRevalidate:p});g?v.startTransition(()=>j()):j()}},[y,x,N,l,s,c,a,t,o,f,m,p,g])}function Io(t){dn(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(Yh(t)),l=v.useRef(!1),s=$a(),c=v.useMemo(()=>qE(s.search,l.current?null:a.current),[s.search]),o=kr(),f=v.useCallback((m,p)=>{const g=Yh(typeof m=="function"?m(new URLSearchParams(c)):m);l.current=!0,o("?"+g,p)},[o,c]);return[c,f]}var fN=0,hN=()=>`__${String(++fN)}__`;function ym(){let{router:t}=Xu("useSubmit"),{basename:a}=v.useContext(ja),l=EE(),s=t.fetch,c=t.navigate;return v.useCallback(async(o,f={})=>{let{action:m,method:p,encType:g,formData:x,body:y}=VE(o,a);if(f.navigate===!1){let N=f.fetcherKey||hN();await s(N,l,f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||p,formEncType:f.encType||g,flushSync:f.flushSync})}else await c(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,c,a,l])}function mN(t,{relative:a}={}){let{basename:l}=v.useContext(ja),s=v.useContext(rr);tt(s,"useFormAction must be used inside a RouteContext");let[c]=s.matches.slice(-1),o={...qo(t||".",{relative:a})},f=$a();if(t==null){o.search=f.search;let m=new URLSearchParams(o.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();o.search=x?`?${x}`:""}}return(!t||t===".")&&c.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(o.pathname=o.pathname==="/"?l:nr([l,o.pathname])),Dr(o)}function gs({key:t}={}){var ee;let{router:a}=Xu("useFetcher"),l=qb("useFetcher"),s=v.useContext(hm),c=v.useContext(rr),o=(ee=c.matches[c.matches.length-1])==null?void 0:ee.route.id;tt(s,"useFetcher must be used inside a FetchersContext"),tt(c,"useFetcher must be used inside a RouteContext"),tt(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let f=v.useId(),[m,p]=v.useState(t||f);t&&t!==m&&p(t);let{deleteFetcher:g,getFetcher:x,resetFetcher:y,fetch:N}=a;v.useEffect(()=>(x(m),()=>g(m)),[g,x,m]);let w=v.useCallback(async(ne,M)=>{tt(o,"No routeId available for fetcher.load()"),await N(m,o,ne,M)},[m,o,N]),S=ym(),j=v.useCallback(async(ne,M)=>{await S(ne,{...M,navigate:!1,fetcherKey:m})},[m,S]),R=v.useCallback(ne=>y(m,ne),[y,m]),z=v.useMemo(()=>{let ne=v.forwardRef((M,C)=>v.createElement(da,{...M,navigate:!1,fetcherKey:m,ref:C}));return ne.displayName="fetcher.Form",ne},[m]),I=l.fetchers.get(m)||vb,q=s.get(m);return v.useMemo(()=>({Form:z,submit:j,load:w,reset:R,...I,data:q}),[z,j,w,R,I,q])}var Xh="react-router-scroll-positions",uu={};function Qh(t,a,l,s){let c=null;return s&&(l!=="/"?c=s({...t,pathname:Ba(t.pathname,l)||t.pathname},a):c=s(t,a)),c==null&&(c=t.key),c}function pN({getKey:t,storageKey:a}={}){let{router:l}=Xu("useScrollRestoration"),{restoreScrollPosition:s,preventScrollReset:c}=qb("useScrollRestoration"),{basename:o}=v.useContext(ja),f=$a(),m=Lb(),p=pr();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),gN(v.useCallback(()=>{if(p.state==="idle"){let g=Qh(f,m,o,t);uu[g]=window.scrollY}try{sessionStorage.setItem(a||Xh,JSON.stringify(uu))}catch(g){dn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${g}).`)}window.history.scrollRestoration="auto"},[p.state,t,o,f,m,a])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let g=sessionStorage.getItem(a||Xh);g&&(uu=JSON.parse(g))}catch{}},[a]),v.useLayoutEffect(()=>{let g=l==null?void 0:l.enableScrollRestoration(uu,()=>window.scrollY,t?(x,y)=>Qh(x,y,o,t):void 0);return()=>g&&g()},[l,o,t]),v.useLayoutEffect(()=>{if(s!==!1){if(typeof s=="number"){window.scrollTo(0,s);return}try{if(f.hash){let g=document.getElementById(decodeURIComponent(f.hash.slice(1)));if(g){g.scrollIntoView();return}}}catch{dn(!1,`"${f.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}c!==!0&&window.scrollTo(0,0)}},[f,s,c]))}function gN(t,a){let{capture:l}={};v.useEffect(()=>{let s=l!=null?{capture:l}:void 0;return window.addEventListener("pagehide",t,s),()=>{window.removeEventListener("pagehide",t,s)}},[t,l])}function vN(t,{relative:a}={}){let l=v.useContext(fm);tt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Xu("useViewTransitionState"),c=qo(t,{relative:a});if(!l.isTransitioning)return!1;let o=Ba(l.currentLocation.pathname,s)||l.currentLocation.pathname,f=Ba(l.nextLocation.pathname,s)||l.nextLocation.pathname;return Du(c.pathname,f)!=null||Du(c.pathname,o)!=null}var al=eb();function yN(t){return v.createElement(OE,{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 Ib=(...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 xN=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 bN=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 cx=t=>{const a=bN(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 wh={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 SN=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0;return!1},wN=v.createContext({}),EN=()=>v.useContext(wN),NN=v.forwardRef(({color:t,size:a,strokeWidth:l,absoluteStrokeWidth:s,className:c="",children:o,iconNode:f,...m},p)=>{const{size:g=24,strokeWidth:x=2,absoluteStrokeWidth:y=!1,color:N="currentColor",className:w=""}=EN()??{},S=s??y?Number(l??x)*24/Number(a??g):l??x;return v.createElement("svg",{ref:p,...wh,width:a??g??wh.width,height:a??g??wh.height,stroke:t??N,strokeWidth:S,className:Ib("lucide",w,c),...!o&&!SN(m)&&{"aria-hidden":"true"},...m},[...f.map(([j,R])=>v.createElement(j,R)),...Array.isArray(o)?o:[o]])});/**
|
|
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 St=(t,a)=>{const l=v.forwardRef(({className:s,...c},o)=>v.createElement(NN,{ref:o,iconNode:a,className:Ib(`lucide-${xN(cx(t))}`,`lucide-${t}`,s),...c}));return l.displayName=cx(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 RN=[["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"}]],jN=St("arrow-down-wide-narrow",RN);/**
|
|
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 TN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Qu=St("arrow-left",TN);/**
|
|
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 CN=[["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"}]],DN=St("arrow-up-narrow-wide",CN);/**
|
|
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 AN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Pb=St("ban",AN);/**
|
|
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 kN=[["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"}]],ON=St("chart-column",kN);/**
|
|
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 MN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],_N=St("check",MN);/**
|
|
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 LN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],bs=St("chevron-down",LN);/**
|
|
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 zN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vb=St("chevron-right",zN);/**
|
|
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 UN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],BN=St("circle-check-big",UN);/**
|
|
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 HN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xm=St("circle-check",HN);/**
|
|
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 $N=[["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"}]],qN=St("circle-dashed",$N);/**
|
|
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 IN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],PN=St("circle-minus",IN);/**
|
|
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 VN=[["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"}]],bm=St("circle-pause",VN);/**
|
|
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 FN=[["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"}]],Fb=St("circle-play",FN);/**
|
|
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 YN=[["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"}]],GN=St("circle-x",YN);/**
|
|
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 XN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ku=St("circle",XN);/**
|
|
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 QN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],KN=St("clock",QN);/**
|
|
182
|
+
* @license lucide-react v1.21.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const ZN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],JN=St("copy",ZN);/**
|
|
187
|
+
* @license lucide-react v1.21.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const WN=[["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"}]],eR=St("download",WN);/**
|
|
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 tR=[["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"}]],nR=St("git-branch",tR);/**
|
|
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 aR=[["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"}]],rR=St("grip-vertical",aR);/**
|
|
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 lR=[["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"}]],ku=St("layers",lR);/**
|
|
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 sR=[["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"}]],Po=St("list-todo",sR);/**
|
|
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 iR=[["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"}]],oR=St("locate-fixed",iR);/**
|
|
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 cR=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],uR=St("menu",cR);/**
|
|
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 dR=[["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"}]],fR=St("moon",dR);/**
|
|
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 hR=[["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"}]],Yb=St("octagon-alert",hR);/**
|
|
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 mR=[["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"}]],vs=St("pencil",mR);/**
|
|
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 pR=[["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"}]],gR=St("play",pR);/**
|
|
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 vR=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Gb=St("rotate-ccw",vR);/**
|
|
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 yR=[["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"}]],Xb=St("scroll-text",yR);/**
|
|
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 xR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],bR=St("search",xR);/**
|
|
257
|
+
* @license lucide-react v1.21.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const SR=[["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"}]],wR=St("sun",SR);/**
|
|
262
|
+
* @license lucide-react v1.21.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const ER=[["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"}]],NR=St("timer-reset",ER);/**
|
|
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 RR=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],hi=St("trash-2",RR);/**
|
|
272
|
+
* @license lucide-react v1.21.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const jR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qb=St("x",jR),TR="/api",CR=120,DR=40;function Zu(t){return{...t,number:t.number??0,decisions:t.decisions??[],acceptedDecisions:t.acceptedDecisions??[],checklist:t.checklist??[],subtasks:t.subtasks??[],pauseSnapshot:t.pauseSnapshot??null,pauseHistory:t.pauseHistory??[],startedAt:t.startedAt??"",completedAt:t.completedAt??"",descriptionUpdatedAt:t.descriptionUpdatedAt??""}}function Ju(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(Zu),linkedRequirements:t.linkedRequirements??[],handoff:t.handoff??"",handoffUpdatedAt:t.handoffUpdatedAt??"",descriptionUpdatedAt:t.descriptionUpdatedAt??""}}function Wu(t){return{...t,number:t.number??0,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",acceptedDecisions:t.acceptedDecisions??[],phaseIds:t.phaseIds??[],descriptionUpdatedAt:t.descriptionUpdatedAt??""}}function Kb(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??[],workDeviations:t.workDeviations??[],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 Sm(t){return{...t,description:t.description??"",macroTasks:t.macroTasks??[],linkedPhaseIds:t.linkedPhaseIds??[]}}async function ux(t,a){const l={"Content-Type":"application/json","X-Planner-Source":"web-ui",...a==null?void 0:a.headers};try{return await fetch(`${TR}${t}`,{...a,headers:l})}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 Pt(t,a){let l=await ux(t,a),s=0;for(;l.status===503&&s<DR;)await new Promise(c=>setTimeout(c,CR)),s+=1,l=await ux(t,a);if(!l.ok){const c=await l.text().catch(()=>l.statusText);throw new Response(c||l.statusText,{status:l.status,statusText:l.statusText})}return l.json()}async function wm(){return Kb(await Pt("/project"))}async function AR(t){return Kb(await Pt("/project",{method:"PUT",body:JSON.stringify({...t,workDeviations:[]})}))}async function kR(){return Pt("/ui-config")}async function Zb(){return(await Pt("/features")).map(Wu)}async function Vo(t){return Wu(await Pt(`/features/${t}`))}async function OR(t){return Wu(await Pt("/features",{method:"POST",body:JSON.stringify(t)}))}async function Jb(t){return Wu(await Pt(`/features/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function MR(t){return Pt(`/features/${t}`,{method:"DELETE"})}async function Em(){return(await Pt("/requirements")).requirements.map(Sm)}async function _R(t){const a=new Date().toISOString();return Sm(await Pt("/requirements",{method:"POST",body:JSON.stringify({...t,macroTasks:[],createdAt:a,updatedAt:a})}))}async function LR(t){return Sm(await Pt(`/requirements/${t.id}`,{method:"PUT",body:JSON.stringify({...t,updatedAt:new Date().toISOString()})}))}async function zR(t){return Pt(`/requirements/${t}`,{method:"DELETE"})}async function ed(t){const a=t?`?featureId=${encodeURIComponent(t)}`:"";return(await Pt(`/phases${a}`)).map(Ju)}async function td(t){return Ju(await Pt(`/phases/${t}`))}async function UR(t){return Ju(await Pt("/phases",{method:"POST",body:JSON.stringify(t)}))}async function Wb(t){return Ju(await Pt(`/phases/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function BR(t){return Pt(`/phases/${t}`,{method:"DELETE"})}async function HR(t,a){return Zu(await Pt(`/phases/${t}/tasks`,{method:"POST",body:JSON.stringify(a)}))}async function nd(t){return Zu(await Pt(`/tasks/${t}`))}async function Nm(t){return Zu(await Pt(`/tasks/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function $R(t){return Pt(`/tasks/${t}`,{method:"DELETE"})}async function qR(){return Pt("/tasks/active")}async function IR(){const t=await Pt("/tasks/focus");return{active:t.active??[],pendingResume:t.pendingResume??[]}}async function Kh(){return(await Pt("/handoffs")).handoffs??[]}async function PR(){return(await Pt("/handoffs/archive")).archived??[]}async function e0(t){return Pt(`/phases/${t}/handoff`,{method:"DELETE"})}async function VR(t=!1){return Pt(`/export?full=${t?"true":"false"}`)}async function FR(){return Pt("/repair",{method:"POST"})}async function Eh(t,a,l,s){return Pt("/reorder",{method:"POST",body:JSON.stringify({kind:t,movedId:a,beforeId:l,afterId:s})})}function YR(){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 GR({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 u.jsxs("span",{className:`inline-flex max-w-full min-h-7 items-center gap-1.5 rounded-[10px] border px-2 py-1 text-xs font-semibold sm:min-h-8 sm:rounded-[12px] sm:px-2.5 sm:py-1.5 sm:text-sm ${a.className}`,children:[u.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${a.dotClassName}`}),u.jsx("span",{className:"truncate",children:a.label})]})}function XR({projectName:t,projectRoot:a,planRoot:l,liveStatus:s}){const{theme:c,toggleTheme:o}=YR(),[f,m]=v.useState(!1),[p,g]=v.useState(null),[x,y]=v.useState(!1),N=[{to:"/features",label:"Features",icon:ku},{to:"/requirements",label:"Requirements",icon:Po},{to:"/handoff",label:"Handoff",icon:Xb}];async function w(S){g(S?"full":"summary");try{const R=await VR(S),z=new Blob([R.markdown],{type:"text/markdown;charset=utf-8"}),I=URL.createObjectURL(z),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),m(!1)}catch(R){window.alert(`Export failed: ${R instanceof Error?R.message:String(R)}`)}finally{g(null)}}return u.jsx("div",{className:"relative z-20 overflow-visible border-b border-[var(--border)] bg-[var(--surface-elevated)] backdrop-blur-xl backdrop-saturate-150",children:u.jsxs("div",{className:"page-container flex items-center gap-2 py-2 sm:gap-3 sm:py-2.5",children:[u.jsxs(Ve,{to:"/",title:a??t??"Agent Plan",className:"flex min-w-0 shrink-0 items-center gap-2 sm:gap-2.5",children:[u.jsx("div",{className:"surface-card flex h-8 w-8 shrink-0 items-center justify-center rounded-xl border border-[var(--border)] text-[var(--accent)] sm:h-9 sm:w-9",children:u.jsx(ku,{className:"h-4 w-4"})}),u.jsx("span",{className:"truncate text-sm font-black tracking-tight sm:text-base",children:t??"Agent Plan"})]}),u.jsx("nav",{className:"ml-1 hidden items-center gap-1 md:flex",children:N.map(S=>u.jsxs(Gh,{to:S.to,"aria-label":S.label,className:({isActive:j})=>`inline-flex min-h-7 shrink-0 items-center gap-1.5 rounded-[10px] border px-2 py-1 text-xs font-semibold transition sm:min-h-8 sm:rounded-[12px] sm:px-3 sm:py-1.5 sm:text-sm ${j?"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:[u.jsx(S.icon,{className:"h-3.5 w-3.5 shrink-0 sm:h-4 sm:w-4"}),u.jsx("span",{children:S.label})]},S.to))}),u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5 sm:gap-2",children:[u.jsx(GR,{liveStatus:s}),u.jsx("button",{type:"button",onClick:o,"aria-label":c==="dark"?"Switch to light theme":"Switch to dark theme",title:c==="dark"?"Switch to light theme":"Switch to dark theme",className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)] sm:h-9 sm:w-9 sm:rounded-[12px]",children:c==="dark"?u.jsx(wR,{className:"h-4 w-4"}):u.jsx(fR,{className:"h-4 w-4"})}),u.jsxs("div",{className:"relative md:hidden",children:[u.jsx("button",{type:"button","aria-label":"Open menu","aria-haspopup":"menu","aria-expanded":x,onClick:()=>y(S=>!S),className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[10px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)]",children:x?u.jsx(Qb,{className:"h-4 w-4"}):u.jsx(uR,{className:"h-4 w-4"})}),x?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"fixed inset-0 z-[150]","aria-hidden":"true",onClick:()=>y(!1)}),u.jsxs("div",{role:"menu",onKeyDown:S=>{S.key==="Escape"&&y(!1)},className:"absolute right-0 top-full z-[200] mt-2 w-52 overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-1 shadow-xl",children:[N.map(S=>u.jsxs(Gh,{to:S.to,"aria-label":S.label,onClick:()=>y(!1),className:({isActive:j})=>`flex items-center gap-2 rounded-[10px] px-3 py-2 text-sm font-semibold transition ${j?"bg-[var(--accent-soft)] text-[var(--accent)]":"text-[var(--text)] hover:bg-[var(--accent-soft)]"}`,children:[u.jsx(S.icon,{className:"h-4 w-4 shrink-0"}),u.jsx("span",{children:S.label})]},S.to)),u.jsx("div",{className:"my-1 h-px bg-[var(--border)]"}),u.jsxs("button",{type:"button",role:"menuitem",disabled:p!==null,onClick:()=>{y(!1),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:["Export summary",p==="summary"?u.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),u.jsxs("button",{type:"button",role:"menuitem",disabled:p!==null,onClick:()=>{y(!1),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:["Export full",p==="full"?u.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]})]}):null]}),u.jsxs("div",{className:"relative z-30 hidden md:block",children:[u.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":f,"aria-label":"Export",onClick:()=>m(S=>!S),className:"inline-flex min-h-7 items-center gap-1.5 rounded-[10px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2 py-1 text-xs font-semibold text-[var(--text-muted)] transition hover:text-[var(--text)] sm:min-h-8 sm:rounded-[12px] sm:px-3 sm:py-1.5 sm:text-sm",children:[u.jsx(eR,{className:"h-3.5 w-3.5 shrink-0 sm:h-4 sm:w-4"}),u.jsx("span",{children:"Export"}),u.jsx(bs,{className:`h-3.5 w-3.5 shrink-0 transition-transform sm:h-4 sm:w-4 ${f?"rotate-180":""}`})]}),f?u.jsxs("div",{role:"menu",onKeyDown:S=>{var I;const j=Array.from(S.currentTarget.querySelectorAll("[role=menuitem]")).filter(q=>!q.hasAttribute("disabled"));if(j.length===0)return;const R=j.indexOf(document.activeElement);let z=R;if(S.key==="ArrowDown")z=R===-1?0:(R+1)%j.length;else if(S.key==="ArrowUp")z=R===-1?j.length-1:(R-1+j.length)%j.length;else if(S.key==="Home")z=0;else if(S.key==="End")z=j.length-1;else return;S.preventDefault(),(I=j[z])==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:[u.jsxs("button",{type:"button",role:"menuitem",disabled:p!==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",p==="summary"?u.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),u.jsxs("button",{type:"button",role:"menuitem",disabled:p!==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",p==="full"?u.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]}):null]})]})]})})}function dx(t,a,l){t.split(`
|
|
277
|
+
`).forEach((c,o)=>{o>0&&a.push(u.jsx("br",{},`${l}-br-${o}`)),c&&a.push(c)})}function po(t,a){const l=[],s=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*)/g;let c=0,o=null,f=0;for(;(o=s.exec(t))!==null;)o.index>c&&dx(t.slice(c,o.index),l,`${a}-${f}`),o[2]&&o[3]?l.push(u.jsx("a",{href:o[3],target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline-offset-4 hover:underline",children:o[2]},`${a}-link-${f}`)):o[4]?l.push(u.jsx("strong",{className:"font-semibold text-[var(--text)]",children:o[4]},`${a}-strong-${f}`)):o[5]?l.push(u.jsx("code",{className:"rounded-md border border-[var(--border)] px-1.5 py-0.5 font-mono text-[0.95em] text-[var(--text)]",children:o[5]},`${a}-code-${f}`)):o[6]&&l.push(u.jsx("em",{className:"italic",children:o[6]},`${a}-em-${f}`)),c=s.lastIndex,f+=1;return c<t.length&&dx(t.slice(c),l,`${a}-tail`),l}function QR(t,a){var c;const l=t.split(`
|
|
278
|
+
`);if(t.startsWith("```")){const o=t.replace(/^```[a-zA-Z]*\n?/,"").replace(/```\s*$/,"");return u.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:u.jsx("code",{children:o})},`code-${a}`)}const s=t.match(/^(#{1,6})\s+(.+)$/);if(s&&s[2]){const o=((c=s[1])==null?void 0:c.length)??1,f=s[2],m=o<=2?"text-base font-bold text-[var(--text)]":"text-sm font-bold text-[var(--text)]";return u.jsx("p",{className:m,children:po(f,`h-${a}`)},`h-${a}`)}return l.every(o=>/^\s*>\s?/.test(o))?u.jsx("blockquote",{className:"border-l-2 border-[var(--accent)] pl-4 text-sm italic text-[var(--text-muted)]",children:l.map((o,f)=>u.jsx("div",{children:po(o.replace(/^\s*>\s?/,""),`bq-${a}-${f}`)},`bq-${a}-${f}`))},`bq-${a}`):/^\s*([-*_])\1{2,}\s*$/.test(t.trim())?u.jsx("hr",{className:"border-[var(--border)]"},`hr-${a}`):l.every(o=>/^\s*[-*]\s+/.test(o))?u.jsx("ul",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map((o,f)=>u.jsx("li",{className:"list-disc",children:po(o.replace(/^\s*[-*]\s+/,""),`ul-${a}-${f}`)},`ul-${a}-${f}`))},`ul-${a}`):l.every(o=>/^\s*\d+\.\s+/.test(o))?u.jsx("ol",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)] list-decimal",children:l.map((o,f)=>u.jsx("li",{children:po(o.replace(/^\s*\d+\.\s+/,""),`ol-${a}-${f}`)},`ol-${a}-${f}`))},`ol-${a}`):u.jsx("p",{className:"text-sm leading-6 text-[var(--text-muted)] whitespace-pre-wrap",children:po(t,`p-${a}`)},`p-${a}`)}function bn({text:t,className:a=""}){if(!(t!=null&&t.trim()))return null;const l=t.trim().split(/\n\s*\n/).filter(Boolean);return u.jsx("div",{className:`formatted-text grid grid-cols-1 gap-3 ${a}`,children:l.map((s,c)=>QR(s,c))})}function rl(t){return String(t&&t>0?t:0).padStart(3,"0")}function il({featureNum:t,phaseNum:a,taskNum:l}){const s=[];return t!==void 0&&s.push(`F${rl(t)}`),a!==void 0&&s.push(`P${rl(a)}`),l!==void 0&&s.push(`T${rl(l)}`),s.join("/")}async function KR(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 t0({type:t,phaseNum:a,featureNum:l}){return t==="feature"?null:t==="phase"?l===void 0?null:u.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:u.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["F",rl(l)]})}):t==="task"?a===void 0?null:u.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:[u.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["P",rl(a)]}),l!==void 0&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"w-[1px] bg-[var(--border)]"}),u.jsxs("span",{className:"px-2 py-1 text-[var(--text-subtle)]",children:["F",rl(l)]})]})]}):null}function ar({featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:c,taskId:o,featureName:f,phaseName:m,taskTitle:p}){const g=f?{title:f}:{},x=m?{title:m}:{},y=p?{title:p}:{},N=s?({children:j})=>u.jsx(Ve,{to:`/features/${s}`,...g,className:"entity-path-seg entity-path-seg--feature entity-path-seg--link",children:j}):({children:j})=>u.jsx("span",{className:"entity-path-seg entity-path-seg--feature",...g,children:j}),w=c?({children:j})=>u.jsx(Ve,{to:`/features/${s}/phases/${c}`,...x,className:"entity-path-seg entity-path-seg--phase entity-path-seg--link",children:j}):({children:j})=>u.jsx("span",{className:"entity-path-seg entity-path-seg--phase",...x,children:j}),S=o?({children:j})=>u.jsx(Ve,{to:`/features/${s}/phases/${c}/tasks/${o}`,...y,className:"entity-path-seg entity-path-seg--task entity-path-seg--link",children:j}):({children:j})=>u.jsx("span",{className:"entity-path-seg entity-path-seg--task",...y,children:j});return u.jsxs("span",{className:"entity-path-badge",children:[t!==void 0?u.jsxs(N,{children:["F",rl(t)]}):null,a!==void 0?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),u.jsxs(w,{children:["P",rl(a)]})]}):null,l!==void 0?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),u.jsxs(S,{children:["T",rl(l)]})]}):null]})}function lr({id:t,children:a}){const[l,s]=v.useState(!1);return u.jsxs("button",{type:"button",onClick:async c=>{c.preventDefault(),c.stopPropagation(),await KR(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,u.jsx("span",{className:"copyable-id__icon","aria-hidden":"true",children:l?u.jsx(_N,{className:"h-3 w-3 text-emerald-500"}):u.jsx(JN,{className:"h-3 w-3"})})]})}function ol({shortId:t}){return u.jsx(lr,{id:t,children:u.jsx("span",{className:"short-id-badge",children:t})})}function n0({featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:c,taskId:o,shortId:f,featureName:m,phaseName:p,taskTitle:g}){return u.jsxs(u.Fragment,{children:[u.jsx(ar,{featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:c,taskId:o,featureName:m,phaseName:p,taskTitle:g}),u.jsx(lr,{id:il({featureNum:t,phaseNum:a,taskNum:l}),children:u.jsx("span",{className:"sr-only",children:"Copy path"})}),f?u.jsx(ol,{shortId:f}):null]})}function Rm({phaseId:t,updatedAt:a}){const l=`Phase handoff pending${a?` · updated ${new Date(a).toLocaleString()}`:""}`;return u.jsxs("a",{href:`/handoff#${t}`,className:"handoff-badge flex items-center gap-1 ml-2 shrink-0",title:l,"aria-label":l,children:[u.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:[u.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"}),u.jsx("path",{d:"M9 2v3h3"}),u.jsx("path",{d:"M5.5 8h5M5.5 10.5h5"})]}),u.jsx("span",{className:"handoff-badge__label",children:"handoff"})]})}const Zh={planned:{colorVar:"--color-status-planned",icon:"circle",pattern:"",label:"Planned",description:"Not started",borderStyle:"solid",bgOpacity:10,borderOpacity:30},started:{colorVar:"--color-status-started",icon:"play-start",pattern:"dashed",label:"Started",description:"Begun but not active now",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},"in-progress":{colorVar:"--color-status-in-progress",icon:"play",pattern:"pulse",label:"In progress",description:"Active now",borderStyle:"solid",bgOpacity:12,borderOpacity:30},waiting:{colorVar:"--color-status-waiting",icon:"clock",pattern:"dashed",label:"Waiting",description:"Waiting on a dependency",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},blocked:{colorVar:"--color-status-blocked",icon:"stop",pattern:"",label:"Blocked",description:"Impediment",borderStyle:"solid",bgOpacity:12,borderOpacity:30},deferred:{colorVar:"--color-status-deferred",icon:"pause",pattern:"dashed",label:"Deferred",description:"Postponed",borderStyle:"dashed",bgOpacity:10,borderOpacity:30},done:{colorVar:"--color-status-done",icon:"check",pattern:"",label:"Done",description:"Completed",borderStyle:"solid",bgOpacity:14,borderOpacity:30},closed:{colorVar:"--color-status-closed",icon:"check-mixed",pattern:"",label:"Closed",description:"Closed with mixed outcomes",borderStyle:"solid",bgOpacity:14,borderOpacity:30},canceled:{colorVar:"--color-status-canceled",icon:"ban",pattern:"hatch",label:"Canceled",description:"Canceled",borderStyle:"solid",bgOpacity:8,borderOpacity:30},rejected:{colorVar:"--color-status-rejected",icon:"x",pattern:"crosshatch",label:"Rejected",description:"Rejected",borderStyle:"solid",bgOpacity:10,borderOpacity:30}};function Il(t){return Zh[t]??Zh.planned}function Ou(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 ZR(t){const a=Il(t);return{backgroundColor:Ou(a,"bg"),borderStyle:a.borderStyle,borderColor:Ou(a,"border"),borderWidth:"1px"}}function JR(t){const a=Il(t);return{backgroundColor:Ou(a,"bg"),borderStyle:a.borderStyle,borderColor:Ou(a,"border"),borderWidth:"1px"}}function jm(t){const{pattern:a}=Il(t);return a?a==="dashed"?`status-pattern-dashed status-pattern-dashed-${t}`:`status-pattern-${a}`:""}function a0(t){return`status-${t}`}function r0(t,a=30){return`color-mix(in srgb, var(${Il(t).colorVar}) ${a}%, transparent)`}function l0(t){return t in Zh?t:"planned"}function WR(t,a){const s=[Il(t).label],c=[["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[o,f]of c)f>0&&s.push(`${f} ${o}`);return s.join(" · ")}const s0={circle:Ku,"play-start":gR,play:Fb,clock:KN,stop:Yb,pause:bm,check:xm,"check-mixed":BN,ban:Pb,x:GN};function e2({status:t,className:a=""}){const l=Il(t),s=s0[l.icon]??Ku;return u.jsx(s,{className:`h-4 w-4 shrink-0 ${a}`.trim(),"aria-hidden":"true"})}function tr({status:t}){const a=l0(t),l=Il(a);return u.jsxs("span",{className:`status-chip ${a0(a)} ${jm(a)}`,title:l.description,"aria-label":l.description,children:[u.jsx(e2,{status:a,className:"h-3.5 w-3.5"}),u.jsx("span",{children:l.label})]})}function Fo({status:t,breakdown:a,size:l="md",children:s}){const c=Il(t),o=s0[c.icon]??Ku,f=jm(t),m=a?WR(t,a):c.description,p=l==="sm"?"px-2 py-0.5 text-[10px]":"px-2.5 py-1 text-[11px]";return u.jsxs("span",{className:`status-chip ${a0(t)} ${f} ${p}`,title:m,"aria-label":m,children:[u.jsx(o,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:c.label}),s]})}function Mu({status:t,breakdown:a,doneTasks:l,totalTasks:s,recentlyChanged:c,className:o}){const f=l!=null&&s!=null;return u.jsxs("div",{className:o,children:[c?u.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?u.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",l,"/",s||0,")"]}):null,u.jsx(Fo,{status:t,breakdown:a})]})}function i0({task:t}){const a=kr(),l=t.featureId?`/features/${t.featureId}/phases/${t.phaseId}/tasks/${t.id}`:"/features";return u.jsx("article",{className:`min-w-0 rounded-[12px] border bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] ${t.pendingResume?"border-[var(--accent)]":"border-[var(--border)]"}`,children:u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[u.jsx(ar,{featureNum:t.featureNumber,phaseNum:t.phaseNumber,taskNum:t.number,featureId:t.featureId,phaseId:t.phaseId,taskId:t.id}),u.jsx(lr,{id:il({featureNum:t.featureNumber,phaseNum:t.phaseNumber,taskNum:t.number}),children:u.jsx("span",{className:"sr-only",children:"Copy task path"})}),t.shortId?u.jsx(ol,{shortId:t.shortId}):null,u.jsx("span",{className:"shrink-0",children:u.jsx(tr,{status:t.status})}),u.jsx(Ve,{to:l,className:"min-w-0 flex-1 truncate font-medium hover:text-[var(--accent)]",children:t.title}),t.pendingResume?u.jsx("span",{className:"shrink-0 rounded-full bg-[var(--accent-soft)] px-2 py-0.5 text-[10px] font-bold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Resume required"}):null]}),u.jsx("button",{type:"button",onClick:s=>{s.preventDefault(),s.stopPropagation(),a(`/?locate=T${t.number}`)},"aria-label":`Locate T${t.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-white",children:u.jsx(oR,{className:"h-4 w-4"})})]})})}function t2({taskFocus:t}){const a=v.useMemo(()=>{const l=s=>{const c=new Set;return s.filter(o=>c.has(o.id)?!1:(c.add(o.id),!0))};return{active:l(t.active),pendingResume:l(t.pendingResume)}},[t.active,t.pendingResume]);return a.active.length===0?null:u.jsx("div",{className:"relative z-10 border-t border-[var(--border)] bg-[var(--surface-elevated)]/95 backdrop-blur-xl",children:u.jsx("div",{className:"page-container grid gap-3 py-2.5",children:a.active.length>0?u.jsxs("section",{"aria-labelledby":"active-task-heading",className:"grid gap-1.5",children:[u.jsxs("h2",{id:"active-task-heading",className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["Active tasks (",a.active.length,")"]}),a.active.map(l=>u.jsx(i0,{task:l},l.id))]}):null})})}function n2({project:t,taskFocus:a,serverInfo:l}){const s=pr(),[c,o]=v.useState("connecting");return v.useEffect(()=>{const f=m=>{var g;const p=(g=m.detail)==null?void 0:g.status;p&&o(p)};return window.addEventListener("agent-plan:ws-status",f),()=>window.removeEventListener("agent-plan:ws-status",f)},[]),u.jsxs("div",{className:"page-shell",children:[u.jsxs("header",{className:"sticky top-0 z-30 overflow-visible",children:[u.jsx(XR,{projectName:t==null?void 0:t.name,projectRoot:t==null?void 0:t.projectRoot,planRoot:t==null?void 0:t.planRoot,liveStatus:c}),u.jsx(t2,{taskFocus:a})]}),u.jsxs("div",{className:"page-container py-8",children:[u.jsxs("div",{className:"mb-8 flex flex-col gap-3 md:flex-row md:items-end md:justify-between md:gap-6",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Current project"}),u.jsx("h1",{className:"text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:u.jsx(Ve,{to:"/",className:"hover:text-[var(--accent)]",children:(t==null?void 0:t.name)??"Agent Plan"})}),t!=null&&t.projectRoot?u.jsx("p",{className:"mt-2 truncate font-mono text-xs text-[var(--text-subtle)]",title:t.projectRoot,children:t.projectRoot}):null,l?u.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[u.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:[u.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"]}),u.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?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-[var(--text-subtle)]",children:"·"}),u.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?u.jsx(bn,{text:t.description,className:"mt-2 max-w-3xl"}):null]}),s.state!=="idle"?u.jsx("div",{className:"text-sm font-semibold text-[var(--accent)]",children:"Updating…"}):null]}),u.jsx(gi,{})]})]})}const Ra=32,o0=4,a2=Math.PI*1.2;function c0(){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 r2(){const t=document.createElement("canvas");t.width=Ra,t.height=Ra;const a=t.getContext("2d");if(!a)return"";const l=c0();return a.beginPath(),a.arc(Ra/2,Ra/2,Ra/2-o0,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 l2(t,a){const l=t.getContext("2d");if(!l)return"";const s=c0();l.clearRect(0,0,Ra,Ra);const c=Ra/2,o=Ra/2,f=Ra/2-o0;return l.beginPath(),l.arc(c,o,f,0,Math.PI*2),l.fillStyle=s,l.globalAlpha=.85,l.fill(),l.globalAlpha=1,l.beginPath(),l.arc(c,o,f-3,a,a+a2),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",c,o+1),t.toDataURL("image/png")}function s2(){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 i2(t){const a=v.useRef(null),l=v.useRef(null),s=v.useRef(null),c=v.useRef(0);v.useEffect(()=>{if(a.current||(a.current=s2()),s.current||(s.current=r2()),!l.current){const m=document.createElement("canvas");m.width=Ra,m.height=Ra,l.current=m}const o=a.current;if(!t){o.href=s.current;return}const f=window.setInterval(()=>{document.hidden||(c.current+=Math.PI/10,o.href=l2(l.current,c.current))},100);return()=>{window.clearInterval(f),o.href=s.current}},[t])}const Eo={create:{key:"n",primary:!0},edit:{key:"e",primary:!0},delete:{key:"d",primary:!0},submit:{key:"Enter",primary:!0}},u0=v.createContext(Eo);function d0(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function o2(t){return typeof t!="string"}function c2(t){return{create:(t==null?void 0:t.create)??Eo.create,edit:(t==null?void 0:t.edit)??Eo.edit,delete:(t==null?void 0:t.delete)??Eo.delete,submit:(t==null?void 0:t.submit)??Eo.submit}}function u2(t){const a=[],l=d0();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 d2(t){return t instanceof HTMLElement?!!t.closest("input, textarea, select, [contenteditable='true']"):!1}function f2(t,a){const l=a.key.length===1?a.key.toLowerCase():a.key,s=t.key.length===1?t.key.toLowerCase():t.key,c=d0(),o=a.meta??(a.primary?c:!1),f=a.ctrl??(a.primary?!c:!1);return s===l&&!!o===t.metaKey&&!!f===t.ctrlKey&&!!a.shift===t.shiftKey&&!!a.alt===t.altKey}function h2({shortcuts:t,children:a}){return v.createElement(u0.Provider,{value:c2(t)},a)}function f0(t){const a=v.useContext(u0);if(t)return o2(t)?t:a[t]}function An(t,a,l){const s=f0(t);v.useEffect(()=>{if(!s||(l==null?void 0:l.enabled)===!1)return;const c=o=>{!(l!=null&&l.allowInEditable)&&d2(o.target)||f2(o,s)&&(o.preventDefault(),a())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[a,l==null?void 0:l.allowInEditable,l==null?void 0:l.enabled,s])}const m2=1500,p2=80,g2=12e3,v2=5e3;function y2(){const{revalidate:t}=NE(),a=v.useRef(null),l=v.useRef(null),s=v.useRef(null),c=v.useRef(null),o=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=()=>{o.current!==null&&(window.clearTimeout(o.current),o.current=null)},y=()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},N=()=>{g(),s.current=window.setTimeout(()=>{t()},p2)},w=()=>{!f||l.current!==null||(m("reconnecting"),l.current=window.setTimeout(()=>{l.current=null,R()},m2))},S=()=>{y(),x();const X=a.current;if(a.current=null,X&&(X.readyState===WebSocket.OPEN||X.readyState===WebSocket.CONNECTING))try{X.close()}catch{}},j=()=>{y(),x(),c.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(),o.current=window.setTimeout(()=>{S(),w()},v2)}},g2)},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 ee=window.location.protocol==="https:"?"wss":"ws",ne=new WebSocket(`${ee}://${window.location.host}/ws`);a.current=ne,ne.onopen=()=>{p(),m("live"),j()},ne.onmessage=M=>{x();try{const C=JSON.parse(M.data);if(!C.type||C.type==="pong"||C.type==="connected")return;switch(window.dispatchEvent(new CustomEvent("agent-plan:ws-event",{detail:C})),C.type){case"project-updated":case"features-updated":case"phases-updated":case"requirements-updated":case"plan-rendered":case"file-changed":case"handoffUpdated":case"handoffCleared":N();break;default:break}}catch{}},ne.onclose=()=>{y(),x(),a.current===ne&&(a.current=null),f&&w()},ne.onerror=()=>{try{ne.close()}catch{}}},z=()=>{const X=a.current;(!X||X.readyState===WebSocket.CLOSED||X.readyState===WebSocket.CLOSING)&&R()},I=()=>{document.visibilityState==="visible"&&z()},q=()=>{z()};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 x2(){const[t,a,l]=await Promise.all([wm(),kR(),IR()]);return{project:t,uiConfig:a,taskFocus:l}}function b2(){const{project:t,uiConfig:a,taskFocus:l}=sl();return v.useEffect(()=>{var f,m;const s=(f=t==null?void 0:t.name)==null?void 0:f.trim(),c=(m=t==null?void 0:t.projectRoot)==null?void 0:m.trim(),o=c?c.split(/[/\\]/).filter(Boolean).pop():void 0;s?o&&o!==s?document.title=`${s} · ${o}`:document.title=`${s} · Agent Plan`:document.title="Agent Plan"},[t==null?void 0:t.name,t==null?void 0:t.projectRoot]),i2(l.active.length>0),u.jsxs(h2,{shortcuts:a.shortcuts,children:[u.jsx(y2,{}),u.jsx(Hb,{getKey:s=>s.pathname}),u.jsx(n2,{project:t,taskFocus:l,serverInfo:a.server})]})}function S2(){const t=zb(),a=fi(t),l=a&&t.status===503,s=a?l?"Planner web UI disconnected":`Request failed (${t.status})`:"Planner web UI unavailable",c=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"},[]),u.jsx("div",{className:"page-shell min-h-screen",children:u.jsx("div",{className:"page-container flex min-h-screen items-center justify-center py-12",children:u.jsxs("div",{className:"surface-card max-w-2xl rounded-[24px] px-8 py-8",children:[u.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Agent Plan"}),u.jsx("h1",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:s}),u.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:String(c)}),u.jsx("div",{className:"mt-6 grid gap-2 text-sm text-[var(--text-muted)]",children:l?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:"Possible cause: Pi was closed or the local planner web server stopped."}),u.jsx("p",{children:"What to do:"}),u.jsxs("ul",{className:"grid gap-1 pl-5",children:[u.jsxs("li",{className:"list-disc",children:["restart Pi or run ",u.jsx("code",{children:"planner-web start"})]}),u.jsx("li",{className:"list-disc",children:"reopen this planner UI from the new session if needed"}),u.jsx("li",{className:"list-disc",children:"then reload this page"})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("p",{children:"The request reached the planner server, but the server rejected it."}),u.jsx("p",{children:"Fix the validation issue above, then try again."})]})}),u.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:u.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 w2(){const[t,a,l]=await Promise.all([Zb(),ed(),qR()]);return{features:t,phases:a,activeTasks:l}}function E2({shortcut:t}){const a=f0(t);return a?u.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:u2(a)}):null}const N2={primary:"border-transparent bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)]",secondary:"border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",ghost:"border-transparent bg-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]",danger:"border-transparent bg-[var(--danger-soft)] text-[var(--color-status-blocked)] hover:bg-[color-mix(in_srgb,var(--danger-soft)_88%,black_12%)]"};function gt({variant:t="secondary",className:a="",children:l,shortcut:s,...c}){return u.jsxs("button",{className:`inline-flex min-h-9 items-center justify-center gap-1.5 whitespace-nowrap rounded-[12px] border px-3 py-1.5 text-sm font-semibold transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface)] disabled:cursor-not-allowed disabled:opacity-60 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2 sm:gap-2 ${N2[t]} ${a}`,...c,children:[u.jsx("span",{className:"inline-flex items-center gap-1.5 sm:gap-2",children:l}),s?u.jsx(E2,{shortcut:s}):null]})}function Gt({className:t="",children:a,...l}){return u.jsx("div",{className:`surface-card p-6 ${t}`,...l,children:a})}function R2({decisions:t}){return t.length===0?null:u.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[u.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Accepted decisions (",t.length,")"]}),u.jsx("div",{className:"mt-4 grid gap-3",children:t.map(a=>u.jsxs("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3",children:[u.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?u.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[u.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"})," ",u.jsx(bn,{text:a.decision})]}):null,a.rationale?u.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[u.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"})," ",u.jsx(bn,{text:a.rationale})]}):null,a.implementationNotes?u.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[u.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"})," ",u.jsx(bn,{text:a.implementationNotes})]}):null]},a.id))})]})}function j2({project:t}){var x,y,N;const a=t.scope??[],l=t.outOfScope??[],s=t.technologies??[],c=t.tools??[],o=t.globalRules??[],f=t.decisions??[],m=t.acceptedDecisions??[],p={beforePhaseStart:((x=t.workflowRules)==null?void 0:x.beforePhaseStart)??[],beforeTaskStart:((y=t.workflowRules)==null?void 0:y.beforeTaskStart)??[],afterPhaseComplete:((N=t.workflowRules)==null?void 0:N.afterPhaseComplete)??[]};return a.length>0||l.length>0||s.length>0||c.length>0||o.length>0||f.length>0||m.length>0||p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?u.jsx(Gt,{className:"grid gap-4",children:u.jsxs("details",{className:"group",children:[u.jsx("summary",{className:"cursor-pointer select-none text-lg font-bold text-[var(--text)]",children:"AI Consolidated Context"}),u.jsxs("div",{className:"mt-4 grid gap-4",children:[a.length>0?u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"In scope"}),u.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:a.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null,l.length>0?u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Out of scope"}),u.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null,s.length>0||c.length>0?u.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.length>0?u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Technologies"}),u.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:s.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null,c.length>0?u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Tools"}),u.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:c.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null]}):null,o.length>0?u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Global rules"}),u.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:o.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?u.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[u.jsx("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:"Workflow rules"}),u.jsxs("div",{className:"mt-4 grid gap-4 text-sm text-[var(--text-muted)]",children:[p.beforePhaseStart.length>0?u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before phase start"}),u.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforePhaseStart.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.beforeTaskStart.length>0?u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before task start"}),u.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforeTaskStart.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null,p.afterPhaseComplete.length>0?u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"After phase complete"}),u.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.afterPhaseComplete.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null]})]}):null,f.length>0?u.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[u.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Legacy decisions (",f.length,")"]}),u.jsx("ul",{className:"mt-4 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:f.map(w=>u.jsx("li",{className:"list-disc",children:w},w))})]}):null,u.jsx(R2,{decisions:m})]})]})}):null}function T2(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function C2({features:t,phases:a}){const l=v.useMemo(()=>{const s=new Map(t.map(c=>[c.id,c.name]));return a.flatMap(c=>c.tasks.filter(o=>o.status==="done").map(o=>({task:o,phase:c,feature:t.find(f=>f.id===c.featureId),featureName:c.featureId?s.get(c.featureId)??c.featureId:"Unlinked feature",completedAt:o.completedAt||o.updatedAt}))).sort((c,o)=>o.completedAt.localeCompare(c.completedAt)).slice(0,3)},[t,a]);return u.jsxs(Gt,{className:"grid gap-4",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Latest completed tasks"}),u.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Most recently completed tasks, ordered by completion timestamp."})]}),u.jsx("div",{className:"grid gap-3",children:l.length>0?l.map(({task:s,phase:c,feature:o,featureName:f,completedAt:m})=>u.jsxs("div",{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:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(n0,{featureNum:o==null?void 0:o.number,phaseNum:c.number,taskNum:s.number,featureId:o==null?void 0:o.id,phaseId:c.id,taskId:s.id,shortId:s.shortId,featureName:o==null?void 0:o.name,phaseName:c.title,taskTitle:s.title}),u.jsx("span",{className:"ml-auto shrink-0",children:u.jsx(tr,{status:s.status})})]}),u.jsx(Ve,{to:c.featureId?`/features/${c.featureId}/phases/${c.id}/tasks/${s.id}`:"/features",className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:s.title}),u.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[u.jsx(t0,{type:"phase",featureNum:o==null?void 0:o.number}),u.jsxs("span",{className:"min-w-0 truncate",children:[f," · ",c.title]})]}),u.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Completed ",T2(m)]})]},s.id)):u.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const fx=1440*60*1e3;function D2(t){const a=Date.now()-new Date(t).getTime();if(a<0)return"just now";const l=Math.floor(a/1e3);if(l<60)return`${l}s ago`;const s=Math.floor(l/60);return s<60?`${s}m ago`:new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}function A2({features:t,phases:a}){const[,l]=v.useState(0),s=Date.now(),c=v.useMemo(()=>{const o=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?o.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<fx&&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(c.length===0)return;const o=c.reduce((m,p)=>{const g=new Date(p.createdAt).getTime()+fx-Date.now();return Math.min(m,g)},1/0);if(!Number.isFinite(o)||o<=0)return;const f=window.setTimeout(()=>l(m=>m+1),o+50);return()=>window.clearTimeout(f)},[c]),c.length===0?null:u.jsxs(Gt,{className:"grid gap-4",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"New Added Tasks"}),u.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Tasks created in the last 24 hours."})]}),u.jsx("div",{className:"grid gap-3",children:c.map(({task:o,phase:f,feature:m,featureName:p,createdAt:g})=>u.jsxs("div",{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:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(n0,{featureNum:m==null?void 0:m.number,phaseNum:f.number,taskNum:o.number,featureId:m==null?void 0:m.id,phaseId:f.id,taskId:o.id,shortId:o.shortId,featureName:m==null?void 0:m.name,phaseName:f.title,taskTitle:o.title}),u.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"}),u.jsx("span",{className:"ml-auto shrink-0",children:u.jsx(tr,{status:o.status})})]}),u.jsx(Ve,{to:f.featureId?`/features/${f.featureId}/phases/${f.id}/tasks/${o.id}`:"/features",className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:o.title}),u.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[u.jsx(t0,{type:"phase",featureNum:m==null?void 0:m.number}),u.jsxs("span",{className:"min-w-0 truncate",children:[p," · ",f.title]})]}),u.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Added ",D2(g)]})]},o.id))})]})}const k2=new Set(["in-progress"]),O2=new Set(["planned","waiting","blocked","deferred"]),M2=new Set(["done","canceled","rejected"]);function h0(t){return t==="discovery"?"in-progress":t==="draft"?"planned":t}function _2(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 L2(){return{planned:0,inProgress:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0}}function m0(t){const a=t,l=_2(a),s=a.length;if(s===0)return{displayStatus:"planned",breakdown:L2(),hasStarted:!1,totalChildren:0,meaningfulChildren:0};const c=a.filter(g=>g!=="canceled"&&g!=="rejected"),o=c.length,f=c.some(g=>g!=="planned");if(c.some(g=>k2.has(g)))return{displayStatus:"in-progress",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o};if(a.every(g=>M2.has(g)))return a.every(g=>g==="done")?{displayStatus:"done",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o}:a.every(g=>g==="canceled")?{displayStatus:"canceled",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o}:a.every(g=>g==="rejected")?{displayStatus:"rejected",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o}:{displayStatus:"closed",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o};const m=c.filter(g=>O2.has(g));return m.length>0&&m.every(g=>g==="waiting")?{displayStatus:"waiting",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o}:m.length>0&&m.every(g=>g==="blocked")?{displayStatus:"blocked",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o}:m.length>0&&m.every(g=>g==="deferred")?{displayStatus:"deferred",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o}:m.length>0&&m.every(g=>g==="planned")&&!f?{displayStatus:"planned",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o}:{displayStatus:"started",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:o}}function Tm(t){const a=t.map(l=>h0(l.status));return m0(a)}function Cm(t){const a=t.map(l=>h0(l.status));return m0(a)}function p0(t){return Cm(t)}function g0(t){return Tm(t)}const No={key:"priority",direction:"asc"},z2=4200;function U2(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function B2(t){return t.reduce((a,l)=>a+l.tasks.filter(s=>s.status==="done").length,0)}function H2(t){return String(t&&t>0?t:0).padStart(3,"0")}const $2={draft:0,discovery:1,planned:2,waiting:3,blocked:4,deferred:5,"in-progress":7,done:8,canceled:9,rejected:10};function hx(t,a){if(a==="title")return"name"in t?t.name:t.title;if(a==="status")return $2[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 jo(t,a,l,s){const c=hx(t,l),o=hx(a,l);let f;return typeof c=="number"&&typeof o=="number"?f=c-o:f=String(c).localeCompare(String(o)),f===0&&(f=(t.priority??0)-(a.priority??0)||t.number-a.number||t.createdAt.localeCompare(a.createdAt)),s==="desc"?-f:f}function q2(t,a,l=No){const s=new Map;for(const c of a){if(!c.featureId)continue;const o=s.get(c.featureId)??[];o.push(c),s.set(c.featureId,o)}return t.map(c=>{const o=s.get(c.id)??[],f=o.reduce((x,y)=>x+y.tasks.length,0),m=o.reduce((x,y)=>x+y.tasks.filter(N=>N.status==="done").length,0),p=o.map(x=>{const y=[...x.tasks].sort((w,S)=>jo(w,S,l.key,l.direction)),N=y.some(w=>w.status==="in-progress");return{phase:x,totalTasks:x.tasks.length,doneTasks:x.tasks.filter(w=>w.status==="done").length,allTasks:y,hasActiveTask:N,display:Tm(y)}}),g=p.some(({phase:x,allTasks:y})=>x.status==="in-progress"||x.status==="discovery"||y.some(N=>N.status==="in-progress"));return{feature:c,totalTasks:f,doneTasks:m,allPhases:p.sort((x,y)=>jo(x.phase,y.phase,l.key,l.direction)),hasActiveTask:p.some(x=>x.hasActiveTask),isActive:g,display:Cm(p.map(x=>x.phase))}}).sort((c,o)=>jo(c.feature,o.feature,l.key,l.direction))}function du({title:t,value:a,valueSuffix:l,subtitle:s,icon:c,valueClassName:o,iconClassName:f}){return u.jsxs(Gt,{className:"flex items-start justify-between gap-4",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:t}),u.jsxs("div",{className:"mt-2 flex items-end gap-2",children:[u.jsx("p",{className:`text-3xl font-black tracking-tight ${o??"text-[var(--text)]"}`,children:a}),l?u.jsx("span",{className:"pb-1 text-sm font-semibold text-[var(--text-muted)]",children:l}):null]}),u.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:s})]}),u.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:c})]})}function mx(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 I2({features:t,phases:a}){const l=new Map;for(const y of a)y.featureId&&l.set(y.featureId,[...l.get(y.featureId)??[],y]);const s=t.filter(y=>{const N=l.get(y.id)??[];return Cm(N).displayStatus==="done"}).length,c=Math.max(t.length-s,0),o=a.filter(y=>Tm(y.tasks).displayStatus==="done").length,f=Math.max(a.length-o,0),m=U2(a),p=B2(a),g=Math.max(m-p,0),x=m>0?Math.round(p/m*100):0;return u.jsxs("div",{className:"grid gap-4 lg:grid-cols-4",children:[u.jsx(du,{title:"Features",value:String(t.length),valueSuffix:"total",subtitle:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[s," done"]}),u.jsx("span",{children:" · "}),u.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[c," left"]})]}),icon:u.jsx(ku,{className:"h-4 w-4"})}),u.jsx(du,{title:"Phases",value:String(a.length),valueSuffix:"total",subtitle:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[o," done"]}),u.jsx("span",{children:" · "}),u.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[f," left"]})]}),icon:u.jsx(ON,{className:"h-4 w-4"})}),u.jsx(du,{title:"Tasks",value:String(m),valueSuffix:"total",subtitle:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[p," done"]}),u.jsx("span",{children:" · "}),u.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[g," left"]})]}),icon:u.jsx(Po,{className:"h-4 w-4"})}),u.jsx(du,{title:"Completion",value:`${x}%`,subtitle:"Task completion rate",valueClassName:mx(x),iconClassName:mx(x),icon:u.jsx(xm,{className:"h-4 w-4"})})]})}function P2(){for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];return v.useMemo(()=>s=>{a.forEach(c=>c(s))},a)}const ad=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vi(t){const a=Object.prototype.toString.call(t);return a==="[object Window]"||a==="[object global]"}function Dm(t){return"nodeType"in t}function pa(t){var a,l;return t?vi(t)?t:Dm(t)&&(a=(l=t.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function Am(t){const{Document:a}=pa(t);return t instanceof a}function Yo(t){return vi(t)?!1:t instanceof pa(t).HTMLElement}function v0(t){return t instanceof pa(t).SVGElement}function yi(t){return t?vi(t)?t.document:Dm(t)?Am(t)?t:Yo(t)||v0(t)?t.ownerDocument:document:document:document}const hr=ad?v.useLayoutEffect:v.useEffect;function rd(t){const a=v.useRef(t);return hr(()=>{a.current=t}),v.useCallback(function(){for(var l=arguments.length,s=new Array(l),c=0;c<l;c++)s[c]=arguments[c];return a.current==null?void 0:a.current(...s)},[])}function V2(){const t=v.useRef(null),a=v.useCallback((s,c)=>{t.current=setInterval(s,c)},[]),l=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[a,l]}function _o(t,a){a===void 0&&(a=[t]);const l=v.useRef(t);return hr(()=>{l.current!==t&&(l.current=t)},a),l}function Go(t,a){const l=v.useRef();return v.useMemo(()=>{const s=t(l.current);return l.current=s,s},[...a])}function _u(t){const a=rd(t),l=v.useRef(null),s=v.useCallback(c=>{c!==l.current&&(a==null||a(c,l.current)),l.current=c},[]);return[l,s]}function Lu(t){const a=v.useRef();return v.useEffect(()=>{a.current=t},[t]),a.current}let Nh={};function Xo(t,a){return v.useMemo(()=>{if(a)return a;const l=Nh[t]==null?0:Nh[t]+1;return Nh[t]=l,t+"-"+l},[t,a])}function y0(t){return function(a){for(var l=arguments.length,s=new Array(l>1?l-1:0),c=1;c<l;c++)s[c-1]=arguments[c];return s.reduce((o,f)=>{const m=Object.entries(f);for(const[p,g]of m){const x=o[p];x!=null&&(o[p]=x+t*g)}return o},{...a})}}const di=y0(1),zu=y0(-1);function F2(t){return"clientX"in t&&"clientY"in t}function ld(t){if(!t)return!1;const{KeyboardEvent:a}=pa(t.target);return a&&t instanceof a}function Y2(t){if(!t)return!1;const{TouchEvent:a}=pa(t.target);return a&&t instanceof a}function Uu(t){if(Y2(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 F2(t)?{x:t.clientX,y:t.clientY}:null}const ql=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[ql.Translate.toString(t),ql.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:a,duration:l,easing:s}=t;return a+" "+l+"ms "+s}}}),px="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function G2(t){return t.matches(px)?t:t.querySelector(px)}const X2={display:"none"};function Q2(t){let{id:a,value:l}=t;return cn.createElement("div",{id:a,style:X2},l)}function K2(t){let{id:a,announcement:l,ariaLiveType:s="assertive"}=t;const c={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 cn.createElement("div",{id:a,style:c,role:"status","aria-live":s,"aria-atomic":!0},l)}function Z2(){const[t,a]=v.useState("");return{announce:v.useCallback(s=>{s!=null&&a(s)},[]),announcement:t}}const x0=v.createContext(null);function J2(t){const a=v.useContext(x0);v.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(t)},[t,a])}function W2(){const[t]=v.useState(()=>new Set),a=v.useCallback(s=>(t.add(s),()=>t.delete(s)),[t]);return[v.useCallback(s=>{let{type:c,event:o}=s;t.forEach(f=>{var m;return(m=f[c])==null?void 0:m.call(f,o)})},[t]),a]}const ej={draggable:`
|
|
279
|
+
To pick up a draggable item, press the space bar.
|
|
280
|
+
While dragging, use the arrow keys to move the item.
|
|
281
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
282
|
+
`},tj={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 nj(t){let{announcements:a=tj,container:l,hiddenTextDescribedById:s,screenReaderInstructions:c=ej}=t;const{announce:o,announcement:f}=Z2(),m=Xo("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),J2(v.useMemo(()=>({onDragStart(y){let{active:N}=y;o(a.onDragStart({active:N}))},onDragMove(y){let{active:N,over:w}=y;a.onDragMove&&o(a.onDragMove({active:N,over:w}))},onDragOver(y){let{active:N,over:w}=y;o(a.onDragOver({active:N,over:w}))},onDragEnd(y){let{active:N,over:w}=y;o(a.onDragEnd({active:N,over:w}))},onDragCancel(y){let{active:N,over:w}=y;o(a.onDragCancel({active:N,over:w}))}}),[o,a])),!p)return null;const x=cn.createElement(cn.Fragment,null,cn.createElement(Q2,{id:s,value:c.draggable}),cn.createElement(K2,{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 Bu(){}function aj(t,a){return v.useMemo(()=>({sensor:t,options:a??{}}),[t,a])}function rj(){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 mr=Object.freeze({x:0,y:0});function lj(t,a){return Math.sqrt(Math.pow(t.x-a.x,2)+Math.pow(t.y-a.y,2))}function sj(t,a){const l=Uu(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 ij(t,a){let{data:{value:l}}=t,{data:{value:s}}=a;return l-s}function oj(t,a){let{data:{value:l}}=t,{data:{value:s}}=a;return s-l}function cj(t,a){if(!t||t.length===0)return null;const[l]=t;return l[a]}function gx(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 uj=t=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=t;const c=gx(a,a.left,a.top),o=[];for(const f of s){const{id:m}=f,p=l.get(m);if(p){const g=lj(gx(p),c);o.push({id:m,data:{droppableContainer:f,value:g}})}}return o.sort(ij)};function dj(t,a){const l=Math.max(a.top,t.top),s=Math.max(a.left,t.left),c=Math.min(a.left+a.width,t.left+t.width),o=Math.min(a.top+a.height,t.top+t.height),f=c-s,m=o-l;if(s<c&&l<o){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 fj=t=>{let{collisionRect:a,droppableRects:l,droppableContainers:s}=t;const c=[];for(const o of s){const{id:f}=o,m=l.get(f);if(m){const p=dj(m,a);p>0&&c.push({id:f,data:{droppableContainer:o,value:p}})}}return c.sort(oj)};function hj(t,a,l){return{...t,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function b0(t,a){return t&&a?{x:t.left-a.left,y:t.top-a.top}:mr}function mj(t){return function(l){for(var s=arguments.length,c=new Array(s>1?s-1:0),o=1;o<s;o++)c[o-1]=arguments[o];return c.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 pj=mj(1);function S0(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 gj(t,a,l){const s=S0(a);if(!s)return t;const{scaleX:c,scaleY:o,x:f,y:m}=s,p=t.left-f-(1-c)*parseFloat(l),g=t.top-m-(1-o)*parseFloat(l.slice(l.indexOf(" ")+1)),x=c?t.width/c:t.width,y=o?t.height/o:t.height;return{width:x,height:y,top:g,right:p+x,bottom:g+y,left:p}}const vj={ignoreTransform:!1};function xi(t,a){a===void 0&&(a=vj);let l=t.getBoundingClientRect();if(a.ignoreTransform){const{transform:g,transformOrigin:x}=pa(t).getComputedStyle(t);g&&(l=gj(l,g,x))}const{top:s,left:c,width:o,height:f,bottom:m,right:p}=l;return{top:s,left:c,width:o,height:f,bottom:m,right:p}}function vx(t){return xi(t,{ignoreTransform:!0})}function yj(t){const a=t.innerWidth,l=t.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function xj(t,a){return a===void 0&&(a=pa(t).getComputedStyle(t)),a.position==="fixed"}function bj(t,a){a===void 0&&(a=pa(t).getComputedStyle(t));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const o=a[c];return typeof o=="string"?l.test(o):!1})}function km(t,a){const l=[];function s(c){if(a!=null&&l.length>=a||!c)return l;if(Am(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!Yo(c)||v0(c)||l.includes(c))return l;const o=pa(t).getComputedStyle(c);return c!==t&&bj(c,o)&&l.push(c),xj(c,o)?l:s(c.parentNode)}return t?s(t):l}function w0(t){const[a]=km(t,1);return a??null}function Rh(t){return!ad||!t?null:vi(t)?t:Dm(t)?Am(t)||t===yi(t).scrollingElement?window:Yo(t)?t:null:null}function E0(t){return vi(t)?t.scrollX:t.scrollLeft}function N0(t){return vi(t)?t.scrollY:t.scrollTop}function Jh(t){return{x:E0(t),y:N0(t)}}var Pn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Pn||(Pn={}));function R0(t){return!ad||!t?!1:t===document.scrollingElement}function j0(t){const a={x:0,y:0},l=R0(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},s={x:t.scrollWidth-l.width,y:t.scrollHeight-l.height},c=t.scrollTop<=a.y,o=t.scrollLeft<=a.x,f=t.scrollTop>=s.y,m=t.scrollLeft>=s.x;return{isTop:c,isLeft:o,isBottom:f,isRight:m,maxScroll:s,minScroll:a}}const Sj={x:.2,y:.2};function wj(t,a,l,s,c){let{top:o,left:f,right:m,bottom:p}=l;s===void 0&&(s=10),c===void 0&&(c=Sj);const{isTop:g,isBottom:x,isLeft:y,isRight:N}=j0(t),w={x:0,y:0},S={x:0,y:0},j={height:a.height*c.y,width:a.width*c.x};return!g&&o<=a.top+j.height?(w.y=Pn.Backward,S.y=s*Math.abs((a.top+j.height-o)/j.height)):!x&&p>=a.bottom-j.height&&(w.y=Pn.Forward,S.y=s*Math.abs((a.bottom-j.height-p)/j.height)),!N&&m>=a.right-j.width?(w.x=Pn.Forward,S.x=s*Math.abs((a.right-j.width-m)/j.width)):!y&&f<=a.left+j.width&&(w.x=Pn.Backward,S.x=s*Math.abs((a.left+j.width-f)/j.width)),{direction:w,speed:S}}function Ej(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:f}=window;return{top:0,left:0,right:o,bottom:f,width:o,height:f}}const{top:a,left:l,right:s,bottom:c}=t.getBoundingClientRect();return{top:a,left:l,right:s,bottom:c,width:t.clientWidth,height:t.clientHeight}}function T0(t){return t.reduce((a,l)=>di(a,Jh(l)),mr)}function Nj(t){return t.reduce((a,l)=>a+E0(l),0)}function Rj(t){return t.reduce((a,l)=>a+N0(l),0)}function C0(t,a){if(a===void 0&&(a=xi),!t)return;const{top:l,left:s,bottom:c,right:o}=a(t);w0(t)&&(c<=0||o<=0||l>=window.innerHeight||s>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const jj=[["x",["left","right"],Nj],["y",["top","bottom"],Rj]];class Om{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=km(l),c=T0(s);this.rect={...a},this.width=a.width,this.height=a.height;for(const[o,f,m]of jj)for(const p of f)Object.defineProperty(this,p,{get:()=>{const g=m(s),x=c[o]-g;return this.rect[p]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class To{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 c;(c=this.target)==null||c.addEventListener(a,l,s),this.listeners.push([a,l,s])}}function Tj(t){const{EventTarget:a}=pa(t);return t instanceof a?t:yi(t)}function jh(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 er;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(er||(er={}));function yx(t){t.preventDefault()}function Cj(t){t.stopPropagation()}var Mt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Mt||(Mt={}));const D0={start:[Mt.Space,Mt.Enter],cancel:[Mt.Esc],end:[Mt.Space,Mt.Enter,Mt.Tab]},Dj=(t,a)=>{let{currentCoordinates:l}=a;switch(t.code){case Mt.Right:return{...l,x:l.x+25};case Mt.Left:return{...l,x:l.x-25};case Mt.Down:return{...l,y:l.y+25};case Mt.Up:return{...l,y:l.y-25}}};class A0{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 To(yi(l)),this.windowListeners=new To(pa(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(er.Resize,this.handleCancel),this.windowListeners.add(er.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(er.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:l}=this.props,s=a.node.current;s&&C0(s),l(mr)}handleKeyDown(a){if(ld(a)){const{active:l,context:s,options:c}=this.props,{keyboardCodes:o=D0,coordinateGetter:f=Dj,scrollBehavior:m="smooth"}=c,{code:p}=a;if(o.end.includes(p)){this.handleEnd(a);return}if(o.cancel.includes(p)){this.handleCancel(a);return}const{collisionRect:g}=s.current,x=g?{x:g.left,y:g.top}:mr;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:s.current,currentCoordinates:x});if(y){const N=zu(y,x),w={x:0,y:0},{scrollableAncestors:S}=s.current;for(const j of S){const R=a.code,{isTop:z,isRight:I,isLeft:q,isBottom:X,maxScroll:ee,minScroll:ne}=j0(j),M=Ej(j),C={x:Math.min(R===Mt.Right?M.right-M.width/2:M.right,Math.max(R===Mt.Right?M.left:M.left+M.width/2,y.x)),y:Math.min(R===Mt.Down?M.bottom-M.height/2:M.bottom,Math.max(R===Mt.Down?M.top:M.top+M.height/2,y.y))},ue=R===Mt.Right&&!I||R===Mt.Left&&!q,me=R===Mt.Down&&!X||R===Mt.Up&&!z;if(ue&&C.x!==y.x){const ye=j.scrollLeft+N.x,ae=R===Mt.Right&&ye<=ee.x||R===Mt.Left&&ye>=ne.x;if(ae&&!N.y){j.scrollTo({left:ye,behavior:m});return}ae?w.x=j.scrollLeft-ye:w.x=R===Mt.Right?j.scrollLeft-ee.x:j.scrollLeft-ne.x,w.x&&j.scrollBy({left:-w.x,behavior:m});break}else if(me&&C.y!==y.y){const ye=j.scrollTop+N.y,ae=R===Mt.Down&&ye<=ee.y||R===Mt.Up&&ye>=ne.y;if(ae&&!N.x){j.scrollTo({top:ye,behavior:m});return}ae?w.y=j.scrollTop-ye:w.y=R===Mt.Down?j.scrollTop-ee.y:j.scrollTop-ne.y,w.y&&j.scrollBy({top:-w.y,behavior:m});break}}this.handleMove(a,di(zu(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()}}A0.activators=[{eventName:"onKeyDown",handler:(t,a,l)=>{let{keyboardCodes:s=D0,onActivation:c}=a,{active:o}=l;const{code:f}=t.nativeEvent;if(s.start.includes(f)){const m=o.activatorNode.current;return m&&t.target!==m?!1:(t.preventDefault(),c==null||c({event:t.nativeEvent}),!0)}return!1}}];function xx(t){return!!(t&&"distance"in t)}function bx(t){return!!(t&&"delay"in t)}class Mm{constructor(a,l,s){var c;s===void 0&&(s=Tj(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:o}=a,{target:f}=o;this.props=a,this.events=l,this.document=yi(f),this.documentListeners=new To(this.document),this.listeners=new To(s),this.windowListeners=new To(pa(f)),this.initialCoordinates=(c=Uu(o))!=null?c:mr,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(er.Resize,this.handleCancel),this.windowListeners.add(er.DragStart,yx),this.windowListeners.add(er.VisibilityChange,this.handleCancel),this.windowListeners.add(er.ContextMenu,yx),this.documentListeners.add(er.Keydown,this.handleKeydown),l){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(bx(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(xx(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:c}=this.props;c(s,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(er.Click,Cj,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(er.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:s,initialCoordinates:c,props:o}=this,{onMove:f,options:{activationConstraint:m}}=o;if(!c)return;const p=(l=Uu(a))!=null?l:mr,g=zu(c,p);if(!s&&m){if(xx(m)){if(m.tolerance!=null&&jh(g,m.tolerance))return this.handleCancel();if(jh(g,m.distance))return this.handleStart()}if(bx(m)&&jh(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 Aj={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class _m extends Mm{constructor(a){const{event:l}=a,s=yi(l.target);super(a,Aj,s)}}_m.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 kj={move:{name:"mousemove"},end:{name:"mouseup"}};var Wh;(function(t){t[t.RightClick=2]="RightClick"})(Wh||(Wh={}));class Oj extends Mm{constructor(a){super(a,kj,yi(a.event.target))}}Oj.activators=[{eventName:"onMouseDown",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:s}=a;return l.button===Wh.RightClick?!1:(s==null||s({event:l}),!0)}}];const Th={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Mj extends Mm{constructor(a){super(a,Th)}static setup(){return window.addEventListener(Th.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Th.move.name,a)};function a(){}}}Mj.activators=[{eventName:"onTouchStart",handler:(t,a)=>{let{nativeEvent:l}=t,{onActivation:s}=a;const{touches:c}=l;return c.length>1?!1:(s==null||s({event:l}),!0)}}];var Co;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Co||(Co={}));var Hu;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Hu||(Hu={}));function _j(t){let{acceleration:a,activator:l=Co.Pointer,canScroll:s,draggingRect:c,enabled:o,interval:f=5,order:m=Hu.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:y,threshold:N}=t;const w=zj({delta:y,disabled:!o}),[S,j]=V2(),R=v.useRef({x:0,y:0}),z=v.useRef({x:0,y:0}),I=v.useMemo(()=>{switch(l){case Co.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case Co.DraggableRect:return c}},[l,c,p]),q=v.useRef(null),X=v.useCallback(()=>{const ne=q.current;if(!ne)return;const M=R.current.x*z.current.x,C=R.current.y*z.current.y;ne.scrollBy(M,C)},[]),ee=v.useMemo(()=>m===Hu.TreeOrder?[...g].reverse():g,[m,g]);v.useEffect(()=>{if(!o||!g.length||!I){j();return}for(const ne of ee){if((s==null?void 0:s(ne))===!1)continue;const M=g.indexOf(ne),C=x[M];if(!C)continue;const{direction:ue,speed:me}=wj(ne,C,I,a,N);for(const ye of["x","y"])w[ye][ue[ye]]||(me[ye]=0,ue[ye]=0);if(me.x>0||me.y>0){j(),q.current=ne,S(X,f),R.current=me,z.current=ue;return}}R.current={x:0,y:0},z.current={x:0,y:0},j()},[a,X,s,j,o,f,JSON.stringify(I),JSON.stringify(w),S,g,ee,x,JSON.stringify(N)])}const Lj={x:{[Pn.Backward]:!1,[Pn.Forward]:!1},y:{[Pn.Backward]:!1,[Pn.Forward]:!1}};function zj(t){let{delta:a,disabled:l}=t;const s=Lu(a);return Go(c=>{if(l||!s||!c)return Lj;const o={x:Math.sign(a.x-s.x),y:Math.sign(a.y-s.y)};return{x:{[Pn.Backward]:c.x[Pn.Backward]||o.x===-1,[Pn.Forward]:c.x[Pn.Forward]||o.x===1},y:{[Pn.Backward]:c.y[Pn.Backward]||o.y===-1,[Pn.Forward]:c.y[Pn.Forward]||o.y===1}}},[l,a,s])}function Uj(t,a){const l=a!=null?t.get(a):void 0,s=l?l.node.current:null;return Go(c=>{var o;return a==null?null:(o=s??c)!=null?o:null},[s,a])}function Bj(t,a){return v.useMemo(()=>t.reduce((l,s)=>{const{sensor:c}=s,o=c.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,s)}));return[...l,...o]},[]),[t,a])}var Lo;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Lo||(Lo={}));var em;(function(t){t.Optimized="optimized"})(em||(em={}));const Sx=new Map;function Hj(t,a){let{dragging:l,dependencies:s,config:c}=a;const[o,f]=v.useState(null),{frequency:m,measure:p,strategy:g}=c,x=v.useRef(t),y=R(),N=_o(y),w=v.useCallback(function(z){z===void 0&&(z=[]),!N.current&&f(I=>I===null?z:I.concat(z.filter(q=>!I.includes(q))))},[N]),S=v.useRef(null),j=Go(z=>{if(y&&!l)return Sx;if(!z||z===Sx||x.current!==t||o!=null){const I=new Map;for(let q of t){if(!q)continue;if(o&&o.length>0&&!o.includes(q.id)&&q.rect.current){I.set(q.id,q.rect.current);continue}const X=q.node.current,ee=X?new Om(p(X),X):null;q.rect.current=ee,ee&&I.set(q.id,ee)}return I}return z},[t,o,l,y,p]);return v.useEffect(()=>{x.current=t},[t]),v.useEffect(()=>{y||w()},[l,y]),v.useEffect(()=>{o&&o.length>0&&f(null)},[JSON.stringify(o)]),v.useEffect(()=>{y||typeof m!="number"||S.current!==null||(S.current=setTimeout(()=>{w(),S.current=null},m))},[m,y,w,...s]),{droppableRects:j,measureDroppableContainers:w,measuringScheduled:o!=null};function R(){switch(g){case Lo.Always:return!1;case Lo.BeforeDragging:return l;default:return!l}}}function Lm(t,a){return Go(l=>t?l||(typeof a=="function"?a(t):t):null,[a,t])}function $j(t,a){return Lm(t,a)}function qj(t){let{callback:a,disabled:l}=t;const s=rd(a),c=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(s)},[s,l]);return v.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function sd(t){let{callback:a,disabled:l}=t;const s=rd(a),c=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(s)},[l]);return v.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function Ij(t){return new Om(xi(t),t)}function wx(t,a,l){a===void 0&&(a=Ij);const[s,c]=v.useState(null);function o(){c(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=qj({callback(p){if(t)for(const g of p){const{type:x,target:y}=g;if(x==="childList"&&y instanceof HTMLElement&&y.contains(t)){o();break}}}}),m=sd({callback:o});return hr(()=>{o(),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 Pj(t){const a=Lm(t);return b0(t,a)}const Ex=[];function Vj(t){const a=v.useRef(t),l=Go(s=>t?s&&s!==Ex&&t&&a.current&&t.parentNode===a.current.parentNode?s:km(t):Ex,[t]);return v.useEffect(()=>{a.current=t},[t]),l}function Fj(t){const[a,l]=v.useState(null),s=v.useRef(t),c=v.useCallback(o=>{const f=Rh(o.target);f&&l(m=>m?(m.set(f,Jh(f)),new Map(m)):null)},[]);return v.useEffect(()=>{const o=s.current;if(t!==o){f(o);const m=t.map(p=>{const g=Rh(p);return g?(g.addEventListener("scroll",c,{passive:!0}),[g,Jh(g)]):null}).filter(p=>p!=null);l(m.length?new Map(m):null),s.current=t}return()=>{f(t),f(o)};function f(m){m.forEach(p=>{const g=Rh(p);g==null||g.removeEventListener("scroll",c)})}},[c,t]),v.useMemo(()=>t.length?a?Array.from(a.values()).reduce((o,f)=>di(o,f),mr):T0(t):mr,[t,a])}function Nx(t,a){a===void 0&&(a=[]);const l=v.useRef(null);return v.useEffect(()=>{l.current=null},a),v.useEffect(()=>{const s=t!==mr;s&&!l.current&&(l.current=t),!s&&l.current&&(l.current=null)},[t]),l.current?zu(t,l.current):mr}function Yj(t){v.useEffect(()=>{if(!ad)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 Gj(t,a){return v.useMemo(()=>t.reduce((l,s)=>{let{eventName:c,handler:o}=s;return l[c]=f=>{o(f,a)},l},{}),[t,a])}function k0(t){return v.useMemo(()=>t?yj(t):null,[t])}const Rx=[];function Xj(t,a){a===void 0&&(a=xi);const[l]=t,s=k0(l?pa(l):null),[c,o]=v.useState(Rx);function f(){o(()=>t.length?t.map(p=>R0(p)?s:new Om(a(p),p)):Rx)}const m=sd({callback:f});return hr(()=>{m==null||m.disconnect(),f(),t.forEach(p=>m==null?void 0:m.observe(p))},[t]),c}function O0(t){if(!t)return null;if(t.children.length>1)return t;const a=t.children[0];return Yo(a)?a:t}function Qj(t){let{measure:a}=t;const[l,s]=v.useState(null),c=v.useCallback(g=>{for(const{target:x}of g)if(Yo(x)){s(y=>{const N=a(x);return y?{...y,width:N.width,height:N.height}:N});break}},[a]),o=sd({callback:c}),f=v.useCallback(g=>{const x=O0(g);o==null||o.disconnect(),x&&(o==null||o.observe(x)),s(x?a(x):null)},[a,o]),[m,p]=_u(f);return v.useMemo(()=>({nodeRef:m,rect:l,setRef:p}),[l,m,p])}const Kj=[{sensor:_m,options:{}},{sensor:A0,options:{}}],Zj={current:{}},Ru={draggable:{measure:vx},droppable:{measure:vx,strategy:Lo.WhileDragging,frequency:em.Optimized},dragOverlay:{measure:xi}};class Do 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 Jj={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Do,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Bu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ru,measureDroppableContainers:Bu,windowRect:null,measuringScheduled:!1},M0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Bu,draggableNodes:new Map,over:null,measureDroppableContainers:Bu},Qo=v.createContext(M0),_0=v.createContext(Jj);function Wj(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Do}}}function eT(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,c=new Do(t.droppable.containers);return c.set(s,l),{...t,droppable:{...t.droppable,containers:c}}}case Un.SetDroppableDisabled:{const{id:l,key:s,disabled:c}=a,o=t.droppable.containers.get(l);if(!o||s!==o.key)return t;const f=new Do(t.droppable.containers);return f.set(l,{...o,disabled:c}),{...t,droppable:{...t.droppable,containers:f}}}case Un.UnregisterDroppable:{const{id:l,key:s}=a,c=t.droppable.containers.get(l);if(!c||s!==c.key)return t;const o=new Do(t.droppable.containers);return o.delete(l),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function tT(t){let{disabled:a}=t;const{active:l,activatorEvent:s,draggableNodes:c}=v.useContext(Qo),o=Lu(s),f=Lu(l==null?void 0:l.id);return v.useEffect(()=>{if(!a&&!s&&o&&f!=null){if(!ld(o)||document.activeElement===o.target)return;const m=c.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=G2(x);if(y){y.focus();break}}})}},[s,a,c,f,o]),null}function L0(t,a){let{transform:l,...s}=a;return t!=null&&t.length?t.reduce((c,o)=>o({transform:c,...s}),l):l}function nT(t){return v.useMemo(()=>({draggable:{...Ru.draggable,...t==null?void 0:t.draggable},droppable:{...Ru.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Ru.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 aT(t){let{activeNode:a,measure:l,initialRect:s,config:c=!0}=t;const o=v.useRef(!1),{x:f,y:m}=typeof c=="boolean"?{x:c,y:c}:c;hr(()=>{if(!f&&!m||!a){o.current=!1;return}if(o.current||!s)return;const g=a==null?void 0:a.node.current;if(!g||g.isConnected===!1)return;const x=l(g),y=b0(x,s);if(f||(y.x=0),m||(y.y=0),o.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const N=w0(g);N&&N.scrollBy({top:y.y,left:y.x})}},[a,f,m,s,l])}const id=v.createContext({...mr,scaleX:1,scaleY:1});var Ul;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ul||(Ul={}));const rT=v.memo(function(a){var l,s,c,o;let{id:f,accessibility:m,autoScroll:p=!0,children:g,sensors:x=Kj,collisionDetection:y=fj,measuring:N,modifiers:w,...S}=a;const j=v.useReducer(eT,void 0,Wj),[R,z]=j,[I,q]=W2(),[X,ee]=v.useState(Ul.Uninitialized),ne=X===Ul.Initialized,{draggable:{active:M,nodes:C,translate:ue},droppable:{containers:me}}=R,ye=M!=null?C.get(M):null,ae=v.useRef({initial:null,translated:null}),K=v.useMemo(()=>{var yt;return M!=null?{id:M,data:(yt=ye==null?void 0:ye.data)!=null?yt:Zj,rect:ae}:null},[M,ye]),ge=v.useRef(null),[be,U]=v.useState(null),[B,oe]=v.useState(null),de=_o(S,Object.values(S)),we=Xo("DndDescribedBy",f),D=v.useMemo(()=>me.getEnabled(),[me]),P=nT(N),{droppableRects:te,measureDroppableContainers:he,measuringScheduled:Ne}=Hj(D,{dragging:ne,dependencies:[ue.x,ue.y],config:P.droppable}),je=Uj(C,M),ze=v.useMemo(()=>B?Uu(B):null,[B]),ct=vt(),Ge=$j(je,P.draggable.measure);aT({activeNode:M!=null?C.get(M):null,config:ct.layoutShiftCompensation,initialRect:Ge,measure:P.draggable.measure});const nt=wx(je,P.draggable.measure,Ge),Sn=wx(je?je.parentElement:null),Xt=v.useRef({activatorEvent:null,active:null,activeNode:je,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:me,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ft=me.getNodeFor((l=Xt.current.over)==null?void 0:l.id),ie=Qj({measure:P.dragOverlay.measure}),$e=(s=ie.nodeRef.current)!=null?s:je,at=ne?(c=ie.rect)!=null?c:nt:null,Ut=!!(ie.nodeRef.current&&ie.rect),gn=Pj(Ut?null:nt),jt=k0($e?pa($e):null),_t=Vj(ne?ft??je:null),Qt=Xj(_t),Hn=L0(w,{transform:{x:ue.x-gn.x,y:ue.y-gn.y,scaleX:1,scaleY:1},activatorEvent:B,active:K,activeNodeRect:nt,containerNodeRect:Sn,draggingNodeRect:at,over:Xt.current.over,overlayNodeRect:ie.rect,scrollableAncestors:_t,scrollableAncestorRects:Qt,windowRect:jt}),$n=ze?di(ze,ue):null,tn=Fj(_t),fa=Nx(tn),ha=Nx(tn,[nt]),Wn=di(Hn,fa),qn=at?pj(at,Hn):null,fe=K&&qn?y({active:K,collisionRect:qn,droppableRects:te,droppableContainers:D,pointerCoordinates:$n}):null,Ce=cj(fe,"id"),[De,Ye]=v.useState(null),qe=Ut?Hn:di(Hn,ha),J=hj(qe,(o=De==null?void 0:De.rect)!=null?o:null,nt),Tt=v.useRef(null),Kt=v.useCallback((yt,wt)=>{let{sensor:Bt,options:Ct}=wt;if(ge.current==null)return;const nn=C.get(ge.current);if(!nn)return;const Zt=yt.nativeEvent,Ht=new Bt({active:ge.current,activeNode:nn,event:Zt,options:Ct,context:Xt,onAbort(Je){if(!C.get(Je))return;const{onDragAbort:kn}=de.current,A={id:Je};kn==null||kn(A),I({type:"onDragAbort",event:A})},onPending(Je,wn,kn,A){if(!C.get(Je))return;const{onDragPending:$}=de.current,Z={id:Je,constraint:wn,initialCoordinates:kn,offset:A};$==null||$(Z),I({type:"onDragPending",event:Z})},onStart(Je){const wn=ge.current;if(wn==null)return;const kn=C.get(wn);if(!kn)return;const{onDragStart:A}=de.current,_={activatorEvent:Zt,active:{id:wn,data:kn.data,rect:ae}};al.unstable_batchedUpdates(()=>{A==null||A(_),ee(Ul.Initializing),z({type:Un.DragStart,initialCoordinates:Je,active:wn}),I({type:"onDragStart",event:_}),U(Tt.current),oe(Zt)})},onMove(Je){z({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:_,scrollAdjustedTranslate:$}=Xt.current;let Z=null;if(kn&&$){const{cancelDrop:le}=de.current;Z={activatorEvent:Zt,active:kn,collisions:A,delta:$,over:_},Je===Un.DragEnd&&typeof le=="function"&&await Promise.resolve(le(Z))&&(Je=Un.DragCancel)}ge.current=null,al.unstable_batchedUpdates(()=>{z({type:Je}),ee(Ul.Uninitialized),Ye(null),U(null),oe(null),Tt.current=null;const le=Je===Un.DragEnd?"onDragEnd":"onDragCancel";if(Z){const Te=de.current[le];Te==null||Te(Z),I({type:le,event:Z})}})}}},[C]),Vn=v.useCallback((yt,wt)=>(Bt,Ct)=>{const nn=Bt.nativeEvent,Zt=C.get(Ct);if(ge.current!==null||!Zt||nn.dndKit||nn.defaultPrevented)return;const Ht={active:Zt};yt(Bt,wt.options,Ht)===!0&&(nn.dndKit={capturedBy:wt.sensor},ge.current=Ct,Kt(Bt,wt))},[C,Kt]),vn=Bj(x,Vn);Yj(x),hr(()=>{nt&&X===Ul.Initializing&&ee(Ul.Initialized)},[nt,X]),v.useEffect(()=>{const{onDragMove:yt}=de.current,{active:wt,activatorEvent:Bt,collisions:Ct,over:nn}=Xt.current;if(!wt||!Bt)return;const Zt={active:wt,activatorEvent:Bt,collisions:Ct,delta:{x:Wn.x,y:Wn.y},over:nn};al.unstable_batchedUpdates(()=>{yt==null||yt(Zt),I({type:"onDragMove",event:Zt})})},[Wn.x,Wn.y]),v.useEffect(()=>{const{active:yt,activatorEvent:wt,collisions:Bt,droppableContainers:Ct,scrollAdjustedTranslate:nn}=Xt.current;if(!yt||ge.current==null||!wt||!nn)return;const{onDragOver:Zt}=de.current,Ht=Ct.get(Ce),ht=Ht&&Ht.rect.current?{id:Ht.id,rect:Ht.rect.current,data:Ht.data,disabled:Ht.disabled}:null,Je={active:yt,activatorEvent:wt,collisions:Bt,delta:{x:nn.x,y:nn.y},over:ht};al.unstable_batchedUpdates(()=>{Ye(ht),Zt==null||Zt(Je),I({type:"onDragOver",event:Je})})},[Ce]),hr(()=>{Xt.current={activatorEvent:B,active:K,activeNode:je,collisionRect:qn,collisions:fe,droppableRects:te,draggableNodes:C,draggingNode:$e,draggingNodeRect:at,droppableContainers:me,over:De,scrollableAncestors:_t,scrollAdjustedTranslate:Wn},ae.current={initial:at,translated:qn}},[K,je,fe,qn,C,$e,at,te,me,De,_t,Wn]),_j({...ct,delta:ue,draggingRect:qn,pointerCoordinates:$n,scrollableAncestors:_t,scrollableAncestorRects:Qt});const qa=v.useMemo(()=>({active:K,activeNode:je,activeNodeRect:nt,activatorEvent:B,collisions:fe,containerNodeRect:Sn,dragOverlay:ie,draggableNodes:C,droppableContainers:me,droppableRects:te,over:De,measureDroppableContainers:he,scrollableAncestors:_t,scrollableAncestorRects:Qt,measuringConfiguration:P,measuringScheduled:Ne,windowRect:jt}),[K,je,nt,B,fe,Sn,ie,C,me,te,De,he,_t,Qt,P,Ne,jt]),Me=v.useMemo(()=>({activatorEvent:B,activators:vn,active:K,activeNodeRect:nt,ariaDescribedById:{draggable:we},dispatch:z,draggableNodes:C,over:De,measureDroppableContainers:he}),[B,vn,K,nt,z,we,C,De,he]);return cn.createElement(x0.Provider,{value:q},cn.createElement(Qo.Provider,{value:Me},cn.createElement(_0.Provider,{value:qa},cn.createElement(id.Provider,{value:J},g)),cn.createElement(tT,{disabled:(m==null?void 0:m.restoreFocus)===!1})),cn.createElement(nj,{...m,hiddenTextDescribedById:we}));function vt(){const yt=(be==null?void 0:be.autoScrollEnabled)===!1,wt=typeof p=="object"?p.enabled===!1:p===!1,Bt=ne&&!yt&&!wt;return typeof p=="object"?{...p,enabled:Bt}:{enabled:Bt}}}),lT=v.createContext(null),jx="button",sT="Draggable";function iT(t){let{id:a,data:l,disabled:s=!1,attributes:c}=t;const o=Xo(sT),{activators:f,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:y,over:N}=v.useContext(Qo),{role:w=jx,roleDescription:S="draggable",tabIndex:j=0}=c??{},R=(p==null?void 0:p.id)===a,z=v.useContext(R?id:lT),[I,q]=_u(),[X,ee]=_u(),ne=Gj(f,a),M=_o(l);hr(()=>(y.set(a,{id:a,key:o,node:I,activatorNode:X,data:M}),()=>{const ue=y.get(a);ue&&ue.key===o&&y.delete(a)}),[y,a]);const C=v.useMemo(()=>({role:w,tabIndex:j,"aria-disabled":s,"aria-pressed":R&&w===jx?!0:void 0,"aria-roledescription":S,"aria-describedby":x.draggable}),[s,w,j,R,S,x.draggable]);return{active:p,activatorEvent:m,activeNodeRect:g,attributes:C,isDragging:R,listeners:s?void 0:ne,node:I,over:N,setNodeRef:q,setActivatorNodeRef:ee,transform:z}}function z0(){return v.useContext(_0)}const oT="Droppable",cT={timeout:25};function uT(t){let{data:a,disabled:l=!1,id:s,resizeObserverConfig:c}=t;const o=Xo(oT),{active:f,dispatch:m,over:p,measureDroppableContainers:g}=v.useContext(Qo),x=v.useRef({disabled:l}),y=v.useRef(!1),N=v.useRef(null),w=v.useRef(null),{disabled:S,updateMeasurementsFor:j,timeout:R}={...cT,...c},z=_o(j??s),I=v.useCallback(()=>{if(!y.current){y.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{g(Array.isArray(z.current)?z.current:[z.current]),w.current=null},R)},[R]),q=sd({callback:I,disabled:S||!f}),X=v.useCallback((C,ue)=>{q&&(ue&&(q.unobserve(ue),y.current=!1),C&&q.observe(C))},[q]),[ee,ne]=_u(X),M=_o(a);return v.useEffect(()=>{!q||!ee.current||(q.disconnect(),y.current=!1,q.observe(ee.current))},[ee,q]),v.useEffect(()=>(m({type:Un.RegisterDroppable,element:{id:s,key:o,disabled:l,node:ee,rect:N,data:M}}),()=>m({type:Un.UnregisterDroppable,key:o,id:s})),[s]),v.useEffect(()=>{l!==x.current.disabled&&(m({type:Un.SetDroppableDisabled,id:s,key:o,disabled:l}),x.current.disabled=l)},[s,o,l,m]),{active:f,rect:N,isOver:(p==null?void 0:p.id)===s,node:ee,over:p,setNodeRef:ne}}function dT(t){let{animation:a,children:l}=t;const[s,c]=v.useState(null),[o,f]=v.useState(null),m=Lu(l);return!l&&!s&&m&&c(m),hr(()=>{if(!o)return;const p=s==null?void 0:s.key,g=s==null?void 0:s.props.id;if(p==null||g==null){c(null);return}Promise.resolve(a(g,o)).then(()=>{c(null)})},[a,s,o]),cn.createElement(cn.Fragment,null,l,s?v.cloneElement(s,{ref:f}):null)}const fT={x:0,y:0,scaleX:1,scaleY:1};function hT(t){let{children:a}=t;return cn.createElement(Qo.Provider,{value:M0},cn.createElement(id.Provider,{value:fT},a))}const mT={position:"fixed",touchAction:"none"},pT=t=>ld(t)?"transform 250ms ease":void 0,gT=v.forwardRef((t,a)=>{let{as:l,activatorEvent:s,adjustScale:c,children:o,className:f,rect:m,style:p,transform:g,transition:x=pT}=t;if(!m)return null;const y=c?g:{...g,scaleX:1,scaleY:1},N={...mT,width:m.width,height:m.height,top:m.top,left:m.left,transform:ql.Transform.toString(y),transformOrigin:c&&s?sj(s,m):void 0,transition:typeof x=="function"?x(s):x,...p};return cn.createElement(l,{className:f,style:N,ref:a},o)}),vT=t=>a=>{let{active:l,dragOverlay:s}=a;const c={},{styles:o,className:f}=t;if(o!=null&&o.active)for(const[m,p]of Object.entries(o.active))p!==void 0&&(c[m]=l.node.style.getPropertyValue(m),l.node.style.setProperty(m,p));if(o!=null&&o.dragOverlay)for(const[m,p]of Object.entries(o.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(c))l.node.style.setProperty(p,g);f!=null&&f.active&&l.node.classList.remove(f.active)}},yT=t=>{let{transform:{initial:a,final:l}}=t;return[{transform:ql.Transform.toString(a)},{transform:ql.Transform.toString(l)}]},xT={duration:250,easing:"ease",keyframes:yT,sideEffects:vT({styles:{active:{opacity:"0"}}})};function bT(t){let{config:a,draggableNodes:l,droppableContainers:s,measuringConfiguration:c}=t;return rd((o,f)=>{if(a===null)return;const m=l.get(o);if(!m)return;const p=m.node.current;if(!p)return;const g=O0(f);if(!g)return;const{transform:x}=pa(f).getComputedStyle(f),y=S0(x);if(!y)return;const N=typeof a=="function"?a:ST(a);return C0(p,c.draggable.measure),N({active:{id:o,data:m.data,node:p,rect:c.draggable.measure(p)},draggableNodes:l,dragOverlay:{node:f,rect:c.dragOverlay.measure(g)},droppableContainers:s,measuringConfiguration:c,transform:y})})}function ST(t){const{duration:a,easing:l,sideEffects:s,keyframes:c}={...xT,...t};return o=>{let{active:f,dragOverlay:m,transform:p,...g}=o;if(!a)return;const x={x:m.rect.left-f.rect.left,y:m.rect.top-f.rect.top},y={scaleX:p.scaleX!==1?f.rect.width*p.scaleX/m.rect.width:1,scaleY:p.scaleY!==1?f.rect.height*p.scaleY/m.rect.height:1},N={x:p.x-x.x,y:p.y-x.y,...y},w=c({...g,active:f,dragOverlay:m,transform:{initial:p,final:N}}),[S]=w,j=w[w.length-1];if(JSON.stringify(S)===JSON.stringify(j))return;const R=s==null?void 0:s({active:f,dragOverlay:m,...g}),z=m.node.animate(w,{duration:a,easing:l,fill:"forwards"});return new Promise(I=>{z.onfinish=()=>{R==null||R(),I()}})}}let Tx=0;function wT(t){return v.useMemo(()=>{if(t!=null)return Tx++,Tx},[t])}const ET=cn.memo(t=>{let{adjustScale:a=!1,children:l,dropAnimation:s,style:c,transition:o,modifiers:f,wrapperElement:m="div",className:p,zIndex:g=999}=t;const{activatorEvent:x,active:y,activeNodeRect:N,containerNodeRect:w,draggableNodes:S,droppableContainers:j,dragOverlay:R,over:z,measuringConfiguration:I,scrollableAncestors:q,scrollableAncestorRects:X,windowRect:ee}=z0(),ne=v.useContext(id),M=wT(y==null?void 0:y.id),C=L0(f,{activatorEvent:x,active:y,activeNodeRect:N,containerNodeRect:w,draggingNodeRect:R.rect,over:z,overlayNodeRect:R.rect,scrollableAncestors:q,scrollableAncestorRects:X,transform:ne,windowRect:ee}),ue=Lm(N),me=bT({config:s,draggableNodes:S,droppableContainers:j,measuringConfiguration:I}),ye=ue?R.setRef:void 0;return cn.createElement(hT,null,cn.createElement(dT,{animation:me},y&&M?cn.createElement(gT,{key:M,id:y.id,ref:ye,as:m,activatorEvent:x,adjustScale:a,className:p,transition:o,rect:ue,style:{zIndex:g,...c},transform:C},l):null))});function Ao(t,a,l){const s=t.slice();return s.splice(l<0?s.length+l:l,0,s.splice(a,1)[0]),s}function NT(t,a){return t.reduce((l,s,c)=>{const o=a.get(s);return o&&(l[c]=o),l},Array(t.length))}function fu(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 jT(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const U0=t=>{let{rects:a,activeIndex:l,overIndex:s,index:c}=t;const o=Ao(a,s,l),f=a[c],m=o[c];return!m||!f?null:{x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height}},hu={scaleX:1,scaleY:1},zm=t=>{var a;let{activeIndex:l,activeNodeRect:s,index:c,rects:o,overIndex:f}=t;const m=(a=o[l])!=null?a:s;if(!m)return null;if(c===l){const g=o[f];return g?{x:0,y:l<f?g.top+g.height-(m.top+m.height):g.top-m.top,...hu}:null}const p=TT(o,c,l);return c>l&&c<=f?{x:0,y:-m.height-p,...hu}:c<l&&c>=f?{x:0,y:m.height+p,...hu}:{x:0,y:0,...hu}};function TT(t,a,l){const s=t[a],c=t[a-1],o=t[a+1];return s?l<a?c?s.top-(c.top+c.height):o?o.top-(s.top+s.height):0:o?o.top-(s.top+s.height):c?s.top-(c.top+c.height):0:0}const B0="Sortable",H0=cn.createContext({activeIndex:-1,containerId:B0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:U0,disabled:{draggable:!1,droppable:!1}});function Um(t){let{children:a,id:l,items:s,strategy:c=U0,disabled:o=!1}=t;const{active:f,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=z0(),y=Xo(B0,l),N=m.rect!==null,w=v.useMemo(()=>s.map(ne=>typeof ne=="object"&&"id"in ne?ne.id:ne),[s]),S=f!=null,j=f?w.indexOf(f.id):-1,R=g?w.indexOf(g.id):-1,z=v.useRef(w),I=!RT(w,z.current),q=R!==-1&&j===-1||I,X=jT(o);hr(()=>{I&&S&&x(w)},[I,w,S,x]),v.useEffect(()=>{z.current=w},[w]);const ee=v.useMemo(()=>({activeIndex:j,containerId:y,disabled:X,disableTransforms:q,items:w,overIndex:R,useDragOverlay:N,sortedRects:NT(w,p),strategy:c}),[j,y,X.draggable,X.droppable,q,w,R,p,N,c]);return cn.createElement(H0.Provider,{value:ee},a)}const CT=t=>{let{id:a,items:l,activeIndex:s,overIndex:c}=t;return Ao(l,s,c).indexOf(a)},DT=t=>{let{containerId:a,isSorting:l,wasDragging:s,index:c,items:o,newIndex:f,previousItems:m,previousContainerId:p,transition:g}=t;return!g||!s||m!==o&&c===f?!1:l?!0:f!==c&&a===p},AT={duration:200,easing:"ease"},$0="transform",kT=ql.Transition.toString({property:$0,duration:0,easing:"linear"}),OT={roleDescription:"sortable"};function MT(t){let{disabled:a,index:l,node:s,rect:c}=t;const[o,f]=v.useState(null),m=v.useRef(l);return hr(()=>{if(!a&&l!==m.current&&s.current){const p=c.current;if(p){const g=xi(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,c]),v.useEffect(()=>{o&&f(null)},[o]),o}function _T(t){let{animateLayoutChanges:a=DT,attributes:l,disabled:s,data:c,getNewIndex:o=CT,id:f,strategy:m,resizeObserverConfig:p,transition:g=AT}=t;const{items:x,containerId:y,activeIndex:N,disabled:w,disableTransforms:S,sortedRects:j,overIndex:R,useDragOverlay:z,strategy:I}=v.useContext(H0),q=LT(s,w),X=x.indexOf(f),ee=v.useMemo(()=>({sortable:{containerId:y,index:X,items:x},...c}),[y,c,X,x]),ne=v.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:M,node:C,isOver:ue,setNodeRef:me}=uT({id:f,data:ee,disabled:q.droppable,resizeObserverConfig:{updateMeasurementsFor:ne,...p}}),{active:ye,activatorEvent:ae,activeNodeRect:K,attributes:ge,setNodeRef:be,listeners:U,isDragging:B,over:oe,setActivatorNodeRef:de,transform:we}=iT({id:f,data:ee,attributes:{...OT,...l},disabled:q.draggable}),D=P2(me,be),P=!!ye,te=P&&!S&&fu(N)&&fu(R),he=!z&&B,Ne=he&&te?we:null,ze=te?Ne??(m??I)({rects:j,activeNodeRect:K,activeIndex:N,overIndex:R,index:X}):null,ct=fu(N)&&fu(R)?o({id:f,items:x,activeIndex:N,overIndex:R}):X,Ge=ye==null?void 0:ye.id,nt=v.useRef({activeId:Ge,items:x,newIndex:ct,containerId:y}),Sn=x!==nt.current.items,Xt=a({active:ye,containerId:y,isDragging:B,isSorting:P,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=MT({disabled:!Xt,index:X,node:C,rect:M});return v.useEffect(()=>{P&&nt.current.newIndex!==ct&&(nt.current.newIndex=ct),y!==nt.current.containerId&&(nt.current.containerId=y),x!==nt.current.items&&(nt.current.items=x)},[P,ct,y,x]),v.useEffect(()=>{if(Ge===nt.current.activeId)return;if(Ge!=null&&nt.current.activeId==null){nt.current.activeId=Ge;return}const $e=setTimeout(()=>{nt.current.activeId=Ge},50);return()=>clearTimeout($e)},[Ge]),{active:ye,activeIndex:N,attributes:ge,data:ee,rect:M,index:X,newIndex:ct,items:x,isOver:ue,isSorting:P,isDragging:B,listeners:U,node:C,overIndex:R,over:oe,setNodeRef:D,setActivatorNodeRef:de,setDroppableNodeRef:me,setDraggableNodeRef:be,transform:ft??ze,transition:ie()};function ie(){if(ft||Sn&&nt.current.newIndex===X)return kT;if(!(he&&!ld(ae)||!g)&&(P||Xt))return ql.Transition.toString({...g,property:$0})}}function LT(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 zT=[{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 Bm({sort:t,onChange:a,label:l="Sort by"}){return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("label",{htmlFor:"sort-control",className:"hidden text-xs text-[var(--text-muted)] sm:inline",children:l}),u.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:[u.jsxs("div",{className:"relative",children:[u.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:zT.map(s=>u.jsx("option",{value:s.value,children:s.label},s.value))}),u.jsx(bs,{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"})]}),u.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"?u.jsx(DN,{className:"h-3.5 w-3.5","aria-hidden":"true"}):u.jsx(jN,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})}const od=[{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"}],cd=[{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"}],Hm=[{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=Hm,q0=[{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"}],go=od.map(t=>t.value),vo=cd.map(t=>t.value),yo=Hm.map(t=>t.value);function Ch(t,a,l){if(t.includes(a)){const s=t.filter(c=>c!==a);return s.length===0?[...l]:s}return[...t,a]}function ei(t,a){return a.includes(t)}function dr(t,a){return`agent-plan:dashboard:${t}:${a}`}function Dh(t,a,l){if(typeof window>"u")return a;try{const s=window.localStorage.getItem(t);if(!s)return a;const c=JSON.parse(s);if(!Array.isArray(c))return a;const o=`${t}-schema`,f=l.slice().sort().join(",");if(window.localStorage.getItem(o)!==f)return window.localStorage.setItem(o,f),a;const p=c.filter(g=>typeof g=="string"&&l.includes(g));return p.length>0?p:a}catch{return a}}function Ah(t,a,l){typeof window>"u"||(window.localStorage.setItem(t,JSON.stringify(a)),window.localStorage.setItem(`${t}-schema`,l.slice().sort().join(",")))}function kh(t,a){if(typeof window>"u")return a;const l=window.localStorage.getItem(t);return l===null?a:l==="true"}const Cx={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},Dx=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function I0(t){return t.split(",").map(a=>a.trim()).filter(a=>a.length>0)}function UT(t){return new Set(I0(t).map(a=>Number(a)).filter(a=>Number.isFinite(a)&&a>0))}function Ax(t){const a=t.toUpperCase();return a==="AND"||a==="OR"}function Oh(t,a){const l=t??new Set;for(const s of UT(a))l.add(s);return l}function BT(t,a){const l=t??new Set;for(const s of I0(a).map(c=>c.toUpperCase()))l.add(s);return l}function HT(t){const a=t.trim();if(!a)return{...Cx};const l={...Cx},s=[],c=[];let o=0;for(;o<a.length;){const m=a[o];if(m==='"'){const p=a.indexOf('"',o+1);if(p===-1){c.push(a.slice(o+1));break}c.push(a.slice(o+1,p)),o=p+1}else if(m===" ")o+=1;else{let p=o;for(;p<a.length&&a[p]!==" ";)p+=1;c.push(a.slice(o,p)),o=p}}let f=0;for(;f<c.length;){const m=c[f];if(Ax(m)){f+=1;continue}const p=m.match(Dx);if(p){const g=(p[1]??"").toLowerCase();let x=p[2]??"";if(x.trim()===""&&f+1<c.length){let y=f+1;for(;y<c.length&&Ax(c[y]);)y+=1;y<c.length&&!c[y].match(Dx)&&(x=c[y],f=y)}if(g==="feature"){const y=Oh(l.featureNumbers,x);y.size&&(l.featureNumbers=y)}else if(g==="phase"){const y=Oh(l.phaseNumbers,x);y.size&&(l.phaseNumbers=y)}else if(g==="task"){const y=Oh(l.taskNumbers,x);y.size&&(l.taskNumbers=y)}else if(g==="id"){const y=BT(l.shortIds,x);y.size&&(l.shortIds=y)}else g==="status"?x.trim()&&(l.status=x.toLowerCase()):g==="feature-status"?x.trim()&&(l.featureStatus=x.toLowerCase()):g==="phase-status"?x.trim()&&(l.phaseStatus=x.toLowerCase()):g==="title"&&x.trim()&&(l.text=x.toLowerCase())}else s.push(m.toLowerCase());f+=1}return s.length>0&&!l.text&&(l.text=s.join(" ")),l}function $T(t){return!!(t.featureNumbers||t.phaseNumbers||t.taskNumbers||t.shortIds||t.status||t.featureStatus||t.phaseStatus||t.text)}function P0(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 qT(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??P0(a)).includes(s))return!1}return!0}function IT({features:t,phases:a,projectStorageScope:l}){const s=dr(l,"show-all-features"),c=dr(l,"tree-open-mode"),o=dr(l,"expanded-features"),f=dr(l,"expanded-phases"),m=dr(l,"feature-status-filters"),p=dr(l,"phase-status-filters"),g=dr(l,"task-status-filters"),x=dr(l,"hide-done"),y=dr(l,"hide-planned"),N=dr(l,"only-active-branches"),w=dr(l,"work-tree-sort"),[S,j]=v.useState(""),[R,z]=v.useState(()=>{if(typeof window>"u")return No;try{const fe=window.localStorage.getItem(w);if(!fe)return No;const Ce=JSON.parse(fe);if(Ce.key&&Ce.direction)return{key:Ce.key,direction:Ce.direction}}catch{}return No}),I=v.useMemo(()=>q2(t,a,R),[t,a,R]),q=v.useMemo(()=>HT(S),[S]),X=$T(q),ee=v.useMemo(()=>{if(!X||!q.text)return null;const fe=new Map;for(const Ce of I)for(const De of Ce.allPhases)for(const Ye of De.allTasks)fe.set(Ye.id,P0({feature:Ce.feature,phase:De.phase,task:Ye}));return fe},[X,q.text,I]),{matchedTaskIds:ne,matchedFeatureIds:M,matchedPhaseIds:C}=v.useMemo(()=>{const fe=new Set,Ce=new Set,De=new Set;if(!X)return{matchedTaskIds:fe,matchedFeatureIds:Ce,matchedPhaseIds:De};for(const Ye of I)for(const qe of Ye.allPhases)for(const J of qe.allTasks)qT(q,{feature:Ye.feature,phase:qe.phase,task:J},ee==null?void 0:ee.get(J.id))&&(fe.add(J.id),Ce.add(Ye.feature.id),De.add(qe.phase.id));return{matchedTaskIds:fe,matchedFeatureIds:Ce,matchedPhaseIds:De}},[X,q,I,ee]),[ue,me]=v.useState(()=>{if(typeof window>"u")return!0;const fe=window.localStorage.getItem(s);return fe===null?!0:fe==="true"}),[ye,ae]=v.useState(()=>{if(typeof window>"u")return"all";const fe=window.localStorage.getItem(c);return fe==="smart"||fe==="none"||fe==="all"?fe:"all"}),[K,ge]=v.useState(()=>{if(typeof window>"u")return[];try{const fe=window.localStorage.getItem(o);return fe?JSON.parse(fe):[]}catch{return[]}}),[be,U]=v.useState(()=>{if(typeof window>"u")return[];try{const fe=window.localStorage.getItem(f);return fe?JSON.parse(fe):[]}catch{return[]}}),[B,oe]=v.useState(()=>Dh(m,go,go)),[de,we]=v.useState(()=>Dh(p,vo,vo)),[D,P]=v.useState(()=>Dh(g,yo,yo)),[te,he]=v.useState(()=>kh(x,!1)),[Ne,je]=v.useState(()=>kh(y,!1)),[ze,ct]=v.useState(()=>kh(N,!1)),[Ge,nt]=v.useState([]),[Sn,Xt]=v.useState([]),[ft,ie]=v.useState([]),$e=v.useRef({});v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(s,String(ue))},[ue,s]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(c,ye)},[ye,c]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(o,JSON.stringify(K))},[K,o]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(f,JSON.stringify(be))},[be,f]),v.useEffect(()=>{typeof window>"u"||Ah(m,B,go)},[B,m]),v.useEffect(()=>{typeof window>"u"||Ah(p,de,vo)},[de,p]),v.useEffect(()=>{typeof window>"u"||Ah(g,D,yo)},[D,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(N,String(ze))},[ze,N]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(w,JSON.stringify(R))},[R,w]),v.useEffect(()=>()=>{Object.values($e.current).forEach(fe=>window.clearTimeout(fe)),$e.current={}},[]);const at=v.useMemo(()=>{let fe=[...B];return te&&(fe=fe.filter(Ce=>Ce!=="done")),Ne&&(fe=fe.filter(Ce=>Ce!=="planned")),fe},[B,te,Ne]),Ut=v.useMemo(()=>{let fe=[...de];return te&&(fe=fe.filter(Ce=>Ce!=="done")),Ne&&(fe=fe.filter(Ce=>Ce!=="planned"&&Ce!=="draft")),fe},[de,te,Ne]),gn=v.useMemo(()=>{let fe=[...D];return te&&(fe=fe.filter(Ce=>Ce!=="done")),Ne&&(fe=fe.filter(Ce=>Ce!=="planned")),fe},[D,te,Ne]),jt=v.useMemo(()=>{if(X)return I.filter(De=>ei(De.feature.status,at)).map(De=>({...De,allPhases:De.allPhases.filter(Ye=>ei(Ye.phase.status,Ut)).map(Ye=>({...Ye,allTasks:Ye.allTasks.filter(qe=>ne.has(qe.id)&&ei(qe.status,gn))})).filter(Ye=>Ye.allTasks.length>0)})).filter(De=>De.allPhases.length>0);const fe=!ue||ze;return(ue?I:I.filter(De=>De.isActive)).filter(({feature:De})=>ei(De.status,at)).map(De=>({...De,allPhases:De.allPhases.filter(({phase:Ye,hasActiveTask:qe})=>ei(Ye.status,Ut)?fe?Ye.status==="in-progress"||Ye.status==="discovery"||qe:!0:!1).map(Ye=>({...Ye,allTasks:Ye.allTasks.filter(qe=>!!ei(qe.status,gn))})).filter(Ye=>Ye.allTasks.length>0||ue||!fe)})).filter(({hasActiveTask:De,allPhases:Ye})=>fe?De||Ye.some(qe=>qe.hasActiveTask):Ye.length>0||ue)},[X,ne,I,at,Ut,gn,ze,ue]);v.useEffect(()=>{if(ye==="none"){ge([]),U([]);return}if(ye==="all"){ge(jt.filter(({feature:De})=>De.status!=="done").map(({feature:De})=>De.id)),U(jt.flatMap(({allPhases:De})=>De.map(({phase:Ye})=>Ye.id)));return}const fe=new Set(jt.map(({feature:De})=>De.id)),Ce=new Set(jt.flatMap(({allPhases:De})=>De.map(({phase:Ye})=>Ye.id)));ge(De=>De.filter(Ye=>fe.has(Ye))),U(De=>De.filter(Ye=>Ce.has(Ye)))},[jt,ye]),v.useEffect(()=>{X&&(ae("smart"),ge(Array.from(M)),U(Array.from(C)))},[X,M,C]);const _t=fe=>{ae("smart"),ge(Ce=>Ce.includes(fe)?Ce.filter(De=>De!==fe):[...Ce,fe])},Qt=fe=>{ae("smart"),U(Ce=>Ce.includes(fe)?Ce.filter(De=>De!==fe):[...Ce,fe])},Hn=()=>{ae("smart"),ge(jt.map(({feature:fe})=>fe.id)),U(jt.flatMap(({allPhases:fe})=>fe.map(({phase:Ce})=>Ce.id)))},$n=()=>{ae("smart"),ge([]),U([])},tn=v.useMemo(()=>{const fe=new Set(jt.map(({feature:qe})=>qe.id)),Ce=new Set(jt.flatMap(({allPhases:qe})=>qe.map(({phase:J})=>J.id)));if(fe.size===0)return!1;const De=Array.from(fe).every(qe=>K.includes(qe)),Ye=Array.from(Ce).every(qe=>be.includes(qe));return De&&Ye},[jt,K,be]);return v.useEffect(()=>{const fe=(De,Ye)=>{const qe=Ye.filter(J=>!!J);for(const J of qe){const Tt=`${De}:${J}`,Kt=De==="feature"?nt:De==="phase"?Xt:ie;Kt(Vn=>Vn.includes(J)?Vn:[...Vn,J]),$e.current[Tt]!==void 0&&window.clearTimeout($e.current[Tt]),$e.current[Tt]=window.setTimeout(()=>{Kt(Vn=>Vn.filter(vn=>vn!==J)),delete $e.current[Tt]},z2)}},Ce=De=>{var J,Tt,Kt,Vn,vn,qa;const qe=De.detail;if(qe!=null&&qe.type){if(qe.type==="features-updated"){const Me=((J=qe.data)==null?void 0:J.featureId)??((Tt=qe.data)==null?void 0:Tt.id);fe("feature",[Me]),Me&&(ae("smart"),ge(vt=>vt.includes(Me)?vt:[...vt,Me]));return}if(qe.type==="phases-updated"){const Me=(Kt=qe.data)==null?void 0:Kt.featureId,vt=((Vn=qe.data)==null?void 0:Vn.phaseId)??((vn=qe.data)==null?void 0:vn.id);fe("phase",[vt]),fe("feature",[Me]),fe("task",[(qa=qe.data)==null?void 0:qa.taskId]),ae("smart"),Me&&ge(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:ye,setTreeOpenMode:ae,expandAll:Hn,collapseAll:$n,isAllExpanded:tn,expandedFeatureIds:K,expandedPhaseIds:be,setExpandedFeatureIds:ge,setExpandedPhaseIds:U,toggleExpandedFeature:_t,toggleExpandedPhase:Qt,recentFeatureIds:Ge,recentPhaseIds:Sn,recentTaskIds:ft,setRecentTaskIds:ie,showAllFeatures:ue,setShowAllFeatures:me,featureStatusFilters:B,phaseStatusFilters:de,taskStatusFilters:D,hideDone:te,setHideDone:he,hidePlanned:Ne,setHidePlanned:je,onlyActiveBranches:ze,setOnlyActiveBranches:ct,resetFilters:()=>{j(""),me(!0),he(!1),je(!1),oe(go),we(vo),P(yo),ct(!1),z(No),ae("all")},toggleFeatureStatusFilter:fe=>oe(Ce=>Ch(Ce,fe,go)),togglePhaseStatusFilter:fe=>we(Ce=>Ch(Ce,fe,vo)),toggleTaskStatusFilter:fe=>P(Ce=>Ch(Ce,fe,yo)),searchQuery:S,setSearchQuery:j,searchActive:X,matchedTaskIds:ne,matchedFeatureIds:M,matchedPhaseIds:C,sort:R,setSort:z}}function bi({id:t,status:a,variant:l="header",className:s,children:c,ariaLabel:o}){const f=l==="surface"?ZR(a):JR(a),m=jm(a),p=["status-item",l==="surface"?"status-item--surface":"status-item--header",m,s??""].filter(Boolean).join(" ");return u.jsx("div",{id:t,className:p,style:f,"aria-label":o,"data-status":a,children:c})}function ll(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function cl({value:t,className:a=""}){if(!t)return null;const l=`Last updated ${ll(t)}`;return u.jsx("time",{dateTime:t,title:l,"aria-label":l,className:`text-[11px] text-[var(--text-subtle)] ${a}`.trim(),children:l})}const V0=v.createContext(null);function qm({id:t,children:a}){const l=_T({id:t}),s={transform:ql.Transform.toString(l.transform),transition:l.transition};return u.jsx(V0.Provider,{value:l,children:u.jsx("div",{ref:l.setNodeRef,style:s,className:l.isDragging?"ap-sortable--dragging":"",children:a})})}function Im(){const t=v.useContext(V0);return t?u.jsx("button",{type:"button",className:"drag-handle","aria-label":"Drag to reorder",title:"Drag to reorder",...t.listeners,...t.attributes,children:u.jsx(rR,{className:"h-4 w-4"})}):null}function F0({phaseId:t,phaseTitle:a,count:l,className:s=""}){if(l<1)return null;const c=`${l} linked requirement${l===1?"":"s"} for phase ${a}`;return u.jsxs(Ve,{to:`/requirements#phase-${t}`,"aria-label":c,title:c,className:`inline-flex min-h-7 items-center gap-1 rounded-md border border-[var(--border)] bg-[var(--surface-elevated)] px-1.5 text-xs font-semibold text-[var(--text-muted)] transition hover:border-[var(--accent)] hover:text-[var(--accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] ${s}`,children:[u.jsx(Po,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{"aria-hidden":"true",children:l})]})}const Pm="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function PT(){return u.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 kx({status:t,doneTasks:a,totalTasks:l,recentlyChanged:s,className:c}){const o=a!=null&&l!=null;return u.jsxs("div",{className:c,children:[s?u.jsx(PT,{}):null,o?u.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",a,"/",l||0,")"]}):null,u.jsx("span",{className:"shrink-0",children:u.jsx(tr,{status:t})})]})}function VT({entry:t,expanded:a,recentlyChanged:l,onToggle:s,isPhaseExpanded:c,onTogglePhase:o,isPhaseRecentlyChanged:f,isTaskRecentlyChanged:m,highlightedTaskIds:p,resumeRequiredIds:g=new Set}){const{feature:x,totalTasks:y,doneTasks:N,allPhases:w,hasActiveTask:S}=t;return u.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:[u.jsxs(bi,{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:[u.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[u.jsx("button",{type:"button",onClick:j=>{j.stopPropagation(),s()},onPointerDown:j=>j.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 ${x.name}`:`Expand feature ${x.name}`,"aria-expanded":a,children:u.jsx(Vb,{className:`h-4 w-4 transition ${a?"rotate-90":"rotate-0"}`})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Im,{}),u.jsx(ar,{featureNum:x.number,featureId:x.id}),u.jsx(lr,{id:il({featureNum:x.number}),children:u.jsx("span",{className:"sr-only",children:"Copy feature path"})}),x.shortId?u.jsx(ol,{shortId:x.shortId}):null,S?u.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),u.jsx(Mu,{status:t.display.displayStatus,breakdown:t.display.breakdown,doneTasks:N,totalTasks:y,recentlyChanged:l,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),u.jsx(Ve,{to:`/features/${x.id}`,className:`entity-link--feature ${Pm} underline-offset-4 hover:underline`,children:x.name}),u.jsx(cl,{value:x.updatedAt,className:"mt-1 block"})]})]}),u.jsx(Mu,{status:t.display.displayStatus,breakdown:t.display.breakdown,doneTasks:N,totalTasks:y,recentlyChanged:l,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),a&&w.length>0?u.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:r0(t.display.displayStatus)},children:u.jsx(Um,{items:w.map(j=>j.phase.id),strategy:zm,children:w.map(j=>u.jsx(qm,{id:j.phase.id,children:u.jsx(FT,{feature:x,phaseEntry:j,expanded:c(j.phase.id),recentlyChanged:f(j.phase.id),onToggle:()=>o(j.phase.id),isTaskRecentlyChanged:m,highlightedTaskIds:p,resumeRequiredIds:g})},j.phase.id))})}):null]})}function FT({feature:t,phaseEntry:a,expanded:l,recentlyChanged:s,onToggle:c,isTaskRecentlyChanged:o,highlightedTaskIds:f,resumeRequiredIds:m=new Set}){var w;const{phase:p,totalTasks:g,doneTasks:x,allTasks:y,hasActiveTask:N}=a;return u.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:[u.jsxs(bi,{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:[u.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[u.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),c()},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":l?`Collapse phase ${p.title}`:`Expand phase ${p.title}`,"aria-expanded":l,children:u.jsx(Vb,{className:`h-4 w-4 transition ${l?"rotate-90":"rotate-0"}`})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Im,{}),u.jsx(ar,{featureNum:t==null?void 0:t.number,phaseNum:p.number,featureId:t.id,phaseId:p.id}),u.jsx(lr,{id:il({featureNum:t==null?void 0:t.number,phaseNum:p.number}),children:u.jsx("span",{className:"sr-only",children:"Copy phase path"})}),p.shortId?u.jsx(ol,{shortId:p.shortId}):null,p.handoff?u.jsx(Rm,{phaseId:p.id,updatedAt:p.handoffUpdatedAt}):null,u.jsx(F0,{phaseId:p.id,phaseTitle:p.title,count:((w=p.linkedRequirements)==null?void 0:w.length)??0}),N?u.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),u.jsx(Mu,{status:a.display.displayStatus,breakdown:a.display.breakdown,doneTasks:x,totalTasks:g,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),u.jsx(Ve,{to:`/features/${t.id}/phases/${p.id}`,className:`entity-link--phase ${Pm} underline-offset-4 hover:underline`,children:p.title}),u.jsx(cl,{value:p.updatedAt,className:"mt-1 block"})]})]}),u.jsx(Mu,{status:a.display.displayStatus,breakdown:a.display.breakdown,doneTasks:x,totalTasks:g,recentlyChanged:s,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),l?y.length>0?u.jsx("div",{className:"ml-1.5 grid grid-cols-1 gap-1 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:r0(a.display.displayStatus)},children:u.jsx(Um,{items:y.map(S=>S.id),strategy:zm,children:y.map(S=>u.jsx(qm,{id:S.id,children:u.jsx(YT,{feature:t,phase:p,task:S,recentlyChanged:o(S.id),highlighted:f==null?void 0:f.has(S.id),resumeRequiredIds:m})},S.id))})}):u.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function YT({feature:t,phase:a,task:l,recentlyChanged:s,highlighted:c,resumeRequiredIds:o=new Set}){return u.jsxs(bi,{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)]":""} ${c?"ap-search-hit":""}`,children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Im,{}),u.jsx(ar,{featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number,featureId:t.id,phaseId:a.id,taskId:l.id}),u.jsx(lr,{id:il({featureNum:t==null?void 0:t.number,phaseNum:a.number,taskNum:l.number}),children:u.jsx("span",{className:"sr-only",children:"Copy task path"})}),l.shortId?u.jsx(ol,{shortId:l.shortId}):null,l.status==="in-progress"?u.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,o!=null&&o.has(l.id)?u.jsx("span",{title:"Paused and ready for resume — resume this task before starting new work.","aria-label":"Resume required",className:"inline-flex items-center text-[var(--accent)]",children:u.jsx(Gb,{className:"h-3.5 w-3.5"})}):null]}),u.jsx(kx,{status:l.status,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),u.jsx(Ve,{to:`/features/${t.id}/phases/${a.id}/tasks/${l.id}`,className:`entity-link--task ${Pm} underline-offset-4 hover:underline`,children:l.title}),u.jsx(cl,{value:l.updatedAt,className:"mt-1 block"})]}),u.jsx(kx,{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||{}),ci=class{constructor(t,a){mn(this,"input");mn(this,"pos");mn(this,"state");mn(this,"tokens");mn(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===`
|
|
283
|
+
`||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===`
|
|
284
|
+
`||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})}},ps=class{constructor(t){mn(this,"tokens");mn(this,"pos");mn(this,"nonWsTokens");mn(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),c=parseFloat(s);t.boost=isNaN(c)?1:c,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(),c=s.value.slice(1),o=parseInt(c,10);t.quoted?t.proximity=isNaN(o)?0:o:t.fuzzy=isNaN(o)?0:o,t.end=s.end}if(((l=this.peek())==null?void 0:l.type)===O.BOOST){const s=this.advance(),c=s.value.slice(1),o=parseFloat(c);t.boost=isNaN(o)?1:o,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==="[",c=a[a.length-1],o=c==="]"||c==="}",f=c==="]";o||this.errors.push({type:"Error",value:l,message:"Unclosed range expression",start:t.start,end:t.start+1});const m=o?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:o?f:!0,lowerQuoted:w.quoted,upperQuoted:!1,lowerStart:w.valueStart,lowerEnd:w.valueEnd,upperStart:t.end,upperEnd:t.end,start:t.start,end:t.end}}const x=this.parseRangeBound(p[1],g),y=g+p[1].length+(m.length-p[1].length-p[2].length),N=this.parseRangeBound(p[2],y);return{type:"Range",lower:x.value,upper:N.value,lowerInclusive:s,upperInclusive:o?f:!0,lowerQuoted:x.quoted,upperQuoted:N.quoted,lowerStart:x.valueStart,lowerEnd:x.valueEnd,upperStart:N.valueStart,upperEnd:N.valueEnd,start:t.start,end:t.end}}parsePrimary(){var l,s,c;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 o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected AND",start:o.start,end:o.end}),this.parsePrimary()}if(t.type===O.OR){const o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected OR",start:o.start,end:o.end}),this.parsePrimary()}if(t.type===O.PREFIX_OP){const o=this.advance(),f=this.parsePrimary();return o.value==="-"?{type:"Not",expression:f,sourceOperator:o.value,start:o.start,end:f.end}:{...f,start:o.start}}if(t.type===O.LPAREN){const o=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const g=this.match(O.RPAREN);g||this.errors.push({type:"Error",value:o.value,message:"Unclosed parenthesis",start:o.start,end:o.end});const x={type:"Group",expression:{type:"BareTerm",value:"",quoted:!1,start:o.end,end:o.end},start:o.start,end:g?g.end:o.end};return this.applyGroupBoost(x)}const f=this.parseOr(),m=this.match(O.RPAREN);m||this.errors.push({type:"Error",value:o.value,message:"Missing closing parenthesis",start:o.start,end:o.end});const p={type:"Group",expression:f,start:o.start,end:m?m.end:f.end};return this.applyGroupBoost(p)}if(t.type===O.SAVED_SEARCH){const o=this.advance();return{type:"SavedSearch",name:o.value.slice(1),start:o.start,end:o.end}}if(t.type===O.HISTORY_REF){const o=this.advance();return{type:"HistoryRef",ref:o.value.slice(1),start:o.start,end:o.end}}if(t.type===O.FIELD_NAME){const o=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 j={type:"FieldGroup",field:o.value,expression:{type:"BareTerm",value:"",quoted:!1,start:x.end,end:x.end},start:o.start,end:S?S.end:x.end};return this.applyGroupBoost(j)}const y=this.parseOr(),N=this.match(O.RPAREN);N||this.errors.push({type:"Error",value:x.value,message:"Missing closing parenthesis",start:x.start,end:x.end});const w={type:"FieldGroup",field:o.value,expression:y,start:o.start,end:N?N.end:y.end};return this.applyGroupBoost(w)}if(((s=this.peek())==null?void 0:s.type)===O.RANGE){const x=this.advance(),y=this.parseRange(x);return y.field=o.value,y.start=o.start,y}if(((c=this.peek())==null?void 0:c.type)===O.REGEX){const x=this.advance();return{type:"Regex",pattern:x.value.slice(1,-1),start:o.start,end:x.end}}const g=this.peek();if(g&&(g.type===O.VALUE||g.type===O.QUOTED_VALUE||g.type===O.WILDCARD)){const x=this.advance(),y=x.type===O.QUOTED_VALUE;y&&this.checkUnclosedQuote(x);const N=y?this.stripQuotes(x):x.value;return this.applyModifiers({type:"FieldValue",field:o.value,operator:m,value:N,quoted:y,start:o.start,end:x.end})}return{type:"FieldValue",field:o.value,operator:m,value:"",quoted:!1,start:o.start,end:p?p.end:f.end}}return{type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end}}if(t.type===O.COMPARISON_OP){const o=this.advance(),f=this.peek();if(f&&(f.type===O.VALUE||f.type===O.QUOTED_VALUE)){const m=this.advance();return{type:"BareTerm",value:o.value+m.value,quoted:!1,start:o.start,end:m.end}}return{type:"Error",value:o.value,message:"Comparison operator without value",start:o.start,end:o.end}}if(t.type===O.QUOTED_VALUE){const o=this.advance();return this.checkUnclosedQuote(o),this.applyModifiers({type:"BareTerm",value:this.stripQuotes(o),quoted:!0,start:o.start,end:o.end})}if(t.type===O.WILDCARD){const o=this.advance();return this.applyModifiers({type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end})}if(t.type===O.RANGE){const o=this.advance();return this.parseRange(o)}if(t.type===O.REGEX){const o=this.advance();return{type:"Regex",pattern:o.value.slice(1,-1),start:o.start,end:o.end}}if(t.type===O.VALUE){const o=this.advance();return this.applyModifiers({type:"BareTerm",value:o.value,quoted:!1,start:o.start,end:o.end})}if(t.type===O.RPAREN){const o=this.advance();return this.errors.push({type:"Error",value:o.value,message:"Unexpected closing parenthesis",start:o.start,end:o.end}),{type:"Error",value:o.value,message:"Unexpected closing parenthesis",start:o.start,end:o.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 o of t)if(o.type!==O.WHITESPACE){if(a>=o.start&&a<=o.end){l=o;break}o.end<=a&&(s=o)}const c=o=>{let f=0;for(let m=o;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 o="";const f=t.indexOf(l);for(let m=f-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){o=t[m].value;break}if(t[m].type!==O.WHITESPACE)break}if(!o&&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:o,token:t[m]};break}}return{type:"FIELD_VALUE",partial:"",fieldName:o,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 o=t.indexOf(l);let f="";for(let m=o-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 o=t.indexOf(s);let f="";for(let m=o-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 o=t.indexOf(l);for(let f=o-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 o=c(t.indexOf(l));return o?{type:"FIELD_VALUE",partial:l.value,fieldName:o,token:l}:{type:"FIELD_NAME",partial:l.value,token:l}}if((s==null?void 0:s.type)===O.PREFIX_OP){const o=c(t.indexOf(s));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,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 o=c(t.indexOf(s));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(t.length===0||t.every(o=>o.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 o=(l==null?void 0:l.type)===O.LPAREN?l:s,f=c(t.indexOf(o));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 o=c(t.indexOf(s));return o?{type:"FIELD_VALUE",partial:"",fieldName:o,token:void 0}:{type:"OPERATOR",partial:""}}return{type:"FIELD_NAME",partial:"",token:void 0}}};function tm(t,a){if(a<t.start||a>t.end)return null;if(t.type==="BooleanExpr"){const l=tm(t.left,a);if(l)return l;const s=tm(t.right,a);return s||null}return t}function GT(t,a,l){if(!t)return null;const s=tm(t,l);if(!s)return null;let c=s.start,o=s.end;const f=a.slice(o).match(/^(\s+(?:AND|OR|&&|\|\|)\s+|\s+)(?=\S)/i);if(f)return o+=f[0].length,{start:c,end:o};const m=a.slice(0,c).match(/(\s+(?:AND|OR|&&|\|\|)\s+|\s+)$/i);return m&&m.index!==void 0&&m.index>0&&(c-=m[0].length),{start:c,end:o}}var XT={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:{}},QT={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"},KT=["AND","OR","NOT"];function Ox(t){return t.replace(/\r\n/g,`
|
|
285
|
+
`).replace(/\r/g,`
|
|
286
|
+
`).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 Mx={"(":")","[":"]",'"':'"',"'":"'"};function ZT(t,a,l,s,c){const o=t.slice(0,a),f=t.slice(a,l),m=t.slice(l);return{newValue:o+s+f+c+m,newCursorPos:l+2,newSelStart:a+1,newSelEnd:l+1}}function JT(t){if(!t.textContent)return"";const a=[];function l(s){var c;if(s.nodeType===Node.TEXT_NODE)a.push(s.textContent||"");else if(s.nodeName==="BR")(c=s.hasAttribute)!=null&&c.call(s,"data-sentinel")||a.push(`
|
|
287
|
+
`);else for(let o=0;o<s.childNodes.length;o++)l(s.childNodes[o])}return l(t),a.join("")}function _x(t,a,l){let s=-1,c=-1;for(let o=0;o<t.length;o++){const f=t[o];a>=f.start&&a<=f.end&&(s=o),c===-1&&l>=f.start&&l<=f.end&&(c=o)}return[s,c]}function WT(t,a,l){if(t){let s=t.end;if(t.type===O.FIELD_NAME&&l){const c=l.indexOf(t);if(c>=0){for(let o=c+1;o<l.length;o++)if(l[o].type!==O.WHITESPACE){l[o].type===O.COLON&&(s=l[o].end);break}}}return{start:t.start,end:s}}return{start:a,end:a}}var Mh=class Y0{constructor(a,l=[],s=[],c=10,o={}){mn(this,"fields");mn(this,"fieldMap");mn(this,"savedSearches");mn(this,"searchHistory");mn(this,"maxSuggestions");mn(this,"options");mn(this,"defaultFieldName");mn(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=c,this.options={showSavedSearchHint:o.showSavedSearchHint??!1,showHistoryHint:o.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=ps.getCursorContext(a,l);const c=WT(s.token,l,a);if(this.defaultFieldName&&(s.type==="FIELD_NAME"||s.type==="EMPTY")){s={...s,type:"FIELD_VALUE",fieldName:this.defaultFieldName};const o=this.resolveField(this.defaultFieldName);if((o==null?void 0:o.type)==="date")return{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:s};const f=this.getValueSuggestions(o,s.partial,c.start,c.end);if(this.defaultFieldShowFieldSuggs){const m=this.getFieldSuggestions(s.partial,c.start,c.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 o=this.getFieldSuggestions(s.partial,c.start,c.end),f=!s.partial&&o.length>0?this.getSpecialHints(c.start,c.end):[];return{suggestions:this.sortByPriority([...o,...f]),showDatePicker:!1,context:s}}case"FIELD_VALUE":{const o=s.fieldName?this.resolveField(s.fieldName):void 0;return(o==null?void 0:o.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:s}:{suggestions:this.getValueSuggestions(o,s.partial,c.start,c.end),showDatePicker:!1,context:s}}case"OPERATOR":{const o=this.getOperatorSuggestions(s.partial,c.start,c.end),f=this.getFieldSuggestions("",c.start,c.end),m=this.getSpecialHints(c.start,c.end);return{suggestions:this.sortByPriority([...o,...f,...m]),showDatePicker:!1,context:s}}case"SAVED_SEARCH":return{suggestions:this.getSavedSearchSuggestions(s.partial,c.start,c.end),showDatePicker:!1,context:s};case"HISTORY_REF":return{suggestions:this.getHistorySuggestions(s.partial,c.start,c.end),showDatePicker:!1,context:s};case"RANGE":{const o=s.fieldName?this.resolveField(s.fieldName):void 0;return(o==null?void 0:o.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:o.name,context:s}:{suggestions:[],showDatePicker:!1,context:s}}default:return{suggestions:[],showDatePicker:!1,context:s}}}getFieldSuggestions(a,l,s){const c=a.toLowerCase();return this.fields.filter(o=>!o.hide).map(o=>{const f=o.name.toLowerCase(),m=(o.label||"").toLowerCase(),p=(o.aliases||[]).map(x=>x.toLowerCase());let g=0;return f.startsWith(c)?g=4:m.startsWith(c)||p.some(x=>x.startsWith(c))?g=3:f.includes(c)?g=2:(m.includes(c)||p.some(x=>x.includes(c)))&&(g=1),{field:o,score:g}}).filter(o=>o.score>0).sort((o,f)=>f.score-o.score).slice(0,this.maxSuggestions).map(o=>({text:o.field.name+":",label:o.field.label||o.field.name,description:o.field.description,type:o.field.type,replaceStart:l,replaceEnd:s,matchPartial:a,priority:10}))}getValueSuggestions(a,l,s,c){if(!a)return[];if(a.type==="boolean")return["true","false"].filter(o=>o.startsWith(l.toLowerCase())).map(o=>({text:o,label:o,type:"boolean",replaceStart:s,replaceEnd:c,matchPartial:l}));if(a.placeholder!==!1){const o=a.placeholder||{number:"Enter a number",ip:"Enter an IP address"}[a.type];if(o)return[{text:"",label:o,type:"hint",replaceStart:s,replaceEnd:c}]}return[]}getOperatorSuggestions(a,l,s){const c=a.toLowerCase();return KT.filter(o=>o.toLowerCase().startsWith(c)).map(o=>({text:o+" ",label:o,description:o==="AND"?"Both conditions must match":o==="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=[],c=this.savedSearches.length>0||this.options.hasSavedSearchProvider,o=this.searchHistory.length>0||this.options.hasHistoryProvider;return this.options.showSavedSearchHint&&c&&s.push({text:"#",label:"#saved-search",description:"Type # to use a saved search",type:"hint",replaceStart:a,replaceEnd:l,priority:20}),this.options.showHistoryHint&&o&&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(c=>({text:c.query,label:c.label||c.query,description:c.description,type:"savedSearch",replaceStart:l,replaceEnd:s,matchPartial:a,sourceData:c}))}getHistorySuggestions(a,l,s){return this.searchHistory.slice(0,this.maxSuggestions).map(c=>({text:Y0.wrapHistoryQuery(c.query),label:c.label||c.query,description:c.description,type:"history",replaceStart:l,replaceEnd:s,matchPartial:a,sourceData:c}))}static wrapHistoryQuery(a){try{const l=new ps(new ci(a).tokenize()).parse();if(l&&l.type==="BooleanExpr")return"("+a+")"}catch{}return a}};function mu(t){if(t==="")return null;const a=Number(t);return isNaN(a)?`"${t}" is not a valid number`:null}var eC=[/^\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 tC(t){for(const a of eC)if(a.test(t))return!0;return!isNaN(Date.parse(t))}function _h(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function nC(t){if(/^now$/i.test(t))return new Date;const a=t.match(/^now([+-])(\d+)([dhms])$/i);if(a){const c=new Date,o=a[1]==="+"?1:-1,f=parseInt(a[2],10);switch(a[3].toLowerCase()){case"d":c.setDate(c.getDate()+o*f);break;case"h":c.setHours(c.getHours()+o*f);break;case"m":c.setMinutes(c.getMinutes()+o*f);break;case"s":c.setSeconds(c.getSeconds()+o*f);break}return c}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 Lx(t,a){return new Date(t,a+1,0).getDate()}function aC(t,a){return new Date(t,a,1).getDay()}function xo(t,a){return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()}function zx(t,a,l){if(!a||!l)return!1;const s=t.getTime(),c=a.getTime(),o=l.getTime();return s>=Math.min(c,o)&&s<=Math.max(c,o)}var rC=["January","February","March","April","May","June","July","August","September","October","November","December"];function lC(t){return rC[t]}function pu(t,a){if(t==="")return null;const l=t.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(l){const s=Lh(l[1].trim(),a);if(s)return`Range start: ${s}`;const c=Lh(l[2].trim(),a);return c?`Range end: ${c}`:null}return Lh(t,a)}function Lh(t,a){return/^now(\/[dhms])?$/i.test(t)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(t)||a&&a(t)!==null||tC(t)?null:`"${t}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function gu(t){return t==null?null:typeof t=="string"?{message:t,severity:"error"}:t}var vu={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function yu(t){if(t.length<=1)return t;const a=[...t].sort((s,c)=>{const o=vu[s.type??"SYNTAX_ERROR"],f=vu[c.type??"SYNTAX_ERROR"];return o!==f?o-f:s.start-c.start}),l=[];for(const s of a)l.some(c=>vu[c.type??"SYNTAX_ERROR"]<vu[s.type??"SYNTAX_ERROR"]&&c.start<=s.start&&c.end>=s.end)||l.push(s);return l}var Ux=class{constructor(t){mn(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 c=[],o=s?this.fields.get(s):void 0;return this.walkNode(t,c,a,l,o),this.checkAmbiguousPrecedence(t,c),c}walkNode(t,a,l,s,c){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"}),c&&t.value!==""){let o=null;switch(c.type){case"number":o=mu(t.value);break;case"date":o=pu(t.value,s);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(o=`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("*")&&(o=`"${t.value}" is not a valid IP address`);break}o&&a.push({message:o,start:t.start,end:t.end,field:c.name,type:"INVALID_VALUE"})}if(l&&t.value!==""){const o=gu(l({value:t.value,position:"bare_term",quoted:t.quoted,fieldName:c==null?void 0:c.name,fieldConfig:c}));o&&a.push({message:o.message,start:t.start,end:t.end,severity:o.severity,type:"CUSTOM"})}break;case"Regex":break;case"Range":if(this.validateEmptyRangeBounds(t,a),t.field&&t.field!=="*"){const o=this.fields.get(t.field);o?this.validateRangeBounds(o,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 o=this.fields.get(t.field);if(!o){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(o.type){case"number":f=mu(t.value);break;case"date":f=pu(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!==":"&&o.type!=="number"&&o.type!=="date"&&(f=`Comparison operator "${t.operator}" is not valid for ${o.type} fields`),!f&&l){const m=gu(l({value:t.value,position:"field_value",fieldName:o.name,fieldConfig:o,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!==":"&&o.type!=="number"&&o.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,c);else{const o=this.fields.get(t.field);o?this.walkFieldGroup(t.expression,o,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,c),this.walkNode(t.right,a,l,s,c);break;case"Group":this.walkNode(t.expression,a,l,s,c),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,c);break;case"Error":a.push({message:t.message,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(t,a,l,s,c){switch(t.type){case"BareTerm":if(t.value==="")return;this.validateFieldValue(a,t.value,t.quoted,":",t.start,t.end,l,s,c);break;case"FieldValue":this.walkNode(t,l,s,c);break;case"Range":this.validateRangeBounds(a,t,l,s,c);break;case"BooleanExpr":this.walkFieldGroup(t.left,a,l,s,c),this.walkFieldGroup(t.right,a,l,s,c);break;case"Group":this.walkFieldGroup(t.expression,a,l,s,c);break;case"Not":this.walkFieldGroup(t.expression,a,l,s,c);break;default:this.walkNode(t,l,s,c);break}}validateFieldValue(t,a,l,s,c,o,f,m,p){let g=null;switch(t.type){case"number":g=mu(a);break;case"date":g=pu(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=gu(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:c,end:o,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:c,end:o,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,c){const o=[];a.lower!=="*"&&a.lower.trim()!==""&&o.push({value:a.lower,label:"Range start",start:a.lowerStart,end:a.lowerEnd,position:"range_start",inclusive:a.lowerInclusive}),a.upper!=="*"&&a.upper.trim()!==""&&o.push({value:a.upper,label:"Range end",start:a.upperStart,end:a.upperEnd,position:"range_end",inclusive:a.upperInclusive});for(const f of o){let m=null;switch(t.type){case"number":m=mu(f.value),m&&(m=`${f.label}: ${m}`);break;case"date":m=pu(f.value,c),m&&(m=`${f.label}: ${m}`);break;case"boolean":m="Range queries are not supported for boolean fields";break}if(!m&&s){const p=gu(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,c=[];this.collectBoolOps(t,s,c),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"}),c.forEach(o=>l.add(o))),this.collectLeaves(t).forEach(o=>this.findAndFlagAmbiguity(o,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 Ua(...t){return t.filter(Boolean).join(" ")}function Ko(t){return{...XT,...t}}function Zo(t){return{...QT,...t}}function sC(t,a){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...a}}function iC(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 oC(t){return{borderColor:t.inputFocusBorderColor,boxShadow:t.inputFocusShadow}}function cC(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 G0(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 Bx(t,a,l){return{padding:l.dropdownItemPadding,cursor:"pointer",fontSize:l.dropdownItemFontSize,fontFamily:l.fontFamily,backgroundColor:t?a.dropdownSelected:"transparent",color:t?"#ffffff":a.text,display:"flex",alignItems:"center",gap:l.dropdownItemContentGap,lineHeight:"1.4"}}function ti(t){return{flex:1,fontWeight:500}}function zh(t){return{fontSize:"11px",opacity:.7,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexShrink:1,minWidth:0}}function uC(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 dC(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 fC={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function hC(t){const a=[];let l=0,s="";function c(){s&&(a.push({type:"text",text:s}),s="")}t.startsWith("/")&&(a.push({type:"delimiter",text:"/"}),l=1);const o=t.lastIndexOf("/"),f=o>0?o:t.length;for(;l<f;){const m=t[l];if(m==="\\"&&l+1<f){c(),a.push({type:"escape",text:t.slice(l,l+2)}),l+=2;continue}if(m==="["){c();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==="("){c();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===")"){c(),a.push({type:"groupClose",text:")"}),l++;continue}if(m==="+"||m==="*"||m==="?"){c();let p=m;l+1<f&&t[l+1]==="?"&&(p+="?"),a.push({type:"quantifier",text:p}),l+=p.length;continue}if(m==="{"){c();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==="$"){c(),a.push({type:"anchor",text:m}),l++;continue}if(m==="|"){c(),a.push({type:"alternation",text:"|"}),l++;continue}s+=m,l++}return c(),o>0&&o<t.length&&a.push({type:"delimiter",text:"/"}),a}function mC(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function pC(t,a,l){const s=hC(t.value).map(c=>{const o=a[fC[c.type]]||a.regexText,f=c.type==="delimiter"?"600":"normal";return`<span class="ei-regex-part ei-regex-part--${c.type}" style="color:${o};font-weight:${f}">${mC(c.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 gC={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function vC(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,c=s>=0&&(t[s]==="]"||t[s]==="}"),o=c?s:t.length;for(;l<o;){const f=t[l];if(f===" "||f===" "){let p=l;for(;p<o&&(t[p]===" "||t[p]===" ");)p++;a.push({type:"whitespace",text:t.slice(l,p)}),l=p;continue}if((f==="T"||f==="t")&&l+1<o&&(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>=o||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<o&&t[p]!=='"';)t[p]==="\\"&&p+1<o&&p++,p++;p<o&&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<o&&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 c&&a.push({type:"bracket",text:t[s]}),a}function Hx(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function yC(t,a,l){const s=vC(t.value).map(c=>{if(c.type==="whitespace")return Hx(c.text);const o=a[gC[c.type]]||a.fieldValue,f=c.type==="toKeyword"||c.type==="bracket"?"600":"normal";return`<span class="ei-range-part ei-range-part--${c.type}" style="color:${o};font-weight:${f}">${Hx(c.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 X0(t,a){if(a<0)return null;const l=t.filter(o=>o.type===O.LPAREN||o.type===O.RPAREN);if(l.length===0)return null;const s=l.find(o=>o.end===a);if(s){const o=$x(l,s);if(o)return o}const c=l.find(o=>o.start===a);if(c){const o=$x(l,c);if(o)return o}return null}function $x(t,a){if(a.type===O.LPAREN){const l=t.indexOf(a);let s=0;for(let c=l;c<t.length;c++)if(t[c].type===O.LPAREN?s++:t[c].type===O.RPAREN&&s--,s===0)return{openStart:a.start,closeStart:t[c].start}}else{const l=t.indexOf(a);let s=0;for(let c=l;c>=0;c--)if(t[c].type===O.RPAREN?s++:t[c].type===O.LPAREN&&s--,s===0)return{openStart:t[c].start,closeStart:a.start}}return null}var xC={[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"},bC={[O.FIELD_NAME]:"fieldName",[O.COLON]:"operator",[O.VALUE]:"fieldValue",[O.QUOTED_VALUE]:"quoted",[O.AND]:"booleanOp",[O.OR]:"booleanOp",[O.NOT]:"booleanOp",[O.COMPARISON_OP]:"operator",[O.LPAREN]:"paren",[O.RPAREN]:"paren",[O.SAVED_SEARCH]:"savedSearch",[O.HISTORY_REF]:"historyRef",[O.PREFIX_OP]:"operator",[O.WILDCARD]:"wildcard",[O.REGEX]:"quoted",[O.RANGE]:"fieldValue",[O.TILDE]:"operator",[O.BOOST]:"operator",[O.WHITESPACE]:"text",[O.UNKNOWN]:"error"};function ni(t,a,l){const s=Ko(a);if(t.length===0)return"";const c=(l==null?void 0:l.cursorOffset)!==void 0?X0(t,l.cursorOffset):null,o=a==null?void 0:a.valueTypes,f=l==null?void 0:l.fieldTypeMap;let m;if(o&&f){m=new Array(t.length);let g,x=!1;const y=[];for(let N=0;N<t.length;N++){const w=t[N];w.type===O.FIELD_NAME?(g=w.value,x=!1):w.type===O.COLON&&g?x=!0:w.type===O.WHITESPACE||(w.type===O.LPAREN?(x&&g?y.push(f.get(g.toLowerCase())):y.push(void 0),g=void 0,x=!1):w.type===O.RPAREN?(y.pop(),g=void 0,x=!1):w.type===O.VALUE||w.type===O.QUOTED_VALUE||w.type===O.RANGE||w.type===O.REGEX||w.type===O.WILDCARD?(x&&g?m[N]=f.get(g.toLowerCase()):y.length>0&&(m[N]=y[y.length-1]),g=void 0,x=!1):(w.type===O.AND||w.type===O.OR||(w.type,O.NOT),g=void 0,x=!1))}}let p=t.map((g,x)=>{let y=s[bC[g.type]||"text"]||s.text;if(o&&m){const j=m[x];j&&o[j]&&(y=o[j])}const N=SC(g.value);if(g.type===O.WHITESPACE)return N.replace(/\n/g,"<br>");if(g.type===O.REGEX)return pC(g,s,l==null?void 0:l.tokenClassName);if(g.type===O.RANGE)return yC(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 c&&(g.type===O.LPAREN||g.type===O.RPAREN)&&(g.start===c.openStart||g.start===c.closeStart)&&(w="700",S=`background-color:${s.matchedParenBg};border-radius:2px;`),`<span class="${`ei-token ei-token--${xC[g.type]}${l!=null&&l.tokenClassName?" "+l.tokenClassName:""}`}" style="color:${y};font-weight:${w};${S}" data-token-start="${g.start}" data-token-end="${g.end}">${N}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function SC(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}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 qx(t,a,l){if(!a||a.length===0)return t;const s=t.toLowerCase(),c=a.toLowerCase(),o=s.indexOf(c);if(o===-1)return t;const f=t.slice(0,o),m=t.slice(o,o+a.length),p=t.slice(o+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 wC({suggestions:t,selectedIndex:a,onSelect:l,position:s,colors:c,styles:o,visible:f,fixedWidth:m,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:x,cursorContext:y,listRefCallback:N,renderType:w,classNames:S}){const j=v.useRef(null),R=v.useRef(null);v.useEffect(()=>{const M=document.createElement("div");return document.body.appendChild(M),j.current=M,()=>{document.body.removeChild(M),j.current=null}},[]);const z=x&&y?x(y):null,I=z!=null;if(v.useEffect(()=>{if(R.current){const M=I?a+1:a,C=R.current.children[M];C&&C.scrollIntoView({block:"nearest"})}},[a,I]),!j.current||!f||t.length===0||!s)return null;const q=Ko(c),X=Zo(o),ee={...G0(q,X),top:`${s.top}px`,left:`${s.left}px`,...m!=null?{width:`${m}px`,minWidth:"unset",maxWidth:"unset"}:{}},ne=v.createElement("div",{className:Ua("ei-dropdown",S==null?void 0:S.dropdown),style:ee,ref:M=>{R.current=M,N==null||N(M)},onMouseDown:M=>M.preventDefault()},I&&v.createElement("div",{className:Ua("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"}},z),t.map((M,C)=>{const ue=C===a,me=Bx(ue,q,X),ye=(U,B,oe)=>({key:C,className:Ua("ei-dropdown-item",U,ue&&"ei-dropdown-item--selected",S==null?void 0:S.dropdownItem),style:{...me,...B},title:oe,onClick:()=>l(M),onMouseEnter:de=>{de.currentTarget.style.backgroundColor=ue?q.dropdownSelected:q.dropdownHover},onMouseLeave:de=>{de.currentTarget.style.backgroundColor=ue?q.dropdownSelected:"transparent"}}),ae=U=>{if(w===!1||!M.type||M.type==="hint")return null;const B=typeof w=="function"?w(M.type,{text:M.text,label:M.label,description:M.description,type:M.type}):M.type;return B!=null?v.createElement("span",{className:"ei-dropdown-item-type",style:{...uC(ue,X),...U}},B):null},K={flexDirection:"column",alignItems:"flex-start"},ge={display:"flex",alignItems:"center",gap:X.dropdownItemContentGap,width:"100%"};if(M.type==="hint"&&(M.text==="#"||M.text==="!"))return v.createElement("div",{...ye("ei-dropdown-item--hint",{opacity:ue?1:.7}),onMouseEnter:U=>{U.currentTarget.style.backgroundColor=ue?q.dropdownSelected:q.dropdownHover,U.currentTarget.style.opacity="1"},onMouseLeave:U=>{U.currentTarget.style.backgroundColor=ue?q.dropdownSelected:"transparent",U.currentTarget.style.opacity=ue?"1":"0.7"}},v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},M.label),M.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:zh()},M.description));if(M.type==="error")return v.createElement("div",{key:C,className:Ua("ei-dropdown-item","ei-dropdown-item--error",S==null?void 0:S.dropdownItem),style:{...me,cursor:"default",opacity:.8}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),color:q.error}},M.label||"Error loading suggestions"));if(M.type==="noResults")return v.createElement("div",{key:C,className:Ua("ei-dropdown-item","ei-dropdown-item--no-results",S==null?void 0:S.dropdownItem),style:{...me,cursor:"default",opacity:.7}},M.customContent);if(M.type==="loading")return v.createElement("div",{key:C,className:Ua("ei-dropdown-item","ei-dropdown-item--loading",S==null?void 0:S.dropdownItem),style:{...me,cursor:"default",opacity:.6,justifyContent:"center"}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),fontStyle:"italic"}},M.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(M.type==="hint"){const U=Bx(!1,q,X);return v.createElement("div",{key:C,className:Ua("ei-dropdown-item","ei-dropdown-item--hint",S==null?void 0:S.dropdownItem),style:{...U,cursor:"default",opacity:M.customContent?1:.6}},M.customContent?M.customContent:v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},M.label))}if(M.type==="history"&&p&&M.sourceData){const U=p(M.sourceData,ue);if(U!=null)return v.createElement("div",ye("ei-dropdown-item--history",K),U)}if(M.type==="savedSearch"&&g&&M.sourceData){const U=g(M.sourceData,ue);if(U!=null)return v.createElement("div",ye("ei-dropdown-item--saved-search"),U)}if((M.type==="history"||M.type==="savedSearch")&&M.description!=null){const U=M.type==="history"?"ei-dropdown-item--history":"ei-dropdown-item--saved-search";let B;const oe=M.text.startsWith("(")&&M.text.endsWith(")")?M.text.slice(1,-1):M.text;return M.label!==oe&&(B=M.text),v.createElement("div",ye(U,K,B),v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},qx(M.label,M.matchPartial,ue)),v.createElement("span",{style:ge},v.createElement("span",{className:"ei-dropdown-item-desc",style:{...zh(),flex:1}},M.description),ae({marginLeft:"auto"})))}const be=M.type==="savedSearch"?"ei-dropdown-item--saved-search":void 0;return v.createElement("div",ye(be),v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},qx(M.label,M.matchPartial,ue)),M.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:zh()},M.description),ae())}));return al.createPortal(ne,j.current)}var EC=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Uh(t){return Math.floor(t/10)*10}function NC({onSelect:t,colors:a,styles:l,initialMode:s,initialStart:c,initialEnd:o,presets:f,className:m}){const p=s==="range"&&o?o:c??new Date,[g,x]=v.useState(s??"single"),[y,N]=v.useState("days"),[w,S]=v.useState(p.getFullYear()),[j,R]=v.useState(p.getMonth()),[z,I]=v.useState(c??null),[q,X]=v.useState(o??null),[ee,ne]=v.useState(null),M=Ko(a),C=dC(M,Zo(l)),ue=()=>{y==="days"?j===0?(R(11),S(ie=>ie-1)):R(ie=>ie-1):S(y==="months"?ie=>ie-1:ie=>ie-10)},me=()=>{y==="days"?j===11?(R(0),S(ie=>ie+1)):R(ie=>ie+1):S(y==="months"?ie=>ie+1:ie=>ie+10)},ye=()=>{S(y==="days"?ie=>ie-1:y==="months"?ie=>ie-10:ie=>ie-100)},ae=()=>{S(y==="days"?ie=>ie+1:y==="months"?ie=>ie+10:ie=>ie+100)},K=()=>{y==="days"?N("months"):y==="months"&&N("years")},ge=ie=>{R(ie),N("days")},be=ie=>{S(ie),N("months")},U=ie=>{if(g==="single"){t(_h(ie));return}if(!z||q)I(ie),X(null),ne(null);else{const[$e,at]=z<=ie?[z,ie]:[ie,z];I($e),X(at),ne(null),t(`[${_h($e)} TO ${_h(at)}]`)}},B=z&&!q?ee:q,oe=ie=>{x(ie),I(null),X(null),ne(null)},de=y==="days"?`${lC(j)} ${w}`:y==="months"?`${w}`:`${Uh(w)}–${Uh(w)+9}`,we=y!=="years",D=new Date,P=Lx(w,j),te=aC(w,j),he=["Su","Mo","Tu","We","Th","Fr","Sa"],Ne=[],je=(ie,$e,at)=>{const Ut=xo(ie,D),gn=z&&xo(ie,z),jt=B&&xo(ie,B),_t=zx(ie,z,B),Qt=gn||jt,Hn={...C.day,...at?C.dayOtherMonth:{},...Ut?C.dayToday:{},..._t?C.dayInRange:{},...Qt?C.daySelected:{}},$n=g==="range"&&z&&!q;return v.createElement("button",{key:$e,className:"ei-datepicker-day",style:Hn,onClick:()=>U(ie),onMouseEnter:tn=>{$n?ne(ie):Qt||(tn.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:tn=>{!$n&&!Qt&&(tn.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},ie.getDate())};if(te>0){const ie=Lx(w,j-1);for(let $e=te-1;$e>=0;$e--){const at=ie-$e,Ut=new Date(w,j-1,at);Ne.push(je(Ut,`prev${at}`,!0))}}for(let ie=1;ie<=P;ie++){const $e=new Date(w,j,ie);Ne.push(je($e,String(ie),!1))}const ze=Ne.length%7;if(ze>0){const ie=7-ze;for(let $e=1;$e<=ie;$e++){const at=new Date(w,j+1,$e);Ne.push(je(at,`next${$e}`,!0))}}const ct={...C.day,padding:"10px 4px",fontSize:"13px"},Ge={...ct,...C.dayToday},nt=f??[{label:"Today",value:"[now/d TO now]",type:"range"},{label:"Yesterday",value:"[now-1d/d TO now/d]",type:"range"},{label:"Last 7 days",value:"[now-7d TO now]",type:"range"},{label:"Last 30 days",value:"[now-30d TO now]",type:"range"},{label:"Last 90 days",value:"[now-90d TO now]",type:"range"},{label:"Last 1 year",value:"[now-365d TO now]",type:"range"}],Sn={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},Xt=ie=>{ie.currentTarget.style.backgroundColor="#eef1f5"},ft=ie=>{ie.currentTarget.style.backgroundColor="transparent"};return v.createElement("div",{className:Ua("ei-datepicker",m),style:C.container,onMouseDown:ie=>ie.preventDefault(),onMouseLeave:()=>ne(null)},v.createElement("div",{className:"ei-datepicker-toggle",style:C.rangeToggle},["single","range"].map(ie=>v.createElement("button",{key:ie,style:{...C.rangeToggleButton,...g===ie?C.rangeToggleButtonActive:{}},onClick:()=>oe(ie)},ie.charAt(0).toUpperCase()+ie.slice(1)))),v.createElement("div",{className:"ei-datepicker-header",style:C.header},v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:C.navButton,onClick:ye,onMouseEnter:Xt,onMouseLeave:ft},"«"),v.createElement("button",{style:C.navButton,onClick:ue,onMouseEnter:Xt,onMouseLeave:ft},"‹")),v.createElement("button",{style:{...C.monthLabel,backgroundColor:"transparent",border:"none",cursor:we?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:we?K:void 0,onMouseEnter:ie=>{we&&(ie.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:ie=>{ie.currentTarget.style.backgroundColor="transparent"}},de),v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:C.navButton,onClick:me,onMouseEnter:Xt,onMouseLeave:ft},"›"),v.createElement("button",{style:C.navButton,onClick:ae,onMouseEnter:Xt,onMouseLeave:ft},"»"))),y==="days"&&v.createElement(v.Fragment,null,v.createElement("div",{style:C.weekDays},he.map(ie=>v.createElement("div",{key:ie,style:C.weekDay},ie))),v.createElement("div",{className:"ei-datepicker-days",style:C.days},Ne)),y==="months"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},EC.map((ie,$e)=>{const at=new Date(w,$e,1),Ut=zx(at,z,B),gn=z&&xo(new Date(z.getFullYear(),z.getMonth(),1),at)||B&&xo(new Date(B.getFullYear(),B.getMonth(),1),at),jt=$e===D.getMonth()&&w===D.getFullYear(),_t=g==="range"&&z&&!q;return v.createElement("button",{key:ie,style:{...jt?Ge:ct,...Ut?C.dayInRange:{},...gn?C.daySelected:{}},onClick:()=>ge($e),onMouseEnter:Qt=>{_t?ne(at):gn||(Qt.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:Qt=>{!_t&&!gn&&(Qt.currentTarget.style.backgroundColor=Ut?"rgba(9, 105, 218, 0.1)":"transparent")}},ie)})),y==="years"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(ie,$e)=>{const at=Uh(w)-1+$e,Ut=$e===0||$e===11,gn=at===D.getFullYear(),jt=new Date(at,0,1),_t=z&&B&&at>=Math.min(z.getFullYear(),B.getFullYear())&&at<=Math.max(z.getFullYear(),B.getFullYear()),Qt=z&&z.getFullYear()===at||B&&B.getFullYear()===at,Hn=g==="range"&&z&&!q;return v.createElement("button",{key:at,style:{...gn?Ge:ct,...Ut?C.dayOtherMonth:{},..._t?C.dayInRange:{},...Qt?C.daySelected:{}},onClick:()=>be(at),onMouseEnter:$n=>{Hn?ne(jt):Qt||($n.currentTarget.style.backgroundColor=M.dropdownHover)},onMouseLeave:$n=>{!Hn&&!Qt&&($n.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},at)})),(()=>{const ie=nt.filter($e=>!$e.type||$e.type===g);return ie.length>0&&v.createElement("div",{className:"ei-datepicker-presets",style:{...C.quickOptions,...Sn}},ie.map($e=>v.createElement("button",{key:`${$e.type??"both"}-${$e.value}`,style:C.quickOption,onClick:()=>t($e.value)},$e.label)))})())}var RC=30,jC=150;function Ix(t,a){let l=0;const s=c=>{if(c.nodeType===Node.TEXT_NODE){const o=(c.textContent||"").length;return l+o>=a?{node:c,offset:a-l}:(l+=o,null)}if(c.nodeName==="BR"){if(l+1>=a){const o=c.parentNode;if(o)return{node:o,offset:Array.from(o.childNodes).indexOf(c)+1}}return l+=1,null}for(let o=0;o<c.childNodes.length;o++){const f=s(c.childNodes[o]);if(f)return f}return null};return s(t)}function TC(t,a,l){const s=Ix(t,a),c=Ix(t,l);if(!s||!c)return[];const o=document.createRange();o.setStart(s.node,s.offset),o.setEnd(c.node,c.offset);const f=t.getBoundingClientRect(),m=o.getClientRects();if(m.length===0)return[];const p=[];for(let g=0;g<m.length;g++){const x=m[g];x.width<1||p.push({left:x.left-f.left,top:x.top-f.top,width:Math.max(x.width,6),height:x.height})}return p}function CC(t,a,l){if(!a||t.length===0)return[];const s=[];let c=0;for(const o of t){if(c>=RC)break;if(l>=o.start&&l<=o.end)continue;const f=TC(a,o.start,o.end);for(const m of f)s.push({left:m.left,top:m.top,width:m.width,height:m.height,error:o});c++}return s}var Px=28,Vx=4;function DC(t){return`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath d='M0 2 Q2 0 4 2 Q6 4 8 2' stroke='${t.replace("#","%23")}' fill='none' stroke-width='0.8'/%3E%3C/svg%3E")`}function AC({errors:t,editorRef:a,cursorOffset:l,colors:s,styles:c,containerRef:o,classNames:f}){const[m,p]=v.useState(null),[g,x]=v.useState({x:0,clientY:0}),[y,N]=v.useState([]),w=v.useRef([]),S=v.useRef(null),j=v.useRef(null);if(v.useEffect(()=>{if(j.current&&clearTimeout(j.current),t.length===0){N([]),w.current=[],p(null);return}return j.current=setTimeout(()=>{const q=CC(t,a,l);N(q),w.current=q},jC),()=>{j.current&&clearTimeout(j.current)}},[t,a,l]),v.useEffect(()=>{const q=o;if(!q||!a)return;const X=M=>{const C=a.getBoundingClientRect(),ue=M.clientX-C.left,me=M.clientY-C.top;let ye=-1;for(let ae=0;ae<w.current.length;ae++){const K=w.current[ae];if(ue>=K.left&&ue<=K.left+K.width&&me>=K.top&&me<=K.top+K.height+6){ye=ae;break}}ye>=0?(p(ye),x({x:ue,clientY:M.clientY})):p(null)},ee=()=>{p(null)},ne=new AbortController;return q.addEventListener("mousemove",X,{signal:ne.signal}),q.addEventListener("mouseleave",ee,{signal:ne.signal}),()=>ne.abort()},[o,a]),v.useEffect(()=>{const q=S.current;if(!q||m==null)return;const X=q.getBoundingClientRect();if(X.right>window.innerWidth-8){const ee=X.right-window.innerWidth+8;q.style.transform=`translateX(-${ee}px)`}else q.style.transform=""}),y.length===0)return null;const R=Ko(s),z=Zo(c),I=m!=null?y[m]:null;return v.createElement(v.Fragment,null,y.map((q,X)=>{const ee=q.error.severity==="warning",ne=DC(ee?R.warning:R.error),M=q.top+q.height-2;return v.createElement("div",{key:`wave-${X}`,className:Ua("ei-squiggly",ee?"ei-squiggly--warning":"ei-squiggly--error",f==null?void 0:f.squiggly),style:{position:"absolute",left:`${q.left}px`,top:`${M}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(),ee=((X==null?void 0:X.left)??0)+g.x,ne=((X==null?void 0:X.top)??0)+I.top+I.height+2,M=((X==null?void 0:X.top)??0)+I.top,C=window.innerHeight-g.clientY<Px+20?M-Px-Vx:ne+Vx;return al.createPortal(v.createElement("div",{ref:S,className:Ua("ei-tooltip",f==null?void 0:f.tooltip),style:{position:"fixed",top:`${C}px`,left:`${ee}px`,zIndex:z.dropdownZIndex,backgroundColor:R.background,color:q,border:`1px solid ${q}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",fontFamily:z.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 zo(t,a,l){let s=0,c=!1;function o(f){var m;if(c)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(o(f.childNodes[p]))return!0;return c=!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(o(f.childNodes[p]))return!0;return!1}return o(t),s}function Ll(t){const a=window.getSelection();if(!a||a.rangeCount===0)return 0;const l=a.getRangeAt(0);return zo(t,l.startContainer,l.startOffset)}function jr(t){const a=window.getSelection();if(!a||a.rangeCount===0)return{start:0,end:0};const l=a.getRangeAt(0);return{start:zo(t,l.startContainer,l.startOffset),end:zo(t,l.endContainer,l.endOffset)}}function nl(t,a){const l=window.getSelection();if(!l)return;const s=nm(t,a);if(!s)return;const c=document.createRange();c.setStart(s.node,s.offset),c.collapse(!0),l.removeAllRanges(),l.addRange(c)}function tl(t,a,l){if(a===l){nl(t,a);return}const s=window.getSelection();if(!s)return;const c=nm(t,a),o=nm(t,l);if(!c||!o)return;const f=document.createRange();f.setStart(c.node,c.offset),f.setEnd(o.node,o.offset),s.removeAllRanges(),s.addRange(f)}function nm(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 c=s(t);if(c)return c;const o=Q0(t);return o?{node:o,offset:(o.textContent||"").length}:{node:t,offset:0}}function Q0(t){if(t.nodeType===Node.TEXT_NODE)return t;for(let a=t.childNodes.length-1;a>=0;a--){const l=Q0(t.childNodes[a]);if(l)return l}return null}function kC(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 OC(){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 xu(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 c=t.getBoundingClientRect(),o=s.top-c.top+t.scrollTop,f=s.bottom-c.top+t.scrollTop;f>t.scrollTop+t.clientHeight?t.scrollTop=f-t.clientHeight:o<t.scrollTop&&(t.scrollTop=o)}function Bh(){var s,c;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 o=document.createElement("span");o.textContent="",a.insertNode(o);const f=o.getBoundingClientRect();return(c=o.parentNode)==null||c.removeChild(o),t.removeAllRanges(),t.addRange(a),f}return l}function Fx(t,a){return Math.min(t,a)}function Hh(t,a,l){const s=window.innerHeight,c=window.innerWidth;let o=t.bottom+window.scrollY+4,f=t.left+window.scrollX;return t.bottom+a+4>s&&(o=t.top+window.scrollY-a-4),f+l>c&&(f=c-l-8),f<8&&(f=8),{top:o,left:f}}var MC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD]);function _C(t,a,l){for(const s of t)if(a>=s.start&&a<=s.end&&MC.has(s.type))return a===s.start&&l===s.end?null:{start:s.start,end:s.end};return null}var LC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD,O.FIELD_NAME,O.RANGE,O.SAVED_SEARCH,O.HISTORY_REF,O.REGEX]);function zC(t,a,l){const s=[];for(const c of a)if(l>=c.start&&l<=c.end&&LC.has(c.type)){s.push({start:c.start,end:c.end});break}return t&&ju(t,l,s),UC(s)}function ju(t,a,l){if(a<t.start||a>t.end)return!1;let s=!1;switch(t.type){case"BooleanExpr":s=ju(t.left,a,l)||s,s=ju(t.right,a,l)||s;break;case"Group":case"Not":case"FieldGroup":s=ju(t.expression,a,l)||s;break}return l.push({start:t.start,end:t.end}),!0}function UC(t){t.sort((l,s)=>l.end-l.start-(s.end-s.start)||l.start-s.start);const a=[];for(const l of t){const s=a[a.length-1];s&&s.start===l.start&&s.end===l.end||a.push(l)}return a}var BC=60,HC=" ";function $C(t,a){const l=(a==null?void 0:a.maxLineLength)??BC,s=(a==null?void 0:a.indent)??HC,c={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 o;return typeof t=="string"?o=new ps(new ci(t,{savedSearches:!0,historySearch:!0}).tokenize()).parse():o=t,o?Cu(o,0,l,s,c):""}function qC(t,a){return t.implicit?a.whitespace??"":t.operator==="AND"?a.and??t.sourceOperator??"AND":a.or??t.sourceOperator??"OR"}function K0(t,a){const l=a.not??t.sourceOperator??"NOT";return{op:l,sep:/^[a-zA-Z]/.test(l)?" ":""}}function Cr(t,a){switch(t.type){case"FieldValue":{const l=t.quoted?`"${t.value}"`:t.value,s=t.operator===":"?":":`:${t.operator}`;let c=`${t.field}${s}${l}`;return t.fuzzy!=null&&(c+=`~${t.fuzzy}`),t.proximity!=null&&(c+=`~${t.proximity}`),t.boost!=null&&(c+=`^${t.boost}`),c}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?"]":"}",c=`${l}${t.lowerQuoted?`"${t.lower}"`:t.lower} TO ${t.upperQuoted?`"${t.upper}"`:t.upper}${s}`;return t.field?`${t.field}:${c}`:c}case"Regex":return`/${t.pattern}/`;case"SavedSearch":return`#${t.name}`;case"HistoryRef":return`!${t.ref}`;case"Not":{const{op:l,sep:s}=K0(t,a);return`${l}${s}${Cr(t.expression,a)}`}case"Group":{let l=`(${Cr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"FieldGroup":{let l=`${t.field}:(${Cr(t.expression,a)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"BooleanExpr":{const l=qC(t,a),s=l?` ${l} `:" ";return`${Cr(t.left,a)}${s}${Cr(t.right,a)}`}case"Error":return t.value}}function IC(t){const a=t.operator,l=!!t.implicit,s=[],c=o=>{o.type==="BooleanExpr"&&o.operator===a&&!!o.implicit===l?(c(o.left),c(o.right)):s.push(o)};return c(t),{operator:a,implicit:l,sourceOperator:t.sourceOperator,operands:s}}function Tu(t){return t.type==="Group"||t.type==="FieldGroup"?!0:t.type==="BooleanExpr"?Tu(t.left)||Tu(t.right):t.type==="Not"?Tu(t.expression):!1}var PC={and:"AND",or:"OR",not:"NOT"};function VC(t,a){return!!(Cr(t,PC).length>a||Tu(t))}function Cu(t,a,l,s,c){const o=s.repeat(a);switch(t.type){case"BooleanExpr":{const{operator:f,implicit:m,sourceOperator:p,operands:g}=IC(t),x=m?c.whitespace??"":f==="AND"?c.and??p??"AND":c.or??p??"OR",y=x?` ${x} `:" ",N=g.map(w=>Cr(w,c)).join(y);return N.length<=l?N:g.map((w,S)=>{const j=Cu(w,a,l,s,c);return S===0?j:x?`${o}${x} ${j}`:`${o}${j}`}).join(`
|
|
288
|
+
`)}case"Group":{if(!VC(t.expression,l)){let m=`(${Cr(t.expression,c)})`;return t.boost!=null&&(m+=`^${t.boost}`),m}let f=`(
|
|
289
|
+
${FC(Cu(t.expression,a+1,l,s,c),a+1,s)}
|
|
290
|
+
${o})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"FieldGroup":{let f=`${t.field}:(${Cr(t.expression,c)})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"Not":{const{op:f,sep:m}=K0(t,c);return`${f}${m}${Cu(t.expression,a,l,s,c)}`}default:return Cr(t,c)}}function FC(t,a,l){const s=l.repeat(a);return t.split(`
|
|
291
|
+
`).map(c=>c.startsWith(s)?c:s+c).join(`
|
|
292
|
+
`)}function YC(t){return t?ko(t):[]}function Yx(t){return t.type==="BooleanExpr"}function ko(t){switch(t.type){case"BooleanExpr":return am(t);case"Group":{const a=[],l=t.expression;return Yx(l)?(a.push({start:t.start,end:t.end}),a.push(...ko(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 Yx(l)&&a.push(...ko(l)),a}case"Not":{const a=[];return a.push({start:t.start,end:t.end}),a.push(...ko(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 am(t){return t.type==="BooleanExpr"?[...am(t.left),...am(t.right)]:ko(t)}function GC(t,a,l,s){if(t.length===0)return null;if(a>=0&&a<t.length){const c=s==="forward"?a+1:a-1;return c>=0&&c<t.length?{stop:t[c],index:c}:null}if(s==="forward"){for(let c=0;c<t.length;c++)if(t[c].start>=l)return{stop:t[c],index:c};return{stop:t[t.length-1],index:t.length-1}}else{for(let c=t.length-1;c>=0;c--)if(t[c].end<=l)return{stop:t[c],index:c};return{stop:t[0],index:0}}}var XC=class{constructor(t=100){mn(this,"stack",[]);mn(this,"index",-1);mn(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 QC(t,a){const l=s=>(a==null?void 0:a(s))??nC(s);if(t.type==="RANGE"&&t.token){const s=t.token.value,c=(s.endsWith("]")||s.endsWith("}")?s.slice(1,-1):s.slice(1)).match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/);if(c)return{mode:"range",start:l(c[1].trim()),end:l(c[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 KC(t,a){var l,s,c,o;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:(((c=t==null?void 0:t.end)==null?void 0:c.getTime())??0)!==(((o=a==null?void 0:a.end)==null?void 0:o.getTime())??0)}function ZC({position:t,colors:a,onSelect:l,colorConfig:s,styleConfig:c,datePickerInit:o,fixedWidth:f,datePresets:m,datePickerClassName:p}){const g=v.useRef(null),[x,y]=v.useState(!1);if(v.useEffect(()=>{const S=document.createElement("div");return document.body.appendChild(S),g.current=S,y(!0),()=>{document.body.removeChild(S),g.current=null}},[]),!x||!g.current)return null;const N=Zo(c),w={position:"absolute",zIndex:N.dropdownZIndex,...G0(a,N),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(NC,{onSelect:l,colors:s,styles:c,initialMode:o==null?void 0:o.mode,initialStart:o==null?void 0:o.start,initialEnd:o==null?void 0:o.end,presets:m,className:p})),g.current)}function JC(t){const{fields:a,onSearch:l,onChange:s,onValidationChange:c,value:o,defaultValue:f,savedSearches:m,searchHistory:p,fetchSuggestions:g,colors:x,styles:y,placeholder:N,className:w,classNames:S,style:j,dropdown:R,features:z,inputRef:I,datePresets:q,onKeyDown:X,onFocus:ee,onBlur:ne,onTab:M,validateValue:C,parseDate:ue,plainModeLength:me,interceptPaste:ye,defaultField:ae,trailingSpaceOnAccept:K=!0,collapseOnBlur:ge=!1}=t,be=typeof ae=="string"?{name:ae,showFieldSuggestions:!1}:ae?{showFieldSuggestions:!1,...ae}:void 0,U=be==null?void 0:be.name,B=(R==null?void 0:R.open)??(R==null?void 0:R.mode)??"always",oe=typeof B=="function",de=oe?null:B,we=(R==null?void 0:R.alignToInput)??!1,D=R==null?void 0:R.maxSuggestions,P=D||10,te=R==null?void 0:R.suggestDebounceMs,he=parseInt((y==null?void 0:y.dropdownMaxHeight)||"300",10)||300,Ne=(z==null?void 0:z.savedSearches)??!!m,je=(z==null?void 0:z.historySearch)??!!p,ze=(R==null?void 0:R.showSavedSearchHint)??Ne,ct=(R==null?void 0:R.showHistoryHint)??je,Ge=(R==null?void 0:R.showOperators)!==!1,nt=(oe||de!=="input")&&(R==null?void 0:R.onNavigation)!==!1,Sn=(R==null?void 0:R.navigationDelay)??0,Xt=(R==null?void 0:R.loadingDelay)??0,ft=R==null?void 0:R.renderFieldHint,ie=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,gn=R==null?void 0:R.renderType,jt=(R==null?void 0:R.autoSelect)??!1,_t=(R==null?void 0:R.homeEndKeys)??!1,Qt=(z==null?void 0:z.multiline)!==!1,Hn=(z==null?void 0:z.smartSelectAll)??!1,$n=(z==null?void 0:z.expandSelection)??!1,tn=(z==null?void 0:z.wildcardWrap)??!1,fa=(z==null?void 0:z.clauseNavigation)??!1,ha=z==null?void 0:z.formatQuery,Wn=!!ha,qn=typeof ha=="object"?ha:void 0,fe=v.useMemo(()=>({savedSearches:Ne,historySearch:je}),[Ne,je]),Ce=Array.isArray(a)?a:[],[De,Ye]=v.useState(Ce);v.useEffect(()=>{if(Array.isArray(a)){Ye(a);return}let T=!1;return a().then(Y=>{T||Ye(Y)}),()=>{T=!0}},[a]);const qe=v.useMemo(()=>{const T=new Map;for(const Y of De)if(T.set(Y.name.toLowerCase(),Y.type),Y.aliases)for(const Ee of Y.aliases)T.set(Ee.toLowerCase(),Y.type);return T},[De]),J=v.useRef(null),[Tt,Kt]=v.useState(null),Vn=v.useCallback(T=>{J.current=T,Kt(T)},[]),vn=v.useRef(null),qa=v.useRef(null),Me=v.useRef(o||f||""),vt=v.useRef(null),yt=v.useRef(!1),wt=v.useRef(!1),Bt=v.useRef(new XC),Ct=v.useRef(null),nn=v.useRef(new Set),Zt=v.useRef(null),Ht=v.useRef(null),ht=v.useRef(null),Je=v.useRef(null),wn=v.useRef(!1),kn=v.useRef(null),A=v.useRef(null),_=v.useRef(null),$=v.useRef("input"),Z=v.useRef(null),le=v.useRef(-1),Te=v.useRef(()=>{}),ve=v.useRef(new Mh(Ce,[],[],D||10,{showSavedSearchHint:ze,showHistoryHint:ct,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}));ve.current.setDefaultField(be);const Ae=v.useRef(new Ux(Ce)),Re=v.useRef(C);Re.current=C;const[_e,Ue]=v.useState([]),[Xe,ke]=v.useState(null),[Ze,Ie]=v.useState([]),[$t,We]=v.useState(-1),[ut,it]=v.useState(!1),[dt,Jt]=v.useState(!1),[Fn,En]=v.useState(null),[On,Mn]=v.useState([]),[Yn,ga]=v.useState(!1),[ul,ea]=v.useState(!Me.current),[gr,Qe]=v.useState(me!=null&&Me.current.length>=me),[Nt,Wt]=v.useState(0),[ta,_n]=v.useState(0),[Or,Rt]=v.useState(""),[Ta,Gn]=v.useState(null),[Yl,Si]=v.useState(null),Dt=v.useRef({tokens:_e,ast:Xe,suggestions:Ze,selectedSuggestionIndex:$t,showDropdown:ut,showDatePicker:dt,cursorOffset:Nt,selectionEnd:ta,autocompleteContext:Or,validationErrors:On,cursorContext:Ta});Dt.current={tokens:_e,ast:Xe,suggestions:Ze,selectedSuggestionIndex:$t,showDropdown:ut,showDatePicker:dt,cursorOffset:Nt,selectionEnd:ta,autocompleteContext:Or,validationErrors:On,cursorContext:Ta};const vr=v.useCallback((T,Y)=>{if(we&&vn.current){const xe=vn.current.getBoundingClientRect();return{top:xe.bottom+window.scrollY+4,left:xe.left+window.scrollX}}const Ee=Bh();return Ee?Hh(Ee,T,Y):null},[we]),Jo=v.useCallback(()=>{if(!(!we||!vn.current))return vn.current.getBoundingClientRect().width},[we]),sr=v.useCallback((T,Y,Ee="dropdown")=>{const xe=Ee==="datePicker"?T:Fx(T,he);if(we&&Ee!=="datePicker"){it(!0),En(vr(xe,Y));return}const Fe=requestAnimationFrame(()=>{nn.current.delete(Fe),Ee==="datePicker"?Jt(!0):it(!0);const ce=Bh();En(ce?Hh(ce,xe,Y):null)});nn.current.add(Fe)},[we,vr,he]),dl=80,dd=60,Ss=v.useCallback((T,Y)=>{if(!J.current)return;const Ee=ni(T,x,{cursorOffset:Y,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});J.current.innerHTML=Ee,document.activeElement===J.current&&nl(J.current,Y)},[x]),va=v.useCallback((T,Y)=>{const Ee=me!=null&&T.length>=me;if(Qe(Ee),Ee){if(Ue([]),ke(null),Mn([]),ea(T.length===0),Ie([]),Dt.current.tokens=[],it(!1),Jt(!1),J.current){const Se=Ll(J.current);J.current.querySelector("span")&&(J.current.textContent=T,nl(J.current,Se)),Wt(Se),_n(Se)}s&&s(T,null),c&&c([]);return}const xe=new ci(T,fe).tokenize(),Fe=new ps(xe),ce=Fe.parse(),pe=yu([...Fe.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...Ae.current.validate(ce,Re.current,ue,U)]);if(J.current){const Se=Ll(J.current);Y&&xe.length>dl?(Ht.current&&clearTimeout(Ht.current),Ht.current=setTimeout(()=>{Ht.current=null,J.current&&Ss(xe,Ll(J.current))},dd)):(Ht.current&&(clearTimeout(Ht.current),Ht.current=null),Ss(xe,Se)),Ue(xe),ke(ce),Mn(pe),ea(T.length===0),Wt(Se),_n(Se),Dt.current.tokens=xe,Y&&Te.current(xe,Se)}else Ue(xe),ke(ce),Mn(pe),ea(T.length===0),Dt.current.tokens=xe;s&&s(T,ce),c&&c(pe)},[x,s,c,Ss,me]),Gl=v.useCallback((T,Y)=>{if(!ft||Y.type!=="FIELD_VALUE"||!Y.fieldName)return T;const Ee=ve.current.resolveField(Y.fieldName);if(!Ee)return T;const xe=ft(Ee,Y.partial);return xe==null?T:T.some(Fe=>Fe.type==="hint")?T.map(Fe=>Fe.type==="hint"?{...Fe,customContent:xe}:Fe):[{text:"",label:"",type:"hint",customContent:xe,replaceStart:Y.start??0,replaceEnd:Y.end??0},...T]},[ft]),ws=v.useCallback(T=>{if(!Ut)return!1;const Y=Ut({cursorContext:T,partial:T.partial});return Y==null?!1:(Ie([{text:"",label:"",type:"noResults",customContent:Y,replaceStart:0,replaceEnd:0}]),We(-1),Jt(!1),sr(32,300),!0)},[Ut]),ya=v.useCallback((T,Y,Ee)=>{var Se,Ke,rt;const xe=ve.current.getSuggestions(T,Y);Ge||(xe.suggestions=xe.suggestions.filter(Be=>Be.type!=="operator"));const Fe=xe.context.type;if(Gn(xe.context),oe){if(B({trigger:$.current,context:xe.context,suggestions:xe.suggestions,isOpen:Dt.current.showDropdown||Dt.current.showDatePicker,value:Me.current,selectionStart:Y,selectionEnd:Ee??Y})===!1){it(!1),Jt(!1),Ie([]);return}}else{if(de==="never"){it(!1),Jt(!1),Ie([]);return}if(de==="manual"){if(_.current&&_.current!==Fe){_.current=null,it(!1),Jt(!1),Ie([]);return}if(!_.current){it(!1),Jt(!1),Ie([]);return}}if(de==="input"&&$.current!=="input"&&$.current!=="ctrlSpace"){it(!1),Jt(!1),Ie([]);return}if(de==="always"&&T.some(Be=>(Be.type===O.AND||Be.type===O.OR||Be.type===O.NOT||Be.type===O.TILDE||Be.type===O.BOOST)&&Y>=Be.start&&Y<=Be.end)){it(!1),Jt(!1),Ie([]);return}}const ce=xe.context.fieldName?ve.current.resolveField(xe.context.fieldName):void 0,pe=!!(g&&xe.context.type==="FIELD_VALUE"&&xe.context.fieldName&&(ce==null?void 0:ce.type)!=="boolean"&&(ce==null?void 0:ce.suggestions)!==!1)||typeof m=="function"&&xe.context.type==="SAVED_SEARCH"||typeof p=="function"&&xe.context.type==="HISTORY_REF";if(xe.showDatePicker){wn.current=!1,(Se=Zt.current)==null||Se.abort(),vt.current&&clearTimeout(vt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const Be=QC(xe.context,ue),Nn=kn.current;kn.current=Be,Si(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:Y,end:Y},Dt.current.showDatePicker&&KC(Nn,Be)&&Jt(!1),Ie([]),we||it(!1),Rt(Fe),sr(350,300,"datePicker");return}if(pe){const Be=xe.context.token,Nn=Be?Be.start:Y,Lt=Be?Be.end:Y,ra=()=>{Je.current=null,Ie([{text:"",label:"Searching...",type:"loading",replaceStart:Nn,replaceEnd:Lt}]),we||it(!1),Jt(!1),We(-1),sr(32,300)};Je.current&&clearTimeout(Je.current),Xt>0?Je.current=setTimeout(ra,Xt):ra(),Rt(Fe)}else{wn.current=!1,(Ke=Zt.current)==null||Ke.abort(),vt.current&&clearTimeout(vt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const Be=Gl(xe.suggestions,xe.context);Be.length>0?(Ie(Be),we||it(!1),Jt(!1),We(xe.context.partial||jt?0:-1),Rt(Fe),sr(Be.length*32,300)):(Rt(Fe),ws(xe.context)||(it(!1),Jt(!1),Ie([])))}if(pe){const Be=xe.context.partial,Nn=te||200;wn.current=!0,vt.current&&clearTimeout(vt.current),(rt=Zt.current)==null||rt.abort();const Lt=new AbortController;Zt.current=Lt,vt.current=setTimeout(async()=>{const ra=xe.context.token,la=ra?ra.start:Y,xa=ra?ra.end:Y;try{let Rn;if(xe.context.type==="SAVED_SEARCH"&&typeof m=="function"){const un=await m(Be);if(Lt.signal.aborted)return;Rn=un.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 un=await p(Be);if(Lt.signal.aborted)return;Rn=un.map(zt=>({text:Mh.wrapHistoryQuery(zt.query),label:zt.label||zt.query,description:zt.description,type:"history",replaceStart:la,replaceEnd:xa,matchPartial:Be,sourceData:zt}))}else{const un=xe.context.fieldName,zt=ve.current.resolveField(un),Zl=await g(zt?zt.name:un,Be);if(Lt.signal.aborted)return;Rn=Zl.map(br=>({text:br.text,label:br.label||br.text,description:br.description,type:br.type,replaceStart:la,replaceEnd:xa,matchPartial:Be}))}if(Je.current&&(clearTimeout(Je.current),Je.current=null),Rn=Rn.slice(0,P),Rn.length>0){if(be!=null&&be.showFieldSuggestions){const un=ve.current.getFieldSuggestions(Be,la,xa);Rn=[...Rn,...un].slice(0,P)}Ie(Rn),We(Be||jt?0:-1),sr(Rn.length*32,300)}else{const un=ve.current.getSuggestions(Dt.current.tokens,Dt.current.cursorOffset);if(!(Be&&ws(un.context))){const zt=Gl(un.suggestions.filter(Zl=>Zl.type==="hint"),un.context);zt.length>0?(Ie(zt),We(un.context.partial||jt?0:-1),sr(zt.length*32,300)):ws(un.context)||(it(!1),Ie([]))}}}catch(Rn){Je.current&&(clearTimeout(Je.current),Je.current=null),Lt.signal.aborted||(Ie([{text:"",label:Rn instanceof Error?Rn.message:"Error loading suggestions",type:"error",replaceStart:la,replaceEnd:xa}]),We(-1),sr(32,300),wn.current=!1)}},Nn)}},[g,m,p,te,Gl,vr,sr,we,B,oe,de,Ge,P,Xt,jt,ws]);Te.current=ya;const an=v.useCallback(()=>{var T;it(!1),Jt(!1),Si(null),kn.current=null,A.current=null,Ie([]),We(-1),wn.current=!1,(T=Zt.current)==null||T.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),ht.current&&(clearTimeout(ht.current),ht.current=null),_.current=null},[]),na=v.useCallback((T,Y,Ee)=>{if(ht.current&&(clearTimeout(ht.current),ht.current=null),!nt){(Dt.current.showDropdown||Dt.current.showDatePicker)&&an();return}$.current="navigation",Sn>0?ht.current=setTimeout(()=>{ht.current=null,ya(T,Y,Ee)},Sn):ya(T,Y,Ee)},[nt,Sn,ya,an]),Ca=v.useCallback((T,Y,Ee)=>{Me.current=T,Ct.current&&(clearTimeout(Ct.current),Ct.current=null),Bt.current.push({value:T,cursorPos:Y});const xe=new ci(T,fe).tokenize(),Fe=new ps(xe),ce=Fe.parse(),pe=yu([...Fe.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...Ae.current.validate(ce,Re.current,ue,U)]);if(J.current){const Se=ni(xe,x,{cursorOffset:Y,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});J.current.innerHTML=Se,nl(J.current,Y)}if(Ue(xe),ke(ce),Mn(pe),ea(T.length===0),Wt(Y),_n(Y),it(!1),Jt(!1),s&&s(T,ce),c&&c(pe),Ee){const Se=requestAnimationFrame(()=>{nn.current.delete(Se),Ee(xe,ce)});nn.current.add(Se)}},[x,s,c]),Mr=v.useCallback((T,Y="Enter",Ee,xe)=>{if(!T)return;const Fe=Dt.current,ce=Fe.autocompleteContext,pe=ce==="FIELD_VALUE"||ce==="SAVED_SEARCH"||ce==="HISTORY_REF";if(pe&&($.current="navigation"),T.type==="hint"&&(T.text==="#"||T.text==="!")){const un=T.text,zt=T.replaceStart,Zl=Math.max(T.replaceEnd,Fe.selectionEnd),br=Me.current.slice(0,zt),hd=Me.current.slice(Zl),nc=br+un+hd,ac=br.length+un.length;Ca(nc,ac,(md,pd)=>{Ee?Ee(nc,pd):ya(md,ac)});return}if(T.type==="hint")return;const Se=Fe.autocompleteContext==="FIELD_VALUE",Ke=Math.min(T.replaceStart,Fe.cursorOffset),rt=Math.max(T.replaceEnd,Fe.selectionEnd),Be=Me.current.slice(0,Ke),Nn=Me.current.slice(rt);let Lt="",ra=Nn;pe&&K&&(Nn.length===0?Lt=" ":/^[ \t\r\n]+$/.test(Nn)&&!Nn.startsWith("\\ ")&&(Lt=" ",ra=""));const la=Be+T.text+Lt+ra,xa=Be.length+T.text.length+Lt.length,Rn=Y==="Enter"&&Se;Ca(la,xa,(un,zt)=>{Ee?Ee(la,zt):Rn?l&&l(la,zt,xe):ya(un,xa)})},[Ca,ya,l,K]);v.useEffect(()=>{Array.isArray(m)&&ve.current.updateSavedSearches(m),Array.isArray(p)&&ve.current.updateSearchHistory(p)},[m,p]),v.useEffect(()=>{ve.current=new Mh(De,[],[],D||10,{showSavedSearchHint:ze,showHistoryHint:ct,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}),ve.current.setDefaultField(be),Ae.current=new Ux(De),Array.isArray(m)&&ve.current.updateSavedSearches(m),Array.isArray(p)&&ve.current.updateSearchHistory(p),Me.current&&va(Me.current,!1)},[De,D,ze,ct]),v.useEffect(()=>{I&&I({getValue:()=>Me.current,setValue:T=>{Me.current=T,va(T,!1)},focus:()=>{var T;return(T=J.current)==null?void 0:T.focus()},blur:()=>{var T;return(T=J.current)==null?void 0:T.blur()},getAST:()=>Dt.current.ast,getValidationErrors:()=>Dt.current.validationErrors,setSelection:(T,Y)=>{J.current&&(J.current.focus(),tl(J.current,T,Y),Wt(T),_n(Y))}})},[I,va]),v.useEffect(()=>{const T=Me.current;Bt.current.push({value:T,cursorPos:T.length}),T&&va(T,!1)},[]),v.useEffect(()=>{o!==void 0&&o!==Me.current&&(Me.current=o,va(o,!1))},[o,va]),v.useEffect(()=>()=>{var T;vt.current&&clearTimeout(vt.current),Ht.current&&clearTimeout(Ht.current),ht.current&&clearTimeout(ht.current),Je.current&&clearTimeout(Je.current),nn.current.forEach(Y=>cancelAnimationFrame(Y)),nn.current.clear(),(T=Zt.current)==null||T.abort()},[]),v.useEffect(()=>{if(oe){const T=Dt.current;T.cursorContext&&B({trigger:"modeChange",context:T.cursorContext,suggestions:T.suggestions,isOpen:T.showDropdown||T.showDatePicker,value:Me.current,selectionStart:T.cursorOffset,selectionEnd:T.selectionEnd})===!1&&(it(!1),Jt(!1),Ie([]))}else de==="never"&&(it(!1),Jt(!1),Ie([]));_.current=null},[B]);const yr=v.useRef(!1);v.useLayoutEffect(()=>{if(yr.current){yr.current=!1;return}const T=qa.current;if(!T||!Fn)return;const Y=T.getBoundingClientRect(),Ee=window.innerWidth;if(Y.right>Ee-8){const xe=Y.right-Ee+8;yr.current=!0,En(Fe=>Fe&&{...Fe,left:Math.max(8,Fe.left-xe)})}},[Fn,ut,dt,Ze]),v.useEffect(()=>{const T=()=>{const Y=Dt.current;if(!(!Y.showDropdown&&!Y.showDatePicker))if(Y.showDropdown&&we&&vn.current){const Ee=vn.current.getBoundingClientRect();En({top:Ee.bottom+window.scrollY+4,left:Ee.left+window.scrollX})}else{const Ee=Bh();Ee&&En(Hh(Ee,Y.showDatePicker?350:Fx(Y.suggestions.length*32,he),300))}};return window.addEventListener("resize",T),window.addEventListener("scroll",T,!0),()=>{window.removeEventListener("resize",T),window.removeEventListener("scroll",T,!0)}},[we,he]),v.useEffect(()=>{const T=J.current;if(!T)return;const Y=()=>{(Dt.current.showDropdown||Dt.current.showDatePicker)&&an()};return T.addEventListener("scroll",Y),()=>T.removeEventListener("scroll",Y)},[an]);const _r=v.useRef(null),wi=v.useRef(x);v.useEffect(()=>{if(!J.current)return;const T=Dt.current.tokens;if(T.length===0||Yn&&ta!==Nt)return;const Y=Yn?Nt:-1,Ee=x!==wi.current;wi.current=x;const xe=X0(T,Y),Fe=xe?`${xe.openStart},${xe.closeStart}`:null;if(Fe===_r.current&&!Ee)return;_r.current=Fe;const ce=Yn?Ll(J.current):-1,pe=ni(T,x,{cursorOffset:Y,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});J.current.innerHTML=pe,Yn&&ce>=0&&nl(J.current,ce)},[Nt,ta,Yn,x]);const xr=ge&&!Yn,Ei=v.useRef(xr);v.useEffect(()=>{if(!J.current)return;const T=Ei.current;if(Ei.current=xr,T!==xr)if(xr)J.current.innerHTML=J.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const Y=Dt.current.tokens;if(Y.length>0){const Ee=Yn?Ll(J.current):-1,xe=ni(Y,x,{cursorOffset:Ee,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});J.current.innerHTML=xe,Yn&&Ee>=0&&nl(J.current,Ee)}}},[xr,x]);const Ia=v.useCallback(()=>{if(yt.current||!J.current)return;Z.current=null,le.current=-1,ht.current&&(clearTimeout(ht.current),ht.current=null);let T=JT(J.current);if(T===Me.current)return;let Y=Ll(J.current);const Ee=Ox(T);Ee!==T&&(T=Ee,Y=Math.min(Y,T.length)),Me.current=T;const xe=Bt.current,Fe=xe.current();if(Fe&&Math.abs(T.length-Fe.value.length)<=2&&Ct.current?xe.replaceCurrent({value:T,cursorPos:Y}):xe.push({value:T,cursorPos:Y}),Ct.current&&clearTimeout(Ct.current),Ct.current=setTimeout(()=>{Ct.current=null},300),$.current="input",!oe&&de==="input"){const ce=Y>0?T[Y-1]:"";if(!ce||ce.trim()===""){va(T,!1),an(),J.current&&xu(J.current);return}}va(T,!0),J.current&&xu(J.current)},[va,oe,de,an]),ir=v.useCallback(()=>{yt.current=!0},[]),Ni=v.useCallback(()=>{yt.current=!1,Ia()},[Ia]),Lr=v.useCallback(T=>{if(!T)return;Me.current=T.value;const Y=new ci(T.value,fe).tokenize(),Ee=new ps(Y),xe=Ee.parse(),Fe=yu([...Ee.getErrors().map(pe=>({message:pe.message,start:pe.start,end:pe.end,type:"SYNTAX_ERROR"})),...Ae.current.validate(xe,Re.current,ue,U)]),ce=T.selStart!=null&&T.selStart!==T.cursorPos;if(J.current){const pe=ni(Y,x,{cursorOffset:T.cursorPos,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});J.current.innerHTML=pe,ce?tl(J.current,T.selStart,T.cursorPos):nl(J.current,T.cursorPos)}Ue(Y),ke(xe),Mn(Fe),ea(T.value.length===0),Wt(ce?T.selStart:T.cursorPos),_n(T.cursorPos),an(),s&&s(T.value,xe),c&&c(Fe)},[x,s,c,an]),Pa=v.useCallback(()=>{const T=qa.current;if(!T)return 10;const Y=T.clientHeight,Ee=T.querySelectorAll(".ei-dropdown-item")[0];if(!Ee)return 10;const xe=Ee.offsetHeight;return xe<=0?10:Math.max(1,Math.floor(Y/xe))},[]),Ri=v.useCallback(T=>{var xe,Fe;if(X&&X(T),T.defaultPrevented)return;const Y=Dt.current,Ee=T.nativeEvent.code;if(Wn&&Ee==="KeyF"&&T.altKey&&T.shiftKey&&!T.ctrlKey&&!T.metaKey){T.preventDefault();const ce=$C(Me.current,qn);ce!==Me.current&&Ca(ce,ce.length);return}if(J.current&&J.current.childNodes.length>40){const ce=window.getSelection();if(ce!=null&&!ce.isCollapsed){const pe=jr(J.current);if(pe.end-pe.start>20){const Se=T.key==="Backspace"||T.key==="Delete"||T.key==="x"&&(T.ctrlKey||T.metaKey),Ke=!T.ctrlKey&&!T.metaKey&&!T.altKey&&T.key.length===1;(Se||Ke)&&(J.current.textContent=Me.current,tl(J.current,pe.start,pe.end))}}}{let ce=null,pe=null;if(Mx[T.key])ce=T.key,pe=Mx[T.key];else if(tn&&T.key==="*"&&J.current){const Se=jr(J.current);if(Se.start!==Se.end){const[Ke,rt]=_x(Y.tokens,Se.start,Se.end);if(Ke>=0&&Ke===rt){const Be=Y.tokens[Ke];(Be.type===O.VALUE||Be.type===O.WILDCARD)&&(ce="*",pe="*")}}}if(ce&&pe&&J.current){const Se=jr(J.current);if(Se.start!==Se.end){T.preventDefault();const{newValue:Ke,newSelStart:rt,newSelEnd:Be}=ZT(Me.current,Se.start,Se.end,ce,pe),Nn=Bt.current,Lt=Nn.current();Lt&&Lt.value===Me.current&&(Lt.selStart=Se.start,Lt.cursorPos=Se.end),Me.current=Ke,Ct.current&&(clearTimeout(Ct.current),Ct.current=null),Nn.push({value:Ke,cursorPos:Be,selStart:rt});const ra=new ci(Ke,fe).tokenize(),la=new ps(ra),xa=la.parse(),Rn=yu([...la.getErrors().map(zt=>({message:zt.message,start:zt.start,end:zt.end,type:"SYNTAX_ERROR"})),...Ae.current.validate(xa,Re.current,ue,U)]),un=ni(ra,x,{cursorOffset:Be,tokenClassName:S==null?void 0:S.token,fieldTypeMap:qe});J.current.innerHTML=un,tl(J.current,rt,Be),Ue(ra),ke(xa),Mn(Rn),ea(!1),Wt(rt),_n(Be),an(),s&&s(Ke,xa),c&&c(Rn);return}}}if(T.key==="z"&&(T.ctrlKey||T.metaKey)&&!T.shiftKey){T.preventDefault(),Lr(Bt.current.undo());return}if(T.key==="y"&&(T.ctrlKey||T.metaKey)||T.key==="z"&&(T.ctrlKey||T.metaKey)&&T.shiftKey){T.preventDefault(),Lr(Bt.current.redo());return}if(T.key==="a"&&(T.ctrlKey||T.metaKey)&&Hn&&J.current){const ce=jr(J.current),pe=_C(Y.tokens,ce.start,ce.end);if(pe){T.preventDefault(),tl(J.current,pe.start,pe.end),Wt(pe.start),_n(pe.end);return}}if($n&&T.altKey&&T.shiftKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&J.current){const ce=Ee==="ArrowRight";let pe=Z.current;if(!pe){const Ke=jr(J.current),rt=zC(Y.ast,Y.tokens,Ke.start);if(rt.length===0)return;pe={ranges:rt,level:-1},Z.current=pe}const Se=ce?Math.min(pe.level+1,pe.ranges.length-1):Math.max(pe.level-1,-1);if(Se===pe.level)return;if(pe.level=Se,Se<0){const Ke=jr(J.current);nl(J.current,Ke.start),Z.current=null}else{T.preventDefault();const Ke=pe.ranges[Se];tl(J.current,Ke.start,Ke.end),Wt(Ke.start),_n(Ke.end)}return}if(Z.current=null,fa&&T.ctrlKey&&T.altKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&J.current){T.preventDefault();const ce=Ee==="ArrowRight"?"forward":"backward",pe=YC(Y.ast),Se=jr(J.current),Ke=ce==="forward"?Se.end:Se.start,rt=GC(pe,le.current,Ke,ce);rt&&(le.current=rt.index,tl(J.current,rt.stop.start,rt.stop.end),Wt(rt.stop.start),_n(rt.stop.end));return}if(le.current=-1,T.key===" "&&(T.ctrlKey||T.metaKey)){T.preventDefault(),$.current="ctrlSpace",!oe&&de==="manual"&&(_.current=ve.current.getSuggestions(Y.tokens,Y.cursorOffset).context.type),ya(Y.tokens,Y.cursorOffset);return}if(T.key==="Enter"&&(T.ctrlKey||T.metaKey)){T.preventDefault(),an(),l&&l(Me.current,Y.ast,T);return}if(T.key==="Enter"&&T.shiftKey&&Qt){T.preventDefault(),OC();const ce=J.current?Ll(J.current):Me.current.length+1,pe=Me.current,Se=pe.slice(0,ce-1)+`
|
|
293
|
+
`+pe.slice(ce-1);Me.current=Se,Z.current=null,ht.current&&(clearTimeout(ht.current),ht.current=null),$.current="input",Bt.current.push({value:Se,cursorPos:ce}),va(Se,!0),J.current&&xu(J.current);return}if((T.key==="Backspace"||T.key==="Delete")&&J.current&&!J.current.textContent){const ce=Me.current;if(!ce)return;const{start:pe,end:Se}=jr(J.current);let Ke,rt;if(pe!==Se)Ke=ce.slice(0,pe)+ce.slice(Se),rt=pe;else if(T.key==="Backspace"&&pe>0)Ke=ce.slice(0,pe-1)+ce.slice(pe),rt=pe-1;else if(T.key==="Delete"&&pe<ce.length)Ke=ce.slice(0,pe)+ce.slice(pe+1),rt=pe;else return;T.preventDefault(),Me.current=Ke,Z.current=null,ht.current&&(clearTimeout(ht.current),ht.current=null),$.current="input",Bt.current.push({value:Ke,cursorPos:rt}),nl(J.current,rt),va(Ke,!0),J.current&&xu(J.current);return}if(wt.current=!1,Y.showDropdown&&Y.suggestions.length>0)switch(T.key){case"ArrowDown":T.preventDefault(),wt.current=!0,We(ce=>ce>=Y.suggestions.length-1?0:ce+1);return;case"ArrowUp":T.preventDefault(),wt.current=!0,We(ce=>ce<=0?Y.suggestions.length-1:ce-1);return;case"PageDown":{T.preventDefault(),wt.current=!0;const ce=Pa();We(pe=>Math.min(pe+ce,Y.suggestions.length-1));return}case"PageUp":{T.preventDefault(),wt.current=!0;const ce=Pa();We(pe=>Math.max(pe-ce,0));return}case"Home":if(_t&&Y.selectedSuggestionIndex>=0){T.preventDefault(),wt.current=!0,We(0);return}break;case"End":if(_t&&Y.selectedSuggestionIndex>=0){T.preventDefault(),wt.current=!0,We(Y.suggestions.length-1);return}break;case"Enter":if(Y.selectedSuggestionIndex>=0){const ce=Y.suggestions[Y.selectedSuggestionIndex];if(ce.type==="loading"||ce.type==="error"){T.preventDefault(),an(),l&&l(Me.current,Y.ast,T);return}if(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!"){T.preventDefault(),an();const pe=Me.current,Se=Y.cursorOffset;if(Se<=pe.length&&pe[Se]!==" "){const Ke=pe.slice(0,Se),rt=pe.slice(Se),Be=Ke+" "+rt;Ca(Be,Se+1,()=>{l&&l(Be,Y.ast,T)})}else l&&l(pe,Y.ast,T);return}T.preventDefault(),Mr(ce,"Enter",void 0,T);return}T.preventDefault(),an(),l&&l(Me.current,Y.ast,T);return;case"Tab":if(M){T.preventDefault();const ce=Y.selectedSuggestionIndex>=0?Y.suggestions[Y.selectedSuggestionIndex]:null,pe=ce&&ce.type!=="loading"&&ce.type!=="error"&&!(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!")?ce:null,Se=M({suggestion:pe,cursorContext:Y.cursorContext||{type:"EMPTY",partial:""},query:Me.current});Se.accept&&pe?Mr(pe,"Tab",(Ke,rt)=>{var Be;Se.submit&&l&&l(Ke,rt,T),Se.blur&&((Be=J.current)==null||Be.blur())},T):(an(),Se.submit&&l&&l(Me.current,Y.ast,T),Se.blur&&((xe=J.current)==null||xe.blur()));return}if(Y.selectedSuggestionIndex>=0){const ce=Y.suggestions[Y.selectedSuggestionIndex];if(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!"){T.preventDefault(),an();const pe=Me.current,Se=Y.cursorOffset;if(Se<=pe.length&&pe[Se]!==" "){const Ke=pe.slice(0,Se),rt=pe.slice(Se),Be=Ke+" "+rt,Nn=Se+1;Ca(Be,Nn,Lt=>{ya(Lt,Nn)})}return}T.preventDefault(),Mr(ce,"Tab",void 0,T);return}break;case"Escape":T.preventDefault(),an();return}if(T.key==="Tab"&&M){T.preventDefault();const ce=M({suggestion:null,cursorContext:Y.cursorContext||{type:"EMPTY",partial:""},query:Me.current});ce.submit&&l&&l(Me.current,Y.ast,T),ce.blur&&((Fe=J.current)==null||Fe.blur());return}if(Y.showDatePicker&&T.key==="Escape"){T.preventDefault(),an();return}if(T.key==="Enter"&&!Y.showDropdown&&!Y.showDatePicker){T.preventDefault(),l&&l(Me.current,Y.ast,T);return}},[l,an,Mr,Ca,Lr,Qt,oe,de,ya,X,M,Hn,$n,fa,_t,Pa,Wn]),Es=v.useCallback(T=>{if(wt.current){wt.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(T.key)){if(!J.current)return;const Y=jr(J.current);Wt(Y.start),_n(Y.end),na(Dt.current.tokens,Y.start,Y.end)}},[na]),Wo=v.useCallback(()=>{ga(!0),ee==null||ee();const T=requestAnimationFrame(()=>{if(nn.current.delete(T),J.current){const Y=Dt.current.tokens,Ee=Y.length>0?Ll(J.current):0;Wt(Ee),_n(Ee),na(Y,Ee)}});nn.current.add(T)},[Ia,na,ee]),Ns=v.useCallback(()=>{var T;ga(!1),it(!1),Jt(!1),Ie([]),wn.current=!1,(T=Zt.current)==null||T.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),Je.current&&(clearTimeout(Je.current),Je.current=null),Wt(-1),ne==null||ne()},[ne]),zr=v.useRef(!1),ec=v.useCallback(T=>{if(!J.current||T.detail!==2&&T.detail!==3)return;if(T.detail===3){if(!Dt.current.ast)return;const Se=document.caretRangeFromPoint(T.clientX,T.clientY);if(!Se)return;const Ke=zo(J.current,Se.startContainer,Se.startOffset),rt=GT(Dt.current.ast,Me.current,Ke);if(!rt||rt.start>=rt.end)return;T.preventDefault(),zr.current=!0,tl(J.current,rt.start,rt.end);return}T.preventDefault(),zr.current=!0;const Y=document.caretRangeFromPoint(T.clientX,T.clientY);if(!Y)return;const Ee=zo(J.current,Y.startContainer,Y.startOffset),xe=Me.current,Fe=Se=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(Se);let ce=Ee;for(;ce>0&&Fe(xe[ce-1]);)ce--;let pe=Ee;for(;pe<xe.length&&Fe(xe[pe]);)pe++;ce<pe&&tl(J.current,ce,pe)},[]),aa=v.useCallback(T=>{zr.current&&(T.preventDefault(),zr.current=!1)},[]),Ur=v.useCallback(()=>{if(!J.current)return;const T=jr(J.current);if(Wt(T.start),_n(T.end),T.start!==T.end){const[Y,Ee]=_x(Dt.current.tokens,T.start,T.end);if(Y!==Ee){an();return}}na(Dt.current.tokens,T.start,T.end)},[na,an]),Br=v.useCallback(T=>{Ct.current&&(clearTimeout(Ct.current),Ct.current=null),kC(T),Ia()},[Ia]),Xl=v.useCallback(T=>{T.preventDefault();const Y=Ox(T.clipboardData.getData("text/plain"));if(ye){const Ee=ye(Y,T);Ee!=null&&typeof(Ee==null?void 0:Ee.then)=="function"?Ee.then(xe=>{xe!=null&&Br(xe)}).catch(()=>{}):Ee!=null&&Br(Ee)}else Br(Y)},[ye,Br]),fd=v.useCallback(T=>{$.current="navigation";const Y=Dt.current,Ee=A.current,xe=Ee?Ee.start:Y.cursorOffset,Fe=Ee?Ee.end:Y.cursorOffset,ce=Me.current.slice(0,xe),pe=Me.current.slice(Fe);let Se="",Ke=pe;K&&T.length>0&&(pe.length===0?Se=" ":/^[ \t\r\n]+$/.test(pe)&&!pe.startsWith("\\ ")&&(Se=" ",Ke=""));const rt=ce+T+Se+Ke,Be=ce.length+T.length+Se.length;Ca(rt,Be,Nn=>{J.current&&J.current.focus(),ya(Nn,Be)})},[Ca,ya,K]),fl=Ko(x),Ql=Zo(y),Kl=sC(fl,j),Hr={...iC(fl,Ql),...Yn?oC(Ql):{}};xr&&(Hr.whiteSpace="nowrap",Hr.overflow="hidden",Hr.textOverflow="ellipsis");const tc=cC(fl,Ql);return v.createElement("div",{ref:vn,style:Kl,className:Ua("ei-container",w,S==null?void 0:S.container)},v.createElement("div",{ref:Vn,contentEditable:!0,suppressContentEditableWarning:!0,className:Ua("ei-editor",S==null?void 0:S.editor),style:Hr,onInput:Ia,onKeyDown:Ri,onKeyUp:Es,onMouseDown:ec,onMouseUp:aa,onFocus:Wo,onBlur:Ns,onClick:Ur,onPaste:Xl,onCompositionStart:ir,onCompositionEnd:Ni,spellCheck:!1}),ul&&!Yn?v.createElement("div",{className:Ua("ei-placeholder",S==null?void 0:S.placeholder),style:tc},N):null,v.createElement(AC,{errors:On,editorRef:Tt,cursorOffset:Nt,colors:x,styles:y,containerRef:vn.current,classNames:S?{squiggly:S.squiggly,tooltip:S.tooltip}:void 0}),v.createElement(wC,{suggestions:Ze,selectedIndex:$t,onSelect:T=>Mr(T,"Tab"),position:Fn,colors:x,styles:y,visible:ut,fixedWidth:Jo(),renderHistoryItem:ie,renderSavedSearchItem:$e,renderDropdownHeader:at,cursorContext:Ta,listRefCallback:T=>{qa.current=T},renderType:gn,classNames:S?{dropdown:S.dropdown,dropdownHeader:S.dropdownHeader,dropdownItem:S.dropdownItem}:void 0}),dt&&Fn?v.createElement(ZC,{position:Fn,colors:fl,onSelect:fd,colorConfig:x,styleConfig:y,datePickerInit:Yl,fixedWidth:void 0,datePresets:q,datePickerClassName:S==null?void 0:S.datePicker}):null)}const WC=["planned","in-progress","done","blocked","canceled","rejected","deferred","waiting"];function Gx(t){var c;const a=window.getSelection();if(!a||a.rangeCount===0)return((c=t.textContent)==null?void 0:c.length)??0;const l=a.getRangeAt(0),s=l.cloneRange();return s.selectNodeContents(t),s.setEnd(l.endContainer,l.endOffset),s.toString().length}function eD(t){return a=>{if(!(a.ctrlKey&&!a.metaKey&&!a.altKey))return;const l=a.key.toLowerCase(),s=a.currentTarget,c=s.isContentEditable?s:s.querySelector("[contenteditable='true'], [contenteditable]")??s,o=t.current;if(l==="h"&&o){a.preventDefault();const m=o.getValue();let p=Gx(c);(p<0||p>m.length)&&(p=m.length),p>0&&(o.setValue(m.slice(0,p-1)+m.slice(p)),o.setSelection(p-1,p-1));return}if(l==="u"&&o){a.preventDefault();const m=o.getValue();let p=Gx(c);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&&(o.setValue(m.slice(0,g)+m.slice(p)),o.setSelection(g,g));return}const f=l==="j"?"ArrowDown":l==="k"?"ArrowUp":null;f&&(a.preventDefault(),c.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0,cancelable:!0})))}}function $h(t){return String(t>0?t:0).padStart(3,"0")}function tD({features:t,phases:a,query:l,onQuery:s}){const c=v.useRef(null),o=eD(c),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,z)=>R-z),N=[...new Set(a.map(R=>R.number))].sort((R,z)=>R-z),w=[...new Set(a.flatMap(R=>R.tasks.map(z=>z.number)))].sort((R,z)=>R-z),S=[...new Set([...t.map(R=>R.shortId),...a.flatMap(R=>[R.shortId,...R.tasks.map(z=>z.shortId)])].filter(Boolean))],j=[...new Set(a.flatMap(R=>R.tasks.map(z=>z.title)))];return{featureNums:y,phaseNums:N,taskNums:w,shortIds:S,titles:j}},[t,a]),p=v.useCallback(async(y,N)=>{const w=N.toLowerCase();return y==="feature"?m.featureNums.filter(S=>String(S).startsWith(N)).slice(0,20).map(S=>({text:String(S),label:`F${$h(S)}`})):y==="phase"?m.phaseNums.filter(S=>String(S).startsWith(N)).slice(0,20).map(S=>({text:String(S),label:`P${$h(S)}`})):y==="task"?m.taskNums.filter(S=>String(S).startsWith(N)).slice(0,20).map(S=>({text:String(S),label:`T${$h(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"?WC.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=>{c.current=y},[]);return u.jsx("div",{className:"search-bar",children:u.jsx(JC,{fields:f,value:l,onChange:g,onSearch:g,fetchSuggestions:p,onKeyDown:o,inputRef:x,placeholder:"Search Work Tree… e.g. feature:1 id:UUXD1 title:auth status:in-progress"})})}function Xx(){const t=new URL(window.location.href);t.searchParams.has("locate")&&(t.searchParams.delete("locate"),window.history.replaceState(window.history.state,"",`${t.pathname}${t.search}${t.hash}`))}function nD(t,a){if(Object.keys(a).length===0)return t;const l=o=>{const f=a[o];return f?new Map(f.map((m,p)=>[m,p])):null},s=l("__features__");return(s?[...t].sort((o,f)=>(s.get(o.feature.id)??1/0)-(s.get(f.feature.id)??1/0)):t).map(o=>{const f=l(`phase-scope:${o.feature.id}`),m=f?[...o.allPhases].sort((p,g)=>(f.get(p.phase.id)??1/0)-(f.get(g.phase.id)??1/0)):o.allPhases;return{...o,allPhases:m.map(p=>{const g=l(`task-scope:${p.phase.id}`),x=g?[...p.allTasks].sort((y,N)=>(g.get(y.id)??1/0)-(g.get(N.id)??1/0)):p.allTasks;return{...p,allTasks:x}})}})}function ai({active:t=!1,disabled:a=!1,onClick:l,children:s}){return u.jsx("button",{type:"button",disabled:a,onClick:l,className:`inline-flex h-7 min-h-7 shrink-0 items-center justify-center whitespace-nowrap rounded-[9px] border px-2 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] sm:h-8 sm:min-h-8 sm:rounded-[10px] sm:px-2.5 ${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 aD({features:t,phases:a,activeTasks:l,projectStorageScope:s,resumeRequiredIds:c=new Set}){const o=IT({features:t,phases:a,projectStorageScope:s}),[f,m]=v.useState({});v.useEffect(()=>{m({})},[o.displayedWorkTree]);const p=v.useMemo(()=>nD(o.displayedWorkTree,f),[o.displayedWorkTree,f]),[g,x]=v.useState(!1),[y,N]=v.useState(null),[w,S]=v.useState(null),j=K=>S(String(K.active.id)),[R,z]=v.useState(0);v.useEffect(()=>{const K=document.querySelector("header");if(!K)return;const ge=()=>z(K.offsetHeight);ge();const be=new ResizeObserver(ge);return be.observe(K),window.addEventListener("resize",ge),()=>{be.disconnect(),window.removeEventListener("resize",ge)}},[]),v.useEffect(()=>{const K=window.setTimeout(()=>{const ge=document.querySelector(".ap-search-sticky"),be=document.querySelector("header");if(!ge||!be)return;const U=ge.getBoundingClientRect();if(U.top<0){const B=U.top+window.scrollY-be.offsetHeight;window.scrollTo({top:Math.max(0,B),behavior:"smooth"})}},60);return()=>window.clearTimeout(K)},[o.searchQuery,o.hideDone,o.hidePlanned,o.onlyActiveBranches]);const I=rj(aj(_m,{activationConstraint:{distance:5}})),q=async K=>{const{active:ge,over:be}=K;if(S(null),!be||ge.id===be.id)return;const U=String(ge.id),B=String(be.id),oe=p.map(de=>de.feature.id);if(oe.includes(U)&&oe.includes(B)){const de=Ao(oe,oe.indexOf(U),oe.indexOf(B)),we=de.indexOf(U),D=we>0?de[we-1]??null:null,P=we<de.length-1?de[we+1]??null:null;m(te=>({...te,__features__:de})),await Eh("feature",U,D,P).catch(()=>{});return}for(const de of p){const we=de.allPhases.map(D=>D.phase.id);if(we.includes(U)&&we.includes(B)){const D=Ao(we,we.indexOf(U),we.indexOf(B)),P=D.indexOf(U),te=P>0?D[P-1]??null:null,he=P<D.length-1?D[P+1]??null:null;m(Ne=>({...Ne,[`phase-scope:${de.feature.id}`]:D})),await Eh("phase",U,te,he).catch(()=>{});return}}for(const de of p)for(const we of de.allPhases){const D=we.allTasks.map(P=>P.id);if(D.includes(U)&&D.includes(B)){const P=Ao(D,D.indexOf(U),D.indexOf(B)),te=P.indexOf(U),he=te>0?P[te-1]??null:null,Ne=te<P.length-1?P[te+1]??null:null;m(je=>({...je,[`task-scope:${we.phase.id}`]:P})),await Eh("task",U,he,Ne).catch(()=>{});return}}},X=K=>o.expandedPhaseIds.includes(K),ee=K=>o.recentPhaseIds.includes(K),ne=K=>o.recentTaskIds.includes(K),[M]=Io(),[C,ue]=v.useState(null),me=M.get("locate"),ye=me?parseInt(me.replace(/^T/i,""),10):null;v.useEffect(()=>{if(ye==null||Number.isNaN(ye))return;const K=a.flatMap(B=>B.tasks.map(oe=>({t:oe,p:B}))).find(({t:B})=>B.number===ye);if(!K){if(a.length===0)return;Xx();return}const{t:ge,p:be}=K;if(o.onlyActiveBranches&&o.setOnlyActiveBranches(!1),o.hideDone&&o.setHideDone(!1),o.searchQuery&&o.setSearchQuery(""),o.setTreeOpenMode("smart"),be.featureId){const B=be.featureId;o.expandedFeatureIds.includes(B)||o.setExpandedFeatureIds(oe=>oe.includes(B)?oe:[...oe,B])}o.expandedPhaseIds.includes(be.id)||o.setExpandedPhaseIds(B=>B.includes(be.id)?B:[...B,be.id]);const U=document.getElementById(`task-row-${ye}`);if(U){const B=document.querySelector("header"),oe=document.querySelector(".ap-search-sticky"),de=((B==null?void 0:B.offsetHeight)??0)+((oe==null?void 0:oe.offsetHeight)??0)+12,we=U.getBoundingClientRect().top+window.scrollY-de;window.scrollTo({top:Math.max(0,we),behavior:"smooth"}),ue(ge.id);const D=window.setTimeout(()=>ue(null),2500);return Xx(),()=>window.clearTimeout(D)}},[ye,a,o.expandedFeatureIds,o.expandedPhaseIds,o.onlyActiveBranches,o.hideDone,o.searchQuery,o.treeOpenMode]);const ae=()=>{if(!w)return null;for(const K of p){if(K.feature.id===w)return u.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(ar,{featureNum:K.feature.number}),u.jsx(tr,{status:K.feature.status})]}),u.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:K.feature.name})]});for(const ge of K.allPhases){if(ge.phase.id===w)return u.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(ar,{featureNum:K.feature.number,phaseNum:ge.phase.number}),u.jsx(tr,{status:ge.phase.status})]}),u.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:ge.phase.title})]});for(const be of ge.allTasks)if(be.id===w)return u.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(ar,{featureNum:K.feature.number,phaseNum:ge.phase.number,taskNum:be.number}),u.jsx(tr,{status:be.status})]}),u.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:be.title})]})}}return null};return u.jsxs(Gt,{className:"grid gap-4",children:[u.jsx("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:u.jsxs("div",{children:[u.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Work Tree"}),u.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Collapsible feature → phase → task tree. Click a feature or phase row to collapse/expand."})]})}),u.jsxs("div",{className:"ap-search-sticky z-20 grid gap-2",style:{top:R},children:[u.jsx(tD,{features:t,phases:a,query:o.searchQuery,onQuery:o.setSearchQuery}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Bm,{sort:o.sort,onChange:o.setSort}),u.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1.5 overflow-x-auto rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1.5 [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5 sm:gap-2 sm:rounded-[14px] sm:px-3 sm:py-2",children:[u.jsx(ai,{active:o.isAllExpanded,onClick:()=>o.isAllExpanded?o.collapseAll():o.expandAll(),children:o.isAllExpanded?"Collapse all":"Expand all"}),u.jsx(ai,{active:o.hideDone,onClick:()=>o.setHideDone(K=>!K),children:"Hide done"}),u.jsx(ai,{active:o.hidePlanned,onClick:()=>o.setHidePlanned(K=>!K),children:"Hide planned"}),u.jsx(ai,{active:o.onlyActiveBranches,onClick:()=>o.setOnlyActiveBranches(K=>!K),children:"Only active"}),u.jsx(ai,{onClick:o.resetFilters,children:"Reset"}),u.jsx(ai,{disabled:g,onClick:async()=>{x(!0),N(null);try{const K=await FR(),ge=K.migrated,be=K.integrity.duplicatePhaseIds.length,U=K.integrity.danglingPhaseIds.length;N(`Repair done: renamed ${ge.renamed}, repaired ${ge.repaired} refs, inferred ${ge.inferred}, archived ${K.handoffs.archived} stale handoff(s). Integrity: ${be} duplicate, ${U} dangling.`)}catch(K){N(`Repair failed: ${K instanceof Error?K.message:String(K)}`)}finally{x(!1)}},children:g?"Repairing…":"Repair"})]})]}),o.searchActive?u.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,y?u.jsx("span",{className:"text-xs text-[var(--text-muted)] sm:truncate",children:y}):null]}),u.jsx("div",{className:"grid gap-3",children:p.length>0?u.jsxs(rT,{sensors:I,collisionDetection:uj,onDragStart:j,onDragEnd:q,children:[u.jsx(Um,{items:p.map(K=>K.feature.id),strategy:zm,children:p.map(K=>u.jsx(qm,{id:K.feature.id,children:u.jsx(VT,{entry:K,expanded:o.expandedFeatureIds.includes(K.feature.id),recentlyChanged:o.recentFeatureIds.includes(K.feature.id),onToggle:()=>o.toggleExpandedFeature(K.feature.id),isPhaseExpanded:X,onTogglePhase:o.toggleExpandedPhase,isPhaseRecentlyChanged:ee,isTaskRecentlyChanged:ne,highlightedTaskIds:(()=>{const ge=o.searchActive?o.matchedTaskIds:void 0;if(!C)return ge;const be=new Set(ge??[]);return be.add(C),be})(),resumeRequiredIds:c})},K.feature.id))}),u.jsx(ET,{dropAnimation:{duration:150,easing:"ease"},children:ae()})]}):l.length>0?l.map(K=>{const ge=K.featureId?`/features/${K.featureId}/phases/${K.phaseId}/tasks/${K.id}`:"/features";return u.jsxs(Ve,{to:ge,className:"surface-card grid gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 truncate text-sm font-semibold text-[var(--text)]",children:[K.status==="in-progress"?u.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,u.jsxs("span",{className:"truncate",children:["T",H2(K.number)," — ",K.title]})]}),u.jsx(tr,{status:K.status})]}),u.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:K.phaseId})]},K.id)}):u.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function rD({tasks:t}){return t.length?u.jsxs("section",{"aria-labelledby":"resume-required-heading",className:"grid grid-cols-1 gap-3",children:[u.jsxs("h2",{id:"resume-required-heading",className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--accent)]",children:["Resume required (",t.length,")"]}),u.jsx("div",{className:"grid gap-2",children:t.map(a=>u.jsx(i0,{task:a},a.id))})]}):null}function lD(){const{features:t,phases:a,activeTasks:l}=sl(),{project:s,taskFocus:c}=xs("root"),o=v.useMemo(()=>new Set((c.pendingResume??[]).map(g=>g.id)),[c.pendingResume]),f=kr(),m=()=>f("/project/edit");An("edit",m);const p=s.projectRoot||s.planRoot||s.name||"default";return u.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[u.jsxs(Gt,{className:"grid grid-cols-1 gap-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u.jsx("h2",{className:"min-w-0 text-lg font-bold text-[var(--text)]",children:"Project Goal"}),u.jsxs(gt,{type:"button",shortcut:"edit",onClick:m,className:"shrink-0",children:[u.jsx(vs,{className:"h-4 w-4"}),"Edit project"]})]}),s.goal?u.jsx(bn,{text:s.goal,className:"max-w-4xl"}):u.jsx("p",{className:"max-w-4xl text-sm text-[var(--text-muted)]",children:"Add a project goal to define the main objective."})]}),u.jsx(j2,{project:s}),u.jsx(I2,{features:t,phases:a}),u.jsx(rD,{tasks:c.pendingResume}),u.jsx(aD,{features:t,phases:a,activeTasks:l,projectStorageScope:p,resumeRequiredIds:o}),u.jsx(C2,{features:t,phases:a}),u.jsx(A2,{features:t,phases:a})]})}async function sD(){const[t,a]=await Promise.all([Zb(),ed()]);return{features:t,phases:a}}function Uo(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function $u(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 iD(t){const a=Uo();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 Z0(t){const a=Uo();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 oD(t){const a=Uo();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 cD({feature:t,phases:a,phasesCount:l,tasksCount:s,phaseSummary:c,taskSummary:o,activity:f}){var z;const m=gs(),p=gs(),x=((z=m.formData)==null?void 0:z.get("status"))??t.status,y=m.state!=="idle",N=p.state!=="idle",w=$u(c),S=$u(o),j=p0(a??[]),R=t.description||(f?`${f.doneTasks}/${s} done · ${f.remainingTasks} left${f.blockedTasks?` · ${f.blockedTasks} blocked`:""}`:"");return u.jsxs(bi,{variant:"surface",status:j.displayStatus,className:"px-4 py-2",children:[u.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:[u.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 xl:contents",children:[u.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ar,{featureNum:t.number,featureId:t.id}),u.jsx(lr,{id:il({featureNum:t.number}),children:u.jsx("span",{className:"sr-only",children:"Copy feature path"})}),t.shortId?u.jsx(ol,{shortId:t.shortId}):null,u.jsx("span",{className:"shrink-0",children:u.jsx(Fo,{status:j.displayStatus,breakdown:j.breakdown})})]}),u.jsx(Ve,{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})]}),u.jsxs("div",{className:"flex items-center gap-2 self-end xl:hidden",children:[u.jsx(Ve,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,children:u.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:u.jsx(vs,{className:"h-3.5 w-3.5"})})}),u.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:u.jsx(gt,{type:"submit",variant:"danger",disabled:N||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:u.jsx(hi,{className:"h-4 w-4"})})})]})]}),u.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[u.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l," phases"]}),w?u.jsx("div",{className:"mt-0.5 break-words",children:w}):null]}),u.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[u.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[s," tasks"]}),S?u.jsx("div",{className:"mt-0.5 break-words",children:S}):null]}),u.jsx(m.Form,{method:"post",action:`/features/${t.id}/status`,className:"w-full xl:w-auto",children:u.jsxs("div",{className:"relative",children:[u.jsx("select",{name:"status",value:x,disabled:y||N,"aria-busy":y,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:I=>m.submit(I.currentTarget.form),children:od.map(I=>u.jsx("option",{value:I.value,children:I.label},I.value))}),u.jsx(bs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),u.jsx(Ve,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,className:"hidden xl:block",children:u.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:u.jsx(vs,{className:"h-3.5 w-3.5"})})}),u.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:u.jsx(gt,{type:"submit",variant:"danger",disabled:N||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:u.jsx(hi,{className:"h-4 w-4"})})})]}),u.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:u.jsx(cl,{value:t.updatedAt})}),R?u.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:R}):null]})}const uD={feature:{label:"Feature",Icon:ku},phase:{label:"Phase",Icon:nR},task:{label:"Task",Icon:Po},requirement:{label:"Requirement",Icon:Xb}};function J0({kind:t,label:a}){const{Icon:l,label:s}=uD[t];return u.jsxs("span",{className:`entity-badge entity-badge--${t}`,children:[u.jsx(l,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:a??s})]})}function ua({className:t="",...a}){return u.jsx("input",{className:`field-control ${t}`,...a})}function Pl({className:t="",...a}){return u.jsx("select",{className:`field-control ${t}`,...a})}function W0({query:t,status:a,statusOptions:l,placeholder:s,clearTo:c,resultsLabel:o}){const f=ym(),m=((l==null?void 0:l.length)??0)>0;return u.jsxs(da,{method:"get",className:`surface-card grid gap-3 p-3 md:items-end sm:p-4 ${m?"md:grid-cols-[minmax(0,1fr)_200px_auto_auto]":"md:grid-cols-[minmax(0,1fr)_auto_auto]"}`,children:[u.jsxs("div",{children:[u.jsx("label",{htmlFor:"list-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Name"}),u.jsx(ua,{id:"list-filter-query",name:"q",defaultValue:t,placeholder:s,className:"min-h-9 py-2 sm:min-h-11 sm:py-2.5",onChange:p=>f(p.currentTarget.form)})]}),m?u.jsxs("div",{children:[u.jsx("label",{htmlFor:"list-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),u.jsxs("div",{className:"relative",children:[u.jsxs(Pl,{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:[u.jsx("option",{value:"",children:"All statuses"}),l==null?void 0:l.map(p=>u.jsx("option",{value:p.value,children:p.label},p.value))]}),u.jsx(bs,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}):null,u.jsx(gt,{type:"submit",variant:"secondary",children:"Apply filters"}),u.jsx(Ve,{to:c,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"}),u.jsx("div",{className:`text-sm text-[var(--text-muted)] ${m?"md:col-span-4":"md:col-span-3"}`,children:o})]})}function e1(t,a,l){return a.status&&t.status!==a.status?!1:a.onlyActive?l.includes(t.status):!(a.hideDone&&t.status==="done"||a.hidePlanned&&t.status==="planned")}function ud(t,a){const l=t.trim().toLowerCase();return l?a.some(s=>s==null?void 0:s.toLowerCase().includes(l)):!0}function dD(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,c=new Map,o=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)),c.set(f,iD(m)),o.set(f,Z0(m.flatMap(p=>p.tasks)));return{phasesByFeature:a,phasesCountByFeature:l,tasksCountByFeature:s,phaseSummaryByFeature:c,taskSummaryByFeature:o}}function fD(){var w,S;const{features:t,phases:a}=sl(),{phasesByFeature:l,phasesCountByFeature:s,tasksCountByFeature:c,phaseSummaryByFeature:o,taskSummaryByFeature:f}=dD(a),m=kr(),[p]=Io(),g=((w=p.get("q"))==null?void 0:w.trim())??"",x=((S=p.get("status"))==null?void 0:S.trim())??"",y=v.useCallback(()=>m("new"),[m]);An("create",y);const N=v.useMemo(()=>t.filter(j=>(!x||j.status===x)&&ud(g,[j.name,j.id,j.description])),[t,g,x]);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-8",children:[u.jsxs(Gt,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{children:[u.jsx(J0,{kind:"feature",label:"Features"}),u.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."})]}),u.jsx(Ve,{to:"new",children:u.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),u.jsx(W0,{query:g,status:x,statusOptions:od,placeholder:"Search feature name, id, or description",clearTo:"/features",resultsLabel:N.length===t.length?`${t.length} features`:`${N.length} of ${t.length} features`}),u.jsx("div",{className:"grid gap-3",children:t.length===0?u.jsxs(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No features yet. ",u.jsx(Ve,{to:"/features/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first feature"})]}):N.length>0?N.map(j=>u.jsx(cD,{feature:j,phases:l.get(j.id),phasesCount:s.get(j.id)??0,tasksCount:c.get(j.id)??0,phaseSummary:o.get(j.id)??Uo(),taskSummary:f.get(j.id)??Uo()},j.id)):u.jsx(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),u.jsx(gi,{})]})}async function hD(){const[t,a]=await Promise.all([Em(),ed()]);return{requirements:t,phases:a}}function bo(...t){return t.filter(Boolean).join(" ")}function mD(){return u.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:u.jsx(bs,{className:"h-5 w-5"})})}function ca({title:t,subtitle:a,leading:l,actions:s,defaultOpen:c=!0,count:o,className:f,summaryClassName:m,contentClassName:p,titleClassName:g,subtitleClassName:x,children:y}){return u.jsxs("details",{className:bo("group mt-4 overflow-hidden rounded-[10px] border border-[var(--border)]",f),open:c,children:[u.jsxs("summary",{className:bo("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:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l?u.jsx("div",{className:"shrink-0 pt-0.5",children:l}):null,u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:bo("flex flex-wrap items-center gap-2 text-sm font-semibold",g),children:[t,o!==void 0?u.jsxs("span",{className:"text-[var(--text-subtle)]",children:["(",o,")"]}):null]}),a?u.jsx("div",{className:bo("mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",x),children:a}):null]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s,u.jsx(mD,{})]})]}),u.jsx("div",{className:bo("border-t border-[var(--border)] bg-[var(--surface)] p-4",p),children:y})]})}function pD(t,a){const l=new Set(a.map(o=>o.id)),s=a.map(o=>({phase:o,requirements:t.filter(f=>f.linkedPhaseIds.includes(o.id))})).filter(o=>o.requirements.length>0).sort((o,f)=>o.phase.priority-f.phase.priority||o.phase.number-f.phase.number),c=t.filter(o=>!o.linkedPhaseIds.some(f=>l.has(f)));return{phaseGroups:s,unlinkedRequirements:c}}function Qx(t){return`P${String(t.number??0).padStart(3,"0")}`}function Kx({requirement:t}){return u.jsx(Gt,{className:"overflow-hidden p-0",children:u.jsx(ca,{defaultOpen:!1,title:u.jsx("h2",{className:"min-w-0 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:t.title}),count:t.linkedPhaseIds.length,subtitle:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[t.linkedPhaseIds.length," linked phase",t.linkedPhaseIds.length===1?"":"s"]}),t.linkedPhaseIds.length>0&&t.macroTasks.length>0?u.jsx("span",{className:"mx-2 text-[var(--text-subtle)]",children:"•"}):null,t.macroTasks.length>0?u.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[t.macroTasks.length," macro task",t.macroTasks.length===1?"":"s"]}):null]}),contentClassName:"grid gap-4",summaryClassName:"hover:bg-[var(--surface-elevated)]/65",children:u.jsxs("div",{className:"flex min-w-0 flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[u.jsx("div",{className:"min-w-0",children:t.description?u.jsx("p",{className:"min-w-0 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.description}):null}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[u.jsx(Ve,{to:`${t.id}/edit`,children:u.jsx(gt,{type:"button",variant:"secondary",children:"Edit"})}),u.jsx(da,{method:"post",action:`/requirements/${t.id}/delete`,onSubmit:a=>{window.confirm(`Delete requirement "${t.title}"?`)||a.preventDefault()},children:u.jsx(gt,{type:"submit",variant:"danger",children:"Delete"})})]})]})})})}function gD(){var x;const{requirements:t,phases:a}=sl(),l=kr(),[s]=Io(),c=((x=s.get("q"))==null?void 0:x.trim())??"",o=v.useCallback(()=>l("new"),[l]);An("create",o);const f=v.useMemo(()=>new Map(a.map(y=>[y.id,y])),[a]),m=v.useMemo(()=>t.filter(y=>{const N=y.linkedPhaseIds.map(w=>{const S=f.get(w);return S?`${Qx(S)} ${S.title} ${S.summary}`:w});return ud(c,[y.title,y.description,y.id,...N])}),[t,f,c]),{phaseGroups:p,unlinkedRequirements:g}=v.useMemo(()=>pD(m,a),[m,a]);return v.useEffect(()=>{const y=window.location.hash.slice(1);y&&requestAnimationFrame(()=>{var N;return(N=document.getElementById(y))==null?void 0:N.scrollIntoView({block:"start"})})},[p]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grid gap-8",children:[u.jsxs(Gt,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{children:[u.jsx(J0,{kind:"requirement",label:"Requirements"}),u.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Track top-level outcomes independently from features, grouped below by the phases that deliver them."})]}),u.jsx(Ve,{to:"new",children:u.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create requirement"})})]}),u.jsx(W0,{query:c,placeholder:"Search requirement title, description, id, or linked phase",clearTo:"/requirements",resultsLabel:m.length===t.length?`${t.length} requirements`:`${m.length} of ${t.length} requirements`}),u.jsx("div",{className:"grid gap-6",children:t.length===0?u.jsxs(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No requirements yet. ",u.jsx(Ve,{to:"/requirements/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first requirement"})]}):m.length>0?u.jsxs(u.Fragment,{children:[p.map(({phase:y,requirements:N})=>{const w=y.featureId?`/features/${y.featureId}/phases/${y.id}`:"/features";return u.jsxs("section",{id:`phase-${y.id}`,className:"scroll-mt-28","aria-labelledby":`phase-${y.id}-heading`,children:[u.jsxs("div",{className:"mb-3 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Linked phase"}),u.jsxs(Ve,{id:`phase-${y.id}-heading`,to:w,className:"min-w-0 break-words text-base font-black text-[var(--text)] underline-offset-4 hover:text-[var(--accent)] hover:underline [overflow-wrap:anywhere]",children:[Qx(y)," — ",y.title]})]}),u.jsxs("span",{className:"shrink-0 rounded-full bg-[var(--surface-elevated)] px-2.5 py-1 text-xs font-semibold text-[var(--text-muted)]",children:[N.length," requirement",N.length===1?"":"s"]})]}),u.jsx("div",{className:"grid gap-3",children:N.map(S=>u.jsx(Kx,{requirement:S},S.id))})]},y.id)}),g.length>0?u.jsxs("section",{id:"unlinked-requirements",className:"scroll-mt-28","aria-labelledby":"unlinked-requirements-heading",children:[u.jsxs("div",{className:"mb-3 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Unlinked"}),u.jsx("h2",{id:"unlinked-requirements-heading",className:"text-base font-black text-[var(--text)]",children:"Requirements without a valid phase"})]}),u.jsx("span",{className:"shrink-0 rounded-full bg-[var(--surface-elevated)] px-2.5 py-1 text-xs font-semibold text-[var(--text-muted)]",children:g.length})]}),u.jsx("div",{className:"grid gap-3",children:g.map(y=>u.jsx(Kx,{requirement:y},y.id))})]}):null]}):u.jsx(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No requirements match the current filters."})})]}),u.jsx(gi,{})]})}async function vD({params:t}){const a=t.featureId;if(!a)throw new Response("featureId required",{status:400});const[l,s]=await Promise.all([Vo(a),ed(a)]);return{feature:l,phases:s}}function yD({featureId:t,feature:a,phase:l}){var y,N;const s=gs(),c=gs(),f=((y=s.formData)==null?void 0:y.get("status"))??l.status,m=s.state!=="idle",p=c.state!=="idle",g=$u(Z0(l.tasks)),x=g0(l.tasks);return u.jsxs(bi,{variant:"surface",status:x.displayStatus,className:"px-4 py-2",children:[u.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,150px)_124px_44px_44px] lg:items-center",children:[u.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[u.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ar,{featureNum:a.number,phaseNum:l.number,featureId:a.id,phaseId:l.id}),u.jsx(lr,{id:il({featureNum:a.number,phaseNum:l.number}),children:u.jsx("span",{className:"sr-only",children:"Copy phase path"})}),l.shortId?u.jsx(ol,{shortId:l.shortId}):null,l.handoff?u.jsx(Rm,{phaseId:l.id,updatedAt:l.handoffUpdatedAt}):null,u.jsx(F0,{phaseId:l.id,phaseTitle:l.title,count:((N=l.linkedRequirements)==null?void 0:N.length)??0}),u.jsx("span",{className:"shrink-0",children:u.jsx(Fo,{status:x.displayStatus,breakdown:x.breakdown})})]}),u.jsx(Ve,{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})]}),u.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[u.jsx(Ve,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,children:u.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:u.jsx(vs,{className:"h-3.5 w-3.5"})})}),u.jsx(c.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,onSubmit:w=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||w.preventDefault()},children:u.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:u.jsx(hi,{className:"h-4 w-4"})})})]})]}),u.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[u.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l.tasks.length," tasks"]}),g?u.jsx("div",{className:"mt-0.5 break-words",children:g}):null]}),u.jsx(s.Form,{method:"post",action:`/features/${t}/phases/${l.id}/status`,className:"w-full lg:w-auto",children:u.jsxs("div",{className:"relative",children:[u.jsx("select",{name:"status",value:f,disabled:m||p,"aria-busy":m,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:w=>s.submit(w.currentTarget.form),children:cd.map(w=>u.jsx("option",{value:w.value,children:w.label},w.value))}),u.jsx(bs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),u.jsx(Ve,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,className:"hidden lg:block",children:u.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:u.jsx(vs,{className:"h-3.5 w-3.5"})})}),u.jsx(c.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,className:"hidden lg:block",onSubmit:w=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||w.preventDefault()},children:u.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:u.jsx(hi,{className:"h-4 w-4"})})})]}),u.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:u.jsx(cl,{value:l.updatedAt})}),l.summary?u.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:l.summary}):null]})}function Vm({items:t,className:a="",stacked:l=!1}){return l?u.jsx("nav",{"aria-label":"Breadcrumb",className:`grid gap-1 text-sm ${a}`,children:t.map((s,c)=>{const o=c===t.length-1,f=s.to&&!o?u.jsx(Ve,{to:s.to,className:"font-semibold text-[var(--accent)] hover:underline break-words min-w-0",children:s.label}):u.jsx("span",{className:`break-words min-w-0 ${o?"text-[var(--text)] font-semibold":"text-[var(--text-muted)]"}`,children:s.label});return u.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[s.kind?u.jsxs("span",{className:"shrink-0 text-[var(--text-subtle)] font-medium",children:[s.kind,":"]}):null,u.jsx("span",{className:"min-w-0",children:f})]},`${s.label}-${c}`)})}):u.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${a}`,children:t.map((s,c)=>{const o=c===t.length-1,f=s.to&&!o?u.jsx(Ve,{to:s.to,className:"font-semibold text-[var(--accent)] hover:underline",children:s.label}):u.jsx("span",{className:o?"text-[var(--text)]":"text-[var(--text-muted)]",children:s.label});return u.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[c>0?u.jsx("span",{className:"text-[var(--text-subtle)]",children:"/"}):null,u.jsx("span",{className:"min-w-0 break-words",children:f})]},`${s.label}-${c}`)})})}function Fm({featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:c,taskId:o,shortId:f,children:m}){return u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(ar,{featureNum:t,phaseNum:a,taskNum:l,featureId:s,phaseId:c,taskId:o}),u.jsx(lr,{id:il({featureNum:t,phaseNum:a,taskNum:l}),children:u.jsx("span",{className:"sr-only",children:"Copy path"})}),f?u.jsx(ol,{shortId:f}):null,m]})}function zn({className:t="",children:a,...l}){return u.jsx("div",{className:`surface-card p-4 ${t}`,...l,children:a})}function Zx(...t){return t.filter(Boolean).join(" ")}function Ym({items:t,className:a}){const l=t.filter(s=>s.visible!==!1);return l.length===0?null:u.jsx("div",{className:Zx("grid gap-4 md:grid-cols-2 xl:grid-cols-4",a),children:l.map(s=>u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:s.label}),u.jsx("div",{className:Zx("mt-2 text-sm font-semibold break-words text-[var(--text)] [overflow-wrap:anywhere]",s.valueClassName),children:s.value})]},s.label))})}function Gm(t){return t&&t>0?`P${t}`:""}function xD(t,a){return!t&&!a?"":`${t||"Start not set"} → ${a||"End not set"}`}const bD=250;function bu(t){return`inline-flex h-9 min-h-9 shrink-0 items-center justify-center whitespace-nowrap rounded-[9px] border px-2 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] sm:h-9 sm:min-h-9 sm:rounded-[10px] sm:px-2.5 ${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)]"}`}function t1({entityKind:t,statusOptions:a,value:l,onChange:s,sortSlot:c}){const[o,f]=v.useState(l.query),m=v.useRef(null),p=v.useRef(l);p.current=l,v.useEffect(()=>{f(l.query)},[l.query]),v.useEffect(()=>()=>{m.current!==null&&window.clearTimeout(m.current)},[]);const g=j=>{m.current!==null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>{s({...p.current,query:j})},bD)},x=j=>{f(j),g(j)},y=j=>{s({...p.current,[j]:!p.current[j]})},N=j=>{s({...p.current,status:j})},w=()=>{m.current!==null&&window.clearTimeout(m.current),f(""),s({query:"",status:"",hideDone:!1,hidePlanned:!1,onlyActive:!1})},S=((a==null?void 0:a.length)??0)>0;return u.jsxs("div",{className:"surface-card flex flex-col gap-3 p-3 sm:p-4",children:[u.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[u.jsxs("div",{className:"min-w-[180px] flex-1",children:[u.jsx("label",{htmlFor:"detail-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Search"}),u.jsx(ua,{id:"detail-filter-query",value:o,onChange:j=>x(j.target.value),placeholder:t==="task"?"Search task title, number, or shortId":"Search phase title, number, or shortId",className:"h-9 py-2"})]}),c]}),u.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[S?u.jsxs("div",{children:[u.jsx("label",{htmlFor:"detail-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),u.jsx("div",{className:"flex items-center rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1.5 sm:rounded-[14px] sm:px-3 sm:py-2",children:u.jsxs(Pl,{id:"detail-filter-status",value:l.status,onChange:j=>N(j.target.value),className:"h-9 appearance-none border-0 bg-transparent py-0 pr-8",children:[u.jsx("option",{value:"",children:"All statuses"}),a==null?void 0:a.map(j=>u.jsx("option",{value:j.value,children:j.label},j.value))]})})]}):null,u.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1.5 overflow-x-auto rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1.5 [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5 sm:gap-2 sm:rounded-[14px] sm:px-3 sm:py-2",children:[u.jsx("button",{type:"button",onClick:()=>y("hideDone"),className:bu(l.hideDone),children:"Hide Done"}),u.jsx("button",{type:"button",onClick:()=>y("hidePlanned"),className:bu(l.hidePlanned),children:"Hide Planned"}),u.jsx("button",{type:"button",onClick:()=>y("onlyActive"),className:bu(l.onlyActive),children:"Only active"}),u.jsx("button",{type:"button",onClick:w,className:bu(!1),children:"Clear"})]})]})]})}function Xm({decisions:t}){return t.length===0?null:u.jsxs("details",{className:"group mt-4",children:[u.jsx("summary",{className:"flex cursor-pointer select-none items-center gap-2 font-semibold text-[var(--text)]",children:u.jsxs("span",{children:["Accepted decisions (",t.length,")"]})}),u.jsx("div",{className:"mt-2 grid gap-3",children:t.map(a=>u.jsxs("div",{className:"surface-card px-4 py-3",children:[u.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:a.title}),a.decision?u.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[u.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"}),u.jsx(bn,{text:a.decision,className:"mt-1"})]}):null,a.rationale?u.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[u.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"}),u.jsx(bn,{text:a.rationale,className:"mt-1"})]}):null,a.implementationNotes?u.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[u.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"}),u.jsx(bn,{text:a.implementationNotes,className:"mt-1"})]}):null]},a.id))})]})}const SD={draft:qN,discovery:bR,planned:Po,"in-progress":Fb,done:xm,blocked:Yb,waiting:bm,deferred:NR,canceled:Pb,rejected:PN};function qh(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Jx(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}const wD=new Set(["canceled","rejected"]);function Qm({statusLog:t,currentStatus:a,backbone:l,createdAt:s,updatedAt:c,startedAt:o,completedAt:f}){const m=[];if(t.length===0){const S=l.indexOf(a);if(S>=0)for(let j=0;j<=S;j++)m.push(l[j]);else m.push(a)}else{const S=t[0];S&&m.push(S.fromStatus);for(const j of t)m[m.length-1]!==j.toStatus&&m.push(j.toStatus)}m[m.length-1]!==a&&m.push(a);const p=new Set(m),g=a==="done"||wD.has(a),x=S=>{var R,z;if(t.length>0){if(S===((R=t[0])==null?void 0:R.fromStatus))return((z=t[0])==null?void 0:z.date)??"";for(const I of t)if(I.toStatus===S)return I.date;return""}const j=l[0];return S===j?s??"":S==="in-progress"?o??c??"":S==="done"?f??c??"":""},y=[...m];if(!g){const S=l.indexOf(a);if(S>=0&&S+1<l.length){const j=l[S+1];p.has(j)||y.push(j)}}const N=t.length===0?y.filter((S,j)=>j===0||S===a||!!x(S)):y,w=S=>p.has(S)?S===a&&!g?"current":"completed":"pending";return u.jsx("ol",{className:"status-stepper",role:"list","aria-label":"Status progress",children:N.map((S,j)=>{const R=w(S),z=SD[S]??Ku,I=p.has(S),q=x(S),X=q?`${qh(S)} — ${Jx(q)}`:qh(S),ee=j===0?null:I?"traveled":"pending";return u.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:[ee?u.jsx("span",{className:`status-connector status-connector--${ee}`,"aria-hidden":"true"}):null,u.jsx("span",{className:"status-node",title:X,children:u.jsx(z,{className:"status-node-icon"})}),u.jsx("span",{className:"status-step-label",children:qh(S)}),q?u.jsx("span",{className:"status-step-date",children:Jx(q)}):null]},`${S}-${j}`)})})}function Wx(t){return t.split(/[-\s]+/).filter(Boolean).map(a=>a==="and"?"and":a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function ED(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}function ND(t,a,l,s,c){if(t.length>0)return t.map(m=>({date:m.date,fromStatus:m.fromStatus,toStatus:m.toStatus,inferred:!1}));const o=l.indexOf(a);if(o<0)return[];const f=[];for(let m=1;m<=o;m++){const p=l[m-1],g=l[m],x=g==="in-progress"?s??"":g==="done"?c??"":"";f.push({date:x,fromStatus:p,toStatus:g,inferred:!0})}return f}function Km({statusLog:t,currentStatus:a,backbone:l,startedAt:s,completedAt:c}){const o=ND(t??[],a??"",l??[],s,c);return u.jsx(ca,{title:"Status history",count:o.length,defaultOpen:o.length>0,contentClassName:"grid gap-2.5",children:o.length===0?u.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No status changes recorded."}):o.map((f,m)=>u.jsxs("div",{className:"text-sm flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-xs font-mono text-[var(--text-subtle)]",children:ED(f.date)}),u.jsx("span",{className:"font-semibold text-[var(--text-muted)]",children:Wx(f.fromStatus)}),u.jsx("span",{className:"text-[var(--text-subtle)]",children:"→"}),u.jsx("span",{className:"font-semibold text-[var(--text)]",children:Wx(f.toStatus)})]},m))})}function RD(t){return t.reduce((a,l)=>a+l.tasks.length,0)}function jD(t){let a=0,l=0,s=0,c=0;for(const o of t)for(const f of o.tasks)f.status==="in-progress"&&(a+=1),f.status==="done"&&(l+=1),f.status==="blocked"&&(s+=1),["done","canceled"].includes(f.status)||(c+=1);return{inProgress:a,done:l,blocked:s,remaining:c}}function TD(t){return t.find(a=>["in-progress","discovery","planned","draft"].includes(a.status))}function CD(){var ee,ne;const{feature:t,phases:a}=sl(),l=t.acceptedDecisions??[],s=RD(a),c=jD(a),o=TD(a),f=p0(a),[m,p]=Io(),g=((ee=m.get("sort"))==null?void 0:ee.trim())??"priority",x=((ne=m.get("dir"))==null?void 0:ne.trim())??"asc",[y,N]=v.useState(()=>{var M,C;return{query:((M=m.get("q"))==null?void 0:M.trim())??"",status:((C=m.get("status"))==null?void 0:C.trim())??"",hideDone:m.get("hideDone")==="1",hidePlanned:m.get("hidePlanned")==="1",onlyActive:m.get("onlyActive")==="1"}});v.useEffect(()=>{const M=new URL(window.location.href),C=(ue,me,ye="1")=>{me?M.searchParams.set(ue,ye):M.searchParams.delete(ue)};C("q",y.query.trim()!=="",y.query.trim()),C("status",y.status!=="",y.status),C("hideDone",y.hideDone),C("hidePlanned",y.hidePlanned),C("onlyActive",y.onlyActive),window.history.replaceState(window.history.state,"",`${M.pathname}${M.search}${M.hash}`)},[y]);const w={key:g==="priority"||g==="number"||g==="createdAt"||g==="updatedAt"||g==="title"||g==="shortId"||g==="status"||g==="startedAt"||g==="completedAt"?g:"priority",direction:x==="desc"?"desc":"asc"},S=v.useMemo(()=>[...a].sort((M,C)=>jo(M,C,w.key,w.direction)),[a,w]),j=v.useMemo(()=>S.filter(M=>e1(M,y,["in-progress","discovery"])&&ud(y.query,[M.title,String(M.number),M.shortId])),[S,y]),R=kr(),z=v.useRef(null),I=v.useCallback(()=>R("edit"),[R]),q=v.useCallback(()=>R("phases/new"),[R]),X=v.useCallback(()=>{var M;(M=z.current)==null||M.requestSubmit()},[]);return An("edit",I),An("create",q),An("delete",X),u.jsxs("div",{className:"grid gap-8",children:[u.jsxs(Ve,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[u.jsx(Qu,{className:"h-4 w-4"})," Back to features"]}),u.jsxs("div",{className:"min-w-0",children:[u.jsx(Vm,{stacked:!0,items:[{label:t.name,kind:"Feature"}]}),u.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:u.jsx(Fm,{featureNum:t.number,featureId:t.id,shortId:t.shortId,children:u.jsx(Fo,{status:f.displayStatus,breakdown:f.breakdown})})}),u.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?u.jsx(ca,{title:u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"Description"}),u.jsx(cl,{value:t.descriptionUpdatedAt})]}),children:u.jsx(bn,{text:t.description,className:"plan-description max-w-4xl"})}):null,u.jsx("div",{className:"mt-4",children:u.jsx(Qm,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"],createdAt:t.createdAt,updatedAt:t.updatedAt})}),u.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[u.jsx(Ve,{to:"edit",children:u.jsx(gt,{type:"button",shortcut:"edit",children:"Edit feature"})}),u.jsx(da,{ref:z,method:"post",action:`/features/${t.id}/delete`,className:"inline-flex",onSubmit:M=>{window.confirm(`Delete feature "${t.name}"?`)||M.preventDefault()},children:u.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]})]}),u.jsxs(Gt,{className:"grid gap-4",children:[u.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),u.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(o==null?void 0:o.title)||"No active phase"})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),u.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.length})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),u.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:s})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),u.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(o==null?void 0:o.title)||"No active phase"})]})]}),u.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:c.inProgress})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:c.remaining})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:c.done})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:c.blocked})]})]}),u.jsx(Ym,{items:[{label:"Entity last updated",value:ll(t.updatedAt),visible:!!t.updatedAt},{label:"Priority",value:Gm(t.priority),visible:t.priority>0},{label:"Timeline",value:xD(t.startDate,t.endDate),visible:!!(t.startDate||t.endDate)}]}),t.workDone||t.workRemaining?u.jsx(ca,{title:"Planning notes",defaultOpen:!1,children:u.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[t.workDone?u.jsxs("div",{children:[u.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work done"}),u.jsx(bn,{text:t.workDone,className:"mt-2"})]}):null,t.workRemaining?u.jsxs("div",{children:[u.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work remaining"}),u.jsx(bn,{text:t.workRemaining,className:"mt-2"})]}):null]})}):null,l.length>0?u.jsx(Xm,{decisions:l}):null,u.jsx(Km,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"]})]}),u.jsxs(Gt,{className:"grid gap-5",children:[u.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["Phases (",a.length,")"]}),u.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this feature's phases."})]}),u.jsx(Ve,{to:"phases/new",children:u.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),u.jsx(t1,{entityKind:"phase",statusOptions:cd,value:y,onChange:N,sortSlot:u.jsx(Bm,{sort:w,onChange:M=>p(C=>(C.set("sort",M.key),C.set("dir",M.direction),C))})}),u.jsx("div",{className:"grid gap-3",children:a.length===0?u.jsxs(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No phases yet. ",u.jsx(Ve,{to:`/features/${t.id}/phases/new`,className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a phase"})]}):j.length>0?j.map(M=>u.jsx(yD,{featureId:t.id,feature:t,phase:M},M.id)):u.jsx(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),u.jsx(gi,{})]})}async function DD({params:t}){const{featureId:a,phaseId:l}=t;if(!a||!l)throw new Response("featureId and phaseId required",{status:400});const[s,c,o]=await Promise.all([Vo(a),td(l),Em()]),f=o.filter(m=>m.linkedPhaseIds.includes(l));return{feature:s,phase:{...c,linkedRequirements:f}}}function AD({featureId:t,featureNum:a,phaseId:l,phaseNum:s,task:c}){var w;const o=gs(),f=gs(),p=((w=o.formData)==null?void 0:w.get("status"))??c.status,g=o.state!=="idle",x=f.state!=="idle",y=$u(oD(c.subtasks)),N=l0(p);return u.jsxs(bi,{variant:"surface",status:N,className:"px-4 py-2",children:[u.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,168px)_124px_44px_44px] lg:items-center",children:[u.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[u.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ar,{featureNum:a,phaseNum:s,taskNum:c.number,featureId:t,phaseId:l,taskId:c.id}),u.jsx(lr,{id:il({featureNum:a,phaseNum:s,taskNum:c.number}),children:u.jsx("span",{className:"sr-only",children:"Copy task path"})}),c.shortId?u.jsx(ol,{shortId:c.shortId}):null,u.jsx("span",{className:"shrink-0",children:u.jsx(tr,{status:p})})]}),u.jsx(Ve,{to:`/features/${t}/phases/${l}/tasks/${c.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:c.title})]}),u.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[u.jsx(Ve,{to:`/features/${t}/phases/${l}/tasks/${c.id}/edit`,"aria-label":`Edit task ${c.title}`,children:u.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:u.jsx(vs,{className:"h-3.5 w-3.5"})})}),u.jsx(f.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${c.id}/delete`,onSubmit:S=>{window.confirm(`Delete task “${c.title}”? This cannot be undone.`)||S.preventDefault()},children:u.jsx(gt,{type:"submit",variant:"danger",disabled:x||g,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${c.title}`,children:u.jsx(hi,{className:"h-4 w-4"})})})]})]}),u.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[u.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[c.subtasks.length," subtasks · ",c.checklist.length," checklist"]}),y?u.jsx("div",{className:"mt-0.5 break-words",children:y}):u.jsx("div",{className:"mt-0.5 break-words",children:"No subtask statuses yet"})]}),u.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${c.id}/status`,className:"w-full lg:w-auto",children:u.jsxs("div",{className:"relative",children:[u.jsx("select",{name:"status",value:p,disabled:g||x||!!c.pauseSnapshot,"aria-busy":g,title:c.pauseSnapshot?"Resume checkpointed work through task_start so its checkpoint is preserved.":void 0,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:S=>o.submit(S.currentTarget.form),children:$m.map(S=>u.jsx("option",{value:S.value,children:S.label},S.value))}),u.jsx(bs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),u.jsx(Ve,{to:`/features/${t}/phases/${l}/tasks/${c.id}/edit`,"aria-label":`Edit task ${c.title}`,className:"hidden lg:block",children:u.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:u.jsx(vs,{className:"h-3.5 w-3.5"})})}),u.jsx(f.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${c.id}/delete`,className:"hidden lg:block",onSubmit:S=>{window.confirm(`Delete task “${c.title}”? This cannot be undone.`)||S.preventDefault()},children:u.jsx(gt,{type:"submit",variant:"danger",disabled:x||g,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${c.title}`,children:u.jsx(hi,{className:"h-4 w-4"})})})]}),u.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--text-subtle)]",children:[u.jsx(cl,{value:c.updatedAt}),c.startedAt?u.jsxs("span",{children:["Started ",ll(c.startedAt)]}):null,c.completedAt?u.jsxs("span",{children:["Completed ",ll(c.completedAt)]}):null]}),c.description?u.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:c.description}):null]})}function kD(t){let a=0,l=0,s=0,c=0;for(const o of t.tasks)o.status==="in-progress"&&(a+=1),o.status==="done"&&(l+=1),o.status==="blocked"&&(s+=1),["done","canceled"].includes(o.status)||(c+=1);return{inProgress:a,done:l,blocked:s,remaining:c}}function OD(){var me,ye;const{feature:t,phase:a}=sl(),l=a.decisions??[],s=a.acceptedDecisions??[],c=a.linkedRequirements??[],o=kD(a),f=g0(a.tasks),[m,p]=Io(),g=((me=m.get("sort"))==null?void 0:me.trim())??"priority",x=((ye=m.get("dir"))==null?void 0:ye.trim())??"asc",[y,N]=v.useState(()=>{var ae,K;return{query:((ae=m.get("q"))==null?void 0:ae.trim())??"",status:((K=m.get("status"))==null?void 0:K.trim())??"",hideDone:m.get("hideDone")==="1",hidePlanned:m.get("hidePlanned")==="1",onlyActive:m.get("onlyActive")==="1"}});v.useEffect(()=>{const ae=new URL(window.location.href),K=(ge,be,U="1")=>{be?ae.searchParams.set(ge,U):ae.searchParams.delete(ge)};K("q",y.query.trim()!=="",y.query.trim()),K("status",y.status!=="",y.status),K("hideDone",y.hideDone),K("hidePlanned",y.hidePlanned),K("onlyActive",y.onlyActive),window.history.replaceState(window.history.state,"",`${ae.pathname}${ae.search}${ae.hash}`)},[y]);const w={key:g==="priority"||g==="number"||g==="createdAt"||g==="updatedAt"||g==="title"||g==="shortId"||g==="status"||g==="startedAt"||g==="completedAt"?g:"priority",direction:x==="desc"?"desc":"asc"},S=v.useMemo(()=>[...a.tasks].sort((ae,K)=>jo(ae,K,w.key,w.direction)),[a.tasks,w]),j=v.useMemo(()=>S.filter(ae=>e1(ae,y,["in-progress"])&&ud(y.query,[ae.title,String(ae.number),ae.shortId])),[S,y]),R=kr(),z=v.useRef(null),[I,q]=v.useState(a.handoff??""),[X,ee]=v.useState(!1),ne=v.useCallback(()=>R("edit"),[R]),M=v.useCallback(()=>R("tasks/new"),[R]),C=v.useCallback(()=>{var ae;(ae=z.current)==null||ae.requestSubmit()},[]),ue=v.useCallback(async()=>{if(window.confirm("Clear this phase's handoff?")){ee(!0);try{await e0(a.id),q("")}catch{}finally{ee(!1)}}},[a.id]);return An("edit",ne),An("create",M),An("delete",C),u.jsxs("div",{className:"grid gap-8",children:[u.jsxs(Ve,{to:`/features/${t.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[u.jsx(Qu,{className:"h-4 w-4"})," Back to feature"]}),u.jsxs("div",{className:"min-w-0",children:[u.jsx(Vm,{stacked:!0,items:[{label:t.name,to:`/features/${t.id}`,kind:"Feature"},{label:a.title,kind:"Phase"}]}),u.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:u.jsxs(Fm,{featureNum:t.number,phaseNum:a.number,featureId:t.id,phaseId:a.id,shortId:a.shortId,children:[I?u.jsx(Rm,{phaseId:a.id,updatedAt:a.handoffUpdatedAt}):null,u.jsx(Fo,{status:f.displayStatus,breakdown:f.breakdown})]})}),u.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?u.jsx(bn,{text:a.summary,className:"mt-3 max-w-4xl"}):null,u.jsx(Qm,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"],createdAt:a.createdAt,updatedAt:a.updatedAt}),u.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[u.jsx(Ve,{to:"edit",children:u.jsx(gt,{type:"button",shortcut:"edit",children:"Edit phase"})}),u.jsx(da,{ref:z,method:"post",action:`/features/${t.id}/phases/${a.id}/delete`,className:"inline-flex",onSubmit:ae=>{window.confirm(`Delete phase "${a.title}"?`)||ae.preventDefault()},children:u.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]})]}),u.jsxs(Gt,{className:"grid gap-4",children:[u.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),u.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:a.tasks.length})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.inProgress})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.remaining})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.done})]})]}),u.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.blocked})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Goals"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.goals.length})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Dependencies"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.dependencies.length})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completion criteria"}),u.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:a.completionCriteria.length})]})]}),u.jsx(Ym,{items:[{label:"Entity last updated",value:ll(a.updatedAt),visible:!!a.updatedAt},{label:"Priority",value:Gm(a.priority),visible:a.priority>0},{label:"Linked requirements",value:c.length,visible:c.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?u.jsx(ca,{title:"Notes",defaultOpen:!1,children:u.jsx(bn,{text:a.notes,className:"plan-description"})}):null,u.jsx(ca,{title:"Linked requirements",count:c.length,defaultOpen:!1,children:c.length>0?u.jsx("div",{className:"grid gap-3",children:c.map(ae=>u.jsx("div",{className:"min-w-0 rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:u.jsxs("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(tr,{status:ae.status}),ae.macroTasks.length>0?u.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[ae.macroTasks.length," macro task",ae.macroTasks.length===1?"":"s"]}):null]}),u.jsx("h3",{className:"mt-2 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:ae.title}),ae.description?u.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:ae.description}):null]}),u.jsx(Ve,{to:`/requirements#phase-${a.id}`,className:"text-sm font-semibold text-[var(--accent)] hover:underline sm:shrink-0",children:"Open phase requirements →"})]})},ae.id))}):u.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No linked requirements yet."})}),a.description?u.jsx(ca,{title:u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"Description"}),u.jsx(cl,{value:a.descriptionUpdatedAt})]}),children:u.jsx(bn,{text:a.description,className:"plan-description"})}):null,l.length>0?u.jsx(ca,{title:"Decisions",count:l.length,defaultOpen:!1,children:u.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:l.map((ae,K)=>u.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:u.jsx(bn,{text:ae})},K))})}):null,s.length>0?u.jsx(Xm,{decisions:s}):null,u.jsx(Km,{statusLog:a.statusLog??[],currentStatus:a.status,backbone:["draft","discovery","planned","in-progress","done"]})]}),I?u.jsx(Gt,{className:"grid gap-4",children:u.jsx(ca,{title:"Handoff",actions:u.jsx("button",{type:"button",onClick:ue,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:u.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:u.jsx(bn,{text:I,className:"formatted-text max-w-none"})})})}):null,u.jsxs(Gt,{className:"grid gap-5",children:[u.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["Tasks (",a.tasks.length,")"]}),u.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this phase's tasks."})]}),u.jsx(Ve,{to:"tasks/new",children:u.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})})]}),u.jsx(t1,{entityKind:"task",statusOptions:Hm,value:y,onChange:N,sortSlot:u.jsx(Bm,{sort:w,onChange:ae=>p(K=>(K.set("sort",ae.key),K.set("dir",ae.direction),K))})}),u.jsx("div",{className:"grid gap-3",children:a.tasks.length===0?u.jsxs(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No tasks yet. ",u.jsx(Ve,{to:"tasks/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a task"})]}):j.length>0?j.map(ae=>u.jsx(AD,{featureId:t.id,featureNum:t.number,phaseId:a.id,phaseNum:a.number,task:ae},ae.id)):u.jsx(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),u.jsx(gi,{})]})}async function MD({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[c,o,f,m]=await Promise.all([Vo(a),td(l),nd(s),wm()]),p=f.status!=="done"&&f.status!=="canceled"&&f.status!=="rejected"&&(!!f.pauseSnapshot||m.workDeviations.some(g=>g.resumeTaskId===f.id&&(g.state==="resume-required"||g.state==="resolved")));return{feature:c,phase:o,task:f,pendingResume:p}}function _D({snapshot:t,pendingResume:a=!1}){const l=v.useId(),s=a?Gb:bm;return u.jsxs("section",{"aria-labelledby":l,"aria-live":a?"polite":void 0,className:`rounded-[14px] border px-4 py-3 ${a?"border-[var(--accent)] bg-[var(--accent-soft)]":"border-[var(--border)] bg-[var(--surface-elevated)]"}`,children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(s,{className:"h-4 w-4 shrink-0 text-[var(--accent)]","aria-hidden":"true"}),u.jsx("h3",{id:l,className:"text-sm font-bold text-[var(--text)]",children:"Resume checkpoint"}),u.jsx("span",{className:"ml-auto text-[10px] font-semibold uppercase tracking-[0.14em] text-[var(--text-subtle)]",children:ll(t.pausedAt)})]}),u.jsxs("dl",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[u.jsxs("div",{children:[u.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Checkpoint reason"}),u.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.reason})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Work checkpoint"}),u.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.whatWasBeingDone})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Resume from"}),u.jsx("dd",{className:"mt-1 font-mono text-xs text-[var(--text)] [overflow-wrap:anywhere]",children:t.resumeLocation})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"How to resume"}),u.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.howToResume})]})]})]})}function LD({featureId:t,phaseId:a,taskId:l,item:s}){const c=gs(),o=c.formData?c.formData.get("checked")==="true":s.checked,f=c.state!=="idle";return u.jsxs("div",{className:"surface-card flex items-start gap-3 px-4 py-3",children:[u.jsx("input",{type:"checkbox",checked:o,onChange:()=>c.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}`}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("span",{className:"checklist-num",children:s.number})," ",u.jsx("span",{className:`text-sm ${o?"text-[var(--text-muted)] line-through":"font-medium text-[var(--text)]"}`,children:s.title})]})]})}function zD(){var y,N;const{feature:t,phase:a,task:l,pendingResume:s}=sl(),c=l.decisions??[],o=l.acceptedDecisions??[],f=l.checklist??[],m=kr(),p=v.useRef(null),g=v.useCallback(()=>m("edit"),[m]),x=v.useCallback(()=>{var w;(w=p.current)==null||w.requestSubmit()},[]);return An("edit",g),An("delete",x),u.jsxs("div",{className:"grid gap-8",children:[u.jsxs(Ve,{to:`/features/${t.id}/phases/${a.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[u.jsx(Qu,{className:"h-4 w-4"})," Back to phase"]}),u.jsxs("div",{className:"min-w-0",children:[u.jsx(Vm,{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"}]}),u.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:u.jsx(Fm,{featureNum:t.number,phaseNum:a.number,taskNum:l.number,featureId:t.id,phaseId:a.id,taskId:l.id,shortId:l.shortId,children:u.jsx(tr,{status:l.status})})}),u.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}),u.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[u.jsx(Ve,{to:"edit",children:u.jsx(gt,{type:"button",shortcut:"edit",children:"Edit task"})}),u.jsx(da,{ref:p,method:"post",action:`/features/${t.id}/phases/${a.id}/tasks/${l.id}/delete`,className:"inline-flex",onSubmit:w=>{window.confirm(`Delete task "${l.title}"?`)||w.preventDefault()},children:u.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]})]}),u.jsx(Qm,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],createdAt:l.createdAt,updatedAt:l.updatedAt,startedAt:l.startedAt,completedAt:l.completedAt}),l.pauseSnapshot?u.jsx(_D,{snapshot:l.pauseSnapshot,pendingResume:s}):null,u.jsxs(Gt,{className:"grid gap-4",children:[l.description?u.jsx(ca,{title:u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"Description"}),u.jsx(cl,{value:l.descriptionUpdatedAt})]}),children:u.jsx(bn,{text:l.description,className:"plan-description"})}):null,l.notes?u.jsx(ca,{title:"Notes",defaultOpen:!1,children:u.jsx(bn,{text:l.notes})}):null,u.jsx(Km,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],startedAt:l.startedAt,completedAt:l.completedAt}),c.length>0?u.jsx(ca,{title:"Decisions",count:c.length,defaultOpen:!1,children:u.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:c.map((w,S)=>u.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:u.jsx(bn,{text:w})},S))})}):null,o.length>0?u.jsx(Xm,{decisions:o}):null,u.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Checklist items"}),u.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:f.length})]}),u.jsxs(zn,{children:[u.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Subtasks"}),u.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:((y=l.subtasks)==null?void 0:y.length)??0})]})]}),u.jsx(Ym,{items:[{label:"Entity last updated",value:ll(l.updatedAt),visible:!!l.updatedAt},{label:"Priority",value:Gm(l.priority),visible:l.priority>0},{label:"Short name",value:l.shortName,visible:!!l.shortName},{label:"Started",value:ll(l.startedAt),visible:!!l.startedAt},{label:"Completed",value:ll(l.completedAt),visible:!!l.completedAt},{label:"Phase",value:a.title}]}),u.jsxs("div",{className:"grid gap-3",children:[u.jsx("div",{children:u.jsxs("h3",{className:"text-sm font-bold text-[var(--text)]",children:["Steps (",f.length,")"]})}),f.length?u.jsx("div",{className:"grid gap-2",children:f.map(w=>u.jsx(LD,{featureId:t.id,phaseId:a.id,taskId:l.id,item:w},w.id))}):u.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No steps defined."})]}),(N=l.subtasks)!=null&&N.length?u.jsx(ca,{title:"Subtasks",count:l.subtasks.length,defaultOpen:!1,contentClassName:"grid gap-2",children:l.subtasks.map(w=>u.jsxs("div",{className:"surface-card flex items-center justify-between gap-4 px-4 py-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:w.title}),u.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:w.id})]}),u.jsx(tr,{status:w.status})]},w.id))}):null]}),u.jsx(gi,{})]})}const UD=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Vl({title:t,description:a,children:l}){const s=kr(),c=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{var g;const f=c.current;if(!f)return;const m=document.activeElement;(g=o.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(UD)).filter(j=>j.offsetParent!==null);if(y.length===0){x.preventDefault(),f.focus();return}const N=y[0],w=y[y.length-1],S=document.activeElement;x.shiftKey?(S===N||!f.contains(S))&&(x.preventDefault(),w.focus()):S===w&&(x.preventDefault(),N.focus())};return window.addEventListener("keydown",p),()=>{var x;window.removeEventListener("keydown",p),(x=m==null?void 0:m.focus)==null||x.call(m)}},[s]),u.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto p-4 md:p-6",children:[u.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(-1),"aria-hidden":"true",tabIndex:-1}),u.jsx("div",{className:"relative z-10 flex min-h-full items-start justify-center",children:u.jsxs("div",{ref:c,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:[u.jsxs("div",{className:"mb-6 flex shrink-0 items-start justify-between gap-4",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:t}),a?u.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:a}):null]}),u.jsx("button",{ref:o,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:u.jsx(Qb,{className:"h-4 w-4"})})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:l})]})})]})}function Fl({className:t="",children:a,...l}){return u.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 u.jsxs("label",{className:"grid gap-2",children:[u.jsx("span",{className:"text-sm font-semibold text-[var(--text-muted)]",children:t}),a]})}function pn(t){return u.jsx("textarea",{className:"field-control field-textarea",...t})}function BD(){const a=pr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var c;return(c=l.current)==null?void 0:c.requestSubmit()},[]);return An("submit",s,{allowInEditable:!0}),u.jsx(Vl,{title:"Create feature",description:"Top-level container for phases and tasks.",children:u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Feature name",children:u.jsx(ua,{name:"name",placeholder:"Products page implementation",required:!0})}),u.jsx(lt,{label:"Description",children:u.jsx(pn,{name:"description",placeholder:"Short context for the feature"})}),u.jsx(Fl,{children:u.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create feature"})})]})})}function HD(){const a=pr().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 o=xs("feature-detail").feature;return u.jsx(Vl,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Name",children:u.jsx(ua,{name:"name",defaultValue:o.name,required:!0})}),u.jsx(lt,{label:"Description",children:u.jsx(pn,{name:"description",defaultValue:o.description})}),u.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[u.jsx(lt,{label:"Start date",children:u.jsx(ua,{type:"date",name:"startDate",defaultValue:o.startDate})}),u.jsx(lt,{label:"End date",children:u.jsx(ua,{type:"date",name:"endDate",defaultValue:o.endDate})})]}),u.jsx(lt,{label:"Status",children:u.jsx(Pl,{name:"status",defaultValue:o.status,children:od.map(f=>u.jsx("option",{value:f.value,children:f.label},f.value))})}),u.jsx(lt,{label:"Priority",children:u.jsx(ua,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),u.jsx(ca,{title:"Planning notes",subtitle:"Optional agent-maintained notes for progress tracking.",defaultOpen:!1,className:"mt-0",children:u.jsxs("div",{className:"grid gap-4",children:[u.jsx(lt,{label:"Work done",children:u.jsx(pn,{name:"workDone",defaultValue:o.workDone})}),u.jsx(lt,{label:"Work remaining",children:u.jsx(pn,{name:"workRemaining",defaultValue:o.workRemaining})})]})}),u.jsx(Fl,{children:u.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save feature"})})]})})}function $D(){const a=pr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var c;return(c=l.current)==null?void 0:c.requestSubmit()},[]);return An("submit",s,{allowInEditable:!0}),u.jsx(Vl,{title:"Create phase",description:"A phase belongs to the current feature.",children:u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Phase title",children:u.jsx(ua,{name:"title",placeholder:"API creation",required:!0})}),u.jsx(lt,{label:"Summary",children:u.jsx(pn,{name:"summary",placeholder:"Brief phase summary"})}),u.jsx(lt,{label:"Description",children:u.jsx(pn,{name:"description",placeholder:"Initial implementation notes"})}),u.jsx(Fl,{children:u.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create phase"})})]})})}function ri(t){return t.join(`
|
|
294
|
+
`)}function qD(){const a=pr().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 o=xs("phase-detail").phase;return u.jsx(Vl,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Title",children:u.jsx(ua,{name:"title",defaultValue:o.title,required:!0})}),u.jsx(lt,{label:"Status",children:u.jsx(Pl,{name:"status",defaultValue:o.status,children:cd.map(f=>u.jsx("option",{value:f.value,children:f.label},f.value))})}),u.jsx(lt,{label:"Priority",children:u.jsx(ua,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),u.jsx(lt,{label:"Summary",children:u.jsx(pn,{name:"summary",defaultValue:o.summary})}),u.jsx(lt,{label:"Description",children:u.jsx(pn,{name:"description",defaultValue:o.description})}),u.jsx(lt,{label:"Goals (one per line)",children:u.jsx(pn,{name:"goals",defaultValue:ri(o.goals)})}),u.jsx(lt,{label:"Non-goals (one per line)",children:u.jsx(pn,{name:"nonGoals",defaultValue:ri(o.nonGoals)})}),u.jsx(lt,{label:"Dependencies (one per line)",children:u.jsx(pn,{name:"dependencies",defaultValue:ri(o.dependencies)})}),u.jsx(lt,{label:"Risks (one per line)",children:u.jsx(pn,{name:"risks",defaultValue:ri(o.risks)})}),u.jsx(lt,{label:"Open questions (one per line)",children:u.jsx(pn,{name:"openQuestions",defaultValue:ri(o.openQuestions)})}),u.jsx(lt,{label:"Completion criteria (one per line)",children:u.jsx(pn,{name:"completionCriteria",defaultValue:ri(o.completionCriteria)})}),u.jsx(Fl,{children:u.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save phase"})})]})})}function ID(){const a=pr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var c;return(c=l.current)==null?void 0:c.requestSubmit()},[]);return An("submit",s,{allowInEditable:!0}),u.jsx(Vl,{title:"Create task",description:"A task belongs to the current phase.",children:u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Task title",children:u.jsx(ua,{name:"title",placeholder:"Custom fetcher integration",required:!0})}),u.jsx(lt,{label:"Description",children:u.jsx(pn,{name:"description",placeholder:"Initial task context"})}),u.jsx(lt,{label:"Checklist (one per line)",children:u.jsx(pn,{name:"checklist",placeholder:`Step one
|
|
295
|
+
Step two
|
|
296
|
+
Step three`})}),u.jsx(lt,{label:"Status",children:u.jsx(Pl,{name:"status",defaultValue:"planned",children:$m.map(c=>u.jsx("option",{value:c.value,children:c.label},c.value))})}),u.jsx(Fl,{children:u.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create task"})})]})})}function PD(t){return t.map(a=>a.title).join(`
|
|
297
|
+
`)}function VD(){const a=pr().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 o=xs("task-detail").task;return u.jsx(Vl,{title:"Edit task",description:"Update execution details and checklist items.",children:u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Title",children:u.jsx(ua,{name:"title",defaultValue:o.title,required:!0})}),u.jsx(lt,{label:"Status",children:u.jsx(Pl,{name:"status",defaultValue:o.status,disabled:!!o.pauseSnapshot,title:o.pauseSnapshot?"Resume checkpointed work through task_start so its checkpoint is preserved.":void 0,children:$m.map(f=>u.jsx("option",{value:f.value,children:f.label},f.value))})}),u.jsx(lt,{label:"Priority",children:u.jsx(ua,{type:"number",name:"priority",defaultValue:o.priority??0,min:0})}),u.jsx(lt,{label:"Description",children:u.jsx(pn,{name:"description",defaultValue:o.description})}),u.jsx(lt,{label:"Checklist (one per line)",children:u.jsx(pn,{name:"checklist",defaultValue:PD(o.checklist)})}),u.jsx(Fl,{children:u.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save task"})})]})})}function FD(){const a=pr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);An("submit",s,{allowInEditable:!0});const{project:c}=xs("root");return u.jsxs("div",{className:"grid gap-8",children:[u.jsxs(Ve,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[u.jsx(Qu,{className:"h-4 w-4"})," Back to dashboard"]}),u.jsxs(Gt,{className:"grid gap-5",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:"Edit project overview"}),u.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."})]}),u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Project name",children:u.jsx(ua,{name:"name",defaultValue:c.name,placeholder:"Project name",required:!0})}),u.jsx(lt,{label:"Short description",children:u.jsx(pn,{name:"description",defaultValue:c.description,placeholder:"Summarize the project in a few lines for the dashboard overview"})}),u.jsx(lt,{label:"Project goal",children:u.jsx(pn,{name:"goal",defaultValue:c.goal,placeholder:"Define the main objective, success criteria, and overall direction of the project"})}),u.jsxs("div",{className:"flex justify-end gap-3",children:[u.jsx(Ve,{to:"/",children:u.jsx(gt,{type:"button",variant:"ghost",children:"Cancel"})}),u.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Saving…":"Save project overview"})]})]})]})]})}function YD(t){return`P${String(t.number??0).padStart(3,"0")}`}function n1({phases:t,selectedIds:a=[]}){const l=new Set(a);return u.jsx(lt,{label:"Linked phases",children:t.length===0?u.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."}):u.jsxs("div",{className:"grid gap-2 rounded-[16px] border border-[var(--border)] bg-[var(--surface-elevated)] p-3",children:[u.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Select the phases that directly implement or track this requirement."}),u.jsx("div",{className:"grid gap-2 max-h-[32dvh] overflow-y-auto pr-1",children:t.map(s=>u.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:[u.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)]"}),u.jsxs("span",{className:"min-w-0",children:[u.jsxs("span",{className:"block font-semibold",children:[YD(s)," — ",s.title]}),s.summary?u.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-muted)]",children:s.summary}):null]})]},s.id))})]})})}function GD(){const a=pr().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);An("submit",s,{allowInEditable:!0});const{phases:c}=xs("requirements");return u.jsx(Vl,{title:"Create requirement",description:"Capture a top-level outcome that phases can implement and track.",children:u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Requirement title",children:u.jsx(ua,{name:"title",placeholder:"Self-hosted Claude Code plugin marketplace distribution",required:!0})}),u.jsx(lt,{label:"Description",children:u.jsx(pn,{name:"description",placeholder:"Describe the user/business outcome this requirement represents"})}),u.jsx(lt,{label:"Status",children:u.jsx(Pl,{name:"status",defaultValue:"planned",children:q0.map(o=>u.jsx("option",{value:o.value,children:o.label},o.value))})}),u.jsx(n1,{phases:c}),u.jsx(Fl,{children:u.jsx(gt,{type:"submit",variant:"primary",disabled:a,shortcut:"submit",children:a?"Creating…":"Create requirement"})})]})})}function XD(){const a=pr().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:c}=pE(),{phases:o,requirements:f}=xs("requirements"),m=f.find(p=>p.id===c);return m?u.jsx(Vl,{title:"Edit requirement",description:"Update status, scope notes, and linked delivery phases.",children:u.jsxs(da,{ref:l,method:"post",className:"grid gap-4",children:[u.jsx(lt,{label:"Requirement title",children:u.jsx(ua,{name:"title",defaultValue:m.title,required:!0})}),u.jsx(lt,{label:"Description",children:u.jsx(pn,{name:"description",defaultValue:m.description})}),u.jsx(lt,{label:"Status",children:u.jsx(Pl,{name:"status",defaultValue:m.status,children:q0.map(p=>u.jsx("option",{value:p.value,children:p.label},p.value))})}),u.jsx(n1,{phases:o,selectedIds:m.linkedPhaseIds}),u.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."}),u.jsx(Fl,{children:u.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 Zm(t,a){const l=t.get(a);if(typeof l!="string")return 0;const s=l.trim();if(s==="")return 0;const c=Number(s);return Number.isFinite(c)?c:0}function Bl(t,a){return Bn(t,a).split(`
|
|
298
|
+
`).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 QD({request:t}){const a=await t.formData();return await OR({name:Jn(a,"name"),description:Bn(a,"description")}),Ha("/features")}async function KD({request:t,params:a}){const l=sn(a,"featureId"),s=await Vo(l),c=await t.formData();return await Jb({...s,name:Jn(c,"name"),description:Bn(c,"description"),startDate:Bn(c,"startDate"),endDate:Bn(c,"endDate"),status:Jn(c,"status"),priority:Zm(c,"priority"),workDone:Bn(c,"workDone"),workRemaining:Bn(c,"workRemaining")}),Ha(`/features/${l}`)}async function ZD({params:t}){return await MR(sn(t,"featureId")),Ha("/features")}async function JD({request:t,params:a}){const l=sn(a,"featureId"),s=await Vo(l),c=await t.formData();return await Jb({...s,status:Jn(c,"status")}),null}async function WD({request:t,params:a}){const l=sn(a,"featureId"),s=await t.formData();return await UR({featureId:l,title:Jn(s,"title"),summary:Bn(s,"summary"),description:Bn(s,"description")}),Ha(`/features/${l}`)}async function eA({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),c=await td(s),o=await t.formData();return await Wb({...c,title:Jn(o,"title"),status:Jn(o,"status"),priority:Zm(o,"priority"),summary:Bn(o,"summary"),description:Bn(o,"description"),goals:Bl(o,"goals"),nonGoals:Bl(o,"nonGoals"),dependencies:Bl(o,"dependencies"),risks:Bl(o,"risks"),openQuestions:Bl(o,"openQuestions"),completionCriteria:Bl(o,"completionCriteria")}),Ha(`/features/${l}/phases/${s}`)}async function tA({params:t}){const a=sn(t,"featureId"),l=sn(t,"phaseId");return await BR(l),Ha(`/features/${a}`)}async function nA({request:t,params:a}){const l=sn(a,"phaseId"),s=await td(l),c=await t.formData();return await Wb({...s,status:Jn(c,"status")}),null}async function aA({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),c=await t.formData(),o=Bl(c,"checklist");return await HR(s,{title:Jn(c,"title"),description:Bn(c,"description"),status:Bn(c,"status")||"planned",...o.length?{checklist:o}:{}}),Ha(`/features/${l}/phases/${s}`)}function rA(t,a){const l=new Map(t.map(c=>[c.id,c])),s=new Map(t.map(c=>[c.title.trim().toLowerCase(),c]));return a.map((c,o)=>{var p;const f=c.trim().toLowerCase(),m=l.get(((p=t[o])==null?void 0:p.id)??"")??s.get(f);return m?{...m,number:o+1,title:c.trim()}:{id:`check-${o+1}-${f.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,number:o+1,title:c.trim(),checked:!1}})}async function lA({request:t,params:a}){const l=sn(a,"featureId"),s=sn(a,"phaseId"),c=sn(a,"taskId"),o=await nd(c),f=await t.formData();return await Nm({...o,phaseId:s,title:Jn(f,"title"),status:Jn(f,"status"),priority:Zm(f,"priority"),description:Bn(f,"description"),checklist:rA(o.checklist,Bl(f,"checklist"))}),Ha(`/features/${l}/phases/${s}/tasks/${c}`)}async function sA({params:t}){const a=sn(t,"featureId"),l=sn(t,"phaseId"),s=sn(t,"taskId");return await $R(s),Ha(`/features/${a}/phases/${l}`)}async function iA({request:t,params:a}){const l=sn(a,"phaseId"),s=sn(a,"taskId"),c=await nd(s),o=await t.formData();return await Nm({...c,phaseId:l,status:Jn(o,"status")}),null}async function oA({request:t}){const a=await wm(),l=await t.formData();return await AR({...a,name:Bn(l,"name")||a.name,description:Bn(l,"description"),goal:Bn(l,"goal")}),Ha("/")}async function cA({request:t}){const a=await t.formData();return await _R({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)}),Ha("/requirements")}async function uA({request:t,params:a}){const l=sn(a,"requirementId"),s=(await Em()).find(o=>o.id===l);if(!s)throw new Response(`Requirement not found: ${l}`,{status:404});const c=await t.formData();return await LR({...s,title:Jn(c,"title"),description:Bn(c,"description"),status:Jn(c,"status"),linkedPhaseIds:c.getAll("linkedPhaseIds").filter(o=>typeof o=="string").map(o=>o.trim()).filter(Boolean)}),Ha("/requirements")}async function dA({params:t}){return await zR(sn(t,"requirementId")),Ha("/requirements")}function fA(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function hA(){return{handoffs:await Kh()}}function mA(){const{handoffs:t}=sl(),[a,l]=v.useState(t),[s,c]=v.useState(null),[o,f]=v.useState(""),m=$a();async function p(g){if(!(s||!window.confirm(`Clear handoff for ${g.compositeRef}?`))){c(g.phaseId),f("");try{await e0(g.phaseId),l(y=>y.filter(N=>N.phaseId!==g.phaseId)),Kh().then(l).catch(()=>{})}catch(y){const N=y instanceof Response?await y.text().catch(()=>""):y instanceof Error?y.message:String(y);f(N||`Failed to clear handoff for ${g.compositeRef}.`)}finally{c(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")&&Kh().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?u.jsxs(Gt,{className:"grid gap-4",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[u.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),u.jsx(Ve,{to:"/handoff/archive",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"View archive →"})]}),u.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Pending entity-scoped handoffs on non-completed phases."})]}),o?u.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:o}):null,u.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No pending phase handoffs."})]}):u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[u.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),u.jsx(Ve,{to:"/handoff/archive",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"View archive →"})]}),u.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Pending entity-scoped handoffs on non-completed phases. ",a.length," pending."]})]}),o?u.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:o}):null,a.map(g=>u.jsx("section",{id:g.phaseId,className:"scroll-mt-20",children:u.jsx(Gt,{className:"overflow-hidden p-0",children:u.jsx(ca,{defaultOpen:!1,title:u.jsxs(u.Fragment,{children:[u.jsx(lr,{id:g.compositeRef,children:g.compositeRef}),u.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Updated ",fA(g.updatedAt)]})]}),subtitle:g.firstLine||"Empty handoff content.",summaryClassName:"hover:bg-[var(--surface-hover)]/60 focus-visible:bg-[var(--surface-hover)]/60",actions:u.jsxs(u.Fragment,{children:[u.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"}),u.jsx(Ve,{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?u.jsx(bn,{text:g.content,className:"formatted-text max-w-none"}):u.jsx("p",{className:"text-sm italic text-[var(--text-muted)]",children:"Empty handoff content."})})})},g.phaseId))]})}function pA(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function gA(){return{archived:await PR()}}function vA(){const{archived:t}=sl();return t.length===0?u.jsxs(Gt,{className:"grid gap-4",children:[u.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Archived handoffs"}),u.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Completed, superseded, and manually cleared handoffs."})]}),u.jsx(Ve,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),u.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No archived handoffs."})]}):u.jsxs("div",{className:"grid gap-4",children:[u.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Archived handoffs"}),u.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:[t.length," archived entries. These are history, not pending resume context."]})]}),u.jsx(Ve,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),t.map(a=>u.jsx(Gt,{className:"overflow-hidden p-0",children:u.jsxs(ca,{defaultOpen:!1,title:u.jsxs(u.Fragment,{children:[u.jsx(lr,{id:a.compositeRef,children:a.compositeRef}),u.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Archived ",pA(a.archivedAt)]})]}),subtitle:a.firstLine||"Empty archived handoff.",contentClassName:"px-5 py-5",children:[u.jsxs("div",{className:"mb-3 flex flex-wrap gap-2 text-xs text-[var(--text-muted)]",children:[u.jsxs("span",{children:["Reason: ",a.reason||"unknown"]}),u.jsxs("span",{className:"break-all",children:["File: ",a.file]})]}),u.jsx(bn,{text:a.content||"(archive file unavailable)",className:"formatted-text max-w-none"})]})},`${a.phaseId}:${a.file}`))]})}async function yA({request:t,params:a}){sn(a,"featureId");const l=sn(a,"phaseId"),s=sn(a,"taskId"),c=sn(a,"itemId"),o=await t.formData(),f=Jn(o,"checked")==="true",m=await nd(s);return await Nm({...m,phaseId:l,checklist:m.checklist.map(p=>p.id===c?{...p,checked:f}:p)}),Response.json({ok:!0,taskId:s,itemId:c,checked:f})}const xA=oN([{id:"root",path:"/",loader:x2,element:u.jsx(b2,{}),errorElement:u.jsx(S2,{}),children:[{index:!0,loader:w2,element:u.jsx(lD,{})},{path:"features",id:"features",loader:sD,element:u.jsx(fD,{}),children:[{path:"new",element:u.jsx(BD,{}),action:QD}]},{path:"features/:featureId",id:"feature-detail",loader:vD,element:u.jsx(CD,{}),children:[{path:"edit",element:u.jsx(HD,{}),action:KD},{path:"phases/new",element:u.jsx($D,{}),action:WD}]},{path:"requirements",id:"requirements",loader:hD,element:u.jsx(gD,{}),children:[{path:"new",element:u.jsx(GD,{}),action:cA},{path:":requirementId/edit",element:u.jsx(XD,{}),action:uA}]},{path:"project/edit",element:u.jsx(FD,{}),action:oA},{path:"handoff",loader:hA,element:u.jsx(mA,{})},{path:"handoff/archive",loader:gA,element:u.jsx(vA,{})},{path:"features/:featureId/delete",action:ZD},{path:"requirements/:requirementId/delete",action:dA},{path:"features/:featureId/status",action:JD},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:DD,element:u.jsx(OD,{}),children:[{path:"edit",element:u.jsx(qD,{}),action:eA},{path:"tasks/new",element:u.jsx(ID,{}),action:aA}]},{path:"features/:featureId/phases/:phaseId/delete",action:tA},{path:"features/:featureId/phases/:phaseId/status",action:nA},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:MD,element:u.jsx(zD,{}),children:[{path:"edit",element:u.jsx(VD,{}),action:lA}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:sA},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:iA},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:yA}]}]),a1=document.getElementById("root");if(!a1)throw new Error("#root not found");KS.createRoot(a1).render(u.jsx(v.StrictMode,{children:u.jsx(yN,{router:xA})}));
|