@agent-plan/pi-adapter 0.2.21 → 0.2.22-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +252 -73
- package/dist/ui/paginate.d.ts +29 -0
- package/dist/ui/paginate.d.ts.map +1 -0
- package/dist/ui/paginate.js +73 -0
- package/package.json +3 -3
- 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
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
var TS=Object.defineProperty;var CS=(t,n,l)=>n in t?TS(t,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[n]=l;var fa=(t,n,l)=>CS(t,typeof n!="symbol"?n+"":n,l);function AS(t,n){for(var l=0;l<n.length;l++){const s=n[l];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in t)){const u=Object.getOwnPropertyDescriptor(s,o);u&&Object.defineProperty(t,o,u.get?u:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function l(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=l(o);fetch(o.href,u)}})();function DS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ch={exports:{}},oo={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Sy;function kS(){if(Sy)return oo;Sy=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function l(s,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:t,type:s,key:f,ref:o!==void 0?o:null,props:u}}return oo.Fragment=n,oo.jsx=l,oo.jsxs=l,oo}var wy;function OS(){return wy||(wy=1,ch.exports=kS()),ch.exports}var c=OS(),dh={exports:{}},et={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ey;function MS(){if(Ey)return et;Ey=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),N=Symbol.iterator;function S(C){return C===null||typeof C!="object"?null:(C=N&&C[N]||C["@@iterator"],typeof C=="function"?C:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,R={};function L(C,V,ae){this.props=C,this.context=V,this.refs=R,this.updater=ae||w}L.prototype.isReactComponent={},L.prototype.setState=function(C,V){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,V,"setState")},L.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function I(){}I.prototype=L.prototype;function q(C,V,ae){this.props=C,this.context=V,this.refs=R,this.updater=ae||w}var X=q.prototype=new I;X.constructor=q,A(X,L.prototype),X.isPureReactComponent=!0;var W=Array.isArray;function ne(){}var z={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(C,V,ae){var me=ae.ref;return{$$typeof:t,type:C,key:V,ref:me!==void 0?me:null,props:ae}}function fe(C,V){return ee(C.type,V,C.props)}function be(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function ye(C){var V={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ae){return V[ae]})}var te=/\/+/g;function re(C,V){return typeof C=="object"&&C!==null&&C.key!=null?ye(""+C.key):V.toString(36)}function ge(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(ne,ne):(C.status="pending",C.then(function(V){C.status==="pending"&&(C.status="fulfilled",C.value=V)},function(V){C.status==="pending"&&(C.status="rejected",C.reason=V)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function U(C,V,ae,me,Ne){var je=typeof C;(je==="undefined"||je==="boolean")&&(C=null);var ze=!1;if(C===null)ze=!0;else switch(je){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(C.$$typeof){case t:case n:ze=!0;break;case x:return ze=C._init,U(ze(C._payload),V,ae,me,Ne)}}if(ze)return Ne=Ne(C),ze=me===""?"."+re(C,0):me,W(Ne)?(ae="",ze!=null&&(ae=ze.replace(te,"$&/")+"/"),U(Ne,V,ae,"",function(at){return at})):Ne!=null&&(be(Ne)&&(Ne=fe(Ne,ae+(Ne.key==null||C&&C.key===Ne.key?"":(""+Ne.key).replace(te,"$&/")+"/")+ze)),V.push(Ne)),1;ze=0;var ut=me===""?".":me+":";if(W(C))for(var Ge=0;Ge<C.length;Ge++)me=C[Ge],je=ut+re(me,Ge),ze+=U(me,V,ae,je,Ne);else if(Ge=S(C),typeof Ge=="function")for(C=Ge.call(C),Ge=0;!(me=C.next()).done;)me=me.value,je=ut+re(me,Ge++),ze+=U(me,V,ae,je,Ne);else if(je==="object"){if(typeof C.then=="function")return U(ge(C),V,ae,me,Ne);throw V=String(C),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ze}function B(C,V,ae){if(C==null)return C;var me=[],Ne=0;return U(C,me,"","",function(je){return V.call(ae,je,Ne++)}),me}function ue(C){if(C._status===-1){var V=C._result;V=V(),V.then(function(ae){(C._status===0||C._status===-1)&&(C._status=1,C._result=ae)},function(ae){(C._status===0||C._status===-1)&&(C._status=2,C._result=ae)}),C._status===-1&&(C._status=0,C._result=V)}if(C._status===1)return C._result.default;throw C._result}var de=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},we={map:B,forEach:function(C,V,ae){B(C,function(){V.apply(this,arguments)},ae)},count:function(C){var V=0;return B(C,function(){V++}),V},toArray:function(C){return B(C,function(V){return V})||[]},only:function(C){if(!be(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return et.Activity=y,et.Children=we,et.Component=L,et.Fragment=l,et.Profiler=o,et.PureComponent=q,et.StrictMode=s,et.Suspense=p,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,et.__COMPILER_RUNTIME={__proto__:null,c:function(C){return z.H.useMemoCache(C)}},et.cache=function(C){return function(){return C.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(C,V,ae){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var me=A({},C.props),Ne=C.key;if(V!=null)for(je in V.key!==void 0&&(Ne=""+V.key),V)!T.call(V,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&V.ref===void 0||(me[je]=V[je]);var je=arguments.length-2;if(je===1)me.children=ae;else if(1<je){for(var ze=Array(je),ut=0;ut<je;ut++)ze[ut]=arguments[ut+2];me.children=ze}return ee(C.type,Ne,me)},et.createContext=function(C){return C={$$typeof:f,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},et.createElement=function(C,V,ae){var me,Ne={},je=null;if(V!=null)for(me in V.key!==void 0&&(je=""+V.key),V)T.call(V,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(Ne[me]=V[me]);var ze=arguments.length-2;if(ze===1)Ne.children=ae;else if(1<ze){for(var ut=Array(ze),Ge=0;Ge<ze;Ge++)ut[Ge]=arguments[Ge+2];Ne.children=ut}if(C&&C.defaultProps)for(me in ze=C.defaultProps,ze)Ne[me]===void 0&&(Ne[me]=ze[me]);return ee(C,je,Ne)},et.createRef=function(){return{current:null}},et.forwardRef=function(C){return{$$typeof:m,render:C}},et.isValidElement=be,et.lazy=function(C){return{$$typeof:x,_payload:{_status:-1,_result:C},_init:ue}},et.memo=function(C,V){return{$$typeof:g,type:C,compare:V===void 0?null:V}},et.startTransition=function(C){var V=z.T,ae={};z.T=ae;try{var me=C(),Ne=z.S;Ne!==null&&Ne(ae,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(ne,de)}catch(je){de(je)}finally{V!==null&&ae.types!==null&&(V.types=ae.types),z.T=V}},et.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},et.use=function(C){return z.H.use(C)},et.useActionState=function(C,V,ae){return z.H.useActionState(C,V,ae)},et.useCallback=function(C,V){return z.H.useCallback(C,V)},et.useContext=function(C){return z.H.useContext(C)},et.useDebugValue=function(){},et.useDeferredValue=function(C,V){return z.H.useDeferredValue(C,V)},et.useEffect=function(C,V){return z.H.useEffect(C,V)},et.useEffectEvent=function(C){return z.H.useEffectEvent(C)},et.useId=function(){return z.H.useId()},et.useImperativeHandle=function(C,V,ae){return z.H.useImperativeHandle(C,V,ae)},et.useInsertionEffect=function(C,V){return z.H.useInsertionEffect(C,V)},et.useLayoutEffect=function(C,V){return z.H.useLayoutEffect(C,V)},et.useMemo=function(C,V){return z.H.useMemo(C,V)},et.useOptimistic=function(C,V){return z.H.useOptimistic(C,V)},et.useReducer=function(C,V,ae){return z.H.useReducer(C,V,ae)},et.useRef=function(C){return z.H.useRef(C)},et.useState=function(C){return z.H.useState(C)},et.useSyncExternalStore=function(C,V,ae){return z.H.useSyncExternalStore(C,V,ae)},et.useTransition=function(){return z.H.useTransition()},et.version="19.2.7",et}var Ny;function tm(){return Ny||(Ny=1,dh.exports=MS()),dh.exports}var v=tm();const oa=DS(v),_S=AS({__proto__:null,default:oa},[v]);var fh={exports:{}},uo={},hh={exports:{}},mh={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var Ry;function LS(){return Ry||(Ry=1,(function(t){function n(U,B){var ue=U.length;U.push(B);e:for(;0<ue;){var de=ue-1>>>1,we=U[de];if(0<o(we,B))U[de]=B,U[ue]=we,ue=de;else break e}}function l(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var B=U[0],ue=U.pop();if(ue!==B){U[0]=ue;e:for(var de=0,we=U.length,C=we>>>1;de<C;){var V=2*(de+1)-1,ae=U[V],me=V+1,Ne=U[me];if(0>o(ae,ue))me<we&&0>o(Ne,ae)?(U[de]=Ne,U[me]=ue,de=me):(U[de]=ae,U[V]=ue,de=V);else if(me<we&&0>o(Ne,ue))U[de]=Ne,U[me]=ue,de=me;else break e}}return B}function o(U,B){var ue=U.sortIndex-B.sortIndex;return ue!==0?ue:U.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,m=f.now();t.unstable_now=function(){return f.now()-m}}var p=[],g=[],x=1,y=null,N=3,S=!1,w=!1,A=!1,R=!1,L=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function X(U){for(var B=l(g);B!==null;){if(B.callback===null)s(g);else if(B.startTime<=U)s(g),B.sortIndex=B.expirationTime,n(p,B);else break;B=l(g)}}function W(U){if(A=!1,X(U),!w)if(l(p)!==null)w=!0,ne||(ne=!0,ye());else{var B=l(g);B!==null&&ge(W,B.startTime-U)}}var ne=!1,z=-1,T=5,ee=-1;function fe(){return R?!0:!(t.unstable_now()-ee<T)}function be(){if(R=!1,ne){var U=t.unstable_now();ee=U;var B=!0;try{e:{w=!1,A&&(A=!1,I(z),z=-1),S=!0;var ue=N;try{t:{for(X(U),y=l(p);y!==null&&!(y.expirationTime>U&&fe());){var de=y.callback;if(typeof de=="function"){y.callback=null,N=y.priorityLevel;var we=de(y.expirationTime<=U);if(U=t.unstable_now(),typeof we=="function"){y.callback=we,X(U),B=!0;break t}y===l(p)&&s(p),X(U)}else s(p);y=l(p)}if(y!==null)B=!0;else{var C=l(g);C!==null&&ge(W,C.startTime-U),B=!1}}break e}finally{y=null,N=ue,S=!1}B=void 0}}finally{B?ye():ne=!1}}}var ye;if(typeof q=="function")ye=function(){q(be)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,re=te.port2;te.port1.onmessage=be,ye=function(){re.postMessage(null)}}else ye=function(){L(be,0)};function ge(U,B){z=L(function(){U(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(U){U.callback=null},t.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<U?Math.floor(1e3/U):5},t.unstable_getCurrentPriorityLevel=function(){return N},t.unstable_next=function(U){switch(N){case 1:case 2:case 3:var B=3;break;default:B=N}var ue=N;N=B;try{return U()}finally{N=ue}},t.unstable_requestPaint=function(){R=!0},t.unstable_runWithPriority=function(U,B){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var ue=N;N=U;try{return B()}finally{N=ue}},t.unstable_scheduleCallback=function(U,B,ue){var de=t.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?de+ue:de):ue=de,U){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=ue+we,U={id:x++,callback:B,priorityLevel:U,startTime:ue,expirationTime:we,sortIndex:-1},ue>de?(U.sortIndex=ue,n(g,U),l(p)===null&&U===l(g)&&(A?(I(z),z=-1):A=!0,ge(W,ue-de))):(U.sortIndex=we,n(p,U),w||S||(w=!0,ne||(ne=!0,ye()))),U},t.unstable_shouldYield=fe,t.unstable_wrapCallback=function(U){var B=N;return function(){var ue=N;N=B;try{return U.apply(this,arguments)}finally{N=ue}}}})(mh)),mh}var jy;function zS(){return jy||(jy=1,hh.exports=LS()),hh.exports}var ph={exports:{}},ln={};/**
|
|
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 Ty;function US(){if(Ty)return ln;Ty=1;var t=tm();function n(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(n(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(p,g,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:p,containerInfo:g,implementation:x}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,ln.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(n(299));return u(p,g,null,x)},ln.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()}},ln.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))},ln.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},ln.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,S=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:S}):x==="script"&&s.d.X(p,{crossOrigin:y,integrity:N,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},ln.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)},ln.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})}},ln.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)},ln.requestFormReset=function(p){s.d.r(p)},ln.unstable_batchedUpdates=function(p,g){return p(g)},ln.useFormState=function(p,g,x){return f.H.useFormState(p,g,x)},ln.useFormStatus=function(){return f.H.useHostTransitionStatus()},ln.version="19.2.7",ln}var Cy;function Zx(){if(Cy)return ph.exports;Cy=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(n){console.error(n)}}return t(),ph.exports=US(),ph.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var Ay;function BS(){if(Ay)return uo;Ay=1;var t=zS(),n=tm(),l=Zx();function s(e){var a="https://react.dev/errors/"+e;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)a+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var a=e,r=e;if(e.alternate)for(;a.return;)a=a.return;else{e=a;do a=e,(a.flags&4098)!==0&&(r=a.return),e=a.return;while(e)}return a.tag===3?r:null}function f(e){if(e.tag===13){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function m(e){if(e.tag===31){var a=e.memoizedState;if(a===null&&(e=e.alternate,e!==null&&(a=e.memoizedState)),a!==null)return a.dehydrated}return null}function p(e){if(u(e)!==e)throw Error(s(188))}function g(e){var a=e.alternate;if(!a){if(a=u(e),a===null)throw Error(s(188));return a!==e?null:e}for(var r=e,i=a;;){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),a;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:a}function x(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e;for(e=e.child;e!==null;){if(a=x(e),a!==null)return a;e=e.sibling}return null}var y=Object.assign,N=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),q=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),be=Symbol.iterator;function ye(e){return e===null||typeof e!="object"?null:(e=be&&e[be]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case L:return"Profiler";case R:return"StrictMode";case W:return"Suspense";case ne:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case q:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case X:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return a=e.displayName||null,a!==null?a:re(e.type)||"Memo";case T:a=e._payload,e=e._init;try{return re(e(a))}catch{}}return null}var ge=Array.isArray,U=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],we=-1;function C(e){return{current:e}}function V(e){0>we||(e.current=de[we],de[we]=null,we--)}function ae(e,a){we++,de[we]=e.current,e.current=a}var me=C(null),Ne=C(null),je=C(null),ze=C(null);function ut(e,a){switch(ae(je,a),ae(Ne,e),ae(me,null),a.nodeType){case 9:case 11:e=(e=a.documentElement)&&(e=e.namespaceURI)?Yv(e):0;break;default:if(e=a.tagName,a=a.namespaceURI)a=Yv(a),e=Fv(a,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(me),ae(me,e)}function Ge(){V(me),V(Ne),V(je)}function at(e){e.memoizedState!==null&&ae(ze,e);var a=me.current,r=Fv(a,e.type);a!==r&&(ae(Ne,e),ae(me,r))}function ba(e){Ne.current===e&&(V(me),V(Ne)),ze.current===e&&(V(ze),ro._currentValue=ue)}var Xt,ft;function oe(e){if(Xt===void 0)try{throw Error()}catch(r){var a=r.stack.trim().match(/\n( *(at )?)/);Xt=a&&a[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 nt(e,a){if(!e||$e)return"";$e=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(a){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Q){var G=Q}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(Q){G=Q}e.call(ie.prototype)}}else{try{throw Error()}catch(Q){G=Q}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Q){if(Q&&G&&typeof Q.stack=="string")return[Q.stack,G.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=i.DetermineComponentFrameRoot(),b=h[0],E=h[1];if(b&&E){var k=b.split(`
|
|
44
|
-
`),F=E.split(`
|
|
45
|
-
`);for(d=i=0;i<k.length&&!k[i].includes("DetermineComponentFrameRoot");)i++;for(;d<F.length&&!F[d].includes("DetermineComponentFrameRoot");)d++;if(i===k.length||d===F.length)for(i=k.length-1,d=F.length-1;1<=i&&0<=d&&k[i]!==F[d];)d--;for(;1<=i&&0<=d;i--,d--)if(k[i]!==F[d]){if(i!==1||d!==1)do if(i--,d--,0>d||k[i]!==F[d]){var J=`
|
|
46
|
-
`+k[i].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=i&&0<=d);break}}}finally{$e=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?oe(r):""}function Ut(e,a){switch(e.tag){case 26:case 27:case 5:return oe(e.type);case 16:return oe("Lazy");case 13:return e.child!==a&&a!==null?oe("Suspense Fallback"):oe("Suspense");case 19:return oe("SuspenseList");case 0:case 15:return nt(e.type,!1);case 11:return nt(e.type.render,!1);case 1:return nt(e.type,!0);case 31:return oe("Activity");default:return""}}function ma(e){try{var a="",r=null;do a+=Ut(e,r),r=e,e=e.return;while(e);return a}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,Ba=t.unstable_shouldYield,Ha=t.unstable_requestPaint,ta=t.unstable_now,dn=t.unstable_getCurrentPriorityLevel,fn=t.unstable_ImmediatePriority,Ja=t.unstable_UserBlockingPriority,$a=t.unstable_NormalPriority,he=t.unstable_LowPriority,Ce=t.unstable_IdlePriority,Ae=t.log,Pe=t.unstable_setDisableYieldValue,qe=null,Z=null;function Tt(e){if(typeof Ae=="function"&&Pe(e),Z&&typeof Z.setStrictMode=="function")try{Z.setStrictMode(qe,e)}catch{}}var Kt=Math.clz32?Math.clz32:Bn,Va=Math.log,pa=Math.LN2;function Bn(e){return e>>>=0,e===0?32:31-(Va(e)/pa|0)|0}var Me=256,vt=262144,yt=4194304;function wt(e){var a=e&42;if(a!==0)return a;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,a,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:a!==0&&a!==d&&(a&h)===0&&(h=d&-d,r=a&-a,h>=r||h===32&&(r&4194048)!==0)?a:d}function Ct(e,a){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&a)===0}function aa(e,a){switch(e){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 a=[],r=0;31>r;r++)a.push(e);return a}function ht(e,a){e.pendingLanes|=a,a!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,a,r,i,d,h){var b=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var E=e.entanglements,k=e.expirationTimes,F=e.hiddenUpdates;for(r=b&~r;0<r;){var J=31-Kt(r),ie=1<<J;E[J]=0,k[J]=-1;var G=F[J];if(G!==null)for(F[J]=null,J=0;J<G.length;J++){var Q=G[J];Q!==null&&(Q.lane&=-536870913)}r&=~ie}i!==0&&Sa(e,i,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(b&~a))}function Sa(e,a,r){e.pendingLanes|=a,e.suspendedLanes&=~a;var i=31-Kt(a);e.entangledLanes|=a,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function Da(e,a){var r=e.entangledLanes|=a;for(e=e.entanglements;r;){var i=31-Kt(r),d=1<<i;d&a|e[i]&a&&(e[i]|=a),r&=~d}}function D(e,a){var r=a&-a;return r=(r&42)!==0?1:M(r),(r&(e.suspendedLanes|a))!==0?0:r}function M(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function $(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function K(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:my(e.type))}function se(e,a){var r=B.p;try{return B.p=e,a()}finally{B.p=r}}var Te=Math.random().toString(36).slice(2),ve="__reactFiber$"+Te,De="__reactProps$"+Te,Re="__reactContainer$"+Te,_e="__reactEvents$"+Te,Ue="__reactListeners$"+Te,Xe="__reactHandles$"+Te,ke="__reactResources$"+Te,Ze="__reactMarker$"+Te;function Ie(e){delete e[ve],delete e[De],delete e[_e],delete e[Ue],delete e[Xe]}function $t(e){var a=e[ve];if(a)return a;for(var r=e.parentNode;r;){if(a=r[Re]||r[ve]){if(r=a.alternate,a.child!==null||r!==null&&r.child!==null)for(e=Jv(e);e!==null;){if(r=e[ve])return r;e=Jv(e)}return a}e=r,r=e.parentNode}return null}function We(e){if(e=e[ve]||e[Re]){var a=e.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return e}return null}function ct(e){var a=e.tag;if(a===5||a===26||a===27||a===6)return e.stateNode;throw Error(s(33))}function it(e){var a=e[ke];return a||(a=e[ke]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function dt(e){e[Ze]=!0}var Jt=new Set,Ya={};function wa(e,a){ka(e,a),ka(e+"Capture",a)}function ka(e,a){for(Ya[e]=a,e=0;e<a.length;e++)Jt.add(a[e])}var Oa=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]*$"),Fa={},gn={};function ol(e){return jt.call(gn,e)?!0:jt.call(Fa,e)?!1:Oa.test(e)?gn[e]=!0:(Fa[e]=!0,!1)}function Wa(e,a,r){if(ol(a))if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(a);return;case"boolean":var i=a.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(a);return}}e.setAttribute(a,""+r)}}function pr(e,a,r){if(r===null)e.removeAttribute(a);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttribute(a,""+r)}}function Qe(e,a,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(a,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 a=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function en(e,a,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,a);if(!e.hasOwnProperty(a)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,h=i.set;return Object.defineProperty(e,a,{configurable:!0,get:function(){return d.call(this)},set:function(b){r=""+b,h.call(this,b)}}),Object.defineProperty(e,a,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(b){r=""+b},stopTracking:function(){e._valueTracker=null,delete e[a]}}}}function Ma(e){if(!e._valueTracker){var a=Wt(e)?"checked":"value";e._valueTracker=en(e,a,""+e[a])}}function Mr(e){if(!e)return!1;var a=e._valueTracker;if(!a)return!0;var r=a.getValue(),i="";return e&&(i=Wt(e)?e.checked?"true":"false":e.value),e=i,e!==r?(a.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 jn=/[\n"\\]/g;function Pa(e){return e.replace(jn,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Fl(e,a,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"),a!=null?b==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+Nt(a)):e.value!==""+Nt(a)&&(e.value=""+Nt(a)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),a!=null?At(e,b,Nt(a)):r!=null?At(e,b,Nt(r)):i!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+Nt(E):e.removeAttribute("name")}function bi(e,a,r,i,d,h,b,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),a!=null||r!=null){if(!(h!=="submit"&&h!=="reset"||a!=null)){Ma(e);return}r=r!=null?""+Nt(r):"",a=a!=null?""+Nt(a):r,E||a===e.value||(e.value=a),e.defaultValue=a}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),Ma(e)}function At(e,a,r){a==="number"&&Rt(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function gr(e,a,r,i){if(e=e.options,a){a={};for(var d=0;d<r.length;d++)a["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=a.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&i&&(e[r].defaultSelected=!0)}else{for(r=""+Nt(r),a=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}a!==null||e[d].disabled||(a=e[d])}a!==null&&(a.selected=!0)}}function Wo(e,a,r){if(a!=null&&(a=""+Nt(a),a!==e.value&&(e.value=a),r==null)){e.defaultValue!==a&&(e.defaultValue=a);return}e.defaultValue=r!=null?""+Nt(r):""}function ar(e,a,r,i){if(a==null){if(i!=null){if(r!=null)throw Error(s(92));if(ge(i)){if(1<i.length)throw Error(s(93));i=i[0]}r=i}r==null&&(r=""),a=r}r=Nt(a),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),Ma(e)}function ul(e,a){if(a){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=a;return}}e.textContent=a}var cd=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ss(e,a,r){var i=a.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?i?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="":i?e.setProperty(a,r):typeof r!="number"||r===0||cd.has(a)?a==="float"?e.cssFloat=r:e[a]=(""+r).trim():e[a]=r+"px"}function vn(e,a,r){if(a!=null&&typeof a!="object")throw Error(s(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||a!=null&&a.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in a)i=a[d],a.hasOwnProperty(d)&&r[d]!==i&&Ss(e,d,i)}else for(var h in a)a.hasOwnProperty(h)&&Ss(e,h,a[h])}function Pl(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ws=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),yn=/^[\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 na(e){return yn.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function tn(){}var Tn=null;function _r(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vr=null,Lr=null;function Si(e){var a=We(e);if(a&&(e=a.stateNode)){var r=e[De]||null;e:switch(e=a.stateNode,a.type){case"input":if(Fl(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),a=r.name,r.type==="radio"&&a!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Pa(""+a)+'"][type="radio"]'),a=0;a<r.length;a++){var i=r[a];if(i!==e&&i.form===e.form){var d=i[De]||null;if(!d)throw Error(s(90));Fl(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(a=0;a<r.length;a++)i=r[a],i.form===e.form&&Mr(i)}break e;case"textarea":Wo(e,r.value,r.defaultValue);break e;case"select":a=r.value,a!=null&&gr(e,!!r.multiple,a,!1)}}}var yr=!1;function wi(e,a,r){if(yr)return e(a,r);yr=!0;try{var i=e(a);return i}finally{if(yr=!1,(vr!==null||Lr!==null)&&($u(),vr&&(a=vr,e=Lr,Lr=vr=null,Si(a),e)))for(a=0;a<e.length;a++)Si(e[a])}}function Hn(e,a){var r=e.stateNode;if(r===null)return null;var i=r[De]||null;if(i===null)return null;r=i[a];e:switch(a){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,a,typeof r));return r}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ei=!1;if(nr)try{var zr={};Object.defineProperty(zr,"passive",{get:function(){Ei=!0}}),window.addEventListener("test",zr,zr),window.removeEventListener("test",zr,zr)}catch{Ei=!1}var $n=null,Ni=null,Es=null;function eu(){if(Es)return Es;var e,a=Ni,r=a.length,i,d="value"in $n?$n.value:$n.textContent,h=d.length;for(e=0;e<r&&a[e]===d[e];e++);var b=r-e;for(i=1;i<=b&&a[r-i]===d[h-i];i++);return Es=d.slice(e,1<i?1-i:void 0)}function Ns(e){var a=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&a===13&&(e=13)):e=a,e===10&&(e=13),32<=e||e===13?e:0}function Ur(){return!0}function tu(){return!1}function an(e){function a(r,i,d,h,b){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(r=e[E],this[E]=r?r(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ur:tu,this.isPropagationStopped=tu,this}return y(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ur)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ur)},persist:function(){},isPersistent:Ur}),a}var Br={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hr=an(Br),Gl=y({},Br,{view:0,detail:0}),dd=an(Gl),cl,Xl,Ql,$r=y({},Gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ql&&(Ql&&e.type==="mousemove"?(cl=e.screenX-Ql.screenX,Xl=e.screenY-Ql.screenY):Xl=cl=0,Ql=e),cl)},movementY:function(e){return"movementY"in e?e.movementY:Xl}}),au=an($r),j=y({},$r,{dataTransfer:0}),P=an(j),Ee=y({},Gl,{relatedTarget:0}),xe=an(Ee),Fe=y({},Br,{animationName:0,elapsedTime:0,pseudoElement:0}),ce=an(Fe),pe=y({},Br,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Se=an(pe),Ke=y({},Br,{data:0}),rt=an(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"},Ea={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 nn(e){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(e):(e=Lt[e])?!!a[e]:!1}function rn(){return nn}var xn=y({},Gl,{key:function(e){if(e.key){var a=Be[e.key]||e.key;if(a!=="Unidentified")return a}return e.type==="keypress"?(e=Ns(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ea[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rn,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}}),Na=an(xn),ua=y({},$r,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zt=an(ua),Kl=y({},Gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rn}),xr=an(Kl),fd=y({},Br,{propertyName:0,elapsedTime:0,pseudoElement:0}),nu=an(fd),ru=y({},$r,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),hd=an(ru),md=y({},Br,{newState:0,oldState:0}),X0=an(md),Q0=[9,13,27,32],pd=nr&&"CompositionEvent"in window,Ri=null;nr&&"documentMode"in document&&(Ri=document.documentMode);var K0=nr&&"TextEvent"in window&&!Ri,Km=nr&&(!pd||Ri&&8<Ri&&11>=Ri),Zm=" ",Jm=!1;function Wm(e,a){switch(e){case"keyup":return Q0.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ep(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rs=!1;function Z0(e,a){switch(e){case"compositionend":return ep(a);case"keypress":return a.which!==32?null:(Jm=!0,Zm);case"textInput":return e=a.data,e===Zm&&Jm?null:e;default:return null}}function J0(e,a){if(Rs)return e==="compositionend"||!pd&&Wm(e,a)?(e=eu(),Es=Ni=$n=null,Rs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Km&&a.locale!=="ko"?null:a.data;default:return null}}var W0={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 tp(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a==="input"?!!W0[e.type]:a==="textarea"}function ap(e,a,r,i){vr?Lr?Lr.push(i):Lr=[i]:vr=i,a=Gu(a,"onChange"),0<a.length&&(r=new Hr("onChange","change",null,r,i),e.push({event:r,listeners:a}))}var ji=null,Ti=null;function e1(e){Bv(e,0)}function lu(e){var a=ct(e);if(Mr(a))return e}function np(e,a){if(e==="change")return a}var rp=!1;if(nr){var gd;if(nr){var vd="oninput"in document;if(!vd){var lp=document.createElement("div");lp.setAttribute("oninput","return;"),vd=typeof lp.oninput=="function"}gd=vd}else gd=!1;rp=gd&&(!document.documentMode||9<document.documentMode)}function sp(){ji&&(ji.detachEvent("onpropertychange",ip),Ti=ji=null)}function ip(e){if(e.propertyName==="value"&&lu(Ti)){var a=[];ap(a,Ti,e,_r(e)),wi(e1,a)}}function t1(e,a,r){e==="focusin"?(sp(),ji=a,Ti=r,ji.attachEvent("onpropertychange",ip)):e==="focusout"&&sp()}function a1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return lu(Ti)}function n1(e,a){if(e==="click")return lu(a)}function r1(e,a){if(e==="input"||e==="change")return lu(a)}function l1(e,a){return e===a&&(e!==0||1/e===1/a)||e!==e&&a!==a}var Cn=typeof Object.is=="function"?Object.is:l1;function Ci(e,a){if(Cn(e,a))return!0;if(typeof e!="object"||e===null||typeof a!="object"||a===null)return!1;var r=Object.keys(e),i=Object.keys(a);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var d=r[i];if(!jt.call(a,d)||!Cn(e[d],a[d]))return!1}return!0}function op(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function up(e,a){var r=op(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=a&&i>=a)return{node:r,offset:a-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=op(r)}}function cp(e,a){return e&&a?e===a?!0:e&&e.nodeType===3?!1:a&&a.nodeType===3?cp(e,a.parentNode):"contains"in e?e.contains(a):e.compareDocumentPosition?!!(e.compareDocumentPosition(a)&16):!1:!1}function dp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var a=Rt(e.document);a instanceof e.HTMLIFrameElement;){try{var r=typeof a.contentWindow.location.href=="string"}catch{r=!1}if(r)e=a.contentWindow;else break;a=Rt(e.document)}return a}function yd(e){var a=e&&e.nodeName&&e.nodeName.toLowerCase();return a&&(a==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||a==="textarea"||e.contentEditable==="true")}var s1=nr&&"documentMode"in document&&11>=document.documentMode,js=null,xd=null,Ai=null,bd=!1;function fp(e,a,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;bd||js==null||js!==Rt(i)||(i=js,"selectionStart"in i&&yd(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ai&&Ci(Ai,i)||(Ai=i,i=Gu(xd,"onSelect"),0<i.length&&(a=new Hr("onSelect","select",null,a,r),e.push({event:a,listeners:i}),a.target=js)))}function Zl(e,a){var r={};return r[e.toLowerCase()]=a.toLowerCase(),r["Webkit"+e]="webkit"+a,r["Moz"+e]="moz"+a,r}var Ts={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionrun:Zl("Transition","TransitionRun"),transitionstart:Zl("Transition","TransitionStart"),transitioncancel:Zl("Transition","TransitionCancel"),transitionend:Zl("Transition","TransitionEnd")},Sd={},hp={};nr&&(hp=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function Jl(e){if(Sd[e])return Sd[e];if(!Ts[e])return e;var a=Ts[e],r;for(r in a)if(a.hasOwnProperty(r)&&r in hp)return Sd[e]=a[r];return e}var mp=Jl("animationend"),pp=Jl("animationiteration"),gp=Jl("animationstart"),i1=Jl("transitionrun"),o1=Jl("transitionstart"),u1=Jl("transitioncancel"),vp=Jl("transitionend"),yp=new Map,wd="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");wd.push("scrollEnd");function rr(e,a){yp.set(e,a),wa(a,[e])}var su=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=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(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qn=[],Cs=0,Ed=0;function iu(){for(var e=Cs,a=Ed=Cs=0;a<e;){var r=qn[a];qn[a++]=null;var i=qn[a];qn[a++]=null;var d=qn[a];qn[a++]=null;var h=qn[a];if(qn[a++]=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&&xp(r,d,h)}}function ou(e,a,r,i){qn[Cs++]=e,qn[Cs++]=a,qn[Cs++]=r,qn[Cs++]=i,Ed|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Nd(e,a,r,i){return ou(e,a,r,i),uu(e)}function Wl(e,a){return ou(e,null,null,a),uu(e)}function xp(e,a,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&&a!==null&&(d=31-Kt(r),e=h.hiddenUpdates,i=e[d],i===null?e[d]=[a]:i.push(a),a.lane=r|536870912),h):null}function uu(e){if(50<Zi)throw Zi=0,_f=null,Error(s(185));for(var a=e.return;a!==null;)e=a,a=e.return;return e.tag===3?e.stateNode:null}var As={};function c1(e,a,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=a,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 An(e,a,r,i){return new c1(e,a,r,i)}function Rd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qr(e,a){var r=e.alternate;return r===null?(r=An(e.tag,a,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=a,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,a=e.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function bp(e,a){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=a,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,a=r.dependencies,e.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),e}function cu(e,a,r,i,d,h){var b=0;if(i=e,typeof e=="function")Rd(e)&&(b=1);else if(typeof e=="string")b=pS(e,r,me.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=An(31,r,a,d),e.elementType=ee,e.lanes=h,e;case A:return es(r.children,d,h,a);case R:b=8,d|=24;break;case L:return e=An(12,r,a,d|2),e.elementType=L,e.lanes=h,e;case W:return e=An(13,r,a,d),e.elementType=W,e.lanes=h,e;case ne:return e=An(19,r,a,d),e.elementType=ne,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q:b=10;break e;case I:b=9;break e;case X:b=11;break e;case z:b=14;break e;case T:b=16,i=null;break e}b=29,r=Error(s(130,e===null?"null":typeof e,"")),i=null}return a=An(b,r,a,d),a.elementType=e,a.type=i,a.lanes=h,a}function es(e,a,r,i){return e=An(7,e,i,a),e.lanes=r,e}function jd(e,a,r){return e=An(6,e,null,a),e.lanes=r,e}function Sp(e){var a=An(18,null,null,0);return a.stateNode=e,a}function Td(e,a,r){return a=An(4,e.children!==null?e.children:[],e.key,a),a.lanes=r,a.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},a}var wp=new WeakMap;function In(e,a){if(typeof e=="object"&&e!==null){var r=wp.get(e);return r!==void 0?r:(a={value:e,source:a,stack:ma(a)},wp.set(e,a),a)}return{value:e,source:a,stack:ma(a)}}var Ds=[],ks=0,du=null,Di=0,Vn=[],Yn=0,dl=null,br=1,Sr="";function Ir(e,a){Ds[ks++]=Di,Ds[ks++]=du,du=e,Di=a}function Ep(e,a,r){Vn[Yn++]=br,Vn[Yn++]=Sr,Vn[Yn++]=dl,dl=e;var i=br;e=Sr;var d=32-Kt(i)-1;i&=~(1<<d),r+=1;var h=32-Kt(a)+d;if(30<h){var b=d-d%5;h=(i&(1<<b)-1).toString(32),i>>=b,d-=b,br=1<<32-Kt(a)+d|r<<d|i,Sr=h+e}else br=1<<h|r<<d|i,Sr=e}function Cd(e){e.return!==null&&(Ir(e,1),Ep(e,1,0))}function Ad(e){for(;e===du;)du=Ds[--ks],Ds[ks]=null,Di=Ds[--ks],Ds[ks]=null;for(;e===dl;)dl=Vn[--Yn],Vn[Yn]=null,Sr=Vn[--Yn],Vn[Yn]=null,br=Vn[--Yn],Vn[Yn]=null}function Np(e,a){Vn[Yn++]=br,Vn[Yn++]=Sr,Vn[Yn++]=dl,br=a.id,Sr=a.overflow,dl=e}var Ga=null,ra=null,Et=!1,fl=null,Fn=!1,Dd=Error(s(519));function hl(e){var a=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ki(In(a,e)),Dd}function Rp(e){var a=e.stateNode,r=e.type,i=e.memoizedProps;switch(a[ve]=e,a[De]=i,r){case"dialog":pt("cancel",a),pt("close",a);break;case"iframe":case"object":case"embed":pt("load",a);break;case"video":case"audio":for(r=0;r<Wi.length;r++)pt(Wi[r],a);break;case"source":pt("error",a);break;case"img":case"image":case"link":pt("error",a),pt("load",a);break;case"details":pt("toggle",a);break;case"input":pt("invalid",a),bi(a,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":pt("invalid",a);break;case"textarea":pt("invalid",a),ar(a,i.value,i.defaultValue,i.children)}r=i.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||a.textContent===""+r||i.suppressHydrationWarning===!0||Iv(a.textContent,r)?(i.popover!=null&&(pt("beforetoggle",a),pt("toggle",a)),i.onScroll!=null&&pt("scroll",a),i.onScrollEnd!=null&&pt("scrollend",a),i.onClick!=null&&(a.onclick=tn),a=!0):a=!1,a||hl(e,!0)}function jp(e){for(Ga=e.return;Ga;)switch(Ga.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Ga=Ga.return}}function Os(e){if(e!==Ga)return!1;if(!Et)return jp(e),Et=!0,!1;var a=e.tag,r;if((r=a!==3&&a!==27)&&((r=a===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Qf(e.type,e.memoizedProps)),r=!r),r&&ra&&hl(e),jp(e),a===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));ra=Zv(e)}else if(a===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));ra=Zv(e)}else a===27?(a=ra,Tl(e.type)?(e=eh,eh=null,ra=e):ra=a):ra=Ga?Gn(e.stateNode.nextSibling):null;return!0}function ts(){ra=Ga=null,Et=!1}function kd(){var e=fl;return e!==null&&(En===null?En=e:En.push.apply(En,e),fl=null),e}function ki(e){fl===null?fl=[e]:fl.push(e)}var Od=C(null),as=null,Vr=null;function ml(e,a,r){ae(Od,a._currentValue),a._currentValue=r}function Yr(e){e._currentValue=Od.current,V(Od)}function Md(e,a,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&a)!==a?(e.childLanes|=a,i!==null&&(i.childLanes|=a)):i!==null&&(i.childLanes&a)!==a&&(i.childLanes|=a),e===r)break;e=e.return}}function _d(e,a,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<a.length;k++)if(E.context===a[k]){h.lanes|=r,E=h.alternate,E!==null&&(E.lanes|=r),Md(h.return,r,e),i||(b=null);break e}h=E.next}}else if(d.tag===18){if(b=d.return,b===null)throw Error(s(341));b.lanes|=r,h=b.alternate,h!==null&&(h.lanes|=r),Md(b,r,e),b=null}else b=d.child;if(b!==null)b.return=d;else for(b=d;b!==null;){if(b===e){b=null;break}if(d=b.sibling,d!==null){d.return=b.return,b=d;break}b=b.return}d=b}}function Ms(e,a,r,i){e=null;for(var d=a,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;Cn(d.pendingProps.value,b.value)||(e!==null?e.push(E):e=[E])}}else if(d===ze.current){if(b=d.alternate,b===null)throw Error(s(387));b.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(ro):e=[ro])}d=d.return}e!==null&&_d(a,e,r,i),a.flags|=262144}function fu(e){for(e=e.firstContext;e!==null;){if(!Cn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ns(e){as=e,Vr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xa(e){return Tp(as,e)}function hu(e,a){return as===null&&ns(e),Tp(e,a)}function Tp(e,a){var r=a._currentValue;if(a={context:a,memoizedValue:r,next:null},Vr===null){if(e===null)throw Error(s(308));Vr=a,e.dependencies={lanes:0,firstContext:a},e.flags|=524288}else Vr=Vr.next=a;return r}var d1=typeof AbortController<"u"?AbortController:function(){var e=[],a=this.signal={aborted:!1,addEventListener:function(r,i){e.push(i)}};this.abort=function(){a.aborted=!0,e.forEach(function(r){return r()})}},f1=t.unstable_scheduleCallback,h1=t.unstable_NormalPriority,Ra={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ld(){return{controller:new d1,data:new Map,refCount:0}}function Oi(e){e.refCount--,e.refCount===0&&f1(h1,function(){e.controller.abort()})}var Mi=null,zd=0,_s=0,Ls=null;function m1(e,a){if(Mi===null){var r=Mi=[];zd=0,_s=$f(),Ls={status:"pending",value:void 0,then:function(i){r.push(i)}}}return zd++,a.then(Cp,Cp),a}function Cp(){if(--zd===0&&Mi!==null){Ls!==null&&(Ls.status="fulfilled");var e=Mi;Mi=null,_s=0,Ls=null;for(var a=0;a<e.length;a++)(0,e[a])()}}function p1(e,a){var r=[],i={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){i.status="fulfilled",i.value=a;for(var d=0;d<r.length;d++)(0,r[d])(a)},function(d){for(i.status="rejected",i.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),i}var Ap=U.S;U.S=function(e,a){fv=ta(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&m1(e,a),Ap!==null&&Ap(e,a)};var rs=C(null);function Ud(){var e=rs.current;return e!==null?e:ea.pooledCache}function mu(e,a){a===null?ae(rs,rs.current):ae(rs,a.pool)}function Dp(){var e=Ud();return e===null?null:{parent:Ra._currentValue,pool:e}}var zs=Error(s(460)),Bd=Error(s(474)),pu=Error(s(542)),gu={then:function(){}};function kp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Op(e,a,r){switch(r=e[r],r===void 0?e.push(a):r!==a&&(a.then(tn,tn),a=r),a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,_p(e),e;default:if(typeof a.status=="string")a.then(tn,tn);else{if(e=ea,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=a,e.status="pending",e.then(function(i){if(a.status==="pending"){var d=a;d.status="fulfilled",d.value=i}},function(i){if(a.status==="pending"){var d=a;d.status="rejected",d.reason=i}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw e=a.reason,_p(e),e}throw ss=a,zs}}function ls(e){try{var a=e._init;return a(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ss=r,zs):r}}var ss=null;function Mp(){if(ss===null)throw Error(s(459));var e=ss;return ss=null,e}function _p(e){if(e===zs||e===pu)throw Error(s(483))}var Us=null,_i=0;function vu(e){var a=_i;return _i+=1,Us===null&&(Us=[]),Op(Us,e,a)}function Li(e,a){a=a.props.ref,e.ref=a!==void 0?a:null}function yu(e,a){throw a.$$typeof===N?Error(s(525)):(e=Object.prototype.toString.call(a),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":e)))}function Lp(e){function a(H,_){if(e){var Y=H.deletions;Y===null?(H.deletions=[_],H.flags|=16):Y.push(_)}}function r(H,_){if(!e)return null;for(;_!==null;)a(H,_),_=_.sibling;return null}function i(H){for(var _=new Map;H!==null;)H.key!==null?_.set(H.key,H):_.set(H.index,H),H=H.sibling;return _}function d(H,_){return H=qr(H,_),H.index=0,H.sibling=null,H}function h(H,_,Y){return H.index=Y,e?(Y=H.alternate,Y!==null?(Y=Y.index,Y<_?(H.flags|=67108866,_):Y):(H.flags|=67108866,_)):(H.flags|=1048576,_)}function b(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function E(H,_,Y,le){return _===null||_.tag!==6?(_=jd(Y,H.mode,le),_.return=H,_):(_=d(_,Y),_.return=H,_)}function k(H,_,Y,le){var He=Y.type;return He===A?J(H,_,Y.props.children,le,Y.key):_!==null&&(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&ls(He)===_.type)?(_=d(_,Y.props),Li(_,Y),_.return=H,_):(_=cu(Y.type,Y.key,Y.props,null,H.mode,le),Li(_,Y),_.return=H,_)}function F(H,_,Y,le){return _===null||_.tag!==4||_.stateNode.containerInfo!==Y.containerInfo||_.stateNode.implementation!==Y.implementation?(_=Td(Y,H.mode,le),_.return=H,_):(_=d(_,Y.children||[]),_.return=H,_)}function J(H,_,Y,le,He){return _===null||_.tag!==7?(_=es(Y,H.mode,le,He),_.return=H,_):(_=d(_,Y),_.return=H,_)}function ie(H,_,Y){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=jd(""+_,H.mode,Y),_.return=H,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case S:return Y=cu(_.type,_.key,_.props,null,H.mode,Y),Li(Y,_),Y.return=H,Y;case w:return _=Td(_,H.mode,Y),_.return=H,_;case T:return _=ls(_),ie(H,_,Y)}if(ge(_)||ye(_))return _=es(_,H.mode,Y,null),_.return=H,_;if(typeof _.then=="function")return ie(H,vu(_),Y);if(_.$$typeof===q)return ie(H,hu(H,_),Y);yu(H,_)}return null}function G(H,_,Y,le){var He=_!==null?_.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return He!==null?null:E(H,_,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:return Y.key===He?k(H,_,Y,le):null;case w:return Y.key===He?F(H,_,Y,le):null;case T:return Y=ls(Y),G(H,_,Y,le)}if(ge(Y)||ye(Y))return He!==null?null:J(H,_,Y,le,null);if(typeof Y.then=="function")return G(H,_,vu(Y),le);if(Y.$$typeof===q)return G(H,_,hu(H,Y),le);yu(H,Y)}return null}function Q(H,_,Y,le,He){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(Y)||null,E(_,H,""+le,He);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case S:return H=H.get(le.key===null?Y:le.key)||null,k(_,H,le,He);case w:return H=H.get(le.key===null?Y:le.key)||null,F(_,H,le,He);case T:return le=ls(le),Q(H,_,Y,le,He)}if(ge(le)||ye(le))return H=H.get(Y)||null,J(_,H,le,He,null);if(typeof le.then=="function")return Q(H,_,Y,vu(le),He);if(le.$$typeof===q)return Q(H,_,Y,hu(_,le),He);yu(_,le)}return null}function Oe(H,_,Y,le){for(var He=null,Dt=null,Le=_,ot=_=0,bt=null;Le!==null&&ot<Y.length;ot++){Le.index>ot?(bt=Le,Le=null):bt=Le.sibling;var kt=G(H,Le,Y[ot],le);if(kt===null){Le===null&&(Le=bt);break}e&&Le&&kt.alternate===null&&a(H,Le),_=h(kt,_,ot),Dt===null?He=kt:Dt.sibling=kt,Dt=kt,Le=bt}if(ot===Y.length)return r(H,Le),Et&&Ir(H,ot),He;if(Le===null){for(;ot<Y.length;ot++)Le=ie(H,Y[ot],le),Le!==null&&(_=h(Le,_,ot),Dt===null?He=Le:Dt.sibling=Le,Dt=Le);return Et&&Ir(H,ot),He}for(Le=i(Le);ot<Y.length;ot++)bt=Q(Le,H,ot,Y[ot],le),bt!==null&&(e&&bt.alternate!==null&&Le.delete(bt.key===null?ot:bt.key),_=h(bt,_,ot),Dt===null?He=bt:Dt.sibling=bt,Dt=bt);return e&&Le.forEach(function(Ol){return a(H,Ol)}),Et&&Ir(H,ot),He}function Ve(H,_,Y,le){if(Y==null)throw Error(s(151));for(var He=null,Dt=null,Le=_,ot=_=0,bt=null,kt=Y.next();Le!==null&&!kt.done;ot++,kt=Y.next()){Le.index>ot?(bt=Le,Le=null):bt=Le.sibling;var Ol=G(H,Le,kt.value,le);if(Ol===null){Le===null&&(Le=bt);break}e&&Le&&Ol.alternate===null&&a(H,Le),_=h(Ol,_,ot),Dt===null?He=Ol:Dt.sibling=Ol,Dt=Ol,Le=bt}if(kt.done)return r(H,Le),Et&&Ir(H,ot),He;if(Le===null){for(;!kt.done;ot++,kt=Y.next())kt=ie(H,kt.value,le),kt!==null&&(_=h(kt,_,ot),Dt===null?He=kt:Dt.sibling=kt,Dt=kt);return Et&&Ir(H,ot),He}for(Le=i(Le);!kt.done;ot++,kt=Y.next())kt=Q(Le,H,ot,kt.value,le),kt!==null&&(e&&kt.alternate!==null&&Le.delete(kt.key===null?ot:kt.key),_=h(kt,_,ot),Dt===null?He=kt:Dt.sibling=kt,Dt=kt);return e&&Le.forEach(function(jS){return a(H,jS)}),Et&&Ir(H,ot),He}function Pt(H,_,Y,le){if(typeof Y=="object"&&Y!==null&&Y.type===A&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:e:{for(var He=Y.key;_!==null;){if(_.key===He){if(He=Y.type,He===A){if(_.tag===7){r(H,_.sibling),le=d(_,Y.props.children),le.return=H,H=le;break e}}else if(_.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===T&&ls(He)===_.type){r(H,_.sibling),le=d(_,Y.props),Li(le,Y),le.return=H,H=le;break e}r(H,_);break}else a(H,_);_=_.sibling}Y.type===A?(le=es(Y.props.children,H.mode,le,Y.key),le.return=H,H=le):(le=cu(Y.type,Y.key,Y.props,null,H.mode,le),Li(le,Y),le.return=H,H=le)}return b(H);case w:e:{for(He=Y.key;_!==null;){if(_.key===He)if(_.tag===4&&_.stateNode.containerInfo===Y.containerInfo&&_.stateNode.implementation===Y.implementation){r(H,_.sibling),le=d(_,Y.children||[]),le.return=H,H=le;break e}else{r(H,_);break}else a(H,_);_=_.sibling}le=Td(Y,H.mode,le),le.return=H,H=le}return b(H);case T:return Y=ls(Y),Pt(H,_,Y,le)}if(ge(Y))return Oe(H,_,Y,le);if(ye(Y)){if(He=ye(Y),typeof He!="function")throw Error(s(150));return Y=He.call(Y),Ve(H,_,Y,le)}if(typeof Y.then=="function")return Pt(H,_,vu(Y),le);if(Y.$$typeof===q)return Pt(H,_,hu(H,Y),le);yu(H,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,_!==null&&_.tag===6?(r(H,_.sibling),le=d(_,Y),le.return=H,H=le):(r(H,_),le=jd(Y,H.mode,le),le.return=H,H=le),b(H)):r(H,_)}return function(H,_,Y,le){try{_i=0;var He=Pt(H,_,Y,le);return Us=null,He}catch(Le){if(Le===zs||Le===pu)throw Le;var Dt=An(29,Le,null,H.mode);return Dt.lanes=le,Dt.return=H,Dt}finally{}}}var is=Lp(!0),zp=Lp(!1),pl=!1;function Hd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $d(e,a){e=e.updateQueue,a.updateQueue===e&&(a.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function gl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vl(e,a,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ot&2)!==0){var d=i.pending;return d===null?a.next=a:(a.next=d.next,d.next=a),i.pending=a,a=uu(e),xp(e,null,r),a}return ou(e,i,a,r),uu(e)}function zi(e,a,r){if(a=a.updateQueue,a!==null&&(a=a.shared,(r&4194048)!==0)){var i=a.lanes;i&=e.pendingLanes,r|=i,a.lanes=r,Da(e,r)}}function qd(e,a){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=a:h=h.next=a}else d=h=a;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=a:e.next=a,r.lastBaseUpdate=a}var Id=!1;function Ui(){if(Id){var e=Ls;if(e!==null)throw e}}function Bi(e,a,r,i){Id=!1;var d=e.updateQueue;pl=!1;var h=d.firstBaseUpdate,b=d.lastBaseUpdate,E=d.shared.pending;if(E!==null){d.shared.pending=null;var k=E,F=k.next;k.next=null,b===null?h=F:b.next=F,b=k;var J=e.alternate;J!==null&&(J=J.updateQueue,E=J.lastBaseUpdate,E!==b&&(E===null?J.firstBaseUpdate=F:E.next=F,J.lastBaseUpdate=k))}if(h!==null){var ie=d.baseState;b=0,J=F=k=null,E=h;do{var G=E.lane&-536870913,Q=G!==E.lane;if(Q?(xt&G)===G:(i&G)===G){G!==0&&G===_s&&(Id=!0),J!==null&&(J=J.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var Oe=e,Ve=E;G=a;var Pt=r;switch(Ve.tag){case 1:if(Oe=Ve.payload,typeof Oe=="function"){ie=Oe.call(Pt,ie,G);break e}ie=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ve.payload,G=typeof Oe=="function"?Oe.call(Pt,ie,G):Oe,G==null)break e;ie=y({},ie,G);break e;case 2:pl=!0}}G=E.callback,G!==null&&(e.flags|=64,Q&&(e.flags|=8192),Q=d.callbacks,Q===null?d.callbacks=[G]:Q.push(G))}else Q={lane:G,tag:E.tag,payload:E.payload,callback:E.callback,next:null},J===null?(F=J=Q,k=ie):J=J.next=Q,b|=G;if(E=E.next,E===null){if(E=d.shared.pending,E===null)break;Q=E,E=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);J===null&&(k=ie),d.baseState=k,d.firstBaseUpdate=F,d.lastBaseUpdate=J,h===null&&(d.shared.lanes=0),wl|=b,e.lanes=b,e.memoizedState=ie}}function Up(e,a){if(typeof e!="function")throw Error(s(191,e));e.call(a)}function Bp(e,a){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Up(r[e],a)}var Bs=C(null),xu=C(0);function Hp(e,a){e=Wr,ae(xu,e),ae(Bs,a),Wr=e|a.baseLanes}function Vd(){ae(xu,Wr),ae(Bs,Bs.current)}function Yd(){Wr=xu.current,V(Bs),V(xu)}var Dn=C(null),Pn=null;function yl(e){var a=e.alternate;ae(ga,ga.current&1),ae(Dn,e),Pn===null&&(a===null||Bs.current!==null||a.memoizedState!==null)&&(Pn=e)}function Fd(e){ae(ga,ga.current),ae(Dn,e),Pn===null&&(Pn=e)}function $p(e){e.tag===22?(ae(ga,ga.current),ae(Dn,e),Pn===null&&(Pn=e)):xl()}function xl(){ae(ga,ga.current),ae(Dn,Dn.current)}function kn(e){V(Dn),Pn===e&&(Pn=null),V(ga)}var ga=C(0);function bu(e){for(var a=e;a!==null;){if(a.tag===13){var r=a.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Jf(r)||Wf(r)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Fr=0,st=null,Yt=null,ja=null,Su=!1,Hs=!1,os=!1,wu=0,Hi=0,$s=null,g1=0;function ca(){throw Error(s(321))}function Pd(e,a){if(a===null)return!1;for(var r=0;r<a.length&&r<e.length;r++)if(!Cn(e[r],a[r]))return!1;return!0}function Gd(e,a,r,i,d,h){return Fr=h,st=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,U.H=e===null||e.memoizedState===null?Eg:uf,os=!1,h=r(i,d),os=!1,Hs&&(h=Ip(a,r,i,d)),qp(e),h}function qp(e){U.H=Ii;var a=Yt!==null&&Yt.next!==null;if(Fr=0,ja=Yt=st=null,Su=!1,Hi=0,$s=null,a)throw Error(s(300));e===null||Ta||(e=e.dependencies,e!==null&&fu(e)&&(Ta=!0))}function Ip(e,a,r,i){st=e;var d=0;do{if(Hs&&($s=null),Hi=0,Hs=!1,25<=d)throw Error(s(301));if(d+=1,ja=Yt=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=Ng,h=a(r,i)}while(Hs);return h}function v1(){var e=U.H,a=e.useState()[0];return a=typeof a.then=="function"?$i(a):a,e=e.useState()[0],(Yt!==null?Yt.memoizedState:null)!==e&&(st.flags|=1024),a}function Xd(){var e=wu!==0;return wu=0,e}function Qd(e,a,r){a.updateQueue=e.updateQueue,a.flags&=-2053,e.lanes&=~r}function Kd(e){if(Su){for(e=e.memoizedState;e!==null;){var a=e.queue;a!==null&&(a.pending=null),e=e.next}Su=!1}Fr=0,ja=Yt=st=null,Hs=!1,Hi=wu=0,$s=null}function hn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ja===null?st.memoizedState=ja=e:ja=ja.next=e,ja}function va(){if(Yt===null){var e=st.alternate;e=e!==null?e.memoizedState:null}else e=Yt.next;var a=ja===null?st.memoizedState:ja.next;if(a!==null)ja=a,Yt=e;else{if(e===null)throw st.alternate===null?Error(s(467)):Error(s(310));Yt=e,e={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},ja===null?st.memoizedState=ja=e:ja=ja.next=e}return ja}function Eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $i(e){var a=Hi;return Hi+=1,$s===null&&($s=[]),e=Op($s,e,a),a=st,(ja===null?a.memoizedState:ja.next)===null&&(a=a.alternate,U.H=a===null||a.memoizedState===null?Eg:uf),e}function Nu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return $i(e);if(e.$$typeof===q)return Xa(e)}throw Error(s(438,String(e)))}function Zd(e){var a=null,r=st.updateQueue;if(r!==null&&(a=r.memoCache),a==null){var i=st.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(a={data:i.data.map(function(d){return d.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),r===null&&(r=Eu(),st.updateQueue=r),r.memoCache=a,r=a.data[a.index],r===void 0)for(r=a.data[a.index]=Array(e),i=0;i<e;i++)r[i]=fe;return a.index++,r}function Pr(e,a){return typeof a=="function"?a(e):a}function Ru(e){var a=va();return Jd(a,Yt,e)}function Jd(e,a,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}a.baseQueue=d=h,i.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{a=d.next;var E=b=null,k=null,F=a,J=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(xt&ie)===ie:(Fr&ie)===ie){var G=F.revertLane;if(G===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ie===_s&&(J=!0);else if((Fr&G)===G){F=F.next,G===_s&&(J=!0);continue}else ie={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},k===null?(E=k=ie,b=h):k=k.next=ie,st.lanes|=G,wl|=G;ie=F.action,os&&r(h,ie),h=F.hasEagerState?F.eagerState:r(h,ie)}else G={lane:ie,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},k===null?(E=k=G,b=h):k=k.next=G,st.lanes|=ie,wl|=ie;F=F.next}while(F!==null&&F!==a);if(k===null?b=h:k.next=E,!Cn(h,e.memoizedState)&&(Ta=!0,J&&(r=Ls,r!==null)))throw r;e.memoizedState=h,e.baseState=b,e.baseQueue=k,i.lastRenderedState=h}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Wd(e){var a=va(),r=a.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var i=r.dispatch,d=r.pending,h=a.memoizedState;if(d!==null){r.pending=null;var b=d=d.next;do h=e(h,b.action),b=b.next;while(b!==d);Cn(h,a.memoizedState)||(Ta=!0),a.memoizedState=h,a.baseQueue===null&&(a.baseState=h),r.lastRenderedState=h}return[h,i]}function Vp(e,a,r){var i=st,d=va(),h=Et;if(h){if(r===void 0)throw Error(s(407));r=r()}else r=a();var b=!Cn((Yt||d).memoizedState,r);if(b&&(d.memoizedState=r,Ta=!0),d=d.queue,af(Pp.bind(null,i,d,e),[e]),d.getSnapshot!==a||b||ja!==null&&ja.memoizedState.tag&1){if(i.flags|=2048,qs(9,{destroy:void 0},Fp.bind(null,i,d,r,a),null),ea===null)throw Error(s(349));h||(Fr&127)!==0||Yp(i,a,r)}return r}function Yp(e,a,r){e.flags|=16384,e={getSnapshot:a,value:r},a=st.updateQueue,a===null?(a=Eu(),st.updateQueue=a,a.stores=[e]):(r=a.stores,r===null?a.stores=[e]:r.push(e))}function Fp(e,a,r,i){a.value=r,a.getSnapshot=i,Gp(a)&&Xp(e)}function Pp(e,a,r){return r(function(){Gp(a)&&Xp(e)})}function Gp(e){var a=e.getSnapshot;e=e.value;try{var r=a();return!Cn(e,r)}catch{return!0}}function Xp(e){var a=Wl(e,2);a!==null&&Nn(a,e,2)}function ef(e){var a=hn();if(typeof e=="function"){var r=e;if(e=r(),os){Tt(!0);try{r()}finally{Tt(!1)}}}return a.memoizedState=a.baseState=e,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:e},a}function Qp(e,a,r,i){return e.baseState=r,Jd(e,Yt,typeof i=="function"?i:Pr)}function y1(e,a,r,i,d){if(Cu(e))throw Error(s(485));if(e=a.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=a.pending,r===null?(h.next=a.pending=h,Kp(a,h)):(h.next=r.next,a.pending=r.next=h)}}function Kp(e,a){var r=a.action,i=a.payload,d=e.state;if(a.isTransition){var h=U.T,b={};U.T=b;try{var E=r(d,i),k=U.S;k!==null&&k(b,E),Zp(e,a,E)}catch(F){tf(e,a,F)}finally{h!==null&&b.types!==null&&(h.types=b.types),U.T=h}}else try{h=r(d,i),Zp(e,a,h)}catch(F){tf(e,a,F)}}function Zp(e,a,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){Jp(e,a,i)},function(i){return tf(e,a,i)}):Jp(e,a,r)}function Jp(e,a,r){a.status="fulfilled",a.value=r,Wp(a),e.state=r,a=e.pending,a!==null&&(r=a.next,r===a?e.pending=null:(r=r.next,a.next=r,Kp(e,r)))}function tf(e,a,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do a.status="rejected",a.reason=r,Wp(a),a=a.next;while(a!==i)}e.action=null}function Wp(e){e=e.listeners;for(var a=0;a<e.length;a++)(0,e[a])()}function eg(e,a){return a}function tg(e,a){if(Et){var r=ea.formState;if(r!==null){e:{var i=st;if(Et){if(ra){t:{for(var d=ra,h=Fn;d.nodeType!==8;){if(!h){d=null;break t}if(d=Gn(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){ra=Gn(d.nextSibling),i=d.data==="F!";break e}}hl(i)}i=!1}i&&(a=r[0])}}return r=hn(),r.memoizedState=r.baseState=a,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:eg,lastRenderedState:a},r.queue=i,r=bg.bind(null,st,i),i.dispatch=r,i=ef(!1),h=of.bind(null,st,!1,i.queue),i=hn(),d={state:a,dispatch:null,action:e,pending:null},i.queue=d,r=y1.bind(null,st,d,h,r),d.dispatch=r,i.memoizedState=e,[a,r,!1]}function ag(e){var a=va();return ng(a,Yt,e)}function ng(e,a,r){if(a=Jd(e,a,eg)[0],e=Ru(Pr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var i=$i(a)}catch(b){throw b===zs?pu:b}else i=a;a=va();var d=a.queue,h=d.dispatch;return r!==a.memoizedState&&(st.flags|=2048,qs(9,{destroy:void 0},x1.bind(null,d,r),null)),[i,h,e]}function x1(e,a){e.action=a}function rg(e){var a=va(),r=Yt;if(r!==null)return ng(a,r,e);va(),a=a.memoizedState,r=va();var i=r.queue.dispatch;return r.memoizedState=e,[a,i,!1]}function qs(e,a,r,i){return e={tag:e,create:r,deps:i,inst:a,next:null},a=st.updateQueue,a===null&&(a=Eu(),st.updateQueue=a),r=a.lastEffect,r===null?a.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,a.lastEffect=e),e}function lg(){return va().memoizedState}function ju(e,a,r,i){var d=hn();st.flags|=e,d.memoizedState=qs(1|a,{destroy:void 0},r,i===void 0?null:i)}function Tu(e,a,r,i){var d=va();i=i===void 0?null:i;var h=d.memoizedState.inst;Yt!==null&&i!==null&&Pd(i,Yt.memoizedState.deps)?d.memoizedState=qs(a,h,r,i):(st.flags|=e,d.memoizedState=qs(1|a,h,r,i))}function sg(e,a){ju(8390656,8,e,a)}function af(e,a){Tu(2048,8,e,a)}function b1(e){st.flags|=4;var a=st.updateQueue;if(a===null)a=Eu(),st.updateQueue=a,a.events=[e];else{var r=a.events;r===null?a.events=[e]:r.push(e)}}function ig(e){var a=va().memoizedState;return b1({ref:a,nextImpl:e}),function(){if((Ot&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}function og(e,a){return Tu(4,2,e,a)}function ug(e,a){return Tu(4,4,e,a)}function cg(e,a){if(typeof a=="function"){e=e();var r=a(e);return function(){typeof r=="function"?r():a(null)}}if(a!=null)return e=e(),a.current=e,function(){a.current=null}}function dg(e,a,r){r=r!=null?r.concat([e]):null,Tu(4,4,cg.bind(null,a,e),r)}function nf(){}function fg(e,a){var r=va();a=a===void 0?null:a;var i=r.memoizedState;return a!==null&&Pd(a,i[1])?i[0]:(r.memoizedState=[e,a],e)}function hg(e,a){var r=va();a=a===void 0?null:a;var i=r.memoizedState;if(a!==null&&Pd(a,i[1]))return i[0];if(i=e(),os){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[i,a],i}function rf(e,a,r){return r===void 0||(Fr&1073741824)!==0&&(xt&261930)===0?e.memoizedState=a:(e.memoizedState=r,e=mv(),st.lanes|=e,wl|=e,r)}function mg(e,a,r,i){return Cn(r,a)?r:Bs.current!==null?(e=rf(e,r,i),Cn(e,a)||(Ta=!0),e):(Fr&42)===0||(Fr&1073741824)!==0&&(xt&261930)===0?(Ta=!0,e.memoizedState=r):(e=mv(),st.lanes|=e,wl|=e,a)}function pg(e,a,r,i,d){var h=B.p;B.p=h!==0&&8>h?h:8;var b=U.T,E={};U.T=E,of(e,!1,a,r);try{var k=d(),F=U.S;if(F!==null&&F(E,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var J=p1(k,i);qi(e,a,J,_n(e))}else qi(e,a,i,_n(e))}catch(ie){qi(e,a,{then:function(){},status:"rejected",reason:ie},_n())}finally{B.p=h,b!==null&&E.types!==null&&(b.types=E.types),U.T=b}}function S1(){}function lf(e,a,r,i){if(e.tag!==5)throw Error(s(476));var d=gg(e).queue;pg(e,d,a,ue,r===null?S1:function(){return vg(e),r(i)})}function gg(e){var a=e.memoizedState;if(a!==null)return a;a={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:ue},next:null};var r={};return a.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pr,lastRenderedState:r},next:null},e.memoizedState=a,e=e.alternate,e!==null&&(e.memoizedState=a),a}function vg(e){var a=gg(e);a.next===null&&(a=e.alternate.memoizedState),qi(e,a.next.queue,{},_n())}function sf(){return Xa(ro)}function yg(){return va().memoizedState}function xg(){return va().memoizedState}function w1(e){for(var a=e.return;a!==null;){switch(a.tag){case 24:case 3:var r=_n();e=gl(r);var i=vl(a,e,r);i!==null&&(Nn(i,a,r),zi(i,a,r)),a={cache:Ld()},e.payload=a;return}a=a.return}}function E1(e,a,r){var i=_n();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Cu(e)?Sg(a,r):(r=Nd(e,a,r,i),r!==null&&(Nn(r,e,i),wg(r,a,i)))}function bg(e,a,r){var i=_n();qi(e,a,r,i)}function qi(e,a,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Cu(e))Sg(a,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=a.lastRenderedReducer,h!==null))try{var b=a.lastRenderedState,E=h(b,r);if(d.hasEagerState=!0,d.eagerState=E,Cn(E,b))return ou(e,a,d,0),ea===null&&iu(),!1}catch{}finally{}if(r=Nd(e,a,d,i),r!==null)return Nn(r,e,i),wg(r,a,i),!0}return!1}function of(e,a,r,i){if(i={lane:2,revertLane:$f(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Cu(e)){if(a)throw Error(s(479))}else a=Nd(e,r,i,2),a!==null&&Nn(a,e,2)}function Cu(e){var a=e.alternate;return e===st||a!==null&&a===st}function Sg(e,a){Hs=Su=!0;var r=e.pending;r===null?a.next=a:(a.next=r.next,r.next=a),e.pending=a}function wg(e,a,r){if((r&4194048)!==0){var i=a.lanes;i&=e.pendingLanes,r|=i,a.lanes=r,Da(e,r)}}var Ii={readContext:Xa,use:Nu,useCallback:ca,useContext:ca,useEffect:ca,useImperativeHandle:ca,useLayoutEffect:ca,useInsertionEffect:ca,useMemo:ca,useReducer:ca,useRef:ca,useState:ca,useDebugValue:ca,useDeferredValue:ca,useTransition:ca,useSyncExternalStore:ca,useId:ca,useHostTransitionStatus:ca,useFormState:ca,useActionState:ca,useOptimistic:ca,useMemoCache:ca,useCacheRefresh:ca};Ii.useEffectEvent=ca;var Eg={readContext:Xa,use:Nu,useCallback:function(e,a){return hn().memoizedState=[e,a===void 0?null:a],e},useContext:Xa,useEffect:sg,useImperativeHandle:function(e,a,r){r=r!=null?r.concat([e]):null,ju(4194308,4,cg.bind(null,a,e),r)},useLayoutEffect:function(e,a){return ju(4194308,4,e,a)},useInsertionEffect:function(e,a){ju(4,2,e,a)},useMemo:function(e,a){var r=hn();a=a===void 0?null:a;var i=e();if(os){Tt(!0);try{e()}finally{Tt(!1)}}return r.memoizedState=[i,a],i},useReducer:function(e,a,r){var i=hn();if(r!==void 0){var d=r(a);if(os){Tt(!0);try{r(a)}finally{Tt(!1)}}}else d=a;return i.memoizedState=i.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},i.queue=e,e=e.dispatch=E1.bind(null,st,e),[i.memoizedState,e]},useRef:function(e){var a=hn();return e={current:e},a.memoizedState=e},useState:function(e){e=ef(e);var a=e.queue,r=bg.bind(null,st,a);return a.dispatch=r,[e.memoizedState,r]},useDebugValue:nf,useDeferredValue:function(e,a){var r=hn();return rf(r,e,a)},useTransition:function(){var e=ef(!1);return e=pg.bind(null,st,e.queue,!0,!1),hn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,a,r){var i=st,d=hn();if(Et){if(r===void 0)throw Error(s(407));r=r()}else{if(r=a(),ea===null)throw Error(s(349));(xt&127)!==0||Yp(i,a,r)}d.memoizedState=r;var h={value:r,getSnapshot:a};return d.queue=h,sg(Pp.bind(null,i,h,e),[e]),i.flags|=2048,qs(9,{destroy:void 0},Fp.bind(null,i,h,r,a),null),r},useId:function(){var e=hn(),a=ea.identifierPrefix;if(Et){var r=Sr,i=br;r=(i&~(1<<32-Kt(i)-1)).toString(32)+r,a="_"+a+"R_"+r,r=wu++,0<r&&(a+="H"+r.toString(32)),a+="_"}else r=g1++,a="_"+a+"r_"+r.toString(32)+"_";return e.memoizedState=a},useHostTransitionStatus:sf,useFormState:tg,useActionState:tg,useOptimistic:function(e){var a=hn();a.memoizedState=a.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=r,a=of.bind(null,st,!0,r),r.dispatch=a,[e,a]},useMemoCache:Zd,useCacheRefresh:function(){return hn().memoizedState=w1.bind(null,st)},useEffectEvent:function(e){var a=hn(),r={impl:e};return a.memoizedState=r,function(){if((Ot&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},uf={readContext:Xa,use:Nu,useCallback:fg,useContext:Xa,useEffect:af,useImperativeHandle:dg,useInsertionEffect:og,useLayoutEffect:ug,useMemo:hg,useReducer:Ru,useRef:lg,useState:function(){return Ru(Pr)},useDebugValue:nf,useDeferredValue:function(e,a){var r=va();return mg(r,Yt.memoizedState,e,a)},useTransition:function(){var e=Ru(Pr)[0],a=va().memoizedState;return[typeof e=="boolean"?e:$i(e),a]},useSyncExternalStore:Vp,useId:yg,useHostTransitionStatus:sf,useFormState:ag,useActionState:ag,useOptimistic:function(e,a){var r=va();return Qp(r,Yt,e,a)},useMemoCache:Zd,useCacheRefresh:xg};uf.useEffectEvent=ig;var Ng={readContext:Xa,use:Nu,useCallback:fg,useContext:Xa,useEffect:af,useImperativeHandle:dg,useInsertionEffect:og,useLayoutEffect:ug,useMemo:hg,useReducer:Wd,useRef:lg,useState:function(){return Wd(Pr)},useDebugValue:nf,useDeferredValue:function(e,a){var r=va();return Yt===null?rf(r,e,a):mg(r,Yt.memoizedState,e,a)},useTransition:function(){var e=Wd(Pr)[0],a=va().memoizedState;return[typeof e=="boolean"?e:$i(e),a]},useSyncExternalStore:Vp,useId:yg,useHostTransitionStatus:sf,useFormState:rg,useActionState:rg,useOptimistic:function(e,a){var r=va();return Yt!==null?Qp(r,Yt,e,a):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Zd,useCacheRefresh:xg};Ng.useEffectEvent=ig;function cf(e,a,r,i){a=e.memoizedState,r=r(i,a),r=r==null?a:y({},a,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var df={enqueueSetState:function(e,a,r){e=e._reactInternals;var i=_n(),d=gl(i);d.payload=a,r!=null&&(d.callback=r),a=vl(e,d,i),a!==null&&(Nn(a,e,i),zi(a,e,i))},enqueueReplaceState:function(e,a,r){e=e._reactInternals;var i=_n(),d=gl(i);d.tag=1,d.payload=a,r!=null&&(d.callback=r),a=vl(e,d,i),a!==null&&(Nn(a,e,i),zi(a,e,i))},enqueueForceUpdate:function(e,a){e=e._reactInternals;var r=_n(),i=gl(r);i.tag=2,a!=null&&(i.callback=a),a=vl(e,i,r),a!==null&&(Nn(a,e,r),zi(a,e,r))}};function Rg(e,a,r,i,d,h,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,b):a.prototype&&a.prototype.isPureReactComponent?!Ci(r,i)||!Ci(d,h):!0}function jg(e,a,r,i){e=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(r,i),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(r,i),a.state!==e&&df.enqueueReplaceState(a,a.state,null)}function us(e,a){var r=a;if("ref"in a){r={};for(var i in a)i!=="ref"&&(r[i]=a[i])}if(e=e.defaultProps){r===a&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function Tg(e){su(e)}function Cg(e){console.error(e)}function Ag(e){su(e)}function Au(e,a){try{var r=e.onUncaughtError;r(a.value,{componentStack:a.stack})}catch(i){setTimeout(function(){throw i})}}function Dg(e,a,r){try{var i=e.onCaughtError;i(r.value,{componentStack:r.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function ff(e,a,r){return r=gl(r),r.tag=3,r.payload={element:null},r.callback=function(){Au(e,a)},r}function kg(e){return e=gl(e),e.tag=3,e}function Og(e,a,r,i){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var h=i.value;e.payload=function(){return d(h)},e.callback=function(){Dg(a,r,i)}}var b=r.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Dg(a,r,i),typeof d!="function"&&(El===null?El=new Set([this]):El.add(this));var E=i.stack;this.componentDidCatch(i.value,{componentStack:E!==null?E:""})})}function N1(e,a,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(a=r.alternate,a!==null&&Ms(a,r,d,!0),r=Dn.current,r!==null){switch(r.tag){case 31:case 13:return Pn===null?qu():r.alternate===null&&da===0&&(da=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===gu?r.flags|=16384:(a=r.updateQueue,a===null?r.updateQueue=new Set([i]):a.add(i),Uf(e,i,d)),!1;case 22:return r.flags|=65536,i===gu?r.flags|=16384:(a=r.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=a):(r=a.retryQueue,r===null?a.retryQueue=new Set([i]):r.add(i)),Uf(e,i,d)),!1}throw Error(s(435,r.tag))}return Uf(e,i,d),qu(),!1}if(Et)return a=Dn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=d,i!==Dd&&(e=Error(s(422),{cause:i}),ki(In(e,r)))):(i!==Dd&&(a=Error(s(423),{cause:i}),ki(In(a,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=In(i,r),d=ff(e.stateNode,i,d),qd(e,d),da!==4&&(da=2)),!1;var h=Error(s(520),{cause:i});if(h=In(h,r),Ki===null?Ki=[h]:Ki.push(h),da!==4&&(da=2),a===null)return!0;i=In(i,r),r=a;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=ff(r.stateNode,i,e),qd(r,e),!1;case 1:if(a=r.type,h=r.stateNode,(r.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(El===null||!El.has(h))))return r.flags|=65536,d&=-d,r.lanes|=d,d=kg(d),Og(d,e,r,i),qd(r,d),!1}r=r.return}while(r!==null);return!1}var hf=Error(s(461)),Ta=!1;function Qa(e,a,r,i){a.child=e===null?zp(a,null,r,i):is(a,e.child,r,i)}function Mg(e,a,r,i,d){r=r.render;var h=a.ref;if("ref"in i){var b={};for(var E in i)E!=="ref"&&(b[E]=i[E])}else b=i;return ns(a),i=Gd(e,a,r,b,h,d),E=Xd(),e!==null&&!Ta?(Qd(e,a,d),Gr(e,a,d)):(Et&&E&&Cd(a),a.flags|=1,Qa(e,a,i,d),a.child)}function _g(e,a,r,i,d){if(e===null){var h=r.type;return typeof h=="function"&&!Rd(h)&&h.defaultProps===void 0&&r.compare===null?(a.tag=15,a.type=h,Lg(e,a,h,i,d)):(e=cu(r.type,null,i,a,a.mode,d),e.ref=a.ref,e.return=a,a.child=e)}if(h=e.child,!Sf(e,d)){var b=h.memoizedProps;if(r=r.compare,r=r!==null?r:Ci,r(b,i)&&e.ref===a.ref)return Gr(e,a,d)}return a.flags|=1,e=qr(h,i),e.ref=a.ref,e.return=a,a.child=e}function Lg(e,a,r,i,d){if(e!==null){var h=e.memoizedProps;if(Ci(h,i)&&e.ref===a.ref)if(Ta=!1,a.pendingProps=i=h,Sf(e,d))(e.flags&131072)!==0&&(Ta=!0);else return a.lanes=e.lanes,Gr(e,a,d)}return mf(e,a,r,i,d)}function zg(e,a,r,i){var d=i.children,h=e!==null?e.memoizedState:null;if(e===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((a.flags&128)!==0){if(h=h!==null?h.baseLanes|r:r,e!==null){for(i=a.child=e.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~h}else i=0,a.child=null;return Ug(e,a,h,r,i)}if((r&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},e!==null&&mu(a,h!==null?h.cachePool:null),h!==null?Hp(a,h):Vd(),$p(a);else return i=a.lanes=536870912,Ug(e,a,h!==null?h.baseLanes|r:r,r,i)}else h!==null?(mu(a,h.cachePool),Hp(a,h),xl(),a.memoizedState=null):(e!==null&&mu(a,null),Vd(),xl());return Qa(e,a,d,r),a.child}function Vi(e,a){return e!==null&&e.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Ug(e,a,r,i,d){var h=Ud();return h=h===null?null:{parent:Ra._currentValue,pool:h},a.memoizedState={baseLanes:r,cachePool:h},e!==null&&mu(a,null),Vd(),$p(a),e!==null&&Ms(e,a,i,!0),a.childLanes=d,null}function Du(e,a){return a=Ou({mode:a.mode,children:a.children},e.mode),a.ref=e.ref,e.child=a,a.return=e,a}function Bg(e,a,r){return is(a,e.child,null,r),e=Du(a,a.pendingProps),e.flags|=2,kn(a),a.memoizedState=null,e}function R1(e,a,r){var i=a.pendingProps,d=(a.flags&128)!==0;if(a.flags&=-129,e===null){if(Et){if(i.mode==="hidden")return e=Du(a,i),a.lanes=536870912,Vi(null,e);if(Fd(a),(e=ra)?(e=Kv(e,Fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(a.memoizedState={dehydrated:e,treeContext:dl!==null?{id:br,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},r=Sp(e),r.return=a,a.child=r,Ga=a,ra=null)):e=null,e===null)throw hl(a);return a.lanes=536870912,null}return Du(a,i)}var h=e.memoizedState;if(h!==null){var b=h.dehydrated;if(Fd(a),d)if(a.flags&256)a.flags&=-257,a=Bg(e,a,r);else if(a.memoizedState!==null)a.child=e.child,a.flags|=128,a=null;else throw Error(s(558));else if(Ta||Ms(e,a,r,!1),d=(r&e.childLanes)!==0,Ta||d){if(i=ea,i!==null&&(b=D(i,r),b!==0&&b!==h.retryLane))throw h.retryLane=b,Wl(e,b),Nn(i,e,b),hf;qu(),a=Bg(e,a,r)}else e=h.treeContext,ra=Gn(b.nextSibling),Ga=a,Et=!0,fl=null,Fn=!1,e!==null&&Np(a,e),a=Du(a,i),a.flags|=4096;return a}return e=qr(e.child,{mode:i.mode,children:i.children}),e.ref=a.ref,a.child=e,e.return=a,e}function ku(e,a){var r=a.ref;if(r===null)e!==null&&e.ref!==null&&(a.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(a.flags|=4194816)}}function mf(e,a,r,i,d){return ns(a),r=Gd(e,a,r,i,void 0,d),i=Xd(),e!==null&&!Ta?(Qd(e,a,d),Gr(e,a,d)):(Et&&i&&Cd(a),a.flags|=1,Qa(e,a,r,d),a.child)}function Hg(e,a,r,i,d,h){return ns(a),a.updateQueue=null,r=Ip(a,i,r,d),qp(e),i=Xd(),e!==null&&!Ta?(Qd(e,a,h),Gr(e,a,h)):(Et&&i&&Cd(a),a.flags|=1,Qa(e,a,r,h),a.child)}function $g(e,a,r,i,d){if(ns(a),a.stateNode===null){var h=As,b=r.contextType;typeof b=="object"&&b!==null&&(h=Xa(b)),h=new r(i,h),a.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=df,a.stateNode=h,h._reactInternals=a,h=a.stateNode,h.props=i,h.state=a.memoizedState,h.refs={},Hd(a),b=r.contextType,h.context=typeof b=="object"&&b!==null?Xa(b):As,h.state=a.memoizedState,b=r.getDerivedStateFromProps,typeof b=="function"&&(cf(a,r,b,i),h.state=a.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&df.enqueueReplaceState(h,h.state,null),Bi(a,i,h,d),Ui(),h.state=a.memoizedState),typeof h.componentDidMount=="function"&&(a.flags|=4194308),i=!0}else if(e===null){h=a.stateNode;var E=a.memoizedProps,k=us(r,E);h.props=k;var F=h.context,J=r.contextType;b=As,typeof J=="object"&&J!==null&&(b=Xa(J));var ie=r.getDerivedStateFromProps;J=typeof ie=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=a.pendingProps!==E,J||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||F!==b)&&jg(a,h,i,b),pl=!1;var G=a.memoizedState;h.state=G,Bi(a,i,h,d),Ui(),F=a.memoizedState,E||G!==F||pl?(typeof ie=="function"&&(cf(a,r,ie,i),F=a.memoizedState),(k=pl||Rg(a,r,k,i,G,F,b))?(J||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(a.flags|=4194308)):(typeof h.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=i,a.memoizedState=F),h.props=i,h.state=F,h.context=b,i=k):(typeof h.componentDidMount=="function"&&(a.flags|=4194308),i=!1)}else{h=a.stateNode,$d(e,a),b=a.memoizedProps,J=us(r,b),h.props=J,ie=a.pendingProps,G=h.context,F=r.contextType,k=As,typeof F=="object"&&F!==null&&(k=Xa(F)),E=r.getDerivedStateFromProps,(F=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==ie||G!==k)&&jg(a,h,i,k),pl=!1,G=a.memoizedState,h.state=G,Bi(a,i,h,d),Ui();var Q=a.memoizedState;b!==ie||G!==Q||pl||e!==null&&e.dependencies!==null&&fu(e.dependencies)?(typeof E=="function"&&(cf(a,r,E,i),Q=a.memoizedState),(J=pl||Rg(a,r,J,i,G,Q,k)||e!==null&&e.dependencies!==null&&fu(e.dependencies))?(F||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,Q,k),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,Q,k)),typeof h.componentDidUpdate=="function"&&(a.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(a.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(a.flags|=1024),a.memoizedProps=i,a.memoizedState=Q),h.props=i,h.state=Q,h.context=k,i=J):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(a.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&G===e.memoizedState||(a.flags|=1024),i=!1)}return h=i,ku(e,a),i=(a.flags&128)!==0,h||i?(h=a.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:h.render(),a.flags|=1,e!==null&&i?(a.child=is(a,e.child,null,d),a.child=is(a,null,r,d)):Qa(e,a,r,d),a.memoizedState=h.state,e=a.child):e=Gr(e,a,d),e}function qg(e,a,r,i){return ts(),a.flags|=256,Qa(e,a,r,i),a.child}var pf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gf(e){return{baseLanes:e,cachePool:Dp()}}function vf(e,a,r){return e=e!==null?e.childLanes&~r:0,a&&(e|=Mn),e}function Ig(e,a,r){var i=a.pendingProps,d=!1,h=(a.flags&128)!==0,b;if((b=h)||(b=e!==null&&e.memoizedState===null?!1:(ga.current&2)!==0),b&&(d=!0,a.flags&=-129),b=(a.flags&32)!==0,a.flags&=-33,e===null){if(Et){if(d?yl(a):xl(),(e=ra)?(e=Kv(e,Fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(a.memoizedState={dehydrated:e,treeContext:dl!==null?{id:br,overflow:Sr}:null,retryLane:536870912,hydrationErrors:null},r=Sp(e),r.return=a,a.child=r,Ga=a,ra=null)):e=null,e===null)throw hl(a);return Wf(e)?a.lanes=32:a.lanes=536870912,null}var E=i.children;return i=i.fallback,d?(xl(),d=a.mode,E=Ou({mode:"hidden",children:E},d),i=es(i,d,r,null),E.return=a,i.return=a,E.sibling=i,a.child=E,i=a.child,i.memoizedState=gf(r),i.childLanes=vf(e,b,r),a.memoizedState=pf,Vi(null,i)):(yl(a),yf(a,E))}var k=e.memoizedState;if(k!==null&&(E=k.dehydrated,E!==null)){if(h)a.flags&256?(yl(a),a.flags&=-257,a=xf(e,a,r)):a.memoizedState!==null?(xl(),a.child=e.child,a.flags|=128,a=null):(xl(),E=i.fallback,d=a.mode,i=Ou({mode:"visible",children:i.children},d),E=es(E,d,r,null),E.flags|=2,i.return=a,E.return=a,i.sibling=E,a.child=i,is(a,e.child,null,r),i=a.child,i.memoizedState=gf(r),i.childLanes=vf(e,b,r),a.memoizedState=pf,a=Vi(null,i));else if(yl(a),Wf(E)){if(b=E.nextSibling&&E.nextSibling.dataset,b)var F=b.dgst;b=F,i=Error(s(419)),i.stack="",i.digest=b,ki({value:i,source:null,stack:null}),a=xf(e,a,r)}else if(Ta||Ms(e,a,r,!1),b=(r&e.childLanes)!==0,Ta||b){if(b=ea,b!==null&&(i=D(b,r),i!==0&&i!==k.retryLane))throw k.retryLane=i,Wl(e,i),Nn(b,e,i),hf;Jf(E)||qu(),a=xf(e,a,r)}else Jf(E)?(a.flags|=192,a.child=e.child,a=null):(e=k.treeContext,ra=Gn(E.nextSibling),Ga=a,Et=!0,fl=null,Fn=!1,e!==null&&Np(a,e),a=yf(a,i.children),a.flags|=4096);return a}return d?(xl(),E=i.fallback,d=a.mode,k=e.child,F=k.sibling,i=qr(k,{mode:"hidden",children:i.children}),i.subtreeFlags=k.subtreeFlags&65011712,F!==null?E=qr(F,E):(E=es(E,d,r,null),E.flags|=2),E.return=a,i.return=a,i.sibling=E,a.child=i,Vi(null,i),i=a.child,E=e.child.memoizedState,E===null?E=gf(r):(d=E.cachePool,d!==null?(k=Ra._currentValue,d=d.parent!==k?{parent:k,pool:k}:d):d=Dp(),E={baseLanes:E.baseLanes|r,cachePool:d}),i.memoizedState=E,i.childLanes=vf(e,b,r),a.memoizedState=pf,Vi(e.child,i)):(yl(a),r=e.child,e=r.sibling,r=qr(r,{mode:"visible",children:i.children}),r.return=a,r.sibling=null,e!==null&&(b=a.deletions,b===null?(a.deletions=[e],a.flags|=16):b.push(e)),a.child=r,a.memoizedState=null,r)}function yf(e,a){return a=Ou({mode:"visible",children:a},e.mode),a.return=e,e.child=a}function Ou(e,a){return e=An(22,e,null,a),e.lanes=0,e}function xf(e,a,r){return is(a,e.child,null,r),e=yf(a,a.pendingProps.children),e.flags|=2,a.memoizedState=null,e}function Vg(e,a,r){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a),Md(e.return,a,r)}function bf(e,a,r,i,d,h){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:h}:(b.isBackwards=a,b.rendering=null,b.renderingStartTime=0,b.last=i,b.tail=r,b.tailMode=d,b.treeForkCount=h)}function Yg(e,a,r){var i=a.pendingProps,d=i.revealOrder,h=i.tail;i=i.children;var b=ga.current,E=(b&2)!==0;if(E?(b=b&1|2,a.flags|=128):b&=1,ae(ga,b),Qa(e,a,i,r),i=Et?Di:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=a.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Vg(e,r,a);else if(e.tag===19)Vg(e,r,a);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===a)break e;for(;e.sibling===null;){if(e.return===null||e.return===a)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=a.child,d=null;r!==null;)e=r.alternate,e!==null&&bu(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=a.child,a.child=null):(d=r.sibling,r.sibling=null),bf(a,!1,d,r,h,i);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=a.child,a.child=null;d!==null;){if(e=d.alternate,e!==null&&bu(e)===null){a.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}bf(a,!0,r,null,h,i);break;case"together":bf(a,!1,null,null,void 0,i);break;default:a.memoizedState=null}return a.child}function Gr(e,a,r){if(e!==null&&(a.dependencies=e.dependencies),wl|=a.lanes,(r&a.childLanes)===0)if(e!==null){if(Ms(e,a,r,!1),(r&a.childLanes)===0)return null}else return null;if(e!==null&&a.child!==e.child)throw Error(s(153));if(a.child!==null){for(e=a.child,r=qr(e,e.pendingProps),a.child=r,r.return=a;e.sibling!==null;)e=e.sibling,r=r.sibling=qr(e,e.pendingProps),r.return=a;r.sibling=null}return a.child}function Sf(e,a){return(e.lanes&a)!==0?!0:(e=e.dependencies,!!(e!==null&&fu(e)))}function j1(e,a,r){switch(a.tag){case 3:ut(a,a.stateNode.containerInfo),ml(a,Ra,e.memoizedState.cache),ts();break;case 27:case 5:at(a);break;case 4:ut(a,a.stateNode.containerInfo);break;case 10:ml(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Fd(a),null;break;case 13:var i=a.memoizedState;if(i!==null)return i.dehydrated!==null?(yl(a),a.flags|=128,null):(r&a.child.childLanes)!==0?Ig(e,a,r):(yl(a),e=Gr(e,a,r),e!==null?e.sibling:null);yl(a);break;case 19:var d=(e.flags&128)!==0;if(i=(r&a.childLanes)!==0,i||(Ms(e,a,r,!1),i=(r&a.childLanes)!==0),d){if(i)return Yg(e,a,r);a.flags|=128}if(d=a.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ae(ga,ga.current),i)break;return null;case 22:return a.lanes=0,zg(e,a,r,a.pendingProps);case 24:ml(a,Ra,e.memoizedState.cache)}return Gr(e,a,r)}function Fg(e,a,r){if(e!==null)if(e.memoizedProps!==a.pendingProps)Ta=!0;else{if(!Sf(e,r)&&(a.flags&128)===0)return Ta=!1,j1(e,a,r);Ta=(e.flags&131072)!==0}else Ta=!1,Et&&(a.flags&1048576)!==0&&Ep(a,Di,a.index);switch(a.lanes=0,a.tag){case 16:e:{var i=a.pendingProps;if(e=ls(a.elementType),a.type=e,typeof e=="function")Rd(e)?(i=us(e,i),a.tag=1,a=$g(null,a,e,i,r)):(a.tag=0,a=mf(null,a,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===X){a.tag=11,a=Mg(null,a,e,i,r);break e}else if(d===z){a.tag=14,a=_g(null,a,e,i,r);break e}}throw a=re(e)||e,Error(s(306,a,""))}}return a;case 0:return mf(e,a,a.type,a.pendingProps,r);case 1:return i=a.type,d=us(i,a.pendingProps),$g(e,a,i,d,r);case 3:e:{if(ut(a,a.stateNode.containerInfo),e===null)throw Error(s(387));i=a.pendingProps;var h=a.memoizedState;d=h.element,$d(e,a),Bi(a,i,null,r);var b=a.memoizedState;if(i=b.cache,ml(a,Ra,i),i!==h.cache&&_d(a,[Ra],r,!0),Ui(),i=b.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:b.cache},a.updateQueue.baseState=h,a.memoizedState=h,a.flags&256){a=qg(e,a,i,r);break e}else if(i!==d){d=In(Error(s(424)),a),ki(d),a=qg(e,a,i,r);break e}else{switch(e=a.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ra=Gn(e.firstChild),Ga=a,Et=!0,fl=null,Fn=!0,r=zp(a,null,i,r),a.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ts(),i===d){a=Gr(e,a,r);break e}Qa(e,a,i,r)}a=a.child}return a;case 26:return ku(e,a),e===null?(r=ay(a.type,null,a.pendingProps,null))?a.memoizedState=r:Et||(r=a.type,e=a.pendingProps,i=Xu(je.current).createElement(r),i[ve]=a,i[De]=e,Ka(i,r,e),dt(i),a.stateNode=i):a.memoizedState=ay(a.type,e.memoizedProps,a.pendingProps,e.memoizedState),null;case 27:return at(a),e===null&&Et&&(i=a.stateNode=Wv(a.type,a.pendingProps,je.current),Ga=a,Fn=!0,d=ra,Tl(a.type)?(eh=d,ra=Gn(i.firstChild)):ra=d),Qa(e,a,a.pendingProps.children,r),ku(e,a),e===null&&(a.flags|=4194304),a.child;case 5:return e===null&&Et&&((d=i=ra)&&(i=aS(i,a.type,a.pendingProps,Fn),i!==null?(a.stateNode=i,Ga=a,ra=Gn(i.firstChild),Fn=!1,d=!0):d=!1),d||hl(a)),at(a),d=a.type,h=a.pendingProps,b=e!==null?e.memoizedProps:null,i=h.children,Qf(d,h)?i=null:b!==null&&Qf(d,b)&&(a.flags|=32),a.memoizedState!==null&&(d=Gd(e,a,v1,null,null,r),ro._currentValue=d),ku(e,a),Qa(e,a,i,r),a.child;case 6:return e===null&&Et&&((e=r=ra)&&(r=nS(r,a.pendingProps,Fn),r!==null?(a.stateNode=r,Ga=a,ra=null,e=!0):e=!1),e||hl(a)),null;case 13:return Ig(e,a,r);case 4:return ut(a,a.stateNode.containerInfo),i=a.pendingProps,e===null?a.child=is(a,null,i,r):Qa(e,a,i,r),a.child;case 11:return Mg(e,a,a.type,a.pendingProps,r);case 7:return Qa(e,a,a.pendingProps,r),a.child;case 8:return Qa(e,a,a.pendingProps.children,r),a.child;case 12:return Qa(e,a,a.pendingProps.children,r),a.child;case 10:return i=a.pendingProps,ml(a,a.type,i.value),Qa(e,a,i.children,r),a.child;case 9:return d=a.type._context,i=a.pendingProps.children,ns(a),d=Xa(d),i=i(d),a.flags|=1,Qa(e,a,i,r),a.child;case 14:return _g(e,a,a.type,a.pendingProps,r);case 15:return Lg(e,a,a.type,a.pendingProps,r);case 19:return Yg(e,a,r);case 31:return R1(e,a,r);case 22:return zg(e,a,r,a.pendingProps);case 24:return ns(a),i=Xa(Ra),e===null?(d=Ud(),d===null&&(d=ea,h=Ld(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=r),d=h),a.memoizedState={parent:i,cache:d},Hd(a),ml(a,Ra,d)):((e.lanes&r)!==0&&($d(e,a),Bi(a,null,null,r),Ui()),d=e.memoizedState,h=a.memoizedState,d.parent!==i?(d={parent:i,cache:i},a.memoizedState=d,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=d),ml(a,Ra,i)):(i=h.cache,ml(a,Ra,i),i!==d.cache&&_d(a,[Ra],r,!0))),Qa(e,a,a.pendingProps.children,r),a.child;case 29:throw a.pendingProps}throw Error(s(156,a.tag))}function Xr(e){e.flags|=4}function wf(e,a,r,i,d){if((a=(e.mode&32)!==0)&&(a=!1),a){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(yv())e.flags|=8192;else throw ss=gu,Bd}else e.flags&=-16777217}function Pg(e,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!iy(a))if(yv())e.flags|=8192;else throw ss=gu,Bd}function Mu(e,a){a!==null&&(e.flags|=4),e.flags&16384&&(a=e.tag!==22?Zt():536870912,e.lanes|=a,Fs|=a)}function Yi(e,a){if(!Et)switch(e.tailMode){case"hidden":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.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?a||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function la(e){var a=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(a)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,a}function T1(e,a,r){var i=a.pendingProps;switch(Ad(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return la(a),null;case 1:return la(a),null;case 3:return r=a.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Yr(Ra),Ge(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Os(a)?Xr(a):e===null||e.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,kd())),la(a),null;case 26:var d=a.type,h=a.memoizedState;return e===null?(Xr(a),h!==null?(la(a),Pg(a,h)):(la(a),wf(a,d,null,i,r))):h?h!==e.memoizedState?(Xr(a),la(a),Pg(a,h)):(la(a),a.flags&=-16777217):(e=e.memoizedProps,e!==i&&Xr(a),la(a),wf(a,d,e,i,r)),null;case 27:if(ba(a),r=je.current,d=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==i&&Xr(a);else{if(!i){if(a.stateNode===null)throw Error(s(166));return la(a),null}e=me.current,Os(a)?Rp(a):(e=Wv(d,i,r),a.stateNode=e,Xr(a))}return la(a),null;case 5:if(ba(a),d=a.type,e!==null&&a.stateNode!=null)e.memoizedProps!==i&&Xr(a);else{if(!i){if(a.stateNode===null)throw Error(s(166));return la(a),null}if(h=me.current,Os(a))Rp(a);else{var b=Xu(je.current);switch(h){case 1:h=b.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=b.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=b.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?h.multiple=!0:i.size&&(h.size=i.size);break;default:h=typeof i.is=="string"?b.createElement(d,{is:i.is}):b.createElement(d)}}h[ve]=a,h[De]=i;e:for(b=a.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===a)break e;for(;b.sibling===null;){if(b.return===null||b.return===a)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}a.stateNode=h;e:switch(Ka(h,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Xr(a)}}return la(a),wf(a,a.type,e===null?null:e.memoizedProps,a.pendingProps,r),null;case 6:if(e&&a.stateNode!=null)e.memoizedProps!==i&&Xr(a);else{if(typeof i!="string"&&a.stateNode===null)throw Error(s(166));if(e=je.current,Os(a)){if(e=a.stateNode,r=a.memoizedProps,i=null,d=Ga,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[ve]=a,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||Iv(e.nodeValue,r)),e||hl(a,!0)}else e=Xu(e).createTextNode(i),e[ve]=a,a.stateNode=e}return la(a),null;case 31:if(r=a.memoizedState,e===null||e.memoizedState!==null){if(i=Os(a),r!==null){if(e===null){if(!i)throw Error(s(318));if(e=a.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[ve]=a}else ts(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;la(a),e=!1}else r=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return a.flags&256?(kn(a),a):(kn(a),null);if((a.flags&128)!==0)throw Error(s(558))}return la(a),null;case 13:if(i=a.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Os(a),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(s(318));if(d=a.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[ve]=a}else ts(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;la(a),d=!1}else d=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return a.flags&256?(kn(a),a):(kn(a),null)}return kn(a),(a.flags&128)!==0?(a.lanes=r,a):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=a.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&&(a.child.flags|=8192),Mu(a,a.updateQueue),la(a),null);case 4:return Ge(),e===null&&Yf(a.stateNode.containerInfo),la(a),null;case 10:return Yr(a.type),la(a),null;case 19:if(V(ga),i=a.memoizedState,i===null)return la(a),null;if(d=(a.flags&128)!==0,h=i.rendering,h===null)if(d)Yi(i,!1);else{if(da!==0||e!==null&&(e.flags&128)!==0)for(e=a.child;e!==null;){if(h=bu(e),h!==null){for(a.flags|=128,Yi(i,!1),e=h.updateQueue,a.updateQueue=e,Mu(a,e),a.subtreeFlags=0,e=r,r=a.child;r!==null;)bp(r,e),r=r.sibling;return ae(ga,ga.current&1|2),Et&&Ir(a,i.treeForkCount),a.child}e=e.sibling}i.tail!==null&&ta()>Bu&&(a.flags|=128,d=!0,Yi(i,!1),a.lanes=4194304)}else{if(!d)if(e=bu(h),e!==null){if(a.flags|=128,d=!0,e=e.updateQueue,a.updateQueue=e,Mu(a,e),Yi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!h.alternate&&!Et)return la(a),null}else 2*ta()-i.renderingStartTime>Bu&&r!==536870912&&(a.flags|=128,d=!0,Yi(i,!1),a.lanes=4194304);i.isBackwards?(h.sibling=a.child,a.child=h):(e=i.last,e!==null?e.sibling=h:a.child=h,i.last=h)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ta(),e.sibling=null,r=ga.current,ae(ga,d?r&1|2:r&1),Et&&Ir(a,i.treeForkCount),e):(la(a),null);case 22:case 23:return kn(a),Yd(),i=a.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(a.flags|=8192):i&&(a.flags|=8192),i?(r&536870912)!==0&&(a.flags&128)===0&&(la(a),a.subtreeFlags&6&&(a.flags|=8192)):la(a),r=a.updateQueue,r!==null&&Mu(a,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==r&&(a.flags|=2048),e!==null&&V(rs),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),a.memoizedState.cache!==r&&(a.flags|=2048),Yr(Ra),la(a),null;case 25:return null;case 30:return null}throw Error(s(156,a.tag))}function C1(e,a){switch(Ad(a),a.tag){case 1:return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 3:return Yr(Ra),Ge(),e=a.flags,(e&65536)!==0&&(e&128)===0?(a.flags=e&-65537|128,a):null;case 26:case 27:case 5:return ba(a),null;case 31:if(a.memoizedState!==null){if(kn(a),a.alternate===null)throw Error(s(340));ts()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 13:if(kn(a),e=a.memoizedState,e!==null&&e.dehydrated!==null){if(a.alternate===null)throw Error(s(340));ts()}return e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 19:return V(ga),null;case 4:return Ge(),null;case 10:return Yr(a.type),null;case 22:case 23:return kn(a),Yd(),e!==null&&V(rs),e=a.flags,e&65536?(a.flags=e&-65537|128,a):null;case 24:return Yr(Ra),null;case 25:return null;default:return null}}function Gg(e,a){switch(Ad(a),a.tag){case 3:Yr(Ra),Ge();break;case 26:case 27:case 5:ba(a);break;case 4:Ge();break;case 31:a.memoizedState!==null&&kn(a);break;case 13:kn(a);break;case 19:V(ga);break;case 10:Yr(a.type);break;case 22:case 23:kn(a),Yd(),e!==null&&V(rs);break;case 24:Yr(Ra)}}function Fi(e,a){try{var r=a.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(a,a.return,E)}}function bl(e,a,r){try{var i=a.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=a;var k=r,F=E;try{F()}catch(J){It(d,k,J)}}}i=i.next}while(i!==h)}}catch(J){It(a,a.return,J)}}function Xg(e){var a=e.updateQueue;if(a!==null){var r=e.stateNode;try{Bp(a,r)}catch(i){It(e,e.return,i)}}}function Qg(e,a,r){r.props=us(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){It(e,a,i)}}function Pi(e,a){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,a,d)}}function wr(e,a){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(d){It(e,a,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,a,d)}else r.current=null}function Kg(e){var a=e.type,r=e.memoizedProps,i=e.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":r.autoFocus&&i.focus();break e;case"img":r.src?i.src=r.src:r.srcSet&&(i.srcset=r.srcSet)}}catch(d){It(e,e.return,d)}}function Ef(e,a,r){try{var i=e.stateNode;K1(i,e.type,r,a),i[De]=a}catch(d){It(e,e.return,d)}}function Zg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Tl(e.type)||e.tag===4}function Nf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Zg(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&&Tl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rf(e,a,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,a?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,a):(a=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,a.appendChild(e),r=r._reactRootContainer,r!=null||a.onclick!==null||(a.onclick=tn));else if(i!==4&&(i===27&&Tl(e.type)&&(r=e.stateNode,a=null),e=e.child,e!==null))for(Rf(e,a,r),e=e.sibling;e!==null;)Rf(e,a,r),e=e.sibling}function _u(e,a,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,a?r.insertBefore(e,a):r.appendChild(e);else if(i!==4&&(i===27&&Tl(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(_u(e,a,r),e=e.sibling;e!==null;)_u(e,a,r),e=e.sibling}function Jg(e){var a=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=a.attributes;d.length;)a.removeAttributeNode(d[0]);Ka(a,i,r),a[ve]=e,a[De]=r}catch(h){It(e,e.return,h)}}var Qr=!1,Ca=!1,jf=!1,Wg=typeof WeakSet=="function"?WeakSet:Set,qa=null;function A1(e,a){if(e=e.containerInfo,Gf=tc,e=dp(e),yd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var d=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var b=0,E=-1,k=-1,F=0,J=0,ie=e,G=null;t:for(;;){for(var Q;ie!==r||d!==0&&ie.nodeType!==3||(E=b+d),ie!==h||i!==0&&ie.nodeType!==3||(k=b+i),ie.nodeType===3&&(b+=ie.nodeValue.length),(Q=ie.firstChild)!==null;)G=ie,ie=Q;for(;;){if(ie===e)break t;if(G===r&&++F===d&&(E=b),G===h&&++J===i&&(k=b),(Q=ie.nextSibling)!==null)break;ie=G,G=ie.parentNode}ie=Q}r=E===-1||k===-1?null:{start:E,end:k}}else r=null}r=r||{start:0,end:0}}else r=null;for(Xf={focusedElem:e,selectionRange:r},tc=!1,qa=a;qa!==null;)if(a=qa,e=a.child,(a.subtreeFlags&1028)!==0&&e!==null)e.return=a,qa=e;else for(;qa!==null;){switch(a=qa,h=a.alternate,e=a.flags,a.tag){case 0:if((e&4)!==0&&(e=a.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=a,d=h.memoizedProps,h=h.memoizedState,i=r.stateNode;try{var Oe=us(r.type,d);e=i.getSnapshotBeforeUpdate(Oe,h),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ve){It(r,r.return,Ve)}}break;case 3:if((e&1024)!==0){if(e=a.stateNode.containerInfo,r=e.nodeType,r===9)Zf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Zf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=a.sibling,e!==null){e.return=a.return,qa=e;break}qa=a.return}}function ev(e,a,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:Zr(e,r),i&4&&Fi(5,r);break;case 1:if(Zr(e,r),i&4)if(e=r.stateNode,a===null)try{e.componentDidMount()}catch(b){It(r,r.return,b)}else{var d=us(r.type,a.memoizedProps);a=a.memoizedState;try{e.componentDidUpdate(d,a,e.__reactInternalSnapshotBeforeUpdate)}catch(b){It(r,r.return,b)}}i&64&&Xg(r),i&512&&Pi(r,r.return);break;case 3:if(Zr(e,r),i&64&&(e=r.updateQueue,e!==null)){if(a=null,r.child!==null)switch(r.child.tag){case 27:case 5:a=r.child.stateNode;break;case 1:a=r.child.stateNode}try{Bp(e,a)}catch(b){It(r,r.return,b)}}break;case 27:a===null&&i&4&&Jg(r);case 26:case 5:Zr(e,r),a===null&&i&4&&Kg(r),i&512&&Pi(r,r.return);break;case 12:Zr(e,r);break;case 31:Zr(e,r),i&4&&nv(e,r);break;case 13:Zr(e,r),i&4&&rv(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=B1.bind(null,r),rS(e,r))));break;case 22:if(i=r.memoizedState!==null||Qr,!i){a=a!==null&&a.memoizedState!==null||Ca,d=Qr;var h=Ca;Qr=i,(Ca=a)&&!h?Jr(e,r,(r.subtreeFlags&8772)!==0):Zr(e,r),Qr=d,Ca=h}break;case 30:break;default:Zr(e,r)}}function tv(e){var a=e.alternate;a!==null&&(e.alternate=null,tv(a)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(a=e.stateNode,a!==null&&Ie(a)),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 ia=null,bn=!1;function Kr(e,a,r){for(r=r.child;r!==null;)av(e,a,r),r=r.sibling}function av(e,a,r){if(Z&&typeof Z.onCommitFiberUnmount=="function")try{Z.onCommitFiberUnmount(qe,r)}catch{}switch(r.tag){case 26:Ca||wr(r,a),Kr(e,a,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Ca||wr(r,a);var i=ia,d=bn;Tl(r.type)&&(ia=r.stateNode,bn=!1),Kr(e,a,r),to(r.stateNode),ia=i,bn=d;break;case 5:Ca||wr(r,a);case 6:if(i=ia,d=bn,ia=null,Kr(e,a,r),ia=i,bn=d,ia!==null)if(bn)try{(ia.nodeType===9?ia.body:ia.nodeName==="HTML"?ia.ownerDocument.body:ia).removeChild(r.stateNode)}catch(h){It(r,a,h)}else try{ia.removeChild(r.stateNode)}catch(h){It(r,a,h)}break;case 18:ia!==null&&(bn?(e=ia,Xv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ws(e)):Xv(ia,r.stateNode));break;case 4:i=ia,d=bn,ia=r.stateNode.containerInfo,bn=!0,Kr(e,a,r),ia=i,bn=d;break;case 0:case 11:case 14:case 15:bl(2,r,a),Ca||bl(4,r,a),Kr(e,a,r);break;case 1:Ca||(wr(r,a),i=r.stateNode,typeof i.componentWillUnmount=="function"&&Qg(r,a,i)),Kr(e,a,r);break;case 21:Kr(e,a,r);break;case 22:Ca=(i=Ca)||r.memoizedState!==null,Kr(e,a,r),Ca=i;break;default:Kr(e,a,r)}}function nv(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ws(e)}catch(r){It(a,a.return,r)}}}function rv(e,a){if(a.memoizedState===null&&(e=a.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ws(e)}catch(r){It(a,a.return,r)}}function D1(e){switch(e.tag){case 31:case 13:case 19:var a=e.stateNode;return a===null&&(a=e.stateNode=new Wg),a;case 22:return e=e.stateNode,a=e._retryCache,a===null&&(a=e._retryCache=new Wg),a;default:throw Error(s(435,e.tag))}}function Lu(e,a){var r=D1(e);a.forEach(function(i){if(!r.has(i)){r.add(i);var d=H1.bind(null,e,i);i.then(d,d)}})}function Sn(e,a){var r=a.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],h=e,b=a,E=b;e:for(;E!==null;){switch(E.tag){case 27:if(Tl(E.type)){ia=E.stateNode,bn=!1;break e}break;case 5:ia=E.stateNode,bn=!1;break e;case 3:case 4:ia=E.stateNode.containerInfo,bn=!0;break e}E=E.return}if(ia===null)throw Error(s(160));av(h,b,d),ia=null,bn=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)lv(a,e),a=a.sibling}var lr=null;function lv(e,a){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sn(a,e),wn(e),i&4&&(bl(3,e,e.return),Fi(3,e),bl(5,e,e.return));break;case 1:Sn(a,e),wn(e),i&512&&(Ca||r===null||wr(r,r.return)),i&64&&Qr&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var d=lr;if(Sn(a,e),wn(e),i&512&&(Ca||r===null||wr(r,r.return)),i&4){var h=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){e:{i=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":h=d.getElementsByTagName("title")[0],(!h||h[Ze]||h[ve]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(i),d.head.insertBefore(h,d.querySelector("head > title"))),Ka(h,i,r),h[ve]=e,dt(h),i=h;break e;case"link":var b=ly("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),Ka(h,i,r),d.head.appendChild(h);break;case"meta":if(b=ly("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),Ka(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 sy(d,e.type,e.stateNode);else e.stateNode=ry(d,i,e.memoizedProps);else h!==i?(h===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):h.count--,i===null?sy(d,e.type,e.stateNode):ry(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Ef(e,e.memoizedProps,r.memoizedProps)}break;case 27:Sn(a,e),wn(e),i&512&&(Ca||r===null||wr(r,r.return)),r!==null&&i&4&&Ef(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Sn(a,e),wn(e),i&512&&(Ca||r===null||wr(r,r.return)),e.flags&32){d=e.stateNode;try{ul(d,"")}catch(Oe){It(e,e.return,Oe)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,Ef(e,d,r!==null?r.memoizedProps:d)),i&1024&&(jf=!0);break;case 6:if(Sn(a,e),wn(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(Oe){It(e,e.return,Oe)}}break;case 3:if(Zu=null,d=lr,lr=Qu(a.containerInfo),Sn(a,e),lr=d,wn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ws(a.containerInfo)}catch(Oe){It(e,e.return,Oe)}jf&&(jf=!1,sv(e));break;case 4:i=lr,lr=Qu(e.stateNode.containerInfo),Sn(a,e),wn(e),lr=i;break;case 12:Sn(a,e),wn(e);break;case 31:Sn(a,e),wn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Lu(e,i)));break;case 13:Sn(a,e),wn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Uu=ta()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Lu(e,i)));break;case 22:d=e.memoizedState!==null;var k=r!==null&&r.memoizedState!==null,F=Qr,J=Ca;if(Qr=F||d,Ca=J||k,Sn(a,e),Ca=J,Qr=F,wn(e),i&8192)e:for(a=e.stateNode,a._visibility=d?a._visibility&-2:a._visibility|1,d&&(r===null||k||Qr||Ca||cs(e)),r=null,a=e;;){if(a.tag===5||a.tag===26){if(r===null){k=r=a;try{if(h=k.stateNode,d)b=h.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{E=k.stateNode;var ie=k.memoizedProps.style,G=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;E.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(Oe){It(k,k.return,Oe)}}}else if(a.tag===6){if(r===null){k=a;try{k.stateNode.nodeValue=d?"":k.memoizedProps}catch(Oe){It(k,k.return,Oe)}}}else if(a.tag===18){if(r===null){k=a;try{var Q=k.stateNode;d?Qv(Q,!0):Qv(k.stateNode,!1)}catch(Oe){It(k,k.return,Oe)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===e)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===e)break e;for(;a.sibling===null;){if(a.return===null||a.return===e)break e;r===a&&(r=null),a=a.return}r===a&&(r=null),a.sibling.return=a.return,a=a.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,Lu(e,r))));break;case 19:Sn(a,e),wn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Lu(e,i)));break;case 30:break;case 21:break;default:Sn(a,e),wn(e)}}function wn(e){var a=e.flags;if(a&2){try{for(var r,i=e.return;i!==null;){if(Zg(i)){r=i;break}i=i.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var d=r.stateNode,h=Nf(e);_u(e,h,d);break;case 5:var b=r.stateNode;r.flags&32&&(ul(b,""),r.flags&=-33);var E=Nf(e);_u(e,E,b);break;case 3:case 4:var k=r.stateNode.containerInfo,F=Nf(e);Rf(e,F,k);break;default:throw Error(s(161))}}catch(J){It(e,e.return,J)}e.flags&=-3}a&4096&&(e.flags&=-4097)}function sv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var a=e;sv(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),e=e.sibling}}function Zr(e,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)ev(e,a.alternate,a),a=a.sibling}function cs(e){for(e=e.child;e!==null;){var a=e;switch(a.tag){case 0:case 11:case 14:case 15:bl(4,a,a.return),cs(a);break;case 1:wr(a,a.return);var r=a.stateNode;typeof r.componentWillUnmount=="function"&&Qg(a,a.return,r),cs(a);break;case 27:to(a.stateNode);case 26:case 5:wr(a,a.return),cs(a);break;case 22:a.memoizedState===null&&cs(a);break;case 30:cs(a);break;default:cs(a)}e=e.sibling}}function Jr(e,a,r){for(r=r&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var i=a.alternate,d=e,h=a,b=h.flags;switch(h.tag){case 0:case 11:case 15:Jr(d,h,r),Fi(4,h);break;case 1:if(Jr(d,h,r),i=h,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(F){It(i,i.return,F)}if(i=h,d=i.updateQueue,d!==null){var E=i.stateNode;try{var k=d.shared.hiddenCallbacks;if(k!==null)for(d.shared.hiddenCallbacks=null,d=0;d<k.length;d++)Up(k[d],E)}catch(F){It(i,i.return,F)}}r&&b&64&&Xg(h),Pi(h,h.return);break;case 27:Jg(h);case 26:case 5:Jr(d,h,r),r&&i===null&&b&4&&Kg(h),Pi(h,h.return);break;case 12:Jr(d,h,r);break;case 31:Jr(d,h,r),r&&b&4&&nv(d,h);break;case 13:Jr(d,h,r),r&&b&4&&rv(d,h);break;case 22:h.memoizedState===null&&Jr(d,h,r),Pi(h,h.return);break;case 30:break;default:Jr(d,h,r)}a=a.sibling}}function Tf(e,a){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(e=a.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Oi(r))}function Cf(e,a){e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&Oi(e))}function sr(e,a,r,i){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)iv(e,a,r,i),a=a.sibling}function iv(e,a,r,i){var d=a.flags;switch(a.tag){case 0:case 11:case 15:sr(e,a,r,i),d&2048&&Fi(9,a);break;case 1:sr(e,a,r,i);break;case 3:sr(e,a,r,i),d&2048&&(e=null,a.alternate!==null&&(e=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==e&&(a.refCount++,e!=null&&Oi(e)));break;case 12:if(d&2048){sr(e,a,r,i),e=a.stateNode;try{var h=a.memoizedProps,b=h.id,E=h.onPostCommit;typeof E=="function"&&E(b,a.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){It(a,a.return,k)}}else sr(e,a,r,i);break;case 31:sr(e,a,r,i);break;case 13:sr(e,a,r,i);break;case 23:break;case 22:h=a.stateNode,b=a.alternate,a.memoizedState!==null?h._visibility&2?sr(e,a,r,i):Gi(e,a):h._visibility&2?sr(e,a,r,i):(h._visibility|=2,Is(e,a,r,i,(a.subtreeFlags&10256)!==0||!1)),d&2048&&Tf(b,a);break;case 24:sr(e,a,r,i),d&2048&&Cf(a.alternate,a);break;default:sr(e,a,r,i)}}function Is(e,a,r,i,d){for(d=d&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var h=e,b=a,E=r,k=i,F=b.flags;switch(b.tag){case 0:case 11:case 15:Is(h,b,E,k,d),Fi(8,b);break;case 23:break;case 22:var J=b.stateNode;b.memoizedState!==null?J._visibility&2?Is(h,b,E,k,d):Gi(h,b):(J._visibility|=2,Is(h,b,E,k,d)),d&&F&2048&&Tf(b.alternate,b);break;case 24:Is(h,b,E,k,d),d&&F&2048&&Cf(b.alternate,b);break;default:Is(h,b,E,k,d)}a=a.sibling}}function Gi(e,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var r=e,i=a,d=i.flags;switch(i.tag){case 22:Gi(r,i),d&2048&&Tf(i.alternate,i);break;case 24:Gi(r,i),d&2048&&Cf(i.alternate,i);break;default:Gi(r,i)}a=a.sibling}}var Xi=8192;function Vs(e,a,r){if(e.subtreeFlags&Xi)for(e=e.child;e!==null;)ov(e,a,r),e=e.sibling}function ov(e,a,r){switch(e.tag){case 26:Vs(e,a,r),e.flags&Xi&&e.memoizedState!==null&&gS(r,lr,e.memoizedState,e.memoizedProps);break;case 5:Vs(e,a,r);break;case 3:case 4:var i=lr;lr=Qu(e.stateNode.containerInfo),Vs(e,a,r),lr=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Xi,Xi=16777216,Vs(e,a,r),Xi=i):Vs(e,a,r));break;default:Vs(e,a,r)}}function uv(e){var a=e.alternate;if(a!==null&&(e=a.child,e!==null)){a.child=null;do a=e.sibling,e.sibling=null,e=a;while(e!==null)}}function Qi(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var r=0;r<a.length;r++){var i=a[r];qa=i,dv(i,e)}uv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)cv(e),e=e.sibling}function cv(e){switch(e.tag){case 0:case 11:case 15:Qi(e),e.flags&2048&&bl(9,e,e.return);break;case 3:Qi(e);break;case 12:Qi(e);break;case 22:var a=e.stateNode;e.memoizedState!==null&&a._visibility&2&&(e.return===null||e.return.tag!==13)?(a._visibility&=-3,zu(e)):Qi(e);break;default:Qi(e)}}function zu(e){var a=e.deletions;if((e.flags&16)!==0){if(a!==null)for(var r=0;r<a.length;r++){var i=a[r];qa=i,dv(i,e)}uv(e)}for(e=e.child;e!==null;){switch(a=e,a.tag){case 0:case 11:case 15:bl(8,a,a.return),zu(a);break;case 22:r=a.stateNode,r._visibility&2&&(r._visibility&=-3,zu(a));break;default:zu(a)}e=e.sibling}}function dv(e,a){for(;qa!==null;){var r=qa;switch(r.tag){case 0:case 11:case 15:bl(8,r,a);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var i=r.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Oi(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,qa=i;else e:for(r=e;qa!==null;){i=qa;var d=i.sibling,h=i.return;if(tv(i),i===r){qa=null;break e}if(d!==null){d.return=h,qa=d;break e}qa=h}}}var k1={getCacheForType:function(e){var a=Xa(Ra),r=a.data.get(e);return r===void 0&&(r=e(),a.data.set(e,r)),r},cacheSignal:function(){return Xa(Ra).controller.signal}},O1=typeof WeakMap=="function"?WeakMap:Map,Ot=0,ea=null,mt=null,xt=0,qt=0,On=null,Sl=!1,Ys=!1,Af=!1,Wr=0,da=0,wl=0,ds=0,Df=0,Mn=0,Fs=0,Ki=null,En=null,kf=!1,Uu=0,fv=0,Bu=1/0,Hu=null,El=null,_a=0,Nl=null,Ps=null,el=0,Of=0,Mf=null,hv=null,Zi=0,_f=null;function _n(){return(Ot&2)!==0&&xt!==0?xt&-xt:U.T!==null?$f():K()}function mv(){if(Mn===0)if((xt&536870912)===0||Et){var e=vt;vt<<=1,(vt&3932160)===0&&(vt=262144),Mn=e}else Mn=536870912;return e=Dn.current,e!==null&&(e.flags|=32),Mn}function Nn(e,a,r){(e===ea&&(qt===2||qt===9)||e.cancelPendingCommit!==null)&&(Gs(e,0),Rl(e,xt,Mn,!1)),ht(e,r),((Ot&2)===0||e!==ea)&&(e===ea&&((Ot&2)===0&&(ds|=r),da===4&&Rl(e,xt,Mn,!1)),Er(e))}function pv(e,a,r){if((Ot&6)!==0)throw Error(s(327));var i=!r&&(a&127)===0&&(a&e.expiredLanes)===0||Ct(e,a),d=i?L1(e,a):zf(e,a,!0),h=i;do{if(d===0){Ys&&!i&&Rl(e,a,0,!1);break}else{if(r=e.current.alternate,h&&!M1(r)){d=zf(e,a,!1),h=!1;continue}if(d===2){if(h=a,e.errorRecoveryDisabledLanes&h)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){a=b;e:{var E=e;d=Ki;var k=E.current.memoizedState.isDehydrated;if(k&&(Gs(E,b).flags|=256),b=zf(E,b,!1),b!==2){if(Af&&!k){E.errorRecoveryDisabledLanes|=h,ds|=h,d=4;break e}h=En,En=d,h!==null&&(En===null?En=h:En.push.apply(En,h))}d=b}if(h=!1,d!==2)continue}}if(d===1){Gs(e,0),Rl(e,a,0,!0);break}e:{switch(i=e,h=d,h){case 0:case 1:throw Error(s(345));case 4:if((a&4194048)!==a)break;case 6:Rl(i,a,Mn,!Sl);break e;case 2:En=null;break;case 3:case 5:break;default:throw Error(s(329))}if((a&62914560)===a&&(d=Uu+300-ta(),10<d)){if(Rl(i,a,Mn,!Sl),Bt(i,0,!0)!==0)break e;el=a,i.timeoutHandle=Pv(gv.bind(null,i,r,En,Hu,kf,a,Mn,ds,Fs,Sl,h,"Throttled",-0,0),d);break e}gv(i,r,En,Hu,kf,a,Mn,ds,Fs,Sl,h,null,-0,0)}}break}while(!0);Er(e)}function gv(e,a,r,i,d,h,b,E,k,F,J,ie,G,Q){if(e.timeoutHandle=-1,ie=a.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},ov(a,h,ie);var Oe=(h&62914560)===h?Uu-ta():(h&4194048)===h?fv-ta():0;if(Oe=vS(ie,Oe),Oe!==null){el=h,e.cancelPendingCommit=Oe(Nv.bind(null,e,a,h,r,i,d,b,E,k,J,ie,null,G,Q)),Rl(e,h,b,!F);return}}Nv(e,a,h,r,i,d,b,E,k)}function M1(e){for(var a=e;;){var r=a.tag;if((r===0||r===11||r===15)&&a.flags&16384&&(r=a.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(!Cn(h(),d))return!1}catch{return!1}}if(r=a.child,a.subtreeFlags&16384&&r!==null)r.return=a,a=r;else{if(a===e)break;for(;a.sibling===null;){if(a.return===null||a.return===e)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Rl(e,a,r,i){a&=~Df,a&=~ds,e.suspendedLanes|=a,e.pingedLanes&=~a,i&&(e.warmLanes|=a),i=e.expirationTimes;for(var d=a;0<d;){var h=31-Kt(d),b=1<<h;i[h]=-1,d&=~b}r!==0&&Sa(e,r,a)}function $u(){return(Ot&6)===0?(Ji(0),!1):!0}function Lf(){if(mt!==null){if(qt===0)var e=mt.return;else e=mt,Vr=as=null,Kd(e),Us=null,_i=0,e=mt;for(;e!==null;)Gg(e.alternate,e),e=e.return;mt=null}}function Gs(e,a){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,W1(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),el=0,Lf(),ea=e,mt=r=qr(e.current,null),xt=a,qt=0,On=null,Sl=!1,Ys=Ct(e,a),Af=!1,Fs=Mn=Df=ds=wl=da=0,En=Ki=null,kf=!1,(a&8)!==0&&(a|=a&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=a;0<i;){var d=31-Kt(i),h=1<<d;a|=e[d],i&=~h}return Wr=a,iu(),r}function vv(e,a){st=null,U.H=Ii,a===zs||a===pu?(a=Mp(),qt=3):a===Bd?(a=Mp(),qt=4):qt=a===hf?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,On=a,mt===null&&(da=1,Au(e,In(a,e.current)))}function yv(){var e=Dn.current;return e===null?!0:(xt&4194048)===xt?Pn===null:(xt&62914560)===xt||(xt&536870912)!==0?e===Pn:!1}function xv(){var e=U.H;return U.H=Ii,e===null?Ii:e}function bv(){var e=U.A;return U.A=k1,e}function qu(){da=4,Sl||(xt&4194048)!==xt&&Dn.current!==null||(Ys=!0),(wl&134217727)===0&&(ds&134217727)===0||ea===null||Rl(ea,xt,Mn,!1)}function zf(e,a,r){var i=Ot;Ot|=2;var d=xv(),h=bv();(ea!==e||xt!==a)&&(Hu=null,Gs(e,a)),a=!1;var b=da;e:do try{if(qt!==0&&mt!==null){var E=mt,k=On;switch(qt){case 8:Lf(),b=6;break e;case 3:case 2:case 9:case 6:Dn.current===null&&(a=!0);var F=qt;if(qt=0,On=null,Xs(e,E,k,F),r&&Ys){b=0;break e}break;default:F=qt,qt=0,On=null,Xs(e,E,k,F)}}_1(),b=da;break}catch(J){vv(e,J)}while(!0);return a&&e.shellSuspendCounter++,Vr=as=null,Ot=i,U.H=d,U.A=h,mt===null&&(ea=null,xt=0,iu()),b}function _1(){for(;mt!==null;)Sv(mt)}function L1(e,a){var r=Ot;Ot|=2;var i=xv(),d=bv();ea!==e||xt!==a?(Hu=null,Bu=ta()+500,Gs(e,a)):Ys=Ct(e,a);e:do try{if(qt!==0&&mt!==null){a=mt;var h=On;t:switch(qt){case 1:qt=0,On=null,Xs(e,a,h,1);break;case 2:case 9:if(kp(h)){qt=0,On=null,wv(a);break}a=function(){qt!==2&&qt!==9||ea!==e||(qt=7),Er(e)},h.then(a,a);break e;case 3:qt=7;break e;case 4:qt=5;break e;case 7:kp(h)?(qt=0,On=null,wv(a)):(qt=0,On=null,Xs(e,a,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?iy(b):E.stateNode.complete){qt=0,On=null;var k=E.sibling;if(k!==null)mt=k;else{var F=E.return;F!==null?(mt=F,Iu(F)):mt=null}break t}}qt=0,On=null,Xs(e,a,h,5);break;case 6:qt=0,On=null,Xs(e,a,h,6);break;case 8:Lf(),da=6;break e;default:throw Error(s(462))}}z1();break}catch(J){vv(e,J)}while(!0);return Vr=as=null,U.H=i,U.A=d,Ot=r,mt!==null?0:(ea=null,xt=0,iu(),da)}function z1(){for(;mt!==null&&!Ba();)Sv(mt)}function Sv(e){var a=Fg(e.alternate,e,Wr);e.memoizedProps=e.pendingProps,a===null?Iu(e):mt=a}function wv(e){var a=e,r=a.alternate;switch(a.tag){case 15:case 0:a=Hg(r,a,a.pendingProps,a.type,void 0,xt);break;case 11:a=Hg(r,a,a.pendingProps,a.type.render,a.ref,xt);break;case 5:Kd(a);default:Gg(r,a),a=mt=bp(a,Wr),a=Fg(r,a,Wr)}e.memoizedProps=e.pendingProps,a===null?Iu(e):mt=a}function Xs(e,a,r,i){Vr=as=null,Kd(a),Us=null,_i=0;var d=a.return;try{if(N1(e,d,a,r,xt)){da=1,Au(e,In(r,e.current)),mt=null;return}}catch(h){if(d!==null)throw mt=d,h;da=1,Au(e,In(r,e.current)),mt=null;return}a.flags&32768?(Et||i===1?e=!0:Ys||(xt&536870912)!==0?e=!1:(Sl=e=!0,(i===2||i===9||i===3||i===6)&&(i=Dn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ev(a,e)):Iu(a)}function Iu(e){var a=e;do{if((a.flags&32768)!==0){Ev(a,Sl);return}e=a.return;var r=T1(a.alternate,a,Wr);if(r!==null){mt=r;return}if(a=a.sibling,a!==null){mt=a;return}mt=a=e}while(a!==null);da===0&&(da=5)}function Ev(e,a){do{var r=C1(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),!a&&(e=e.sibling,e!==null)){mt=e;return}mt=e=r}while(e!==null);da=6,mt=null}function Nv(e,a,r,i,d,h,b,E,k){e.cancelPendingCommit=null;do Vu();while(_a!==0);if((Ot&6)!==0)throw Error(s(327));if(a!==null){if(a===e.current)throw Error(s(177));if(h=a.lanes|a.childLanes,h|=Ed,Je(e,r,h,b,E,k),e===ea&&(mt=ea=null,xt=0),Ps=a,Nl=e,el=r,Of=h,Mf=d,hv=i,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,$1($a,function(){return Av(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||i){i=U.T,U.T=null,d=B.p,B.p=2,b=Ot,Ot|=4;try{A1(e,a,r)}finally{Ot=b,B.p=d,U.T=i}}_a=1,Rv(),jv(),Tv()}}function Rv(){if(_a===1){_a=0;var e=Nl,a=Ps,r=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||r){r=U.T,U.T=null;var i=B.p;B.p=2;var d=Ot;Ot|=4;try{lv(a,e);var h=Xf,b=dp(e.containerInfo),E=h.focusedElem,k=h.selectionRange;if(b!==E&&E&&E.ownerDocument&&cp(E.ownerDocument.documentElement,E)){if(k!==null&&yd(E)){var F=k.start,J=k.end;if(J===void 0&&(J=F),"selectionStart"in E)E.selectionStart=F,E.selectionEnd=Math.min(J,E.value.length);else{var ie=E.ownerDocument||document,G=ie&&ie.defaultView||window;if(G.getSelection){var Q=G.getSelection(),Oe=E.textContent.length,Ve=Math.min(k.start,Oe),Pt=k.end===void 0?Ve:Math.min(k.end,Oe);!Q.extend&&Ve>Pt&&(b=Pt,Pt=Ve,Ve=b);var H=up(E,Ve),_=up(E,Pt);if(H&&_&&(Q.rangeCount!==1||Q.anchorNode!==H.node||Q.anchorOffset!==H.offset||Q.focusNode!==_.node||Q.focusOffset!==_.offset)){var Y=ie.createRange();Y.setStart(H.node,H.offset),Q.removeAllRanges(),Ve>Pt?(Q.addRange(Y),Q.extend(_.node,_.offset)):(Y.setEnd(_.node,_.offset),Q.addRange(Y))}}}}for(ie=[],Q=E;Q=Q.parentNode;)Q.nodeType===1&&ie.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ie.length;E++){var le=ie[E];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}tc=!!Gf,Xf=Gf=null}finally{Ot=d,B.p=i,U.T=r}}e.current=a,_a=2}}function jv(){if(_a===2){_a=0;var e=Nl,a=Ps,r=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||r){r=U.T,U.T=null;var i=B.p;B.p=2;var d=Ot;Ot|=4;try{ev(e,a.alternate,a)}finally{Ot=d,B.p=i,U.T=r}}_a=3}}function Tv(){if(_a===4||_a===3){_a=0,Ha();var e=Nl,a=Ps,r=el,i=hv;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?_a=5:(_a=0,Ps=Nl=null,Cv(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(El=null),$(r),a=a.stateNode,Z&&typeof Z.onCommitFiberRoot=="function")try{Z.onCommitFiberRoot(qe,a,void 0,(a.current.flags&128)===128)}catch{}if(i!==null){a=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=a,B.p=d}}(el&3)!==0&&Vu(),Er(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===_f?Zi++:(Zi=0,_f=e):Zi=0,Ji(0)}}function Cv(e,a){(e.pooledCacheLanes&=a)===0&&(a=e.pooledCache,a!=null&&(e.pooledCache=null,Oi(a)))}function Vu(){return Rv(),jv(),Tv(),Av()}function Av(){if(_a!==5)return!1;var e=Nl,a=Of;Of=0;var r=$(el),i=U.T,d=B.p;try{B.p=32>r?32:r,U.T=null,r=Mf,Mf=null;var h=Nl,b=el;if(_a=0,Ps=Nl=null,el=0,(Ot&6)!==0)throw Error(s(331));var E=Ot;if(Ot|=4,cv(h.current),iv(h,h.current,b,r),Ot=E,Ji(0,!1),Z&&typeof Z.onPostCommitFiberRoot=="function")try{Z.onPostCommitFiberRoot(qe,h)}catch{}return!0}finally{B.p=d,U.T=i,Cv(e,a)}}function Dv(e,a,r){a=In(r,a),a=ff(e.stateNode,a,2),e=vl(e,a,2),e!==null&&(ht(e,2),Er(e))}function It(e,a,r){if(e.tag===3)Dv(e,e,r);else for(;a!==null;){if(a.tag===3){Dv(a,e,r);break}else if(a.tag===1){var i=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(El===null||!El.has(i))){e=In(r,e),r=kg(2),i=vl(a,r,2),i!==null&&(Og(r,i,a,e),ht(i,2),Er(i));break}}a=a.return}}function Uf(e,a,r){var i=e.pingCache;if(i===null){i=e.pingCache=new O1;var d=new Set;i.set(a,d)}else d=i.get(a),d===void 0&&(d=new Set,i.set(a,d));d.has(r)||(Af=!0,d.add(r),e=U1.bind(null,e,a,r),a.then(e,e))}function U1(e,a,r){var i=e.pingCache;i!==null&&i.delete(a),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,ea===e&&(xt&r)===r&&(da===4||da===3&&(xt&62914560)===xt&&300>ta()-Uu?(Ot&2)===0&&Gs(e,0):Df|=r,Fs===xt&&(Fs=0)),Er(e)}function kv(e,a){a===0&&(a=Zt()),e=Wl(e,a),e!==null&&(ht(e,a),Er(e))}function B1(e){var a=e.memoizedState,r=0;a!==null&&(r=a.retryLane),kv(e,r)}function H1(e,a){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(a),kv(e,r)}function $1(e,a){return _t(e,a)}var Yu=null,Qs=null,Bf=!1,Fu=!1,Hf=!1,jl=0;function Er(e){e!==Qs&&e.next===null&&(Qs===null?Yu=Qs=e:Qs=Qs.next=e),Fu=!0,Bf||(Bf=!0,I1())}function Ji(e,a){if(!Hf&&Fu){Hf=!0;do for(var r=!1,i=Yu;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var h=0;else{var b=i.suspendedLanes,E=i.pingedLanes;h=(1<<31-Kt(42|e)+1)-1,h&=d&~(b&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(r=!0,Lv(i,h))}else h=xt,h=Bt(i,i===ea?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(h&3)===0||Ct(i,h)||(r=!0,Lv(i,h));i=i.next}while(r);Hf=!1}}function q1(){Ov()}function Ov(){Fu=Bf=!1;var e=0;jl!==0&&J1()&&(e=jl);for(var a=ta(),r=null,i=Yu;i!==null;){var d=i.next,h=Mv(i,a);h===0?(i.next=null,r===null?Yu=d:r.next=d,d===null&&(Qs=r)):(r=i,(e!==0||(h&3)!==0)&&(Fu=!0)),i=d}_a!==0&&_a!==5||Ji(e),jl!==0&&(jl=0)}function Mv(e,a){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]=aa(E,a)):k<=a&&(e.expiredLanes|=E),h&=~E}if(a=ea,r=xt,r=Bt(e,e===a?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===a&&(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(a=r&-r,a===e.callbackPriority)return a;switch(i!==null&&Qt(i),$(r)){case 2:case 8:r=Ja;break;case 32:r=$a;break;case 268435456:r=Ce;break;default:r=$a}return i=_v.bind(null,e),r=_t(r,i),e.callbackPriority=a,e.callbackNode=r,a}return i!==null&&i!==null&&Qt(i),e.callbackPriority=2,e.callbackNode=null,2}function _v(e,a){if(_a!==0&&_a!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Vu()&&e.callbackNode!==r)return null;var i=xt;return i=Bt(e,e===ea?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(pv(e,i,a),Mv(e,ta()),e.callbackNode!=null&&e.callbackNode===r?_v.bind(null,e):null)}function Lv(e,a){if(Vu())return null;pv(e,a,!0)}function I1(){eS(function(){(Ot&6)!==0?_t(fn,q1):Ov()})}function $f(){if(jl===0){var e=_s;e===0&&(e=Me,Me<<=1,(Me&261888)===0&&(Me=256)),jl=e}return jl}function zv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:na(""+e)}function Uv(e,a){var r=a.ownerDocument.createElement("input");return r.name=a.name,r.value=a.value,e.id&&r.setAttribute("form",e.id),a.parentNode.insertBefore(r,a),e=new FormData(e),r.parentNode.removeChild(r),e}function V1(e,a,r,i,d){if(a==="submit"&&r&&r.stateNode===d){var h=zv((d[De]||null).action),b=i.submitter;b&&(a=(a=b[De]||null)?zv(a.formAction):b.getAttribute("formAction"),a!==null&&(h=a,b=null));var E=new Hr("action","action",null,i,d);e.push({event:E,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(jl!==0){var k=b?Uv(d,b):new FormData(d);lf(r,{pending:!0,data:k,method:d.method,action:h},null,k)}}else typeof h=="function"&&(E.preventDefault(),k=b?Uv(d,b):new FormData(d),lf(r,{pending:!0,data:k,method:d.method,action:h},h,k))},currentTarget:d}]})}}for(var qf=0;qf<wd.length;qf++){var If=wd[qf],Y1=If.toLowerCase(),F1=If[0].toUpperCase()+If.slice(1);rr(Y1,"on"+F1)}rr(mp,"onAnimationEnd"),rr(pp,"onAnimationIteration"),rr(gp,"onAnimationStart"),rr("dblclick","onDoubleClick"),rr("focusin","onFocus"),rr("focusout","onBlur"),rr(i1,"onTransitionRun"),rr(o1,"onTransitionStart"),rr(u1,"onTransitionCancel"),rr(vp,"onTransitionEnd"),ka("onMouseEnter",["mouseout","mouseover"]),ka("onMouseLeave",["mouseout","mouseover"]),ka("onPointerEnter",["pointerout","pointerover"]),ka("onPointerLeave",["pointerout","pointerover"]),wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wa("onBeforeInput",["compositionend","keypress","textInput","paste"]),wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),P1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wi));function Bv(e,a){a=(a&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(a)for(var b=i.length-1;0<=b;b--){var E=i[b],k=E.instance,F=E.currentTarget;if(E=E.listener,k!==h&&d.isPropagationStopped())break e;h=E,d.currentTarget=F;try{h(d)}catch(J){su(J)}d.currentTarget=null,h=k}else for(b=0;b<i.length;b++){if(E=i[b],k=E.instance,F=E.currentTarget,E=E.listener,k!==h&&d.isPropagationStopped())break e;h=E,d.currentTarget=F;try{h(d)}catch(J){su(J)}d.currentTarget=null,h=k}}}}function pt(e,a){var r=a[_e];r===void 0&&(r=a[_e]=new Set);var i=e+"__bubble";r.has(i)||(Hv(a,e,2,!1),r.add(i))}function Vf(e,a,r){var i=0;a&&(i|=4),Hv(r,e,i,a)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Yf(e){if(!e[Pu]){e[Pu]=!0,Jt.forEach(function(r){r!=="selectionchange"&&(P1.has(r)||Vf(r,!1,e),Vf(r,!0,e))});var a=e.nodeType===9?e:e.ownerDocument;a===null||a[Pu]||(a[Pu]=!0,Vf("selectionchange",!1,a))}}function Hv(e,a,r,i){switch(my(a)){case 2:var d=bS;break;case 8:d=SS;break;default:d=lh}r=d.bind(null,a,r,e),d=void 0,!Ei||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(a,r,{capture:!0,passive:d}):e.addEventListener(a,r,!0):d!==void 0?e.addEventListener(a,r,{passive:d}):e.addEventListener(a,r,!1)}function Ff(e,a,r,i,d){var h=i;if((a&1)===0&&(a&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var E=i.stateNode.containerInfo;if(E===d)break;if(b===4)for(b=i.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===d)return;b=b.return}for(;E!==null;){if(b=$t(E),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){i=h=b;continue e}E=E.parentNode}}i=i.return}wi(function(){var F=h,J=_r(r),ie=[];e:{var G=yp.get(e);if(G!==void 0){var Q=Hr,Oe=e;switch(e){case"keypress":if(Ns(r)===0)break e;case"keydown":case"keyup":Q=Na;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=au;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=P;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=xr;break;case mp:case pp:case gp:Q=ce;break;case vp:Q=nu;break;case"scroll":case"scrollend":Q=dd;break;case"wheel":Q=hd;break;case"copy":case"cut":case"paste":Q=Se;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=zt;break;case"toggle":case"beforetoggle":Q=X0}var Ve=(a&4)!==0,Pt=!Ve&&(e==="scroll"||e==="scrollend"),H=Ve?G!==null?G+"Capture":null:G;Ve=[];for(var _=F,Y;_!==null;){var le=_;if(Y=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Y===null||H===null||(le=Hn(_,H),le!=null&&Ve.push(eo(_,le,Y))),Pt)break;_=_.return}0<Ve.length&&(G=new Q(G,Oe,null,r,J),ie.push({event:G,listeners:Ve}))}}if((a&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",G&&r!==Tn&&(Oe=r.relatedTarget||r.fromElement)&&($t(Oe)||Oe[Re]))break e;if((Q||G)&&(G=J.window===J?J:(G=J.ownerDocument)?G.defaultView||G.parentWindow:window,Q?(Oe=r.relatedTarget||r.toElement,Q=F,Oe=Oe?$t(Oe):null,Oe!==null&&(Pt=u(Oe),Ve=Oe.tag,Oe!==Pt||Ve!==5&&Ve!==27&&Ve!==6)&&(Oe=null)):(Q=null,Oe=F),Q!==Oe)){if(Ve=au,le="onMouseLeave",H="onMouseEnter",_="mouse",(e==="pointerout"||e==="pointerover")&&(Ve=zt,le="onPointerLeave",H="onPointerEnter",_="pointer"),Pt=Q==null?G:ct(Q),Y=Oe==null?G:ct(Oe),G=new Ve(le,_+"leave",Q,r,J),G.target=Pt,G.relatedTarget=Y,le=null,$t(J)===F&&(Ve=new Ve(H,_+"enter",Oe,r,J),Ve.target=Y,Ve.relatedTarget=Pt,le=Ve),Pt=le,Q&&Oe)t:{for(Ve=G1,H=Q,_=Oe,Y=0,le=H;le;le=Ve(le))Y++;le=0;for(var He=_;He;He=Ve(He))le++;for(;0<Y-le;)H=Ve(H),Y--;for(;0<le-Y;)_=Ve(_),le--;for(;Y--;){if(H===_||_!==null&&H===_.alternate){Ve=H;break t}H=Ve(H),_=Ve(_)}Ve=null}else Ve=null;Q!==null&&$v(ie,G,Q,Ve,!1),Oe!==null&&Pt!==null&&$v(ie,Pt,Oe,Ve,!0)}}e:{if(G=F?ct(F):window,Q=G.nodeName&&G.nodeName.toLowerCase(),Q==="select"||Q==="input"&&G.type==="file")var Dt=np;else if(tp(G))if(rp)Dt=r1;else{Dt=a1;var Le=t1}else Q=G.nodeName,!Q||Q.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?F&&Pl(F.elementType)&&(Dt=np):Dt=n1;if(Dt&&(Dt=Dt(e,F))){ap(ie,Dt,r,J);break e}Le&&Le(e,G,F),e==="focusout"&&F&&G.type==="number"&&F.memoizedProps.value!=null&&At(G,"number",G.value)}switch(Le=F?ct(F):window,e){case"focusin":(tp(Le)||Le.contentEditable==="true")&&(js=Le,xd=F,Ai=null);break;case"focusout":Ai=xd=js=null;break;case"mousedown":bd=!0;break;case"contextmenu":case"mouseup":case"dragend":bd=!1,fp(ie,r,J);break;case"selectionchange":if(s1)break;case"keydown":case"keyup":fp(ie,r,J)}var ot;if(pd)e:{switch(e){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Rs?Wm(e,r)&&(bt="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(bt="onCompositionStart");bt&&(Km&&r.locale!=="ko"&&(Rs||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Rs&&(ot=eu()):($n=J,Ni="value"in $n?$n.value:$n.textContent,Rs=!0)),Le=Gu(F,bt),0<Le.length&&(bt=new rt(bt,e,null,r,J),ie.push({event:bt,listeners:Le}),ot?bt.data=ot:(ot=ep(r),ot!==null&&(bt.data=ot)))),(ot=K0?Z0(e,r):J0(e,r))&&(bt=Gu(F,"onBeforeInput"),0<bt.length&&(Le=new rt("onBeforeInput","beforeinput",null,r,J),ie.push({event:Le,listeners:bt}),Le.data=ot)),V1(ie,e,F,r,J)}Bv(ie,a)})}function eo(e,a,r){return{instance:e,listener:a,currentTarget:r}}function Gu(e,a){for(var r=a+"Capture",i=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=Hn(e,r),d!=null&&i.unshift(eo(e,d,h)),d=Hn(e,a),d!=null&&i.push(eo(e,d,h))),e.tag===3)return i;e=e.return}return[]}function G1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $v(e,a,r,i,d){for(var h=a._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=Hn(r,h),F!=null&&b.unshift(eo(r,F,k))):d||(F=Hn(r,h),F!=null&&b.push(eo(r,F,k)))),r=r.return}b.length!==0&&e.push({event:a,listeners:b})}var X1=/\r\n?/g,Q1=/\u0000|\uFFFD/g;function qv(e){return(typeof e=="string"?e:""+e).replace(X1,`
|
|
49
|
-
`).replace(Q1,"")}function Iv(e,a){return a=qv(a),qv(e)===a}function Ft(e,a,r,i,d,h){switch(r){case"children":typeof i=="string"?a==="body"||a==="textarea"&&i===""||ul(e,i):(typeof i=="number"||typeof i=="bigint")&&a!=="body"&&ul(e,""+i);break;case"className":pr(e,"class",i);break;case"tabIndex":pr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":pr(e,r,i);break;case"style":vn(e,i,h);break;case"data":if(a!=="object"){pr(e,"data",i);break}case"src":case"href":if(i===""&&(a!=="a"||r!=="href")){e.removeAttribute(r);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=na(""+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"?(a!=="input"&&Ft(e,a,"name",d.name,d,null),Ft(e,a,"formEncType",d.formEncType,d,null),Ft(e,a,"formMethod",d.formMethod,d,null),Ft(e,a,"formTarget",d.formTarget,d,null)):(Ft(e,a,"encType",d.encType,d,null),Ft(e,a,"method",d.method,d,null),Ft(e,a,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=na(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=tn);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=na(""+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),Wa(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":Wa(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,Wa(e,r,i))}}function Pf(e,a,r,i,d,h){switch(r){case"style":vn(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"?ul(e,i):(typeof i=="number"||typeof i=="bigint")&&ul(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=tn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ya.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),a=r.slice(2,d?r.length-7:void 0),h=e[De]||null,h=h!=null?h[r]:null,typeof h=="function"&&e.removeEventListener(a,h,d),typeof i=="function")){typeof h!="function"&&h!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(a,i,d);break e}r in e?e[r]=i:i===!0?e.setAttribute(r,""):Wa(e,r,i)}}}function Ka(e,a,r){switch(a){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,a));default:Ft(e,a,h,b,r,null)}}d&&Ft(e,a,"srcSet",r.srcSet,r,null),i&&Ft(e,a,"src",r.src,r,null);return;case"input":pt("invalid",e);var E=h=b=d=null,k=null,F=null;for(i in r)if(r.hasOwnProperty(i)){var J=r[i];if(J!=null)switch(i){case"name":d=J;break;case"type":b=J;break;case"checked":k=J;break;case"defaultChecked":F=J;break;case"value":h=J;break;case"defaultValue":E=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(s(137,a));break;default:Ft(e,a,i,J,r,null)}}bi(e,h,E,k,F,b,d,!1);return;case"select":pt("invalid",e),i=b=h=null;for(d in r)if(r.hasOwnProperty(d)&&(E=r[d],E!=null))switch(d){case"value":h=E;break;case"defaultValue":b=E;break;case"multiple":i=E;default:Ft(e,a,d,E,r,null)}a=h,r=b,e.multiple=!!i,a!=null?gr(e,!!i,a,!1):r!=null&&gr(e,!!i,r,!0);return;case"textarea":pt("invalid",e),h=d=i=null;for(b in r)if(r.hasOwnProperty(b)&&(E=r[b],E!=null))switch(b){case"value":i=E;break;case"defaultValue":d=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(s(91));break;default:Ft(e,a,b,E,r,null)}ar(e,i,d,h);return;case"option":for(k in r)if(r.hasOwnProperty(k)&&(i=r[k],i!=null))switch(k){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Ft(e,a,k,i,r,null)}return;case"dialog":pt("beforetoggle",e),pt("toggle",e),pt("cancel",e),pt("close",e);break;case"iframe":case"object":pt("load",e);break;case"video":case"audio":for(i=0;i<Wi.length;i++)pt(Wi[i],e);break;case"image":pt("error",e),pt("load",e);break;case"details":pt("toggle",e);break;case"embed":case"source":case"link":pt("error",e),pt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in r)if(r.hasOwnProperty(F)&&(i=r[F],i!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Ft(e,a,F,i,r,null)}return;default:if(Pl(a)){for(J in r)r.hasOwnProperty(J)&&(i=r[J],i!==void 0&&Pf(e,a,J,i,r,void 0));return}}for(E in r)r.hasOwnProperty(E)&&(i=r[E],i!=null&&Ft(e,a,E,i,r,null))}function K1(e,a,r,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,b=null,E=null,k=null,F=null,J=null;for(Q in r){var ie=r[Q];if(r.hasOwnProperty(Q)&&ie!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":k=ie;default:i.hasOwnProperty(Q)||Ft(e,a,Q,null,i,ie)}}for(var G in i){var Q=i[G];if(ie=r[G],i.hasOwnProperty(G)&&(Q!=null||ie!=null))switch(G){case"type":h=Q;break;case"name":d=Q;break;case"checked":F=Q;break;case"defaultChecked":J=Q;break;case"value":b=Q;break;case"defaultValue":E=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(s(137,a));break;default:Q!==ie&&Ft(e,a,G,Q,i,ie)}}Fl(e,b,E,k,F,J,h,d);return;case"select":Q=b=E=G=null;for(h in r)if(k=r[h],r.hasOwnProperty(h)&&k!=null)switch(h){case"value":break;case"multiple":Q=k;default:i.hasOwnProperty(h)||Ft(e,a,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,a,d,h,i,k)}a=E,r=b,i=Q,G!=null?gr(e,!!r,G,!1):!!i!=!!r&&(a!=null?gr(e,!!r,a,!0):gr(e,!!r,r?[]:"",!1));return;case"textarea":Q=G=null;for(E in r)if(d=r[E],r.hasOwnProperty(E)&&d!=null&&!i.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Ft(e,a,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,a,b,d,i,h)}Wo(e,G,Q);return;case"option":for(var Oe in r)if(G=r[Oe],r.hasOwnProperty(Oe)&&G!=null&&!i.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:Ft(e,a,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,a,k,G,i,Q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ve in r)G=r[Ve],r.hasOwnProperty(Ve)&&G!=null&&!i.hasOwnProperty(Ve)&&Ft(e,a,Ve,null,i,G);for(F in i)if(G=i[F],Q=r[F],i.hasOwnProperty(F)&&G!==Q&&(G!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,a));break;default:Ft(e,a,F,G,i,Q)}return;default:if(Pl(a)){for(var Pt in r)G=r[Pt],r.hasOwnProperty(Pt)&&G!==void 0&&!i.hasOwnProperty(Pt)&&Pf(e,a,Pt,void 0,i,G);for(J in i)G=i[J],Q=r[J],!i.hasOwnProperty(J)||G===Q||G===void 0&&Q===void 0||Pf(e,a,J,G,i,Q);return}}for(var H in r)G=r[H],r.hasOwnProperty(H)&&G!=null&&!i.hasOwnProperty(H)&&Ft(e,a,H,null,i,G);for(ie in i)G=i[ie],Q=r[ie],!i.hasOwnProperty(ie)||G===Q||G==null&&Q==null||Ft(e,a,ie,G,i,Q)}function Vv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Z1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,a=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&&Vv(b)){for(b=0,E=d.responseEnd,i+=1;i<r.length;i++){var k=r[i],F=k.startTime;if(F>E)break;var J=k.transferSize,ie=k.initiatorType;J&&Vv(ie)&&(k=k.responseEnd,b+=J*(k<E?1:(E-F)/(k-F)))}if(--i,a+=8*(h+b)/(d.duration/1e3),e++,10<e)break}}if(0<e)return a/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Gf=null,Xf=null;function Xu(e){return e.nodeType===9?e:e.ownerDocument}function 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 Fv(e,a){if(e===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&a==="foreignObject"?0:e}function Qf(e,a){return e==="textarea"||e==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Kf=null;function J1(){var e=window.event;return e&&e.type==="popstate"?e===Kf?!1:(Kf=e,!0):(Kf=null,!1)}var Pv=typeof setTimeout=="function"?setTimeout:void 0,W1=typeof clearTimeout=="function"?clearTimeout:void 0,Gv=typeof Promise=="function"?Promise:void 0,eS=typeof queueMicrotask=="function"?queueMicrotask:typeof Gv<"u"?function(e){return Gv.resolve(null).then(e).catch(tS)}:Pv;function tS(e){setTimeout(function(){throw e})}function Tl(e){return e==="head"}function Xv(e,a){var r=a,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(a);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")to(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,to(r);for(var h=r.firstChild;h;){var b=h.nextSibling,E=h.nodeName;h[Ze]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||r.removeChild(h),h=b}}else r==="body"&&to(e.ownerDocument.body);r=d}while(r);Ws(a)}function Qv(e,a){var r=e;e=0;do{var i=r.nextSibling;if(r.nodeType===1?a?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(a?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=i}while(r)}function Zf(e){var a=e.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var r=a;switch(a=a.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Zf(r),Ie(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function aS(e,a,r,i){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==a.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ze])switch(a){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(a==="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=Gn(e.nextSibling),e===null)break}return null}function nS(e,a,r){if(a==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Gn(e.nextSibling),e===null))return null;return e}function Kv(e,a){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Gn(e.nextSibling),e===null))return null;return e}function Jf(e){return e.data==="$?"||e.data==="$~"}function Wf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function rS(e,a){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=a;else if(e.data!=="$?"||r.readyState!=="loading")a();else{var i=function(){a(),r.removeEventListener("DOMContentLoaded",i)};r.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Gn(e){for(;e!=null;e=e.nextSibling){var a=e.nodeType;if(a===1||a===3)break;if(a===8){if(a=e.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return e}var eh=null;function Zv(e){e=e.nextSibling;for(var a=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(a===0)return Gn(e.nextSibling);a--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||a++}e=e.nextSibling}return null}function Jv(e){e=e.previousSibling;for(var a=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(a===0)return e;a--}else r!=="/$"&&r!=="/&"||a++}e=e.previousSibling}return null}function Wv(e,a,r){switch(a=Xu(r),e){case"html":if(e=a.documentElement,!e)throw Error(s(452));return e;case"head":if(e=a.head,!e)throw Error(s(453));return e;case"body":if(e=a.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function to(e){for(var a=e.attributes;a.length;)e.removeAttributeNode(a[0]);Ie(e)}var Xn=new Map,ey=new Set;function Qu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var tl=B.d;B.d={f:lS,r:sS,D:iS,C:oS,L:uS,m:cS,X:fS,S:dS,M:hS};function lS(){var e=tl.f(),a=$u();return e||a}function sS(e){var a=We(e);a!==null&&a.tag===5&&a.type==="form"?vg(a):tl.r(e)}var Ks=typeof document>"u"?null:document;function ty(e,a,r){var i=Ks;if(i&&typeof a=="string"&&a){var d=Pa(a);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),ey.has(d)||(ey.add(d),e={rel:e,crossOrigin:r,href:a},i.querySelector(d)===null&&(a=i.createElement("link"),Ka(a,"link",e),dt(a),i.head.appendChild(a)))}}function iS(e){tl.D(e),ty("dns-prefetch",e,null)}function oS(e,a){tl.C(e,a),ty("preconnect",e,a)}function uS(e,a,r){tl.L(e,a,r);var i=Ks;if(i&&e&&a){var d='link[rel="preload"][as="'+Pa(a)+'"]';a==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+Pa(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+Pa(r.imageSizes)+'"]')):d+='[href="'+Pa(e)+'"]';var h=d;switch(a){case"style":h=Zs(e);break;case"script":h=Js(e)}Xn.has(h)||(e=y({rel:"preload",href:a==="image"&&r&&r.imageSrcSet?void 0:e,as:a},r),Xn.set(h,e),i.querySelector(d)!==null||a==="style"&&i.querySelector(ao(h))||a==="script"&&i.querySelector(no(h))||(a=i.createElement("link"),Ka(a,"link",e),dt(a),i.head.appendChild(a)))}}function cS(e,a){tl.m(e,a);var r=Ks;if(r&&e){var i=a&&typeof a.as=="string"?a.as:"script",d='link[rel="modulepreload"][as="'+Pa(i)+'"][href="'+Pa(e)+'"]',h=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Js(e)}if(!Xn.has(h)&&(e=y({rel:"modulepreload",href:e},a),Xn.set(h,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(no(h)))return}i=r.createElement("link"),Ka(i,"link",e),dt(i),r.head.appendChild(i)}}}function dS(e,a,r){tl.S(e,a,r);var i=Ks;if(i&&e){var d=it(i).hoistableStyles,h=Zs(e);a=a||"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":a},r),(r=Xn.get(h))&&th(e,r);var k=b=i.createElement("link");dt(k),Ka(k,"link",e),k._p=new Promise(function(F,J){k.onload=F,k.onerror=J}),k.addEventListener("load",function(){E.loading|=1}),k.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ku(b,a,i)}b={type:"stylesheet",instance:b,count:1,state:E},d.set(h,b)}}}function fS(e,a){tl.X(e,a);var r=Ks;if(r&&e){var i=it(r).hoistableScripts,d=Js(e),h=i.get(d);h||(h=r.querySelector(no(d)),h||(e=y({src:e,async:!0},a),(a=Xn.get(d))&&ah(e,a),h=r.createElement("script"),dt(h),Ka(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function hS(e,a){tl.M(e,a);var r=Ks;if(r&&e){var i=it(r).hoistableScripts,d=Js(e),h=i.get(d);h||(h=r.querySelector(no(d)),h||(e=y({src:e,async:!0,type:"module"},a),(a=Xn.get(d))&&ah(e,a),h=r.createElement("script"),dt(h),Ka(h,"link",e),r.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},i.set(d,h))}}function ay(e,a,r,i){var d=(d=je.current)?Qu(d):null;if(!d)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(a=Zs(r.href),r=it(d).hoistableStyles,i=r.get(a),i||(i={type:"style",instance:null,count:0,state:null},r.set(a,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),Xn.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},Xn.set(e,r),h||mS(d,e,r,b.state))),a&&i===null)throw Error(s(528,""));return b}if(a&&i!==null)throw Error(s(529,""));return null;case"script":return a=r.async,r=r.src,typeof r=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Js(r),r=it(d).hoistableScripts,i=r.get(a),i||(i={type:"script",instance:null,count:0,state:null},r.set(a,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Zs(e){return'href="'+Pa(e)+'"'}function ao(e){return'link[rel="stylesheet"]['+e+"]"}function ny(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function mS(e,a,r,i){e.querySelector('link[rel="preload"][as="style"]['+a+"]")?i.loading=1:(a=e.createElement("link"),i.preload=a,a.addEventListener("load",function(){return i.loading|=1}),a.addEventListener("error",function(){return i.loading|=2}),Ka(a,"link",r),dt(a),e.head.appendChild(a))}function Js(e){return'[src="'+Pa(e)+'"]'}function no(e){return"script[async]"+e}function ry(e,a,r){if(a.count++,a.instance===null)switch(a.type){case"style":var i=e.querySelector('style[data-href~="'+Pa(r.href)+'"]');if(i)return a.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),Ka(i,"style",d),Ku(i,r.precedence,e),a.instance=i;case"stylesheet":d=Zs(r.href);var h=e.querySelector(ao(d));if(h)return a.state.loading|=4,a.instance=h,dt(h),h;i=ny(r),(d=Xn.get(d))&&th(i,d),h=(e.ownerDocument||e).createElement("link"),dt(h);var b=h;return b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),Ka(h,"link",i),a.state.loading|=4,Ku(h,r.precedence,e),a.instance=h;case"script":return h=Js(r.src),(d=e.querySelector(no(h)))?(a.instance=d,dt(d),d):(i=r,(d=Xn.get(h))&&(i=y({},r),ah(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),dt(d),Ka(d,"link",i),e.head.appendChild(d),a.instance=d);case"void":return null;default:throw Error(s(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(i=a.instance,a.state.loading|=4,Ku(i,r.precedence,e));return a.instance}function Ku(e,a,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===a)h=E;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(a=r.nodeType===9?r.head:r,a.insertBefore(e,a.firstChild))}function th(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.title==null&&(e.title=a.title)}function ah(e,a){e.crossOrigin==null&&(e.crossOrigin=a.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=a.referrerPolicy),e.integrity==null&&(e.integrity=a.integrity)}var Zu=null;function ly(e,a,r){if(Zu===null){var i=new Map,d=Zu=new Map;d.set(r,i)}else d=Zu,i=d.get(r),i||(i=new Map,d.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var h=r[d];if(!(h[Ze]||h[ve]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var b=h.getAttribute(a)||"";b=e+b;var E=i.get(b);E?E.push(h):i.set(b,[h])}}return i}function sy(e,a,r){e=e.ownerDocument||e,e.head.insertBefore(r,a==="title"?e.querySelector("head > title"):null)}function pS(e,a,r){if(r===1||a.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return e=a.disabled,typeof a.precedence=="string"&&e==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function iy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function gS(e,a,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=a.querySelector(ao(d));if(h){a=h._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(e.count++,e=Ju.bind(e),a.then(e,e)),r.state.loading|=4,r.instance=h,dt(h);return}h=a.ownerDocument||a,i=ny(i),(d=Xn.get(d))&&th(i,d),h=h.createElement("link"),dt(h);var b=h;b._p=new Promise(function(E,k){b.onload=E,b.onerror=k}),Ka(h,"link",i),r.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,a),(a=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Ju.bind(e),a.addEventListener("load",r),a.addEventListener("error",r))}}var nh=0;function vS(e,a){return e.stylesheets&&e.count===0&&ec(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&ec(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+a);0<e.imgBytes&&nh===0&&(nh=62500*Z1());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ec(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>nh?50:800)+a);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function Ju(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ec(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Wu=null;function ec(e,a){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Wu=new Map,a.forEach(yS,e),Wu=null,Ju.call(e))}function yS(e,a){if(!(a.state.loading&4)){var r=Wu.get(e);if(r)var i=r.get(null);else{r=new Map,Wu.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var b=d[h];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(r.set(b.dataset.precedence,b),i=b)}i&&r.set(null,i)}d=a.instance,b=d.getAttribute("data-precedence"),h=r.get(b)||i,h===i&&r.set(null,d),r.set(b,d),this.count++,i=Ju.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),a.state.loading|=4}}var ro={$$typeof:q,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function xS(e,a,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 oy(e,a,r,i,d,h,b,E,k,F,J,ie){return e=new xS(e,a,r,b,k,F,J,ie,E),a=1,h===!0&&(a|=24),h=An(3,null,null,a),e.current=h,h.stateNode=e,a=Ld(),a.refCount++,e.pooledCache=a,a.refCount++,h.memoizedState={element:i,isDehydrated:r,cache:a},Hd(h),e}function uy(e){return e?(e=As,e):As}function cy(e,a,r,i,d,h){d=uy(d),i.context===null?i.context=d:i.pendingContext=d,i=gl(a),i.payload={element:r},h=h===void 0?null:h,h!==null&&(i.callback=h),r=vl(e,i,a),r!==null&&(Nn(r,e,a),zi(r,e,a))}function dy(e,a){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<a?r:a}}function rh(e,a){dy(e,a),(e=e.alternate)&&dy(e,a)}function fy(e){if(e.tag===13||e.tag===31){var a=Wl(e,67108864);a!==null&&Nn(a,e,67108864),rh(e,67108864)}}function hy(e){if(e.tag===13||e.tag===31){var a=_n();a=M(a);var r=Wl(e,a);r!==null&&Nn(r,e,a),rh(e,a)}}var tc=!0;function bS(e,a,r,i){var d=U.T;U.T=null;var h=B.p;try{B.p=2,lh(e,a,r,i)}finally{B.p=h,U.T=d}}function SS(e,a,r,i){var d=U.T;U.T=null;var h=B.p;try{B.p=8,lh(e,a,r,i)}finally{B.p=h,U.T=d}}function lh(e,a,r,i){if(tc){var d=sh(i);if(d===null)Ff(e,a,i,ac,r),py(e,i);else if(ES(d,e,a,r,i))i.stopPropagation();else if(py(e,i),a&4&&-1<wS.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}Er(h),(Ot&6)===0&&(Bu=ta()+500,Ji(0))}}break;case 31:case 13:E=Wl(h,2),E!==null&&Nn(E,h,2),$u(),rh(h,2)}if(h=sh(i),h===null&&Ff(e,a,i,ac,r),h===d)break;d=h}d!==null&&i.stopPropagation()}else Ff(e,a,i,null,r)}}function sh(e){return e=_r(e),ih(e)}var ac=null;function ih(e){if(ac=null,e=$t(e),e!==null){var a=u(e);if(a===null)e=null;else{var r=a.tag;if(r===13){if(e=f(a),e!==null)return e;e=null}else if(r===31){if(e=m(a),e!==null)return e;e=null}else if(r===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;e=null}else a!==e&&(e=null)}}return ac=e,null}function my(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(dn()){case fn:return 2;case Ja:return 8;case $a:case he:return 32;case Ce:return 268435456;default:return 32}default:return 32}}var oh=!1,Cl=null,Al=null,Dl=null,lo=new Map,so=new Map,kl=[],wS="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 py(e,a){switch(e){case"focusin":case"focusout":Cl=null;break;case"dragenter":case"dragleave":Al=null;break;case"mouseover":case"mouseout":Dl=null;break;case"pointerover":case"pointerout":lo.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":so.delete(a.pointerId)}}function io(e,a,r,i,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:a,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[d]},a!==null&&(a=We(a),a!==null&&fy(a)),e):(e.eventSystemFlags|=i,a=e.targetContainers,d!==null&&a.indexOf(d)===-1&&a.push(d),e)}function ES(e,a,r,i,d){switch(a){case"focusin":return Cl=io(Cl,e,a,r,i,d),!0;case"dragenter":return Al=io(Al,e,a,r,i,d),!0;case"mouseover":return Dl=io(Dl,e,a,r,i,d),!0;case"pointerover":var h=d.pointerId;return lo.set(h,io(lo.get(h)||null,e,a,r,i,d)),!0;case"gotpointercapture":return h=d.pointerId,so.set(h,io(so.get(h)||null,e,a,r,i,d)),!0}return!1}function gy(e){var a=$t(e.target);if(a!==null){var r=u(a);if(r!==null){if(a=r.tag,a===13){if(a=f(r),a!==null){e.blockedOn=a,se(e.priority,function(){hy(r)});return}}else if(a===31){if(a=m(r),a!==null){e.blockedOn=a,se(e.priority,function(){hy(r)});return}}else if(a===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function nc(e){if(e.blockedOn!==null)return!1;for(var a=e.targetContainers;0<a.length;){var r=sh(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Tn=i,r.target.dispatchEvent(i),Tn=null}else return a=We(r),a!==null&&fy(a),e.blockedOn=r,!1;a.shift()}return!0}function vy(e,a,r){nc(e)&&r.delete(a)}function NS(){oh=!1,Cl!==null&&nc(Cl)&&(Cl=null),Al!==null&&nc(Al)&&(Al=null),Dl!==null&&nc(Dl)&&(Dl=null),lo.forEach(vy),so.forEach(vy)}function rc(e,a){e.blockedOn===a&&(e.blockedOn=null,oh||(oh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,NS)))}var lc=null;function yy(e){lc!==e&&(lc=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){lc===e&&(lc=null);for(var a=0;a<e.length;a+=3){var r=e[a],i=e[a+1],d=e[a+2];if(typeof i!="function"){if(ih(i||r)===null)continue;break}var h=We(r);h!==null&&(e.splice(a,3),a-=3,lf(h,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Ws(e){function a(k){return rc(k,e)}Cl!==null&&rc(Cl,e),Al!==null&&rc(Al,e),Dl!==null&&rc(Dl,e),lo.forEach(a),so.forEach(a);for(var r=0;r<kl.length;r++){var i=kl[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<kl.length&&(r=kl[0],r.blockedOn===null);)gy(r),r.blockedOn===null&&kl.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var d=r[i],h=r[i+1],b=d[De]||null;if(typeof h=="function")b||yy(r);else if(b){var E=null;if(h&&h.hasAttribute("formAction")){if(d=h,b=h[De]||null)E=b.formAction;else if(ih(d)!==null)continue}else E=b.action;typeof E=="function"?r[i+1]=E:(r.splice(i,3),i-=3),yy(r)}}}function xy(){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 a(){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",a),navigation.addEventListener("navigateerror",a),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),d!==null&&(d(),d=null)}}}function uh(e){this._internalRoot=e}sc.prototype.render=uh.prototype.render=function(e){var a=this._internalRoot;if(a===null)throw Error(s(409));var r=a.current,i=_n();cy(r,i,e,a,null,null)},sc.prototype.unmount=uh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var a=e.containerInfo;cy(e.current,2,null,e,null,null),$u(),a[Re]=null}};function sc(e){this._internalRoot=e}sc.prototype.unstable_scheduleHydration=function(e){if(e){var a=K();e={blockedOn:null,target:e,priority:a};for(var r=0;r<kl.length&&a!==0&&a<kl[r].priority;r++);kl.splice(r,0,e),r===0&&gy(e)}};var by=n.version;if(by!=="19.2.7")throw Error(s(527,by,"19.2.7"));B.findDOMNode=function(e){var a=e._reactInternals;if(a===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=g(a),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var RS={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ic=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ic.isDisabled&&ic.supportsFiber)try{qe=ic.inject(RS),Z=ic}catch{}}return uo.createRoot=function(e,a){if(!o(e))throw Error(s(299));var r=!1,i="",d=Tg,h=Cg,b=Ag;return a!=null&&(a.unstable_strictMode===!0&&(r=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(h=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError)),a=oy(e,1,!1,null,null,r,i,null,d,h,b,xy),e[Re]=a.current,Yf(e),new uh(a)},uo.hydrateRoot=function(e,a,r){if(!o(e))throw Error(s(299));var i=!1,d="",h=Tg,b=Cg,E=Ag,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)),a=oy(e,1,!0,a,r??null,i,d,k,h,b,E,xy),a.context=uy(null),r=a.current,i=_n(),i=M(i),d=gl(i),d.callback=null,vl(r,d,i),r=i,a.current.lanes=r,ht(a,r),Er(a),e[Re]=a.current,Yf(e),new sc(a)},uo.version="19.2.7",uo}var Dy;function HS(){if(Dy)return fh.exports;Dy=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(n){console.error(n)}}return t(),fh.exports=BS(),fh.exports}var $S=HS();/**
|
|
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 Jx=t=>{throw TypeError(t)},Wx=(t,n,l)=>n.has(t)||Jx("Cannot "+l),Qn=(t,n,l)=>(Wx(t,n,"read from private field"),l?l.call(t):n.get(t)),bo=(t,n,l)=>n.has(t)?Jx("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,l),Nr=(t,n,l,s)=>(Wx(t,n,"write to private field"),n.set(t,l),l),qc=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,am=/^[\\/]{2}/;function eb(t,n){return n+t.replace(/\\/g,"/")}var ky="popstate";function Oy(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function qS(t={}){function n(s,o){var g;let u=(g=o.state)==null?void 0:g.masked,{pathname:f,search:m,hash:p}=u||s.location;return ko("",{pathname:f,search:m,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function l(s,o){return typeof o=="string"?o:Ar(o)}return VS(n,l,null,t)}function tt(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function xa(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function IS(){return Math.random().toString(36).substring(2,10)}function My(t,n){return{usr:t.state,key:t.key,idx:n,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function ko(t,n,l=null,s,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof n=="string"?Dr(n):n,state:l,key:n&&n.key||s||IS(),mask:o}}function Ar({pathname:t="/",search:n="",hash:l=""}){return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),l&&l!=="#"&&(t+=l.charAt(0)==="#"?l:"#"+l),t}function Dr(t){let n={};if(t){let l=t.indexOf("#");l>=0&&(n.hash=t.substring(l),t=t.substring(0,l));let s=t.indexOf("?");s>=0&&(n.search=t.substring(s),t=t.substring(0,s)),t&&(n.pathname=t)}return n}function VS(t,n,l,s={}){let{window:o=document.defaultView,v5Compat:u=!1}=s,f=o.history,m="POP",p=null,g=x();g==null&&(g=0,f.replaceState({...f.state,idx:g},""));function x(){return(f.state||{idx:null}).idx}function y(){m="POP";let R=x(),L=R==null?null:R-g;g=R,p&&p({action:m,location:A.location,delta:L})}function N(R,L){m="PUSH";let I=Oy(R)?R:ko(A.location,R,L);g=x()+1;let q=My(I,g),X=A.createHref(I.mask||I);try{f.pushState(q,"",X)}catch(W){if(W instanceof DOMException&&W.name==="DataCloneError")throw W;o.location.assign(X)}u&&p&&p({action:m,location:A.location,delta:1})}function S(R,L){m="REPLACE";let I=Oy(R)?R:ko(A.location,R,L);g=x();let q=My(I,g),X=A.createHref(I.mask||I);f.replaceState(q,"",X),u&&p&&p({action:m,location:A.location,delta:0})}function w(R){return tb(o,R)}let A={get action(){return m},get location(){return t(o,f)},listen(R){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(ky,y),p=R,()=>{o.removeEventListener(ky,y),p=null}},createHref(R){return n(o,R)},createURL:w,encodeLocation(R){let L=w(R);return{pathname:L.pathname,search:L.search,hash:L.hash}},push:N,replace:S,go(R){return f.go(R)}};return A}function tb(t,n,l=!1){let s="http://localhost";t&&(s=t.location.origin!=="null"?t.location.origin:t.location.href),tt(s,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:Ar(n);return o=o.replace(/ $/,"%20"),!l&&am.test(o)&&(o=s+o),new URL(o,s)}var So,_y=class{constructor(t){if(bo(this,So,new Map),t)for(let[n,l]of t)this.set(n,l)}get(t){if(Qn(this,So).has(t))return Qn(this,So).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,n){Qn(this,So).set(t,n)}};So=new WeakMap;var YS=new Set(["lazy","caseSensitive","path","id","index","children"]);function FS(t){return YS.has(t)}var PS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function GS(t){return PS.has(t)}function XS(t){return t.index===!0}function Oo(t,n,l=[],s={},o=!1){return t.map((u,f)=>{let m=[...l,String(f)],p=typeof u.id=="string"?u.id:m.join("-");if(tt(u.index!==!0||!u.children,"Cannot specify children on an index route"),tt(o||!s[p],`Found a route id collision on id "${p}". Route id's must be globally unique within Data Router usages`),XS(u)){let g={...u,id:p};return s[p]=Ly(g,n(g)),g}else{let g={...u,id:p,children:void 0};return s[p]=Ly(g,n(g)),u.children&&(g.children=Oo(u.children,n,m,s,o)),g}})}function Ly(t,n){return Object.assign(t,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...t.lazy,...n.lazy}}:{}})}function ab(t,n,l="/"){return or(t,n,l,!1)}function or(t,n,l,s,o){let u=typeof n=="string"?Dr(n):n,f=Wn(u.pathname||"/",l);if(f==null)return null;let m=o??bc(t),p=null,g=sw(f);for(let x=0;p==null&&x<m.length;++x)p=lw(m[x],g,s);return p}function QS(t,n){let{route:l,pathname:s,params:o}=t;return{id:l.id,pathname:s,params:o,data:n[l.id],loaderData:n[l.id],handle:l.handle}}function bc(t){let n=nb(t);return KS(n),n}function nb(t,n=[],l=[],s="",o=!1){let u=(f,m,p=o,g)=>{let x={relativePath:g===void 0?f.path||"":g,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&p)return;tt(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let y=Jn([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}".`),nb(f.children,n,N,y,p)),!(f.path==null&&!f.index)&&n.push({path:y,score:nw(y,f.index),routesMeta:N.map((S,w)=>{let[A,R]=sb(S.relativePath,S.caseSensitive,w===N.length-1);return{...S,matcher:A,compiledParams:R}})})};return t.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))u(f,m);else for(let g of rb(f.path))u(f,m,!0,g)}),n}function rb(t){let n=t.split("/");if(n.length===0)return[];let[l,...s]=n,o=l.endsWith("?"),u=l.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let f=rb(s.join("/")),m=[];return m.push(...f.map(p=>p===""?u:[u,p].join("/"))),o&&m.push(...f),m.map(p=>t.startsWith("/")&&p===""?"/":p)}function KS(t){t.sort((n,l)=>n.score!==l.score?l.score-n.score:rw(n.routesMeta.map(s=>s.childrenIndex),l.routesMeta.map(s=>s.childrenIndex)))}var ZS=/^:[\w-]+$/,JS=3,WS=2,ew=1,tw=10,aw=-2,zy=t=>t==="*";function nw(t,n){let l=t.split("/"),s=l.length;return l.some(zy)&&(s+=aw),n&&(s+=WS),l.filter(o=>!zy(o)).reduce((o,u)=>o+(ZS.test(u)?JS:u===""?ew:tw),s)}function rw(t,n){return t.length===n.length&&t.slice(0,-1).every((s,o)=>s===n[o])?t[t.length-1]-n[n.length-1]:0}function lw(t,n,l=!1){let{routesMeta:s}=t,o={},u="/",f=[];for(let m=0;m<s.length;++m){let p=s[m],g=m===s.length-1,x=u==="/"?n:n.slice(u.length)||"/",y={path:p.relativePath,caseSensitive:p.caseSensitive,end:g},N=p.matcher&&p.compiledParams?lb(y,x,p.matcher,p.compiledParams):Cc(y,x),S=p.route;if(!N&&g&&l&&!s[s.length-1].route.index&&(N=Cc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!N)return null;Object.assign(o,N.params),f.push({params:o,pathname:Jn([u,N.pathname]),pathnameBase:uw(Jn([u,N.pathnameBase])),route:S}),N.pathnameBase!=="/"&&(u=Jn([u,N.pathnameBase]))}return f}function Cc(t,n){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[l,s]=sb(t.path,t.caseSensitive,t.end);return lb(t,n,l,s)}function lb(t,n,l,s){let o=n.match(l);if(!o)return null;let u=o[0],f=u.replace(/(.)\/+$/,"$1"),m=o.slice(1);return{params:s.reduce((g,{paramName:x,isOptional:y},N)=>{if(x==="*"){let w=m[N]||"";f=u.slice(0,u.length-w.length).replace(/(.)\/+$/,"$1")}const S=m[N];return y&&!S?g[x]=void 0:g[x]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:t}}function sb(t,n=!1,l=!0){xa(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p,g,x)=>{if(s.push({paramName:m,isOptional:p!=null}),p){let y=x.charAt(g+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(s.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),s]}function sw(t){try{return t.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return xa(!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 (${n}).`),t}}function Wn(t,n){if(n==="/")return t;if(!t.toLowerCase().startsWith(n.toLowerCase()))return null;let l=n.endsWith("/")?n.length-1:n.length,s=t.charAt(l);return s&&s!=="/"?null:t.slice(l)||"/"}function iw({basename:t,pathname:n}){return n==="/"?t:Jn([t,n])}var nm=t=>qc.test(t);function ow(t,n="/"){let{pathname:l,search:s="",hash:o=""}=typeof t=="string"?Dr(t):t,u;return l?(l=lm(l),l.startsWith("/")?u=Uy(l.substring(1),"/"):u=Uy(l,n)):u=n,{pathname:u,search:cw(s),hash:dw(o)}}function Uy(t,n){let l=Ac(n).split("/");return t.split("/").forEach(o=>{o===".."?l.length>1&&l.pop():o!=="."&&l.push(o)}),l.length>1?l.join("/"):"/"}function gh(t,n,l,s){return`Cannot include a '${t}' character in a manually specified \`to.${n}\` 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 ib(t){return t.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function rm(t){let n=ib(t);return n.map((l,s)=>s===n.length-1?l.pathname:l.pathnameBase)}function Ic(t,n,l,s=!1){let o;typeof t=="string"?o=Dr(t):(o={...t},tt(!o.pathname||!o.pathname.includes("?"),gh("?","pathname","search",o)),tt(!o.pathname||!o.pathname.includes("#"),gh("#","pathname","hash",o)),tt(!o.search||!o.search.includes("#"),gh("#","search","hash",o)));let u=t===""||o.pathname==="",f=u?"/":o.pathname,m;if(f==null)m=l;else{let y=n.length-1;if(!s&&f.startsWith("..")){let N=f.split("/");for(;N[0]==="..";)N.shift(),y-=1;o.pathname=N.join("/")}m=y>=0?n[y]:"/"}let p=ow(o,m),g=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var lm=t=>t.replace(/[\\/]{2,}/g,"/"),Jn=t=>lm(t.join("/")),Ac=t=>t.replace(/\/+$/,""),uw=t=>Ac(t).replace(/^\/*/,"/"),cw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,dw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Un=(t,n=302)=>{let l=n;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})},fw=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Uo=class{constructor(t,n,l,s=!1){this.status=t,this.statusText=n||"",this.internal=s,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function fi(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Bo(t){let n=t.map(l=>l.route.path).filter(Boolean);return Jn(n)||"/"}var ob=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ub(t,n){let l=t;if(typeof l!="string"||!qc.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let s=l,o=!1;if(ob)try{let u=new URL(window.location.href),f=am.test(l)?new URL(eb(l,u.protocol)):new URL(l),m=Wn(f.pathname,n);f.origin===u.origin&&m!=null?l=m+f.search+f.hash:o=!0}catch{xa(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:l}}var Bl=Symbol("Uninstrumented");function hw(t,n){let l={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(o=>o({id:n.id,index:n.index,path:n.path,instrument(u){let f=Object.keys(l);for(let m of f)u[m]&&l[m].push(u[m])}}));let s={};if(typeof n.lazy=="function"&&l.lazy.length>0){let o=oi(l.lazy,n.lazy,()=>{});o&&(s.lazy=o)}if(typeof n.lazy=="object"){let o=n.lazy;["middleware","loader","action"].forEach(u=>{let f=o[u],m=l[`lazy.${u}`];if(typeof f=="function"&&m.length>0){let p=oi(m,f,()=>{});p&&(s.lazy=Object.assign(s.lazy||{},{[u]:p}))}})}return["loader","action"].forEach(o=>{let u=n[o];if(typeof u=="function"&&l[o].length>0){let f=u[Bl]??u,m=oi(l[o],f,(...p)=>By(p[0]));m&&(o==="loader"&&f.hydrate===!0&&(m.hydrate=!0),m[Bl]=f,s[o]=m)}}),n.middleware&&n.middleware.length>0&&l.middleware.length>0&&(s.middleware=n.middleware.map(o=>{let u=o[Bl]??o,f=oi(l.middleware,u,(...m)=>By(m[0]));return f?(f[Bl]=u,f):o})),s}function mw(t,n){let l={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(o){let u=Object.keys(o);for(let f of u)o[f]&&l[f].push(o[f])}})),l.navigate.length>0){let s=t.navigate[Bl]??t.navigate,o=oi(l.navigate,s,(...u)=>{let[f,m]=u;return{to:typeof f=="number"||typeof f=="string"?f:f?Ar(f):".",...Hy(t,m??{})}});o&&(o[Bl]=s,t.navigate=o)}if(l.fetch.length>0){let s=t.fetch[Bl]??t.fetch,o=oi(l.fetch,s,(...u)=>{let[f,,m,p]=u;return{href:m??".",fetcherKey:f,...Hy(t,p??{})}});o&&(o[Bl]=s,t.fetch=o)}return t}function oi(t,n,l){return t.length===0?null:async(...s)=>{let o=await cb(t,l(...s),()=>n(...s),t.length-1);if(o.type==="error")throw o.value;return o.value}}async function cb(t,n,l,s){let o=t[s],u;if(o){let f,m=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=cb(t,n,l,s-1),u=await f,tt(u,"Expected a result"),u.type==="error"&&u.value instanceof Error?{status:"error",error:u.value}:{status:"success",error:void 0});try{await o(m,n)}catch(p){console.error("An instrumentation function threw an error:",p)}f||await m(),await f}else try{u={type:"success",value:await l()}}catch(f){u={type:"error",value:f}}return u||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function By(t){let{request:n,context:l,params:s,pattern:o}=t;return{request:pw(n),params:{...s},pattern:o,context:gw(l)}}function Hy(t,n){return{currentUrl:Ar(t.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function pw(t){return{method:t.method,url:t.url,headers:{get:(...n)=>t.headers.get(...n)}}}function gw(t){if(yw(t)){let n={...t};return Object.freeze(n),n}else return{get:n=>t.get(n)}}var vw=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function yw(t){if(t===null||typeof t!="object")return!1;const n=Object.getPrototypeOf(t);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===vw}var db=["POST","PUT","PATCH","DELETE"],xw=new Set(db),bw=["GET",...db],Sw=new Set(bw),fb=new Set([301,302,303,307,308]),ww=new Set([307,308]),vh={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},hb={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},co={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ew=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),mb="remix-router-transitions",pb=Symbol("ResetLoaderData"),fs,li,_l,si,Nw=class{constructor(t){bo(this,fs),bo(this,li),bo(this,_l),bo(this,si),Nr(this,fs,t),Nr(this,li,bc(t))}get stableRoutes(){return Qn(this,fs)}get activeRoutes(){return Qn(this,_l)??Qn(this,fs)}get branches(){return Qn(this,si)??Qn(this,li)}get hasHMRRoutes(){return Qn(this,_l)!=null}setRoutes(t){Nr(this,fs,t),Nr(this,li,bc(t))}setHmrRoutes(t){Nr(this,_l,t),Nr(this,si,bc(t))}commitHmrRoutes(){Qn(this,_l)&&(Nr(this,fs,Qn(this,_l)),Nr(this,li,Qn(this,si)),Nr(this,_l,void 0),Nr(this,si,void 0))}};fs=new WeakMap;li=new WeakMap;_l=new WeakMap;si=new WeakMap;function Rw(t){const n=t.window?t.window:typeof window<"u"?window:void 0,l=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";tt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=t.hydrationRouteProperties||[],o=t.mapRouteProperties||Ew,u=o;if(t.instrumentations){let D=t.instrumentations;u=M=>({...o(M),...hw(D.map($=>$.route).filter(Boolean),M)})}let f={},m=new Nw(Oo(t.routes,u,void 0,f)),p=t.basename||"/";p.startsWith("/")||(p=`/${p}`);let g=t.dataStrategy||Dw,x={...t.future},y=null,N=new Set,S=null,w=null,A=null,R=null,L=t.hydrationData!=null,I=or(m.activeRoutes,t.history.location,p,!1,m.branches),q=!1,X=null,W,ne;if(I==null&&!t.patchRoutesOnNavigation){let D=Kn(404,{pathname:t.history.location.pathname}),{matches:M,route:$}=oc(m.activeRoutes);W=!0,ne=!W,I=M,X={[$.id]:D}}else if(I&&!t.hydrationData&&Ht(I,m.activeRoutes,t.history.location.pathname).active&&(I=null),I)if(I.some(D=>D.route.lazy))W=!1,ne=!W;else if(!I.some(D=>sm(D.route)))W=!0,ne=!W;else{let D=t.hydrationData?t.hydrationData.loaderData:null,M=t.hydrationData?t.hydrationData.errors:null,$=I;if(M){let K=I.findIndex(se=>M[se.route.id]!==void 0);$=$.slice(0,K+1)}ne=!1,W=!0,$.forEach(K=>{let se=gb(K.route,D,M);ne=ne||se.renderFallback,W=W&&!se.shouldLoad})}else{W=!1,ne=!W,I=[];let D=Ht(null,m.activeRoutes,t.history.location.pathname);D.active&&D.matches&&(q=!0,I=D.matches)}let z,T={historyAction:t.history.action,location:t.history.location,matches:I,initialized:W,renderFallback:ne,navigation:vh,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||X,fetchers:new Map,blockers:new Map},ee="POP",fe=null,be=!1,ye,te=!1,re=new Map,ge=null,U=!1,B=!1,ue=new Set,de=new Map,we=0,C=-1,V=new Map,ae=new Set,me=new Map,Ne=new Map,je=new Set,ze=new Map,ut,Ge=null;function at(){if(y=t.history.listen(({action:D,location:M,delta:$})=>{if(ut){ut(),ut=void 0;return}xa(ze.size===0||$!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let K=yt({currentLocation:T.location,nextLocation:M,historyAction:D});if(K&&$!=null){let se=new Promise(Te=>{ut=Te});t.history.go($*-1),vt(K,{state:"blocked",location:M,proceed(){vt(K,{state:"proceeding",proceed:void 0,reset:void 0,location:M}),se.then(()=>t.history.go($))},reset(){let Te=new Map(T.blockers);Te.set(K,co),ft({blockers:Te})}}),fe==null||fe.resolve(),fe=null;return}return Ut(D,M)}),l){Qw(n,re);let D=()=>Kw(n,re);n.addEventListener("pagehide",D),ge=()=>n.removeEventListener("pagehide",D)}return T.initialized||Ut("POP",T.location,{initialHydration:!0}),z}function ba(){y&&y(),ge&&ge(),N.clear(),ye&&ye.abort(),T.fetchers.forEach((D,M)=>qe(T.fetchers,M)),T.blockers.forEach((D,M)=>Me(M))}function Xt(D){if(N.add(D),S){let{newErrors:M}=S;S=null,D(T,{deletedFetchers:[],newErrors:M,viewTransitionOpts:void 0,flushSync:!1})}return()=>N.delete(D)}function ft(D,M={}){D.matches&&(D.matches=D.matches.map(se=>{let Te=f[se.route.id],ve=se.route;return ve.element!==Te.element||ve.errorElement!==Te.errorElement||ve.hydrateFallbackElement!==Te.hydrateFallbackElement?{...se,route:Te}:se})),T={...T,...D};let $=[],K=[];T.fetchers.forEach((se,Te)=>{se.state==="idle"&&(je.has(Te)?$.push(Te):K.push(Te))}),je.forEach(se=>{!T.fetchers.has(se)&&!de.has(se)&&$.push(se)}),N.size===0&&(S={newErrors:D.errors??null}),[...N].forEach(se=>se(T,{deletedFetchers:$,newErrors:D.errors??null,viewTransitionOpts:M.viewTransitionOpts,flushSync:M.flushSync===!0})),$.forEach(se=>qe(T.fetchers,se)),K.forEach(se=>T.fetchers.delete(se))}function oe(D,M,{flushSync:$}={}){var Ue,Xe;let K=T.actionData!=null&&T.navigation.formMethod!=null&&on(T.navigation.formMethod)&&T.navigation.state==="loading"&&((Ue=D.state)==null?void 0:Ue._isRedirect)!==!0,se;M.actionData?Object.keys(M.actionData).length>0?se=M.actionData:se=null:K?se=T.actionData:se=null;let Te=M.loaderData?Qy(T.loaderData,M.loaderData,M.matches||[],M.errors):T.loaderData,ve=T.blockers;ve.size>0&&(ve=new Map(ve),ve.forEach((ke,Ze)=>ve.set(Ze,co)));let De=U?!1:Zt(D,M.matches||T.matches),Re=be===!0||T.navigation.formMethod!=null&&on(T.navigation.formMethod)&&((Xe=D.state)==null?void 0:Xe._isRedirect)!==!0;m.commitHmrRoutes(),U||ee==="POP"||(ee==="PUSH"?t.history.push(D,D.state):ee==="REPLACE"&&t.history.replace(D,D.state));let _e;if(ee==="POP"){let ke=re.get(T.location.pathname);ke&&ke.has(D.pathname)?_e={currentLocation:T.location,nextLocation:D}:re.has(D.pathname)&&(_e={currentLocation:D,nextLocation:T.location})}else if(te){let ke=re.get(T.location.pathname);ke?ke.add(D.pathname):(ke=new Set([D.pathname]),re.set(T.location.pathname,ke)),_e={currentLocation:T.location,nextLocation:D}}ft({...M,actionData:se,loaderData:Te,historyAction:ee,location:D,initialized:!0,renderFallback:!1,navigation:vh,revalidation:"idle",restoreScrollPosition:De,preventScrollReset:Re,blockers:ve},{viewTransitionOpts:_e,flushSync:$===!0}),ee="POP",be=!1,te=!1,U=!1,B=!1,fe==null||fe.resolve(),fe=null,Ge==null||Ge.resolve(),Ge=null}async function $e(D,M){if(fe==null||fe.resolve(),fe=null,typeof D=="number"){fe||(fe=Wy());let Ie=fe.promise;return t.history.go(D),Ie}let $=Ih(T.location,T.matches,p,D,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:K,submission:se,error:Te}=$y(!1,$,M),ve;M!=null&&M.mask&&(ve={pathname:"",search:"",hash:"",...typeof M.mask=="string"?Dr(M.mask):{...T.location.mask,...M.mask}});let De=T.location,Re=ko(De,K,M&&M.state,void 0,ve);Re={...Re,...t.history.encodeLocation(Re)};let _e=M&&M.replace!=null?M.replace:void 0,Ue="PUSH";_e===!0?Ue="REPLACE":_e===!1||se!=null&&on(se.formMethod)&&se.formAction===T.location.pathname+T.location.search&&(Ue="REPLACE");let Xe=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,ke=(M&&M.flushSync)===!0,Ze=yt({currentLocation:De,nextLocation:Re,historyAction:Ue});if(Ze){vt(Ze,{state:"blocked",location:Re,proceed(){vt(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:Re}),$e(D,M)},reset(){let Ie=new Map(T.blockers);Ie.set(Ze,co),ft({blockers:Ie})}});return}await Ut(Ue,Re,{submission:se,pendingError:Te,preventScrollReset:Xe,replace:M&&M.replace,enableViewTransition:M&&M.viewTransition,flushSync:ke,callSiteDefaultShouldRevalidate:M&&M.defaultShouldRevalidate})}function nt(){Ge||(Ge=Wy()),$a(),ft({revalidation:"loading"});let D=Ge.promise;return T.navigation.state==="submitting"?D:T.navigation.state==="idle"?(Ut(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),D):(Ut(ee||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:te===!0}),D)}async function Ut(D,M,$){ye&&ye.abort(),ye=null,ee=D,U=($&&$.startUninterruptedRevalidation)===!0,aa(T.location,T.matches),be=($&&$.preventScrollReset)===!0,te=($&&$.enableViewTransition)===!0;let K=m.activeRoutes,se=$!=null&&$.initialHydration&&T.matches&&T.matches.length>0&&!q?T.matches:or(K,M,p,!1,m.branches),Te=($&&$.flushSync)===!0;if(se&&T.initialized&&!B&&Hw(T.location,M)&&!($&&$.submission&&on($.submission.formMethod))){oe(M,{matches:se},{flushSync:Te});return}let ve=Ht(se,K,M.pathname);if(ve.active&&ve.matches&&(se=ve.matches),!se){let{error:We,notFoundMatches:ct,route:it}=wt(M.pathname);oe(M,{matches:ct,loaderData:{},errors:{[it.id]:We}},{flushSync:Te});return}let De=$&&$.overrideNavigation?{...$.overrideNavigation,matches:se,historyAction:D}:void 0;ye=new AbortController;let Re=ii(t.history,M,ye.signal,$&&$.submission),_e=t.getContext?await t.getContext():new _y,Ue;if($&&$.pendingError)Ue=[Ul(se).route.id,{type:"error",error:$.pendingError}];else if($&&$.submission&&on($.submission.formMethod)){let We=await ma(Re,M,$.submission,se,D,_e,ve.active,$&&$.initialHydration===!0,{replace:$.replace,flushSync:Te});if(We.shortCircuited)return;if(We.pendingActionResult){let[ct,it]=We.pendingActionResult;if(Ln(it)&&fi(it.error)&&it.error.status===404){ye=null,oe(M,{matches:We.matches,loaderData:{},errors:{[ct]:it.error}});return}}se=We.matches||se,Ue=We.pendingActionResult,De=yh(M,se,D,$.submission),Te=!1,ve.active=!1,Re=ii(t.history,Re.url,Re.signal)}let{shortCircuited:Xe,matches:ke,loaderData:Ze,errors:Ie,workingFetchers:$t}=await jt(Re,M,se,D,_e,ve.active,De,$&&$.submission,$&&$.fetcherSubmission,$&&$.replace,$&&$.initialHydration===!0,Te,Ue,$&&$.callSiteDefaultShouldRevalidate);Xe||(ye=null,oe(M,{matches:ke||se,...Ky(Ue),loaderData:Ze,errors:Ie,...$t?{fetchers:$t}:{}}))}async function ma(D,M,$,K,se,Te,ve,De,Re={}){$a();let _e=Gw(M,K,se,$);if(ft({navigation:_e},{flushSync:Re.flushSync===!0}),ve){let ke=await ht(K,M.pathname,D.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){if(ke.partialMatches.length===0){let{matches:Ie,route:$t}=oc(m.activeRoutes);return{matches:Ie,pendingActionResult:[$t.id,{type:"error",error:ke.error}]}}let Ze=Ul(ke.partialMatches).route.id;return{matches:ke.partialMatches,pendingActionResult:[Ze,{type:"error",error:ke.error}]}}else if(ke.matches)K=ke.matches;else{let{notFoundMatches:Ze,error:Ie,route:$t}=wt(M.pathname);return{matches:Ze,pendingActionResult:[$t.id,{type:"error",error:Ie}]}}}let Ue,Xe=Sc(K,M);if(!Xe.route.action&&!Xe.route.lazy)Ue={type:"error",error:Kn(405,{method:D.method,pathname:M.pathname,routeId:Xe.route.id})};else{let ke=ci(u,f,D,M,K,Xe,De?[]:s,Te),Ze=await fn(D,M,ke,Te,null);if(Ue=Ze[Xe.route.id],!Ue){for(let Ie of K)if(Ze[Ie.route.id]){Ue=Ze[Ie.route.id];break}}if(D.signal.aborted)return{shortCircuited:!0}}if(hs(Ue)){let ke;return Re&&Re.replace!=null?ke=Re.replace:ke=Py(Ue.response.headers.get("Location"),new URL(D.url),p,t.history)===T.location.pathname+T.location.search,await dn(D,Ue,!0,{submission:$,replace:ke}),{shortCircuited:!0}}if(Ln(Ue)){let ke=Ul(K,Xe.route.id);return(Re&&Re.replace)!==!0&&(ee="PUSH"),{matches:K,pendingActionResult:[ke.route.id,Ue,Xe.route.id]}}return{matches:K,pendingActionResult:[Xe.route.id,Ue]}}async function jt(D,M,$,K,se,Te,ve,De,Re,_e,Ue,Xe,ke,Ze){let Ie=ve||yh(M,$,K,De),$t=De||Re||Jy(Ie),We=!U&&!Ue;if(Te){if(We){let Nt=_t(ke);ft({navigation:Ie,...Nt!==void 0?{actionData:Nt}:{}},{flushSync:Xe})}let Qe=await ht($,M.pathname,D.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){if(Qe.partialMatches.length===0){let{matches:Wt,route:en}=oc(m.activeRoutes);return{matches:Wt,loaderData:{},errors:{[en.id]:Qe.error}}}let Nt=Ul(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:en}=wt(M.pathname);return{matches:Wt,loaderData:{},errors:{[en.id]:Nt}}}}let ct=m.activeRoutes,{dsMatches:it,revalidatingFetchers:dt}=qy(D,se,u,f,t.history,T,$,$t,M,Ue?[]:s,Ue===!0,B,ue,je,me,ae,ct,p,t.patchRoutesOnNavigation!=null,m.branches,ke,Ze);if(C=++we,!t.dataStrategy&&!it.some(Qe=>Qe.shouldLoad)&&!it.some(Qe=>Qe.route.middleware&&Qe.route.middleware.length>0)&&dt.length===0){let Qe=new Map(T.fetchers),Nt=Va(Qe);return oe(M,{matches:$,loaderData:{},errors:ke&&Ln(ke[1])?{[ke[0]]:ke[1].error}:null,...Ky(ke),...Nt?{fetchers:Qe}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(We){let Qe={};if(!Te){Qe.navigation=Ie;let Nt=_t(ke);Nt!==void 0&&(Qe.actionData=Nt)}dt.length>0&&(Qe.fetchers=Qt(dt)),ft(Qe,{flushSync:Xe})}dt.forEach(Qe=>{Tt(Qe.key),Qe.controller&&de.set(Qe.key,Qe.controller)});let Jt=()=>dt.forEach(Qe=>Tt(Qe.key));ye&&ye.signal.addEventListener("abort",Jt);let{loaderResults:Ya,fetcherResults:wa}=await Ja(it,dt,D,M,se);if(D.signal.aborted)return{shortCircuited:!0};ye&&ye.signal.removeEventListener("abort",Jt),dt.forEach(Qe=>de.delete(Qe.key));let ka=uc(Ya);if(ka)return await dn(D,ka.result,!0,{replace:_e}),{shortCircuited:!0};if(ka=uc(wa),ka)return ae.add(ka.key),await dn(D,ka.result,!0,{replace:_e}),{shortCircuited:!0};let Oa=new Map(T.fetchers),{loaderData:Fa,errors:gn}=Xy(T,$,Ya,ke,dt,wa,Oa);Ue&&T.errors&&(gn={...T.errors,...gn});let ol=Va(Oa),Wa=pa(C,Oa),pr=ol||Wa||dt.length>0;return{matches:$,loaderData:Fa,errors:gn,...pr?{workingFetchers:Oa}:{}}}function _t(D){if(D&&!Ln(D[1]))return{[D[0]]:D[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Qt(D){let M=new Map(T.fetchers);return D.forEach($=>{let K=M.get($.key),se=fo(void 0,K?K.data:void 0);M.set($.key,se)}),M}async function Ba(D,M,$,K){Tt(D);let se=(K&&K.flushSync)===!0,Te=m.activeRoutes,ve=Ih(T.location,T.matches,p,$,M,K==null?void 0:K.relative),De=or(Te,ve,p,!1,m.branches),Re=Ht(De,Te,ve);if(Re.active&&Re.matches&&(De=Re.matches),!De){Ce(D,M,Kn(404,{pathname:ve}),{flushSync:se});return}let{path:_e,submission:Ue,error:Xe}=$y(!0,ve,K);if(Xe){Ce(D,M,Xe,{flushSync:se});return}let ke=t.getContext?await t.getContext():new _y,Ze=(K&&K.preventScrollReset)===!0;if(Ue&&on(Ue.formMethod)){await Ha(D,M,_e,De,ke,Re.active,se,Ze,Ue,K&&K.defaultShouldRevalidate);return}me.set(D,{routeId:M,path:_e}),await ta(D,M,_e,De,ke,Re.active,se,Ze,Ue)}async function Ha(D,M,$,K,se,Te,ve,De,Re,_e){$a(),me.delete(D);let Ue=T.fetchers.get(D);he(D,Xw(Re,Ue),{flushSync:ve});let Xe=new AbortController,ke=ii(t.history,$,Xe.signal,Re);if(Te){let Rt=await ht(K,new URL(ke.url).pathname,ke.signal,D);if(Rt.type==="aborted")return;if(Rt.type==="error"){Ce(D,M,Rt.error,{flushSync:ve});return}else if(Rt.matches)K=Rt.matches;else{Ce(D,M,Kn(404,{pathname:$}),{flushSync:ve});return}}let Ze=Sc(K,$);if(!Ze.route.action&&!Ze.route.lazy){let Rt=Kn(405,{method:Re.formMethod,pathname:$,routeId:M});Ce(D,M,Rt,{flushSync:ve});return}de.set(D,Xe);let Ie=we,$t=ci(u,f,ke,$,K,Ze,s,se),We=await fn(ke,$,$t,se,D),ct=We[Ze.route.id];if(!ct){for(let Rt of $t)if(We[Rt.route.id]){ct=We[Rt.route.id];break}}if(ke.signal.aborted){de.get(D)===Xe&&de.delete(D);return}if(je.has(D)){if(hs(ct)||Ln(ct)){he(D,jr(void 0));return}}else{if(hs(ct))if(de.delete(D),C>Ie){he(D,jr(void 0));return}else return ae.add(D),he(D,fo(Re)),dn(ke,ct,!1,{fetcherSubmission:Re,preventScrollReset:De});if(Ln(ct)){Ce(D,M,ct.error);return}}let it=T.navigation.location||T.location,dt=ii(t.history,it,Xe.signal),Jt=m.activeRoutes,Ya=T.navigation.state!=="idle"?or(Jt,T.navigation.location,p,!1,m.branches):T.matches;tt(Ya,"Didn't find any matches after fetcher action");let wa=++we;V.set(D,wa);let{dsMatches:ka,revalidatingFetchers:Oa}=qy(dt,se,u,f,t.history,T,Ya,Re,it,s,!1,B,ue,je,me,ae,Jt,p,t.patchRoutesOnNavigation!=null,m.branches,[Ze.route.id,ct],_e),Fa=fo(Re,ct.data),gn=new Map(T.fetchers);gn.set(D,Fa),Oa.filter(Rt=>Rt.key!==D).forEach(Rt=>{let jn=Rt.key,Pa=gn.get(jn),Fl=fo(void 0,Pa?Pa.data:void 0);gn.set(jn,Fl),Tt(jn),Rt.controller&&de.set(jn,Rt.controller)}),ft({fetchers:gn});let ol=()=>Oa.forEach(Rt=>Tt(Rt.key));Xe.signal.addEventListener("abort",ol);let{loaderResults:Wa,fetcherResults:pr}=await Ja(ka,Oa,dt,it,se);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",ol),V.delete(D),de.delete(D),Oa.forEach(Rt=>de.delete(Rt.key));let Qe=T.fetchers.has(D),Nt=Rt=>{if(!Qe)return Rt;let jn=new Map(Rt.fetchers);return jn.set(D,jr(ct.data)),{...Rt,fetchers:jn}},Wt=uc(Wa);if(Wt)return T=Nt(T),dn(dt,Wt.result,!1,{preventScrollReset:De});if(Wt=uc(pr),Wt)return ae.add(Wt.key),T=Nt(T),dn(dt,Wt.result,!1,{preventScrollReset:De});let en=new Map(T.fetchers);Qe&&en.set(D,jr(ct.data));let{loaderData:Ma,errors:Mr}=Xy(T,Ya,Wa,void 0,Oa,pr,en);pa(wa,en),T.navigation.state==="loading"&&wa>C?(tt(ee,"Expected pending action"),ye&&ye.abort(),oe(T.navigation.location,{matches:Ya,loaderData:Ma,errors:Mr,fetchers:en})):(ft({errors:Mr,loaderData:Qy(T.loaderData,Ma,Ya,Mr),fetchers:en}),B=!1)}async function ta(D,M,$,K,se,Te,ve,De,Re){let _e=T.fetchers.get(D);he(D,fo(Re,_e?_e.data:void 0),{flushSync:ve});let Ue=new AbortController,Xe=ii(t.history,$,Ue.signal);if(Te){let ct=await ht(K,new URL(Xe.url).pathname,Xe.signal,D);if(ct.type==="aborted")return;if(ct.type==="error"){Ce(D,M,ct.error,{flushSync:ve});return}else if(ct.matches)K=ct.matches;else{Ce(D,M,Kn(404,{pathname:$}),{flushSync:ve});return}}let ke=Sc(K,$);de.set(D,Ue);let Ze=we,Ie=ci(u,f,Xe,$,K,ke,s,se),$t=await fn(Xe,$,Ie,se,D),We=$t[ke.route.id];if(!We){for(let ct of K)if($t[ct.route.id]){We=$t[ct.route.id];break}}if(de.get(D)===Ue&&de.delete(D),!Xe.signal.aborted){if(je.has(D)){he(D,jr(void 0));return}if(hs(We))if(C>Ze){he(D,jr(void 0));return}else{ae.add(D),await dn(Xe,We,!1,{preventScrollReset:De});return}if(Ln(We)){Ce(D,M,We.error);return}he(D,jr(We.data))}}async function dn(D,M,$,{submission:K,fetcherSubmission:se,preventScrollReset:Te,replace:ve}={}){$||(fe==null||fe.resolve(),fe=null),M.response.headers.has("X-Remix-Revalidate")&&(B=!0);let De=M.response.headers.get("Location");tt(De,"Expected a Location header on the redirect Response"),De=Py(De,new URL(D.url),p,t.history);let Re=ko(T.location,De,{_isRedirect:!0});if(l){let Ie=!1;if(M.response.headers.has("X-Remix-Reload-Document"))Ie=!0;else if(nm(De)){const $t=tb(n,De,!0);Ie=$t.origin!==n.location.origin||Wn($t.pathname,p)==null}if(Ie){ve?n.location.replace(De):n.location.assign(De);return}}ye=null;let _e=ve===!0||M.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Xe,formEncType:ke}=T.navigation;!K&&!se&&Ue&&Xe&&ke&&(K=Jy(T.navigation));let Ze=K||se;if(ww.has(M.response.status)&&Ze&&on(Ze.formMethod))await Ut(_e,Re,{submission:{...Ze,formAction:De},preventScrollReset:Te||be,enableViewTransition:$?te:void 0});else{let Ie=yh(Re,[],_e,K);await Ut(_e,Re,{overrideNavigation:Ie,fetcherSubmission:se,preventScrollReset:Te||be,enableViewTransition:$?te:void 0})}}async function fn(D,M,$,K,se){var De;let Te,ve={};try{Te=await Ow(g,D,M,$,se,K,!1)}catch(Re){return $.filter(_e=>_e.shouldLoad).forEach(_e=>{ve[_e.route.id]={type:"error",error:Re}}),ve}if(D.signal.aborted)return ve;if(!on(D.method))for(let Re of $){if(((De=Te[Re.route.id])==null?void 0:De.type)==="error")break;!Te.hasOwnProperty(Re.route.id)&&!T.loaderData.hasOwnProperty(Re.route.id)&&(!T.errors||!T.errors.hasOwnProperty(Re.route.id))&&Re.shouldCallHandler()&&(Te[Re.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Re.route.id}`)})}for(let[Re,_e]of Object.entries(Te))if(Vw(_e)){let Ue=_e.result;ve[Re]={type:"redirect",response:zw(Ue,D,Re,$,p)}}else ve[Re]=await Lw(_e);return ve}async function Ja(D,M,$,K,se){let Te=fn($,K,D,se,null),ve=Promise.all(M.map(async _e=>{if(_e.matches&&_e.match&&_e.request&&_e.controller){let Xe=(await fn(_e.request,_e.path,_e.matches,se,_e.key))[_e.match.route.id];return{[_e.key]:Xe}}else return Promise.resolve({[_e.key]:{type:"error",error:Kn(404,{pathname:_e.path})}})})),De=await Te,Re=(await ve).reduce((_e,Ue)=>Object.assign(_e,Ue),{});return{loaderResults:De,fetcherResults:Re}}function $a(){B=!0,me.forEach((D,M)=>{de.has(M)&&ue.add(M),Tt(M)})}function he(D,M,$={}){let K=new Map(T.fetchers);K.set(D,M),ft({fetchers:K},{flushSync:($&&$.flushSync)===!0})}function Ce(D,M,$,K={}){let se=Ul(T.matches,M),Te=new Map(T.fetchers);qe(Te,D),ft({errors:{[se.route.id]:$},fetchers:Te},{flushSync:(K&&K.flushSync)===!0})}function Ae(D){return Ne.set(D,(Ne.get(D)||0)+1),je.has(D)&&je.delete(D),T.fetchers.get(D)||hb}function Pe(D,M){Tt(D,M==null?void 0:M.reason),he(D,jr(null))}function qe(D,M){let $=T.fetchers.get(M);de.has(M)&&!($&&$.state==="loading"&&V.has(M))&&Tt(M),me.delete(M),V.delete(M),ae.delete(M),je.delete(M),ue.delete(M),D.delete(M)}function Z(D){let M=(Ne.get(D)||0)-1;M<=0?(Ne.delete(D),je.add(D)):Ne.set(D,M),ft({fetchers:new Map(T.fetchers)})}function Tt(D,M){let $=de.get(D);$&&($.abort(M),de.delete(D))}function Kt(D,M){for(let $ of D){let K=M.get($);tt(K,`Expected fetcher: ${$}`);let se=jr(K.data);M.set($,se)}}function Va(D){let M=[],$=!1;for(let K of ae){let se=D.get(K);tt(se,`Expected fetcher: ${K}`),se.state==="loading"&&(ae.delete(K),M.push(K),$=!0)}return Kt(M,D),$}function pa(D,M){let $=[];for(let[K,se]of V)if(se<D){let Te=M.get(K);tt(Te,`Expected fetcher: ${K}`),Te.state==="loading"&&(Tt(K),V.delete(K),$.push(K))}return Kt($,M),$.length>0}function Bn(D,M){let $=T.blockers.get(D)||co;return ze.get(D)!==M&&ze.set(D,M),$}function Me(D){T.blockers.delete(D),ze.delete(D)}function vt(D,M){let $=T.blockers.get(D)||co;tt($.state==="unblocked"&&M.state==="blocked"||$.state==="blocked"&&M.state==="blocked"||$.state==="blocked"&&M.state==="proceeding"||$.state==="blocked"&&M.state==="unblocked"||$.state==="proceeding"&&M.state==="unblocked",`Invalid blocker state transition: ${$.state} -> ${M.state}`);let K=new Map(T.blockers);K.set(D,M),ft({blockers:K})}function yt({currentLocation:D,nextLocation:M,historyAction:$}){if(ze.size===0)return;ze.size>1&&xa(!1,"A router only supports one blocker at a time");let K=Array.from(ze.entries()),[se,Te]=K[K.length-1],ve=T.blockers.get(se);if(!(ve&&ve.state==="proceeding")&&Te({currentLocation:D,nextLocation:M,historyAction:$}))return se}function wt(D){let M=Kn(404,{pathname:D}),$=m.activeRoutes,{matches:K,route:se}=oc($);return{notFoundMatches:K,route:se,error:M}}function Bt(D,M,$){if(w=D,R=M,A=$||null,!L&&T.navigation===vh){L=!0;let K=Zt(T.location,T.matches);K!=null&&ft({restoreScrollPosition:K})}return()=>{w=null,R=null,A=null}}function Ct(D,M){return A&&A(D,M.map(K=>QS(K,T.loaderData)))||D.key}function aa(D,M){if(w&&R){let $=Ct(D,M);w[$]=R()}}function Zt(D,M){if(w){let $=Ct(D,M),K=w[$];if(typeof K=="number")return K}return null}function Ht(D,M,$){if(t.patchRoutesOnNavigation){let K=m.branches;if(D){if(Object.keys(D[0].params).length>0)return{active:!0,matches:or(M,$,p,!0,K)}}else return{active:!0,matches:or(M,$,p,!0,K)||[]}}return{active:!1,matches:null}}async function ht(D,M,$,K){if(!t.patchRoutesOnNavigation)return{type:"success",matches:D};let se=D;for(;;){let Te=f;try{await t.patchRoutesOnNavigation({signal:$,path:M,matches:se,fetcherKey:K,patch:(_e,Ue)=>{$.aborted||Iy(_e,Ue,m,Te,u,!1)}})}catch(_e){return{type:"error",error:_e,partialMatches:se}}if($.aborted)return{type:"aborted"};let ve=m.branches,De=or(m.activeRoutes,M,p,!1,ve),Re=null;if(De){if(Object.keys(De[0].params).length===0)return{type:"success",matches:De};if(Re=or(m.activeRoutes,M,p,!0,ve),!(Re&&se.length<Re.length&&Je(se,Re.slice(0,se.length))))return{type:"success",matches:De}}if(Re||(Re=or(m.activeRoutes,M,p,!0,ve)),!Re||Je(se,Re))return{type:"success",matches:null};se=Re}}function Je(D,M){return D.length===M.length&&D.every(($,K)=>$.route.id===M[K].route.id)}function Sa(D){f={},m.setHmrRoutes(Oo(D,u,void 0,f))}function Da(D,M,$=!1){Iy(D,M,m,f,u,$),m.hasHMRRoutes||ft({})}return z={get basename(){return p},get future(){return x},get state(){return T},get routes(){return m.stableRoutes},get branches(){return m.branches},get manifest(){return f},get window(){return n},initialize:at,subscribe:Xt,enableScrollRestoration:Bt,navigate:$e,fetch:Ba,revalidate:nt,createHref:D=>t.history.createHref(D),encodeLocation:D=>t.history.encodeLocation(D),getFetcher:Ae,resetFetcher:Pe,deleteFetcher:Z,dispose:ba,getBlocker:Bn,deleteBlocker:Me,patchRoutes:Da,_internalFetchControllers:de,_internalSetRoutes:Sa,_internalSetStateDoNotUseOrYouWillBreakYourApp(D){ft(D)}},t.instrumentations&&(z=mw(z,t.instrumentations.map(D=>D.router).filter(Boolean))),z}function jw(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Ih(t,n,l,s,o,u){let f,m;if(o){f=[];for(let g of n)if(f.push(g),g.route.id===o){m=g;break}}else f=n,m=n[n.length-1];let p=Ic(s||".",rm(f),Wn(t.pathname,l)||t.pathname,u==="path");if(s==null&&(p.search=t.search,p.hash=t.hash),(s==null||s===""||s===".")&&m){let g=om(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(S=>S).forEach(S=>x.append("index",S));let N=x.toString();p.search=N?`?${N}`:""}}return l!=="/"&&(p.pathname=iw({basename:l,pathname:p.pathname})),Ar(p)}function $y(t,n,l){if(!l||!jw(l))return{path:n};if(l.formMethod&&!Pw(l.formMethod))return{path:n,error:Kn(405,{method:l.formMethod})};let s=()=>({path:n,error:Kn(400,{type:"invalid-body"})}),u=(l.formMethod||"get").toUpperCase(),f=Eb(n);if(l.body!==void 0){if(l.formEncType==="text/plain"){if(!on(u))return s();let y=typeof l.body=="string"?l.body:l.body instanceof FormData||l.body instanceof URLSearchParams?Array.from(l.body.entries()).reduce((N,[S,w])=>`${N}${S}=${w}
|
|
59
|
-
`,""):String(l.body);return{path:n,submission:{formMethod:u,formAction:f,formEncType:l.formEncType,formData:void 0,json:void 0,text:y}}}else if(l.formEncType==="application/json"){if(!on(u))return s();try{let y=typeof l.body=="string"?JSON.parse(l.body):l.body;return{path:n,submission:{formMethod:u,formAction:f,formEncType:l.formEncType,formData:void 0,json:y,text:void 0}}}catch{return s()}}}tt(typeof FormData=="function","FormData is not available in this environment");let m,p;if(l.formData)m=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=Gy(m);else if(l.body==null)m=new URLSearchParams,p=new FormData;else try{m=new URLSearchParams(l.body),p=Gy(m)}catch{return s()}let g={formMethod:u,formAction:f,formEncType:l&&l.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(on(g.formMethod))return{path:n,submission:g};let x=Dr(n);return t&&x.search&&om(x.search)&&m.append("index",""),x.search=`?${m}`,{path:Ar(x),submission:g}}function qy(t,n,l,s,o,u,f,m,p,g,x,y,N,S,w,A,R,L,I,q,X,W){var U;let ne=X?Ln(X[1])?X[1].error:X[1].data:void 0,z=o.createURL(u.location),T=o.createURL(p),ee;if(x&&u.errors){let B=Object.keys(u.errors)[0];ee=f.findIndex(ue=>ue.route.id===B)}else if(X&&Ln(X[1])){let B=X[0];ee=f.findIndex(ue=>ue.route.id===B)-1}let fe=X?X[1].statusCode:void 0,be=fe&&fe>=400,ye={currentUrl:z,currentParams:((U=u.matches[0])==null?void 0:U.params)||{},nextUrl:T,nextParams:f[0].params,...m,actionResult:ne,actionStatus:fe},te=Bo(f),re=f.map((B,ue)=>{let{route:de}=B,we=null;if(ee!=null&&ue>ee)we=!1;else if(de.lazy)we=!0;else if(!sm(de))we=!1;else if(x){let{shouldLoad:me}=gb(de,u.loaderData,u.errors);we=me}else Tw(u.loaderData,u.matches[ue],B)&&(we=!0);if(we!==null)return Vh(l,s,t,p,te,B,g,n,we);let C=!1;typeof W=="boolean"?C=W:be?C=!1:(y||z.pathname+z.search===T.pathname+T.search||z.search!==T.search||Cw(u.matches[ue],B))&&(C=!0);let V={...ye,defaultShouldRevalidate:C},ae=No(B,V);return Vh(l,s,t,p,te,B,g,n,ae,V,W)}),ge=[];return w.forEach((B,ue)=>{if(x||!f.some(je=>je.route.id===B.routeId)||S.has(ue))return;let de=u.fetchers.get(ue),we=de&&de.state!=="idle"&&de.data===void 0,C=or(R,B.path,L??"/",!1,q);if(!C){if(I&&we)return;ge.push({key:ue,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(A.has(ue))return;let V=Sc(C,B.path),ae=new AbortController,me=ii(o,B.path,ae.signal),Ne=null;if(N.has(ue))N.delete(ue),Ne=ci(l,s,me,B.path,C,V,g,n);else if(we)y&&(Ne=ci(l,s,me,B.path,C,V,g,n));else{let je;typeof W=="boolean"?je=W:be?je=!1:je=y;let ze={...ye,defaultShouldRevalidate:je};No(V,ze)&&(Ne=ci(l,s,me,B.path,C,V,g,n,ze))}Ne&&ge.push({key:ue,routeId:B.routeId,path:B.path,matches:Ne,match:V,request:me,controller:ae})}),{dsMatches:re,revalidatingFetchers:ge}}function sm(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function gb(t,n,l){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!sm(t))return{shouldLoad:!1,renderFallback:!1};let s=n!=null&&t.id in n,o=l!=null&&l[t.id]!==void 0;if(!s&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let u=!s&&!o;return{shouldLoad:u,renderFallback:u}}function Tw(t,n,l){let s=!n||l.route.id!==n.route.id,o=!t.hasOwnProperty(l.route.id);return s||o}function Cw(t,n){let l=t.route.path;return t.pathname!==n.pathname||l!=null&&l.endsWith("*")&&t.params["*"]!==n.params["*"]}function No(t,n){if(t.route.shouldRevalidate){let l=t.route.shouldRevalidate(n);if(typeof l=="boolean")return l}return n.defaultShouldRevalidate}function Iy(t,n,l,s,o,u){let f;if(t){let g=s[t];tt(g,`No route found to patch children into: routeId = ${t}`),g.children||(g.children=[]),f=g.children}else f=l.activeRoutes;let m=[],p=[];if(n.forEach(g=>{let x=f.find(y=>vb(g,y));x?p.push({existingRoute:x,newRoute:g}):m.push(g)}),m.length>0){let g=Oo(m,o,[t||"_","patch",String((f==null?void 0:f.length)||"0")],s);f.push(...g)}if(u&&p.length>0)for(let g=0;g<p.length;g++){let{existingRoute:x,newRoute:y}=p[g],N=x,[S]=Oo([y],o,[],{},!0);Object.assign(N,{element:S.element?S.element:N.element,errorElement:S.errorElement?S.errorElement:N.errorElement,hydrateFallbackElement:S.hydrateFallbackElement?S.hydrateFallbackElement:N.hydrateFallbackElement})}l.hasHMRRoutes||l.setRoutes([...l.activeRoutes])}function vb(t,n){var l;return"id"in t&&"id"in n&&t.id===n.id?!0:t.index===n.index&&t.path===n.path&&t.caseSensitive===n.caseSensitive?(!t.children||t.children.length===0)&&(!n.children||n.children.length===0)?!0:((l=t.children)==null?void 0:l.every((s,o)=>{var u;return(u=n.children)==null?void 0:u.some(f=>vb(s,f))}))??!1:!1}var Vy=new WeakMap,yb=({key:t,route:n,manifest:l,mapRouteProperties:s})=>{let o=l[n.id];if(tt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let u=o.lazy[t];if(!u)return;let f=Vy.get(o);f||(f={},Vy.set(o,f));let m=f[t];if(m)return m;let p=(async()=>{let g=FS(t),y=o[t]!==void 0&&t!=="hasErrorBoundary";if(g)xa(!g,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),f[t]=Promise.resolve();else if(y)xa(!1,`Route "${o.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let N=await u();N!=null&&(Object.assign(o,{[t]:N}),Object.assign(o,s(o)))}typeof o.lazy=="object"&&(o.lazy[t]=void 0,Object.values(o.lazy).every(N=>N===void 0)&&(o.lazy=void 0))})();return f[t]=p,p},Yy=new WeakMap;function Aw(t,n,l,s,o){let u=l[t.id];if(tt(u,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let x=Yy.get(u);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let y=(async()=>{tt(typeof t.lazy=="function","No lazy route function found");let N=await t.lazy(),S={};for(let w in N){let A=N[w];if(A===void 0)continue;let R=GS(w),I=u[w]!==void 0&&w!=="hasErrorBoundary";R?xa(!R,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):I?xa(!I,`Route "${u.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):S[w]=A}Object.assign(u,S),Object.assign(u,{...s(u),lazy:void 0})})();return Yy.set(u,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let f=Object.keys(t.lazy),m=[],p;for(let x of f){if(o&&o.includes(x))continue;let y=yb({key:x,route:t,manifest:l,mapRouteProperties:s});y&&(m.push(y),x===n&&(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 Fy(t){let n=t.matches.filter(o=>o.shouldLoad),l={};return(await Promise.all(n.map(o=>o.resolve()))).forEach((o,u)=>{l[n[u].route.id]=o}),l}async function Dw(t){return t.matches.some(n=>n.route.middleware)?xb(t,()=>Fy(t)):Fy(t)}function xb(t,n){return kw(t,n,s=>{if(Fw(s))throw s;return s},qw,l);function l(s,o,u){if(u)return Promise.resolve(Object.assign(u.value,{[o]:{type:"error",result:s}}));{let{matches:f}=t,m=Math.min(Math.max(f.findIndex(g=>g.route.id===o),0),Math.max(f.findIndex(g=>g.shouldCallHandler()),0)),p=Ul(f,f[m].route.id).route.id;return Promise.resolve({[p]:{type:"error",result:s}})}}}async function kw(t,n,l,s,o){let{matches:u,...f}=t,m=u.flatMap(g=>g.route.middleware?g.route.middleware.map(x=>[g.route.id,x]):[]);return await bb(f,m,n,l,s,o)}async function bb(t,n,l,s,o,u,f=0){let{request:m}=t;if(m.signal.aborted)throw m.signal.reason??new Error(`Request aborted: ${m.method} ${m.url}`);let p=n[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 bb(t,n,l,s,o,u,f+1)},y.value}catch(S){return y={value:await u(S,g,y)},y.value}};try{let S=await x(t,N),w=S!=null?s(S):void 0;return o(w)?w:y?w??y.value:(y={value:await N()},y.value)}catch(S){return await u(S,g,y)}}function Sb(t,n,l,s,o){let u=yb({key:"middleware",route:s.route,manifest:n,mapRouteProperties:t}),f=Aw(s.route,on(l.method)?"action":"loader",n,t,o);return{middleware:u,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Vh(t,n,l,s,o,u,f,m,p,g=null,x){let y=!1,N=Sb(t,n,l,u,f);return{...u,_lazyPromises:N,shouldLoad:p,shouldRevalidateArgs:g,shouldCallHandler(S){return y=!0,g?typeof x=="boolean"?No(u,{...g,defaultShouldRevalidate:x}):typeof S=="boolean"?No(u,{...g,defaultShouldRevalidate:S}):No(u,g):p},resolve(S){let{lazy:w,loader:A,middleware:R}=u.route,L=y||p||S&&!on(l.method)&&(w||A),I=R&&R.length>0&&!A&&!w;return L&&(on(l.method)||!I)?Mw({request:l,path:s,pattern:o,match:u,lazyHandlerPromise:N==null?void 0:N.handler,lazyRoutePromise:N==null?void 0:N.route,handlerOverride:S,scopedContext:m}):Promise.resolve({type:"data",result:void 0})}}}function ci(t,n,l,s,o,u,f,m,p=null){return o.map(g=>g.route.id!==u.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:p,shouldCallHandler:()=>!1,_lazyPromises:Sb(t,n,l,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Vh(t,n,l,s,Bo(o),g,f,m,!0,p))}async function Ow(t,n,l,s,o,u,f){s.some(x=>{var y;return(y=x._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(s.map(x=>{var y;return(y=x._lazyPromises)==null?void 0:y.middleware}));let m={request:n,url:wb(n,l),pattern:Bo(s),params:s[0].params,context:u,matches:s},g=await t({...m,fetcherKey:o,runClientMiddleware:x=>{let y=m;return xb(y,()=>x({...y,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(x=>{var y,N;return[(y=x._lazyPromises)==null?void 0:y.handler,(N=x._lazyPromises)==null?void 0:N.route]}))}catch{}return g}async function Mw({request:t,path:n,pattern:l,match:s,lazyHandlerPromise:o,lazyRoutePromise:u,handlerOverride:f,scopedContext:m}){let p,g,x=on(t.method),y=x?"action":"loader",N=S=>{let w,A=new Promise((I,q)=>w=q);g=()=>w(),t.signal.addEventListener("abort",g);let R=I=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${s.route.id}]`)):S({request:t,url:wb(t,n),pattern:l,params:s.params,context:m},...I!==void 0?[I]:[]),L=(async()=>{try{return{type:"data",result:await(f?f(q=>R(q)):R())}}catch(I){return{type:"error",result:I}}})();return Promise.race([L,A])};try{let S=x?s.route.action:s.route.loader;if(o||u)if(S){let w,[A]=await Promise.all([N(S).catch(R=>{w=R}),o,u]);if(w!==void 0)throw w;p=A}else{await o;let w=x?s.route.action:s.route.loader;if(w)[p]=await Promise.all([N(w),u]);else if(y==="action"){let A=new URL(t.url),R=A.pathname+A.search;throw Kn(405,{method:t.method,pathname:R,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(S)p=await N(S);else{let w=new URL(t.url),A=w.pathname+w.search;throw Kn(404,{pathname:A})}}catch(S){return{type:"error",result:S}}finally{g&&t.signal.removeEventListener("abort",g)}return p}async function _w(t){let n=t.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?t.body==null?null:t.json():t.text()}async function Lw(t){var s,o,u,f,m;let{result:n,type:l}=t;if(im(n)){let p;try{p=await _w(n)}catch(g){return{type:"error",error:g}}return l==="error"?{type:"error",error:new Uo(n.status,n.statusText,p),statusCode:n.status,headers:n.headers}:{type:"data",data:p,statusCode:n.status,headers:n.headers}}return l==="error"?Zy(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:(s=n.init)==null?void 0:s.status,headers:(o=n.init)!=null&&o.headers?new Headers(n.init.headers):void 0}:{type:"error",error:$w(n),statusCode:fi(n)?n.status:void 0,headers:(u=n.init)!=null&&u.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:fi(n)?n.status:void 0}:Zy(n)?{type:"data",data:n.data,statusCode:(f=n.init)==null?void 0:f.status,headers:(m=n.init)!=null&&m.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function zw(t,n,l,s,o){let u=t.headers.get("Location");if(tt(u,"Redirects returned/thrown from loaders/actions must have a Location header"),!nm(u)){let f=s.slice(0,s.findIndex(m=>m.route.id===l)+1);u=Ih(new URL(n.url),f,o,u),t.headers.set("Location",u)}return t}var Uw=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Yh(t){try{return Uw.includes(new URL(t).protocol)}catch{return!1}}function Py(t,n,l,s){if(nm(t)){let o=t,u=am.test(o)?new URL(eb(o,n.protocol)):new URL(o);if(Yh(u.toString()))throw new Error("Invalid redirect location");let f=Wn(u.pathname,l)!=null;if(u.origin===n.origin&&f)return lm(u.pathname)+u.search+u.hash}try{let o=s.createURL(t);if(Yh(o.toString()))throw new Error("Invalid redirect location")}catch{}return t}function ii(t,n,l,s){let o=t.createURL(Eb(n)).toString(),u={signal:l};if(s&&on(s.formMethod)){let{formMethod:f,formEncType:m}=s;u.method=f.toUpperCase(),m==="application/json"?(u.headers=new Headers({"Content-Type":m}),u.body=JSON.stringify(s.json)):m==="text/plain"?u.body=s.text:m==="application/x-www-form-urlencoded"&&s.formData?u.body=Fh(s.formData):u.body=s.formData}return new Request(o,u)}function wb(t,n){let l=new URL(t.url),s=typeof n=="string"?Dr(n):n;if(l.pathname=s.pathname||"/",s.search){let o=new URLSearchParams(s.search),u=o.getAll("index");o.delete("index");for(let f of u.filter(Boolean))o.append("index",f);l.search=o.size?`?${o.toString()}`:""}else l.search="";return l.hash=s.hash||"",l}function Fh(t){let n=new URLSearchParams;for(let[l,s]of t.entries())n.append(l,typeof s=="string"?s:s.name);return n}function Gy(t){let n=new FormData;for(let[l,s]of t.entries())n.append(l,s);return n}function Bw(t,n,l,s=!1,o=!1){let u={},f=null,m,p=!1,g={},x=l&&Ln(l[1])?l[1].error:void 0;return t.forEach(y=>{if(!(y.route.id in n))return;let N=y.route.id,S=n[N];if(tt(!hs(S),"Cannot handle redirect results in processLoaderData"),Ln(S)){let w=S.error;if(x!==void 0&&(w=x,x=void 0),f=f||{},o)f[N]=w;else{let A=Ul(t,N);f[A.route.id]==null&&(f[A.route.id]=w)}s||(u[N]=pb),p||(p=!0,m=fi(S.error)?S.error.status:500),S.headers&&(g[N]=S.headers)}else u[N]=S.data,S.statusCode&&S.statusCode!==200&&!p&&(m=S.statusCode),S.headers&&(g[N]=S.headers)}),x!==void 0&&l&&(f={[l[0]]:x},l[2]&&(u[l[2]]=void 0)),{loaderData:u,errors:f,statusCode:m||200,loaderHeaders:g}}function Xy(t,n,l,s,o,u,f){let{loaderData:m,errors:p}=Bw(n,l,s);return o.filter(g=>!g.matches||g.matches.some(x=>x.shouldLoad)).forEach(g=>{let{key:x,match:y,controller:N}=g;if(N&&N.signal.aborted)return;let S=u[x];if(tt(S,"Did not find corresponding fetcher result"),Ln(S)){let w=Ul(t.matches,y==null?void 0:y.route.id);p&&p[w.route.id]||(p={...p,[w.route.id]:S.error}),f.delete(x)}else if(hs(S))tt(!1,"Unhandled fetcher revalidation redirect");else{let w=jr(S.data);f.set(x,w)}}),{loaderData:m,errors:p}}function Qy(t,n,l,s){let o=Object.entries(n).filter(([,u])=>u!==pb).reduce((u,[f,m])=>(u[f]=m,u),{});for(let u of l){let f=u.route.id;if(!n.hasOwnProperty(f)&&t.hasOwnProperty(f)&&u.route.loader&&(o[f]=t[f]),s&&s.hasOwnProperty(f))break}return o}function Ky(t){return t?Ln(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Ul(t,n){return(n?t.slice(0,t.findIndex(s=>s.route.id===n)+1):[...t]).reverse().find(s=>s.route.hasErrorBoundary===!0)||t[0]}function oc(t){let n=t.length===1?t[0]:t.find(l=>l.index||!l.path||l.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function Kn(t,{pathname:n,routeId:l,method:s,type:o,message:u}={}){let f="Unknown Server Error",m="Unknown @remix-run/router error";return t===400?(f="Bad Request",s&&n&&l?m=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${l}", so there is no way to handle the request.`:o==="invalid-body"&&(m="Unable to encode submission body")):t===403?(f="Forbidden",m=`Route "${l}" does not match URL "${n}"`):t===404?(f="Not Found",m=`No route matches URL "${n}"`):t===405&&(f="Method Not Allowed",s&&n&&l?m=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${l}", so there is no way to handle the request.`:s&&(m=`Invalid request method "${s.toUpperCase()}"`)),new Uo(t||500,f,new Error(m),!0)}function uc(t){let n=Object.entries(t);for(let l=n.length-1;l>=0;l--){let[s,o]=n[l];if(hs(o))return{key:s,result:o}}}function Eb(t){let n=typeof t=="string"?Dr(t):t;return Ar({...n,hash:""})}function Hw(t,n){return t.pathname!==n.pathname||t.search!==n.search?!1:t.hash===""?n.hash!=="":t.hash===n.hash?!0:n.hash!==""}function $w(t){var n,l;return new Uo(((n=t.init)==null?void 0:n.status)??500,((l=t.init)==null?void 0:l.statusText)??"Internal Server Error",t.data)}function qw(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([n,l])=>typeof n=="string"&&Iw(l))}function Iw(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function Vw(t){return im(t.result)&&fb.has(t.result.status)}function Ln(t){return t.type==="error"}function hs(t){return(t&&t.type)==="redirect"}function Zy(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function im(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function Yw(t){return fb.has(t)}function Fw(t){return im(t)&&Yw(t.status)&&t.headers.has("Location")}function Pw(t){return Sw.has(t.toUpperCase())}function on(t){return xw.has(t.toUpperCase())}function om(t){return new URLSearchParams(t).getAll("index").some(n=>n==="")}function Sc(t,n){let l=typeof n=="string"?Dr(n).search:n.search;if(t[t.length-1].route.index&&om(l||""))return t[t.length-1];let s=ib(t);return s[s.length-1]}function Jy(t){let{formMethod:n,formAction:l,formEncType:s,text:o,formData:u,json:f}=t;if(!(!n||!l||!s)){if(o!=null)return{formMethod:n,formAction:l,formEncType:s,formData:void 0,json:void 0,text:o};if(u!=null)return{formMethod:n,formAction:l,formEncType:s,formData:u,json:void 0,text:void 0};if(f!==void 0)return{formMethod:n,formAction:l,formEncType:s,formData:void 0,json:f,text:void 0}}}function yh(t,n,l,s){return s?{state:"loading",location:t,matches:n,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:n,historyAction:l,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Gw(t,n,l,s){return{state:"submitting",location:t,matches:n,historyAction:l,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}}function fo(t,n){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function Xw(t,n){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:n?n.data:void 0}}function jr(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Qw(t,n){try{let l=t.sessionStorage.getItem(mb);if(l){let s=JSON.parse(l);for(let[o,u]of Object.entries(s||{}))u&&Array.isArray(u)&&n.set(o,new Set(u||[]))}}catch{}}function Kw(t,n){if(n.size>0){let l={};for(let[s,o]of n)l[s]=[...o];try{t.sessionStorage.setItem(mb,JSON.stringify(l))}catch(s){xa(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function Wy(){let t,n,l=new Promise((s,o)=>{t=async u=>{s(u);try{await l}catch{}},n=async u=>{o(u);try{await l}catch{}}});return{promise:l,resolve:t,reject:n}}var vs=v.createContext(null);vs.displayName="DataRouter";var mi=v.createContext(null);mi.displayName="DataRouterState";var Nb=v.createContext(!1);function Rb(){return v.useContext(Nb)}var um=v.createContext({isTransitioning:!1});um.displayName="ViewTransition";var cm=v.createContext(new Map);cm.displayName="Fetchers";var Zw=v.createContext(null);Zw.displayName="Await";var er=v.createContext(null);er.displayName="Navigation";var Vc=v.createContext(null);Vc.displayName="Location";var tr=v.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName="Route";var dm=v.createContext(null);dm.displayName="RouteError";var jb="REACT_ROUTER_ERROR",Jw="REDIRECT",Ww="ROUTE_ERROR_RESPONSE";function eE(t){if(t.startsWith(`${jb}:${Jw}:{`))try{let n=JSON.parse(t.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function tE(t){if(t.startsWith(`${jb}:${Ww}:{`))try{let n=JSON.parse(t.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Uo(n.status,n.statusText,n.data)}catch{}}function aE(t,{relative:n}={}){tt(Ho(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:s}=v.useContext(er),{hash:o,pathname:u,search:f}=$o(t,{relative:n}),m=u;return l!=="/"&&(m=u==="/"?l:Jn([l,u])),s.createHref({pathname:m,search:f,hash:o})}function Ho(){return v.useContext(Vc)!=null}function hr(){return tt(Ho(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Vc).location}var Tb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cb(t){v.useContext(er).static||v.useLayoutEffect(t)}function kr(){let{isDataRoute:t}=v.useContext(tr);return t?gE():nE()}function nE(){tt(Ho(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(vs),{basename:n,navigator:l}=v.useContext(er),{matches:s}=v.useContext(tr),{pathname:o}=hr(),u=JSON.stringify(rm(s)),f=v.useRef(!1);return Cb(()=>{f.current=!0}),v.useCallback((p,g={})=>{if(xa(f.current,Tb),!f.current)return;if(typeof p=="number"){l.go(p);return}let x=Ic(p,JSON.parse(u),o,g.relative==="path");t==null&&n!=="/"&&(x.pathname=x.pathname==="/"?n:Jn([n,x.pathname])),(g.replace?l.replace:l.push)(x,g.state,g)},[n,l,u,o,t])}var rE=v.createContext(null);function lE(t){let n=v.useContext(tr).outlet;return v.useMemo(()=>n&&v.createElement(rE.Provider,{value:t},n),[n,t])}function sE(){let{matches:t}=v.useContext(tr),n=t[t.length-1];return(n==null?void 0:n.params)??{}}function $o(t,{relative:n}={}){let{matches:l}=v.useContext(tr),{pathname:s}=hr(),o=JSON.stringify(rm(l));return v.useMemo(()=>Ic(t,JSON.parse(o),s,n==="path"),[t,o,s,n])}function iE(t,n,l){tt(Ho(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=v.useContext(er),{matches:o}=v.useContext(tr),u=o[o.length-1],f=u?u.params:{},m=u?u.pathname:"/",p=u?u.pathnameBase:"/",g=u&&u.route;{let R=g&&g.path||"";Ob(m,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=hr(),y;y=x;let N=y.pathname||"/",S=N;if(p!=="/"){let R=p.replace(/^\//,"").split("/");S="/"+N.replace(/^\//,"").split("/").slice(R.length).join("/")}let w=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):ab(t,{pathname:S});return xa(g||w!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),xa(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.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.`),fE(w&&w.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Jn([p,s.encodeLocation?s.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?p:Jn([p,s.encodeLocation?s.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),o,l)}function oE(){let t=kb(),n=fi(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),l=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:u},"ErrorBoundary")," or"," ",v.createElement("code",{style:u},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},n),l?v.createElement("pre",{style:o},l):null,f)}var uE=v.createElement(oE,null),Ab=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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){this.props.onError?this.props.onError(t,n):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=tE(t.digest);l&&(t=l)}let n=t!==void 0?v.createElement(tr.Provider,{value:this.props.routeContext},v.createElement(dm.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(cE,{error:t},n):n}};Ab.contextType=Nb;var xh=new WeakMap;function cE({children:t,error:n}){let{basename:l}=v.useContext(er);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=eE(n.digest);if(s){let o=xh.get(n);if(o)throw o;let u=ub(s.location,l),f=u.absoluteURL||u.to;if(Yh(f))throw new Error("Invalid redirect location");if(ob&&!xh.get(n))if(u.isExternal||s.reloadDocument)window.location.href=f;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:s.replace}));throw xh.set(n,m),m}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return t}function dE({routeContext:t,match:n,children:l}){let s=v.useContext(vs);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(tr.Provider,{value:t},l)}function fE(t,n=[],l){let s=l==null?void 0:l.state;if(t==null){if(!s)return null;if(s.errors)t=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let o=t,u=s==null?void 0:s.errors;if(u!=null){let x=o.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);tt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,x+1))}let f=!1,m=-1;if(l&&s){f=s.renderFallback;for(let x=0;x<o.length;x++){let y=o[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(m=x),y.route.id){let{loaderData:N,errors:S}=s,w=y.route.loader&&!N.hasOwnProperty(y.route.id)&&(!S||S[y.route.id]===void 0);if(y.route.lazy||w){l.isStatic&&(f=!0),m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}}let p=l==null?void 0:l.onError,g=s&&p?(x,y)=>{var N,S;p(x,{location:s.location,params:((S=(N=s.matches)==null?void 0:N[0])==null?void 0:S.params)??{},pattern:Bo(s.matches),errorInfo:y})}:void 0;return o.reduceRight((x,y,N)=>{let S,w=!1,A=null,R=null;s&&(S=u&&y.route.id?u[y.route.id]:void 0,A=y.route.errorElement||uE,f&&(m<0&&N===0?(Ob("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):m===N&&(w=!0,R=y.route.hydrateFallbackElement||null)));let L=n.concat(o.slice(0,N+1)),I=()=>{let q;return S?q=A:w?q=R:y.route.Component?q=v.createElement(y.route.Component,null):y.route.element?q=y.route.element:q=x,v.createElement(dE,{match:y,routeContext:{outlet:x,matches:L,isDataRoute:s!=null},children:q})};return s&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?v.createElement(Ab,{location:s.location,revalidation:s.revalidation,component:A,error:S,children:I(),routeContext:{outlet:null,matches:L,isDataRoute:!0},onError:g}):I()},null)}function fm(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Db(t){let n=v.useContext(vs);return tt(n,fm(t)),n}function qo(t){let n=v.useContext(mi);return tt(n,fm(t)),n}function hE(t){let n=v.useContext(tr);return tt(n,fm(t)),n}function Yc(t){let n=hE(t),l=n.matches[n.matches.length-1];return tt(l.route.id,`${t} can only be used on routes that contain a unique "id"`),l.route.id}function mE(){return Yc("useRouteId")}function Or(){let t=qo("useNavigation");return v.useMemo(()=>{let{matches:n,historyAction:l,...s}=t.navigation;return s},[t.navigation])}function pE(){let t=Db("useRevalidator"),n=qo("useRevalidator"),l=v.useCallback(async()=>{await t.router.revalidate()},[t.router]);return v.useMemo(()=>({revalidate:l,state:n.revalidation}),[l,n.revalidation])}function sl(){let t=qo("useLoaderData"),n=Yc("useLoaderData");return t.loaderData[n]}function ys(t){return qo("useRouteLoaderData").loaderData[t]}function kb(){var s;let t=v.useContext(dm),n=qo("useRouteError"),l=Yc("useRouteError");return t!==void 0?t:(s=n.errors)==null?void 0:s[l]}function gE(){let{router:t}=Db("useNavigate"),n=Yc("useNavigate"),l=v.useRef(!1);return Cb(()=>{l.current=!0}),v.useCallback(async(o,u={})=>{xa(l.current,Tb),l.current&&(typeof o=="number"?await t.navigate(o):await t.navigate(o,{fromRouteId:n,...u}))},[t,n])}var ex={};function Ob(t,n,l){!n&&!ex[t]&&(ex[t]=!0,xa(!1,l))}var tx={};function ax(t,n){!t&&!tx[n]&&(tx[n]=!0,console.warn(n))}var vE="useOptimistic",nx=_S[vE],yE=()=>{};function xE(t){return nx?nx(t):[t,yE]}function bE(t){let n={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&xa(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:v.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&xa(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:v.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&xa(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:v.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),n}var SE=["HydrateFallback","hydrateFallbackElement"],wE=class{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=l=>{this.status==="pending"&&(this.status="resolved",t(l))},this.reject=l=>{this.status==="pending"&&(this.status="rejected",n(l))}})}};function EE({router:t,flushSync:n,onError:l,useTransitions:s}){s=Rb()||s;let[u,f]=v.useState(t.state),[m,p]=xE(u),[g,x]=v.useState(),[y,N]=v.useState({isTransitioning:!1}),[S,w]=v.useState(),[A,R]=v.useState(),[L,I]=v.useState(),q=v.useRef(new Map),X=v.useCallback((T,{deletedFetchers:ee,newErrors:fe,flushSync:be,viewTransitionOpts:ye})=>{fe&&l&&Object.values(fe).forEach(re=>{var ge;return l(re,{location:T.location,params:((ge=T.matches[0])==null?void 0:ge.params)??{},pattern:Bo(T.matches)})}),T.fetchers.forEach((re,ge)=>{re.data!==void 0&&q.current.set(ge,re.data)}),ee.forEach(re=>q.current.delete(re)),ax(be===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let te=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(ax(ye==null||te,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!ye||!te){n&&be?n(()=>f(T)):s===!1?f(T):v.startTransition(()=>{s===!0&&p(re=>rx(re,T)),f(T)});return}if(n&&be){n(()=>{A&&(S==null||S.resolve(),A.skipTransition()),N({isTransitioning:!0,flushSync:!0,currentLocation:ye.currentLocation,nextLocation:ye.nextLocation})});let re=t.window.document.startViewTransition(()=>{n(()=>f(T))});re.finished.finally(()=>{n(()=>{w(void 0),R(void 0),x(void 0),N({isTransitioning:!1})})}),n(()=>R(re));return}A?(S==null||S.resolve(),A.skipTransition(),I({state:T,currentLocation:ye.currentLocation,nextLocation:ye.nextLocation})):(x(T),N({isTransitioning:!0,flushSync:!1,currentLocation:ye.currentLocation,nextLocation:ye.nextLocation}))},[t.window,n,A,S,s,p,l]);v.useLayoutEffect(()=>t.subscribe(X),[t,X]),v.useEffect(()=>{y.isTransitioning&&!y.flushSync&&w(new wE)},[y]),v.useEffect(()=>{if(S&&g&&t.window){let T=g,ee=S.promise,fe=t.window.document.startViewTransition(async()=>{s===!1?f(T):v.startTransition(()=>{s===!0&&p(be=>rx(be,T)),f(T)}),await ee});fe.finished.finally(()=>{w(void 0),R(void 0),x(void 0),N({isTransitioning:!1})}),R(fe)}},[g,S,t.window,s,p]),v.useEffect(()=>{S&&g&&m.location.key===g.location.key&&S.resolve()},[S,A,m.location,g]),v.useEffect(()=>{!y.isTransitioning&&L&&(x(L.state),N({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}),I(void 0))},[y.isTransitioning,L]);let W=v.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:T=>t.navigate(T),push:(T,ee,fe)=>t.navigate(T,{state:ee,preventScrollReset:fe==null?void 0:fe.preventScrollReset}),replace:(T,ee,fe)=>t.navigate(T,{replace:!0,state:ee,preventScrollReset:fe==null?void 0:fe.preventScrollReset})}),[t]),ne=t.basename||"/",z=v.useMemo(()=>({router:t,navigator:W,static:!1,basename:ne,onError:l}),[t,W,ne,l]);return v.createElement(v.Fragment,null,v.createElement(vs.Provider,{value:z},v.createElement(mi.Provider,{value:m},v.createElement(cm.Provider,{value:q.current},v.createElement(um.Provider,{value:y},v.createElement(jE,{basename:ne,location:m.location,navigationType:m.historyAction,navigator:W,useTransitions:s},v.createElement(NE,{routes:t.routes,manifest:t.manifest,future:t.future,state:m,isStatic:!1,onError:l})))))),null)}function rx(t,n){return{...t,navigation:n.navigation.state!=="idle"?n.navigation:t.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:t.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:t.actionData,fetchers:n.fetchers}}var NE=v.memo(RE);function RE({routes:t,manifest:n,future:l,state:s,isStatic:o,onError:u}){return iE(t,void 0,{manifest:n,state:s,isStatic:o,onError:u})}function pi(t){return lE(t.context)}function jE({basename:t="/",children:n=null,location:l,navigationType:s="POP",navigator:o,static:u=!1,useTransitions:f}){tt(!Ho(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=t.replace(/^\/*/,"/"),p=v.useMemo(()=>({basename:m,navigator:o,static:u,useTransitions:f,future:{}}),[m,o,u,f]);typeof l=="string"&&(l=Dr(l));let{pathname:g="/",search:x="",hash:y="",state:N=null,key:S="default",mask:w}=l,A=v.useMemo(()=>{let R=Wn(g,m);return R==null?null:{location:{pathname:R,search:x,hash:y,state:N,key:S,mask:w},navigationType:s}},[m,g,x,y,N,S,s,w]);return xa(A!=null,`<Router basename="${m}"> is not able to match the URL "${g}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:v.createElement(er.Provider,{value:p},v.createElement(Vc.Provider,{children:n,value:A}))}var wc="get",Ec="application/x-www-form-urlencoded";function Fc(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function TE(t){return Fc(t)&&t.tagName.toLowerCase()==="button"}function CE(t){return Fc(t)&&t.tagName.toLowerCase()==="form"}function AE(t){return Fc(t)&&t.tagName.toLowerCase()==="input"}function DE(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function kE(t,n){return t.button===0&&(!n||n==="_self")&&!DE(t)}function Ph(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((n,l)=>{let s=t[l];return n.concat(Array.isArray(s)?s.map(o=>[l,o]):[[l,s]])},[]))}function OE(t,n){let l=Ph(t);return n&&n.forEach((s,o)=>{l.has(o)||n.getAll(o).forEach(u=>{l.append(o,u)})}),l}var cc=null;function ME(){if(cc===null)try{new FormData(document.createElement("form"),0),cc=!1}catch{cc=!0}return cc}var _E=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function bh(t){return t!=null&&!_E.has(t)?(xa(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ec}"`),null):t}function LE(t,n){let l,s,o,u,f;if(CE(t)){let m=t.getAttribute("action");s=m?Wn(m,n):null,l=t.getAttribute("method")||wc,o=bh(t.getAttribute("enctype"))||Ec,u=new FormData(t)}else if(TE(t)||AE(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?Wn(p,n):null,l=t.getAttribute("formmethod")||m.getAttribute("method")||wc,o=bh(t.getAttribute("formenctype"))||bh(m.getAttribute("enctype"))||Ec,u=new FormData(m,t),!ME()){let{name:g,type:x,value:y}=t;if(x==="image"){let N=g?`${g}.`:"";u.append(`${N}x`,"0"),u.append(`${N}y`,"0")}else g&&u.append(g,y)}}else{if(Fc(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=wc,s=null,o=Ec,f=t}return u&&o==="text/plain"&&(f=u,u=void 0),{action:s,method:l.toLowerCase(),encType:o,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function hm(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function Mb(t,n,l,s){let o=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return l?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:n&&Wn(o.pathname,n)==="/"?o.pathname=`${Ac(n)}/_root.${s}`:o.pathname=`${Ac(o.pathname)}.${s}`,o}async function zE(t,n){if(t.id in n)return n[t.id];try{let l=await import(t.module);return n[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 UE(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 BE(t,n,l){let s=await Promise.all(t.map(async o=>{let u=n.routes[o.route.id];if(u){let f=await zE(u,l);return f.links?f.links():[]}return[]}));return IE(s.flat(1).filter(UE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function lx(t,n,l,s,o,u){let f=(p,g)=>l[g]?p.route.id!==l[g].route.id:!0,m=(p,g)=>{var x;return l[g].pathname!==p.pathname||((x=l[g].route.path)==null?void 0:x.endsWith("*"))&&l[g].params["*"]!==p.params["*"]};return u==="assets"?n.filter((p,g)=>f(p,g)||m(p,g)):u==="data"?n.filter((p,g)=>{var y;let x=s.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(f(p,g)||m(p,g))return!0;if(p.route.shouldRevalidate){let N=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof N=="boolean")return N}return!0}):[]}function HE(t,n,{includeHydrateFallback:l}={}){return $E(t.map(s=>{let o=n.routes[s.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),l&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function $E(t){return[...new Set(t)]}function qE(t){let n={},l=Object.keys(t).sort();for(let s of l)n[s]=t[s];return n}function IE(t,n){let l=new Set;return new Set(n),t.reduce((s,o)=>{let u=JSON.stringify(qE(o));return l.has(u)||(l.add(u),s.push({key:u,link:o})),s},[])}function mm(){let t=v.useContext(vs);return hm(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function VE(){let t=v.useContext(mi);return hm(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var pm=v.createContext(void 0);pm.displayName="FrameworkContext";function Pc(){let t=v.useContext(pm);return hm(t,"You must render this element inside a <HydratedRouter> element"),t}function YE(t,n){let l=v.useContext(pm),[s,o]=v.useState(!1),[u,f]=v.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:g,onMouseLeave:x,onTouchStart:y}=n,N=v.useRef(null);v.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let A=L=>{L.forEach(I=>{f(I.isIntersecting)})},R=new IntersectionObserver(A,{threshold:.5});return N.current&&R.observe(N.current),()=>{R.disconnect()}}},[t]),v.useEffect(()=>{if(s){let A=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(A)}}},[s]);let S=()=>{o(!0)},w=()=>{o(!1),f(!1)};return l?t!=="intent"?[u,N,{}]:[u,N,{onFocus:ho(m,S),onBlur:ho(p,w),onMouseEnter:ho(g,S),onMouseLeave:ho(x,w),onTouchStart:ho(y,S)}]:[!1,N,{}]}function ho(t,n){return l=>{t&&t(l),l.defaultPrevented||n(l)}}function FE({page:t,...n}){let l=Rb(),{nonce:s}=Pc(),{router:o}=mm(),u=v.useMemo(()=>ab(o.routes,t,o.basename),[o.routes,t,o.basename]);return u?(n.nonce==null&&s&&(n={...n,nonce:s}),l?v.createElement(GE,{page:t,matches:u,...n}):v.createElement(XE,{page:t,matches:u,...n})):null}function PE(t){let{manifest:n,routeModules:l}=Pc(),[s,o]=v.useState([]);return v.useEffect(()=>{let u=!1;return BE(t,n,l).then(f=>{u||o(f)}),()=>{u=!0}},[t,n,l]),s}function GE({page:t,matches:n,...l}){let s=hr(),{future:o}=Pc(),{basename:u}=mm(),f=v.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let m=Mb(t,u,o.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,g=[];for(let x of n)typeof x.route.shouldRevalidate=="function"?p=!0:g.push(x.route.id);return p&&g.length>0&&m.searchParams.set("_routes",g.join(",")),[m.pathname+m.search]},[u,o.v8_trailingSlashAwareDataRequests,t,s,n]);return v.createElement(v.Fragment,null,f.map(m=>v.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...l})))}function XE({page:t,matches:n,...l}){let s=hr(),{future:o,manifest:u,routeModules:f}=Pc(),{basename:m}=mm(),{loaderData:p,matches:g}=VE(),x=v.useMemo(()=>lx(t,n,g,u,s,"data"),[t,n,g,u,s]),y=v.useMemo(()=>lx(t,n,g,u,s,"assets"),[t,n,g,u,s]),N=v.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let A=new Set,R=!1;if(n.forEach(I=>{var X;let q=u.routes[I.route.id];!q||!q.hasLoader||(!x.some(W=>W.route.id===I.route.id)&&I.route.id in p&&((X=f[I.route.id])!=null&&X.shouldRevalidate)||q.hasClientLoader?R=!0:A.add(I.route.id))}),A.size===0)return[];let L=Mb(t,m,o.v8_trailingSlashAwareDataRequests,"data");return R&&A.size>0&&L.searchParams.set("_routes",n.filter(I=>A.has(I.route.id)).map(I=>I.route.id).join(",")),[L.pathname+L.search]},[m,o.v8_trailingSlashAwareDataRequests,p,s,u,x,n,t,f]),S=v.useMemo(()=>HE(y,u),[y,u]),w=PE(y);return v.createElement(v.Fragment,null,N.map(A=>v.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...l})),S.map(A=>v.createElement("link",{key:A,rel:"modulepreload",href:A,...l})),w.map(({key:A,link:R})=>v.createElement("link",{key:A,nonce:l.nonce,...R,crossOrigin:R.crossOrigin??l.crossOrigin})))}function QE(...t){return n=>{t.forEach(l=>{typeof l=="function"?l(n):l!=null&&(l.current=n)})}}var KE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{KE&&(window.__reactRouterVersion="7.18.0")}catch{}function ZE(t,n){return Rw({basename:n==null?void 0:n.basename,getContext:n==null?void 0:n.getContext,future:n==null?void 0:n.future,history:qS({window:n==null?void 0:n.window}),hydrationData:JE(),routes:t,mapRouteProperties:bE,hydrationRouteProperties:SE,dataStrategy:n==null?void 0:n.dataStrategy,patchRoutesOnNavigation:n==null?void 0:n.patchRoutesOnNavigation,window:n==null?void 0:n.window,instrumentations:n==null?void 0:n.instrumentations}).initialize()}function JE(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:WE(t.errors)}),t}function WE(t){if(!t)return null;let n=Object.entries(t),l={};for(let[s,o]of n)if(o&&o.__type==="RouteErrorResponse")l[s]=new Uo(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&fw.includes(o.__subType)){let u=window[o.__subType];if(typeof u=="function")try{let f=new u(o.message);f.stack="",l[s]=f}catch{}}if(l[s]==null){let u=new Error(o.message);u.stack="",l[s]=u}}else l[s]=o;return l}var Ye=v.forwardRef(function({onClick:n,discover:l="render",prefetch:s="none",relative:o,reloadDocument:u,replace:f,mask:m,state:p,target:g,to:x,preventScrollReset:y,viewTransition:N,defaultShouldRevalidate:S,...w},A){let{basename:R,navigator:L,useTransitions:I}=v.useContext(er),q=typeof x=="string"&&qc.test(x),X=ub(x,R);x=X.to;let W=aE(x,{relative:o}),ne=hr(),z=null;if(m){let ge=Ic(m,[],ne.mask?ne.mask.pathname:"/",!0);R!=="/"&&(ge.pathname=ge.pathname==="/"?R:Jn([R,ge.pathname])),z=L.createHref(ge)}let[T,ee,fe]=YE(s,w),be=tN(x,{replace:f,mask:m,state:p,target:g,preventScrollReset:y,relative:o,viewTransition:N,defaultShouldRevalidate:S,useTransitions:I});function ye(ge){n&&n(ge),ge.defaultPrevented||be(ge)}let te=!(X.isExternal||u),re=v.createElement("a",{...w,...fe,href:(te?z:void 0)||X.absoluteURL||W,onClick:te?ye:n,ref:QE(A,ee),target:g,"data-discover":!q&&l==="render"?"true":void 0});return T&&!q?v.createElement(v.Fragment,null,re,v.createElement(FE,{page:W})):re});Ye.displayName="Link";var _b=v.forwardRef(function({"aria-current":n="page",caseSensitive:l=!1,className:s="",end:o=!1,style:u,to:f,viewTransition:m,children:p,...g},x){let y=$o(f,{relative:g.relative}),N=hr(),S=v.useContext(mi),{navigator:w,basename:A}=v.useContext(er),R=S!=null&&lN(y)&&m===!0,L=w.encodeLocation?w.encodeLocation(y).pathname:y.pathname,I=N.pathname,q=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;l||(I=I.toLowerCase(),q=q?q.toLowerCase():null,L=L.toLowerCase()),q&&A&&(q=Wn(q,A)||q);const X=L!=="/"&&L.endsWith("/")?L.length-1:L.length;let W=I===L||!o&&I.startsWith(L)&&I.charAt(X)==="/",ne=q!=null&&(q===L||!o&&q.startsWith(L)&&q.charAt(L.length)==="/"),z={isActive:W,isPending:ne,isTransitioning:R},T=W?n:void 0,ee;typeof s=="function"?ee=s(z):ee=[s,W?"active":null,ne?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let fe=typeof u=="function"?u(z):u;return v.createElement(Ye,{...g,"aria-current":T,className:ee,ref:x,style:fe,to:f,viewTransition:m},typeof p=="function"?p(z):p)});_b.displayName="NavLink";var cn=v.forwardRef(({discover:t="render",fetcherKey:n,navigate:l,reloadDocument:s,replace:o,state:u,method:f=wc,action:m,onSubmit:p,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:N,...S},w)=>{let{useTransitions:A}=v.useContext(er),R=vm(),L=rN(m,{relative:g}),I=f.toLowerCase()==="get"?"get":"post",q=typeof m=="string"&&qc.test(m),X=W=>{if(p&&p(W),W.defaultPrevented)return;W.preventDefault();let ne=W.nativeEvent.submitter,z=(ne==null?void 0:ne.getAttribute("formmethod"))||f,T=()=>R(ne||W.currentTarget,{fetcherKey:n,method:z,navigate:l,replace:o,state:u,relative:g,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:N});A&&l!==!1?v.startTransition(()=>T()):T()};return v.createElement("form",{ref:w,method:I,action:L,onSubmit:s?p:X,...S,"data-discover":!q&&t==="render"?"true":void 0})});cn.displayName="Form";function Lb(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gm(t){let n=v.useContext(vs);return tt(n,Lb(t)),n}function eN(t){let n=v.useContext(mi);return tt(n,Lb(t)),n}function tN(t,{target:n,replace:l,mask:s,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p,useTransitions:g}={}){let x=kr(),y=hr(),N=$o(t,{relative:f});return v.useCallback(S=>{if(kE(S,n)){S.preventDefault();let w=l!==void 0?l:Ar(y)===Ar(N),A=()=>x(t,{replace:w,mask:s,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p});g?v.startTransition(()=>A()):A()}},[y,x,N,l,s,o,n,t,u,f,m,p,g])}function Io(t){xa(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 n=v.useRef(Ph(t)),l=v.useRef(!1),s=hr(),o=v.useMemo(()=>OE(s.search,l.current?null:n.current),[s.search]),u=kr(),f=v.useCallback((m,p)=>{const g=Ph(typeof m=="function"?m(new URLSearchParams(o)):m);l.current=!0,u("?"+g,p)},[u,o]);return[o,f]}var aN=0,nN=()=>`__${String(++aN)}__`;function vm(){let{router:t}=gm("useSubmit"),{basename:n}=v.useContext(er),l=mE(),s=t.fetch,o=t.navigate;return v.useCallback(async(u,f={})=>{let{action:m,method:p,encType:g,formData:x,body:y}=LE(u,n);if(f.navigate===!1){let N=f.fetcherKey||nN();await s(N,l,f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||p,formEncType:f.encType||g,flushSync:f.flushSync})}else await o(f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||p,formEncType:f.encType||g,replace:f.replace,state:f.state,fromRouteId:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[s,o,n,l])}function rN(t,{relative:n}={}){let{basename:l}=v.useContext(er),s=v.useContext(tr);tt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),u={...$o(t||".",{relative:n})},f=hr();if(t==null){u.search=f.search;let m=new URLSearchParams(u.search),p=m.getAll("index");if(p.some(x=>x==="")){m.delete("index"),p.filter(y=>y).forEach(y=>m.append("index",y));let x=m.toString();u.search=x?`?${x}`:""}}return(!t||t===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(u.pathname=u.pathname==="/"?l:Jn([l,u.pathname])),Ar(u)}function ps({key:t}={}){var W;let{router:n}=gm("useFetcher"),l=eN("useFetcher"),s=v.useContext(cm),o=v.useContext(tr),u=(W=o.matches[o.matches.length-1])==null?void 0:W.route.id;tt(s,"useFetcher must be used inside a FetchersContext"),tt(o,"useFetcher must be used inside a RouteContext"),tt(u!=null,'useFetcher can only be used on routes that contain a unique "id"');let f=v.useId(),[m,p]=v.useState(t||f);t&&t!==m&&p(t);let{deleteFetcher:g,getFetcher:x,resetFetcher:y,fetch:N}=n;v.useEffect(()=>(x(m),()=>g(m)),[g,x,m]);let S=v.useCallback(async(ne,z)=>{tt(u,"No routeId available for fetcher.load()"),await N(m,u,ne,z)},[m,u,N]),w=vm(),A=v.useCallback(async(ne,z)=>{await w(ne,{...z,navigate:!1,fetcherKey:m})},[m,w]),R=v.useCallback(ne=>y(m,ne),[y,m]),L=v.useMemo(()=>{let ne=v.forwardRef((z,T)=>v.createElement(cn,{...z,navigate:!1,fetcherKey:m,ref:T}));return ne.displayName="fetcher.Form",ne},[m]),I=l.fetchers.get(m)||hb,q=s.get(m);return v.useMemo(()=>({Form:L,submit:A,load:S,reset:R,...I,data:q}),[L,A,S,R,I,q])}function lN(t,{relative:n}={}){let l=v.useContext(um);tt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=gm("useViewTransitionState"),o=$o(t,{relative:n});if(!l.isTransitioning)return!1;let u=Wn(l.currentLocation.pathname,s)||l.currentLocation.pathname,f=Wn(l.nextLocation.pathname,s)||l.nextLocation.pathname;return Cc(o.pathname,f)!=null||Cc(o.pathname,u)!=null}var rl=Zx();function sN(t){return v.createElement(EE,{flushSync:rl.flushSync,...t})}/**
|
|
62
|
-
* @license lucide-react v1.21.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const zb=(...t)=>t.filter((n,l,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===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 iN=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 oN=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,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 sx=t=>{const n=oN(t);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
|
82
|
-
* @license lucide-react v1.21.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var Sh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
87
|
-
* @license lucide-react v1.21.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const uN=t=>{for(const n in t)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},cN=v.createContext({}),dN=()=>v.useContext(cN),fN=v.forwardRef(({color:t,size:n,strokeWidth:l,absoluteStrokeWidth:s,className:o="",children:u,iconNode:f,...m},p)=>{const{size:g=24,strokeWidth:x=2,absoluteStrokeWidth:y=!1,color:N="currentColor",className:S=""}=dN()??{},w=s??y?Number(l??x)*24/Number(n??g):l??x;return v.createElement("svg",{ref:p,...Sh,width:n??g??Sh.width,height:n??g??Sh.height,stroke:t??N,strokeWidth:w,className:zb("lucide",S,o),...!u&&!uN(m)&&{"aria-hidden":"true"},...m},[...f.map(([A,R])=>v.createElement(A,R)),...Array.isArray(u)?u:[u]])});/**
|
|
92
|
-
* @license lucide-react v1.21.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const St=(t,n)=>{const l=v.forwardRef(({className:s,...o},u)=>v.createElement(fN,{ref:u,iconNode:n,className:zb(`lucide-${iN(sx(t))}`,`lucide-${t}`,s),...o}));return l.displayName=sx(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 hN=[["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"}]],mN=St("arrow-down-wide-narrow",hN);/**
|
|
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 pN=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Gc=St("arrow-left",pN);/**
|
|
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 gN=[["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"}]],vN=St("arrow-up-narrow-wide",gN);/**
|
|
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 yN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Ub=St("ban",yN);/**
|
|
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 xN=[["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"}]],bN=St("chart-column",xN);/**
|
|
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 SN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Bb=St("check",SN);/**
|
|
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 wN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xs=St("chevron-down",wN);/**
|
|
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 EN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hb=St("chevron-right",EN);/**
|
|
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 NN=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],RN=St("circle-check-big",NN);/**
|
|
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 jN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ym=St("circle-check",jN);/**
|
|
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 TN=[["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"}]],CN=St("circle-dashed",TN);/**
|
|
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 AN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],DN=St("circle-minus",AN);/**
|
|
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 kN=[["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"}]],xm=St("circle-pause",kN);/**
|
|
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 ON=[["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"}]],$b=St("circle-play",ON);/**
|
|
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 MN=[["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"}]],_N=St("circle-x",MN);/**
|
|
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 LN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Xc=St("circle",LN);/**
|
|
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 zN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],UN=St("clock",zN);/**
|
|
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 BN=[["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"}]],qb=St("copy",BN);/**
|
|
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 HN=[["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"}]],$N=St("download",HN);/**
|
|
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 qN=[["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"}]],IN=St("git-branch",qN);/**
|
|
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 VN=[["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"}]],YN=St("grip-vertical",VN);/**
|
|
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 FN=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],PN=St("house",FN);/**
|
|
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 GN=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Dc=St("layers",GN);/**
|
|
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 XN=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Vo=St("list-todo",XN);/**
|
|
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 QN=[["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"}]],KN=St("locate-fixed",QN);/**
|
|
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 ZN=[["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"}]],JN=St("moon",ZN);/**
|
|
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 WN=[["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"}]],Ib=St("octagon-alert",WN);/**
|
|
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 eR=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],gs=St("pencil",eR);/**
|
|
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 tR=[["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"}]],aR=St("play",tR);/**
|
|
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 nR=[["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"}]],rR=St("rotate-ccw",nR);/**
|
|
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 lR=[["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"}]],Vb=St("scroll-text",lR);/**
|
|
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 sR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],iR=St("search",sR);/**
|
|
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 oR=[["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"}]],uR=St("sun",oR);/**
|
|
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 cR=[["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"}]],dR=St("timer-reset",cR);/**
|
|
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 fR=[["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",fR);/**
|
|
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 hR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mR=St("x",hR),pR="/api",gR=120,vR=40;function Qc(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 Kc(t){return{...t,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",notes:t.notes??"",goals:t.goals??[],nonGoals:t.nonGoals??[],dependencies:t.dependencies??[],risks:t.risks??[],openQuestions:t.openQuestions??[],decisions:t.decisions??[],acceptedDecisions:t.acceptedDecisions??[],completionCriteria:t.completionCriteria??[],taskIds:t.taskIds??[],tasks:(t.tasks??[]).map(Qc),linkedRequirements:t.linkedRequirements??[],handoff:t.handoff??"",handoffUpdatedAt:t.handoffUpdatedAt??"",descriptionUpdatedAt:t.descriptionUpdatedAt??""}}function Zc(t){return{...t,number:t.number??0,discussedAt:t.discussedAt??"",contextReady:t.contextReady??!1,contextReadyReason:t.contextReadyReason??"",acceptedDecisions:t.acceptedDecisions??[],phaseIds:t.phaseIds??[],descriptionUpdatedAt:t.descriptionUpdatedAt??""}}function Yb(t){var n,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:((n=t.workflowRules)==null?void 0:n.beforePhaseStart)??[],beforeTaskStart:((l=t.workflowRules)==null?void 0:l.beforeTaskStart)??[],afterPhaseComplete:((s=t.workflowRules)==null?void 0:s.afterPhaseComplete)??[]}}}function bm(t){return{...t,description:t.description??"",macroTasks:t.macroTasks??[],linkedPhaseIds:t.linkedPhaseIds??[]}}async function ix(t,n){try{return await fetch(`${pR}${t}`,{headers:{"Content-Type":"application/json"},...n})}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 Vt(t,n){let l=await ix(t,n),s=0;for(;l.status===503&&s<vR;)await new Promise(o=>setTimeout(o,gR)),s+=1,l=await ix(t,n);if(!l.ok){const o=await l.text().catch(()=>l.statusText);throw new Response(o||l.statusText,{status:l.status,statusText:l.statusText})}return l.json()}async function Sm(){return Yb(await Vt("/project"))}async function yR(t){return Yb(await Vt("/project",{method:"PUT",body:JSON.stringify(t)}))}async function xR(){return Vt("/ui-config")}async function Fb(){return(await Vt("/features")).map(Zc)}async function Yo(t){return Zc(await Vt(`/features/${t}`))}async function bR(t){return Zc(await Vt("/features",{method:"POST",body:JSON.stringify(t)}))}async function Pb(t){return Zc(await Vt(`/features/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function SR(t){return Vt(`/features/${t}`,{method:"DELETE"})}async function wm(){return(await Vt("/requirements")).requirements.map(bm)}async function wR(t){const n=new Date().toISOString();return bm(await Vt("/requirements",{method:"POST",body:JSON.stringify({...t,macroTasks:[],createdAt:n,updatedAt:n})}))}async function ER(t){return bm(await Vt(`/requirements/${t.id}`,{method:"PUT",body:JSON.stringify({...t,updatedAt:new Date().toISOString()})}))}async function NR(t){return Vt(`/requirements/${t}`,{method:"DELETE"})}async function Jc(t){const n=t?`?featureId=${encodeURIComponent(t)}`:"";return(await Vt(`/phases${n}`)).map(Kc)}async function Wc(t){return Kc(await Vt(`/phases/${t}`))}async function RR(t){return Kc(await Vt("/phases",{method:"POST",body:JSON.stringify(t)}))}async function Gb(t){return Kc(await Vt(`/phases/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function jR(t){return Vt(`/phases/${t}`,{method:"DELETE"})}async function TR(t,n){return Qc(await Vt(`/phases/${t}/tasks`,{method:"POST",body:JSON.stringify(n)}))}async function ed(t){return Qc(await Vt(`/tasks/${t}`))}async function Em(t){return Qc(await Vt(`/tasks/${t.id}`,{method:"PUT",body:JSON.stringify(t)}))}async function CR(t){return Vt(`/tasks/${t}`,{method:"DELETE"})}async function AR(){return Vt("/tasks/active")}async function DR(){const t=await Vt("/tasks/focus");return{active:t.active??[],paused:t.paused??[],pendingResume:t.pendingResume??[]}}async function Gh(){return(await Vt("/handoffs")).handoffs??[]}async function kR(){return(await Vt("/handoffs/archive")).archived??[]}async function Xb(t){return Vt(`/phases/${t}/handoff`,{method:"DELETE"})}async function OR(t=!1){return Vt(`/export?full=${t?"true":"false"}`)}async function MR(){return Vt("/repair",{method:"POST"})}async function wh(t,n,l,s){return Vt("/reorder",{method:"POST",body:JSON.stringify({kind:t,movedId:n,beforeId:l,afterId:s})})}function _R(){const[t,n]=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:()=>n(l=>l==="dark"?"light":"dark")}}function LR({liveStatus:t}){const n=t==="live"?{label:"Live",className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",dotClassName:"bg-emerald-500"}:t==="reconnecting"?{label:"Reconnecting…",className:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-400",dotClassName:"bg-amber-500 animate-pulse"}:t==="disconnected"?{label:"Disconnected",className:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-400",dotClassName:"bg-rose-500"}:{label:"Connecting…",className:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-400",dotClassName:"bg-sky-500 animate-pulse"};return c.jsxs("span",{className:`inline-flex min-h-9 items-center gap-2 rounded-[12px] border px-2.5 py-1.5 text-sm font-semibold sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 ${n.className}`,children:[c.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${n.dotClassName}`}),c.jsx("span",{className:"hidden sm:inline",children:n.label})]})}function zR({projectName:t,projectRoot:n,planRoot:l,liveStatus:s}){const{theme:o,toggleTheme:u}=_R(),[f,m]=v.useState(!1),[p,g]=v.useState(!1),[x,y]=v.useState(null),N=[{to:"/",label:"Dashboard",icon:PN},{to:"/features",label:"Features",icon:Dc},{to:"/requirements",label:"Requirements",icon:Vo},{to:"/handoff",label:"Handoff",icon:Vb}];async function S(w){y(w?"full":"summary");try{const R=await OR(w),L=new Blob([R.markdown],{type:"text/markdown;charset=utf-8"}),I=URL.createObjectURL(L),q=document.createElement("a");q.href=I,q.download=w?"EXPORT-full.md":R.filePath||"EXPORT.md",document.body.appendChild(q),q.click(),q.remove(),URL.revokeObjectURL(I),g(!1)}catch(R){window.alert(`Export failed: ${R instanceof Error?R.message:String(R)}`)}finally{y(null)}}return c.jsx("div",{className:"relative z-20 overflow-visible border-b border-[var(--border)] bg-[var(--surface-elevated)] backdrop-blur-xl backdrop-saturate-150",children:c.jsxs("div",{className:"page-container flex flex-col gap-3 py-2.5 md:flex-row md:items-center md:justify-between sm:gap-4 sm:py-3",children:[c.jsxs(Ye,{to:"/",className:"flex min-w-0 items-center gap-3",children:[c.jsx("div",{className:"surface-card flex h-10 w-10 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] text-[var(--accent)]",children:c.jsx(Dc,{className:"h-4 w-4"})}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("div",{className:"truncate text-sm font-black tracking-tight",children:t??"Agent Plan"})}),n?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"truncate text-[11px] text-[var(--text-subtle)]",title:n,children:n}),c.jsx("button",{type:"button",onClick:async w=>{w.preventDefault(),w.stopPropagation(),n&&(await navigator.clipboard.writeText(n).catch(()=>{}),m(!0),window.setTimeout(()=>m(!1),1200))},className:"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] transition hover:text-[var(--text)]",title:f?"Copied":"Copy project path","aria-label":f?"Copied":"Copy project path",children:f?c.jsx(Bb,{className:"h-3.5 w-3.5"}):c.jsx(qb,{className:"h-3.5 w-3.5"})})]}):null]})]}),c.jsxs("div",{className:"flex items-center justify-end gap-2 sm:gap-3",children:[c.jsx("div",{className:"flex flex-wrap items-center gap-2",children:c.jsx(LR,{liveStatus:s})}),c.jsx("nav",{className:"flex items-center gap-1.5 sm:gap-2",children:N.map(w=>c.jsxs(_b,{to:w.to,end:w.to==="/","aria-label":w.label,className:({isActive:A})=>`inline-flex min-h-9 items-center gap-2 rounded-[12px] border px-2.5 py-1.5 text-sm font-semibold transition sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 sm:px-4 ${A?"border-transparent bg-[var(--accent-soft)] text-[var(--accent)]":"border-transparent text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"}`,children:[c.jsx(w.icon,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:w.label})]},w.to))}),c.jsxs("div",{className:"relative z-30",children:[c.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":p,"aria-label":"Export",onClick:()=>g(w=>!w),className:"inline-flex min-h-9 items-center gap-2 rounded-[12px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2.5 py-1.5 text-sm font-semibold text-[var(--text-muted)] transition hover:text-[var(--text)] sm:min-h-11 sm:rounded-[14px] sm:px-3 sm:py-2 sm:px-4",children:[c.jsx($N,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"Export"}),c.jsx(xs,{className:`h-4 w-4 transition-transform ${p?"rotate-180":""}`})]}),p?c.jsxs("div",{role:"menu",onKeyDown:w=>{var I;const A=Array.from(w.currentTarget.querySelectorAll("[role=menuitem]")).filter(q=>!q.hasAttribute("disabled"));if(A.length===0)return;const R=A.indexOf(document.activeElement);let L=R;if(w.key==="ArrowDown")L=R===-1?0:(R+1)%A.length;else if(w.key==="ArrowUp")L=R===-1?A.length-1:(R-1+A.length)%A.length;else if(w.key==="Home")L=0;else if(w.key==="End")L=A.length-1;else return;w.preventDefault(),(I=A[L])==null||I.focus()},className:"absolute right-0 top-full z-[200] mt-2 min-w-44 overflow-hidden rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] p-1 shadow-xl",children:[c.jsxs("button",{type:"button",role:"menuitem",disabled:x!==null,onClick:()=>void S(!1),className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Summary",x==="summary"?c.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]}),c.jsxs("button",{type:"button",role:"menuitem",disabled:x!==null,onClick:()=>void S(!0),className:"flex w-full items-center justify-between rounded-[10px] px-3 py-2 text-left text-sm font-semibold text-[var(--text)] transition hover:bg-[var(--accent-soft)] disabled:cursor-wait disabled:opacity-60",children:["Full",x==="full"?c.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"…"}):null]})]}):null]}),c.jsx("button",{type:"button",onClick:u,"aria-label":o==="dark"?"Switch to light theme":"Switch to dark theme",title:o==="dark"?"Switch to light theme":"Switch to dark theme",className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[12px] border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text-muted)] transition hover:text-[var(--text)] sm:h-11 sm:w-11 sm:rounded-[14px]",children:o==="dark"?c.jsx(uR,{className:"h-4 w-4"}):c.jsx(JN,{className:"h-4 w-4"})})]})]})})}function ox(t,n,l){t.split(`
|
|
277
|
-
`).forEach((o,u)=>{u>0&&n.push(c.jsx("br",{},`${l}-br-${u}`)),o&&n.push(o)})}function mo(t,n){const l=[],s=/(\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*)/g;let o=0,u=null,f=0;for(;(u=s.exec(t))!==null;)u.index>o&&ox(t.slice(o,u.index),l,`${n}-${f}`),u[2]&&u[3]?l.push(c.jsx("a",{href:u[3],target:"_blank",rel:"noreferrer",className:"font-semibold text-[var(--accent)] underline-offset-4 hover:underline",children:u[2]},`${n}-link-${f}`)):u[4]?l.push(c.jsx("strong",{className:"font-semibold text-[var(--text)]",children:u[4]},`${n}-strong-${f}`)):u[5]?l.push(c.jsx("code",{className:"rounded-md border border-[var(--border)] px-1.5 py-0.5 font-mono text-[0.95em] text-[var(--text)]",children:u[5]},`${n}-code-${f}`)):u[6]&&l.push(c.jsx("em",{className:"italic",children:u[6]},`${n}-em-${f}`)),o=s.lastIndex,f+=1;return o<t.length&&ox(t.slice(o),l,`${n}-tail`),l}function UR(t,n){var o;const l=t.split(`
|
|
278
|
-
`);if(t.startsWith("```")){const u=t.replace(/^```[a-zA-Z]*\n?/,"").replace(/```\s*$/,"");return c.jsx("pre",{className:"overflow-x-auto rounded-lg border border-[var(--border)] bg-[var(--surface-elevated)] p-3 text-sm font-mono text-[var(--text)]",children:c.jsx("code",{children:u})},`code-${n}`)}const s=t.match(/^(#{1,6})\s+(.+)$/);if(s&&s[2]){const u=((o=s[1])==null?void 0:o.length)??1,f=s[2],m=u<=2?"text-base font-bold text-[var(--text)]":"text-sm font-bold text-[var(--text)]";return c.jsx("p",{className:m,children:mo(f,`h-${n}`)},`h-${n}`)}return l.every(u=>/^\s*>\s?/.test(u))?c.jsx("blockquote",{className:"border-l-2 border-[var(--accent)] pl-4 text-sm italic text-[var(--text-muted)]",children:l.map((u,f)=>c.jsx("div",{children:mo(u.replace(/^\s*>\s?/,""),`bq-${n}-${f}`)},`bq-${n}-${f}`))},`bq-${n}`):/^\s*([-*_])\1{2,}\s*$/.test(t.trim())?c.jsx("hr",{className:"border-[var(--border)]"},`hr-${n}`):l.every(u=>/^\s*[-*]\s+/.test(u))?c.jsx("ul",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map((u,f)=>c.jsx("li",{className:"list-disc",children:mo(u.replace(/^\s*[-*]\s+/,""),`ul-${n}-${f}`)},`ul-${n}-${f}`))},`ul-${n}`):l.every(u=>/^\s*\d+\.\s+/.test(u))?c.jsx("ol",{className:"grid gap-2 pl-5 text-sm text-[var(--text-muted)] list-decimal",children:l.map((u,f)=>c.jsx("li",{children:mo(u.replace(/^\s*\d+\.\s+/,""),`ol-${n}-${f}`)},`ol-${n}-${f}`))},`ol-${n}`):c.jsx("p",{className:"text-sm leading-6 text-[var(--text-muted)] whitespace-pre-wrap",children:mo(t,`p-${n}`)},`p-${n}`)}function ya({text:t,className:n=""}){if(!(t!=null&&t.trim()))return null;const l=t.trim().split(/\n\s*\n/).filter(Boolean);return c.jsx("div",{className:`formatted-text grid grid-cols-1 gap-3 ${n}`,children:l.map((s,o)=>UR(s,o))})}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 il({value:t,className:n=""}){if(!t)return null;const l=`Last updated ${ll(t)}`;return c.jsx("time",{dateTime:t,title:l,"aria-label":l,className:`text-[11px] text-[var(--text-subtle)] ${n}`.trim(),children:l})}function Qb({snapshot:t,pendingResume:n=!1,compact:l=!1}){const s=v.useId(),o=n?rR:xm;return c.jsxs("section",{"aria-labelledby":s,"aria-live":n?"polite":void 0,className:`rounded-[14px] border px-4 py-3 ${n?"border-[var(--accent)] bg-[var(--accent-soft)]":"border-[var(--border)] bg-[var(--surface-elevated)]"}`,children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(o,{className:"h-4 w-4 shrink-0 text-[var(--accent)]","aria-hidden":"true"}),c.jsx("h3",{id:s,className:"text-sm font-bold text-[var(--text)]",children:n?"Resume required":"Paused work snapshot"}),c.jsx("span",{className:"ml-auto text-[10px] font-semibold uppercase tracking-[0.14em] text-[var(--text-subtle)]",children:ll(t.pausedAt)})]}),c.jsxs("dl",{className:`mt-3 grid ${l?"gap-2":"gap-3 sm:grid-cols-2"}`,children:[c.jsxs("div",{children:[c.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Why paused"}),c.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.reason})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Work checkpoint"}),c.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.whatWasBeingDone})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Resume from"}),c.jsx("dd",{className:"mt-1 font-mono text-xs text-[var(--text)] [overflow-wrap:anywhere]",children:t.resumeLocation})]}),c.jsxs("div",{children:[c.jsx("dt",{className:"text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"How to resume"}),c.jsx("dd",{className:"mt-1 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.howToResume})]})]})]})}const ux={feature:{soft:"rgba(139, 92, 246, 0.16)",strong:"var(--color-entity-feature)"},phase:{soft:"rgba(6, 182, 212, 0.16)",strong:"var(--color-entity-phase)"},task:{soft:"rgba(16, 185, 129, 0.16)",strong:"var(--color-entity-task)"}};function Cr(t){return String(t&&t>0?t:0).padStart(3,"0")}function $l({featureNum:t,phaseNum:n,taskNum:l}){const s=[];return t!==void 0&&s.push(`F${Cr(t)}`),n!==void 0&&s.push(`P${Cr(n)}`),l!==void 0&&s.push(`T${Cr(l)}`),s.join("/")}async function BR(t){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(t),!0}catch{}try{const n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.top="-1000px",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select();const l=document.execCommand("copy");return n.remove(),l}catch{return!1}}function Kb({type:t,number:n}){const l=ux[t]||ux.task,s=(l==null?void 0:l.soft)||"transparent",o=(l==null?void 0:l.strong)||"inherit";return c.jsxs("span",{className:"shrink-0 inline-flex items-center justify-center font-mono text-[11px] font-bold leading-none px-2 py-1 rounded-md transition-colors",style:{backgroundColor:s,color:o},children:[t?t.charAt(0).toUpperCase():"?",Cr(n)]})}function kc({type:t,phaseNum:n,featureNum:l}){return t==="feature"?null:t==="phase"?l===void 0?null:c.jsx("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:c.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["F",Cr(l)]})}):t==="task"?n===void 0?null:c.jsxs("div",{className:"shrink-0 inline-flex items-stretch font-mono text-[10.5px] font-semibold rounded-md overflow-hidden border border-[var(--border)] bg-[var(--surface-elevated)]",children:[c.jsxs("span",{className:"px-2 py-1 text-[var(--text-muted)]",children:["P",Cr(n)]}),l!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-[1px] bg-[var(--border)]"}),c.jsxs("span",{className:"px-2 py-1 text-[var(--text-subtle)]",children:["F",Cr(l)]})]})]}):null}function cr({featureNum:t,phaseNum:n,taskNum:l,featureId:s,phaseId:o,taskId:u}){const f=s?({children:g})=>c.jsx(Ye,{to:`/features/${s}`,className:"entity-path-seg entity-path-seg--feature entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--feature",children:g}),m=o?({children:g})=>c.jsx(Ye,{to:`/features/${s}/phases/${o}`,className:"entity-path-seg entity-path-seg--phase entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--phase",children:g}),p=u?({children:g})=>c.jsx(Ye,{to:`/features/${s}/phases/${o}/tasks/${u}`,className:"entity-path-seg entity-path-seg--task entity-path-seg--link",children:g}):({children:g})=>c.jsx("span",{className:"entity-path-seg entity-path-seg--task",children:g});return c.jsxs("span",{className:"entity-path-badge",children:[t!==void 0?c.jsxs(f,{children:["F",Cr(t)]}):null,n!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),c.jsxs(m,{children:["P",Cr(n)]})]}):null,l!==void 0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"entity-path-sep","aria-hidden":"true",children:"/"}),c.jsxs(p,{children:["T",Cr(l)]})]}):null]})}function mr({id:t,children:n}){const[l,s]=v.useState(!1);return c.jsxs("button",{type:"button",onClick:async o=>{o.preventDefault(),o.stopPropagation(),await BR(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:[n,c.jsx("span",{className:"copyable-id__icon","aria-hidden":"true",children:l?c.jsx(Bb,{className:"h-3 w-3 text-emerald-500"}):c.jsx(qb,{className:"h-3 w-3"})})]})}function ql({shortId:t}){return c.jsx(mr,{id:t,children:c.jsx("span",{className:"short-id-badge",children:t})})}function Nm({phaseId:t,updatedAt:n}){const l=`Phase handoff pending${n?` · updated ${new Date(n).toLocaleString()}`:""}`;return c.jsxs("a",{href:`/handoff#${t}`,className:"handoff-badge flex items-center gap-1 ml-2 shrink-0",title:l,"aria-label":l,children:[c.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M4 2h5l3 3v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z"}),c.jsx("path",{d:"M9 2v3h3"}),c.jsx("path",{d:"M5.5 8h5M5.5 10.5h5"})]}),c.jsx("span",{className:"handoff-badge__label",children:"handoff"})]})}function Eh({task:t}){const n=kr(),l=t.featureId?`/features/${t.featureId}/phases/${t.phaseId}/tasks/${t.id}`:"/features";return c.jsxs("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:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{"aria-hidden":"true",className:`inline-block h-2 w-2 shrink-0 rounded-full ${t.status==="in-progress"?"bg-[var(--accent)]":"border border-[var(--accent)] bg-transparent"}`}),c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c.jsx(cr,{featureNum:t.featureNumber,phaseNum:t.phaseNumber,taskNum:t.number,featureId:t.featureId,phaseId:t.phaseId,taskId:t.id}),c.jsx(mr,{id:$l({featureNum:t.featureNumber,phaseNum:t.phaseNumber,taskNum:t.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),t.shortId?c.jsx(ql,{shortId:t.shortId}):null,c.jsx(Ye,{to:l,className:"min-w-0 flex-1 truncate font-medium hover:text-[var(--accent)]",children:t.title}),t.pendingResume?c.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]}),c.jsx("button",{type:"button",onClick:s=>{s.preventDefault(),s.stopPropagation(),n(`/?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:c.jsx(KN,{className:"h-4 w-4"})})]}),t.pauseSnapshot?c.jsx("div",{className:"mt-2",children:c.jsx(Qb,{snapshot:t.pauseSnapshot,pendingResume:t.pendingResume,compact:!0})}):t.pendingResume?c.jsx("p",{className:"mt-2 text-xs font-medium text-[var(--accent)]",children:"Return to this preserved task before selecting new priority work."}):null]})}function HR({taskFocus:t}){const n=v.useMemo(()=>{const l=s=>{const o=new Set;return s.filter(u=>o.has(u.id)?!1:(o.add(u.id),!0))};return{active:l(t.active),paused:l(t.paused),pendingResume:l(t.pendingResume)}},[t.active,t.paused,t.pendingResume]);return n.active.length===0&&n.paused.length===0&&n.pendingResume.length===0?null:c.jsx("div",{className:"relative z-10 border-t border-[var(--border)] bg-[var(--surface-elevated)]/95 backdrop-blur-xl",children:c.jsxs("div",{className:"page-container grid max-h-[45vh] gap-3 overflow-y-auto py-2.5 pr-1",children:[n.pendingResume.length>0?c.jsxs("section",{"aria-labelledby":"resume-task-heading",className:"grid gap-1.5",children:[c.jsxs("h2",{id:"resume-task-heading",className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--accent)]",children:["Resume required (",n.pendingResume.length,")"]}),n.pendingResume.map(l=>c.jsx(Eh,{task:l},l.id))]}):null,n.active.length>0?c.jsxs("section",{"aria-labelledby":"active-task-heading",className:"grid gap-1.5",children:[c.jsxs("h2",{id:"active-task-heading",className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["Active tasks (",n.active.length,")"]}),n.active.map(l=>c.jsx(Eh,{task:l},l.id))]}):null,n.paused.length>0?c.jsxs("section",{"aria-labelledby":"paused-task-heading",className:"grid gap-1.5",children:[c.jsxs("h2",{id:"paused-task-heading",className:"text-[10px] font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:["Paused tasks (",n.paused.length,")"]}),n.paused.map(l=>c.jsx(Eh,{task:l},l.id))]}):null]})})}function $R({project:t,taskFocus:n,serverInfo:l}){const s=Or(),[o,u]=v.useState("connecting");return v.useEffect(()=>{const f=m=>{var g;const p=(g=m.detail)==null?void 0:g.status;p&&u(p)};return window.addEventListener("agent-plan:ws-status",f),()=>window.removeEventListener("agent-plan:ws-status",f)},[]),c.jsxs("div",{className:"page-shell",children:[c.jsxs("header",{className:"sticky top-0 z-30 overflow-visible",children:[c.jsx(zR,{projectName:t==null?void 0:t.name,projectRoot:t==null?void 0:t.projectRoot,planRoot:t==null?void 0:t.planRoot,liveStatus:o}),c.jsx(HR,{taskFocus:n})]}),c.jsxs("div",{className:"page-container py-8",children:[c.jsxs("div",{className:"mb-8 flex flex-col gap-3 md:flex-row md:items-end md:justify-between md:gap-6",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Current project"}),c.jsx("h1",{className:"text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:c.jsx(Ye,{to:"/",className:"hover:text-[var(--accent)]",children:(t==null?void 0:t.name)??"Agent Plan"})}),t!=null&&t.projectRoot?c.jsx("p",{className:"mt-2 truncate font-mono text-xs text-[var(--text-subtle)]",title:t.projectRoot,children:t.projectRoot}):null,l?c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[c.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 font-semibold uppercase tracking-[0.12em] ${l.mode==="lan"?"bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] text-[var(--accent)]":"bg-[var(--surface-elevated)] text-[var(--text-muted)]"}`,children:[c.jsx("span",{"aria-hidden":"true",className:"inline-block h-1.5 w-1.5 rounded-full bg-current"}),l.mode==="lan"?"LAN visible":"Local only"]}),c.jsx("a",{href:l.localUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:l.localUrl}),l.lanUrl?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-[var(--text-subtle)]",children:"·"}),c.jsx("a",{href:l.lanUrl,target:"_blank",rel:"noreferrer",className:"font-mono text-[var(--text-subtle)] underline-offset-2 hover:text-[var(--accent)] hover:underline",children:l.lanUrl})]}):null]}):null,t!=null&&t.description?c.jsx(ya,{text:t.description,className:"mt-2 max-w-3xl"}):null]}),s.state!=="idle"?c.jsx("div",{className:"text-sm font-semibold text-[var(--accent)]",children:"Updating…"}):null]}),c.jsx(pi,{})]})]})}const Rn=32,Zb=4,qR=Math.PI*1.2;function Jb(){if(typeof document>"u")return"#7b68ee";const t=document.createElement("div");t.style.color="var(--accent, #7b68ee)",document.body.appendChild(t);const n=getComputedStyle(t).color||"#7b68ee";return t.remove(),n}function IR(){const t=document.createElement("canvas");t.width=Rn,t.height=Rn;const n=t.getContext("2d");if(!n)return"";const l=Jb();return n.beginPath(),n.arc(Rn/2,Rn/2,Rn/2-Zb,0,Math.PI*2),n.fillStyle=l,n.fill(),n.fillStyle="#ffffff",n.font="bold 16px system-ui, sans-serif",n.textAlign="center",n.textBaseline="middle",n.fillText("A",Rn/2,Rn/2+1),t.toDataURL("image/png")}function VR(t,n){const l=t.getContext("2d");if(!l)return"";const s=Jb();l.clearRect(0,0,Rn,Rn);const o=Rn/2,u=Rn/2,f=Rn/2-Zb;return l.beginPath(),l.arc(o,u,f,0,Math.PI*2),l.fillStyle=s,l.globalAlpha=.85,l.fill(),l.globalAlpha=1,l.beginPath(),l.arc(o,u,f-3,n,n+qR),l.strokeStyle="#ffffff",l.lineWidth=3,l.lineCap="round",l.stroke(),l.fillStyle="#ffffff",l.font="bold 14px system-ui, sans-serif",l.textAlign="center",l.textBaseline="middle",l.fillText("A",o,u+1),t.toDataURL("image/png")}function YR(){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 FR(t){const n=v.useRef(null),l=v.useRef(null),s=v.useRef(null),o=v.useRef(0);v.useEffect(()=>{if(n.current||(n.current=YR()),s.current||(s.current=IR()),!l.current){const m=document.createElement("canvas");m.width=Rn,m.height=Rn,l.current=m}const u=n.current;if(!t){u.href=s.current;return}const f=window.setInterval(()=>{document.hidden||(o.current+=Math.PI/10,u.href=VR(l.current,o.current))},100);return()=>{window.clearInterval(f),u.href=s.current}},[t])}const wo={create:{key:"n",primary:!0},edit:{key:"e",primary:!0},delete:{key:"d",primary:!0},submit:{key:"Enter",primary:!0}},Wb=v.createContext(wo);function e0(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform)}function PR(t){return typeof t!="string"}function GR(t){return{create:(t==null?void 0:t.create)??wo.create,edit:(t==null?void 0:t.edit)??wo.edit,delete:(t==null?void 0:t.delete)??wo.delete,submit:(t==null?void 0:t.submit)??wo.submit}}function XR(t){const n=[],l=e0();t.primary&&n.push(l?"⌘":"Ctrl"),t.meta&&n.push(l?"⌘":"Meta"),t.ctrl&&n.push(l?"⌃":"Ctrl"),t.shift&&n.push(l?"⇧":"Shift"),t.alt&&n.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 n.push(s),l?n.join(""):n.join("+")}function QR(t){return t instanceof HTMLElement?!!t.closest("input, textarea, select, [contenteditable='true']"):!1}function KR(t,n){const l=n.key.length===1?n.key.toLowerCase():n.key,s=t.key.length===1?t.key.toLowerCase():t.key,o=e0(),u=n.meta??(n.primary?o:!1),f=n.ctrl??(n.primary?!o:!1);return s===l&&!!u===t.metaKey&&!!f===t.ctrlKey&&!!n.shift===t.shiftKey&&!!n.alt===t.altKey}function ZR({shortcuts:t,children:n}){return v.createElement(Wb.Provider,{value:GR(t)},n)}function t0(t){const n=v.useContext(Wb);if(t)return PR(t)?t:n[t]}function Aa(t,n,l){const s=t0(t);v.useEffect(()=>{if(!s||(l==null?void 0:l.enabled)===!1)return;const o=u=>{!(l!=null&&l.allowInEditable)&&QR(u.target)||KR(u,s)&&(u.preventDefault(),n())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n,l==null?void 0:l.allowInEditable,l==null?void 0:l.enabled,s])}const JR=1500,WR=80,e2=12e3,t2=5e3;function a2(){const{revalidate:t}=pE(),n=v.useRef(null),l=v.useRef(null),s=v.useRef(null),o=v.useRef(null),u=v.useRef(null);return v.useEffect(()=>{let f=!0;const m=X=>{window.dispatchEvent(new CustomEvent("agent-plan:ws-status",{detail:{status:X}}))},p=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},g=()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)},x=()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},y=()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},N=()=>{g(),s.current=window.setTimeout(()=>{t()},WR)},S=()=>{!f||l.current!==null||(m("reconnecting"),l.current=window.setTimeout(()=>{l.current=null,R()},JR))},w=()=>{y(),x();const X=n.current;if(n.current=null,X&&(X.readyState===WebSocket.OPEN||X.readyState===WebSocket.CONNECTING))try{X.close()}catch{}},A=()=>{y(),x(),o.current=window.setInterval(()=>{const X=n.current;if(!(!X||X.readyState!==WebSocket.OPEN)){try{X.send(JSON.stringify({type:"ping"}))}catch{w(),S();return}x(),u.current=window.setTimeout(()=>{w(),S()},t2)}},e2)},R=()=>{if(!f)return;const X=n.current;if(X&&(X.readyState===WebSocket.OPEN||X.readyState===WebSocket.CONNECTING))return;m(l.current!==null?"reconnecting":"connecting"),p();const W=window.location.protocol==="https:"?"wss":"ws",ne=new WebSocket(`${W}://${window.location.host}/ws`);n.current=ne,ne.onopen=()=>{p(),m("live"),A()},ne.onmessage=z=>{x();try{const T=JSON.parse(z.data);if(!T.type||T.type==="pong"||T.type==="connected")return;switch(window.dispatchEvent(new CustomEvent("agent-plan:ws-event",{detail:T})),T.type){case"project-updated":case"features-updated":case"phases-updated":case"requirements-updated":case"plan-rendered":case"file-changed":case"handoffUpdated":case"handoffCleared":N();break;default:break}}catch{}},ne.onclose=()=>{y(),x(),n.current===ne&&(n.current=null),f&&S()},ne.onerror=()=>{try{ne.close()}catch{}}},L=()=>{const X=n.current;(!X||X.readyState===WebSocket.CLOSED||X.readyState===WebSocket.CLOSING)&&R()},I=()=>{document.visibilityState==="visible"&&L()},q=()=>{L()};return m("connecting"),R(),window.addEventListener("online",q),document.addEventListener("visibilitychange",I),()=>{f=!1,m("disconnected"),window.removeEventListener("online",q),document.removeEventListener("visibilitychange",I),p(),g(),y(),x(),w()}},[t]),null}async function n2(){const[t,n,l]=await Promise.all([Sm(),xR(),DR()]);return{project:t,uiConfig:n,taskFocus:l}}function r2(){const{project:t,uiConfig:n,taskFocus:l}=sl();return v.useEffect(()=>{var f,m;const s=(f=t==null?void 0:t.name)==null?void 0:f.trim(),o=(m=t==null?void 0:t.projectRoot)==null?void 0:m.trim(),u=o?o.split(/[/\\]/).filter(Boolean).pop():void 0;s?u&&u!==s?document.title=`${s} · ${u}`:document.title=`${s} · Agent Plan`:document.title="Agent Plan"},[t==null?void 0:t.name,t==null?void 0:t.projectRoot]),FR(l.active.length>0),c.jsxs(ZR,{shortcuts:n.shortcuts,children:[c.jsx(a2,{}),c.jsx($R,{project:t,taskFocus:l,serverInfo:n.server})]})}function l2(){const t=kb(),n=fi(t),l=n&&t.status===503,s=n?l?"Planner web UI disconnected":`Request failed (${t.status})`:"Planner web UI unavailable",o=n?t.data||t.statusText:t instanceof Error?t.message:"The planner web UI could not reach its local server.";return v.useEffect(()=>{document.title="Agent Plan"},[]),c.jsx("div",{className:"page-shell min-h-screen",children:c.jsx("div",{className:"page-container flex min-h-screen items-center justify-center py-12",children:c.jsxs("div",{className:"surface-card max-w-2xl rounded-[24px] px-8 py-8",children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.24em] text-[var(--text-subtle)]",children:"Agent Plan"}),c.jsx("h1",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] md:text-3xl",children:s}),c.jsx("p",{className:"mt-4 text-sm text-[var(--text-muted)]",children:String(o)}),c.jsx("div",{className:"mt-6 grid gap-2 text-sm text-[var(--text-muted)]",children:l?c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"Possible cause: Pi was closed or the local planner web server stopped."}),c.jsx("p",{children:"What to do:"}),c.jsxs("ul",{className:"grid gap-1 pl-5",children:[c.jsxs("li",{className:"list-disc",children:["restart Pi or run ",c.jsx("code",{children:"planner-web start"})]}),c.jsx("li",{className:"list-disc",children:"reopen this planner UI from the new session if needed"}),c.jsx("li",{className:"list-disc",children:"then reload this page"})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{children:"The request reached the planner server, but the server rejected it."}),c.jsx("p",{children:"Fix the validation issue above, then try again."})]})}),c.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:c.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"inline-flex min-h-9 items-center whitespace-nowrap rounded-[12px] bg-[var(--accent)] px-3 py-1.5 text-sm font-semibold text-white transition hover:opacity-90 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2",children:"Reload page"})})]})})})}async function s2(){const[t,n,l]=await Promise.all([Fb(),Jc(),AR()]);return{features:t,phases:n,activeTasks:l}}function i2({shortcut:t}){const n=t0(t);return n?c.jsx("span",{className:"hidden rounded-md border border-[var(--border-strong)] bg-[var(--surface-elevated)] px-2 py-0.5 text-[11px] font-bold tracking-wide text-[var(--text-muted)] sm:inline-block",children:XR(n)}):null}const o2={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:n="",children:l,shortcut:s,...o}){return c.jsxs("button",{className:`inline-flex min-h-9 items-center justify-center gap-1.5 whitespace-nowrap rounded-[12px] border px-3 py-1.5 text-sm font-semibold transition-colors motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface)] disabled:cursor-not-allowed disabled:opacity-60 sm:min-h-11 sm:rounded-[14px] sm:px-4 sm:py-2 sm:gap-2 ${o2[t]} ${n}`,...o,children:[c.jsx("span",{className:"inline-flex items-center gap-1.5 sm:gap-2",children:l}),s?c.jsx(i2,{shortcut:s}):null]})}function Gt({className:t="",children:n,...l}){return c.jsx("div",{className:`surface-card p-6 ${t}`,...l,children:n})}function u2({decisions:t}){return t.length===0?null:c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Accepted decisions (",t.length,")"]}),c.jsx("div",{className:"mt-4 grid gap-3",children:t.map(n=>c.jsxs("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:n.title}),n.decision?c.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"})," ",c.jsx(ya,{text:n.decision})]}):null,n.rationale?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"})," ",c.jsx(ya,{text:n.rationale})]}):null,n.implementationNotes?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"})," ",c.jsx(ya,{text:n.implementationNotes})]}):null]},n.id))})]})}function c2({project:t}){var x,y,N;const n=t.scope??[],l=t.outOfScope??[],s=t.technologies??[],o=t.tools??[],u=t.globalRules??[],f=t.decisions??[],m=t.acceptedDecisions??[],p={beforePhaseStart:((x=t.workflowRules)==null?void 0:x.beforePhaseStart)??[],beforeTaskStart:((y=t.workflowRules)==null?void 0:y.beforeTaskStart)??[],afterPhaseComplete:((N=t.workflowRules)==null?void 0:N.afterPhaseComplete)??[]};return n.length>0||l.length>0||s.length>0||o.length>0||u.length>0||f.length>0||m.length>0||p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?c.jsx(Gt,{className:"grid gap-4",children:c.jsxs("details",{className:"group",children:[c.jsx("summary",{className:"cursor-pointer select-none text-lg font-bold text-[var(--text)]",children:"AI Consolidated Context"}),c.jsxs("div",{className:"mt-4 grid gap-4",children:[n.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"In scope"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:n.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null,l.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Out of scope"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:l.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null,s.length>0||o.length>0?c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Technologies"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:s.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null,o.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Tools"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:o.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null]}):null,u.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Global rules"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:u.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.beforePhaseStart.length>0||p.beforeTaskStart.length>0||p.afterPhaseComplete.length>0?c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsx("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:"Workflow rules"}),c.jsxs("div",{className:"mt-4 grid gap-4 text-sm text-[var(--text-muted)]",children:[p.beforePhaseStart.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before phase start"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforePhaseStart.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.beforeTaskStart.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"Before task start"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.beforeTaskStart.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null,p.afterPhaseComplete.length>0?c.jsxs("div",{children:[c.jsx("h3",{className:"font-semibold text-[var(--text)]",children:"After phase complete"}),c.jsx("ul",{className:"mt-2 grid gap-2 pl-5",children:p.afterPhaseComplete.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null]})]}):null,f.length>0?c.jsxs("details",{className:"group rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:[c.jsxs("summary",{className:"cursor-pointer select-none font-semibold text-[var(--text)]",children:["Legacy decisions (",f.length,")"]}),c.jsx("ul",{className:"mt-4 grid gap-2 pl-5 text-sm text-[var(--text-muted)]",children:f.map(S=>c.jsx("li",{className:"list-disc",children:S},S))})]}):null,c.jsx(u2,{decisions:m})]})]})}):null}const Xh={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},paused:{colorVar:"--color-status-paused",icon:"pause",pattern:"dashed",label:"Paused",description:"Work checkpoint saved; not active now",borderStyle:"dashed",bgOpacity:12,borderOpacity:36},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 Xh[t]??Xh.planned}function Oc(t,n,l){switch(n){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 d2(t){const n=Il(t);return{backgroundColor:Oc(n,"bg"),borderStyle:n.borderStyle,borderColor:Oc(n,"border"),borderWidth:"1px"}}function f2(t){const n=Il(t);return{backgroundColor:Oc(n,"bg"),borderStyle:n.borderStyle,borderColor:Oc(n,"border"),borderWidth:"1px"}}function Rm(t){const{pattern:n}=Il(t);return n?n==="dashed"?`status-pattern-dashed status-pattern-dashed-${t}`:`status-pattern-${n}`:""}function a0(t){return`status-${t}`}function n0(t,n=30){return`color-mix(in srgb, var(${Il(t).colorVar}) ${n}%, transparent)`}function r0(t){return t in Xh?t:"planned"}function h2(t,n){const s=[Il(t).label],o=[["done",n.done],["in-progress",n.inProgress],["paused",n.paused],["planned",n.planned],["waiting",n.waiting],["blocked",n.blocked],["deferred",n.deferred],["canceled",n.canceled],["rejected",n.rejected]];for(const[u,f]of o)f>0&&s.push(`${f} ${u}`);return s.join(" · ")}const l0={circle:Xc,"play-start":aR,play:$b,clock:UN,stop:Ib,pause:xm,check:ym,"check-mixed":RN,ban:Ub,x:_N};function m2({status:t,className:n=""}){const l=Il(t),s=l0[l.icon]??Xc;return c.jsx(s,{className:`h-4 w-4 shrink-0 ${n}`.trim(),"aria-hidden":"true"})}function ur({status:t}){const n=r0(t),l=Il(n);return c.jsxs("span",{className:`status-chip ${a0(n)} ${Rm(n)}`,title:l.description,"aria-label":l.description,children:[c.jsx(m2,{status:n,className:"h-3.5 w-3.5"}),c.jsx("span",{children:l.label})]})}function Fo({status:t,breakdown:n,size:l="md",children:s}){const o=Il(t),u=l0[o.icon]??Xc,f=Rm(t),m=n?h2(t,n):o.description,p=l==="sm"?"px-2 py-0.5 text-[10px]":"px-2.5 py-1 text-[11px]";return c.jsxs("span",{className:`status-chip ${a0(t)} ${f} ${p}`,title:m,"aria-label":m,children:[c.jsx(u,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:o.label}),s]})}function Mc({status:t,breakdown:n,doneTasks:l,totalTasks:s,recentlyChanged:o,className:u}){const f=l!=null&&s!=null;return c.jsxs("div",{className:u,children:[o?c.jsx("span",{className:"rounded-full bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Updated"}):null,f?c.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",l,"/",s||0,")"]}):null,c.jsx(Fo,{status:t,breakdown:n})]})}function p2(t){try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}function g2({features:t,phases:n}){const l=v.useMemo(()=>{const s=new Map(t.map(o=>[o.id,o.name]));return n.flatMap(o=>o.tasks.filter(u=>u.status==="done").map(u=>({task:u,phase:o,feature:t.find(f=>f.id===o.featureId),featureName:o.featureId?s.get(o.featureId)??o.featureId:"Unlinked feature",completedAt:u.completedAt||u.updatedAt}))).sort((o,u)=>u.completedAt.localeCompare(o.completedAt)).slice(0,3)},[t,n]);return c.jsxs(Gt,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Latest completed tasks"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Most recently completed tasks, ordered by completion timestamp."})]}),c.jsx("div",{className:"grid gap-3",children:l.length>0?l.map(({task:s,phase:o,feature:u,featureName:f,completedAt:m})=>c.jsxs(Ye,{to:o.featureId?`/features/${o.featureId}/phases/${o.id}/tasks/${s.id}`:"/features",className:"surface-card grid min-w-0 grid-cols-1 gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Kb,{type:"task",number:s.number}),c.jsx(kc,{type:"task",phaseNum:o.number,featureNum:u==null?void 0:u.number}),c.jsx("span",{className:"shrink-0",children:c.jsx(ur,{status:s.status})})]}),c.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:s.title}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[c.jsx(kc,{type:"phase",featureNum:u==null?void 0:u.number}),c.jsxs("span",{className:"min-w-0 truncate",children:[f," · ",o.title]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Completed ",p2(m)]})]},s.id)):c.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No completed tasks yet."})})]})}const cx=1440*60*1e3;function v2(t){const n=Date.now()-new Date(t).getTime();if(n<0)return"just now";const l=Math.floor(n/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 y2({features:t,phases:n}){const[,l]=v.useState(0),s=Date.now(),o=v.useMemo(()=>{const u=new Map(t.map(f=>[f.id,f.name]));return n.flatMap(f=>f.tasks.map(m=>({task:m,phase:f,feature:t.find(p=>p.id===f.featureId),featureName:f.featureId?u.get(f.featureId)??f.featureId:"Unlinked feature",createdAt:m.createdAt}))).filter(f=>{const m=new Date(f.createdAt).getTime();return Number.isFinite(m)&&s-m<cx&&s-m>=0&&f.task.status==="planned"&&!f.task.startedAt}).sort((f,m)=>m.createdAt.localeCompare(f.createdAt)).slice(0,10)},[t,n,s]);return v.useEffect(()=>{if(o.length===0)return;const u=o.reduce((m,p)=>{const g=new Date(p.createdAt).getTime()+cx-Date.now();return Math.min(m,g)},1/0);if(!Number.isFinite(u)||u<=0)return;const f=window.setTimeout(()=>l(m=>m+1),u+50);return()=>window.clearTimeout(f)},[o]),o.length===0?null:c.jsxs(Gt,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"New Added Tasks"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Tasks created in the last 24 hours."})]}),c.jsx("div",{className:"grid gap-3",children:o.map(({task:u,phase:f,feature:m,featureName:p,createdAt:g})=>c.jsxs(Ye,{to:f.featureId?`/features/${f.featureId}/phases/${f.id}/tasks/${u.id}`:"/features",className:"surface-card grid min-w-0 grid-cols-1 gap-1 border-[color:color-mix(in_srgb,var(--color-status-done)_0%,transparent)] px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Kb,{type:"task",number:u.number}),c.jsx(kc,{type:"task",phaseNum:f.number,featureNum:m==null?void 0:m.number}),c.jsx("span",{className:"inline-flex items-center rounded-full bg-[color:color-mix(in_srgb,var(--accent)_18%,transparent)] px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-[var(--accent)]",children:"New"}),c.jsx("span",{className:"shrink-0",children:c.jsx(ur,{status:u.status})})]}),c.jsx("span",{className:"entity-link--task min-w-0 break-words text-sm font-semibold underline-offset-4 [overflow-wrap:anywhere]",children:u.title}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-muted)]",children:[c.jsx(kc,{type:"phase",featureNum:m==null?void 0:m.number}),c.jsxs("span",{className:"min-w-0 truncate",children:[p," · ",f.title]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-subtle)]",children:["Added ",v2(g)]})]},u.id))})]})}const x2=new Set(["in-progress"]),b2=new Set(["planned","paused","waiting","blocked","deferred"]),S2=new Set(["done","canceled","rejected"]);function s0(t){return t==="discovery"?"in-progress":t==="draft"?"planned":t}function w2(t){const n={planned:0,inProgress:0,paused:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0};for(const l of t)switch(l){case"planned":n.planned++;break;case"in-progress":n.inProgress++;break;case"paused":n.paused++;break;case"waiting":n.waiting++;break;case"blocked":n.blocked++;break;case"deferred":n.deferred++;break;case"done":n.done++;break;case"canceled":n.canceled++;break;case"rejected":n.rejected++;break}return n}function E2(){return{planned:0,inProgress:0,paused:0,waiting:0,blocked:0,deferred:0,done:0,canceled:0,rejected:0}}function i0(t){const n=t,l=w2(n),s=n.length;if(s===0)return{displayStatus:"planned",breakdown:E2(),hasStarted:!1,totalChildren:0,meaningfulChildren:0};const o=n.filter(g=>g!=="canceled"&&g!=="rejected"),u=o.length,f=o.some(g=>g!=="planned");if(o.some(g=>x2.has(g)))return{displayStatus:"in-progress",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u};if(n.every(g=>S2.has(g)))return n.every(g=>g==="done")?{displayStatus:"done",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:n.every(g=>g==="canceled")?{displayStatus:"canceled",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:n.every(g=>g==="rejected")?{displayStatus:"rejected",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:{displayStatus:"closed",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u};const m=o.filter(g=>b2.has(g));return m.length>0&&m.every(g=>g==="paused")?{displayStatus:"paused",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="waiting")?{displayStatus:"waiting",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="blocked")?{displayStatus:"blocked",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="deferred")?{displayStatus:"deferred",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:m.length>0&&m.every(g=>g==="planned")&&!f?{displayStatus:"planned",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}:{displayStatus:"started",breakdown:l,hasStarted:f,totalChildren:s,meaningfulChildren:u}}function jm(t){const n=t.map(l=>s0(l.status));return i0(n)}function Tm(t){const n=t.map(l=>s0(l.status));return i0(n)}function o0(t){return Tm(t)}function u0(t){return jm(t)}const Eo={key:"priority",direction:"asc"},N2=4200;function R2(t){return t.reduce((n,l)=>n+l.tasks.length,0)}function j2(t){return t.reduce((n,l)=>n+l.tasks.filter(s=>s.status==="done").length,0)}function T2(t){return String(t&&t>0?t:0).padStart(3,"0")}const C2={draft:0,discovery:1,planned:2,waiting:3,blocked:4,deferred:5,paused:6,"in-progress":7,done:8,canceled:9,rejected:10};function dx(t,n){if(n==="title")return"name"in t?t.name:t.title;if(n==="status")return C2[t.status]??99;if(n==="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(n==="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(n==="shortId")return t.shortId??"";if(n==="priority"||n==="number")return t[n]??0;if(n==="createdAt"||n==="updatedAt"){const l=t[n];return l?new Date(l).getTime():0}return 0}function Ro(t,n,l,s){const o=dx(t,l),u=dx(n,l);let f;return typeof o=="number"&&typeof u=="number"?f=o-u:f=String(o).localeCompare(String(u)),f===0&&(f=(t.priority??0)-(n.priority??0)||t.number-n.number||t.createdAt.localeCompare(n.createdAt)),s==="desc"?-f:f}function A2(t,n,l=Eo){const s=new Map;for(const o of n){if(!o.featureId)continue;const u=s.get(o.featureId)??[];u.push(o),s.set(o.featureId,u)}return t.map(o=>{const u=s.get(o.id)??[],f=u.reduce((x,y)=>x+y.tasks.length,0),m=u.reduce((x,y)=>x+y.tasks.filter(N=>N.status==="done").length,0),p=u.map(x=>{const y=[...x.tasks].sort((S,w)=>Ro(S,w,l.key,l.direction)),N=y.some(S=>S.status==="in-progress");return{phase:x,totalTasks:x.tasks.length,doneTasks:x.tasks.filter(S=>S.status==="done").length,allTasks:y,hasActiveTask:N,display:jm(y)}}),g=p.some(({phase:x,allTasks:y})=>x.status==="in-progress"||x.status==="discovery"||y.some(N=>N.status==="in-progress"));return{feature:o,totalTasks:f,doneTasks:m,allPhases:p.sort((x,y)=>Ro(x.phase,y.phase,l.key,l.direction)),hasActiveTask:p.some(x=>x.hasActiveTask),isActive:g,display:Tm(p.map(x=>x.phase))}}).sort((o,u)=>Ro(o.feature,u.feature,l.key,l.direction))}function dc({title:t,value:n,valueSuffix:l,subtitle:s,icon:o,valueClassName:u,iconClassName:f}){return c.jsxs(Gt,{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:t}),c.jsxs("div",{className:"mt-2 flex items-end gap-2",children:[c.jsx("p",{className:`text-3xl font-black tracking-tight ${u??"text-[var(--text)]"}`,children:n}),l?c.jsx("span",{className:"pb-1 text-sm font-semibold text-[var(--text-muted)]",children:l}):null]}),c.jsx("p",{className:"mt-1 text-sm text-[var(--text-muted)]",children:s})]}),c.jsx("div",{className:`surface-card flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl border border-[var(--border)] bg-[var(--accent-soft)] ${f??"text-[var(--accent)]"}`,children:o})]})}function fx(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 D2({features:t,phases:n}){const l=new Map;for(const y of n)y.featureId&&l.set(y.featureId,[...l.get(y.featureId)??[],y]);const s=t.filter(y=>{const N=l.get(y.id)??[];return Tm(N).displayStatus==="done"}).length,o=Math.max(t.length-s,0),u=n.filter(y=>jm(y.tasks).displayStatus==="done").length,f=Math.max(n.length-u,0),m=R2(n),p=j2(n),g=Math.max(m-p,0),x=m>0?Math.round(p/m*100):0;return c.jsxs("div",{className:"grid gap-4 lg:grid-cols-4",children:[c.jsx(dc,{title:"Features",value:String(t.length),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[s," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[o," left"]})]}),icon:c.jsx(Dc,{className:"h-4 w-4"})}),c.jsx(dc,{title:"Phases",value:String(n.length),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[u," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[f," left"]})]}),icon:c.jsx(bN,{className:"h-4 w-4"})}),c.jsx(dc,{title:"Tasks",value:String(m),valueSuffix:"total",subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:[p," done"]}),c.jsx("span",{children:" · "}),c.jsxs("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:[g," left"]})]}),icon:c.jsx(Vo,{className:"h-4 w-4"})}),c.jsx(dc,{title:"Completion",value:`${x}%`,subtitle:"Task completion rate",valueClassName:fx(x),iconClassName:fx(x),icon:c.jsx(ym,{className:"h-4 w-4"})})]})}function k2(){for(var t=arguments.length,n=new Array(t),l=0;l<t;l++)n[l]=arguments[l];return v.useMemo(()=>s=>{n.forEach(o=>o(s))},n)}const td=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gi(t){const n=Object.prototype.toString.call(t);return n==="[object Window]"||n==="[object global]"}function Cm(t){return"nodeType"in t}function pn(t){var n,l;return t?gi(t)?t:Cm(t)&&(n=(l=t.ownerDocument)==null?void 0:l.defaultView)!=null?n:window:window}function Am(t){const{Document:n}=pn(t);return t instanceof n}function Po(t){return gi(t)?!1:t instanceof pn(t).HTMLElement}function c0(t){return t instanceof pn(t).SVGElement}function vi(t){return t?gi(t)?t.document:Cm(t)?Am(t)?t:Po(t)||c0(t)?t.ownerDocument:document:document:document}const dr=td?v.useLayoutEffect:v.useEffect;function ad(t){const n=v.useRef(t);return dr(()=>{n.current=t}),v.useCallback(function(){for(var l=arguments.length,s=new Array(l),o=0;o<l;o++)s[o]=arguments[o];return n.current==null?void 0:n.current(...s)},[])}function O2(){const t=v.useRef(null),n=v.useCallback((s,o)=>{t.current=setInterval(s,o)},[]),l=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[n,l]}function Mo(t,n){n===void 0&&(n=[t]);const l=v.useRef(t);return dr(()=>{l.current!==t&&(l.current=t)},n),l}function Go(t,n){const l=v.useRef();return v.useMemo(()=>{const s=t(l.current);return l.current=s,s},[...n])}function _c(t){const n=ad(t),l=v.useRef(null),s=v.useCallback(o=>{o!==l.current&&(n==null||n(o,l.current)),l.current=o},[]);return[l,s]}function Lc(t){const n=v.useRef();return v.useEffect(()=>{n.current=t},[t]),n.current}let Nh={};function Xo(t,n){return v.useMemo(()=>{if(n)return n;const l=Nh[t]==null?0:Nh[t]+1;return Nh[t]=l,t+"-"+l},[t,n])}function d0(t){return function(n){for(var l=arguments.length,s=new Array(l>1?l-1:0),o=1;o<l;o++)s[o-1]=arguments[o];return s.reduce((u,f)=>{const m=Object.entries(f);for(const[p,g]of m){const x=u[p];x!=null&&(u[p]=x+t*g)}return u},{...n})}}const di=d0(1),zc=d0(-1);function M2(t){return"clientX"in t&&"clientY"in t}function nd(t){if(!t)return!1;const{KeyboardEvent:n}=pn(t.target);return n&&t instanceof n}function _2(t){if(!t)return!1;const{TouchEvent:n}=pn(t.target);return n&&t instanceof n}function Uc(t){if(_2(t)){if(t.touches&&t.touches.length){const{clientX:n,clientY:l}=t.touches[0];return{x:n,y:l}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:n,clientY:l}=t.changedTouches[0];return{x:n,y:l}}}return M2(t)?{x:t.clientX,y:t.clientY}:null}const Hl=Object.freeze({Translate:{toString(t){if(!t)return;const{x:n,y:l}=t;return"translate3d("+(n?Math.round(n):0)+"px, "+(l?Math.round(l):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:n,scaleY:l}=t;return"scaleX("+n+") scaleY("+l+")"}},Transform:{toString(t){if(t)return[Hl.Translate.toString(t),Hl.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:n,duration:l,easing:s}=t;return n+" "+l+"ms "+s}}}),hx="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function L2(t){return t.matches(hx)?t:t.querySelector(hx)}const z2={display:"none"};function U2(t){let{id:n,value:l}=t;return oa.createElement("div",{id:n,style:z2},l)}function B2(t){let{id:n,announcement:l,ariaLiveType:s="assertive"}=t;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return oa.createElement("div",{id:n,style:o,role:"status","aria-live":s,"aria-atomic":!0},l)}function H2(){const[t,n]=v.useState("");return{announce:v.useCallback(s=>{s!=null&&n(s)},[]),announcement:t}}const f0=v.createContext(null);function $2(t){const n=v.useContext(f0);v.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(t)},[t,n])}function q2(){const[t]=v.useState(()=>new Set),n=v.useCallback(s=>(t.add(s),()=>t.delete(s)),[t]);return[v.useCallback(s=>{let{type:o,event:u}=s;t.forEach(f=>{var m;return(m=f[o])==null?void 0:m.call(f,u)})},[t]),n]}const I2={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
|
-
`},V2={onDragStart(t){let{active:n}=t;return"Picked up draggable item "+n.id+"."},onDragOver(t){let{active:n,over:l}=t;return l?"Draggable item "+n.id+" was moved over droppable area "+l.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(t){let{active:n,over:l}=t;return l?"Draggable item "+n.id+" was dropped over droppable area "+l.id:"Draggable item "+n.id+" was dropped."},onDragCancel(t){let{active:n}=t;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function Y2(t){let{announcements:n=V2,container:l,hiddenTextDescribedById:s,screenReaderInstructions:o=I2}=t;const{announce:u,announcement:f}=H2(),m=Xo("DndLiveRegion"),[p,g]=v.useState(!1);if(v.useEffect(()=>{g(!0)},[]),$2(v.useMemo(()=>({onDragStart(y){let{active:N}=y;u(n.onDragStart({active:N}))},onDragMove(y){let{active:N,over:S}=y;n.onDragMove&&u(n.onDragMove({active:N,over:S}))},onDragOver(y){let{active:N,over:S}=y;u(n.onDragOver({active:N,over:S}))},onDragEnd(y){let{active:N,over:S}=y;u(n.onDragEnd({active:N,over:S}))},onDragCancel(y){let{active:N,over:S}=y;u(n.onDragCancel({active:N,over:S}))}}),[u,n])),!p)return null;const x=oa.createElement(oa.Fragment,null,oa.createElement(U2,{id:s,value:o.draggable}),oa.createElement(B2,{id:m,announcement:f}));return l?rl.createPortal(x,l):x}var za;(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"})(za||(za={}));function Bc(){}function F2(t,n){return v.useMemo(()=>({sensor:t,options:n??{}}),[t,n])}function P2(){for(var t=arguments.length,n=new Array(t),l=0;l<t;l++)n[l]=arguments[l];return v.useMemo(()=>[...n].filter(s=>s!=null),[...n])}const fr=Object.freeze({x:0,y:0});function G2(t,n){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function X2(t,n){const l=Uc(t);if(!l)return"0 0";const s={x:(l.x-n.left)/n.width*100,y:(l.y-n.top)/n.height*100};return s.x+"% "+s.y+"%"}function Q2(t,n){let{data:{value:l}}=t,{data:{value:s}}=n;return l-s}function K2(t,n){let{data:{value:l}}=t,{data:{value:s}}=n;return s-l}function Z2(t,n){if(!t||t.length===0)return null;const[l]=t;return l[n]}function mx(t,n,l){return n===void 0&&(n=t.left),l===void 0&&(l=t.top),{x:n+t.width*.5,y:l+t.height*.5}}const J2=t=>{let{collisionRect:n,droppableRects:l,droppableContainers:s}=t;const o=mx(n,n.left,n.top),u=[];for(const f of s){const{id:m}=f,p=l.get(m);if(p){const g=G2(mx(p),o);u.push({id:m,data:{droppableContainer:f,value:g}})}}return u.sort(Q2)};function W2(t,n){const l=Math.max(n.top,t.top),s=Math.max(n.left,t.left),o=Math.min(n.left+n.width,t.left+t.width),u=Math.min(n.top+n.height,t.top+t.height),f=o-s,m=u-l;if(s<o&&l<u){const p=n.width*n.height,g=t.width*t.height,x=f*m,y=x/(p+g-x);return Number(y.toFixed(4))}return 0}const ej=t=>{let{collisionRect:n,droppableRects:l,droppableContainers:s}=t;const o=[];for(const u of s){const{id:f}=u,m=l.get(f);if(m){const p=W2(m,n);p>0&&o.push({id:f,data:{droppableContainer:u,value:p}})}}return o.sort(K2)};function tj(t,n,l){return{...t,scaleX:n&&l?n.width/l.width:1,scaleY:n&&l?n.height/l.height:1}}function h0(t,n){return t&&n?{x:t.left-n.left,y:t.top-n.top}:fr}function aj(t){return function(l){for(var s=arguments.length,o=new Array(s>1?s-1:0),u=1;u<s;u++)o[u-1]=arguments[u];return o.reduce((f,m)=>({...f,top:f.top+t*m.y,bottom:f.bottom+t*m.y,left:f.left+t*m.x,right:f.right+t*m.x}),{...l})}}const nj=aj(1);function m0(t){if(t.startsWith("matrix3d(")){const n=t.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(t.startsWith("matrix(")){const n=t.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function rj(t,n,l){const s=m0(n);if(!s)return t;const{scaleX:o,scaleY:u,x:f,y:m}=s,p=t.left-f-(1-o)*parseFloat(l),g=t.top-m-(1-u)*parseFloat(l.slice(l.indexOf(" ")+1)),x=o?t.width/o:t.width,y=u?t.height/u:t.height;return{width:x,height:y,top:g,right:p+x,bottom:g+y,left:p}}const lj={ignoreTransform:!1};function yi(t,n){n===void 0&&(n=lj);let l=t.getBoundingClientRect();if(n.ignoreTransform){const{transform:g,transformOrigin:x}=pn(t).getComputedStyle(t);g&&(l=rj(l,g,x))}const{top:s,left:o,width:u,height:f,bottom:m,right:p}=l;return{top:s,left:o,width:u,height:f,bottom:m,right:p}}function px(t){return yi(t,{ignoreTransform:!0})}function sj(t){const n=t.innerWidth,l=t.innerHeight;return{top:0,left:0,right:n,bottom:l,width:n,height:l}}function ij(t,n){return n===void 0&&(n=pn(t).getComputedStyle(t)),n.position==="fixed"}function oj(t,n){n===void 0&&(n=pn(t).getComputedStyle(t));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const u=n[o];return typeof u=="string"?l.test(u):!1})}function Dm(t,n){const l=[];function s(o){if(n!=null&&l.length>=n||!o)return l;if(Am(o)&&o.scrollingElement!=null&&!l.includes(o.scrollingElement))return l.push(o.scrollingElement),l;if(!Po(o)||c0(o)||l.includes(o))return l;const u=pn(t).getComputedStyle(o);return o!==t&&oj(o,u)&&l.push(o),ij(o,u)?l:s(o.parentNode)}return t?s(t):l}function p0(t){const[n]=Dm(t,1);return n??null}function Rh(t){return!td||!t?null:gi(t)?t:Cm(t)?Am(t)||t===vi(t).scrollingElement?window:Po(t)?t:null:null}function g0(t){return gi(t)?t.scrollX:t.scrollLeft}function v0(t){return gi(t)?t.scrollY:t.scrollTop}function Qh(t){return{x:g0(t),y:v0(t)}}var Ia;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Ia||(Ia={}));function y0(t){return!td||!t?!1:t===document.scrollingElement}function x0(t){const n={x:0,y:0},l=y0(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},s={x:t.scrollWidth-l.width,y:t.scrollHeight-l.height},o=t.scrollTop<=n.y,u=t.scrollLeft<=n.x,f=t.scrollTop>=s.y,m=t.scrollLeft>=s.x;return{isTop:o,isLeft:u,isBottom:f,isRight:m,maxScroll:s,minScroll:n}}const uj={x:.2,y:.2};function cj(t,n,l,s,o){let{top:u,left:f,right:m,bottom:p}=l;s===void 0&&(s=10),o===void 0&&(o=uj);const{isTop:g,isBottom:x,isLeft:y,isRight:N}=x0(t),S={x:0,y:0},w={x:0,y:0},A={height:n.height*o.y,width:n.width*o.x};return!g&&u<=n.top+A.height?(S.y=Ia.Backward,w.y=s*Math.abs((n.top+A.height-u)/A.height)):!x&&p>=n.bottom-A.height&&(S.y=Ia.Forward,w.y=s*Math.abs((n.bottom-A.height-p)/A.height)),!N&&m>=n.right-A.width?(S.x=Ia.Forward,w.x=s*Math.abs((n.right-A.width-m)/A.width)):!y&&f<=n.left+A.width&&(S.x=Ia.Backward,w.x=s*Math.abs((n.left+A.width-f)/A.width)),{direction:S,speed:w}}function dj(t){if(t===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:n,left:l,right:s,bottom:o}=t.getBoundingClientRect();return{top:n,left:l,right:s,bottom:o,width:t.clientWidth,height:t.clientHeight}}function b0(t){return t.reduce((n,l)=>di(n,Qh(l)),fr)}function fj(t){return t.reduce((n,l)=>n+g0(l),0)}function hj(t){return t.reduce((n,l)=>n+v0(l),0)}function S0(t,n){if(n===void 0&&(n=yi),!t)return;const{top:l,left:s,bottom:o,right:u}=n(t);p0(t)&&(o<=0||u<=0||l>=window.innerHeight||s>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const mj=[["x",["left","right"],fj],["y",["top","bottom"],hj]];class km{constructor(n,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=Dm(l),o=b0(s);this.rect={...n},this.width=n.width,this.height=n.height;for(const[u,f,m]of mj)for(const p of f)Object.defineProperty(this,p,{get:()=>{const g=m(s),x=o[u]-g;return this.rect[p]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class jo{constructor(n){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=n}add(n,l,s){var o;(o=this.target)==null||o.addEventListener(n,l,s),this.listeners.push([n,l,s])}}function pj(t){const{EventTarget:n}=pn(t);return t instanceof n?t:vi(t)}function jh(t,n){const l=Math.abs(t.x),s=Math.abs(t.y);return typeof n=="number"?Math.sqrt(l**2+s**2)>n:"x"in n&&"y"in n?l>n.x&&s>n.y:"x"in n?l>n.x:"y"in n?s>n.y:!1}var Zn;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Zn||(Zn={}));function gx(t){t.preventDefault()}function gj(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 w0={start:[Mt.Space,Mt.Enter],cancel:[Mt.Esc],end:[Mt.Space,Mt.Enter,Mt.Tab]},vj=(t,n)=>{let{currentCoordinates:l}=n;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 E0{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:l}}=n;this.props=n,this.listeners=new jo(vi(l)),this.windowListeners=new jo(pn(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Zn.Resize,this.handleCancel),this.windowListeners.add(Zn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Zn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:l}=this.props,s=n.node.current;s&&S0(s),l(fr)}handleKeyDown(n){if(nd(n)){const{active:l,context:s,options:o}=this.props,{keyboardCodes:u=w0,coordinateGetter:f=vj,scrollBehavior:m="smooth"}=o,{code:p}=n;if(u.end.includes(p)){this.handleEnd(n);return}if(u.cancel.includes(p)){this.handleCancel(n);return}const{collisionRect:g}=s.current,x=g?{x:g.left,y:g.top}:fr;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(n,{active:l,context:s.current,currentCoordinates:x});if(y){const N=zc(y,x),S={x:0,y:0},{scrollableAncestors:w}=s.current;for(const A of w){const R=n.code,{isTop:L,isRight:I,isLeft:q,isBottom:X,maxScroll:W,minScroll:ne}=x0(A),z=dj(A),T={x:Math.min(R===Mt.Right?z.right-z.width/2:z.right,Math.max(R===Mt.Right?z.left:z.left+z.width/2,y.x)),y:Math.min(R===Mt.Down?z.bottom-z.height/2:z.bottom,Math.max(R===Mt.Down?z.top:z.top+z.height/2,y.y))},ee=R===Mt.Right&&!I||R===Mt.Left&&!q,fe=R===Mt.Down&&!X||R===Mt.Up&&!L;if(ee&&T.x!==y.x){const be=A.scrollLeft+N.x,ye=R===Mt.Right&&be<=W.x||R===Mt.Left&&be>=ne.x;if(ye&&!N.y){A.scrollTo({left:be,behavior:m});return}ye?S.x=A.scrollLeft-be:S.x=R===Mt.Right?A.scrollLeft-W.x:A.scrollLeft-ne.x,S.x&&A.scrollBy({left:-S.x,behavior:m});break}else if(fe&&T.y!==y.y){const be=A.scrollTop+N.y,ye=R===Mt.Down&&be<=W.y||R===Mt.Up&&be>=ne.y;if(ye&&!N.x){A.scrollTo({top:be,behavior:m});return}ye?S.y=A.scrollTop-be:S.y=R===Mt.Down?A.scrollTop-W.y:A.scrollTop-ne.y,S.y&&A.scrollBy({top:-S.y,behavior:m});break}}this.handleMove(n,di(zc(y,this.referenceCoordinates),S))}}}handleMove(n,l){const{onMove:s}=this.props;n.preventDefault(),s(l)}handleEnd(n){const{onEnd:l}=this.props;n.preventDefault(),this.detach(),l()}handleCancel(n){const{onCancel:l}=this.props;n.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}E0.activators=[{eventName:"onKeyDown",handler:(t,n,l)=>{let{keyboardCodes:s=w0,onActivation:o}=n,{active:u}=l;const{code:f}=t.nativeEvent;if(s.start.includes(f)){const m=u.activatorNode.current;return m&&t.target!==m?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function vx(t){return!!(t&&"distance"in t)}function yx(t){return!!(t&&"delay"in t)}class Om{constructor(n,l,s){var o;s===void 0&&(s=pj(n.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=n,this.events=l;const{event:u}=n,{target:f}=u;this.props=n,this.events=l,this.document=vi(f),this.documentListeners=new jo(this.document),this.listeners=new jo(s),this.windowListeners=new jo(pn(f)),this.initialCoordinates=(o=Uc(u))!=null?o:fr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:n,props:{options:{activationConstraint:l,bypassActivationConstraint:s}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(Zn.Resize,this.handleCancel),this.windowListeners.add(Zn.DragStart,gx),this.windowListeners.add(Zn.VisibilityChange,this.handleCancel),this.windowListeners.add(Zn.ContextMenu,gx),this.documentListeners.add(Zn.Keydown,this.handleKeydown),l){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(yx(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(vx(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(n,l){const{active:s,onPending:o}=this.props;o(s,n,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:n}=this,{onStart:l}=this.props;n&&(this.activated=!0,this.documentListeners.add(Zn.Click,gj,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Zn.SelectionChange,this.removeTextSelection),l(n))}handleMove(n){var l;const{activated:s,initialCoordinates:o,props:u}=this,{onMove:f,options:{activationConstraint:m}}=u;if(!o)return;const p=(l=Uc(n))!=null?l:fr,g=zc(o,p);if(!s&&m){if(vx(m)){if(m.tolerance!=null&&jh(g,m.tolerance))return this.handleCancel();if(jh(g,m.distance))return this.handleStart()}if(yx(m)&&jh(g,m.tolerance))return this.handleCancel();this.handlePending(m,g);return}n.cancelable&&n.preventDefault(),f(p)}handleEnd(){const{onAbort:n,onEnd:l}=this.props;this.detach(),this.activated||n(this.props.active),l()}handleCancel(){const{onAbort:n,onCancel:l}=this.props;this.detach(),this.activated||n(this.props.active),l()}handleKeydown(n){n.code===Mt.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const yj={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Mm extends Om{constructor(n){const{event:l}=n,s=vi(l.target);super(n,yj,s)}}Mm.activators=[{eventName:"onPointerDown",handler:(t,n)=>{let{nativeEvent:l}=t,{onActivation:s}=n;return!l.isPrimary||l.button!==0?!1:(s==null||s({event:l}),!0)}}];const xj={move:{name:"mousemove"},end:{name:"mouseup"}};var Kh;(function(t){t[t.RightClick=2]="RightClick"})(Kh||(Kh={}));class bj extends Om{constructor(n){super(n,xj,vi(n.event.target))}}bj.activators=[{eventName:"onMouseDown",handler:(t,n)=>{let{nativeEvent:l}=t,{onActivation:s}=n;return l.button===Kh.RightClick?!1:(s==null||s({event:l}),!0)}}];const Th={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Sj extends Om{constructor(n){super(n,Th)}static setup(){return window.addEventListener(Th.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(Th.move.name,n)};function n(){}}}Sj.activators=[{eventName:"onTouchStart",handler:(t,n)=>{let{nativeEvent:l}=t,{onActivation:s}=n;const{touches:o}=l;return o.length>1?!1:(s==null||s({event:l}),!0)}}];var To;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(To||(To={}));var Hc;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Hc||(Hc={}));function wj(t){let{acceleration:n,activator:l=To.Pointer,canScroll:s,draggingRect:o,enabled:u,interval:f=5,order:m=Hc.TreeOrder,pointerCoordinates:p,scrollableAncestors:g,scrollableAncestorRects:x,delta:y,threshold:N}=t;const S=Nj({delta:y,disabled:!u}),[w,A]=O2(),R=v.useRef({x:0,y:0}),L=v.useRef({x:0,y:0}),I=v.useMemo(()=>{switch(l){case To.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case To.DraggableRect:return o}},[l,o,p]),q=v.useRef(null),X=v.useCallback(()=>{const ne=q.current;if(!ne)return;const z=R.current.x*L.current.x,T=R.current.y*L.current.y;ne.scrollBy(z,T)},[]),W=v.useMemo(()=>m===Hc.TreeOrder?[...g].reverse():g,[m,g]);v.useEffect(()=>{if(!u||!g.length||!I){A();return}for(const ne of W){if((s==null?void 0:s(ne))===!1)continue;const z=g.indexOf(ne),T=x[z];if(!T)continue;const{direction:ee,speed:fe}=cj(ne,T,I,n,N);for(const be of["x","y"])S[be][ee[be]]||(fe[be]=0,ee[be]=0);if(fe.x>0||fe.y>0){A(),q.current=ne,w(X,f),R.current=fe,L.current=ee;return}}R.current={x:0,y:0},L.current={x:0,y:0},A()},[n,X,s,A,u,f,JSON.stringify(I),JSON.stringify(S),w,g,W,x,JSON.stringify(N)])}const Ej={x:{[Ia.Backward]:!1,[Ia.Forward]:!1},y:{[Ia.Backward]:!1,[Ia.Forward]:!1}};function Nj(t){let{delta:n,disabled:l}=t;const s=Lc(n);return Go(o=>{if(l||!s||!o)return Ej;const u={x:Math.sign(n.x-s.x),y:Math.sign(n.y-s.y)};return{x:{[Ia.Backward]:o.x[Ia.Backward]||u.x===-1,[Ia.Forward]:o.x[Ia.Forward]||u.x===1},y:{[Ia.Backward]:o.y[Ia.Backward]||u.y===-1,[Ia.Forward]:o.y[Ia.Forward]||u.y===1}}},[l,n,s])}function Rj(t,n){const l=n!=null?t.get(n):void 0,s=l?l.node.current:null;return Go(o=>{var u;return n==null?null:(u=s??o)!=null?u:null},[s,n])}function jj(t,n){return v.useMemo(()=>t.reduce((l,s)=>{const{sensor:o}=s,u=o.activators.map(f=>({eventName:f.eventName,handler:n(f.handler,s)}));return[...l,...u]},[]),[t,n])}var _o;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(_o||(_o={}));var Zh;(function(t){t.Optimized="optimized"})(Zh||(Zh={}));const xx=new Map;function Tj(t,n){let{dragging:l,dependencies:s,config:o}=n;const[u,f]=v.useState(null),{frequency:m,measure:p,strategy:g}=o,x=v.useRef(t),y=R(),N=Mo(y),S=v.useCallback(function(L){L===void 0&&(L=[]),!N.current&&f(I=>I===null?L:I.concat(L.filter(q=>!I.includes(q))))},[N]),w=v.useRef(null),A=Go(L=>{if(y&&!l)return xx;if(!L||L===xx||x.current!==t||u!=null){const I=new Map;for(let q of t){if(!q)continue;if(u&&u.length>0&&!u.includes(q.id)&&q.rect.current){I.set(q.id,q.rect.current);continue}const X=q.node.current,W=X?new km(p(X),X):null;q.rect.current=W,W&&I.set(q.id,W)}return I}return L},[t,u,l,y,p]);return v.useEffect(()=>{x.current=t},[t]),v.useEffect(()=>{y||S()},[l,y]),v.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),v.useEffect(()=>{y||typeof m!="number"||w.current!==null||(w.current=setTimeout(()=>{S(),w.current=null},m))},[m,y,S,...s]),{droppableRects:A,measureDroppableContainers:S,measuringScheduled:u!=null};function R(){switch(g){case _o.Always:return!1;case _o.BeforeDragging:return l;default:return!l}}}function _m(t,n){return Go(l=>t?l||(typeof n=="function"?n(t):t):null,[n,t])}function Cj(t,n){return _m(t,n)}function Aj(t){let{callback:n,disabled:l}=t;const s=ad(n),o=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(s)},[s,l]);return v.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function rd(t){let{callback:n,disabled:l}=t;const s=ad(n),o=v.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(s)},[l]);return v.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Dj(t){return new km(yi(t),t)}function bx(t,n,l){n===void 0&&(n=Dj);const[s,o]=v.useState(null);function u(){o(p=>{if(!t)return null;if(t.isConnected===!1){var g;return(g=p??l)!=null?g:null}const x=n(t);return JSON.stringify(p)===JSON.stringify(x)?p:x})}const f=Aj({callback(p){if(t)for(const g of p){const{type:x,target:y}=g;if(x==="childList"&&y instanceof HTMLElement&&y.contains(t)){u();break}}}}),m=rd({callback:u});return dr(()=>{u(),t?(m==null||m.observe(t),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(m==null||m.disconnect(),f==null||f.disconnect())},[t]),s}function kj(t){const n=_m(t);return h0(t,n)}const Sx=[];function Oj(t){const n=v.useRef(t),l=Go(s=>t?s&&s!==Sx&&t&&n.current&&t.parentNode===n.current.parentNode?s:Dm(t):Sx,[t]);return v.useEffect(()=>{n.current=t},[t]),l}function Mj(t){const[n,l]=v.useState(null),s=v.useRef(t),o=v.useCallback(u=>{const f=Rh(u.target);f&&l(m=>m?(m.set(f,Qh(f)),new Map(m)):null)},[]);return v.useEffect(()=>{const u=s.current;if(t!==u){f(u);const m=t.map(p=>{const g=Rh(p);return g?(g.addEventListener("scroll",o,{passive:!0}),[g,Qh(g)]):null}).filter(p=>p!=null);l(m.length?new Map(m):null),s.current=t}return()=>{f(t),f(u)};function f(m){m.forEach(p=>{const g=Rh(p);g==null||g.removeEventListener("scroll",o)})}},[o,t]),v.useMemo(()=>t.length?n?Array.from(n.values()).reduce((u,f)=>di(u,f),fr):b0(t):fr,[t,n])}function wx(t,n){n===void 0&&(n=[]);const l=v.useRef(null);return v.useEffect(()=>{l.current=null},n),v.useEffect(()=>{const s=t!==fr;s&&!l.current&&(l.current=t),!s&&l.current&&(l.current=null)},[t]),l.current?zc(t,l.current):fr}function _j(t){v.useEffect(()=>{if(!td)return;const n=t.map(l=>{let{sensor:s}=l;return s.setup==null?void 0:s.setup()});return()=>{for(const l of n)l==null||l()}},t.map(n=>{let{sensor:l}=n;return l}))}function Lj(t,n){return v.useMemo(()=>t.reduce((l,s)=>{let{eventName:o,handler:u}=s;return l[o]=f=>{u(f,n)},l},{}),[t,n])}function N0(t){return v.useMemo(()=>t?sj(t):null,[t])}const Ex=[];function zj(t,n){n===void 0&&(n=yi);const[l]=t,s=N0(l?pn(l):null),[o,u]=v.useState(Ex);function f(){u(()=>t.length?t.map(p=>y0(p)?s:new km(n(p),p)):Ex)}const m=rd({callback:f});return dr(()=>{m==null||m.disconnect(),f(),t.forEach(p=>m==null?void 0:m.observe(p))},[t]),o}function R0(t){if(!t)return null;if(t.children.length>1)return t;const n=t.children[0];return Po(n)?n:t}function Uj(t){let{measure:n}=t;const[l,s]=v.useState(null),o=v.useCallback(g=>{for(const{target:x}of g)if(Po(x)){s(y=>{const N=n(x);return y?{...y,width:N.width,height:N.height}:N});break}},[n]),u=rd({callback:o}),f=v.useCallback(g=>{const x=R0(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),s(x?n(x):null)},[n,u]),[m,p]=_c(f);return v.useMemo(()=>({nodeRef:m,rect:l,setRef:p}),[l,m,p])}const Bj=[{sensor:Mm,options:{}},{sensor:E0,options:{}}],Hj={current:{}},Nc={draggable:{measure:px},droppable:{measure:px,strategy:_o.WhileDragging,frequency:Zh.Optimized},dragOverlay:{measure:yi}};class Co extends Map{get(n){var l;return n!=null&&(l=super.get(n))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:l}=n;return!l})}getNodeFor(n){var l,s;return(l=(s=this.get(n))==null?void 0:s.node.current)!=null?l:void 0}}const $j={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Co,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Bc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Nc,measureDroppableContainers:Bc,windowRect:null,measuringScheduled:!1},j0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Bc,draggableNodes:new Map,over:null,measureDroppableContainers:Bc},Qo=v.createContext(j0),T0=v.createContext($j);function qj(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Co}}}function Ij(t,n){switch(n.type){case za.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case za.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:n.coordinates.x-t.draggable.initialCoordinates.x,y:n.coordinates.y-t.draggable.initialCoordinates.y}}};case za.DragEnd:case za.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case za.RegisterDroppable:{const{element:l}=n,{id:s}=l,o=new Co(t.droppable.containers);return o.set(s,l),{...t,droppable:{...t.droppable,containers:o}}}case za.SetDroppableDisabled:{const{id:l,key:s,disabled:o}=n,u=t.droppable.containers.get(l);if(!u||s!==u.key)return t;const f=new Co(t.droppable.containers);return f.set(l,{...u,disabled:o}),{...t,droppable:{...t.droppable,containers:f}}}case za.UnregisterDroppable:{const{id:l,key:s}=n,o=t.droppable.containers.get(l);if(!o||s!==o.key)return t;const u=new Co(t.droppable.containers);return u.delete(l),{...t,droppable:{...t.droppable,containers:u}}}default:return t}}function Vj(t){let{disabled:n}=t;const{active:l,activatorEvent:s,draggableNodes:o}=v.useContext(Qo),u=Lc(s),f=Lc(l==null?void 0:l.id);return v.useEffect(()=>{if(!n&&!s&&u&&f!=null){if(!nd(u)||document.activeElement===u.target)return;const m=o.get(f);if(!m)return;const{activatorNode:p,node:g}=m;if(!p.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[p.current,g.current]){if(!x)continue;const y=L2(x);if(y){y.focus();break}}})}},[s,n,o,f,u]),null}function C0(t,n){let{transform:l,...s}=n;return t!=null&&t.length?t.reduce((o,u)=>u({transform:o,...s}),l):l}function Yj(t){return v.useMemo(()=>({draggable:{...Nc.draggable,...t==null?void 0:t.draggable},droppable:{...Nc.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Nc.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function Fj(t){let{activeNode:n,measure:l,initialRect:s,config:o=!0}=t;const u=v.useRef(!1),{x:f,y:m}=typeof o=="boolean"?{x:o,y:o}:o;dr(()=>{if(!f&&!m||!n){u.current=!1;return}if(u.current||!s)return;const g=n==null?void 0:n.node.current;if(!g||g.isConnected===!1)return;const x=l(g),y=h0(x,s);if(f||(y.x=0),m||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const N=p0(g);N&&N.scrollBy({top:y.y,left:y.x})}},[n,f,m,s,l])}const ld=v.createContext({...fr,scaleX:1,scaleY:1});var Ll;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ll||(Ll={}));const Pj=v.memo(function(n){var l,s,o,u;let{id:f,accessibility:m,autoScroll:p=!0,children:g,sensors:x=Bj,collisionDetection:y=ej,measuring:N,modifiers:S,...w}=n;const A=v.useReducer(Ij,void 0,qj),[R,L]=A,[I,q]=q2(),[X,W]=v.useState(Ll.Uninitialized),ne=X===Ll.Initialized,{draggable:{active:z,nodes:T,translate:ee},droppable:{containers:fe}}=R,be=z!=null?T.get(z):null,ye=v.useRef({initial:null,translated:null}),te=v.useMemo(()=>{var yt;return z!=null?{id:z,data:(yt=be==null?void 0:be.data)!=null?yt:Hj,rect:ye}:null},[z,be]),re=v.useRef(null),[ge,U]=v.useState(null),[B,ue]=v.useState(null),de=Mo(w,Object.values(w)),we=Xo("DndDescribedBy",f),C=v.useMemo(()=>fe.getEnabled(),[fe]),V=Yj(N),{droppableRects:ae,measureDroppableContainers:me,measuringScheduled:Ne}=Tj(C,{dragging:ne,dependencies:[ee.x,ee.y],config:V.droppable}),je=Rj(T,z),ze=v.useMemo(()=>B?Uc(B):null,[B]),ut=vt(),Ge=Cj(je,V.draggable.measure);Fj({activeNode:z!=null?T.get(z):null,config:ut.layoutShiftCompensation,initialRect:Ge,measure:V.draggable.measure});const at=bx(je,V.draggable.measure,Ge),ba=bx(je?je.parentElement:null),Xt=v.useRef({activatorEvent:null,active:null,activeNode:je,collisionRect:null,collisions:null,droppableRects:ae,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:fe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ft=fe.getNodeFor((l=Xt.current.over)==null?void 0:l.id),oe=Uj({measure:V.dragOverlay.measure}),$e=(s=oe.nodeRef.current)!=null?s:je,nt=ne?(o=oe.rect)!=null?o:at:null,Ut=!!(oe.nodeRef.current&&oe.rect),ma=kj(Ut?null:at),jt=N0($e?pn($e):null),_t=Oj(ne?ft??je:null),Qt=zj(_t),Ba=C0(S,{transform:{x:ee.x-ma.x,y:ee.y-ma.y,scaleX:1,scaleY:1},activatorEvent:B,active:te,activeNodeRect:at,containerNodeRect:ba,draggingNodeRect:nt,over:Xt.current.over,overlayNodeRect:oe.rect,scrollableAncestors:_t,scrollableAncestorRects:Qt,windowRect:jt}),Ha=ze?di(ze,ee):null,ta=Mj(_t),dn=wx(ta),fn=wx(ta,[at]),Ja=di(Ba,dn),$a=nt?nj(nt,Ba):null,he=te&&$a?y({active:te,collisionRect:$a,droppableRects:ae,droppableContainers:C,pointerCoordinates:Ha}):null,Ce=Z2(he,"id"),[Ae,Pe]=v.useState(null),qe=Ut?Ba:di(Ba,fn),Z=tj(qe,(u=Ae==null?void 0:Ae.rect)!=null?u:null,at),Tt=v.useRef(null),Kt=v.useCallback((yt,wt)=>{let{sensor:Bt,options:Ct}=wt;if(re.current==null)return;const aa=T.get(re.current);if(!aa)return;const Zt=yt.nativeEvent,Ht=new Bt({active:re.current,activeNode:aa,event:Zt,options:Ct,context:Xt,onAbort(Je){if(!T.get(Je))return;const{onDragAbort:Da}=de.current,D={id:Je};Da==null||Da(D),I({type:"onDragAbort",event:D})},onPending(Je,Sa,Da,D){if(!T.get(Je))return;const{onDragPending:$}=de.current,K={id:Je,constraint:Sa,initialCoordinates:Da,offset:D};$==null||$(K),I({type:"onDragPending",event:K})},onStart(Je){const Sa=re.current;if(Sa==null)return;const Da=T.get(Sa);if(!Da)return;const{onDragStart:D}=de.current,M={activatorEvent:Zt,active:{id:Sa,data:Da.data,rect:ye}};rl.unstable_batchedUpdates(()=>{D==null||D(M),W(Ll.Initializing),L({type:za.DragStart,initialCoordinates:Je,active:Sa}),I({type:"onDragStart",event:M}),U(Tt.current),ue(Zt)})},onMove(Je){L({type:za.DragMove,coordinates:Je})},onEnd:ht(za.DragEnd),onCancel:ht(za.DragCancel)});Tt.current=Ht;function ht(Je){return async function(){const{active:Da,collisions:D,over:M,scrollAdjustedTranslate:$}=Xt.current;let K=null;if(Da&&$){const{cancelDrop:se}=de.current;K={activatorEvent:Zt,active:Da,collisions:D,delta:$,over:M},Je===za.DragEnd&&typeof se=="function"&&await Promise.resolve(se(K))&&(Je=za.DragCancel)}re.current=null,rl.unstable_batchedUpdates(()=>{L({type:Je}),W(Ll.Uninitialized),Pe(null),U(null),ue(null),Tt.current=null;const se=Je===za.DragEnd?"onDragEnd":"onDragCancel";if(K){const Te=de.current[se];Te==null||Te(K),I({type:se,event:K})}})}}},[T]),Va=v.useCallback((yt,wt)=>(Bt,Ct)=>{const aa=Bt.nativeEvent,Zt=T.get(Ct);if(re.current!==null||!Zt||aa.dndKit||aa.defaultPrevented)return;const Ht={active:Zt};yt(Bt,wt.options,Ht)===!0&&(aa.dndKit={capturedBy:wt.sensor},re.current=Ct,Kt(Bt,wt))},[T,Kt]),pa=jj(x,Va);_j(x),dr(()=>{at&&X===Ll.Initializing&&W(Ll.Initialized)},[at,X]),v.useEffect(()=>{const{onDragMove:yt}=de.current,{active:wt,activatorEvent:Bt,collisions:Ct,over:aa}=Xt.current;if(!wt||!Bt)return;const Zt={active:wt,activatorEvent:Bt,collisions:Ct,delta:{x:Ja.x,y:Ja.y},over:aa};rl.unstable_batchedUpdates(()=>{yt==null||yt(Zt),I({type:"onDragMove",event:Zt})})},[Ja.x,Ja.y]),v.useEffect(()=>{const{active:yt,activatorEvent:wt,collisions:Bt,droppableContainers:Ct,scrollAdjustedTranslate:aa}=Xt.current;if(!yt||re.current==null||!wt||!aa)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:aa.x,y:aa.y},over:ht};rl.unstable_batchedUpdates(()=>{Pe(ht),Zt==null||Zt(Je),I({type:"onDragOver",event:Je})})},[Ce]),dr(()=>{Xt.current={activatorEvent:B,active:te,activeNode:je,collisionRect:$a,collisions:he,droppableRects:ae,draggableNodes:T,draggingNode:$e,draggingNodeRect:nt,droppableContainers:fe,over:Ae,scrollableAncestors:_t,scrollAdjustedTranslate:Ja},ye.current={initial:nt,translated:$a}},[te,je,he,$a,T,$e,nt,ae,fe,Ae,_t,Ja]),wj({...ut,delta:ee,draggingRect:$a,pointerCoordinates:Ha,scrollableAncestors:_t,scrollableAncestorRects:Qt});const Bn=v.useMemo(()=>({active:te,activeNode:je,activeNodeRect:at,activatorEvent:B,collisions:he,containerNodeRect:ba,dragOverlay:oe,draggableNodes:T,droppableContainers:fe,droppableRects:ae,over:Ae,measureDroppableContainers:me,scrollableAncestors:_t,scrollableAncestorRects:Qt,measuringConfiguration:V,measuringScheduled:Ne,windowRect:jt}),[te,je,at,B,he,ba,oe,T,fe,ae,Ae,me,_t,Qt,V,Ne,jt]),Me=v.useMemo(()=>({activatorEvent:B,activators:pa,active:te,activeNodeRect:at,ariaDescribedById:{draggable:we},dispatch:L,draggableNodes:T,over:Ae,measureDroppableContainers:me}),[B,pa,te,at,L,we,T,Ae,me]);return oa.createElement(f0.Provider,{value:q},oa.createElement(Qo.Provider,{value:Me},oa.createElement(T0.Provider,{value:Bn},oa.createElement(ld.Provider,{value:Z},g)),oa.createElement(Vj,{disabled:(m==null?void 0:m.restoreFocus)===!1})),oa.createElement(Y2,{...m,hiddenTextDescribedById:we}));function vt(){const yt=(ge==null?void 0:ge.autoScrollEnabled)===!1,wt=typeof p=="object"?p.enabled===!1:p===!1,Bt=ne&&!yt&&!wt;return typeof p=="object"?{...p,enabled:Bt}:{enabled:Bt}}}),Gj=v.createContext(null),Nx="button",Xj="Draggable";function Qj(t){let{id:n,data:l,disabled:s=!1,attributes:o}=t;const u=Xo(Xj),{activators:f,activatorEvent:m,active:p,activeNodeRect:g,ariaDescribedById:x,draggableNodes:y,over:N}=v.useContext(Qo),{role:S=Nx,roleDescription:w="draggable",tabIndex:A=0}=o??{},R=(p==null?void 0:p.id)===n,L=v.useContext(R?ld:Gj),[I,q]=_c(),[X,W]=_c(),ne=Lj(f,n),z=Mo(l);dr(()=>(y.set(n,{id:n,key:u,node:I,activatorNode:X,data:z}),()=>{const ee=y.get(n);ee&&ee.key===u&&y.delete(n)}),[y,n]);const T=v.useMemo(()=>({role:S,tabIndex:A,"aria-disabled":s,"aria-pressed":R&&S===Nx?!0:void 0,"aria-roledescription":w,"aria-describedby":x.draggable}),[s,S,A,R,w,x.draggable]);return{active:p,activatorEvent:m,activeNodeRect:g,attributes:T,isDragging:R,listeners:s?void 0:ne,node:I,over:N,setNodeRef:q,setActivatorNodeRef:W,transform:L}}function A0(){return v.useContext(T0)}const Kj="Droppable",Zj={timeout:25};function Jj(t){let{data:n,disabled:l=!1,id:s,resizeObserverConfig:o}=t;const u=Xo(Kj),{active:f,dispatch:m,over:p,measureDroppableContainers:g}=v.useContext(Qo),x=v.useRef({disabled:l}),y=v.useRef(!1),N=v.useRef(null),S=v.useRef(null),{disabled:w,updateMeasurementsFor:A,timeout:R}={...Zj,...o},L=Mo(A??s),I=v.useCallback(()=>{if(!y.current){y.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(L.current)?L.current:[L.current]),S.current=null},R)},[R]),q=rd({callback:I,disabled:w||!f}),X=v.useCallback((T,ee)=>{q&&(ee&&(q.unobserve(ee),y.current=!1),T&&q.observe(T))},[q]),[W,ne]=_c(X),z=Mo(n);return v.useEffect(()=>{!q||!W.current||(q.disconnect(),y.current=!1,q.observe(W.current))},[W,q]),v.useEffect(()=>(m({type:za.RegisterDroppable,element:{id:s,key:u,disabled:l,node:W,rect:N,data:z}}),()=>m({type:za.UnregisterDroppable,key:u,id:s})),[s]),v.useEffect(()=>{l!==x.current.disabled&&(m({type:za.SetDroppableDisabled,id:s,key:u,disabled:l}),x.current.disabled=l)},[s,u,l,m]),{active:f,rect:N,isOver:(p==null?void 0:p.id)===s,node:W,over:p,setNodeRef:ne}}function Wj(t){let{animation:n,children:l}=t;const[s,o]=v.useState(null),[u,f]=v.useState(null),m=Lc(l);return!l&&!s&&m&&o(m),dr(()=>{if(!u)return;const p=s==null?void 0:s.key,g=s==null?void 0:s.props.id;if(p==null||g==null){o(null);return}Promise.resolve(n(g,u)).then(()=>{o(null)})},[n,s,u]),oa.createElement(oa.Fragment,null,l,s?v.cloneElement(s,{ref:f}):null)}const eT={x:0,y:0,scaleX:1,scaleY:1};function tT(t){let{children:n}=t;return oa.createElement(Qo.Provider,{value:j0},oa.createElement(ld.Provider,{value:eT},n))}const aT={position:"fixed",touchAction:"none"},nT=t=>nd(t)?"transform 250ms ease":void 0,rT=v.forwardRef((t,n)=>{let{as:l,activatorEvent:s,adjustScale:o,children:u,className:f,rect:m,style:p,transform:g,transition:x=nT}=t;if(!m)return null;const y=o?g:{...g,scaleX:1,scaleY:1},N={...aT,width:m.width,height:m.height,top:m.top,left:m.left,transform:Hl.Transform.toString(y),transformOrigin:o&&s?X2(s,m):void 0,transition:typeof x=="function"?x(s):x,...p};return oa.createElement(l,{className:f,style:N,ref:n},u)}),lT=t=>n=>{let{active:l,dragOverlay:s}=n;const o={},{styles:u,className:f}=t;if(u!=null&&u.active)for(const[m,p]of Object.entries(u.active))p!==void 0&&(o[m]=l.node.style.getPropertyValue(m),l.node.style.setProperty(m,p));if(u!=null&&u.dragOverlay)for(const[m,p]of Object.entries(u.dragOverlay))p!==void 0&&s.node.style.setProperty(m,p);return f!=null&&f.active&&l.node.classList.add(f.active),f!=null&&f.dragOverlay&&s.node.classList.add(f.dragOverlay),function(){for(const[p,g]of Object.entries(o))l.node.style.setProperty(p,g);f!=null&&f.active&&l.node.classList.remove(f.active)}},sT=t=>{let{transform:{initial:n,final:l}}=t;return[{transform:Hl.Transform.toString(n)},{transform:Hl.Transform.toString(l)}]},iT={duration:250,easing:"ease",keyframes:sT,sideEffects:lT({styles:{active:{opacity:"0"}}})};function oT(t){let{config:n,draggableNodes:l,droppableContainers:s,measuringConfiguration:o}=t;return ad((u,f)=>{if(n===null)return;const m=l.get(u);if(!m)return;const p=m.node.current;if(!p)return;const g=R0(f);if(!g)return;const{transform:x}=pn(f).getComputedStyle(f),y=m0(x);if(!y)return;const N=typeof n=="function"?n:uT(n);return S0(p,o.draggable.measure),N({active:{id:u,data:m.data,node:p,rect:o.draggable.measure(p)},draggableNodes:l,dragOverlay:{node:f,rect:o.dragOverlay.measure(g)},droppableContainers:s,measuringConfiguration:o,transform:y})})}function uT(t){const{duration:n,easing:l,sideEffects:s,keyframes:o}={...iT,...t};return u=>{let{active:f,dragOverlay:m,transform:p,...g}=u;if(!n)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},S=o({...g,active:f,dragOverlay:m,transform:{initial:p,final:N}}),[w]=S,A=S[S.length-1];if(JSON.stringify(w)===JSON.stringify(A))return;const R=s==null?void 0:s({active:f,dragOverlay:m,...g}),L=m.node.animate(S,{duration:n,easing:l,fill:"forwards"});return new Promise(I=>{L.onfinish=()=>{R==null||R(),I()}})}}let Rx=0;function cT(t){return v.useMemo(()=>{if(t!=null)return Rx++,Rx},[t])}const dT=oa.memo(t=>{let{adjustScale:n=!1,children:l,dropAnimation:s,style:o,transition:u,modifiers:f,wrapperElement:m="div",className:p,zIndex:g=999}=t;const{activatorEvent:x,active:y,activeNodeRect:N,containerNodeRect:S,draggableNodes:w,droppableContainers:A,dragOverlay:R,over:L,measuringConfiguration:I,scrollableAncestors:q,scrollableAncestorRects:X,windowRect:W}=A0(),ne=v.useContext(ld),z=cT(y==null?void 0:y.id),T=C0(f,{activatorEvent:x,active:y,activeNodeRect:N,containerNodeRect:S,draggingNodeRect:R.rect,over:L,overlayNodeRect:R.rect,scrollableAncestors:q,scrollableAncestorRects:X,transform:ne,windowRect:W}),ee=_m(N),fe=oT({config:s,draggableNodes:w,droppableContainers:A,measuringConfiguration:I}),be=ee?R.setRef:void 0;return oa.createElement(tT,null,oa.createElement(Wj,{animation:fe},y&&z?oa.createElement(rT,{key:z,id:y.id,ref:be,as:m,activatorEvent:x,adjustScale:n,className:p,transition:u,rect:ee,style:{zIndex:g,...o},transform:T},l):null))});function Ao(t,n,l){const s=t.slice();return s.splice(l<0?s.length+l:l,0,s.splice(n,1)[0]),s}function fT(t,n){return t.reduce((l,s,o)=>{const u=n.get(s);return u&&(l[o]=u),l},Array(t.length))}function fc(t){return t!==null&&t>=0}function hT(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let l=0;l<t.length;l++)if(t[l]!==n[l])return!1;return!0}function mT(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const D0=t=>{let{rects:n,activeIndex:l,overIndex:s,index:o}=t;const u=Ao(n,s,l),f=n[o],m=u[o];return!m||!f?null:{x:m.left-f.left,y:m.top-f.top,scaleX:m.width/f.width,scaleY:m.height/f.height}},hc={scaleX:1,scaleY:1},Lm=t=>{var n;let{activeIndex:l,activeNodeRect:s,index:o,rects:u,overIndex:f}=t;const m=(n=u[l])!=null?n:s;if(!m)return null;if(o===l){const g=u[f];return g?{x:0,y:l<f?g.top+g.height-(m.top+m.height):g.top-m.top,...hc}:null}const p=pT(u,o,l);return o>l&&o<=f?{x:0,y:-m.height-p,...hc}:o<l&&o>=f?{x:0,y:m.height+p,...hc}:{x:0,y:0,...hc}};function pT(t,n,l){const s=t[n],o=t[n-1],u=t[n+1];return s?l<n?o?s.top-(o.top+o.height):u?u.top-(s.top+s.height):0:u?u.top-(s.top+s.height):o?s.top-(o.top+o.height):0:0}const k0="Sortable",O0=oa.createContext({activeIndex:-1,containerId:k0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:D0,disabled:{draggable:!1,droppable:!1}});function zm(t){let{children:n,id:l,items:s,strategy:o=D0,disabled:u=!1}=t;const{active:f,dragOverlay:m,droppableRects:p,over:g,measureDroppableContainers:x}=A0(),y=Xo(k0,l),N=m.rect!==null,S=v.useMemo(()=>s.map(ne=>typeof ne=="object"&&"id"in ne?ne.id:ne),[s]),w=f!=null,A=f?S.indexOf(f.id):-1,R=g?S.indexOf(g.id):-1,L=v.useRef(S),I=!hT(S,L.current),q=R!==-1&&A===-1||I,X=mT(u);dr(()=>{I&&w&&x(S)},[I,S,w,x]),v.useEffect(()=>{L.current=S},[S]);const W=v.useMemo(()=>({activeIndex:A,containerId:y,disabled:X,disableTransforms:q,items:S,overIndex:R,useDragOverlay:N,sortedRects:fT(S,p),strategy:o}),[A,y,X.draggable,X.droppable,q,S,R,p,N,o]);return oa.createElement(O0.Provider,{value:W},n)}const gT=t=>{let{id:n,items:l,activeIndex:s,overIndex:o}=t;return Ao(l,s,o).indexOf(n)},vT=t=>{let{containerId:n,isSorting:l,wasDragging:s,index:o,items:u,newIndex:f,previousItems:m,previousContainerId:p,transition:g}=t;return!g||!s||m!==u&&o===f?!1:l?!0:f!==o&&n===p},yT={duration:200,easing:"ease"},M0="transform",xT=Hl.Transition.toString({property:M0,duration:0,easing:"linear"}),bT={roleDescription:"sortable"};function ST(t){let{disabled:n,index:l,node:s,rect:o}=t;const[u,f]=v.useState(null),m=v.useRef(l);return dr(()=>{if(!n&&l!==m.current&&s.current){const p=o.current;if(p){const g=yi(s.current,{ignoreTransform:!0}),x={x:p.left-g.left,y:p.top-g.top,scaleX:p.width/g.width,scaleY:p.height/g.height};(x.x||x.y)&&f(x)}}l!==m.current&&(m.current=l)},[n,l,s,o]),v.useEffect(()=>{u&&f(null)},[u]),u}function wT(t){let{animateLayoutChanges:n=vT,attributes:l,disabled:s,data:o,getNewIndex:u=gT,id:f,strategy:m,resizeObserverConfig:p,transition:g=yT}=t;const{items:x,containerId:y,activeIndex:N,disabled:S,disableTransforms:w,sortedRects:A,overIndex:R,useDragOverlay:L,strategy:I}=v.useContext(O0),q=ET(s,S),X=x.indexOf(f),W=v.useMemo(()=>({sortable:{containerId:y,index:X,items:x},...o}),[y,o,X,x]),ne=v.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:z,node:T,isOver:ee,setNodeRef:fe}=Jj({id:f,data:W,disabled:q.droppable,resizeObserverConfig:{updateMeasurementsFor:ne,...p}}),{active:be,activatorEvent:ye,activeNodeRect:te,attributes:re,setNodeRef:ge,listeners:U,isDragging:B,over:ue,setActivatorNodeRef:de,transform:we}=Qj({id:f,data:W,attributes:{...bT,...l},disabled:q.draggable}),C=k2(fe,ge),V=!!be,ae=V&&!w&&fc(N)&&fc(R),me=!L&&B,Ne=me&&ae?we:null,ze=ae?Ne??(m??I)({rects:A,activeNodeRect:te,activeIndex:N,overIndex:R,index:X}):null,ut=fc(N)&&fc(R)?u({id:f,items:x,activeIndex:N,overIndex:R}):X,Ge=be==null?void 0:be.id,at=v.useRef({activeId:Ge,items:x,newIndex:ut,containerId:y}),ba=x!==at.current.items,Xt=n({active:be,containerId:y,isDragging:B,isSorting:V,id:f,index:X,items:x,newIndex:at.current.newIndex,previousItems:at.current.items,previousContainerId:at.current.containerId,transition:g,wasDragging:at.current.activeId!=null}),ft=ST({disabled:!Xt,index:X,node:T,rect:z});return v.useEffect(()=>{V&&at.current.newIndex!==ut&&(at.current.newIndex=ut),y!==at.current.containerId&&(at.current.containerId=y),x!==at.current.items&&(at.current.items=x)},[V,ut,y,x]),v.useEffect(()=>{if(Ge===at.current.activeId)return;if(Ge!=null&&at.current.activeId==null){at.current.activeId=Ge;return}const $e=setTimeout(()=>{at.current.activeId=Ge},50);return()=>clearTimeout($e)},[Ge]),{active:be,activeIndex:N,attributes:re,data:W,rect:z,index:X,newIndex:ut,items:x,isOver:ee,isSorting:V,isDragging:B,listeners:U,node:T,overIndex:R,over:ue,setNodeRef:C,setActivatorNodeRef:de,setDroppableNodeRef:fe,setDraggableNodeRef:ge,transform:ft??ze,transition:oe()};function oe(){if(ft||ba&&at.current.newIndex===X)return xT;if(!(me&&!nd(ye)||!g)&&(V||Xt))return Hl.Transition.toString({...g,property:M0})}}function ET(t,n){var l,s;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(l=t==null?void 0:t.draggable)!=null?l:n.draggable,droppable:(s=t==null?void 0:t.droppable)!=null?s:n.droppable}}Mt.Down,Mt.Right,Mt.Up,Mt.Left;const NT=[{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 Um({sort:t,onChange:n,label:l="Sort by"}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("label",{htmlFor:"sort-control",className:"hidden text-xs text-[var(--text-muted)] sm:inline",children:l}),c.jsxs("div",{className:"inline-flex h-9 items-center gap-1 rounded-lg border border-[var(--border)] bg-[var(--surface-card)] px-2 py-1 shadow-sm",children:[c.jsxs("div",{className:"relative",children:[c.jsx("select",{id:"sort-control",value:t.key,onChange:s=>n({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:NT.map(s=>c.jsx("option",{value:s.value,children:s.label},s.value))}),c.jsx(xs,{className:"pointer-events-none absolute right-0 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]","aria-hidden":"true"})]}),c.jsx("button",{type:"button",onClick:()=>n({key:t.key,direction:t.direction==="asc"?"desc":"asc"}),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-[var(--text-muted)] transition hover:bg-[var(--surface-strong)] hover:text-[var(--text)]","aria-label":`Sort direction: ${t.direction}`,title:`Sort direction: ${t.direction}`,children:t.direction==="asc"?c.jsx(vN,{className:"h-3.5 w-3.5","aria-hidden":"true"}):c.jsx(mN,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})}const sd=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"paused",label:"Paused"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],id=[{value:"draft",label:"Draft"},{value:"discovery",label:"Discovery"},{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"paused",label:"Paused"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],Ko=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"paused",label:"Paused"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],Bm=Ko.filter(t=>t.value!=="paused"),_0=[{value:"planned",label:"Planned"},{value:"in-progress",label:"In progress"},{value:"paused",label:"Paused"},{value:"done",label:"Done"},{value:"blocked",label:"Blocked"},{value:"canceled",label:"Canceled"},{value:"rejected",label:"Rejected"},{value:"deferred",label:"Deferred"},{value:"waiting",label:"Waiting"}],po=sd.map(t=>t.value),go=id.map(t=>t.value),vo=Ko.map(t=>t.value);function Ch(t,n,l){if(t.includes(n)){const s=t.filter(o=>o!==n);return s.length===0?[...l]:s}return[...t,n]}function ei(t,n){return n.includes(t)}function ir(t,n){return`agent-plan:dashboard:${t}:${n}`}function Ah(t,n,l){if(typeof window>"u")return n;try{const s=window.localStorage.getItem(t);if(!s)return n;const o=JSON.parse(s);if(!Array.isArray(o))return n;const u=`${t}-schema`,f=l.slice().sort().join(",");if(window.localStorage.getItem(u)!==f)return window.localStorage.setItem(u,f),n;const p=o.filter(g=>typeof g=="string"&&l.includes(g));return p.length>0?p:n}catch{return n}}function Dh(t,n,l){typeof window>"u"||(window.localStorage.setItem(t,JSON.stringify(n)),window.localStorage.setItem(`${t}-schema`,l.slice().sort().join(",")))}function kh(t,n){if(typeof window>"u")return n;const l=window.localStorage.getItem(t);return l===null?n:l==="true"}const jx={featureNumbers:null,phaseNumbers:null,taskNumbers:null,shortIds:null,status:null,featureStatus:null,phaseStatus:null,text:null},Tx=/^(feature-status|phase-status|feature|phase|task|id|status|title):(.*)$/i;function L0(t){return t.split(",").map(n=>n.trim()).filter(n=>n.length>0)}function RT(t){return new Set(L0(t).map(n=>Number(n)).filter(n=>Number.isFinite(n)&&n>0))}function Cx(t){const n=t.toUpperCase();return n==="AND"||n==="OR"}function Oh(t,n){const l=t??new Set;for(const s of RT(n))l.add(s);return l}function jT(t,n){const l=t??new Set;for(const s of L0(n).map(o=>o.toUpperCase()))l.add(s);return l}function TT(t){const n=t.trim();if(!n)return{...jx};const l={...jx},s=[],o=[];let u=0;for(;u<n.length;){const m=n[u];if(m==='"'){const p=n.indexOf('"',u+1);if(p===-1){o.push(n.slice(u+1));break}o.push(n.slice(u+1,p)),u=p+1}else if(m===" ")u+=1;else{let p=u;for(;p<n.length&&n[p]!==" ";)p+=1;o.push(n.slice(u,p)),u=p}}let f=0;for(;f<o.length;){const m=o[f];if(Cx(m)){f+=1;continue}const p=m.match(Tx);if(p){const g=(p[1]??"").toLowerCase();let x=p[2]??"";if(x.trim()===""&&f+1<o.length){let y=f+1;for(;y<o.length&&Cx(o[y]);)y+=1;y<o.length&&!o[y].match(Tx)&&(x=o[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=jT(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 CT(t){return!!(t.featureNumbers||t.phaseNumbers||t.taskNumbers||t.shortIds||t.status||t.featureStatus||t.phaseStatus||t.text)}function z0(t){const n=l=>String(l).padStart(3,"0");return[t.task.title,t.task.shortName??"",t.task.shortId??"",String(t.task.number),`T${n(t.task.number)}`,t.task.description??"",t.task.notes??"",t.phase.title,t.phase.slug??"",t.phase.shortId??"",String(t.phase.number),`P${n(t.phase.number)}`,t.phase.description??"",t.phase.summary??"",t.phase.notes??"",t.feature.name,t.feature.shortId??"",String(t.feature.number),`F${n(t.feature.number)}`,t.feature.description??""].join(" ").toLowerCase()}function AT(t,n,l){if(t.featureNumbers&&!t.featureNumbers.has(n.feature.number)||t.phaseNumbers&&!t.phaseNumbers.has(n.phase.number)||t.taskNumbers&&!t.taskNumbers.has(n.task.number)||t.shortIds&&!(t.shortIds.has(n.task.shortId??"")||t.shortIds.has(n.phase.shortId??"")||t.shortIds.has(n.feature.shortId??""))||t.status&&n.task.status!==t.status||t.featureStatus&&n.feature.status!==t.featureStatus||t.phaseStatus&&n.phase.status!==t.phaseStatus)return!1;if(t.text){const s=t.text;if(!(l??z0(n)).includes(s))return!1}return!0}function DT({features:t,phases:n,projectStorageScope:l}){const s=ir(l,"show-all-features"),o=ir(l,"tree-open-mode"),u=ir(l,"expanded-features"),f=ir(l,"expanded-phases"),m=ir(l,"feature-status-filters"),p=ir(l,"phase-status-filters"),g=ir(l,"task-status-filters"),x=ir(l,"hide-done"),y=ir(l,"hide-planned"),N=ir(l,"only-active-branches"),S=ir(l,"work-tree-sort"),[w,A]=v.useState(""),[R,L]=v.useState(()=>{if(typeof window>"u")return Eo;try{const he=window.localStorage.getItem(S);if(!he)return Eo;const Ce=JSON.parse(he);if(Ce.key&&Ce.direction)return{key:Ce.key,direction:Ce.direction}}catch{}return Eo}),I=v.useMemo(()=>A2(t,n,R),[t,n,R]),q=v.useMemo(()=>TT(w),[w]),X=CT(q),W=v.useMemo(()=>{if(!X||!q.text)return null;const he=new Map;for(const Ce of I)for(const Ae of Ce.allPhases)for(const Pe of Ae.allTasks)he.set(Pe.id,z0({feature:Ce.feature,phase:Ae.phase,task:Pe}));return he},[X,q.text,I]),{matchedTaskIds:ne,matchedFeatureIds:z,matchedPhaseIds:T}=v.useMemo(()=>{const he=new Set,Ce=new Set,Ae=new Set;if(!X)return{matchedTaskIds:he,matchedFeatureIds:Ce,matchedPhaseIds:Ae};for(const Pe of I)for(const qe of Pe.allPhases)for(const Z of qe.allTasks)AT(q,{feature:Pe.feature,phase:qe.phase,task:Z},W==null?void 0:W.get(Z.id))&&(he.add(Z.id),Ce.add(Pe.feature.id),Ae.add(qe.phase.id));return{matchedTaskIds:he,matchedFeatureIds:Ce,matchedPhaseIds:Ae}},[X,q,I,W]),[ee,fe]=v.useState(()=>{if(typeof window>"u")return!0;const he=window.localStorage.getItem(s);return he===null?!0:he==="true"}),[be,ye]=v.useState(()=>{if(typeof window>"u")return"all";const he=window.localStorage.getItem(o);return he==="smart"||he==="none"||he==="all"?he:"all"}),[te,re]=v.useState(()=>{if(typeof window>"u")return[];try{const he=window.localStorage.getItem(u);return he?JSON.parse(he):[]}catch{return[]}}),[ge,U]=v.useState(()=>{if(typeof window>"u")return[];try{const he=window.localStorage.getItem(f);return he?JSON.parse(he):[]}catch{return[]}}),[B,ue]=v.useState(()=>Ah(m,po,po)),[de,we]=v.useState(()=>Ah(p,go,go)),[C,V]=v.useState(()=>Ah(g,vo,vo)),[ae,me]=v.useState(()=>kh(x,!1)),[Ne,je]=v.useState(()=>kh(y,!1)),[ze,ut]=v.useState(()=>kh(N,!1)),[Ge,at]=v.useState([]),[ba,Xt]=v.useState([]),[ft,oe]=v.useState([]),$e=v.useRef({});v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(s,String(ee))},[ee,s]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(o,be)},[be,o]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(u,JSON.stringify(te))},[te,u]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(f,JSON.stringify(ge))},[ge,f]),v.useEffect(()=>{typeof window>"u"||Dh(m,B,po)},[B,m]),v.useEffect(()=>{typeof window>"u"||Dh(p,de,go)},[de,p]),v.useEffect(()=>{typeof window>"u"||Dh(g,C,vo)},[C,g]),v.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(x,String(ae))},[ae,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(S,JSON.stringify(R))},[R,S]),v.useEffect(()=>()=>{Object.values($e.current).forEach(he=>window.clearTimeout(he)),$e.current={}},[]);const nt=v.useMemo(()=>{let he=[...B];return ae&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned")),he},[B,ae,Ne]),Ut=v.useMemo(()=>{let he=[...de];return ae&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned"&&Ce!=="draft")),he},[de,ae,Ne]),ma=v.useMemo(()=>{let he=[...C];return ae&&(he=he.filter(Ce=>Ce!=="done")),Ne&&(he=he.filter(Ce=>Ce!=="planned")),he},[C,ae,Ne]),jt=v.useMemo(()=>{if(X)return I.filter(Ae=>ei(Ae.feature.status,nt)).map(Ae=>({...Ae,allPhases:Ae.allPhases.filter(Pe=>ei(Pe.phase.status,Ut)).map(Pe=>({...Pe,allTasks:Pe.allTasks.filter(qe=>ne.has(qe.id)&&ei(qe.status,ma))})).filter(Pe=>Pe.allTasks.length>0)})).filter(Ae=>Ae.allPhases.length>0);const he=!ee||ze;return(ee?I:I.filter(Ae=>Ae.isActive)).filter(({feature:Ae})=>ei(Ae.status,nt)).map(Ae=>({...Ae,allPhases:Ae.allPhases.filter(({phase:Pe,hasActiveTask:qe})=>ei(Pe.status,Ut)?he?Pe.status==="in-progress"||Pe.status==="discovery"||qe:!0:!1).map(Pe=>({...Pe,allTasks:Pe.allTasks.filter(qe=>!!ei(qe.status,ma))})).filter(Pe=>Pe.allTasks.length>0||ee||!he)})).filter(({hasActiveTask:Ae,allPhases:Pe})=>he?Ae||Pe.some(qe=>qe.hasActiveTask):Pe.length>0||ee)},[X,ne,I,nt,Ut,ma,ze,ee]);v.useEffect(()=>{if(be==="none"){re([]),U([]);return}if(be==="all"){re(jt.filter(({feature:Ae})=>Ae.status!=="done").map(({feature:Ae})=>Ae.id)),U(jt.flatMap(({allPhases:Ae})=>Ae.map(({phase:Pe})=>Pe.id)));return}const he=new Set(jt.map(({feature:Ae})=>Ae.id)),Ce=new Set(jt.flatMap(({allPhases:Ae})=>Ae.map(({phase:Pe})=>Pe.id)));re(Ae=>Ae.filter(Pe=>he.has(Pe))),U(Ae=>Ae.filter(Pe=>Ce.has(Pe)))},[jt,be]),v.useEffect(()=>{X&&(ye("smart"),re(Array.from(z)),U(Array.from(T)))},[X,z,T]);const _t=he=>{ye("smart"),re(Ce=>Ce.includes(he)?Ce.filter(Ae=>Ae!==he):[...Ce,he])},Qt=he=>{ye("smart"),U(Ce=>Ce.includes(he)?Ce.filter(Ae=>Ae!==he):[...Ce,he])},Ba=()=>{ye("smart"),re(jt.map(({feature:he})=>he.id)),U(jt.flatMap(({allPhases:he})=>he.map(({phase:Ce})=>Ce.id)))},Ha=()=>{ye("smart"),re([]),U([])},ta=v.useMemo(()=>{const he=new Set(jt.map(({feature:qe})=>qe.id)),Ce=new Set(jt.flatMap(({allPhases:qe})=>qe.map(({phase:Z})=>Z.id)));if(he.size===0)return!1;const Ae=Array.from(he).every(qe=>te.includes(qe)),Pe=Array.from(Ce).every(qe=>ge.includes(qe));return Ae&&Pe},[jt,te,ge]);return v.useEffect(()=>{const he=(Ae,Pe)=>{const qe=Pe.filter(Z=>!!Z);for(const Z of qe){const Tt=`${Ae}:${Z}`,Kt=Ae==="feature"?at:Ae==="phase"?Xt:oe;Kt(Va=>Va.includes(Z)?Va:[...Va,Z]),$e.current[Tt]!==void 0&&window.clearTimeout($e.current[Tt]),$e.current[Tt]=window.setTimeout(()=>{Kt(Va=>Va.filter(pa=>pa!==Z)),delete $e.current[Tt]},N2)}},Ce=Ae=>{var Z,Tt,Kt,Va,pa,Bn;const qe=Ae.detail;if(qe!=null&&qe.type){if(qe.type==="features-updated"){const Me=((Z=qe.data)==null?void 0:Z.featureId)??((Tt=qe.data)==null?void 0:Tt.id);he("feature",[Me]),Me&&(ye("smart"),re(vt=>vt.includes(Me)?vt:[...vt,Me]));return}if(qe.type==="phases-updated"){const Me=(Kt=qe.data)==null?void 0:Kt.featureId,vt=((Va=qe.data)==null?void 0:Va.phaseId)??((pa=qe.data)==null?void 0:pa.id);he("phase",[vt]),he("feature",[Me]),he("task",[(Bn=qe.data)==null?void 0:Bn.taskId]),ye("smart"),Me&&re(yt=>yt.includes(Me)?yt:[...yt,Me]),vt&&U(yt=>yt.includes(vt)?yt:[...yt,vt])}}};return window.addEventListener("agent-plan:ws-event",Ce),()=>{window.removeEventListener("agent-plan:ws-event",Ce)}},[]),{workTree:I,displayedWorkTree:jt,treeOpenMode:be,setTreeOpenMode:ye,expandAll:Ba,collapseAll:Ha,isAllExpanded:ta,expandedFeatureIds:te,expandedPhaseIds:ge,setExpandedFeatureIds:re,setExpandedPhaseIds:U,toggleExpandedFeature:_t,toggleExpandedPhase:Qt,recentFeatureIds:Ge,recentPhaseIds:ba,recentTaskIds:ft,setRecentTaskIds:oe,showAllFeatures:ee,setShowAllFeatures:fe,featureStatusFilters:B,phaseStatusFilters:de,taskStatusFilters:C,hideDone:ae,setHideDone:me,hidePlanned:Ne,setHidePlanned:je,onlyActiveBranches:ze,setOnlyActiveBranches:ut,resetFilters:()=>{A(""),fe(!0),me(!1),je(!1),ue(po),we(go),V(vo),ut(!1),L(Eo),ye("all")},toggleFeatureStatusFilter:he=>ue(Ce=>Ch(Ce,he,po)),togglePhaseStatusFilter:he=>we(Ce=>Ch(Ce,he,go)),toggleTaskStatusFilter:he=>V(Ce=>Ch(Ce,he,vo)),searchQuery:w,setSearchQuery:A,searchActive:X,matchedTaskIds:ne,matchedFeatureIds:z,matchedPhaseIds:T,sort:R,setSort:L}}function xi({id:t,status:n,variant:l="header",className:s,children:o,ariaLabel:u}){const f=l==="surface"?d2(n):f2(n),m=Rm(n),p=["status-item",l==="surface"?"status-item--surface":"status-item--header",m,s??""].filter(Boolean).join(" ");return c.jsx("div",{id:t,className:p,style:f,"aria-label":u,"data-status":n,children:o})}const U0=v.createContext(null);function Hm({id:t,children:n}){const l=wT({id:t}),s={transform:Hl.Transform.toString(l.transform),transition:l.transition};return c.jsx(U0.Provider,{value:l,children:c.jsx("div",{ref:l.setNodeRef,style:s,className:l.isDragging?"ap-sortable--dragging":"",children:n})})}function $m(){const t=v.useContext(U0);return t?c.jsx("button",{type:"button",className:"drag-handle","aria-label":"Drag to reorder",title:"Drag to reorder",...t.listeners,...t.attributes,children:c.jsx(YN,{className:"h-4 w-4"})}):null}function B0({phaseId:t,phaseTitle:n,count:l,className:s=""}){if(l<1)return null;const o=`${l} linked requirement${l===1?"":"s"} for phase ${n}`;return c.jsxs(Ye,{to:`/requirements#phase-${t}`,"aria-label":o,title:o,className:`inline-flex min-h-7 items-center gap-1 rounded-md border border-[var(--border)] bg-[var(--surface-elevated)] px-1.5 text-xs font-semibold text-[var(--text-muted)] transition hover:border-[var(--accent)] hover:text-[var(--accent)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] ${s}`,children:[c.jsx(Vo,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{"aria-hidden":"true",children:l})]})}const qm="mt-1 block min-w-0 break-words font-mono text-sm font-semibold leading-snug [overflow-wrap:anywhere]";function kT(){return c.jsx("span",{className:"rounded-full bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--accent)]",children:"Updated"})}function Ax({status:t,doneTasks:n,totalTasks:l,recentlyChanged:s,className:o}){const u=n!=null&&l!=null;return c.jsxs("div",{className:o,children:[s?c.jsx(kT,{}):null,u?c.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["(",n,"/",l||0,")"]}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(ur,{status:t})})]})}function OT({entry:t,expanded:n,recentlyChanged:l,onToggle:s,isPhaseExpanded:o,onTogglePhase:u,isPhaseRecentlyChanged:f,isTaskRecentlyChanged:m,highlightedTaskIds:p}){const{feature:g,totalTasks:x,doneTasks:y,allPhases:N,hasActiveTask:S}=t;return c.jsxs("div",{className:`surface-card min-w-0 rounded-[10px] px-3 py-3 transition-colors sm:px-4 ${l?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[c.jsxs(xi,{status:t.display.displayStatus,variant:"header",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${l?"bg-[color:color-mix(in_srgb,var(--accent)_10%,transparent)]":""}`,children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[c.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),s()},onPointerDown:w=>w.stopPropagation(),className:"mt-0.5 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--text-subtle)] hover:bg-[var(--surface-elevated)] hover:text-[var(--text)]","aria-label":n?`Collapse feature ${g.name}`:`Expand feature ${g.name}`,"aria-expanded":n,children:c.jsx(Hb,{className:`h-4 w-4 transition ${n?"rotate-90":"rotate-0"}`})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx($m,{}),c.jsx(cr,{featureNum:g.number,featureId:g.id}),c.jsx(mr,{id:$l({featureNum:g.number}),children:c.jsx("span",{className:"sr-only",children:"Copy feature path"})}),g.shortId?c.jsx(ql,{shortId:g.shortId}):null,S?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Mc,{status:t.display.displayStatus,breakdown:t.display.breakdown,doneTasks:y,totalTasks:x,recentlyChanged:l,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Ye,{to:`/features/${g.id}`,className:`entity-link--feature ${qm} underline-offset-4 hover:underline`,children:g.name}),c.jsx(il,{value:g.updatedAt,className:"mt-1 block"})]})]}),c.jsx(Mc,{status:t.display.displayStatus,breakdown:t.display.breakdown,doneTasks:y,totalTasks:x,recentlyChanged:l,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),n&&N.length>0?c.jsx("div",{className:"mt-2 ml-1.5 grid grid-cols-1 gap-2 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:n0(t.display.displayStatus)},children:c.jsx(zm,{items:N.map(w=>w.phase.id),strategy:Lm,children:N.map(w=>c.jsx(Hm,{id:w.phase.id,children:c.jsx(MT,{feature:g,phaseEntry:w,expanded:o(w.phase.id),recentlyChanged:f(w.phase.id),onToggle:()=>u(w.phase.id),isTaskRecentlyChanged:m,highlightedTaskIds:p})},w.phase.id))})}):null]})}function MT({feature:t,phaseEntry:n,expanded:l,recentlyChanged:s,onToggle:o,isTaskRecentlyChanged:u,highlightedTaskIds:f}){var N;const{phase:m,totalTasks:p,doneTasks:g,allTasks:x,hasActiveTask:y}=n;return c.jsxs("div",{className:`work-tree-row grid min-w-0 grid-cols-1 gap-2 rounded-[10px] p-3 transition-colors ${s?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""}`,children:[c.jsxs(xi,{status:n.display.displayStatus,variant:"header",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-1 py-1 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${s?"bg-[color:color-mix(in_srgb,var(--accent)_8%,transparent)]":""}`,children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-2 sm:flex-1",children:[c.jsx("button",{type:"button",onClick:S=>{S.stopPropagation(),o()},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 ${m.title}`:`Expand phase ${m.title}`,"aria-expanded":l,children:c.jsx(Hb,{className:`h-4 w-4 transition ${l?"rotate-90":"rotate-0"}`})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx($m,{}),c.jsx(cr,{featureNum:t==null?void 0:t.number,phaseNum:m.number,featureId:t.id,phaseId:m.id}),c.jsx(mr,{id:$l({featureNum:t==null?void 0:t.number,phaseNum:m.number}),children:c.jsx("span",{className:"sr-only",children:"Copy phase path"})}),m.shortId?c.jsx(ql,{shortId:m.shortId}):null,m.handoff?c.jsx(Nm,{phaseId:m.id,updatedAt:m.handoffUpdatedAt}):null,c.jsx(B0,{phaseId:m.id,phaseTitle:m.title,count:((N=m.linkedRequirements)==null?void 0:N.length)??0}),y?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Mc,{status:n.display.displayStatus,breakdown:n.display.breakdown,doneTasks:g,totalTasks:p,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Ye,{to:`/features/${t.id}/phases/${m.id}`,className:`entity-link--phase ${qm} underline-offset-4 hover:underline`,children:m.title}),c.jsx(il,{value:m.updatedAt,className:"mt-1 block"})]})]}),c.jsx(Mc,{status:n.display.displayStatus,breakdown:n.display.breakdown,doneTasks:g,totalTasks:p,recentlyChanged:s,className:"hidden shrink-0 items-center gap-2 sm:flex"})]}),l?x.length>0?c.jsx("div",{className:"ml-1.5 grid grid-cols-1 gap-1 border-l pl-3 sm:ml-4 sm:pl-4",style:{borderLeftColor:n0(n.display.displayStatus)},children:c.jsx(zm,{items:x.map(S=>S.id),strategy:Lm,children:x.map(S=>c.jsx(Hm,{id:S.id,children:c.jsx(_T,{feature:t,phase:m,task:S,recentlyChanged:u(S.id),highlighted:f==null?void 0:f.has(S.id)})},S.id))})}):c.jsx("p",{className:"ml-1.5 text-xs italic text-[var(--text-subtle)] sm:ml-4",children:"No tasks"}):null]})}function _T({feature:t,phase:n,task:l,recentlyChanged:s,highlighted:o}){return c.jsxs(xi,{id:`task-row-${l.number}`,status:l.status,variant:"surface",className:`flex min-w-0 flex-col gap-1.5 rounded-[10px] px-2 py-2 transition-colors hover:bg-[var(--accent-soft)] sm:flex-row sm:items-start sm:justify-between sm:gap-3 ${s?"ring-1 ring-[color:color-mix(in_srgb,var(--accent)_55%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_12%,transparent)]":""} ${o?"ap-search-hit":""}`,children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx($m,{}),c.jsx(cr,{featureNum:t==null?void 0:t.number,phaseNum:n.number,taskNum:l.number,featureId:t.id,phaseId:n.id,taskId:l.id}),c.jsx(mr,{id:$l({featureNum:t==null?void 0:t.number,phaseNum:n.number,taskNum:l.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),l.shortId?c.jsx(ql,{shortId:l.shortId}):null,l.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null]}),c.jsx(Ax,{status:l.status,recentlyChanged:s,className:"mt-1 flex flex-wrap items-center gap-2 sm:hidden"}),c.jsx(Ye,{to:`/features/${t.id}/phases/${n.id}/tasks/${l.id}`,className:`entity-link--task ${qm} underline-offset-4 hover:underline`,children:l.title}),c.jsx(il,{value:l.updatedAt,className:"mt-1 block"})]}),c.jsx(Ax,{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})({}),sn=(function(t){return t[t.EXPECT_TERM=0]="EXPECT_TERM",t[t.EXPECT_VALUE=1]="EXPECT_VALUE",t})(sn||{}),ui=class{constructor(t,n){fa(this,"input");fa(this,"pos");fa(this,"state");fa(this,"tokens");fa(this,"options");this.input=t,this.pos=0,this.state=sn.EXPECT_TERM,this.tokens=[],this.options=n||{}}tokenize(){for(this.tokens=[],this.pos=0,this.state=sn.EXPECT_TERM;this.pos<this.input.length;)this.state===sn.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,n=this.advance();for(;this.pos<this.input.length;){const l=this.advance();if(l==="\\"&&this.pos<this.input.length)this.advance();else if(l===n)break}this.tokens.push({type:O.QUOTED_VALUE,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.tryReadModifier(),this.state=sn.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===sn.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=sn.EXPECT_VALUE;return}if(t==="/"){this.readRegex();return}const n=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>n&&this.tokens.push({type:O.FIELD_NAME,value:this.input.slice(n,this.pos),start:n,end:this.pos}),this.tokens.push({type:O.COLON,value:":",start:this.pos,end:this.pos+1}),this.advance(),this.state=sn.EXPECT_VALUE;return}this.advance()}if(this.pos>n){const l=this.input.slice(n,this.pos),s=l.toUpperCase();s==="AND"?this.tokens.push({type:O.AND,value:l,start:n,end:this.pos}):s==="OR"?this.tokens.push({type:O.OR,value:l,start:n,end:this.pos}):s==="NOT"?this.tokens.push({type:O.NOT,value:l,start:n,end:this.pos}):l.includes("*")||l.includes("?")?this.tokens.push({type:O.WILDCARD,value:l,start:n,end:this.pos}):this.tokens.push({type:O.VALUE,value:l,start:n,end:this.pos}),this.tryReadModifier()}}readValue(){const t=this.peek();if(this.isWhitespace(t)){this.readWhitespace(),this.state=sn.EXPECT_TERM;return}if(t==='"'){this.readQuotedString(),this.state=sn.EXPECT_TERM;return}if(t==="("||t===")"){this.state=sn.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=sn.EXPECT_TERM;return}const n=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>n){const l=this.input.slice(n,this.pos);l.includes("*")||l.includes("?")?this.tokens.push({type:O.WILDCARD,value:l,start:n,end:this.pos}):this.tokens.push({type:O.VALUE,value:l,start:n,end:this.pos}),this.tryReadModifier()}this.state=sn.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=sn.EXPECT_TERM}tryReadModifier(){for(;this.pos<this.input.length&&(this.peek()==="~"||this.peek()==="^");){const t=this.pos,n=this.advance()==="~"?O.TILDE:O.BOOST;for(;this.pos<this.input.length&&/[0-9.]/.test(this.peek());)this.advance();this.tokens.push({type:n,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 n=this.peek();if(n==="\\"&&this.pos+1<this.input.length){this.advance(),this.advance();continue}if(n==="/"){this.advance(),this.tokens.push({type:O.REGEX,value:this.input.slice(t,this.pos),start:t,end:this.pos}),this.tryReadModifier(),this.state=sn.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=sn.EXPECT_TERM}readSavedSearch(){const t=this.pos;for(this.advance();this.pos<this.input.length&&this.isAlphaNumeric(this.peek());)this.advance();this.tokens.push({type:O.SAVED_SEARCH,value:this.input.slice(t,this.pos),start:t,end:this.pos})}readHistoryRef(){const t=this.pos;for(this.advance();this.pos<this.input.length&&this.isAlphaNumeric(this.peek());)this.advance();this.tokens.push({type:O.HISTORY_REF,value:this.input.slice(t,this.pos),start:t,end:this.pos})}},ms=class{constructor(t){fa(this,"tokens");fa(this,"pos");fa(this,"nonWsTokens");fa(this,"errors",[]);this.tokens=t,this.nonWsTokens=t.filter(n=>n.type!==O.WHITESPACE),this.pos=0}getErrors(){return this.errors}isUnclosedQuote(t){if(t.type!==O.QUOTED_VALUE)return!1;const n=t.value;if(n.length<2)return!0;const l=n[0];return n[n.length-1]!==l}stripQuotes(t){const n=t.value;return this.isUnclosedQuote(t)?n.slice(1):n.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 n=this.peek();if(n.type===O.RPAREN)this.advance(),this.errors.push({type:"Error",value:n.value,message:"Unexpected closing parenthesis",start:n.start,end:n.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 n;if(((n=this.peek())==null?void 0:n.type)===t)return this.advance()}parseOr(){var n;let t=this.parseAnd();for(;((n=this.peek())==null?void 0:n.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 n=this.peek();if(!n)break;if(n.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(n.type===O.OR||n.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 n=this.advance(),l=this.parsePrimary();return l.type==="Error"&&l.value===""?(this.errors.push({type:"Error",value:n.value,message:"Missing search term after NOT",start:n.start,end:n.end}),l):{type:"Not",expression:l,sourceOperator:n.value,start:n.start,end:l.end}}return this.parsePrimary()}applyGroupBoost(t){var n;if(((n=this.peek())==null?void 0:n.type)===O.BOOST){const l=this.advance(),s=l.value.slice(1),o=parseFloat(s);t.boost=isNaN(o)?1:o,t.end=l.end}return t}applyModifiers(t){var n,l;if(t.type!=="BareTerm"&&t.type!=="FieldValue")return t;if(((n=this.peek())==null?void 0:n.type)===O.TILDE){const s=this.advance(),o=s.value.slice(1),u=parseInt(o,10);t.quoted?t.proximity=isNaN(u)?0:u:t.fuzzy=isNaN(u)?0:u,t.end=s.end}if(((l=this.peek())==null?void 0:l.type)===O.BOOST){const s=this.advance(),o=s.value.slice(1),u=parseFloat(o);t.boost=isNaN(u)?1:u,t.end=s.end}return t}parseRangeBound(t,n){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:n+l,valueEnd:n+l+s.length}:s.startsWith('"')?{value:s.slice(1),quoted:!0,valueStart:n+l,valueEnd:n+l+s.length}:{value:s,quoted:!1,valueStart:n+l,valueEnd:n+l+s.length}}parseRange(t){const n=t.value,l=n[0],s=l==="[",o=n[n.length-1],u=o==="]"||o==="}",f=o==="]";u||this.errors.push({type:"Error",value:l,message:"Unclosed range expression",start:t.start,end:t.start+1});const m=u?n.slice(1,-1):n.slice(1),p=m.match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/),g=t.start+1;if(!p){this.errors.push({type:"Error",value:n,message:"Range expression missing TO keyword",start:t.start,end:t.end});const S=this.parseRangeBound(m,g);return{type:"Range",lower:S.value,upper:"",lowerInclusive:s,upperInclusive:u?f:!0,lowerQuoted:S.quoted,upperQuoted:!1,lowerStart:S.valueStart,lowerEnd:S.valueEnd,upperStart:t.end,upperEnd:t.end,start:t.start,end:t.end}}const x=this.parseRangeBound(p[1],g),y=g+p[1].length+(m.length-p[1].length-p[2].length),N=this.parseRangeBound(p[2],y);return{type:"Range",lower:x.value,upper:N.value,lowerInclusive:s,upperInclusive:u?f:!0,lowerQuoted:x.quoted,upperQuoted:N.quoted,lowerStart:x.valueStart,lowerEnd:x.valueEnd,upperStart:N.valueStart,upperEnd:N.valueEnd,start:t.start,end:t.end}}parsePrimary(){var l,s,o;const t=this.peek();if(!t)return{type:"Error",value:"",message:"Unexpected end of input",start:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0,end:this.nonWsTokens.length>0?this.nonWsTokens[this.nonWsTokens.length-1].end:0};if(t.type===O.AND){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected AND",start:u.start,end:u.end}),this.parsePrimary()}if(t.type===O.OR){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected OR",start:u.start,end:u.end}),this.parsePrimary()}if(t.type===O.PREFIX_OP){const u=this.advance(),f=this.parsePrimary();return u.value==="-"?{type:"Not",expression:f,sourceOperator:u.value,start:u.start,end:f.end}:{...f,start:u.start}}if(t.type===O.LPAREN){const u=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const g=this.match(O.RPAREN);g||this.errors.push({type:"Error",value:u.value,message:"Unclosed parenthesis",start:u.start,end:u.end});const x={type:"Group",expression:{type:"BareTerm",value:"",quoted:!1,start:u.end,end:u.end},start:u.start,end:g?g.end:u.end};return this.applyGroupBoost(x)}const f=this.parseOr(),m=this.match(O.RPAREN);m||this.errors.push({type:"Error",value:u.value,message:"Missing closing parenthesis",start:u.start,end:u.end});const p={type:"Group",expression:f,start:u.start,end:m?m.end:f.end};return this.applyGroupBoost(p)}if(t.type===O.SAVED_SEARCH){const u=this.advance();return{type:"SavedSearch",name:u.value.slice(1),start:u.start,end:u.end}}if(t.type===O.HISTORY_REF){const u=this.advance();return{type:"HistoryRef",ref:u.value.slice(1),start:u.start,end:u.end}}if(t.type===O.FIELD_NAME){const u=this.advance(),f=this.match(O.COLON);if(f){let m=":";const p=this.match(O.COMPARISON_OP);if(p&&(m=p.value),((l=this.peek())==null?void 0:l.type)===O.LPAREN){const x=this.advance();if(!this.peek()||this.peek().type===O.RPAREN){const w=this.match(O.RPAREN);w||this.errors.push({type:"Error",value:x.value,message:"Unclosed parenthesis",start:x.start,end:x.end});const A={type:"FieldGroup",field:u.value,expression:{type:"BareTerm",value:"",quoted:!1,start:x.end,end:x.end},start:u.start,end:w?w.end:x.end};return this.applyGroupBoost(A)}const y=this.parseOr(),N=this.match(O.RPAREN);N||this.errors.push({type:"Error",value:x.value,message:"Missing closing parenthesis",start:x.start,end:x.end});const S={type:"FieldGroup",field:u.value,expression:y,start:u.start,end:N?N.end:y.end};return this.applyGroupBoost(S)}if(((s=this.peek())==null?void 0:s.type)===O.RANGE){const x=this.advance(),y=this.parseRange(x);return y.field=u.value,y.start=u.start,y}if(((o=this.peek())==null?void 0:o.type)===O.REGEX){const x=this.advance();return{type:"Regex",pattern:x.value.slice(1,-1),start:u.start,end:x.end}}const g=this.peek();if(g&&(g.type===O.VALUE||g.type===O.QUOTED_VALUE||g.type===O.WILDCARD)){const x=this.advance(),y=x.type===O.QUOTED_VALUE;y&&this.checkUnclosedQuote(x);const N=y?this.stripQuotes(x):x.value;return this.applyModifiers({type:"FieldValue",field:u.value,operator:m,value:N,quoted:y,start:u.start,end:x.end})}return{type:"FieldValue",field:u.value,operator:m,value:"",quoted:!1,start:u.start,end:p?p.end:f.end}}return{type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end}}if(t.type===O.COMPARISON_OP){const u=this.advance(),f=this.peek();if(f&&(f.type===O.VALUE||f.type===O.QUOTED_VALUE)){const m=this.advance();return{type:"BareTerm",value:u.value+m.value,quoted:!1,start:u.start,end:m.end}}return{type:"Error",value:u.value,message:"Comparison operator without value",start:u.start,end:u.end}}if(t.type===O.QUOTED_VALUE){const u=this.advance();return this.checkUnclosedQuote(u),this.applyModifiers({type:"BareTerm",value:this.stripQuotes(u),quoted:!0,start:u.start,end:u.end})}if(t.type===O.WILDCARD){const u=this.advance();return this.applyModifiers({type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end})}if(t.type===O.RANGE){const u=this.advance();return this.parseRange(u)}if(t.type===O.REGEX){const u=this.advance();return{type:"Regex",pattern:u.value.slice(1,-1),start:u.start,end:u.end}}if(t.type===O.VALUE){const u=this.advance();return this.applyModifiers({type:"BareTerm",value:u.value,quoted:!1,start:u.start,end:u.end})}if(t.type===O.RPAREN){const u=this.advance();return this.errors.push({type:"Error",value:u.value,message:"Unexpected closing parenthesis",start:u.start,end:u.end}),{type:"Error",value:u.value,message:"Unexpected closing parenthesis",start:u.start,end:u.end}}const n=this.advance();return{type:"Error",value:n.value,message:`Unexpected token: ${n.value}`,start:n.start,end:n.end}}static getCursorContext(t,n){let l,s;for(const u of t)if(u.type!==O.WHITESPACE){if(n>=u.start&&n<=u.end){l=u;break}u.end<=n&&(s=u)}const o=u=>{let f=0;for(let m=u;m>=0;m--){const p=t[m];if(p.type!==O.WHITESPACE){if(p.type===O.RPAREN){f++;continue}if(p.type===O.LPAREN){if(f>0){f--;continue}for(let g=m-1;g>=0;g--)if(t[g].type!==O.WHITESPACE){if(t[g].type===O.COLON){for(let x=g-1;x>=0;x--)if(t[x].type!==O.WHITESPACE){if(t[x].type===O.FIELD_NAME)return t[x].value;break}}break}}}}return""};if((l==null?void 0:l.type)===O.COLON){let u="";const f=t.indexOf(l);for(let m=f-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){u=t[m].value;break}if(t[m].type!==O.WHITESPACE)break}if(!u&&n===l.start)return{type:"FIELD_NAME",partial:"",token:l};if(n===l.end){for(let m=f+1;m<t.length;m++)if(t[m].type!==O.WHITESPACE){if(t[m].type===O.VALUE||t[m].type===O.QUOTED_VALUE||t[m].type===O.WILDCARD||t[m].type===O.RANGE)return{type:"FIELD_VALUE",partial:t[m].type===O.QUOTED_VALUE?t[m].value.slice(1,t[m].value.endsWith('"')||t[m].value.endsWith("'")?-1:void 0):t[m].value,fieldName:u,token:t[m]};break}}return{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}}if((l==null?void 0:l.type)===O.SAVED_SEARCH)return{type:"SAVED_SEARCH",partial:l.value.slice(1),token:l};if((l==null?void 0:l.type)===O.HISTORY_REF)return{type:"HISTORY_REF",partial:l.value.slice(1),token:l};if((l==null?void 0:l.type)===O.RANGE){const u=t.indexOf(l);let f="";for(let m=u-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){f=t[m].value;break}if(!(t[m].type===O.WHITESPACE||t[m].type===O.COLON))break}return{type:"RANGE",partial:"",fieldName:f,token:l}}if((s==null?void 0:s.type)===O.COLON||(s==null?void 0:s.type)===O.COMPARISON_OP){const u=t.indexOf(s);let f="";for(let m=u-1;m>=0;m--){if(t[m].type===O.FIELD_NAME){f=t[m].value;break}if(!(t[m].type===O.WHITESPACE||t[m].type===O.COLON||t[m].type===O.COMPARISON_OP))break}return l&&(l.type===O.VALUE||l.type===O.QUOTED_VALUE||l.type===O.WILDCARD)?{type:"FIELD_VALUE",partial:l.type===O.QUOTED_VALUE?l.value.slice(1,l.value.endsWith('"')||l.value.endsWith("'")?-1:void 0):l.value,fieldName:f,token:l}:{type:"FIELD_VALUE",partial:"",fieldName:f,token:s}}if((l==null?void 0:l.type)===O.VALUE||(l==null?void 0:l.type)===O.QUOTED_VALUE||(l==null?void 0:l.type)===O.WILDCARD){const u=t.indexOf(l);for(let f=u-1;f>=0;f--)if(t[f].type!==O.WHITESPACE){if(t[f].type===O.COLON||t[f].type===O.COMPARISON_OP){let m="";for(let p=f-1;p>=0;p--){if(t[p].type===O.FIELD_NAME){m=t[p].value;break}if(!(t[p].type===O.WHITESPACE||t[p].type===O.COLON||t[p].type===O.COMPARISON_OP))break}return{type:"FIELD_VALUE",partial:l.type===O.QUOTED_VALUE?l.value.slice(1,l.value.endsWith('"')||l.value.endsWith("'")?-1:void 0):l.value,fieldName:m,token:l}}break}}if((l==null?void 0:l.type)===O.QUOTED_VALUE)return{type:"FIELD_NAME",partial:l.value,token:l};if((l==null?void 0:l.type)===O.FIELD_NAME||(l==null?void 0:l.type)===O.VALUE){const u=o(t.indexOf(l));return u?{type:"FIELD_VALUE",partial:l.value,fieldName:u,token:l}:{type:"FIELD_NAME",partial:l.value,token:l}}if((s==null?void 0:s.type)===O.PREFIX_OP){const u=o(t.indexOf(s));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(s&&(s.type===O.AND||s.type===O.OR||s.type===O.NOT)){const u=o(t.indexOf(s));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if(t.length===0||t.every(u=>u.type===O.WHITESPACE))return{type:"EMPTY",partial:""};if((l==null?void 0:l.type)===O.LPAREN||(s==null?void 0:s.type)===O.LPAREN){const u=(l==null?void 0:l.type)===O.LPAREN?l:s,f=o(t.indexOf(u));return f?{type:"FIELD_VALUE",partial:"",fieldName:f,token:void 0}:{type:"FIELD_NAME",partial:"",token:void 0}}if((l==null?void 0:l.type)===O.TILDE||(l==null?void 0:l.type)===O.BOOST)return{type:"OPERATOR",partial:""};if(s&&(s.type===O.VALUE||s.type===O.QUOTED_VALUE||s.type===O.RPAREN||s.type===O.RANGE||s.type===O.TILDE||s.type===O.BOOST)){const u=o(t.indexOf(s));return u?{type:"FIELD_VALUE",partial:"",fieldName:u,token:void 0}:{type:"OPERATOR",partial:""}}return{type:"FIELD_NAME",partial:"",token:void 0}}};function Jh(t,n){if(n<t.start||n>t.end)return null;if(t.type==="BooleanExpr"){const l=Jh(t.left,n);if(l)return l;const s=Jh(t.right,n);return s||null}return t}function LT(t,n,l){if(!t)return null;const s=Jh(t,l);if(!s)return null;let o=s.start,u=s.end;const f=n.slice(u).match(/^(\s+(?:AND|OR|&&|\|\|)\s+|\s+)(?=\S)/i);if(f)return u+=f[0].length,{start:o,end:u};const m=n.slice(0,o).match(/(\s+(?:AND|OR|&&|\|\|)\s+|\s+)$/i);return m&&m.index!==void 0&&m.index>0&&(o-=m[0].length),{start:o,end:u}}var zT={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:{}},UT={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"},BT=["AND","OR","NOT"];function Dx(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,n=>String.fromCharCode(n.charCodeAt(0)-65248))}var kx={"(":")","[":"]",'"':'"',"'":"'"};function HT(t,n,l,s,o){const u=t.slice(0,n),f=t.slice(n,l),m=t.slice(l);return{newValue:u+s+f+o+m,newCursorPos:l+2,newSelStart:n+1,newSelEnd:l+1}}function $T(t){if(!t.textContent)return"";const n=[];function l(s){var o;if(s.nodeType===Node.TEXT_NODE)n.push(s.textContent||"");else if(s.nodeName==="BR")(o=s.hasAttribute)!=null&&o.call(s,"data-sentinel")||n.push(`
|
|
287
|
-
`);else for(let u=0;u<s.childNodes.length;u++)l(s.childNodes[u])}return l(t),n.join("")}function Ox(t,n,l){let s=-1,o=-1;for(let u=0;u<t.length;u++){const f=t[u];n>=f.start&&n<=f.end&&(s=u),o===-1&&l>=f.start&&l<=f.end&&(o=u)}return[s,o]}function qT(t,n,l){if(t){let s=t.end;if(t.type===O.FIELD_NAME&&l){const o=l.indexOf(t);if(o>=0){for(let u=o+1;u<l.length;u++)if(l[u].type!==O.WHITESPACE){l[u].type===O.COLON&&(s=l[u].end);break}}}return{start:t.start,end:s}}return{start:n,end:n}}var Mh=class H0{constructor(n,l=[],s=[],o=10,u={}){fa(this,"fields");fa(this,"fieldMap");fa(this,"savedSearches");fa(this,"searchHistory");fa(this,"maxSuggestions");fa(this,"options");fa(this,"defaultFieldName");fa(this,"defaultFieldShowFieldSuggs",!1);this.fields=n,this.fieldMap=new Map(n.map(f=>[f.name,f]));for(const f of n)if(f.aliases)for(const m of f.aliases)this.fieldMap.set(m,f);this.savedSearches=l,this.searchHistory=s,this.maxSuggestions=o,this.options={showSavedSearchHint:u.showSavedSearchHint??!1,showHistoryHint:u.showHistoryHint??!1}}resolveField(n){return this.fieldMap.get(n)}updateSavedSearches(n){this.savedSearches=n}updateSearchHistory(n){this.searchHistory=n}setDefaultField(n){this.defaultFieldName=n==null?void 0:n.name,this.defaultFieldShowFieldSuggs=(n==null?void 0:n.showFieldSuggestions)??!1}getSuggestions(n,l){let s=ms.getCursorContext(n,l);const o=qT(s.token,l,n);if(this.defaultFieldName&&(s.type==="FIELD_NAME"||s.type==="EMPTY")){s={...s,type:"FIELD_VALUE",fieldName:this.defaultFieldName};const u=this.resolveField(this.defaultFieldName);if((u==null?void 0:u.type)==="date")return{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:s};const f=this.getValueSuggestions(u,s.partial,o.start,o.end);if(this.defaultFieldShowFieldSuggs){const m=this.getFieldSuggestions(s.partial,o.start,o.end);return{suggestions:[...f,...m],showDatePicker:!1,context:s}}return{suggestions:f,showDatePicker:!1,context:s}}switch(s.type){case"FIELD_NAME":case"EMPTY":{const u=this.getFieldSuggestions(s.partial,o.start,o.end),f=!s.partial&&u.length>0?this.getSpecialHints(o.start,o.end):[];return{suggestions:this.sortByPriority([...u,...f]),showDatePicker:!1,context:s}}case"FIELD_VALUE":{const u=s.fieldName?this.resolveField(s.fieldName):void 0;return(u==null?void 0:u.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:s}:{suggestions:this.getValueSuggestions(u,s.partial,o.start,o.end),showDatePicker:!1,context:s}}case"OPERATOR":{const u=this.getOperatorSuggestions(s.partial,o.start,o.end),f=this.getFieldSuggestions("",o.start,o.end),m=this.getSpecialHints(o.start,o.end);return{suggestions:this.sortByPriority([...u,...f,...m]),showDatePicker:!1,context:s}}case"SAVED_SEARCH":return{suggestions:this.getSavedSearchSuggestions(s.partial,o.start,o.end),showDatePicker:!1,context:s};case"HISTORY_REF":return{suggestions:this.getHistorySuggestions(s.partial,o.start,o.end),showDatePicker:!1,context:s};case"RANGE":{const u=s.fieldName?this.resolveField(s.fieldName):void 0;return(u==null?void 0:u.type)==="date"?{suggestions:[],showDatePicker:!0,dateFieldName:u.name,context:s}:{suggestions:[],showDatePicker:!1,context:s}}default:return{suggestions:[],showDatePicker:!1,context:s}}}getFieldSuggestions(n,l,s){const o=n.toLowerCase();return this.fields.filter(u=>!u.hide).map(u=>{const f=u.name.toLowerCase(),m=(u.label||"").toLowerCase(),p=(u.aliases||[]).map(x=>x.toLowerCase());let g=0;return f.startsWith(o)?g=4:m.startsWith(o)||p.some(x=>x.startsWith(o))?g=3:f.includes(o)?g=2:(m.includes(o)||p.some(x=>x.includes(o)))&&(g=1),{field:u,score:g}}).filter(u=>u.score>0).sort((u,f)=>f.score-u.score).slice(0,this.maxSuggestions).map(u=>({text:u.field.name+":",label:u.field.label||u.field.name,description:u.field.description,type:u.field.type,replaceStart:l,replaceEnd:s,matchPartial:n,priority:10}))}getValueSuggestions(n,l,s,o){if(!n)return[];if(n.type==="boolean")return["true","false"].filter(u=>u.startsWith(l.toLowerCase())).map(u=>({text:u,label:u,type:"boolean",replaceStart:s,replaceEnd:o,matchPartial:l}));if(n.placeholder!==!1){const u=n.placeholder||{number:"Enter a number",ip:"Enter an IP address"}[n.type];if(u)return[{text:"",label:u,type:"hint",replaceStart:s,replaceEnd:o}]}return[]}getOperatorSuggestions(n,l,s){const o=n.toLowerCase();return BT.filter(u=>u.toLowerCase().startsWith(o)).map(u=>({text:u+" ",label:u,description:u==="AND"?"Both conditions must match":u==="OR"?"Either condition must match":"Negate the following condition",type:"operator",replaceStart:l,replaceEnd:s,matchPartial:n,priority:30}))}sortByPriority(n){return n.sort((l,s)=>(s.priority??0)-(l.priority??0))}getSpecialHints(n,l){const s=[],o=this.savedSearches.length>0||this.options.hasSavedSearchProvider,u=this.searchHistory.length>0||this.options.hasHistoryProvider;return this.options.showSavedSearchHint&&o&&s.push({text:"#",label:"#saved-search",description:"Type # to use a saved search",type:"hint",replaceStart:n,replaceEnd:l,priority:20}),this.options.showHistoryHint&&u&&s.push({text:"!",label:"!history",description:"Type ! to search history",type:"hint",replaceStart:n,replaceEnd:l,priority:20}),s}getSavedSearchSuggestions(n,l,s){return this.savedSearches.slice(0,this.maxSuggestions).map(o=>({text:o.query,label:o.label||o.query,description:o.description,type:"savedSearch",replaceStart:l,replaceEnd:s,matchPartial:n,sourceData:o}))}getHistorySuggestions(n,l,s){return this.searchHistory.slice(0,this.maxSuggestions).map(o=>({text:H0.wrapHistoryQuery(o.query),label:o.label||o.query,description:o.description,type:"history",replaceStart:l,replaceEnd:s,matchPartial:n,sourceData:o}))}static wrapHistoryQuery(n){try{const l=new ms(new ui(n).tokenize()).parse();if(l&&l.type==="BooleanExpr")return"("+n+")"}catch{}return n}};function mc(t){if(t==="")return null;const n=Number(t);return isNaN(n)?`"${t}" is not a valid number`:null}var IT=[/^\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 VT(t){for(const n of IT)if(n.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 YT(t){if(/^now$/i.test(t))return new Date;const n=t.match(/^now([+-])(\d+)([dhms])$/i);if(n){const o=new Date,u=n[1]==="+"?1:-1,f=parseInt(n[2],10);switch(n[3].toLowerCase()){case"d":o.setDate(o.getDate()+u*f);break;case"h":o.setHours(o.getHours()+u*f);break;case"m":o.setMinutes(o.getMinutes()+u*f);break;case"s":o.setSeconds(o.getSeconds()+u*f);break}return o}const l=t.match(/^(\d{4})[-/](\d{2})[-/](\d{2})$/);if(l)return new Date(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10));const s=new Date(t);return isNaN(s.getTime())?null:s}function Mx(t,n){return new Date(t,n+1,0).getDate()}function FT(t,n){return new Date(t,n,1).getDay()}function yo(t,n){return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function _x(t,n,l){if(!n||!l)return!1;const s=t.getTime(),o=n.getTime(),u=l.getTime();return s>=Math.min(o,u)&&s<=Math.max(o,u)}var PT=["January","February","March","April","May","June","July","August","September","October","November","December"];function GT(t){return PT[t]}function pc(t,n){if(t==="")return null;const l=t.match(/^[\[{](.+)\s+TO\s+(.+)[\]}]$/i);if(l){const s=Lh(l[1].trim(),n);if(s)return`Range start: ${s}`;const o=Lh(l[2].trim(),n);return o?`Range end: ${o}`:null}return Lh(t,n)}function Lh(t,n){return/^now(\/[dhms])?$/i.test(t)||/^now[+-]\d+[dhms](\/[dhms])?$/i.test(t)||n&&n(t)!==null||VT(t)?null:`"${t}" is not a valid date. Use YYYY-MM-DD, relative (now-7d), or ISO 8601.`}function gc(t){return t==null?null:typeof t=="string"?{message:t,severity:"error"}:t}var vc={SYNTAX_ERROR:0,INVALID_VALUE:1,UNKNOWN_FIELD:2,AMBIGUOUS_PRECEDENCE:3,CUSTOM:4};function yc(t){if(t.length<=1)return t;const n=[...t].sort((s,o)=>{const u=vc[s.type??"SYNTAX_ERROR"],f=vc[o.type??"SYNTAX_ERROR"];return u!==f?u-f:s.start-o.start}),l=[];for(const s of n)l.some(o=>vc[o.type??"SYNTAX_ERROR"]<vc[s.type??"SYNTAX_ERROR"]&&o.start<=s.start&&o.end>=s.end)||l.push(s);return l}var Lx=class{constructor(t){fa(this,"fields");this.fields=new Map(t.map(n=>[n.name,n]));for(const n of t)if(n.aliases)for(const l of n.aliases)this.fields.set(l,n)}validate(t,n,l,s){if(!t)return[];const o=[],u=s?this.fields.get(s):void 0;return this.walkNode(t,o,n,l,u),this.checkAmbiguousPrecedence(t,o),o}walkNode(t,n,l,s,o){switch(t.type){case"BareTerm":if(t.fuzzy!==void 0&&t.fuzzy>2&&n.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&&n.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&&n.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,type:"SYNTAX_ERROR"}),o&&t.value!==""){let u=null;switch(o.type){case"number":u=mc(t.value);break;case"date":u=pc(t.value,s);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(u=`Expected "true" or "false", got "${t.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(t.value)&&!t.value.includes("*")&&(u=`"${t.value}" is not a valid IP address`);break}u&&n.push({message:u,start:t.start,end:t.end,field:o.name,type:"INVALID_VALUE"})}if(l&&t.value!==""){const u=gc(l({value:t.value,position:"bare_term",quoted:t.quoted,fieldName:o==null?void 0:o.name,fieldConfig:o}));u&&n.push({message:u.message,start:t.start,end:t.end,severity:u.severity,type:"CUSTOM"})}break;case"Regex":break;case"Range":if(this.validateEmptyRangeBounds(t,n),t.field&&t.field!=="*"){const u=this.fields.get(t.field);u?this.validateRangeBounds(u,t,n,l,s):n.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;n.push({message:`Missing value after "${t.field}${m}"`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"});return}const u=this.fields.get(t.field);if(!u){n.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&&n.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&&n.push({message:`Boost value must be positive (got ${t.boost})`,start:t.start,end:t.end,field:t.field,type:"SYNTAX_ERROR"});let f=null;switch(u.type){case"number":f=mc(t.value);break;case"date":f=pc(t.value,s);break;case"boolean":t.value!=="true"&&t.value!=="false"&&(f=`Expected "true" or "false", got "${t.value}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(t.value)&&!t.value.includes("*")&&(f=`"${t.value}" is not a valid IP address`);break}if(t.operator!==":"&&u.type!=="number"&&u.type!=="date"&&(f=`Comparison operator "${t.operator}" is not valid for ${u.type} fields`),!f&&l){const m=gc(l({value:t.value,position:"field_value",fieldName:u.name,fieldConfig:u,quoted:t.quoted,operator:t.operator!==":"?t.operator:void 0}));if(m){const p=t.end-t.value.length;n.push({message:m.message,start:p,end:t.end,field:t.field,severity:m.severity,type:"CUSTOM"})}}if(f){const m=t.end-t.value.length,p=t.operator!==":"&&u.type!=="number"&&u.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";n.push({message:f,start:m,end:t.end,field:t.field,type:p})}break}case"FieldGroup":if(t.field==="*")this.walkNode(t.expression,n,l,s,o);else{const u=this.fields.get(t.field);u?this.walkFieldGroup(t.expression,u,n,l,s):n.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&&n.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,n,l,s,o),this.walkNode(t.right,n,l,s,o);break;case"Group":this.walkNode(t.expression,n,l,s,o),t.boost!==void 0&&t.boost<=0&&n.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,n,l,s,o);break;case"Error":n.push({message:t.message,start:t.start,end:t.end,type:"SYNTAX_ERROR"});break}}walkFieldGroup(t,n,l,s,o){switch(t.type){case"BareTerm":if(t.value==="")return;this.validateFieldValue(n,t.value,t.quoted,":",t.start,t.end,l,s,o);break;case"FieldValue":this.walkNode(t,l,s,o);break;case"Range":this.validateRangeBounds(n,t,l,s,o);break;case"BooleanExpr":this.walkFieldGroup(t.left,n,l,s,o),this.walkFieldGroup(t.right,n,l,s,o);break;case"Group":this.walkFieldGroup(t.expression,n,l,s,o);break;case"Not":this.walkFieldGroup(t.expression,n,l,s,o);break;default:this.walkNode(t,l,s,o);break}}validateFieldValue(t,n,l,s,o,u,f,m,p){let g=null;switch(t.type){case"number":g=mc(n);break;case"date":g=pc(n,p);break;case"boolean":n!=="true"&&n!=="false"&&(g=`Expected "true" or "false", got "${n}"`);break;case"ip":!/^\d{1,3}(\.\d{1,3}){3}(\/\d{1,2})?$/.test(n)&&!n.includes("*")&&(g=`"${n}" is not a valid IP address`);break}if(s!==":"&&t.type!=="number"&&t.type!=="date"&&(g=`Comparison operator "${s}" is not valid for ${t.type} fields`),!g&&m){const x=gc(m({value:n,position:"field_group_term",fieldName:t.name,fieldConfig:t,quoted:l,operator:s!==":"?s:void 0}));x&&f.push({message:x.message,start:o,end:u,field:t.name,severity:x.severity,type:"CUSTOM"})}if(g){const x=s!==":"&&t.type!=="number"&&t.type!=="date"?"SYNTAX_ERROR":"INVALID_VALUE";f.push({message:g,start:o,end:u,field:t.name,type:x})}}validateEmptyRangeBounds(t,n){t.lower!=="*"&&t.lower.trim()===""&&n.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()===""&&n.push({message:"Missing upper bound in range",start:t.end-1,end:t.end,field:t.field,type:"SYNTAX_ERROR"})}validateRangeBounds(t,n,l,s,o){const u=[];n.lower!=="*"&&n.lower.trim()!==""&&u.push({value:n.lower,label:"Range start",start:n.lowerStart,end:n.lowerEnd,position:"range_start",inclusive:n.lowerInclusive}),n.upper!=="*"&&n.upper.trim()!==""&&u.push({value:n.upper,label:"Range end",start:n.upperStart,end:n.upperEnd,position:"range_end",inclusive:n.upperInclusive});for(const f of u){let m=null;switch(t.type){case"number":m=mc(f.value),m&&(m=`${f.label}: ${m}`);break;case"date":m=pc(f.value,o),m&&(m=`${f.label}: ${m}`);break;case"boolean":m="Range queries are not supported for boolean fields";break}if(!m&&s){const p=gc(s({value:f.value,position:f.position,fieldName:t.name,fieldConfig:t,quoted:!1,inclusive:f.inclusive}));p&&l.push({message:p.message,start:f.start,end:f.end,field:t.name,severity:p.severity,type:"CUSTOM"})}if(m){const p=t.type==="boolean"?"SYNTAX_ERROR":"INVALID_VALUE";l.push({message:m,start:f.start,end:f.end,field:t.name,type:p})}}}checkAmbiguousPrecedence(t,n){const l=new Set;this.findAndFlagAmbiguity(t,n,l)}findAndFlagAmbiguity(t,n,l){if(t.type==="BooleanExpr"&&!l.has(t)){const s=new Set,o=[];this.collectBoolOps(t,s,o),s.size>1&&(n.push({message:"Ambiguous precedence: mix of AND and OR without parentheses. Add parentheses to clarify.",start:t.start,end:t.end,severity:"warning",type:"AMBIGUOUS_PRECEDENCE"}),o.forEach(u=>l.add(u))),this.collectLeaves(t).forEach(u=>this.findAndFlagAmbiguity(u,n,l))}else t.type==="Group"||t.type==="FieldGroup"?this.findAndFlagAmbiguity(t.expression,n,l):t.type==="Not"?this.findAndFlagAmbiguity(t.expression,n,l):t.type==="BooleanExpr"&&this.collectLeaves(t).forEach(s=>this.findAndFlagAmbiguity(s,n,l))}collectBoolOps(t,n,l){t.type==="BooleanExpr"&&(n.add(t.operator),l.push(t),this.collectBoolOps(t.left,n,l),this.collectBoolOps(t.right,n,l))}collectLeaves(t){return t.type!=="BooleanExpr"?[t]:[...this.collectLeaves(t.left),...this.collectLeaves(t.right)]}};function zn(...t){return t.filter(Boolean).join(" ")}function Zo(t){return{...zT,...t}}function Jo(t){return{...UT,...t}}function XT(t,n){return{position:"relative",display:"flex",flexDirection:"column",width:"100%",...n}}function QT(t,n){return{flex:1,minHeight:n.inputMinHeight,padding:n.inputPadding,borderWidth:n.inputBorderWidth,borderStyle:"solid",borderColor:n.inputBorderColor,borderRadius:n.inputBorderRadius,outline:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,lineHeight:n.lineHeight,backgroundColor:t.background,color:t.text,caretColor:t.cursor,whiteSpace:"pre-wrap",wordWrap:"break-word",overflowWrap:"break-word",overflow:"auto",cursor:"text"}}function KT(t){return{borderColor:t.inputFocusBorderColor,boxShadow:t.inputFocusShadow}}function ZT(t,n){const l=n.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:n.fontSize,fontFamily:n.fontFamily,lineHeight:n.lineHeight,userSelect:"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}function $0(t,n){return{position:"absolute",zIndex:n.dropdownZIndex,backgroundColor:t.background,border:`1px solid ${n.dropdownBorderColor}`,borderRadius:n.dropdownBorderRadius,boxShadow:n.dropdownShadow,maxHeight:n.dropdownMaxHeight,overflowY:"auto",width:"max-content",minWidth:n.dropdownMinWidth,maxWidth:n.dropdownMaxWidth,padding:"4px 0"}}function zx(t,n,l){return{padding:l.dropdownItemPadding,cursor:"pointer",fontSize:l.dropdownItemFontSize,fontFamily:l.fontFamily,backgroundColor:t?n.dropdownSelected:"transparent",color:t?"#ffffff":n.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 JT(t,n){return{fontSize:"10px",padding:"1px 4px",borderRadius:"3px",backgroundColor:t?n.typeBadgeSelectedBg:n.typeBadgeBg,color:t?n.typeBadgeSelectedColor:n.typeBadgeColor,flexShrink:0}}function WT(t,n){return{container:{padding:"12px",backgroundColor:t.background,minWidth:"280px",fontFamily:n.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:n.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:n.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:n.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 ${n.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 eC={delimiter:"regexDelimiter",charClass:"regexCharClass",groupOpen:"regexGroup",groupClose:"regexGroup",escape:"regexEscape",quantifier:"regexQuantifier",anchor:"regexAnchor",alternation:"regexAlternation",text:"regexText"};function tC(t){const n=[];let l=0,s="";function o(){s&&(n.push({type:"text",text:s}),s="")}t.startsWith("/")&&(n.push({type:"delimiter",text:"/"}),l=1);const u=t.lastIndexOf("/"),f=u>0?u:t.length;for(;l<f;){const m=t[l];if(m==="\\"&&l+1<f){o(),n.push({type:"escape",text:t.slice(l,l+2)}),l+=2;continue}if(m==="["){o();let p=l+1;for(p<f&&t[p]==="^"&&p++,p<f&&t[p]==="]"&&p++;p<f&&t[p]!=="]";)t[p]==="\\"&&p+1<f&&p++,p++;p<f&&p++,n.push({type:"charClass",text:t.slice(l,p)}),l=p;continue}if(m==="("){o();let p="(";if(l+1<f&&t[l+1]==="?"){let g=l+2;for(;g<f&&g<l+4&&/[:<>=!]/.test(t[g]);)g++;p=t.slice(l,g)}n.push({type:"groupOpen",text:p}),l+=p.length;continue}if(m===")"){o(),n.push({type:"groupClose",text:")"}),l++;continue}if(m==="+"||m==="*"||m==="?"){o();let p=m;l+1<f&&t[l+1]==="?"&&(p+="?"),n.push({type:"quantifier",text:p}),l+=p.length;continue}if(m==="{"){o();let p=l+1;for(;p<f&&t[p]!=="}";)p++;p<f&&p++,n.push({type:"quantifier",text:t.slice(l,p)}),l=p;continue}if(m==="^"||m==="$"){o(),n.push({type:"anchor",text:m}),l++;continue}if(m==="|"){o(),n.push({type:"alternation",text:"|"}),l++;continue}s+=m,l++}return o(),u>0&&u<t.length&&n.push({type:"delimiter",text:"/"}),n}function aC(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function nC(t,n,l){const s=tC(t.value).map(o=>{const u=n[eC[o.type]]||n.regexText,f=o.type==="delimiter"?"600":"normal";return`<span class="ei-regex-part ei-regex-part--${o.type}" style="color:${u};font-weight:${f}">${aC(o.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--regex${l?" "+l:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${s}</span>`}var rC={bracket:"paren",toKeyword:"booleanOp",bareValue:"fieldValue",quotedValue:"quoted",wildcard:"wildcard",whitespace:"text"};function lC(t){const n=[];let l=0;l<t.length&&(t[l]==="["||t[l]==="{")&&(n.push({type:"bracket",text:t[l]}),l++);const s=t.length-1,o=s>=0&&(t[s]==="]"||t[s]==="}"),u=o?s:t.length;for(;l<u;){const f=t[l];if(f===" "||f===" "){let p=l;for(;p<u&&(t[p]===" "||t[p]===" ");)p++;n.push({type:"whitespace",text:t.slice(l,p)}),l=p;continue}if((f==="T"||f==="t")&&l+1<u&&(t[l+1]==="O"||t[l+1]==="o")){const p=l===0||t[l-1]===" "||t[l-1]===" "||t[l-1]==="["||t[l-1]==="{",g=l+2>=u||t[l+2]===" "||t[l+2]===" ";if(p&&g){n.push({type:"toKeyword",text:t.slice(l,l+2)}),l+=2;continue}}if(f==='"'){let p=l+1;for(;p<u&&t[p]!=='"';)t[p]==="\\"&&p+1<u&&p++,p++;p<u&&p++,n.push({type:"quotedValue",text:t.slice(l,p)}),l=p;continue}if(f==="*"){n.push({type:"wildcard",text:"*"}),l++;continue}let m=l;for(;m<u&&t[m]!==" "&&t[m]!==" "&&t[m]!=='"';)m++;if(m>l){const p=t.slice(l,m);n.push({type:"bareValue",text:p}),l=m}else n.push({type:"bareValue",text:f}),l++}return o&&n.push({type:"bracket",text:t[s]}),n}function Ux(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function sC(t,n,l){const s=lC(t.value).map(o=>{if(o.type==="whitespace")return Ux(o.text);const u=n[rC[o.type]]||n.fieldValue,f=o.type==="toKeyword"||o.type==="bracket"?"600":"normal";return`<span class="ei-range-part ei-range-part--${o.type}" style="color:${u};font-weight:${f}">${Ux(o.text)}</span>`}).join("");return`<span class="${`ei-token ei-token--range${l?" "+l:""}`}" data-token-start="${t.start}" data-token-end="${t.end}">${s}</span>`}function q0(t,n){if(n<0)return null;const l=t.filter(u=>u.type===O.LPAREN||u.type===O.RPAREN);if(l.length===0)return null;const s=l.find(u=>u.end===n);if(s){const u=Bx(l,s);if(u)return u}const o=l.find(u=>u.start===n);if(o){const u=Bx(l,o);if(u)return u}return null}function Bx(t,n){if(n.type===O.LPAREN){const l=t.indexOf(n);let s=0;for(let o=l;o<t.length;o++)if(t[o].type===O.LPAREN?s++:t[o].type===O.RPAREN&&s--,s===0)return{openStart:n.start,closeStart:t[o].start}}else{const l=t.indexOf(n);let s=0;for(let o=l;o>=0;o--)if(t[o].type===O.RPAREN?s++:t[o].type===O.LPAREN&&s--,s===0)return{openStart:t[o].start,closeStart:n.start}}return null}var iC={[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"},oC={[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 ai(t,n,l){const s=Zo(n);if(t.length===0)return"";const o=(l==null?void 0:l.cursorOffset)!==void 0?q0(t,l.cursorOffset):null,u=n==null?void 0:n.valueTypes,f=l==null?void 0:l.fieldTypeMap;let m;if(u&&f){m=new Array(t.length);let g,x=!1;const y=[];for(let N=0;N<t.length;N++){const S=t[N];S.type===O.FIELD_NAME?(g=S.value,x=!1):S.type===O.COLON&&g?x=!0:S.type===O.WHITESPACE||(S.type===O.LPAREN?(x&&g?y.push(f.get(g.toLowerCase())):y.push(void 0),g=void 0,x=!1):S.type===O.RPAREN?(y.pop(),g=void 0,x=!1):S.type===O.VALUE||S.type===O.QUOTED_VALUE||S.type===O.RANGE||S.type===O.REGEX||S.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):(S.type===O.AND||S.type===O.OR||(S.type,O.NOT),g=void 0,x=!1))}}let p=t.map((g,x)=>{let y=s[oC[g.type]||"text"]||s.text;if(u&&m){const A=m[x];A&&u[A]&&(y=u[A])}const N=uC(g.value);if(g.type===O.WHITESPACE)return N.replace(/\n/g,"<br>");if(g.type===O.REGEX)return nC(g,s,l==null?void 0:l.tokenClassName);if(g.type===O.RANGE)return sC(g,s,l==null?void 0:l.tokenClassName);let S="normal";(g.type===O.AND||g.type===O.OR||g.type===O.NOT)&&(S="600"),g.type===O.FIELD_NAME&&(S="500");let w="";return o&&(g.type===O.LPAREN||g.type===O.RPAREN)&&(g.start===o.openStart||g.start===o.closeStart)&&(S="700",w=`background-color:${s.matchedParenBg};border-radius:2px;`),`<span class="${`ei-token ei-token--${iC[g.type]}${l!=null&&l.tokenClassName?" "+l.tokenClassName:""}`}" style="color:${y};font-weight:${S};${w}" data-token-start="${g.start}" data-token-end="${g.end}">${N}</span>`}).join("");return p.endsWith("<br>")&&(p+="<br data-sentinel>"),p}function uC(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 n=document.createElement("style");n.id=t,n.textContent="@keyframes elastic-input-spin { to { transform: rotate(360deg); } }",document.head.appendChild(n)}}function Hx(t,n,l){if(!n||n.length===0)return t;const s=t.toLowerCase(),o=n.toLowerCase(),u=s.indexOf(o);if(u===-1)return t;const f=t.slice(0,u),m=t.slice(u,u+n.length),p=t.slice(u+n.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 cC({suggestions:t,selectedIndex:n,onSelect:l,position:s,colors:o,styles:u,visible:f,fixedWidth:m,renderHistoryItem:p,renderSavedSearchItem:g,renderDropdownHeader:x,cursorContext:y,listRefCallback:N,renderType:S,classNames:w}){const A=v.useRef(null),R=v.useRef(null);v.useEffect(()=>{const z=document.createElement("div");return document.body.appendChild(z),A.current=z,()=>{document.body.removeChild(z),A.current=null}},[]);const L=x&&y?x(y):null,I=L!=null;if(v.useEffect(()=>{if(R.current){const z=I?n+1:n,T=R.current.children[z];T&&T.scrollIntoView({block:"nearest"})}},[n,I]),!A.current||!f||t.length===0||!s)return null;const q=Zo(o),X=Jo(u),W={...$0(q,X),top:`${s.top}px`,left:`${s.left}px`,...m!=null?{width:`${m}px`,minWidth:"unset",maxWidth:"unset"}:{}},ne=v.createElement("div",{className:zn("ei-dropdown",w==null?void 0:w.dropdown),style:W,ref:z=>{R.current=z,N==null||N(z)},onMouseDown:z=>z.preventDefault()},I&&v.createElement("div",{className:zn("ei-dropdown-header",w==null?void 0:w.dropdownHeader),style:{padding:X.dropdownItemPadding||"4px 10px",fontSize:"11px",color:q.placeholder,borderBottom:`1px solid ${q.dropdownHover}`,userSelect:"none"}},L),t.map((z,T)=>{const ee=T===n,fe=zx(ee,q,X),be=(U,B,ue)=>({key:T,className:zn("ei-dropdown-item",U,ee&&"ei-dropdown-item--selected",w==null?void 0:w.dropdownItem),style:{...fe,...B},title:ue,onClick:()=>l(z),onMouseEnter:de=>{de.currentTarget.style.backgroundColor=ee?q.dropdownSelected:q.dropdownHover},onMouseLeave:de=>{de.currentTarget.style.backgroundColor=ee?q.dropdownSelected:"transparent"}}),ye=U=>{if(S===!1||!z.type||z.type==="hint")return null;const B=typeof S=="function"?S(z.type,{text:z.text,label:z.label,description:z.description,type:z.type}):z.type;return B!=null?v.createElement("span",{className:"ei-dropdown-item-type",style:{...JT(ee,X),...U}},B):null},te={flexDirection:"column",alignItems:"flex-start"},re={display:"flex",alignItems:"center",gap:X.dropdownItemContentGap,width:"100%"};if(z.type==="hint"&&(z.text==="#"||z.text==="!"))return v.createElement("div",{...be("ei-dropdown-item--hint",{opacity:ee?1:.7}),onMouseEnter:U=>{U.currentTarget.style.backgroundColor=ee?q.dropdownSelected:q.dropdownHover,U.currentTarget.style.opacity="1"},onMouseLeave:U=>{U.currentTarget.style.backgroundColor=ee?q.dropdownSelected:"transparent",U.currentTarget.style.opacity=ee?"1":"0.7"}},v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},z.label),z.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:zh()},z.description));if(z.type==="error")return v.createElement("div",{key:T,className:zn("ei-dropdown-item","ei-dropdown-item--error",w==null?void 0:w.dropdownItem),style:{...fe,cursor:"default",opacity:.8}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),color:q.error}},z.label||"Error loading suggestions"));if(z.type==="noResults")return v.createElement("div",{key:T,className:zn("ei-dropdown-item","ei-dropdown-item--no-results",w==null?void 0:w.dropdownItem),style:{...fe,cursor:"default",opacity:.7}},z.customContent);if(z.type==="loading")return v.createElement("div",{key:T,className:zn("ei-dropdown-item","ei-dropdown-item--loading",w==null?void 0:w.dropdownItem),style:{...fe,cursor:"default",opacity:.6,justifyContent:"center"}},v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),fontStyle:"italic"}},z.label||"Searching..."),v.createElement("span",{className:"ei-dropdown-spinner",style:{marginLeft:"6px",display:"inline-block",animation:"elastic-input-spin 1s linear infinite",width:"14px",height:"14px",border:"2px solid",borderColor:`${q.placeholder} transparent ${q.placeholder} transparent`,borderRadius:"50%"}}));if(z.type==="hint"){const U=zx(!1,q,X);return v.createElement("div",{key:T,className:zn("ei-dropdown-item","ei-dropdown-item--hint",w==null?void 0:w.dropdownItem),style:{...U,cursor:"default",opacity:z.customContent?1:.6}},z.customContent?z.customContent:v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},z.label))}if(z.type==="history"&&p&&z.sourceData){const U=p(z.sourceData,ee);if(U!=null)return v.createElement("div",be("ei-dropdown-item--history",te),U)}if(z.type==="savedSearch"&&g&&z.sourceData){const U=g(z.sourceData,ee);if(U!=null)return v.createElement("div",be("ei-dropdown-item--saved-search"),U)}if((z.type==="history"||z.type==="savedSearch")&&z.description!=null){const U=z.type==="history"?"ei-dropdown-item--history":"ei-dropdown-item--saved-search";let B;const ue=z.text.startsWith("(")&&z.text.endsWith(")")?z.text.slice(1,-1):z.text;return z.label!==ue&&(B=z.text),v.createElement("div",be(U,te,B),v.createElement("span",{className:"ei-dropdown-item-label",style:{...ti(),width:"100%",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"normal",wordBreak:"break-all"}},Hx(z.label,z.matchPartial,ee)),v.createElement("span",{style:re},v.createElement("span",{className:"ei-dropdown-item-desc",style:{...zh(),flex:1}},z.description),ye({marginLeft:"auto"})))}const ge=z.type==="savedSearch"?"ei-dropdown-item--saved-search":void 0;return v.createElement("div",be(ge),v.createElement("span",{className:"ei-dropdown-item-label",style:ti()},Hx(z.label,z.matchPartial,ee)),z.description&&v.createElement("span",{className:"ei-dropdown-item-desc",style:zh()},z.description),ye())}));return rl.createPortal(ne,A.current)}var dC=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Uh(t){return Math.floor(t/10)*10}function fC({onSelect:t,colors:n,styles:l,initialMode:s,initialStart:o,initialEnd:u,presets:f,className:m}){const p=s==="range"&&u?u:o??new Date,[g,x]=v.useState(s??"single"),[y,N]=v.useState("days"),[S,w]=v.useState(p.getFullYear()),[A,R]=v.useState(p.getMonth()),[L,I]=v.useState(o??null),[q,X]=v.useState(u??null),[W,ne]=v.useState(null),z=Zo(n),T=WT(z,Jo(l)),ee=()=>{y==="days"?A===0?(R(11),w(oe=>oe-1)):R(oe=>oe-1):w(y==="months"?oe=>oe-1:oe=>oe-10)},fe=()=>{y==="days"?A===11?(R(0),w(oe=>oe+1)):R(oe=>oe+1):w(y==="months"?oe=>oe+1:oe=>oe+10)},be=()=>{w(y==="days"?oe=>oe-1:y==="months"?oe=>oe-10:oe=>oe-100)},ye=()=>{w(y==="days"?oe=>oe+1:y==="months"?oe=>oe+10:oe=>oe+100)},te=()=>{y==="days"?N("months"):y==="months"&&N("years")},re=oe=>{R(oe),N("days")},ge=oe=>{w(oe),N("months")},U=oe=>{if(g==="single"){t(_h(oe));return}if(!L||q)I(oe),X(null),ne(null);else{const[$e,nt]=L<=oe?[L,oe]:[oe,L];I($e),X(nt),ne(null),t(`[${_h($e)} TO ${_h(nt)}]`)}},B=L&&!q?W:q,ue=oe=>{x(oe),I(null),X(null),ne(null)},de=y==="days"?`${GT(A)} ${S}`:y==="months"?`${S}`:`${Uh(S)}–${Uh(S)+9}`,we=y!=="years",C=new Date,V=Mx(S,A),ae=FT(S,A),me=["Su","Mo","Tu","We","Th","Fr","Sa"],Ne=[],je=(oe,$e,nt)=>{const Ut=yo(oe,C),ma=L&&yo(oe,L),jt=B&&yo(oe,B),_t=_x(oe,L,B),Qt=ma||jt,Ba={...T.day,...nt?T.dayOtherMonth:{},...Ut?T.dayToday:{},..._t?T.dayInRange:{},...Qt?T.daySelected:{}},Ha=g==="range"&&L&&!q;return v.createElement("button",{key:$e,className:"ei-datepicker-day",style:Ba,onClick:()=>U(oe),onMouseEnter:ta=>{Ha?ne(oe):Qt||(ta.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:ta=>{!Ha&&!Qt&&(ta.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},oe.getDate())};if(ae>0){const oe=Mx(S,A-1);for(let $e=ae-1;$e>=0;$e--){const nt=oe-$e,Ut=new Date(S,A-1,nt);Ne.push(je(Ut,`prev${nt}`,!0))}}for(let oe=1;oe<=V;oe++){const $e=new Date(S,A,oe);Ne.push(je($e,String(oe),!1))}const ze=Ne.length%7;if(ze>0){const oe=7-ze;for(let $e=1;$e<=oe;$e++){const nt=new Date(S,A+1,$e);Ne.push(je(nt,`next${$e}`,!0))}}const ut={...T.day,padding:"10px 4px",fontSize:"13px"},Ge={...ut,...T.dayToday},at=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"}],ba={display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2px"},Xt=oe=>{oe.currentTarget.style.backgroundColor="#eef1f5"},ft=oe=>{oe.currentTarget.style.backgroundColor="transparent"};return v.createElement("div",{className:zn("ei-datepicker",m),style:T.container,onMouseDown:oe=>oe.preventDefault(),onMouseLeave:()=>ne(null)},v.createElement("div",{className:"ei-datepicker-toggle",style:T.rangeToggle},["single","range"].map(oe=>v.createElement("button",{key:oe,style:{...T.rangeToggleButton,...g===oe?T.rangeToggleButtonActive:{}},onClick:()=>ue(oe)},oe.charAt(0).toUpperCase()+oe.slice(1)))),v.createElement("div",{className:"ei-datepicker-header",style:T.header},v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:be,onMouseEnter:Xt,onMouseLeave:ft},"«"),v.createElement("button",{style:T.navButton,onClick:ee,onMouseEnter:Xt,onMouseLeave:ft},"‹")),v.createElement("button",{style:{...T.monthLabel,backgroundColor:"transparent",border:"none",cursor:we?"pointer":"default",padding:"2px 8px",borderRadius:"4px"},onClick:we?te:void 0,onMouseEnter:oe=>{we&&(oe.currentTarget.style.backgroundColor="#eef1f5")},onMouseLeave:oe=>{oe.currentTarget.style.backgroundColor="transparent"}},de),v.createElement("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},v.createElement("button",{style:T.navButton,onClick:fe,onMouseEnter:Xt,onMouseLeave:ft},"›"),v.createElement("button",{style:T.navButton,onClick:ye,onMouseEnter:Xt,onMouseLeave:ft},"»"))),y==="days"&&v.createElement(v.Fragment,null,v.createElement("div",{style:T.weekDays},me.map(oe=>v.createElement("div",{key:oe,style:T.weekDay},oe))),v.createElement("div",{className:"ei-datepicker-days",style:T.days},Ne)),y==="months"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},dC.map((oe,$e)=>{const nt=new Date(S,$e,1),Ut=_x(nt,L,B),ma=L&&yo(new Date(L.getFullYear(),L.getMonth(),1),nt)||B&&yo(new Date(B.getFullYear(),B.getMonth(),1),nt),jt=$e===C.getMonth()&&S===C.getFullYear(),_t=g==="range"&&L&&!q;return v.createElement("button",{key:oe,style:{...jt?Ge:ut,...Ut?T.dayInRange:{},...ma?T.daySelected:{}},onClick:()=>re($e),onMouseEnter:Qt=>{_t?ne(nt):ma||(Qt.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:Qt=>{!_t&&!ma&&(Qt.currentTarget.style.backgroundColor=Ut?"rgba(9, 105, 218, 0.1)":"transparent")}},oe)})),y==="years"&&v.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"2px"}},Array.from({length:12},(oe,$e)=>{const nt=Uh(S)-1+$e,Ut=$e===0||$e===11,ma=nt===C.getFullYear(),jt=new Date(nt,0,1),_t=L&&B&&nt>=Math.min(L.getFullYear(),B.getFullYear())&&nt<=Math.max(L.getFullYear(),B.getFullYear()),Qt=L&&L.getFullYear()===nt||B&&B.getFullYear()===nt,Ba=g==="range"&&L&&!q;return v.createElement("button",{key:nt,style:{...ma?Ge:ut,...Ut?T.dayOtherMonth:{},..._t?T.dayInRange:{},...Qt?T.daySelected:{}},onClick:()=>ge(nt),onMouseEnter:Ha=>{Ba?ne(jt):Qt||(Ha.currentTarget.style.backgroundColor=z.dropdownHover)},onMouseLeave:Ha=>{!Ba&&!Qt&&(Ha.currentTarget.style.backgroundColor=_t?"rgba(9, 105, 218, 0.1)":"transparent")}},nt)})),(()=>{const oe=at.filter($e=>!$e.type||$e.type===g);return oe.length>0&&v.createElement("div",{className:"ei-datepicker-presets",style:{...T.quickOptions,...ba}},oe.map($e=>v.createElement("button",{key:`${$e.type??"both"}-${$e.value}`,style:T.quickOption,onClick:()=>t($e.value)},$e.label)))})())}var hC=30,mC=150;function $x(t,n){let l=0;const s=o=>{if(o.nodeType===Node.TEXT_NODE){const u=(o.textContent||"").length;return l+u>=n?{node:o,offset:n-l}:(l+=u,null)}if(o.nodeName==="BR"){if(l+1>=n){const u=o.parentNode;if(u)return{node:u,offset:Array.from(u.childNodes).indexOf(o)+1}}return l+=1,null}for(let u=0;u<o.childNodes.length;u++){const f=s(o.childNodes[u]);if(f)return f}return null};return s(t)}function pC(t,n,l){const s=$x(t,n),o=$x(t,l);if(!s||!o)return[];const u=document.createRange();u.setStart(s.node,s.offset),u.setEnd(o.node,o.offset);const f=t.getBoundingClientRect(),m=u.getClientRects();if(m.length===0)return[];const p=[];for(let g=0;g<m.length;g++){const x=m[g];x.width<1||p.push({left:x.left-f.left,top:x.top-f.top,width:Math.max(x.width,6),height:x.height})}return p}function gC(t,n,l){if(!n||t.length===0)return[];const s=[];let o=0;for(const u of t){if(o>=hC)break;if(l>=u.start&&l<=u.end)continue;const f=pC(n,u.start,u.end);for(const m of f)s.push({left:m.left,top:m.top,width:m.width,height:m.height,error:u});o++}return s}var qx=28,Ix=4;function vC(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 yC({errors:t,editorRef:n,cursorOffset:l,colors:s,styles:o,containerRef:u,classNames:f}){const[m,p]=v.useState(null),[g,x]=v.useState({x:0,clientY:0}),[y,N]=v.useState([]),S=v.useRef([]),w=v.useRef(null),A=v.useRef(null);if(v.useEffect(()=>{if(A.current&&clearTimeout(A.current),t.length===0){N([]),S.current=[],p(null);return}return A.current=setTimeout(()=>{const q=gC(t,n,l);N(q),S.current=q},mC),()=>{A.current&&clearTimeout(A.current)}},[t,n,l]),v.useEffect(()=>{const q=u;if(!q||!n)return;const X=z=>{const T=n.getBoundingClientRect(),ee=z.clientX-T.left,fe=z.clientY-T.top;let be=-1;for(let ye=0;ye<S.current.length;ye++){const te=S.current[ye];if(ee>=te.left&&ee<=te.left+te.width&&fe>=te.top&&fe<=te.top+te.height+6){be=ye;break}}be>=0?(p(be),x({x:ee,clientY:z.clientY})):p(null)},W=()=>{p(null)},ne=new AbortController;return q.addEventListener("mousemove",X,{signal:ne.signal}),q.addEventListener("mouseleave",W,{signal:ne.signal}),()=>ne.abort()},[u,n]),v.useEffect(()=>{const q=w.current;if(!q||m==null)return;const X=q.getBoundingClientRect();if(X.right>window.innerWidth-8){const W=X.right-window.innerWidth+8;q.style.transform=`translateX(-${W}px)`}else q.style.transform=""}),y.length===0)return null;const R=Zo(s),L=Jo(o),I=m!=null?y[m]:null;return v.createElement(v.Fragment,null,y.map((q,X)=>{const W=q.error.severity==="warning",ne=vC(W?R.warning:R.error),z=q.top+q.height-2;return v.createElement("div",{key:`wave-${X}`,className:zn("ei-squiggly",W?"ei-squiggly--warning":"ei-squiggly--error",f==null?void 0:f.squiggly),style:{position:"absolute",left:`${q.left}px`,top:`${z}px`,width:`${q.width}px`,height:"4px",zIndex:1,backgroundImage:ne,backgroundRepeat:"repeat-x",backgroundPosition:"left top",backgroundSize:"auto 4px",pointerEvents:"none"}})}),I!=null&&(()=>{const q=I.error.severity==="warning"?R.warning:R.error,X=n==null?void 0:n.getBoundingClientRect(),W=((X==null?void 0:X.left)??0)+g.x,ne=((X==null?void 0:X.top)??0)+I.top+I.height+2,z=((X==null?void 0:X.top)??0)+I.top,T=window.innerHeight-g.clientY<qx+20?z-qx-Ix:ne+Ix;return rl.createPortal(v.createElement("div",{ref:w,className:zn("ei-tooltip",f==null?void 0:f.tooltip),style:{position:"fixed",top:`${T}px`,left:`${W}px`,zIndex:L.dropdownZIndex,backgroundColor:R.background,color:q,border:`1px solid ${q}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",fontFamily:L.fontFamily,lineHeight:"1.4",whiteSpace:"nowrap",pointerEvents:"none",userSelect:"none",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",maxWidth:"90vw"}},I.error.message),document.body)})())}function Lo(t,n,l){let s=0,o=!1;function u(f){var m;if(o)return!0;if(f===n){if(f.nodeType===Node.TEXT_NODE)s+=l;else for(let p=0;p<l&&p<f.childNodes.length;p++)if(u(f.childNodes[p]))return!0;return o=!0,!0}if(f.nodeType===Node.TEXT_NODE)return s+=(f.textContent||"").length,!1;if(f.nodeName==="BR")return(m=f.hasAttribute)!=null&&m.call(f,"data-sentinel")||(s+=1),!1;for(let p=0;p<f.childNodes.length;p++)if(u(f.childNodes[p]))return!0;return!1}return u(t),s}function Ml(t){const n=window.getSelection();if(!n||n.rangeCount===0)return 0;const l=n.getRangeAt(0);return Lo(t,l.startContainer,l.startOffset)}function Rr(t){const n=window.getSelection();if(!n||n.rangeCount===0)return{start:0,end:0};const l=n.getRangeAt(0);return{start:Lo(t,l.startContainer,l.startOffset),end:Lo(t,l.endContainer,l.endOffset)}}function nl(t,n){const l=window.getSelection();if(!l)return;const s=Wh(t,n);if(!s)return;const o=document.createRange();o.setStart(s.node,s.offset),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}function al(t,n,l){if(n===l){nl(t,n);return}const s=window.getSelection();if(!s)return;const o=Wh(t,n),u=Wh(t,l);if(!o||!u)return;const f=document.createRange();f.setStart(o.node,o.offset),f.setEnd(u.node,u.offset),s.removeAllRanges(),s.addRange(f)}function Wh(t,n){let l=0;function s(f){var m;if(f.nodeType===Node.TEXT_NODE){const p=(f.textContent||"").length;return l+p>=n?{node:f,offset:n-l}:(l+=p,null)}if(f.nodeName==="BR"){if((m=f.hasAttribute)!=null&&m.call(f,"data-sentinel"))return null;if(l+1>=n){const p=f.parentNode;if(p)return{node:p,offset:Array.from(p.childNodes).indexOf(f)+1}}return l+=1,null}for(let p=0;p<f.childNodes.length;p++){const g=s(f.childNodes[p]);if(g)return g}return null}const o=s(t);if(o)return o;const u=I0(t);return u?{node:u,offset:(u.textContent||"").length}:{node:t,offset:0}}function I0(t){if(t.nodeType===Node.TEXT_NODE)return t;for(let n=t.childNodes.length-1;n>=0;n--){const l=I0(t.childNodes[n]);if(l)return l}return null}function xC(t){const n=window.getSelection();if(!n||n.rangeCount===0)return;const l=n.getRangeAt(0);l.deleteContents();const s=document.createTextNode(t);l.insertNode(s),l.setStartAfter(s),l.collapse(!0),n.removeAllRanges(),n.addRange(l)}function bC(){const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0);n.deleteContents();const l=document.createElement("br");n.insertNode(l),n.setStartAfter(l),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function xc(t){var m;const n=window.getSelection();if(!n||n.rangeCount===0)return;const l=n.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),n.removeAllRanges(),n.addRange(l)}const o=t.getBoundingClientRect(),u=s.top-o.top+t.scrollTop,f=s.bottom-o.top+t.scrollTop;f>t.scrollTop+t.clientHeight?t.scrollTop=f-t.clientHeight:u<t.scrollTop&&(t.scrollTop=u)}function Bh(){var s,o;const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0),l=n.getBoundingClientRect();if(l.width===0&&l.height===0||n.collapsed&&n.startContainer.nodeType===Node.ELEMENT_NODE&&n.startOffset>0&&((s=n.startContainer.childNodes[n.startOffset-1])==null?void 0:s.nodeName)==="BR"){const u=document.createElement("span");u.textContent="",n.insertNode(u);const f=u.getBoundingClientRect();return(o=u.parentNode)==null||o.removeChild(u),t.removeAllRanges(),t.addRange(n),f}return l}function Vx(t,n){return Math.min(t,n)}function Hh(t,n,l){const s=window.innerHeight,o=window.innerWidth;let u=t.bottom+window.scrollY+4,f=t.left+window.scrollX;return t.bottom+n+4>s&&(u=t.top+window.scrollY-n-4),f+l>o&&(f=o-l-8),f<8&&(f=8),{top:u,left:f}}var SC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD]);function wC(t,n,l){for(const s of t)if(n>=s.start&&n<=s.end&&SC.has(s.type))return n===s.start&&l===s.end?null:{start:s.start,end:s.end};return null}var EC=new Set([O.VALUE,O.QUOTED_VALUE,O.WILDCARD,O.FIELD_NAME,O.RANGE,O.SAVED_SEARCH,O.HISTORY_REF,O.REGEX]);function NC(t,n,l){const s=[];for(const o of n)if(l>=o.start&&l<=o.end&&EC.has(o.type)){s.push({start:o.start,end:o.end});break}return t&&Rc(t,l,s),RC(s)}function Rc(t,n,l){if(n<t.start||n>t.end)return!1;let s=!1;switch(t.type){case"BooleanExpr":s=Rc(t.left,n,l)||s,s=Rc(t.right,n,l)||s;break;case"Group":case"Not":case"FieldGroup":s=Rc(t.expression,n,l)||s;break}return l.push({start:t.start,end:t.end}),!0}function RC(t){t.sort((l,s)=>l.end-l.start-(s.end-s.start)||l.start-s.start);const n=[];for(const l of t){const s=n[n.length-1];s&&s.start===l.start&&s.end===l.end||n.push(l)}return n}var jC=60,TC=" ";function CC(t,n){const l=(n==null?void 0:n.maxLineLength)??jC,s=(n==null?void 0:n.indent)??TC,o={whitespace:n==null?void 0:n.whitespaceOperator,and:n==null?void 0:n.andOperator,or:n==null?void 0:n.orOperator,not:n==null?void 0:n.notOperator};let u;return typeof t=="string"?u=new ms(new ui(t,{savedSearches:!0,historySearch:!0}).tokenize()).parse():u=t,u?Tc(u,0,l,s,o):""}function AC(t,n){return t.implicit?n.whitespace??"":t.operator==="AND"?n.and??t.sourceOperator??"AND":n.or??t.sourceOperator??"OR"}function V0(t,n){const l=n.not??t.sourceOperator??"NOT";return{op:l,sep:/^[a-zA-Z]/.test(l)?" ":""}}function Tr(t,n){switch(t.type){case"FieldValue":{const l=t.quoted?`"${t.value}"`:t.value,s=t.operator===":"?":":`:${t.operator}`;let o=`${t.field}${s}${l}`;return t.fuzzy!=null&&(o+=`~${t.fuzzy}`),t.proximity!=null&&(o+=`~${t.proximity}`),t.boost!=null&&(o+=`^${t.boost}`),o}case"BareTerm":{let l=t.quoted?`"${t.value}"`:t.value;return t.fuzzy!=null&&(l+=`~${t.fuzzy}`),t.proximity!=null&&(l+=`~${t.proximity}`),t.boost!=null&&(l+=`^${t.boost}`),l}case"Range":{const l=t.lowerInclusive?"[":"{",s=t.upperInclusive?"]":"}",o=`${l}${t.lowerQuoted?`"${t.lower}"`:t.lower} TO ${t.upperQuoted?`"${t.upper}"`:t.upper}${s}`;return t.field?`${t.field}:${o}`:o}case"Regex":return`/${t.pattern}/`;case"SavedSearch":return`#${t.name}`;case"HistoryRef":return`!${t.ref}`;case"Not":{const{op:l,sep:s}=V0(t,n);return`${l}${s}${Tr(t.expression,n)}`}case"Group":{let l=`(${Tr(t.expression,n)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"FieldGroup":{let l=`${t.field}:(${Tr(t.expression,n)})`;return t.boost!=null&&(l+=`^${t.boost}`),l}case"BooleanExpr":{const l=AC(t,n),s=l?` ${l} `:" ";return`${Tr(t.left,n)}${s}${Tr(t.right,n)}`}case"Error":return t.value}}function DC(t){const n=t.operator,l=!!t.implicit,s=[],o=u=>{u.type==="BooleanExpr"&&u.operator===n&&!!u.implicit===l?(o(u.left),o(u.right)):s.push(u)};return o(t),{operator:n,implicit:l,sourceOperator:t.sourceOperator,operands:s}}function jc(t){return t.type==="Group"||t.type==="FieldGroup"?!0:t.type==="BooleanExpr"?jc(t.left)||jc(t.right):t.type==="Not"?jc(t.expression):!1}var kC={and:"AND",or:"OR",not:"NOT"};function OC(t,n){return!!(Tr(t,kC).length>n||jc(t))}function Tc(t,n,l,s,o){const u=s.repeat(n);switch(t.type){case"BooleanExpr":{const{operator:f,implicit:m,sourceOperator:p,operands:g}=DC(t),x=m?o.whitespace??"":f==="AND"?o.and??p??"AND":o.or??p??"OR",y=x?` ${x} `:" ",N=g.map(S=>Tr(S,o)).join(y);return N.length<=l?N:g.map((S,w)=>{const A=Tc(S,n,l,s,o);return w===0?A:x?`${u}${x} ${A}`:`${u}${A}`}).join(`
|
|
288
|
-
`)}case"Group":{if(!OC(t.expression,l)){let m=`(${Tr(t.expression,o)})`;return t.boost!=null&&(m+=`^${t.boost}`),m}let f=`(
|
|
289
|
-
${MC(Tc(t.expression,n+1,l,s,o),n+1,s)}
|
|
290
|
-
${u})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"FieldGroup":{let f=`${t.field}:(${Tr(t.expression,o)})`;return t.boost!=null&&(f+=`^${t.boost}`),f}case"Not":{const{op:f,sep:m}=V0(t,o);return`${f}${m}${Tc(t.expression,n,l,s,o)}`}default:return Tr(t,o)}}function MC(t,n,l){const s=l.repeat(n);return t.split(`
|
|
291
|
-
`).map(o=>o.startsWith(s)?o:s+o).join(`
|
|
292
|
-
`)}function _C(t){return t?Do(t):[]}function Yx(t){return t.type==="BooleanExpr"}function Do(t){switch(t.type){case"BooleanExpr":return em(t);case"Group":{const n=[],l=t.expression;return Yx(l)?(n.push({start:t.start,end:t.end}),n.push(...Do(l)),n.push({start:t.start,end:t.end})):n.push({start:t.start,end:t.end}),n}case"FieldGroup":{const n=[];n.push({start:t.start,end:t.end});const l=t.expression;return Yx(l)&&n.push(...Do(l)),n}case"Not":{const n=[];return n.push({start:t.start,end:t.end}),n.push(...Do(t.expression)),n}case"FieldValue":case"BareTerm":case"SavedSearch":case"HistoryRef":case"Regex":case"Range":case"Error":return[{start:t.start,end:t.end}]}}function em(t){return t.type==="BooleanExpr"?[...em(t.left),...em(t.right)]:Do(t)}function LC(t,n,l,s){if(t.length===0)return null;if(n>=0&&n<t.length){const o=s==="forward"?n+1:n-1;return o>=0&&o<t.length?{stop:t[o],index:o}:null}if(s==="forward"){for(let o=0;o<t.length;o++)if(t[o].start>=l)return{stop:t[o],index:o};return{stop:t[t.length-1],index:t.length-1}}else{for(let o=t.length-1;o>=0;o--)if(t[o].end<=l)return{stop:t[o],index:o};return{stop:t[0],index:0}}}var zC=class{constructor(t=100){fa(this,"stack",[]);fa(this,"index",-1);fa(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 UC(t,n){const l=s=>(n==null?void 0:n(s))??YT(s);if(t.type==="RANGE"&&t.token){const s=t.token.value,o=(s.endsWith("]")||s.endsWith("}")?s.slice(1,-1):s.slice(1)).match(/^(.*?)\s+[Tt][Oo]\s+(.*)$/);if(o)return{mode:"range",start:l(o[1].trim()),end:l(o[2].trim())}}if(t.type==="FIELD_VALUE"&&t.partial){const s=l(t.partial);if(s)return{mode:"single",start:s,end:null}}return null}function BC(t,n){var l,s,o,u;return((t==null?void 0:t.mode)??"single")!==((n==null?void 0:n.mode)??"single")||(((l=t==null?void 0:t.start)==null?void 0:l.getTime())??0)!==(((s=n==null?void 0:n.start)==null?void 0:s.getTime())??0)?!0:(((o=t==null?void 0:t.end)==null?void 0:o.getTime())??0)!==(((u=n==null?void 0:n.end)==null?void 0:u.getTime())??0)}function HC({position:t,colors:n,onSelect:l,colorConfig:s,styleConfig:o,datePickerInit:u,fixedWidth:f,datePresets:m,datePickerClassName:p}){const g=v.useRef(null),[x,y]=v.useState(!1);if(v.useEffect(()=>{const w=document.createElement("div");return document.body.appendChild(w),g.current=w,y(!0),()=>{document.body.removeChild(w),g.current=null}},[]),!x||!g.current)return null;const N=Jo(o),S={position:"absolute",zIndex:N.dropdownZIndex,...$0(n,N),top:`${t.top}px`,left:`${t.left}px`,maxHeight:"none",overflowY:"visible",...f!=null?{width:`${f}px`,minWidth:"unset",maxWidth:"unset"}:{}};return rl.createPortal(v.createElement("div",{className:"ei-datepicker-portal",style:S,onMouseDown:w=>w.preventDefault()},v.createElement(fC,{onSelect:l,colors:s,styles:o,initialMode:u==null?void 0:u.mode,initialStart:u==null?void 0:u.start,initialEnd:u==null?void 0:u.end,presets:m,className:p})),g.current)}function $C(t){const{fields:n,onSearch:l,onChange:s,onValidationChange:o,value:u,defaultValue:f,savedSearches:m,searchHistory:p,fetchSuggestions:g,colors:x,styles:y,placeholder:N,className:S,classNames:w,style:A,dropdown:R,features:L,inputRef:I,datePresets:q,onKeyDown:X,onFocus:W,onBlur:ne,onTab:z,validateValue:T,parseDate:ee,plainModeLength:fe,interceptPaste:be,defaultField:ye,trailingSpaceOnAccept:te=!0,collapseOnBlur:re=!1}=t,ge=typeof ye=="string"?{name:ye,showFieldSuggestions:!1}:ye?{showFieldSuggestions:!1,...ye}:void 0,U=ge==null?void 0:ge.name,B=(R==null?void 0:R.open)??(R==null?void 0:R.mode)??"always",ue=typeof B=="function",de=ue?null:B,we=(R==null?void 0:R.alignToInput)??!1,C=R==null?void 0:R.maxSuggestions,V=C||10,ae=R==null?void 0:R.suggestDebounceMs,me=parseInt((y==null?void 0:y.dropdownMaxHeight)||"300",10)||300,Ne=(L==null?void 0:L.savedSearches)??!!m,je=(L==null?void 0:L.historySearch)??!!p,ze=(R==null?void 0:R.showSavedSearchHint)??Ne,ut=(R==null?void 0:R.showHistoryHint)??je,Ge=(R==null?void 0:R.showOperators)!==!1,at=(ue||de!=="input")&&(R==null?void 0:R.onNavigation)!==!1,ba=(R==null?void 0:R.navigationDelay)??0,Xt=(R==null?void 0:R.loadingDelay)??0,ft=R==null?void 0:R.renderFieldHint,oe=R==null?void 0:R.renderHistoryItem,$e=R==null?void 0:R.renderSavedSearchItem,nt=R==null?void 0:R.renderHeader,Ut=R==null?void 0:R.renderNoResults,ma=R==null?void 0:R.renderType,jt=(R==null?void 0:R.autoSelect)??!1,_t=(R==null?void 0:R.homeEndKeys)??!1,Qt=(L==null?void 0:L.multiline)!==!1,Ba=(L==null?void 0:L.smartSelectAll)??!1,Ha=(L==null?void 0:L.expandSelection)??!1,ta=(L==null?void 0:L.wildcardWrap)??!1,dn=(L==null?void 0:L.clauseNavigation)??!1,fn=L==null?void 0:L.formatQuery,Ja=!!fn,$a=typeof fn=="object"?fn:void 0,he=v.useMemo(()=>({savedSearches:Ne,historySearch:je}),[Ne,je]),Ce=Array.isArray(n)?n:[],[Ae,Pe]=v.useState(Ce);v.useEffect(()=>{if(Array.isArray(n)){Pe(n);return}let j=!1;return n().then(P=>{j||Pe(P)}),()=>{j=!0}},[n]);const qe=v.useMemo(()=>{const j=new Map;for(const P of Ae)if(j.set(P.name.toLowerCase(),P.type),P.aliases)for(const Ee of P.aliases)j.set(Ee.toLowerCase(),P.type);return j},[Ae]),Z=v.useRef(null),[Tt,Kt]=v.useState(null),Va=v.useCallback(j=>{Z.current=j,Kt(j)},[]),pa=v.useRef(null),Bn=v.useRef(null),Me=v.useRef(u||f||""),vt=v.useRef(null),yt=v.useRef(!1),wt=v.useRef(!1),Bt=v.useRef(new zC),Ct=v.useRef(null),aa=v.useRef(new Set),Zt=v.useRef(null),Ht=v.useRef(null),ht=v.useRef(null),Je=v.useRef(null),Sa=v.useRef(!1),Da=v.useRef(null),D=v.useRef(null),M=v.useRef(null),$=v.useRef("input"),K=v.useRef(null),se=v.useRef(-1),Te=v.useRef(()=>{}),ve=v.useRef(new Mh(Ce,[],[],C||10,{showSavedSearchHint:ze,showHistoryHint:ut,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}));ve.current.setDefaultField(ge);const De=v.useRef(new Lx(Ce)),Re=v.useRef(T);Re.current=T;const[_e,Ue]=v.useState([]),[Xe,ke]=v.useState(null),[Ze,Ie]=v.useState([]),[$t,We]=v.useState(-1),[ct,it]=v.useState(!1),[dt,Jt]=v.useState(!1),[Ya,wa]=v.useState(null),[ka,Oa]=v.useState([]),[Fa,gn]=v.useState(!1),[ol,Wa]=v.useState(!Me.current),[pr,Qe]=v.useState(fe!=null&&Me.current.length>=fe),[Nt,Wt]=v.useState(0),[en,Ma]=v.useState(0),[Mr,Rt]=v.useState(""),[jn,Pa]=v.useState(null),[Fl,bi]=v.useState(null),At=v.useRef({tokens:_e,ast:Xe,suggestions:Ze,selectedSuggestionIndex:$t,showDropdown:ct,showDatePicker:dt,cursorOffset:Nt,selectionEnd:en,autocompleteContext:Mr,validationErrors:ka,cursorContext:jn});At.current={tokens:_e,ast:Xe,suggestions:Ze,selectedSuggestionIndex:$t,showDropdown:ct,showDatePicker:dt,cursorOffset:Nt,selectionEnd:en,autocompleteContext:Mr,validationErrors:ka,cursorContext:jn};const gr=v.useCallback((j,P)=>{if(we&&pa.current){const xe=pa.current.getBoundingClientRect();return{top:xe.bottom+window.scrollY+4,left:xe.left+window.scrollX}}const Ee=Bh();return Ee?Hh(Ee,j,P):null},[we]),Wo=v.useCallback(()=>{if(!(!we||!pa.current))return pa.current.getBoundingClientRect().width},[we]),ar=v.useCallback((j,P,Ee="dropdown")=>{const xe=Ee==="datePicker"?j:Vx(j,me);if(we&&Ee!=="datePicker"){it(!0),wa(gr(xe,P));return}const Fe=requestAnimationFrame(()=>{aa.current.delete(Fe),Ee==="datePicker"?Jt(!0):it(!0);const ce=Bh();wa(ce?Hh(ce,xe,P):null)});aa.current.add(Fe)},[we,gr,me]),ul=80,cd=60,Ss=v.useCallback((j,P)=>{if(!Z.current)return;const Ee=ai(j,x,{cursorOffset:P,tokenClassName:w==null?void 0:w.token,fieldTypeMap:qe});Z.current.innerHTML=Ee,document.activeElement===Z.current&&nl(Z.current,P)},[x]),vn=v.useCallback((j,P)=>{const Ee=fe!=null&&j.length>=fe;if(Qe(Ee),Ee){if(Ue([]),ke(null),Oa([]),Wa(j.length===0),Ie([]),At.current.tokens=[],it(!1),Jt(!1),Z.current){const Se=Ml(Z.current);Z.current.querySelector("span")&&(Z.current.textContent=j,nl(Z.current,Se)),Wt(Se),Ma(Se)}s&&s(j,null),o&&o([]);return}const xe=new ui(j,he).tokenize(),Fe=new ms(xe),ce=Fe.parse(),pe=yc([...Fe.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...De.current.validate(ce,Re.current,ee,U)]);if(Z.current){const Se=Ml(Z.current);P&&xe.length>ul?(Ht.current&&clearTimeout(Ht.current),Ht.current=setTimeout(()=>{Ht.current=null,Z.current&&Ss(xe,Ml(Z.current))},cd)):(Ht.current&&(clearTimeout(Ht.current),Ht.current=null),Ss(xe,Se)),Ue(xe),ke(ce),Oa(pe),Wa(j.length===0),Wt(Se),Ma(Se),At.current.tokens=xe,P&&Te.current(xe,Se)}else Ue(xe),ke(ce),Oa(pe),Wa(j.length===0),At.current.tokens=xe;s&&s(j,ce),o&&o(pe)},[x,s,o,Ss,fe]),Pl=v.useCallback((j,P)=>{if(!ft||P.type!=="FIELD_VALUE"||!P.fieldName)return j;const Ee=ve.current.resolveField(P.fieldName);if(!Ee)return j;const xe=ft(Ee,P.partial);return xe==null?j:j.some(Fe=>Fe.type==="hint")?j.map(Fe=>Fe.type==="hint"?{...Fe,customContent:xe}:Fe):[{text:"",label:"",type:"hint",customContent:xe,replaceStart:P.start??0,replaceEnd:P.end??0},...j]},[ft]),ws=v.useCallback(j=>{if(!Ut)return!1;const P=Ut({cursorContext:j,partial:j.partial});return P==null?!1:(Ie([{text:"",label:"",type:"noResults",customContent:P,replaceStart:0,replaceEnd:0}]),We(-1),Jt(!1),ar(32,300),!0)},[Ut]),yn=v.useCallback((j,P,Ee)=>{var Se,Ke,rt;const xe=ve.current.getSuggestions(j,P);Ge||(xe.suggestions=xe.suggestions.filter(Be=>Be.type!=="operator"));const Fe=xe.context.type;if(Pa(xe.context),ue){if(B({trigger:$.current,context:xe.context,suggestions:xe.suggestions,isOpen:At.current.showDropdown||At.current.showDatePicker,value:Me.current,selectionStart:P,selectionEnd:Ee??P})===!1){it(!1),Jt(!1),Ie([]);return}}else{if(de==="never"){it(!1),Jt(!1),Ie([]);return}if(de==="manual"){if(M.current&&M.current!==Fe){M.current=null,it(!1),Jt(!1),Ie([]);return}if(!M.current){it(!1),Jt(!1),Ie([]);return}}if(de==="input"&&$.current!=="input"&&$.current!=="ctrlSpace"){it(!1),Jt(!1),Ie([]);return}if(de==="always"&&j.some(Be=>(Be.type===O.AND||Be.type===O.OR||Be.type===O.NOT||Be.type===O.TILDE||Be.type===O.BOOST)&&P>=Be.start&&P<=Be.end)){it(!1),Jt(!1),Ie([]);return}}const ce=xe.context.fieldName?ve.current.resolveField(xe.context.fieldName):void 0,pe=!!(g&&xe.context.type==="FIELD_VALUE"&&xe.context.fieldName&&(ce==null?void 0:ce.type)!=="boolean"&&(ce==null?void 0:ce.suggestions)!==!1)||typeof m=="function"&&xe.context.type==="SAVED_SEARCH"||typeof p=="function"&&xe.context.type==="HISTORY_REF";if(xe.showDatePicker){Sa.current=!1,(Se=Zt.current)==null||Se.abort(),vt.current&&clearTimeout(vt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const Be=UC(xe.context,ee),Ea=Da.current;Da.current=Be,bi(Be);const Lt=xe.context.token;Lt&&(Lt.type==="COLON"||Lt.type==="COMPARISON_OP")?D.current={start:Lt.end,end:Lt.end}:Lt?D.current={start:Lt.start,end:Lt.end}:D.current={start:P,end:P},At.current.showDatePicker&&BC(Ea,Be)&&Jt(!1),Ie([]),we||it(!1),Rt(Fe),ar(350,300,"datePicker");return}if(pe){const Be=xe.context.token,Ea=Be?Be.start:P,Lt=Be?Be.end:P,nn=()=>{Je.current=null,Ie([{text:"",label:"Searching...",type:"loading",replaceStart:Ea,replaceEnd:Lt}]),we||it(!1),Jt(!1),We(-1),ar(32,300)};Je.current&&clearTimeout(Je.current),Xt>0?Je.current=setTimeout(nn,Xt):nn(),Rt(Fe)}else{Sa.current=!1,(Ke=Zt.current)==null||Ke.abort(),vt.current&&clearTimeout(vt.current),Je.current&&(clearTimeout(Je.current),Je.current=null);const Be=Pl(xe.suggestions,xe.context);Be.length>0?(Ie(Be),we||it(!1),Jt(!1),We(xe.context.partial||jt?0:-1),Rt(Fe),ar(Be.length*32,300)):(Rt(Fe),ws(xe.context)||(it(!1),Jt(!1),Ie([])))}if(pe){const Be=xe.context.partial,Ea=ae||200;Sa.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 nn=xe.context.token,rn=nn?nn.start:P,xn=nn?nn.end:P;try{let Na;if(xe.context.type==="SAVED_SEARCH"&&typeof m=="function"){const ua=await m(Be);if(Lt.signal.aborted)return;Na=ua.map(zt=>({text:zt.query,label:zt.label||zt.query,description:zt.description,type:"savedSearch",replaceStart:rn,replaceEnd:xn,matchPartial:Be,sourceData:zt}))}else if(xe.context.type==="HISTORY_REF"&&typeof p=="function"){const ua=await p(Be);if(Lt.signal.aborted)return;Na=ua.map(zt=>({text:Mh.wrapHistoryQuery(zt.query),label:zt.label||zt.query,description:zt.description,type:"history",replaceStart:rn,replaceEnd:xn,matchPartial:Be,sourceData:zt}))}else{const ua=xe.context.fieldName,zt=ve.current.resolveField(ua),Kl=await g(zt?zt.name:ua,Be);if(Lt.signal.aborted)return;Na=Kl.map(xr=>({text:xr.text,label:xr.label||xr.text,description:xr.description,type:xr.type,replaceStart:rn,replaceEnd:xn,matchPartial:Be}))}if(Je.current&&(clearTimeout(Je.current),Je.current=null),Na=Na.slice(0,V),Na.length>0){if(ge!=null&&ge.showFieldSuggestions){const ua=ve.current.getFieldSuggestions(Be,rn,xn);Na=[...Na,...ua].slice(0,V)}Ie(Na),We(Be||jt?0:-1),ar(Na.length*32,300)}else{const ua=ve.current.getSuggestions(At.current.tokens,At.current.cursorOffset);if(!(Be&&ws(ua.context))){const zt=Pl(ua.suggestions.filter(Kl=>Kl.type==="hint"),ua.context);zt.length>0?(Ie(zt),We(ua.context.partial||jt?0:-1),ar(zt.length*32,300)):ws(ua.context)||(it(!1),Ie([]))}}}catch(Na){Je.current&&(clearTimeout(Je.current),Je.current=null),Lt.signal.aborted||(Ie([{text:"",label:Na instanceof Error?Na.message:"Error loading suggestions",type:"error",replaceStart:rn,replaceEnd:xn}]),We(-1),ar(32,300),Sa.current=!1)}},Ea)}},[g,m,p,ae,Pl,gr,ar,we,B,ue,de,Ge,V,Xt,jt,ws]);Te.current=yn;const na=v.useCallback(()=>{var j;it(!1),Jt(!1),bi(null),Da.current=null,D.current=null,Ie([]),We(-1),Sa.current=!1,(j=Zt.current)==null||j.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),ht.current&&(clearTimeout(ht.current),ht.current=null),M.current=null},[]),tn=v.useCallback((j,P,Ee)=>{if(ht.current&&(clearTimeout(ht.current),ht.current=null),!at){(At.current.showDropdown||At.current.showDatePicker)&&na();return}$.current="navigation",ba>0?ht.current=setTimeout(()=>{ht.current=null,yn(j,P,Ee)},ba):yn(j,P,Ee)},[at,ba,yn,na]),Tn=v.useCallback((j,P,Ee)=>{Me.current=j,Ct.current&&(clearTimeout(Ct.current),Ct.current=null),Bt.current.push({value:j,cursorPos:P});const xe=new ui(j,he).tokenize(),Fe=new ms(xe),ce=Fe.parse(),pe=yc([...Fe.getErrors().map(Se=>({message:Se.message,start:Se.start,end:Se.end,type:"SYNTAX_ERROR"})),...De.current.validate(ce,Re.current,ee,U)]);if(Z.current){const Se=ai(xe,x,{cursorOffset:P,tokenClassName:w==null?void 0:w.token,fieldTypeMap:qe});Z.current.innerHTML=Se,nl(Z.current,P)}if(Ue(xe),ke(ce),Oa(pe),Wa(j.length===0),Wt(P),Ma(P),it(!1),Jt(!1),s&&s(j,ce),o&&o(pe),Ee){const Se=requestAnimationFrame(()=>{aa.current.delete(Se),Ee(xe,ce)});aa.current.add(Se)}},[x,s,o]),_r=v.useCallback((j,P="Enter",Ee,xe)=>{if(!j)return;const Fe=At.current,ce=Fe.autocompleteContext,pe=ce==="FIELD_VALUE"||ce==="SAVED_SEARCH"||ce==="HISTORY_REF";if(pe&&($.current="navigation"),j.type==="hint"&&(j.text==="#"||j.text==="!")){const ua=j.text,zt=j.replaceStart,Kl=Math.max(j.replaceEnd,Fe.selectionEnd),xr=Me.current.slice(0,zt),fd=Me.current.slice(Kl),nu=xr+ua+fd,ru=xr.length+ua.length;Tn(nu,ru,(hd,md)=>{Ee?Ee(nu,md):yn(hd,ru)});return}if(j.type==="hint")return;const Se=Fe.autocompleteContext==="FIELD_VALUE",Ke=Math.min(j.replaceStart,Fe.cursorOffset),rt=Math.max(j.replaceEnd,Fe.selectionEnd),Be=Me.current.slice(0,Ke),Ea=Me.current.slice(rt);let Lt="",nn=Ea;pe&&te&&(Ea.length===0?Lt=" ":/^[ \t\r\n]+$/.test(Ea)&&!Ea.startsWith("\\ ")&&(Lt=" ",nn=""));const rn=Be+j.text+Lt+nn,xn=Be.length+j.text.length+Lt.length,Na=P==="Enter"&&Se;Tn(rn,xn,(ua,zt)=>{Ee?Ee(rn,zt):Na?l&&l(rn,zt,xe):yn(ua,xn)})},[Tn,yn,l,te]);v.useEffect(()=>{Array.isArray(m)&&ve.current.updateSavedSearches(m),Array.isArray(p)&&ve.current.updateSearchHistory(p)},[m,p]),v.useEffect(()=>{ve.current=new Mh(Ae,[],[],C||10,{showSavedSearchHint:ze,showHistoryHint:ut,hasSavedSearchProvider:typeof m=="function",hasHistoryProvider:typeof p=="function"}),ve.current.setDefaultField(ge),De.current=new Lx(Ae),Array.isArray(m)&&ve.current.updateSavedSearches(m),Array.isArray(p)&&ve.current.updateSearchHistory(p),Me.current&&vn(Me.current,!1)},[Ae,C,ze,ut]),v.useEffect(()=>{I&&I({getValue:()=>Me.current,setValue:j=>{Me.current=j,vn(j,!1)},focus:()=>{var j;return(j=Z.current)==null?void 0:j.focus()},blur:()=>{var j;return(j=Z.current)==null?void 0:j.blur()},getAST:()=>At.current.ast,getValidationErrors:()=>At.current.validationErrors,setSelection:(j,P)=>{Z.current&&(Z.current.focus(),al(Z.current,j,P),Wt(j),Ma(P))}})},[I,vn]),v.useEffect(()=>{const j=Me.current;Bt.current.push({value:j,cursorPos:j.length}),j&&vn(j,!1)},[]),v.useEffect(()=>{u!==void 0&&u!==Me.current&&(Me.current=u,vn(u,!1))},[u,vn]),v.useEffect(()=>()=>{var j;vt.current&&clearTimeout(vt.current),Ht.current&&clearTimeout(Ht.current),ht.current&&clearTimeout(ht.current),Je.current&&clearTimeout(Je.current),aa.current.forEach(P=>cancelAnimationFrame(P)),aa.current.clear(),(j=Zt.current)==null||j.abort()},[]),v.useEffect(()=>{if(ue){const j=At.current;j.cursorContext&&B({trigger:"modeChange",context:j.cursorContext,suggestions:j.suggestions,isOpen:j.showDropdown||j.showDatePicker,value:Me.current,selectionStart:j.cursorOffset,selectionEnd:j.selectionEnd})===!1&&(it(!1),Jt(!1),Ie([]))}else de==="never"&&(it(!1),Jt(!1),Ie([]));M.current=null},[B]);const vr=v.useRef(!1);v.useLayoutEffect(()=>{if(vr.current){vr.current=!1;return}const j=Bn.current;if(!j||!Ya)return;const P=j.getBoundingClientRect(),Ee=window.innerWidth;if(P.right>Ee-8){const xe=P.right-Ee+8;vr.current=!0,wa(Fe=>Fe&&{...Fe,left:Math.max(8,Fe.left-xe)})}},[Ya,ct,dt,Ze]),v.useEffect(()=>{const j=()=>{const P=At.current;if(!(!P.showDropdown&&!P.showDatePicker))if(P.showDropdown&&we&&pa.current){const Ee=pa.current.getBoundingClientRect();wa({top:Ee.bottom+window.scrollY+4,left:Ee.left+window.scrollX})}else{const Ee=Bh();Ee&&wa(Hh(Ee,P.showDatePicker?350:Vx(P.suggestions.length*32,me),300))}};return window.addEventListener("resize",j),window.addEventListener("scroll",j,!0),()=>{window.removeEventListener("resize",j),window.removeEventListener("scroll",j,!0)}},[we,me]),v.useEffect(()=>{const j=Z.current;if(!j)return;const P=()=>{(At.current.showDropdown||At.current.showDatePicker)&&na()};return j.addEventListener("scroll",P),()=>j.removeEventListener("scroll",P)},[na]);const Lr=v.useRef(null),Si=v.useRef(x);v.useEffect(()=>{if(!Z.current)return;const j=At.current.tokens;if(j.length===0||Fa&&en!==Nt)return;const P=Fa?Nt:-1,Ee=x!==Si.current;Si.current=x;const xe=q0(j,P),Fe=xe?`${xe.openStart},${xe.closeStart}`:null;if(Fe===Lr.current&&!Ee)return;Lr.current=Fe;const ce=Fa?Ml(Z.current):-1,pe=ai(j,x,{cursorOffset:P,tokenClassName:w==null?void 0:w.token,fieldTypeMap:qe});Z.current.innerHTML=pe,Fa&&ce>=0&&nl(Z.current,ce)},[Nt,en,Fa,x]);const yr=re&&!Fa,wi=v.useRef(yr);v.useEffect(()=>{if(!Z.current)return;const j=wi.current;if(wi.current=yr,j!==yr)if(yr)Z.current.innerHTML=Z.current.innerHTML.replace(/<br\s*\/?>/gi," ");else{const P=At.current.tokens;if(P.length>0){const Ee=Fa?Ml(Z.current):-1,xe=ai(P,x,{cursorOffset:Ee,tokenClassName:w==null?void 0:w.token,fieldTypeMap:qe});Z.current.innerHTML=xe,Fa&&Ee>=0&&nl(Z.current,Ee)}}},[yr,x]);const Hn=v.useCallback(()=>{if(yt.current||!Z.current)return;K.current=null,se.current=-1,ht.current&&(clearTimeout(ht.current),ht.current=null);let j=$T(Z.current);if(j===Me.current)return;let P=Ml(Z.current);const Ee=Dx(j);Ee!==j&&(j=Ee,P=Math.min(P,j.length)),Me.current=j;const xe=Bt.current,Fe=xe.current();if(Fe&&Math.abs(j.length-Fe.value.length)<=2&&Ct.current?xe.replaceCurrent({value:j,cursorPos:P}):xe.push({value:j,cursorPos:P}),Ct.current&&clearTimeout(Ct.current),Ct.current=setTimeout(()=>{Ct.current=null},300),$.current="input",!ue&&de==="input"){const ce=P>0?j[P-1]:"";if(!ce||ce.trim()===""){vn(j,!1),na(),Z.current&&xc(Z.current);return}}vn(j,!0),Z.current&&xc(Z.current)},[vn,ue,de,na]),nr=v.useCallback(()=>{yt.current=!0},[]),Ei=v.useCallback(()=>{yt.current=!1,Hn()},[Hn]),zr=v.useCallback(j=>{if(!j)return;Me.current=j.value;const P=new ui(j.value,he).tokenize(),Ee=new ms(P),xe=Ee.parse(),Fe=yc([...Ee.getErrors().map(pe=>({message:pe.message,start:pe.start,end:pe.end,type:"SYNTAX_ERROR"})),...De.current.validate(xe,Re.current,ee,U)]),ce=j.selStart!=null&&j.selStart!==j.cursorPos;if(Z.current){const pe=ai(P,x,{cursorOffset:j.cursorPos,tokenClassName:w==null?void 0:w.token,fieldTypeMap:qe});Z.current.innerHTML=pe,ce?al(Z.current,j.selStart,j.cursorPos):nl(Z.current,j.cursorPos)}Ue(P),ke(xe),Oa(Fe),Wa(j.value.length===0),Wt(ce?j.selStart:j.cursorPos),Ma(j.cursorPos),na(),s&&s(j.value,xe),o&&o(Fe)},[x,s,o,na]),$n=v.useCallback(()=>{const j=Bn.current;if(!j)return 10;const P=j.clientHeight,Ee=j.querySelectorAll(".ei-dropdown-item")[0];if(!Ee)return 10;const xe=Ee.offsetHeight;return xe<=0?10:Math.max(1,Math.floor(P/xe))},[]),Ni=v.useCallback(j=>{var xe,Fe;if(X&&X(j),j.defaultPrevented)return;const P=At.current,Ee=j.nativeEvent.code;if(Ja&&Ee==="KeyF"&&j.altKey&&j.shiftKey&&!j.ctrlKey&&!j.metaKey){j.preventDefault();const ce=CC(Me.current,$a);ce!==Me.current&&Tn(ce,ce.length);return}if(Z.current&&Z.current.childNodes.length>40){const ce=window.getSelection();if(ce!=null&&!ce.isCollapsed){const pe=Rr(Z.current);if(pe.end-pe.start>20){const Se=j.key==="Backspace"||j.key==="Delete"||j.key==="x"&&(j.ctrlKey||j.metaKey),Ke=!j.ctrlKey&&!j.metaKey&&!j.altKey&&j.key.length===1;(Se||Ke)&&(Z.current.textContent=Me.current,al(Z.current,pe.start,pe.end))}}}{let ce=null,pe=null;if(kx[j.key])ce=j.key,pe=kx[j.key];else if(ta&&j.key==="*"&&Z.current){const Se=Rr(Z.current);if(Se.start!==Se.end){const[Ke,rt]=Ox(P.tokens,Se.start,Se.end);if(Ke>=0&&Ke===rt){const Be=P.tokens[Ke];(Be.type===O.VALUE||Be.type===O.WILDCARD)&&(ce="*",pe="*")}}}if(ce&&pe&&Z.current){const Se=Rr(Z.current);if(Se.start!==Se.end){j.preventDefault();const{newValue:Ke,newSelStart:rt,newSelEnd:Be}=HT(Me.current,Se.start,Se.end,ce,pe),Ea=Bt.current,Lt=Ea.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),Ea.push({value:Ke,cursorPos:Be,selStart:rt});const nn=new ui(Ke,he).tokenize(),rn=new ms(nn),xn=rn.parse(),Na=yc([...rn.getErrors().map(zt=>({message:zt.message,start:zt.start,end:zt.end,type:"SYNTAX_ERROR"})),...De.current.validate(xn,Re.current,ee,U)]),ua=ai(nn,x,{cursorOffset:Be,tokenClassName:w==null?void 0:w.token,fieldTypeMap:qe});Z.current.innerHTML=ua,al(Z.current,rt,Be),Ue(nn),ke(xn),Oa(Na),Wa(!1),Wt(rt),Ma(Be),na(),s&&s(Ke,xn),o&&o(Na);return}}}if(j.key==="z"&&(j.ctrlKey||j.metaKey)&&!j.shiftKey){j.preventDefault(),zr(Bt.current.undo());return}if(j.key==="y"&&(j.ctrlKey||j.metaKey)||j.key==="z"&&(j.ctrlKey||j.metaKey)&&j.shiftKey){j.preventDefault(),zr(Bt.current.redo());return}if(j.key==="a"&&(j.ctrlKey||j.metaKey)&&Ba&&Z.current){const ce=Rr(Z.current),pe=wC(P.tokens,ce.start,ce.end);if(pe){j.preventDefault(),al(Z.current,pe.start,pe.end),Wt(pe.start),Ma(pe.end);return}}if(Ha&&j.altKey&&j.shiftKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&Z.current){const ce=Ee==="ArrowRight";let pe=K.current;if(!pe){const Ke=Rr(Z.current),rt=NC(P.ast,P.tokens,Ke.start);if(rt.length===0)return;pe={ranges:rt,level:-1},K.current=pe}const Se=ce?Math.min(pe.level+1,pe.ranges.length-1):Math.max(pe.level-1,-1);if(Se===pe.level)return;if(pe.level=Se,Se<0){const Ke=Rr(Z.current);nl(Z.current,Ke.start),K.current=null}else{j.preventDefault();const Ke=pe.ranges[Se];al(Z.current,Ke.start,Ke.end),Wt(Ke.start),Ma(Ke.end)}return}if(K.current=null,dn&&j.ctrlKey&&j.altKey&&(Ee==="ArrowRight"||Ee==="ArrowLeft")&&Z.current){j.preventDefault();const ce=Ee==="ArrowRight"?"forward":"backward",pe=_C(P.ast),Se=Rr(Z.current),Ke=ce==="forward"?Se.end:Se.start,rt=LC(pe,se.current,Ke,ce);rt&&(se.current=rt.index,al(Z.current,rt.stop.start,rt.stop.end),Wt(rt.stop.start),Ma(rt.stop.end));return}if(se.current=-1,j.key===" "&&(j.ctrlKey||j.metaKey)){j.preventDefault(),$.current="ctrlSpace",!ue&&de==="manual"&&(M.current=ve.current.getSuggestions(P.tokens,P.cursorOffset).context.type),yn(P.tokens,P.cursorOffset);return}if(j.key==="Enter"&&(j.ctrlKey||j.metaKey)){j.preventDefault(),na(),l&&l(Me.current,P.ast,j);return}if(j.key==="Enter"&&j.shiftKey&&Qt){j.preventDefault(),bC();const ce=Z.current?Ml(Z.current):Me.current.length+1,pe=Me.current,Se=pe.slice(0,ce-1)+`
|
|
293
|
-
`+pe.slice(ce-1);Me.current=Se,K.current=null,ht.current&&(clearTimeout(ht.current),ht.current=null),$.current="input",Bt.current.push({value:Se,cursorPos:ce}),vn(Se,!0),Z.current&&xc(Z.current);return}if((j.key==="Backspace"||j.key==="Delete")&&Z.current&&!Z.current.textContent){const ce=Me.current;if(!ce)return;const{start:pe,end:Se}=Rr(Z.current);let Ke,rt;if(pe!==Se)Ke=ce.slice(0,pe)+ce.slice(Se),rt=pe;else if(j.key==="Backspace"&&pe>0)Ke=ce.slice(0,pe-1)+ce.slice(pe),rt=pe-1;else if(j.key==="Delete"&&pe<ce.length)Ke=ce.slice(0,pe)+ce.slice(pe+1),rt=pe;else return;j.preventDefault(),Me.current=Ke,K.current=null,ht.current&&(clearTimeout(ht.current),ht.current=null),$.current="input",Bt.current.push({value:Ke,cursorPos:rt}),nl(Z.current,rt),vn(Ke,!0),Z.current&&xc(Z.current);return}if(wt.current=!1,P.showDropdown&&P.suggestions.length>0)switch(j.key){case"ArrowDown":j.preventDefault(),wt.current=!0,We(ce=>ce>=P.suggestions.length-1?0:ce+1);return;case"ArrowUp":j.preventDefault(),wt.current=!0,We(ce=>ce<=0?P.suggestions.length-1:ce-1);return;case"PageDown":{j.preventDefault(),wt.current=!0;const ce=$n();We(pe=>Math.min(pe+ce,P.suggestions.length-1));return}case"PageUp":{j.preventDefault(),wt.current=!0;const ce=$n();We(pe=>Math.max(pe-ce,0));return}case"Home":if(_t&&P.selectedSuggestionIndex>=0){j.preventDefault(),wt.current=!0,We(0);return}break;case"End":if(_t&&P.selectedSuggestionIndex>=0){j.preventDefault(),wt.current=!0,We(P.suggestions.length-1);return}break;case"Enter":if(P.selectedSuggestionIndex>=0){const ce=P.suggestions[P.selectedSuggestionIndex];if(ce.type==="loading"||ce.type==="error"){j.preventDefault(),na(),l&&l(Me.current,P.ast,j);return}if(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!"){j.preventDefault(),na();const pe=Me.current,Se=P.cursorOffset;if(Se<=pe.length&&pe[Se]!==" "){const Ke=pe.slice(0,Se),rt=pe.slice(Se),Be=Ke+" "+rt;Tn(Be,Se+1,()=>{l&&l(Be,P.ast,j)})}else l&&l(pe,P.ast,j);return}j.preventDefault(),_r(ce,"Enter",void 0,j);return}j.preventDefault(),na(),l&&l(Me.current,P.ast,j);return;case"Tab":if(z){j.preventDefault();const ce=P.selectedSuggestionIndex>=0?P.suggestions[P.selectedSuggestionIndex]:null,pe=ce&&ce.type!=="loading"&&ce.type!=="error"&&!(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!")?ce:null,Se=z({suggestion:pe,cursorContext:P.cursorContext||{type:"EMPTY",partial:""},query:Me.current});Se.accept&&pe?_r(pe,"Tab",(Ke,rt)=>{var Be;Se.submit&&l&&l(Ke,rt,j),Se.blur&&((Be=Z.current)==null||Be.blur())},j):(na(),Se.submit&&l&&l(Me.current,P.ast,j),Se.blur&&((xe=Z.current)==null||xe.blur()));return}if(P.selectedSuggestionIndex>=0){const ce=P.suggestions[P.selectedSuggestionIndex];if(ce.type==="hint"&&ce.text!=="#"&&ce.text!=="!"){j.preventDefault(),na();const pe=Me.current,Se=P.cursorOffset;if(Se<=pe.length&&pe[Se]!==" "){const Ke=pe.slice(0,Se),rt=pe.slice(Se),Be=Ke+" "+rt,Ea=Se+1;Tn(Be,Ea,Lt=>{yn(Lt,Ea)})}return}j.preventDefault(),_r(ce,"Tab",void 0,j);return}break;case"Escape":j.preventDefault(),na();return}if(j.key==="Tab"&&z){j.preventDefault();const ce=z({suggestion:null,cursorContext:P.cursorContext||{type:"EMPTY",partial:""},query:Me.current});ce.submit&&l&&l(Me.current,P.ast,j),ce.blur&&((Fe=Z.current)==null||Fe.blur());return}if(P.showDatePicker&&j.key==="Escape"){j.preventDefault(),na();return}if(j.key==="Enter"&&!P.showDropdown&&!P.showDatePicker){j.preventDefault(),l&&l(Me.current,P.ast,j);return}},[l,na,_r,Tn,zr,Qt,ue,de,yn,X,z,Ba,Ha,dn,_t,$n,Ja]),Es=v.useCallback(j=>{if(wt.current){wt.current=!1;return}if(["ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(j.key)){if(!Z.current)return;const P=Rr(Z.current);Wt(P.start),Ma(P.end),tn(At.current.tokens,P.start,P.end)}},[tn]),eu=v.useCallback(()=>{gn(!0),W==null||W();const j=requestAnimationFrame(()=>{if(aa.current.delete(j),Z.current){const P=At.current.tokens,Ee=P.length>0?Ml(Z.current):0;Wt(Ee),Ma(Ee),tn(P,Ee)}});aa.current.add(j)},[Hn,tn,W]),Ns=v.useCallback(()=>{var j;gn(!1),it(!1),Jt(!1),Ie([]),Sa.current=!1,(j=Zt.current)==null||j.abort(),vt.current&&(clearTimeout(vt.current),vt.current=null),Je.current&&(clearTimeout(Je.current),Je.current=null),Wt(-1),ne==null||ne()},[ne]),Ur=v.useRef(!1),tu=v.useCallback(j=>{if(!Z.current||j.detail!==2&&j.detail!==3)return;if(j.detail===3){if(!At.current.ast)return;const Se=document.caretRangeFromPoint(j.clientX,j.clientY);if(!Se)return;const Ke=Lo(Z.current,Se.startContainer,Se.startOffset),rt=LT(At.current.ast,Me.current,Ke);if(!rt||rt.start>=rt.end)return;j.preventDefault(),Ur.current=!0,al(Z.current,rt.start,rt.end);return}j.preventDefault(),Ur.current=!0;const P=document.caretRangeFromPoint(j.clientX,j.clientY);if(!P)return;const Ee=Lo(Z.current,P.startContainer,P.startOffset),xe=Me.current,Fe=Se=>!/[\s:()[\]{}"<>!,;|&=~^+\-*/\\]/.test(Se);let ce=Ee;for(;ce>0&&Fe(xe[ce-1]);)ce--;let pe=Ee;for(;pe<xe.length&&Fe(xe[pe]);)pe++;ce<pe&&al(Z.current,ce,pe)},[]),an=v.useCallback(j=>{Ur.current&&(j.preventDefault(),Ur.current=!1)},[]),Br=v.useCallback(()=>{if(!Z.current)return;const j=Rr(Z.current);if(Wt(j.start),Ma(j.end),j.start!==j.end){const[P,Ee]=Ox(At.current.tokens,j.start,j.end);if(P!==Ee){na();return}}tn(At.current.tokens,j.start,j.end)},[tn,na]),Hr=v.useCallback(j=>{Ct.current&&(clearTimeout(Ct.current),Ct.current=null),xC(j),Hn()},[Hn]),Gl=v.useCallback(j=>{j.preventDefault();const P=Dx(j.clipboardData.getData("text/plain"));if(be){const Ee=be(P,j);Ee!=null&&typeof(Ee==null?void 0:Ee.then)=="function"?Ee.then(xe=>{xe!=null&&Hr(xe)}).catch(()=>{}):Ee!=null&&Hr(Ee)}else Hr(P)},[be,Hr]),dd=v.useCallback(j=>{$.current="navigation";const P=At.current,Ee=D.current,xe=Ee?Ee.start:P.cursorOffset,Fe=Ee?Ee.end:P.cursorOffset,ce=Me.current.slice(0,xe),pe=Me.current.slice(Fe);let Se="",Ke=pe;te&&j.length>0&&(pe.length===0?Se=" ":/^[ \t\r\n]+$/.test(pe)&&!pe.startsWith("\\ ")&&(Se=" ",Ke=""));const rt=ce+j+Se+Ke,Be=ce.length+j.length+Se.length;Tn(rt,Be,Ea=>{Z.current&&Z.current.focus(),yn(Ea,Be)})},[Tn,yn,te]),cl=Zo(x),Xl=Jo(y),Ql=XT(cl,A),$r={...QT(cl,Xl),...Fa?KT(Xl):{}};yr&&($r.whiteSpace="nowrap",$r.overflow="hidden",$r.textOverflow="ellipsis");const au=ZT(cl,Xl);return v.createElement("div",{ref:pa,style:Ql,className:zn("ei-container",S,w==null?void 0:w.container)},v.createElement("div",{ref:Va,contentEditable:!0,suppressContentEditableWarning:!0,className:zn("ei-editor",w==null?void 0:w.editor),style:$r,onInput:Hn,onKeyDown:Ni,onKeyUp:Es,onMouseDown:tu,onMouseUp:an,onFocus:eu,onBlur:Ns,onClick:Br,onPaste:Gl,onCompositionStart:nr,onCompositionEnd:Ei,spellCheck:!1}),ol&&!Fa?v.createElement("div",{className:zn("ei-placeholder",w==null?void 0:w.placeholder),style:au},N):null,v.createElement(yC,{errors:ka,editorRef:Tt,cursorOffset:Nt,colors:x,styles:y,containerRef:pa.current,classNames:w?{squiggly:w.squiggly,tooltip:w.tooltip}:void 0}),v.createElement(cC,{suggestions:Ze,selectedIndex:$t,onSelect:j=>_r(j,"Tab"),position:Ya,colors:x,styles:y,visible:ct,fixedWidth:Wo(),renderHistoryItem:oe,renderSavedSearchItem:$e,renderDropdownHeader:nt,cursorContext:jn,listRefCallback:j=>{Bn.current=j},renderType:ma,classNames:w?{dropdown:w.dropdown,dropdownHeader:w.dropdownHeader,dropdownItem:w.dropdownItem}:void 0}),dt&&Ya?v.createElement(HC,{position:Ya,colors:cl,onSelect:dd,colorConfig:x,styleConfig:y,datePickerInit:Fl,fixedWidth:void 0,datePresets:q,datePickerClassName:w==null?void 0:w.datePicker}):null)}const qC=["planned","in-progress","paused","done","blocked","canceled","rejected","deferred","waiting"];function Fx(t){var o;const n=window.getSelection();if(!n||n.rangeCount===0)return((o=t.textContent)==null?void 0:o.length)??0;const l=n.getRangeAt(0),s=l.cloneRange();return s.selectNodeContents(t),s.setEnd(l.endContainer,l.endOffset),s.toString().length}function IC(t){return n=>{if(!(n.ctrlKey&&!n.metaKey&&!n.altKey))return;const l=n.key.toLowerCase(),s=n.currentTarget,o=s.isContentEditable?s:s.querySelector("[contenteditable='true'], [contenteditable]")??s,u=t.current;if(l==="h"&&u){n.preventDefault();const m=u.getValue();let p=Fx(o);(p<0||p>m.length)&&(p=m.length),p>0&&(u.setValue(m.slice(0,p-1)+m.slice(p)),u.setSelection(p-1,p-1));return}if(l==="u"&&u){n.preventDefault();const m=u.getValue();let p=Fx(o);if((p<0||p>m.length)&&(p=m.length),p===0)return;let g=p;for(;g>0&&/\s/.test(m[g-1]??"");)g--;if(g===p)for(;g>0&&!/\s/.test(m[g-1]??"");)g--;g<p&&(u.setValue(m.slice(0,g)+m.slice(p)),u.setSelection(g,g));return}const f=l==="j"?"ArrowDown":l==="k"?"ArrowUp":null;f&&(n.preventDefault(),o.dispatchEvent(new KeyboardEvent("keydown",{key:f,bubbles:!0,cancelable:!0})))}}function $h(t){return String(t>0?t:0).padStart(3,"0")}function VC({features:t,phases:n,query:l,onQuery:s}){const o=v.useRef(null),u=IC(o),f=v.useMemo(()=>[{name:"feature",label:"Feature",type:"number",description:"Feature number, e.g. 1 (F001)"},{name:"phase",label:"Phase",type:"number",description:"Phase number, e.g. 2 (P002)"},{name:"task",label:"Task",type:"number",description:"Task number, e.g. 10 (T010). Comma-list supported."},{name:"id",label:"Short ID",type:"string",description:"Global 5-char short id, e.g. UUXD1"},{name:"status",label:"Status",type:"string",description:"Task status"},{name:"feature-status",label:"Feature status",type:"string",description:"Status of the feature"},{name:"phase-status",label:"Phase status",type:"string",description:"Status of the phase"},{name:"title",label:"Title",type:"string",description:"Substring match on title"}],[]),m=v.useMemo(()=>{const y=[...new Set(t.map(R=>R.number))].sort((R,L)=>R-L),N=[...new Set(n.map(R=>R.number))].sort((R,L)=>R-L),S=[...new Set(n.flatMap(R=>R.tasks.map(L=>L.number)))].sort((R,L)=>R-L),w=[...new Set([...t.map(R=>R.shortId),...n.flatMap(R=>[R.shortId,...R.tasks.map(L=>L.shortId)])].filter(Boolean))],A=[...new Set(n.flatMap(R=>R.tasks.map(L=>L.title)))];return{featureNums:y,phaseNums:N,taskNums:S,shortIds:w,titles:A}},[t,n]),p=v.useCallback(async(y,N)=>{const S=N.toLowerCase();return y==="feature"?m.featureNums.filter(w=>String(w).startsWith(N)).slice(0,20).map(w=>({text:String(w),label:`F${$h(w)}`})):y==="phase"?m.phaseNums.filter(w=>String(w).startsWith(N)).slice(0,20).map(w=>({text:String(w),label:`P${$h(w)}`})):y==="task"?m.taskNums.filter(w=>String(w).startsWith(N)).slice(0,20).map(w=>({text:String(w),label:`T${$h(w)}`})):y==="id"?m.shortIds.filter(w=>w.toLowerCase().startsWith(S)).slice(0,20).map(w=>({text:w,label:w})):y==="status"||y==="feature-status"||y==="phase-status"?qC.filter(w=>w.startsWith(S)).map(w=>({text:w,label:w})):y==="title"?m.titles.filter(w=>w.toLowerCase().includes(S)).slice(0,20).map(w=>({text:w,label:w.length>44?w.slice(0,44)+"…":w})):[]},[m]),g=v.useCallback(y=>s(y),[s]),x=v.useCallback(y=>{o.current=y},[]);return c.jsx("div",{className:"search-bar",children:c.jsx($C,{fields:f,value:l,onChange:g,onSearch:g,fetchSuggestions:p,onKeyDown:u,inputRef:x,placeholder:"Search Work Tree… e.g. feature:1 id:UUXD1 title:auth status:in-progress"})})}function YC(t,n){if(Object.keys(n).length===0)return t;const l=u=>{const f=n[u];return f?new Map(f.map((m,p)=>[m,p])):null},s=l("__features__");return(s?[...t].sort((u,f)=>(s.get(u.feature.id)??1/0)-(s.get(f.feature.id)??1/0)):t).map(u=>{const f=l(`phase-scope:${u.feature.id}`),m=f?[...u.allPhases].sort((p,g)=>(f.get(p.phase.id)??1/0)-(f.get(g.phase.id)??1/0)):u.allPhases;return{...u,allPhases:m.map(p=>{const g=l(`task-scope:${p.phase.id}`),x=g?[...p.allTasks].sort((y,N)=>(g.get(y.id)??1/0)-(g.get(N.id)??1/0)):p.allTasks;return{...p,allTasks:x}})}})}function ni({active:t=!1,disabled:n=!1,onClick:l,children:s}){return c.jsx("button",{type:"button",disabled:n,onClick:l,className:`inline-flex h-8 min-h-8 w-full items-center justify-center rounded-[10px] border px-2.5 py-1 text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] ${t?"border-transparent bg-[var(--accent)] text-white":"border-[var(--border)] bg-[var(--surface-card)] text-[var(--text-muted)] hover:bg-[var(--accent-soft)] hover:text-[var(--text)]"} ${n?"cursor-not-allowed opacity-60":""}`,children:s})}function FC({features:t,phases:n,activeTasks:l,projectStorageScope:s}){const o=DT({features:t,phases:n,projectStorageScope:s}),[u,f]=v.useState({});v.useEffect(()=>{f({})},[o.displayedWorkTree]);const m=v.useMemo(()=>YC(o.displayedWorkTree,u),[o.displayedWorkTree,u]),[p,g]=v.useState(!1),[x,y]=v.useState(null),[N,S]=v.useState(null),w=te=>S(String(te.active.id)),[A,R]=v.useState(0);v.useEffect(()=>{const te=document.querySelector("header");if(!te)return;const re=()=>R(te.offsetHeight);re();const ge=new ResizeObserver(re);return ge.observe(te),window.addEventListener("resize",re),()=>{ge.disconnect(),window.removeEventListener("resize",re)}},[]),v.useEffect(()=>{const te=window.setTimeout(()=>{const re=document.querySelector(".ap-search-sticky"),ge=document.querySelector("header");if(!re||!ge)return;const U=re.getBoundingClientRect();if(U.top<0){const B=U.top+window.scrollY-ge.offsetHeight;window.scrollTo({top:Math.max(0,B),behavior:"smooth"})}},60);return()=>window.clearTimeout(te)},[o.searchQuery,o.hideDone,o.hidePlanned,o.onlyActiveBranches]);const L=P2(F2(Mm,{activationConstraint:{distance:5}})),I=async te=>{const{active:re,over:ge}=te;if(S(null),!ge||re.id===ge.id)return;const U=String(re.id),B=String(ge.id),ue=m.map(de=>de.feature.id);if(ue.includes(U)&&ue.includes(B)){const de=Ao(ue,ue.indexOf(U),ue.indexOf(B)),we=de.indexOf(U),C=we>0?de[we-1]??null:null,V=we<de.length-1?de[we+1]??null:null;f(ae=>({...ae,__features__:de})),await wh("feature",U,C,V).catch(()=>{});return}for(const de of m){const we=de.allPhases.map(C=>C.phase.id);if(we.includes(U)&&we.includes(B)){const C=Ao(we,we.indexOf(U),we.indexOf(B)),V=C.indexOf(U),ae=V>0?C[V-1]??null:null,me=V<C.length-1?C[V+1]??null:null;f(Ne=>({...Ne,[`phase-scope:${de.feature.id}`]:C})),await wh("phase",U,ae,me).catch(()=>{});return}}for(const de of m)for(const we of de.allPhases){const C=we.allTasks.map(V=>V.id);if(C.includes(U)&&C.includes(B)){const V=Ao(C,C.indexOf(U),C.indexOf(B)),ae=V.indexOf(U),me=ae>0?V[ae-1]??null:null,Ne=ae<V.length-1?V[ae+1]??null:null;f(je=>({...je,[`task-scope:${we.phase.id}`]:V})),await wh("task",U,me,Ne).catch(()=>{});return}}},q=te=>o.expandedPhaseIds.includes(te),X=te=>o.recentPhaseIds.includes(te),W=te=>o.recentTaskIds.includes(te),[ne,z]=Io(),[T,ee]=v.useState(null),fe=ne.get("locate"),be=fe?parseInt(fe.replace(/^T/i,""),10):null;v.useEffect(()=>{if(be==null||Number.isNaN(be))return;const te=n.flatMap(B=>B.tasks.map(ue=>({t:ue,p:B}))).find(({t:B})=>B.number===be);if(!te){z(B=>(B.delete("locate"),B),{replace:!0});return}const{t:re,p:ge}=te;if(o.onlyActiveBranches&&o.setOnlyActiveBranches(!1),o.hideDone&&o.setHideDone(!1),o.searchQuery&&o.setSearchQuery(""),o.setTreeOpenMode("smart"),ge.featureId){const B=ge.featureId;o.expandedFeatureIds.includes(B)||o.setExpandedFeatureIds(ue=>ue.includes(B)?ue:[...ue,B])}o.expandedPhaseIds.includes(ge.id)||o.setExpandedPhaseIds(B=>B.includes(ge.id)?B:[...B,ge.id]);const U=document.getElementById(`task-row-${be}`);if(U){const B=document.querySelector("header"),ue=document.querySelector(".ap-search-sticky"),de=((B==null?void 0:B.offsetHeight)??0)+((ue==null?void 0:ue.offsetHeight)??0)+12,we=U.getBoundingClientRect().top+window.scrollY-de;window.scrollTo({top:Math.max(0,we),behavior:"smooth"}),ee(re.id);const C=window.setTimeout(()=>ee(null),2500);return z(V=>(V.delete("locate"),V),{replace:!0}),()=>window.clearTimeout(C)}},[be,n,o.expandedFeatureIds,o.expandedPhaseIds,o.onlyActiveBranches,o.hideDone,o.searchQuery,o.treeOpenMode]);const ye=()=>{if(!N)return null;for(const te of m){if(te.feature.id===N)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(cr,{featureNum:te.feature.number}),c.jsx(ur,{status:te.feature.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:te.feature.name})]});for(const re of te.allPhases){if(re.phase.id===N)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(cr,{featureNum:te.feature.number,phaseNum:re.phase.number}),c.jsx(ur,{status:re.phase.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:re.phase.title})]});for(const ge of re.allTasks)if(ge.id===N)return c.jsxs("div",{className:"ap-drag-overlay surface-card min-w-0 max-w-md px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(cr,{featureNum:te.feature.number,phaseNum:re.phase.number,taskNum:ge.number}),c.jsx(ur,{status:ge.status})]}),c.jsx("div",{className:"mt-1 break-words font-mono text-sm font-semibold [overflow-wrap:anywhere]",children:ge.title})]})}}return null};return c.jsxs(Gt,{className:"grid gap-4",children:[c.jsx("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:c.jsxs("div",{children:[c.jsx("h2",{className:"text-lg font-bold text-[var(--text)]",children:"Work Tree"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Collapsible feature → phase → task tree. Click a feature or phase row to collapse/expand."})]})}),c.jsxs("div",{className:"ap-search-sticky z-20 grid gap-3",style:{top:A},children:[c.jsx(VC,{features:t,phases:n,query:o.searchQuery,onQuery:o.setSearchQuery}),c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsx(Um,{sort:o.sort,onChange:o.setSort}),o.searchActive?c.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:[o.matchedTaskIds.size," match",o.matchedTaskIds.size===1?"":"es"," — clear the box to reset."]}):null]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 rounded-[14px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 sm:grid-cols-3 sm:rounded-[18px] sm:px-4 sm:py-3 lg:grid-cols-6",children:[c.jsx(ni,{active:o.isAllExpanded,onClick:()=>o.isAllExpanded?o.collapseAll():o.expandAll(),children:o.isAllExpanded?"Collapse all":"Expand all"}),c.jsx(ni,{active:o.hideDone,onClick:()=>o.setHideDone(te=>!te),children:"Hide done"}),c.jsx(ni,{active:o.hidePlanned,onClick:()=>o.setHidePlanned(te=>!te),children:"Hide planned"}),c.jsx(ni,{active:o.onlyActiveBranches,onClick:()=>o.setOnlyActiveBranches(te=>!te),children:"Only active"}),c.jsx(ni,{onClick:o.resetFilters,children:"Reset"}),c.jsx(ni,{disabled:p,onClick:async()=>{g(!0),y(null);try{const te=await MR(),re=te.migrated,ge=te.integrity.duplicatePhaseIds.length,U=te.integrity.danglingPhaseIds.length;y(`Repair done: renamed ${re.renamed}, repaired ${re.repaired} refs, inferred ${re.inferred}, archived ${te.handoffs.archived} stale handoff(s). Integrity: ${ge} duplicate, ${U} dangling.`)}catch(te){y(`Repair failed: ${te instanceof Error?te.message:String(te)}`)}finally{g(!1)}},children:p?"Repairing…":"Repair"}),x?c.jsx("span",{className:"hidden text-xs text-[var(--text-muted)] sm:inline sm:truncate",children:x}):null]})]}),c.jsx("div",{className:"grid gap-3",children:m.length>0?c.jsxs(Pj,{sensors:L,collisionDetection:J2,onDragStart:w,onDragEnd:I,children:[c.jsx(zm,{items:m.map(te=>te.feature.id),strategy:Lm,children:m.map(te=>c.jsx(Hm,{id:te.feature.id,children:c.jsx(OT,{entry:te,expanded:o.expandedFeatureIds.includes(te.feature.id),recentlyChanged:o.recentFeatureIds.includes(te.feature.id),onToggle:()=>o.toggleExpandedFeature(te.feature.id),isPhaseExpanded:q,onTogglePhase:o.toggleExpandedPhase,isPhaseRecentlyChanged:X,isTaskRecentlyChanged:W,highlightedTaskIds:(()=>{const re=o.searchActive?o.matchedTaskIds:void 0;if(!T)return re;const ge=new Set(re??[]);return ge.add(T),ge})()})},te.feature.id))}),c.jsx(dT,{dropAnimation:{duration:150,easing:"ease"},children:ye()})]}):l.length>0?l.map(te=>{const re=te.featureId?`/features/${te.featureId}/phases/${te.phaseId}/tasks/${te.id}`:"/features";return c.jsxs(Ye,{to:re,className:"surface-card grid gap-1 px-4 py-3 transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2 truncate text-sm font-semibold text-[var(--text)]",children:[te.status==="in-progress"?c.jsx("span",{"aria-hidden":"true",className:"ap-progress-dot"}):null,c.jsxs("span",{className:"truncate",children:["T",T2(te.number)," — ",te.title]})]}),c.jsx(ur,{status:te.status})]}),c.jsx("div",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:te.phaseId})]},te.id)}):c.jsx("p",{className:"py-4 text-center text-sm text-[var(--text-muted)]",children:"No work items match the current filters."})})]})}function PC(){const{features:t,phases:n,activeTasks:l}=sl(),{project:s}=ys("root"),o=kr(),u=()=>o("/project/edit");Aa("edit",u);const f=s.projectRoot||s.planRoot||s.name||"default";return c.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[c.jsxs(Gt,{className:"grid grid-cols-1 gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c.jsx("h2",{className:"min-w-0 text-lg font-bold text-[var(--text)]",children:"Project Goal"}),c.jsxs(gt,{type:"button",shortcut:"edit",onClick:u,className:"shrink-0",children:[c.jsx(gs,{className:"h-4 w-4"}),"Edit project"]})]}),s.goal?c.jsx(ya,{text:s.goal,className:"max-w-4xl"}):c.jsx("p",{className:"max-w-4xl text-sm text-[var(--text-muted)]",children:"Add a project goal to define the main objective."})]}),c.jsx(c2,{project:s}),c.jsx(D2,{features:t,phases:n}),c.jsx(FC,{features:t,phases:n,activeTasks:l,projectStorageScope:f}),c.jsx(g2,{features:t,phases:n}),c.jsx(y2,{features:t,phases:n})]})}async function GC(){const[t,n]=await Promise.all([Fb(),Jc()]);return{features:t,phases:n}}function zo(){return{active:0,planned:0,done:0,blocked:0,canceled:0}}function $c(t){const n=[];return t.active&&n.push(`${t.active} active`),t.planned&&n.push(`${t.planned} planned`),t.done&&n.push(`${t.done} done`),t.blocked&&n.push(`${t.blocked} blocked`),t.canceled&&n.push(`${t.canceled} canceled`),n.join(" · ")}function XC(t){const n=zo();for(const l of t){if(l.status==="in-progress"||l.status==="discovery"){n.active+=1;continue}if(l.status==="planned"||l.status==="draft"){n.planned+=1;continue}if(l.status==="done"){n.done+=1;continue}if(l.status==="blocked"){n.blocked+=1;continue}l.status==="canceled"&&(n.canceled+=1)}return n}function Y0(t){const n=zo();for(const l of t){if(l.status==="in-progress"){n.active+=1;continue}if(l.status==="planned"){n.planned+=1;continue}if(l.status==="done"){n.done+=1;continue}if(l.status==="blocked"){n.blocked+=1;continue}l.status==="canceled"&&(n.canceled+=1)}return n}function QC(t){const n=zo();for(const l of t){if(l.status==="in-progress"){n.active+=1;continue}if(l.status==="planned"){n.planned+=1;continue}if(l.status==="done"){n.done+=1;continue}if(l.status==="blocked"){n.blocked+=1;continue}l.status==="canceled"&&(n.canceled+=1)}return n}function KC({feature:t,phases:n,phasesCount:l,tasksCount:s,phaseSummary:o,taskSummary:u,activity:f}){var L;const m=ps(),p=ps(),x=((L=m.formData)==null?void 0:L.get("status"))??t.status,y=m.state!=="idle",N=p.state!=="idle",S=$c(o),w=$c(u),A=o0(n??[]),R=t.description||(f?`${f.doneTasks}/${s} done · ${f.remainingTasks} left${f.blockedTasks?` · ${f.blockedTasks} blocked`:""}`:"");return c.jsxs(xi,{variant:"surface",status:A.displayStatus,className:"px-4 py-2",children:[c.jsxs("div",{className:"grid gap-2 xl:grid-cols-[minmax(0,1fr)_minmax(0,132px)_minmax(0,152px)_124px_44px_44px] xl:items-center",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 xl:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cr,{featureNum:t.number,featureId:t.id}),c.jsx(mr,{id:$l({featureNum:t.number}),children:c.jsx("span",{className:"sr-only",children:"Copy feature path"})}),t.shortId?c.jsx(ql,{shortId:t.shortId}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(Fo,{status:A.displayStatus,breakdown:A.breakdown})})]}),c.jsx(Ye,{to:`/features/${t.id}`,className:"entity-link--feature min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:t.name})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end xl:hidden",children:[c.jsx(Ye,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(p.Form,{method:"post",action:`/features/${t.id}/delete`,onSubmit:I=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||I.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:N||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l," phases"]}),S?c.jsx("div",{className:"mt-0.5 break-words",children:S}):null]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[s," tasks"]}),w?c.jsx("div",{className:"mt-0.5 break-words",children:w}):null]}),c.jsx(m.Form,{method:"post",action:`/features/${t.id}/status`,className:"w-full xl:w-auto",children:c.jsxs("div",{className:"relative",children:[c.jsx("select",{name:"status",value:x,disabled:y||N,"aria-busy":y,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:I=>m.submit(I.currentTarget.form),children:sd.map(I=>c.jsx("option",{value:I.value,children:I.label},I.value))}),c.jsx(xs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Ye,{to:`/features/${t.id}/edit`,"aria-label":`Edit feature ${t.name}`,className:"hidden xl:block",children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(p.Form,{method:"post",action:`/features/${t.id}/delete`,className:"hidden xl:block",onSubmit:I=>{window.confirm(`Delete feature “${t.name}”? This cannot be undone.`)||I.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:N||y,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete feature ${t.name}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]}),c.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:c.jsx(il,{value:t.updatedAt})}),R?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:R}):null]})}const ZC={feature:{label:"Feature",Icon:Dc},phase:{label:"Phase",Icon:IN},task:{label:"Task",Icon:Vo},requirement:{label:"Requirement",Icon:Vb}};function F0({kind:t,label:n}){const{Icon:l,label:s}=ZC[t];return c.jsxs("span",{className:`entity-badge entity-badge--${t}`,children:[c.jsx(l,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:n??s})]})}function mn({className:t="",...n}){return c.jsx("input",{className:`field-control ${t}`,...n})}function bs({className:t="",...n}){return c.jsx("select",{className:`field-control ${t}`,...n})}function od({query:t,status:n,statusOptions:l,placeholder:s,clearTo:o,resultsLabel:u}){const f=vm(),m=((l==null?void 0:l.length)??0)>0;return c.jsxs(cn,{method:"get",className:`surface-card grid gap-3 p-3 md:items-end sm:p-4 ${m?"md:grid-cols-[minmax(0,1fr)_200px_auto_auto]":"md:grid-cols-[minmax(0,1fr)_auto_auto]"}`,children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"list-filter-query",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Name"}),c.jsx(mn,{id:"list-filter-query",name:"q",defaultValue:t,placeholder:s,className:"min-h-9 py-2 sm:min-h-11 sm:py-2.5",onChange:p=>f(p.currentTarget.form)})]}),m?c.jsxs("div",{children:[c.jsx("label",{htmlFor:"list-filter-status",className:"mb-1 block text-xs font-semibold uppercase tracking-[0.18em] text-[var(--text-subtle)]",children:"Status"}),c.jsxs("div",{className:"relative",children:[c.jsxs(bs,{id:"list-filter-status",name:"status",defaultValue:n,className:"min-h-9 appearance-none py-2 sm:min-h-11 sm:py-2.5 pr-8",children:[c.jsx("option",{value:"",children:"All statuses"}),l==null?void 0:l.map(p=>c.jsx("option",{value:p.value,children:p.label},p.value))]}),c.jsx(xs,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--text-muted)]"})]})]}):null,c.jsx(gt,{type:"submit",variant:"secondary",children:"Apply filters"}),c.jsx(Ye,{to:o,className:"inline-flex min-h-9 items-center justify-center rounded-[12px] px-3 text-sm font-semibold text-[var(--text-muted)] transition hover:bg-[var(--accent-soft)] hover:text-[var(--text)] sm:min-h-11 sm:rounded-[14px]",children:"Clear"}),c.jsx("div",{className:`text-sm text-[var(--text-muted)] ${m?"md:col-span-4":"md:col-span-3"}`,children:u})]})}function ud(t,n){const l=t.trim().toLowerCase();return l?n.some(s=>s==null?void 0:s.toLowerCase().includes(l)):!0}function JC(t){const n=new Map;for(const f of t)f.featureId&&n.set(f.featureId,[...n.get(f.featureId)??[],f]);const l=new Map,s=new Map,o=new Map,u=new Map;for(const[f,m]of n)l.set(f,m.length),s.set(f,m.reduce((p,g)=>p+g.tasks.length,0)),o.set(f,XC(m)),u.set(f,Y0(m.flatMap(p=>p.tasks)));return{phasesByFeature:n,phasesCountByFeature:l,tasksCountByFeature:s,phaseSummaryByFeature:o,taskSummaryByFeature:u}}function WC(){var S,w;const{features:t,phases:n}=sl(),{phasesByFeature:l,phasesCountByFeature:s,tasksCountByFeature:o,phaseSummaryByFeature:u,taskSummaryByFeature:f}=JC(n),m=kr(),[p]=Io(),g=((S=p.get("q"))==null?void 0:S.trim())??"",x=((w=p.get("status"))==null?void 0:w.trim())??"",y=v.useCallback(()=>m("new"),[m]);Aa("create",y);const N=v.useMemo(()=>t.filter(A=>(!x||A.status===x)&&ud(g,[A.name,A.id,A.description])),[t,g,x]);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Gt,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx(F0,{kind:"feature",label:"Features"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter by name or status, then inspect child phases and tasks directly from the rows."})]}),c.jsx(Ye,{to:"new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create feature"})})]}),c.jsx(od,{query:g,status:x,statusOptions:sd,placeholder:"Search feature name, id, or description",clearTo:"/features",resultsLabel:N.length===t.length?`${t.length} features`:`${N.length} of ${t.length} features`}),c.jsx("div",{className:"grid gap-3",children:t.length===0?c.jsxs(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No features yet. ",c.jsx(Ye,{to:"/features/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first feature"})]}):N.length>0?N.map(A=>c.jsx(KC,{feature:A,phases:l.get(A.id),phasesCount:s.get(A.id)??0,tasksCount:o.get(A.id)??0,phaseSummary:u.get(A.id)??zo(),taskSummary:f.get(A.id)??zo()},A.id)):c.jsx(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No features match the current filters."})})]}),c.jsx(pi,{})]})}async function eA(){const[t,n]=await Promise.all([wm(),Jc()]);return{requirements:t,phases:n}}function xo(...t){return t.filter(Boolean).join(" ")}function tA(){return c.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-[var(--border-strong)] bg-[var(--surface-elevated)] text-[var(--text)] shadow-sm transition group-open:rotate-180 group-hover:border-[var(--accent)] group-hover:text-[var(--accent)]",children:c.jsx(xs,{className:"h-5 w-5"})})}function un({title:t,subtitle:n,leading:l,actions:s,defaultOpen:o=!0,count:u,className:f,summaryClassName:m,contentClassName:p,titleClassName:g,subtitleClassName:x,children:y}){return c.jsxs("details",{className:xo("group mt-4 overflow-hidden rounded-[10px] border border-[var(--border)]",f),open:o,children:[c.jsxs("summary",{className:xo("flex min-w-0 list-none cursor-pointer items-start justify-between gap-3 bg-[var(--surface-elevated)] p-4 text-left text-[var(--text)] transition-colors select-none hover:bg-[var(--surface-strong)] [&::-webkit-details-marker]:hidden",m),children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[l?c.jsx("div",{className:"shrink-0 pt-0.5",children:l}):null,c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:xo("flex flex-wrap items-center gap-2 text-sm font-semibold",g),children:[t,u!==void 0?c.jsxs("span",{className:"text-[var(--text-subtle)]",children:["(",u,")"]}):null]}),n?c.jsx("div",{className:xo("mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",x),children:n}):null]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s,c.jsx(tA,{})]})]}),c.jsx("div",{className:xo("border-t border-[var(--border)] bg-[var(--surface)] p-4",p),children:y})]})}function aA(t,n){const l=new Set(n.map(u=>u.id)),s=n.map(u=>({phase:u,requirements:t.filter(f=>f.linkedPhaseIds.includes(u.id))})).filter(u=>u.requirements.length>0).sort((u,f)=>u.phase.priority-f.phase.priority||u.phase.number-f.phase.number),o=t.filter(u=>!u.linkedPhaseIds.some(f=>l.has(f)));return{phaseGroups:s,unlinkedRequirements:o}}function Px(t){return`P${String(t.number??0).padStart(3,"0")}`}function Gx({requirement:t}){return c.jsx(Gt,{className:"overflow-hidden p-0",children:c.jsx(un,{defaultOpen:!1,title:c.jsx("h2",{className:"min-w-0 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:t.title}),count:t.linkedPhaseIds.length,subtitle:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[t.linkedPhaseIds.length," linked phase",t.linkedPhaseIds.length===1?"":"s"]}),t.linkedPhaseIds.length>0&&t.macroTasks.length>0?c.jsx("span",{className:"mx-2 text-[var(--text-subtle)]",children:"•"}):null,t.macroTasks.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[t.macroTasks.length," macro task",t.macroTasks.length===1?"":"s"]}):null]}),contentClassName:"grid gap-4",summaryClassName:"hover:bg-[var(--surface-elevated)]/65",children:c.jsxs("div",{className:"flex min-w-0 flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[c.jsx("div",{className:"min-w-0",children:t.description?c.jsx("p",{className:"min-w-0 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:t.description}):null}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[c.jsx(Ye,{to:`${t.id}/edit`,children:c.jsx(gt,{type:"button",variant:"secondary",children:"Edit"})}),c.jsx(cn,{method:"post",action:`/requirements/${t.id}/delete`,onSubmit:n=>{window.confirm(`Delete requirement "${t.title}"?`)||n.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",children:"Delete"})})]})]})})})}function nA(){var x;const{requirements:t,phases:n}=sl(),l=kr(),[s]=Io(),o=((x=s.get("q"))==null?void 0:x.trim())??"",u=v.useCallback(()=>l("new"),[l]);Aa("create",u);const f=v.useMemo(()=>new Map(n.map(y=>[y.id,y])),[n]),m=v.useMemo(()=>t.filter(y=>{const N=y.linkedPhaseIds.map(S=>{const w=f.get(S);return w?`${Px(w)} ${w.title} ${w.summary}`:S});return ud(o,[y.title,y.description,y.id,...N])}),[t,f,o]),{phaseGroups:p,unlinkedRequirements:g}=v.useMemo(()=>aA(m,n),[m,n]);return v.useEffect(()=>{const y=window.location.hash.slice(1);y&&requestAnimationFrame(()=>{var N;return(N=document.getElementById(y))==null?void 0:N.scrollIntoView({block:"start"})})},[p]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Gt,{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{children:[c.jsx(F0,{kind:"requirement",label:"Requirements"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Track top-level outcomes independently from features, grouped below by the phases that deliver them."})]}),c.jsx(Ye,{to:"new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create requirement"})})]}),c.jsx(od,{query:o,placeholder:"Search requirement title, description, id, or linked phase",clearTo:"/requirements",resultsLabel:m.length===t.length?`${t.length} requirements`:`${m.length} of ${t.length} requirements`}),c.jsx("div",{className:"grid gap-6",children:t.length===0?c.jsxs(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No requirements yet. ",c.jsx(Ye,{to:"/requirements/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Create your first requirement"})]}):m.length>0?c.jsxs(c.Fragment,{children:[p.map(({phase:y,requirements:N})=>{const S=y.featureId?`/features/${y.featureId}/phases/${y.id}`:"/features";return c.jsxs("section",{id:`phase-${y.id}`,className:"scroll-mt-28","aria-labelledby":`phase-${y.id}-heading`,children:[c.jsxs("div",{className:"mb-3 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Linked phase"}),c.jsxs(Ye,{id:`phase-${y.id}-heading`,to:S,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:[Px(y)," — ",y.title]})]}),c.jsxs("span",{className:"shrink-0 rounded-full bg-[var(--surface-elevated)] px-2.5 py-1 text-xs font-semibold text-[var(--text-muted)]",children:[N.length," requirement",N.length===1?"":"s"]})]}),c.jsx("div",{className:"grid gap-3",children:N.map(w=>c.jsx(Gx,{requirement:w},w.id))})]},y.id)}),g.length>0?c.jsxs("section",{id:"unlinked-requirements",className:"scroll-mt-28","aria-labelledby":"unlinked-requirements-heading",children:[c.jsxs("div",{className:"mb-3 flex min-w-0 flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:"Unlinked"}),c.jsx("h2",{id:"unlinked-requirements-heading",className:"text-base font-black text-[var(--text)]",children:"Requirements without a valid phase"})]}),c.jsx("span",{className:"shrink-0 rounded-full bg-[var(--surface-elevated)] px-2.5 py-1 text-xs font-semibold text-[var(--text-muted)]",children:g.length})]}),c.jsx("div",{className:"grid gap-3",children:g.map(y=>c.jsx(Gx,{requirement:y},y.id))})]}):null]}):c.jsx(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No requirements match the current filters."})})]}),c.jsx(pi,{})]})}async function rA({params:t}){const n=t.featureId;if(!n)throw new Response("featureId required",{status:400});const[l,s]=await Promise.all([Yo(n),Jc(n)]);return{feature:l,phases:s}}function lA({featureId:t,feature:n,phase:l}){var y,N;const s=ps(),o=ps(),f=((y=s.formData)==null?void 0:y.get("status"))??l.status,m=s.state!=="idle",p=o.state!=="idle",g=$c(Y0(l.tasks)),x=u0(l.tasks);return c.jsxs(xi,{variant:"surface",status:x.displayStatus,className:"px-4 py-2",children:[c.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,150px)_124px_44px_44px] lg:items-center",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cr,{featureNum:n.number,phaseNum:l.number,featureId:n.id,phaseId:l.id}),c.jsx(mr,{id:$l({featureNum:n.number,phaseNum:l.number}),children:c.jsx("span",{className:"sr-only",children:"Copy phase path"})}),l.shortId?c.jsx(ql,{shortId:l.shortId}):null,l.handoff?c.jsx(Nm,{phaseId:l.id,updatedAt:l.handoffUpdatedAt}):null,c.jsx(B0,{phaseId:l.id,phaseTitle:l.title,count:((N=l.linkedRequirements)==null?void 0:N.length)??0}),c.jsx("span",{className:"shrink-0",children:c.jsx(Fo,{status:x.displayStatus,breakdown:x.breakdown})})]}),c.jsx(Ye,{to:`/features/${t}/phases/${l.id}`,className:"entity-link--phase min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:l.title})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[c.jsx(Ye,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,onSubmit:S=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||S.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${l.title}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[l.tasks.length," tasks"]}),g?c.jsx("div",{className:"mt-0.5 break-words",children:g}):null]}),c.jsx(s.Form,{method:"post",action:`/features/${t}/phases/${l.id}/status`,className:"w-full lg:w-auto",children:c.jsxs("div",{className:"relative",children:[c.jsx("select",{name:"status",value:f,disabled:m||p,"aria-busy":m,className:"field-control min-h-8 appearance-none py-1 pr-8 text-[11px]",onChange:S=>s.submit(S.currentTarget.form),children:id.map(S=>c.jsx("option",{value:S.value,children:S.label},S.value))}),c.jsx(xs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Ye,{to:`/features/${t}/phases/${l.id}/edit`,"aria-label":`Edit phase ${l.title}`,className:"hidden lg:block",children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(o.Form,{method:"post",action:`/features/${t}/phases/${l.id}/delete`,className:"hidden lg:block",onSubmit:S=>{window.confirm(`Delete phase “${l.title}”? This cannot be undone.`)||S.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:p||m,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete phase ${l.title}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]}),c.jsx("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1",children:c.jsx(il,{value:l.updatedAt})}),l.summary?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:l.summary}):null]})}function Im({items:t,className:n="",stacked:l=!1}){return l?c.jsx("nav",{"aria-label":"Breadcrumb",className:`grid gap-1 text-sm ${n}`,children:t.map((s,o)=>{const u=o===t.length-1,f=s.to&&!u?c.jsx(Ye,{to:s.to,className:"font-semibold text-[var(--accent)] hover:underline break-words min-w-0",children:s.label}):c.jsx("span",{className:`break-words min-w-0 ${u?"text-[var(--text)] font-semibold":"text-[var(--text-muted)]"}`,children:s.label});return c.jsxs("div",{className:"flex items-baseline gap-2 min-w-0",children:[s.kind?c.jsxs("span",{className:"shrink-0 text-[var(--text-subtle)] font-medium",children:[s.kind,":"]}):null,c.jsx("span",{className:"min-w-0",children:f})]},`${s.label}-${o}`)})}):c.jsx("nav",{"aria-label":"Breadcrumb",className:`flex flex-wrap items-center gap-2 text-sm ${n}`,children:t.map((s,o)=>{const u=o===t.length-1,f=s.to&&!u?c.jsx(Ye,{to:s.to,className:"font-semibold text-[var(--accent)] hover:underline",children:s.label}):c.jsx("span",{className:u?"text-[var(--text)]":"text-[var(--text-muted)]",children:s.label});return c.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[o>0?c.jsx("span",{className:"text-[var(--text-subtle)]",children:"/"}):null,c.jsx("span",{className:"min-w-0 break-words",children:f})]},`${s.label}-${o}`)})})}function Vm({featureNum:t,phaseNum:n,taskNum:l,featureId:s,phaseId:o,taskId:u,shortId:f,children:m}){return c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(cr,{featureNum:t,phaseNum:n,taskNum:l,featureId:s,phaseId:o,taskId:u}),c.jsx(mr,{id:$l({featureNum:t,phaseNum:n,taskNum:l}),children:c.jsx("span",{className:"sr-only",children:"Copy path"})}),f?c.jsx(ql,{shortId:f}):null,m]})}function La({className:t="",children:n,...l}){return c.jsx("div",{className:`surface-card p-4 ${t}`,...l,children:n})}function Xx(...t){return t.filter(Boolean).join(" ")}function Ym({items:t,className:n}){const l=t.filter(s=>s.visible!==!1);return l.length===0?null:c.jsx("div",{className:Xx("grid gap-4 md:grid-cols-2 xl:grid-cols-4",n),children:l.map(s=>c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:s.label}),c.jsx("div",{className:Xx("mt-2 text-sm font-semibold break-words text-[var(--text)] [overflow-wrap:anywhere]",s.valueClassName),children:s.value})]},s.label))})}function Fm(t){return t&&t>0?`P${t}`:""}function sA(t,n){return!t&&!n?"":`${t||"Start not set"} → ${n||"End not set"}`}function Pm({decisions:t}){return t.length===0?null:c.jsxs("details",{className:"group mt-4",children:[c.jsx("summary",{className:"flex cursor-pointer select-none items-center gap-2 font-semibold text-[var(--text)]",children:c.jsxs("span",{children:["Accepted decisions (",t.length,")"]})}),c.jsx("div",{className:"mt-2 grid gap-3",children:t.map(n=>c.jsxs("div",{className:"surface-card px-4 py-3",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:n.title}),n.decision?c.jsxs("div",{className:"mt-2 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Decision:"}),c.jsx(ya,{text:n.decision,className:"mt-1"})]}):null,n.rationale?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Rationale:"}),c.jsx(ya,{text:n.rationale,className:"mt-1"})]}):null,n.implementationNotes?c.jsxs("div",{className:"mt-1 text-sm text-[var(--text-muted)]",children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Implementation:"}),c.jsx(ya,{text:n.implementationNotes,className:"mt-1"})]}):null]},n.id))})]})}const iA={draft:CN,discovery:iR,planned:Vo,"in-progress":$b,done:ym,blocked:Ib,waiting:xm,deferred:dR,canceled:Ub,rejected:DN};function qh(t){return t.split(/[-\s]+/).filter(Boolean).map(n=>n==="and"?"and":n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function Qx(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}const oA=new Set(["canceled","rejected"]);function Gm({statusLog:t,currentStatus:n,backbone:l,createdAt:s,updatedAt:o,startedAt:u,completedAt:f}){const m=[];if(t.length===0){const w=l.indexOf(n);if(w>=0)for(let A=0;A<=w;A++)m.push(l[A]);else m.push(n)}else{const w=t[0];w&&m.push(w.fromStatus);for(const A of t)m[m.length-1]!==A.toStatus&&m.push(A.toStatus)}m[m.length-1]!==n&&m.push(n);const p=new Set(m),g=n==="done"||oA.has(n),x=w=>{var R,L;if(t.length>0){if(w===((R=t[0])==null?void 0:R.fromStatus))return((L=t[0])==null?void 0:L.date)??"";for(const I of t)if(I.toStatus===w)return I.date;return""}const A=l[0];return w===A?s??"":w==="in-progress"?u??o??"":w==="done"?f??o??"":""},y=[...m];if(!g){const w=l.indexOf(n);if(w>=0&&w+1<l.length){const A=l[w+1];p.has(A)||y.push(A)}}const N=t.length===0?y.filter((w,A)=>A===0||w===n||!!x(w)):y,S=w=>p.has(w)?w===n&&!g?"current":"completed":"pending";return c.jsx("ol",{className:"status-stepper",role:"list","aria-label":"Status progress",children:N.map((w,A)=>{const R=S(w),L=iA[w]??Xc,I=p.has(w),q=x(w),X=q?`${qh(w)} — ${Qx(q)}`:qh(w),W=A===0?null:I?"traveled":"pending";return c.jsxs("li",{className:`status-step status-step--${R}`,role:"listitem","aria-current":R==="current"?"step":void 0,style:{"--step-color":`var(--color-status-${w})`},children:[W?c.jsx("span",{className:`status-connector status-connector--${W}`,"aria-hidden":"true"}):null,c.jsx("span",{className:"status-node",title:X,children:c.jsx(L,{className:"status-node-icon"})}),c.jsx("span",{className:"status-step-label",children:qh(w)}),q?c.jsx("span",{className:"status-step-date",children:Qx(q)}):null]},`${w}-${A}`)})})}function Kx(t){return t.split(/[-\s]+/).filter(Boolean).map(n=>n==="and"?"and":n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function uA(t){if(!t)return"";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}).format(new Date(t))}catch{return t}}function cA(t,n,l,s,o){if(t.length>0)return t.map(m=>({date:m.date,fromStatus:m.fromStatus,toStatus:m.toStatus,inferred:!1}));const u=l.indexOf(n);if(u<0)return[];const f=[];for(let m=1;m<=u;m++){const p=l[m-1],g=l[m],x=g==="in-progress"?s??"":g==="done"?o??"":"";f.push({date:x,fromStatus:p,toStatus:g,inferred:!0})}return f}function Xm({statusLog:t,currentStatus:n,backbone:l,startedAt:s,completedAt:o}){const u=cA(t??[],n??"",l??[],s,o);return c.jsx(un,{title:"Status history",count:u.length,defaultOpen:u.length>0,contentClassName:"grid gap-2.5",children:u.length===0?c.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No status changes recorded."}):u.map((f,m)=>c.jsxs("div",{className:"text-sm flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-xs font-mono text-[var(--text-subtle)]",children:uA(f.date)}),c.jsx("span",{className:"font-semibold text-[var(--text-muted)]",children:Kx(f.fromStatus)}),c.jsx("span",{className:"text-[var(--text-subtle)]",children:"→"}),c.jsx("span",{className:"font-semibold text-[var(--text)]",children:Kx(f.toStatus)})]},m))})}function dA(t){return t.reduce((n,l)=>n+l.tasks.length,0)}function fA(t){let n=0,l=0,s=0,o=0;for(const u of t)for(const f of u.tasks)f.status==="in-progress"&&(n+=1),f.status==="done"&&(l+=1),f.status==="blocked"&&(s+=1),["done","canceled"].includes(f.status)||(o+=1);return{inProgress:n,done:l,blocked:s,remaining:o}}function hA(t){return t.find(n=>["in-progress","discovery","planned","draft"].includes(n.status))}function mA(){var W,ne,z,T;const{feature:t,phases:n}=sl(),l=t.acceptedDecisions??[],s=dA(n),o=fA(n),u=hA(n),f=o0(n),[m,p]=Io(),g=((W=m.get("q"))==null?void 0:W.trim())??"",x=((ne=m.get("status"))==null?void 0:ne.trim())??"",y=((z=m.get("sort"))==null?void 0:z.trim())??"priority",N=((T=m.get("dir"))==null?void 0:T.trim())??"asc",S={key:y==="priority"||y==="number"||y==="createdAt"||y==="updatedAt"||y==="title"||y==="shortId"||y==="status"||y==="startedAt"||y==="completedAt"?y:"priority",direction:N==="desc"?"desc":"asc"},w=v.useMemo(()=>[...n].sort((ee,fe)=>Ro(ee,fe,S.key,S.direction)),[n,S]),A=v.useMemo(()=>w.filter(ee=>(!x||ee.status===x)&&ud(g,[ee.title,ee.id,ee.summary,ee.description])),[w,g,x]),R=kr(),L=v.useRef(null),I=v.useCallback(()=>R("edit"),[R]),q=v.useCallback(()=>R("phases/new"),[R]),X=v.useCallback(()=>{var ee;(ee=L.current)==null||ee.requestSubmit()},[]);return Aa("edit",I),Aa("create",q),Aa("delete",X),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ye,{to:"/features",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Gc,{className:"h-4 w-4"})," Back to features"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Im,{stacked:!0,items:[{label:t.name,kind:"Feature"}]}),c.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:c.jsx(Vm,{featureNum:t.number,featureId:t.id,shortId:t.shortId,children:c.jsx(Fo,{status:f.displayStatus,breakdown:f.breakdown})})}),c.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:t.name}),t.description?c.jsx(un,{title:c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"Description"}),c.jsx(il,{value:t.descriptionUpdatedAt})]}),children:c.jsx(ya,{text:t.description,className:"plan-description max-w-4xl"})}):null,c.jsx("div",{className:"mt-4",children:c.jsx(Gm,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"],createdAt:t.createdAt,updatedAt:t.updatedAt})}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Ye,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit feature"})}),c.jsx(cn,{ref:L,method:"post",action:`/features/${t.id}/delete`,className:"inline-flex",onSubmit:ee=>{window.confirm(`Delete feature "${t.name}"?`)||ee.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete feature"})})]})]}),c.jsxs(Gt,{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),c.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(u==null?void 0:u.title)||"No active phase"})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:n.length})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:s})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Current phase"}),c.jsx("p",{className:"mt-2 text-sm font-semibold text-[var(--text)] break-words",children:(u==null?void 0:u.title)||"No active phase"})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.inProgress})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.remaining})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.done})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:o.blocked})]})]}),c.jsx(Ym,{items:[{label:"Entity last updated",value:ll(t.updatedAt),visible:!!t.updatedAt},{label:"Priority",value:Fm(t.priority),visible:t.priority>0},{label:"Timeline",value:sA(t.startDate,t.endDate),visible:!!(t.startDate||t.endDate)}]}),t.workDone||t.workRemaining?c.jsx(un,{title:"Planning notes",defaultOpen:!1,children:c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[t.workDone?c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work done"}),c.jsx(ya,{text:t.workDone,className:"mt-2"})]}):null,t.workRemaining?c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold text-[var(--text)]",children:"Work remaining"}),c.jsx(ya,{text:t.workRemaining,className:"mt-2"})]}):null]})}):null,l.length>0?c.jsx(Pm,{decisions:l}):null,c.jsx(Xm,{statusLog:t.statusLog??[],currentStatus:t.status,backbone:["planned","in-progress","done"]})]}),c.jsxs(Gt,{className:"grid gap-5",children:[c.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Phases"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this feature's phases."})]}),c.jsx(Ye,{to:"phases/new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create phase"})})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[c.jsx(Um,{sort:S,onChange:ee=>p(fe=>(fe.set("sort",ee.key),fe.set("dir",ee.direction),fe))}),c.jsx(od,{query:g,status:x,statusOptions:id,placeholder:"Search phase title, id, or summary",clearTo:`/features/${t.id}`,resultsLabel:A.length===n.length?`${n.length} phases`:`${A.length} of ${n.length} phases`})]}),c.jsx("div",{className:"grid gap-3",children:n.length===0?c.jsxs(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No phases yet. ",c.jsx(Ye,{to:`/features/${t.id}/phases/new`,className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a phase"})]}):A.length>0?A.map(ee=>c.jsx(lA,{featureId:t.id,feature:t,phase:ee},ee.id)):c.jsx(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No phases match the current filters."})})]}),c.jsx(pi,{})]})}async function pA({params:t}){const{featureId:n,phaseId:l}=t;if(!n||!l)throw new Response("featureId and phaseId required",{status:400});const[s,o,u]=await Promise.all([Yo(n),Wc(l),wm()]),f=u.filter(m=>m.linkedPhaseIds.includes(l));return{feature:s,phase:{...o,linkedRequirements:f}}}function gA({featureId:t,featureNum:n,phaseId:l,phaseNum:s,task:o}){var S;const u=ps(),f=ps(),p=((S=u.formData)==null?void 0:S.get("status"))??o.status,g=u.state!=="idle",x=f.state!=="idle",y=$c(QC(o.subtasks)),N=r0(p);return c.jsxs(xi,{variant:"surface",status:N,className:"px-4 py-2",children:[c.jsxs("div",{className:"grid gap-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,168px)_124px_44px_44px] lg:items-center",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1 lg:contents",children:[c.jsxs("div",{className:"flex min-w-0 flex-col items-start gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cr,{featureNum:n,phaseNum:s,taskNum:o.number,featureId:t,phaseId:l,taskId:o.id}),c.jsx(mr,{id:$l({featureNum:n,phaseNum:s,taskNum:o.number}),children:c.jsx("span",{className:"sr-only",children:"Copy task path"})}),o.shortId?c.jsx(ql,{shortId:o.shortId}):null,c.jsx("span",{className:"shrink-0",children:c.jsx(ur,{status:p})})]}),c.jsx(Ye,{to:`/features/${t}/phases/${l}/tasks/${o.id}`,className:"entity-link--task min-w-0 w-full break-words text-sm font-semibold underline-offset-4 hover:underline [overflow-wrap:anywhere]",children:o.title})]}),c.jsxs("div",{className:"flex items-center gap-2 self-end lg:hidden",children:[c.jsx(Ye,{to:`/features/${t}/phases/${l}/tasks/${o.id}/edit`,"aria-label":`Edit task ${o.title}`,children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(f.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${o.id}/delete`,onSubmit:w=>{window.confirm(`Delete task “${o.title}”? This cannot be undone.`)||w.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:x||g,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${o.title}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]})]}),c.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[c.jsxs("div",{className:"font-semibold text-[var(--text)]",children:[o.subtasks.length," subtasks · ",o.checklist.length," checklist"]}),y?c.jsx("div",{className:"mt-0.5 break-words",children:y}):c.jsx("div",{className:"mt-0.5 break-words",children:"No subtask statuses yet"})]}),c.jsx(u.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${o.id}/status`,className:"w-full lg:w-auto",children:c.jsxs("div",{className:"relative",children:[c.jsx("select",{name:"status",value:p,disabled:g||x||o.status==="paused","aria-busy":g,title:o.status==="paused"?"Resume paused 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:w=>u.submit(w.currentTarget.form),children:(o.status==="paused"?Ko:Bm).map(w=>c.jsx("option",{value:w.value,children:w.label},w.value))}),c.jsx(xs,{className:"pointer-events-none absolute right-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-[var(--text-muted)]"})]})}),c.jsx(Ye,{to:`/features/${t}/phases/${l}/tasks/${o.id}/edit`,"aria-label":`Edit task ${o.title}`,className:"hidden lg:block",children:c.jsx(gt,{type:"button",variant:"secondary",className:"min-h-8 w-8 rounded-[10px] px-0 text-[var(--text-muted)] hover:text-[var(--text)]",children:c.jsx(gs,{className:"h-3.5 w-3.5"})})}),c.jsx(f.Form,{method:"post",action:`/features/${t}/phases/${l}/tasks/${o.id}/delete`,className:"hidden lg:block",onSubmit:w=>{window.confirm(`Delete task “${o.title}”? This cannot be undone.`)||w.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",disabled:x||g,className:"min-h-8 w-8 rounded-[10px] px-0","aria-label":`Delete task ${o.title}`,children:c.jsx(hi,{className:"h-4 w-4"})})})]}),c.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--text-subtle)]",children:[c.jsx(il,{value:o.updatedAt}),o.startedAt?c.jsxs("span",{children:["Started ",ll(o.startedAt)]}):null,o.completedAt?c.jsxs("span",{children:["Completed ",ll(o.completedAt)]}):null]}),o.description?c.jsx("div",{className:"mt-1 min-w-0 break-words line-clamp-2 text-[11px] text-[var(--text-muted)]",children:o.description}):null]})}function vA(t){let n=0,l=0,s=0,o=0;for(const u of t.tasks)u.status==="in-progress"&&(n+=1),u.status==="done"&&(l+=1),u.status==="blocked"&&(s+=1),["done","canceled"].includes(u.status)||(o+=1);return{inProgress:n,done:l,blocked:s,remaining:o}}function yA(){var fe,be,ye,te;const{feature:t,phase:n}=sl(),l=n.decisions??[],s=n.acceptedDecisions??[],o=n.linkedRequirements??[],u=vA(n),f=u0(n.tasks),[m,p]=Io(),g=((fe=m.get("q"))==null?void 0:fe.trim())??"",x=((be=m.get("status"))==null?void 0:be.trim())??"",y=((ye=m.get("sort"))==null?void 0:ye.trim())??"priority",N=((te=m.get("dir"))==null?void 0:te.trim())??"asc",S={key:y==="priority"||y==="number"||y==="createdAt"||y==="updatedAt"||y==="title"||y==="shortId"||y==="status"||y==="startedAt"||y==="completedAt"?y:"priority",direction:N==="desc"?"desc":"asc"},w=v.useMemo(()=>[...n.tasks].sort((re,ge)=>Ro(re,ge,S.key,S.direction)),[n.tasks,S]),A=v.useMemo(()=>w.filter(re=>(!x||re.status===x)&&ud(g,[re.title,re.id,re.description,re.shortName])),[w,g,x]),R=kr(),L=v.useRef(null),[I,q]=v.useState(n.handoff??""),[X,W]=v.useState(!1),ne=v.useCallback(()=>R("edit"),[R]),z=v.useCallback(()=>R("tasks/new"),[R]),T=v.useCallback(()=>{var re;(re=L.current)==null||re.requestSubmit()},[]),ee=v.useCallback(async()=>{if(window.confirm("Clear this phase's handoff?")){W(!0);try{await Xb(n.id),q("")}catch{}finally{W(!1)}}},[n.id]);return Aa("edit",ne),Aa("create",z),Aa("delete",T),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ye,{to:`/features/${t.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Gc,{className:"h-4 w-4"})," Back to feature"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Im,{stacked:!0,items:[{label:t.name,to:`/features/${t.id}`,kind:"Feature"},{label:n.title,kind:"Phase"}]}),c.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:c.jsxs(Vm,{featureNum:t.number,phaseNum:n.number,featureId:t.id,phaseId:n.id,shortId:n.shortId,children:[I?c.jsx(Nm,{phaseId:n.id,updatedAt:n.handoffUpdatedAt}):null,c.jsx(Fo,{status:f.displayStatus,breakdown:f.breakdown})]})}),c.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:n.title}),n.summary?c.jsx(ya,{text:n.summary,className:"mt-3 max-w-4xl"}):null,c.jsx(Gm,{statusLog:n.statusLog??[],currentStatus:n.status,backbone:["draft","discovery","planned","in-progress","done"],createdAt:n.createdAt,updatedAt:n.updatedAt}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Ye,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit phase"})}),c.jsx(Ye,{to:"tasks/new",children:c.jsx(gt,{type:"button",variant:"primary",shortcut:"create",children:"Create task"})}),c.jsx(cn,{ref:L,method:"post",action:`/features/${t.id}/phases/${n.id}/delete`,className:"inline-flex",onSubmit:re=>{window.confirm(`Delete phase "${n.title}"?`)||re.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete phase"})})]})]}),c.jsxs(Gt,{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:n.tasks.length})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"In progress"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.inProgress})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Remaining"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.remaining})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Done"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.done})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Blocked"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:u.blocked})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Goals"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:n.goals.length})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Dependencies"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:n.dependencies.length})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Completion criteria"}),c.jsx("p",{className:"mt-2 text-2xl font-black text-[var(--text)]",children:n.completionCriteria.length})]})]}),c.jsx(Ym,{items:[{label:"Entity last updated",value:ll(n.updatedAt),visible:!!n.updatedAt},{label:"Priority",value:Fm(n.priority),visible:n.priority>0},{label:"Linked requirements",value:o.length,visible:o.length>0,valueClassName:"text-2xl font-black"},{label:"Risks",value:n.risks.length,visible:n.risks.length>0,valueClassName:"text-2xl font-black"},{label:"Open questions",value:n.openQuestions.length,visible:n.openQuestions.length>0,valueClassName:"text-2xl font-black"}]}),n.notes?c.jsx(un,{title:"Notes",defaultOpen:!1,children:c.jsx(ya,{text:n.notes,className:"plan-description"})}):null,c.jsx(un,{title:"Linked requirements",count:o.length,defaultOpen:!1,children:o.length>0?c.jsx("div",{className:"grid gap-3",children:o.map(re=>c.jsx("div",{className:"min-w-0 rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-4 py-4",children:c.jsxs("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(ur,{status:re.status}),re.macroTasks.length>0?c.jsxs("span",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-[var(--text-subtle)]",children:[re.macroTasks.length," macro task",re.macroTasks.length===1?"":"s"]}):null]}),c.jsx("h3",{className:"mt-2 text-lg font-black tracking-tight text-[var(--text)] [overflow-wrap:anywhere]",children:re.title}),re.description?c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)] [overflow-wrap:anywhere]",children:re.description}):null]}),c.jsx(Ye,{to:`/requirements#phase-${n.id}`,className:"text-sm font-semibold text-[var(--accent)] hover:underline sm:shrink-0",children:"Open phase requirements →"})]})},re.id))}):c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"No linked requirements yet."})}),n.description?c.jsx(un,{title:c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"Description"}),c.jsx(il,{value:n.descriptionUpdatedAt})]}),children:c.jsx(ya,{text:n.description,className:"plan-description"})}):null,l.length>0?c.jsx(un,{title:"Decisions",count:l.length,defaultOpen:!1,children:c.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:l.map((re,ge)=>c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:c.jsx(ya,{text:re})},ge))})}):null,s.length>0?c.jsx(Pm,{decisions:s}):null,c.jsx(Xm,{statusLog:n.statusLog??[],currentStatus:n.status,backbone:["draft","discovery","planned","in-progress","done"]})]}),I?c.jsx(Gt,{className:"grid gap-4",children:c.jsx(un,{title:"Handoff",actions:c.jsx("button",{type:"button",onClick:ee,disabled:X,className:"rounded-lg border border-[var(--border)] px-3 py-1.5 text-sm text-[var(--text-muted)] hover:bg-[var(--surface-card)] disabled:opacity-60",children:X?"Clearing…":"Clear handoff"}),children:c.jsx("div",{className:"rounded-[18px] border border-[var(--border)] bg-[var(--surface-card)] px-5 py-5",children:c.jsx(ya,{text:I,className:"formatted-text max-w-none"})})})}):null,c.jsxs(Gt,{className:"grid gap-5",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Tasks"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Filter and sort this phase's tasks."})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[c.jsx(Um,{sort:S,onChange:re=>p(ge=>(ge.set("sort",re.key),ge.set("dir",re.direction),ge))}),c.jsx(od,{query:g,status:x,statusOptions:Ko,placeholder:"Search task title, id, or description",clearTo:`/features/${t.id}/phases/${n.id}`,resultsLabel:A.length===n.tasks.length?`${n.tasks.length} tasks`:`${A.length} of ${n.tasks.length} tasks`})]}),c.jsx("div",{className:"grid gap-3",children:n.tasks.length===0?c.jsxs(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:["No tasks yet. ",c.jsx(Ye,{to:"tasks/new",className:"font-semibold text-[var(--accent)] hover:underline",children:"Add a task"})]}):A.length>0?A.map(re=>c.jsx(gA,{featureId:t.id,featureNum:t.number,phaseId:n.id,phaseNum:n.number,task:re},re.id)):c.jsx(Gt,{className:"p-4 text-sm text-[var(--text-muted)]",children:"No tasks match the current filters."})})]}),c.jsx(pi,{})]})}async function xA({params:t}){const{featureId:n,phaseId:l,taskId:s}=t;if(!n||!l||!s)throw new Response("featureId, phaseId and taskId required",{status:400});const[o,u,f,m]=await Promise.all([Yo(n),Wc(l),ed(s),Sm()]),p=m.workDeviations.some(g=>g.resumeTaskId===f.id&&(g.state==="resume-required"||g.state==="resolved"));return{feature:o,phase:u,task:f,pendingResume:p}}function bA({featureId:t,phaseId:n,taskId:l,item:s}){const o=ps(),u=o.formData?o.formData.get("checked")==="true":s.checked,f=o.state!=="idle";return c.jsxs("div",{className:"surface-card flex items-start gap-3 px-4 py-3",children:[c.jsx("input",{type:"checkbox",checked:u,onChange:()=>o.submit({checked:s.checked?"false":"true"},{method:"post",action:`/features/${t}/phases/${n}/tasks/${l}/checklist/${s.id}/toggle`}),disabled:f,className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]","aria-label":`Toggle checklist item ${s.title}`}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"checklist-num",children:s.number})," ",c.jsx("span",{className:`text-sm ${u?"text-[var(--text-muted)] line-through":"font-medium text-[var(--text)]"}`,children:s.title})]})]})}function SA(){var y,N;const{feature:t,phase:n,task:l,pendingResume:s}=sl(),o=l.decisions??[],u=l.acceptedDecisions??[],f=l.checklist??[],m=kr(),p=v.useRef(null),g=v.useCallback(()=>m("edit"),[m]),x=v.useCallback(()=>{var S;(S=p.current)==null||S.requestSubmit()},[]);return Aa("edit",g),Aa("delete",x),c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ye,{to:`/features/${t.id}/phases/${n.id}`,className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Gc,{className:"h-4 w-4"})," Back to phase"]}),c.jsxs("div",{className:"min-w-0",children:[c.jsx(Im,{stacked:!0,items:[{label:t.name,to:`/features/${t.id}`,kind:"Feature"},{label:n.title,to:`/features/${t.id}/phases/${n.id}`,kind:"Phase"},{label:l.title,kind:"Task"}]}),c.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:c.jsx(Vm,{featureNum:t.number,phaseNum:n.number,taskNum:l.number,featureId:t.id,phaseId:n.id,taskId:l.id,shortId:l.shortId,children:c.jsx(ur,{status:l.status})})}),c.jsx("h2",{className:"mt-2 text-2xl font-black tracking-tight text-[var(--text)] min-w-0 break-words [overflow-wrap:anywhere] sm:text-3xl",children:l.title}),c.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[c.jsx(Ye,{to:"edit",children:c.jsx(gt,{type:"button",shortcut:"edit",children:"Edit task"})}),c.jsx(cn,{ref:p,method:"post",action:`/features/${t.id}/phases/${n.id}/tasks/${l.id}/delete`,className:"inline-flex",onSubmit:S=>{window.confirm(`Delete task "${l.title}"?`)||S.preventDefault()},children:c.jsx(gt,{type:"submit",variant:"danger",shortcut:"delete",children:"Delete task"})})]})]}),c.jsx(Gm,{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?c.jsx(Qb,{snapshot:l.pauseSnapshot,pendingResume:s}):null,c.jsxs(Gt,{className:"grid gap-4",children:[l.description?c.jsx(un,{title:c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"Description"}),c.jsx(il,{value:l.descriptionUpdatedAt})]}),children:c.jsx(ya,{text:l.description,className:"plan-description"})}):null,l.notes?c.jsx(un,{title:"Notes",defaultOpen:!1,children:c.jsx(ya,{text:l.notes})}):null,c.jsx(Xm,{statusLog:l.statusLog??[],currentStatus:l.status,backbone:["planned","in-progress","done"],startedAt:l.startedAt,completedAt:l.completedAt}),o.length>0?c.jsx(un,{title:"Decisions",count:o.length,defaultOpen:!1,children:c.jsx("div",{className:"grid gap-2 border-l-2 border-[var(--border)] pl-4 ml-1",children:o.map((S,w)=>c.jsx("div",{className:"text-sm text-[var(--text-muted)]",children:c.jsx(ya,{text:S})},w))})}):null,u.length>0?c.jsx(Pm,{decisions:u}):null,c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-5",children:[c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Checklist items"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:f.length})]}),c.jsxs(La,{children:[c.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.22em] text-[var(--text-subtle)]",children:"Subtasks"}),c.jsx("p",{className:"mt-2 text-3xl font-black text-[var(--text)]",children:((y=l.subtasks)==null?void 0:y.length)??0})]})]}),c.jsx(Ym,{items:[{label:"Entity last updated",value:ll(l.updatedAt),visible:!!l.updatedAt},{label:"Priority",value:Fm(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:n.title}]}),c.jsxs("div",{className:"grid gap-3",children:[c.jsx("div",{children:c.jsxs("h3",{className:"text-sm font-bold text-[var(--text)]",children:["Steps (",f.length,")"]})}),f.length?c.jsx("div",{className:"grid gap-2",children:f.map(S=>c.jsx(bA,{featureId:t.id,phaseId:n.id,taskId:l.id,item:S},S.id))}):c.jsx("p",{className:"text-sm text-[var(--text-muted)] italic",children:"No steps defined."})]}),(N=l.subtasks)!=null&&N.length?c.jsx(un,{title:"Subtasks",count:l.subtasks.length,defaultOpen:!1,contentClassName:"grid gap-2",children:l.subtasks.map(S=>c.jsxs("div",{className:"surface-card flex items-center justify-between gap-4 px-4 py-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold text-[var(--text)]",children:S.title}),c.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:S.id})]}),c.jsx(ur,{status:S.status})]},S.id))}):null]}),c.jsx(pi,{})]})}const wA=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Vl({title:t,description:n,children:l}){const s=kr(),o=v.useRef(null),u=v.useRef(null);return v.useEffect(()=>{var g;const f=o.current;if(!f)return;const m=document.activeElement;(g=u.current)==null||g.focus();const p=x=>{if(x.key==="Escape"){x.preventDefault(),s(-1);return}if(x.key!=="Tab")return;const y=Array.from(f.querySelectorAll(wA)).filter(A=>A.offsetParent!==null);if(y.length===0){x.preventDefault(),f.focus();return}const N=y[0],S=y[y.length-1],w=document.activeElement;x.shiftKey?(w===N||!f.contains(w))&&(x.preventDefault(),S.focus()):w===S&&(x.preventDefault(),N.focus())};return window.addEventListener("keydown",p),()=>{var x;window.removeEventListener("keydown",p),(x=m==null?void 0:m.focus)==null||x.call(m)}},[s]),c.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto p-4 md:p-6",children:[c.jsx("button",{type:"button",className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>s(-1),"aria-hidden":"true",tabIndex:-1}),c.jsx("div",{className:"relative z-10 flex min-h-full items-start justify-center",children:c.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,className:"surface-panel flex max-h-[calc(100vh-2rem)] w-full max-w-2xl flex-col overflow-hidden p-6 outline-none md:max-h-[calc(100vh-3rem)] md:p-8",children:[c.jsxs("div",{className:"mb-6 flex shrink-0 items-start justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:t}),n?c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:n}):null]}),c.jsx("button",{ref:u,type:"button",onClick:()=>s(-1),className:"inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-[14px] border border-[var(--border-strong)] text-[var(--text-muted)] transition hover:text-[var(--text)]","aria-label":"Close modal",children:c.jsx(mR,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:l})]})})]})}function Yl({className:t="",children:n,...l}){return c.jsx("div",{className:`sticky bottom-0 mt-2 flex justify-end gap-3 border-t border-[var(--border)] bg-[var(--surface)] px-1 pt-4 pb-1 backdrop-blur-xl ${t}`,...l,children:n})}function lt({label:t,children:n}){return c.jsxs("label",{className:"grid gap-2",children:[c.jsx("span",{className:"text-sm font-semibold text-[var(--text-muted)]",children:t}),n]})}function ha(t){return c.jsx("textarea",{className:"field-control field-textarea",...t})}function EA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return Aa("submit",s,{allowInEditable:!0}),c.jsx(Vl,{title:"Create feature",description:"Top-level container for phases and tasks.",children:c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Feature name",children:c.jsx(mn,{name:"name",placeholder:"Products page implementation",required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(ha,{name:"description",placeholder:"Short context for the feature"})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Creating…":"Create feature"})})]})})}function NA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const u=ys("feature-detail").feature;return c.jsx(Vl,{title:"Edit feature",description:"Update metadata, planning notes and timeline.",children:c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Name",children:c.jsx(mn,{name:"name",defaultValue:u.name,required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(ha,{name:"description",defaultValue:u.description})}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsx(lt,{label:"Start date",children:c.jsx(mn,{type:"date",name:"startDate",defaultValue:u.startDate})}),c.jsx(lt,{label:"End date",children:c.jsx(mn,{type:"date",name:"endDate",defaultValue:u.endDate})})]}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:u.status,children:sd.map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})}),c.jsx(lt,{label:"Priority",children:c.jsx(mn,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(un,{title:"Planning notes",subtitle:"Optional agent-maintained notes for progress tracking.",defaultOpen:!1,className:"mt-0",children:c.jsxs("div",{className:"grid gap-4",children:[c.jsx(lt,{label:"Work done",children:c.jsx(ha,{name:"workDone",defaultValue:u.workDone})}),c.jsx(lt,{label:"Work remaining",children:c.jsx(ha,{name:"workRemaining",defaultValue:u.workRemaining})})]})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save feature"})})]})})}function RA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return Aa("submit",s,{allowInEditable:!0}),c.jsx(Vl,{title:"Create phase",description:"A phase belongs to the current feature.",children:c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Phase title",children:c.jsx(mn,{name:"title",placeholder:"API creation",required:!0})}),c.jsx(lt,{label:"Summary",children:c.jsx(ha,{name:"summary",placeholder:"Brief phase summary"})}),c.jsx(lt,{label:"Description",children:c.jsx(ha,{name:"description",placeholder:"Initial implementation notes"})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Creating…":"Create phase"})})]})})}function ri(t){return t.join(`
|
|
294
|
-
`)}function jA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const u=ys("phase-detail").phase;return c.jsx(Vl,{title:"Edit phase",description:"Update scope, constraints and delivery criteria.",children:c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Title",children:c.jsx(mn,{name:"title",defaultValue:u.title,required:!0})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:u.status,children:id.map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})}),c.jsx(lt,{label:"Priority",children:c.jsx(mn,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(lt,{label:"Summary",children:c.jsx(ha,{name:"summary",defaultValue:u.summary})}),c.jsx(lt,{label:"Description",children:c.jsx(ha,{name:"description",defaultValue:u.description})}),c.jsx(lt,{label:"Goals (one per line)",children:c.jsx(ha,{name:"goals",defaultValue:ri(u.goals)})}),c.jsx(lt,{label:"Non-goals (one per line)",children:c.jsx(ha,{name:"nonGoals",defaultValue:ri(u.nonGoals)})}),c.jsx(lt,{label:"Dependencies (one per line)",children:c.jsx(ha,{name:"dependencies",defaultValue:ri(u.dependencies)})}),c.jsx(lt,{label:"Risks (one per line)",children:c.jsx(ha,{name:"risks",defaultValue:ri(u.risks)})}),c.jsx(lt,{label:"Open questions (one per line)",children:c.jsx(ha,{name:"openQuestions",defaultValue:ri(u.openQuestions)})}),c.jsx(lt,{label:"Completion criteria (one per line)",children:c.jsx(ha,{name:"completionCriteria",defaultValue:ri(u.completionCriteria)})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save phase"})})]})})}function TA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var o;return(o=l.current)==null?void 0:o.requestSubmit()},[]);return Aa("submit",s,{allowInEditable:!0}),c.jsx(Vl,{title:"Create task",description:"A task belongs to the current phase.",children:c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Task title",children:c.jsx(mn,{name:"title",placeholder:"Custom fetcher integration",required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(ha,{name:"description",placeholder:"Initial task context"})}),c.jsx(lt,{label:"Checklist (one per line)",children:c.jsx(ha,{name:"checklist",placeholder:`Step one
|
|
295
|
-
Step two
|
|
296
|
-
Step three`})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:"planned",children:Bm.map(o=>c.jsx("option",{value:o.value,children:o.label},o.value))})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Creating…":"Create task"})})]})})}function CA(t){return t.map(n=>n.title).join(`
|
|
297
|
-
`)}function AA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var f;return(f=l.current)==null?void 0:f.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const u=ys("task-detail").task;return c.jsx(Vl,{title:"Edit task",description:"Update execution details and checklist items.",children:c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Title",children:c.jsx(mn,{name:"title",defaultValue:u.title,required:!0})}),c.jsxs(lt,{label:"Status",children:[u.status==="paused"?c.jsx("input",{type:"hidden",name:"status",value:"paused"}):null,c.jsx(bs,{name:u.status==="paused"?void 0:"status",defaultValue:u.status,disabled:u.status==="paused",title:u.status==="paused"?"Resume paused work through task_start so its checkpoint is preserved.":void 0,children:(u.status==="paused"?Ko:Bm).map(f=>c.jsx("option",{value:f.value,children:f.label},f.value))})]}),c.jsx(lt,{label:"Priority",children:c.jsx(mn,{type:"number",name:"priority",defaultValue:u.priority??0,min:0})}),c.jsx(lt,{label:"Description",children:c.jsx(ha,{name:"description",defaultValue:u.description})}),c.jsx(lt,{label:"Checklist (one per line)",children:c.jsx(ha,{name:"checklist",defaultValue:CA(u.checklist)})}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save task"})})]})})}function DA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const{project:o}=ys("root");return c.jsxs("div",{className:"grid gap-8",children:[c.jsxs(Ye,{to:"/",className:"inline-flex items-center gap-2 text-sm font-semibold text-[var(--accent)] hover:underline",children:[c.jsx(Gc,{className:"h-4 w-4"})," Back to dashboard"]}),c.jsxs(Gt,{className:"grid gap-5",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-black tracking-tight text-[var(--text)]",children:"Edit project overview"}),c.jsx("p",{className:"mt-2 text-sm text-[var(--text-muted)]",children:"Update the short dashboard summary and the longer project goal without changing the rest of the project metadata."})]}),c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Project name",children:c.jsx(mn,{name:"name",defaultValue:o.name,placeholder:"Project name",required:!0})}),c.jsx(lt,{label:"Short description",children:c.jsx(ha,{name:"description",defaultValue:o.description,placeholder:"Summarize the project in a few lines for the dashboard overview"})}),c.jsx(lt,{label:"Project goal",children:c.jsx(ha,{name:"goal",defaultValue:o.goal,placeholder:"Define the main objective, success criteria, and overall direction of the project"})}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx(Ye,{to:"/",children:c.jsx(gt,{type:"button",variant:"ghost",children:"Cancel"})}),c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save project overview"})]})]})]})]})}function kA(t){return`P${String(t.number??0).padStart(3,"0")}`}function P0({phases:t,selectedIds:n=[]}){const l=new Set(n);return c.jsx(lt,{label:"Linked phases",children:t.length===0?c.jsx("div",{className:"rounded-[14px] border border-dashed border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3 text-sm text-[var(--text-muted)]",children:"No phases available yet. Create phases first if you want to link this requirement to delivery work."}):c.jsxs("div",{className:"grid gap-2 rounded-[16px] border border-[var(--border)] bg-[var(--surface-elevated)] p-3",children:[c.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Select the phases that directly implement or track this requirement."}),c.jsx("div",{className:"grid gap-2 max-h-[32dvh] overflow-y-auto pr-1",children:t.map(s=>c.jsxs("label",{className:"flex items-start gap-3 rounded-[12px] border border-[var(--border)] bg-[var(--surface-card)] px-3 py-2 text-sm text-[var(--text)] transition hover:border-[var(--accent)] hover:bg-[var(--accent-soft)]",children:[c.jsx("input",{type:"checkbox",name:"linkedPhaseIds",value:s.id,defaultChecked:l.has(s.id),className:"mt-0.5 h-4 w-4 shrink-0 accent-[var(--accent)]"}),c.jsxs("span",{className:"min-w-0",children:[c.jsxs("span",{className:"block font-semibold",children:[kA(s)," — ",s.title]}),s.summary?c.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-muted)]",children:s.summary}):null]})]},s.id))})]})})}function OA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var u;return(u=l.current)==null?void 0:u.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const{phases:o}=ys("requirements");return c.jsx(Vl,{title:"Create requirement",description:"Capture a top-level outcome that phases can implement and track.",children:c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Requirement title",children:c.jsx(mn,{name:"title",placeholder:"Self-hosted Claude Code plugin marketplace distribution",required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(ha,{name:"description",placeholder:"Describe the user/business outcome this requirement represents"})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:"planned",children:_0.map(u=>c.jsx("option",{value:u.value,children:u.label},u.value))})}),c.jsx(P0,{phases:o}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Creating…":"Create requirement"})})]})})}function MA(){const n=Or().state!=="idle",l=v.useRef(null),s=v.useCallback(()=>{var p;return(p=l.current)==null?void 0:p.requestSubmit()},[]);Aa("submit",s,{allowInEditable:!0});const{requirementId:o}=sE(),{phases:u,requirements:f}=ys("requirements"),m=f.find(p=>p.id===o);return m?c.jsx(Vl,{title:"Edit requirement",description:"Update status, scope notes, and linked delivery phases.",children:c.jsxs(cn,{ref:l,method:"post",className:"grid gap-4",children:[c.jsx(lt,{label:"Requirement title",children:c.jsx(mn,{name:"title",defaultValue:m.title,required:!0})}),c.jsx(lt,{label:"Description",children:c.jsx(ha,{name:"description",defaultValue:m.description})}),c.jsx(lt,{label:"Status",children:c.jsx(bs,{name:"status",defaultValue:m.status,children:_0.map(p=>c.jsx("option",{value:p.value,children:p.label},p.value))})}),c.jsx(P0,{phases:u,selectedIds:m.linkedPhaseIds}),c.jsx("div",{className:"rounded-[14px] border border-[var(--border)] bg-[var(--surface-elevated)] px-4 py-3 text-sm text-[var(--text-muted)]",children:"Macro tasks are preserved automatically on save. This screen does not edit the nested macro-task list yet."}),c.jsx(Yl,{children:c.jsx(gt,{type:"submit",variant:"primary",disabled:n,shortcut:"submit",children:n?"Saving…":"Save requirement"})})]})}):null}function Za(t,n){const l=t.get(n);if(typeof l!="string"||l.trim()==="")throw new Response(`Missing field: ${n}`,{status:400});return l.trim()}function Ua(t,n){const l=t.get(n);return typeof l=="string"?l.trim():""}function Qm(t,n){const l=t.get(n);if(typeof l!="string")return 0;const s=l.trim();if(s==="")return 0;const o=Number(s);return Number.isFinite(o)?o:0}function zl(t,n){return Ua(t,n).split(`
|
|
298
|
-
`).map(l=>l.trim()).filter(Boolean)}function sa(t,n){const l=t[n];if(!l)throw new Response(`Missing route param: ${n}`,{status:400});return l}async function _A({request:t}){const n=await t.formData();return await bR({name:Za(n,"name"),description:Ua(n,"description")}),Un("/features")}async function LA({request:t,params:n}){const l=sa(n,"featureId"),s=await Yo(l),o=await t.formData();return await Pb({...s,name:Za(o,"name"),description:Ua(o,"description"),startDate:Ua(o,"startDate"),endDate:Ua(o,"endDate"),status:Za(o,"status"),priority:Qm(o,"priority"),workDone:Ua(o,"workDone"),workRemaining:Ua(o,"workRemaining")}),Un(`/features/${l}`)}async function zA({params:t}){return await SR(sa(t,"featureId")),Un("/features")}async function UA({request:t,params:n}){const l=sa(n,"featureId"),s=await Yo(l),o=await t.formData();return await Pb({...s,status:Za(o,"status")}),null}async function BA({request:t,params:n}){const l=sa(n,"featureId"),s=await t.formData();return await RR({featureId:l,title:Za(s,"title"),summary:Ua(s,"summary"),description:Ua(s,"description")}),Un(`/features/${l}`)}async function HA({request:t,params:n}){const l=sa(n,"featureId"),s=sa(n,"phaseId"),o=await Wc(s),u=await t.formData();return await Gb({...o,title:Za(u,"title"),status:Za(u,"status"),priority:Qm(u,"priority"),summary:Ua(u,"summary"),description:Ua(u,"description"),goals:zl(u,"goals"),nonGoals:zl(u,"nonGoals"),dependencies:zl(u,"dependencies"),risks:zl(u,"risks"),openQuestions:zl(u,"openQuestions"),completionCriteria:zl(u,"completionCriteria")}),Un(`/features/${l}/phases/${s}`)}async function $A({params:t}){const n=sa(t,"featureId"),l=sa(t,"phaseId");return await jR(l),Un(`/features/${n}`)}async function qA({request:t,params:n}){const l=sa(n,"phaseId"),s=await Wc(l),o=await t.formData();return await Gb({...s,status:Za(o,"status")}),null}async function IA({request:t,params:n}){const l=sa(n,"featureId"),s=sa(n,"phaseId"),o=await t.formData(),u=zl(o,"checklist");return await TR(s,{title:Za(o,"title"),description:Ua(o,"description"),status:Ua(o,"status")||"planned",...u.length?{checklist:u}:{}}),Un(`/features/${l}/phases/${s}`)}function VA(t,n){const l=new Map(t.map(o=>[o.id,o])),s=new Map(t.map(o=>[o.title.trim().toLowerCase(),o]));return n.map((o,u)=>{var p;const f=o.trim().toLowerCase(),m=l.get(((p=t[u])==null?void 0:p.id)??"")??s.get(f);return m?{...m,number:u+1,title:o.trim()}:{id:`check-${u+1}-${f.replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"item"}`,number:u+1,title:o.trim(),checked:!1}})}async function YA({request:t,params:n}){const l=sa(n,"featureId"),s=sa(n,"phaseId"),o=sa(n,"taskId"),u=await ed(o),f=await t.formData();return await Em({...u,phaseId:s,title:Za(f,"title"),status:Za(f,"status"),priority:Qm(f,"priority"),description:Ua(f,"description"),checklist:VA(u.checklist,zl(f,"checklist"))}),Un(`/features/${l}/phases/${s}/tasks/${o}`)}async function FA({params:t}){const n=sa(t,"featureId"),l=sa(t,"phaseId"),s=sa(t,"taskId");return await CR(s),Un(`/features/${n}/phases/${l}`)}async function PA({request:t,params:n}){const l=sa(n,"phaseId"),s=sa(n,"taskId"),o=await ed(s),u=await t.formData();return await Em({...o,phaseId:l,status:Za(u,"status")}),null}async function GA({request:t}){const n=await Sm(),l=await t.formData();return await yR({...n,name:Ua(l,"name")||n.name,description:Ua(l,"description"),goal:Ua(l,"goal")}),Un("/")}async function XA({request:t}){const n=await t.formData();return await wR({id:crypto.randomUUID(),title:Za(n,"title"),description:Ua(n,"description"),status:Za(n,"status"),linkedPhaseIds:n.getAll("linkedPhaseIds").filter(l=>typeof l=="string").map(l=>l.trim()).filter(Boolean)}),Un("/requirements")}async function QA({request:t,params:n}){const l=sa(n,"requirementId"),s=(await wm()).find(u=>u.id===l);if(!s)throw new Response(`Requirement not found: ${l}`,{status:404});const o=await t.formData();return await ER({...s,title:Za(o,"title"),description:Ua(o,"description"),status:Za(o,"status"),linkedPhaseIds:o.getAll("linkedPhaseIds").filter(u=>typeof u=="string").map(u=>u.trim()).filter(Boolean)}),Un("/requirements")}async function KA({params:t}){return await NR(sa(t,"requirementId")),Un("/requirements")}function ZA(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function JA(){return{handoffs:await Gh()}}function WA(){const{handoffs:t}=sl(),[n,l]=v.useState(t),[s,o]=v.useState(null),[u,f]=v.useState(""),m=hr();async function p(g){if(!(s||!window.confirm(`Clear handoff for ${g.compositeRef}?`))){o(g.phaseId),f("");try{await Xb(g.phaseId),l(y=>y.filter(N=>N.phaseId!==g.phaseId)),Gh().then(l).catch(()=>{})}catch(y){const N=y instanceof Response?await y.text().catch(()=>""):y instanceof Error?y.message:String(y);f(N||`Failed to clear handoff for ${g.compositeRef}.`)}finally{o(null)}}}return v.useEffect(()=>{const g=x=>{const y=x.detail;((y==null?void 0:y.type)==="handoffUpdated"||(y==null?void 0:y.type)==="handoffCleared")&&Gh().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,n]),n.length===0?c.jsxs(Gt,{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),c.jsx(Ye,{to:"/handoff/archive",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"View archive →"})]}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Pending entity-scoped handoffs on non-completed phases."})]}),u?c.jsx("p",{className:"rounded-[12px] border border-[var(--danger-soft)] bg-[var(--danger-soft)]/50 px-3 py-2 text-sm text-[var(--color-status-blocked)]",children:u}):null,c.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No pending phase handoffs."})]}):c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Phase handoffs"}),c.jsx(Ye,{to:"/handoff/archive",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"View archive →"})]}),c.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:["Pending entity-scoped handoffs on non-completed phases. ",n.length," pending."]})]}),u?c.jsx("p",{className:"rounded-[12px] border border-[var(--danger-soft)] bg-[var(--danger-soft)]/50 px-3 py-2 text-sm text-[var(--color-status-blocked)]",children:u}):null,n.map(g=>c.jsx("section",{id:g.phaseId,className:"scroll-mt-20",children:c.jsx(Gt,{className:"overflow-hidden p-0",children:c.jsx(un,{defaultOpen:!1,title:c.jsxs(c.Fragment,{children:[c.jsx(mr,{id:g.compositeRef,children:g.compositeRef}),c.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Updated ",ZA(g.updatedAt)]})]}),subtitle:g.firstLine||"Empty handoff content.",summaryClassName:"hover:bg-[var(--surface-hover)]/60 focus-visible:bg-[var(--surface-hover)]/60",actions:c.jsxs(c.Fragment,{children:[c.jsx(gt,{type:"button",variant:"danger",className:"min-h-8 px-2.5 py-1 text-xs sm:min-h-9",disabled:s===g.phaseId,onClick:x=>{x.preventDefault(),x.stopPropagation(),p(g)},children:s===g.phaseId?"Clearing…":"Clear"}),c.jsx(Ye,{to:g.featureId?`/features/${g.featureId}/phases/${g.phaseId}`:"/features",className:"text-xs text-[var(--text-muted)] underline-offset-2 hover:text-[var(--text)] hover:underline",onClick:x=>x.stopPropagation(),children:g.featureId?"Open phase →":"Browse features →"})]}),contentClassName:"px-5 py-5",children:g.firstLine?c.jsx(ya,{text:g.content,className:"formatted-text max-w-none"}):c.jsx("p",{className:"text-sm italic text-[var(--text-muted)]",children:"Empty handoff content."})})})},g.phaseId))]})}function eD(t){if(!t)return"—";try{return new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t))}catch{return t}}async function tD(){return{archived:await kR()}}function aD(){const{archived:t}=sl();return t.length===0?c.jsxs(Gt,{className:"grid gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Archived handoffs"}),c.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Completed, superseded, and manually cleared handoffs."})]}),c.jsx(Ye,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),c.jsx("p",{className:"py-8 text-center text-sm text-[var(--text-muted)]",children:"No archived handoffs."})]}):c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-bold text-[var(--text)]",children:"Archived handoffs"}),c.jsxs("p",{className:"text-sm text-[var(--text-muted)]",children:[t.length," archived entries. These are history, not pending resume context."]})]}),c.jsx(Ye,{to:"/handoff",className:"text-sm text-[var(--accent)] underline-offset-2 hover:underline",children:"← Pending handoffs"})]}),t.map(n=>c.jsx(Gt,{className:"overflow-hidden p-0",children:c.jsxs(un,{defaultOpen:!1,title:c.jsxs(c.Fragment,{children:[c.jsx(mr,{id:n.compositeRef,children:n.compositeRef}),c.jsxs("span",{className:"text-xs font-normal text-[var(--text-muted)]",children:["Archived ",eD(n.archivedAt)]})]}),subtitle:n.firstLine||"Empty archived handoff.",contentClassName:"px-5 py-5",children:[c.jsxs("div",{className:"mb-3 flex flex-wrap gap-2 text-xs text-[var(--text-muted)]",children:[c.jsxs("span",{children:["Reason: ",n.reason||"unknown"]}),c.jsxs("span",{className:"break-all",children:["File: ",n.file]})]}),c.jsx(ya,{text:n.content||"(archive file unavailable)",className:"formatted-text max-w-none"})]})},`${n.phaseId}:${n.file}`))]})}async function nD({request:t,params:n}){sa(n,"featureId");const l=sa(n,"phaseId"),s=sa(n,"taskId"),o=sa(n,"itemId"),u=await t.formData(),f=Za(u,"checked")==="true",m=await ed(s);return await Em({...m,phaseId:l,checklist:m.checklist.map(p=>p.id===o?{...p,checked:f}:p)}),Response.json({ok:!0,taskId:s,itemId:o,checked:f})}const rD=ZE([{id:"root",path:"/",loader:n2,element:c.jsx(r2,{}),errorElement:c.jsx(l2,{}),children:[{index:!0,loader:s2,element:c.jsx(PC,{})},{path:"features",id:"features",loader:GC,element:c.jsx(WC,{}),children:[{path:"new",element:c.jsx(EA,{}),action:_A}]},{path:"features/:featureId",id:"feature-detail",loader:rA,element:c.jsx(mA,{}),children:[{path:"edit",element:c.jsx(NA,{}),action:LA},{path:"phases/new",element:c.jsx(RA,{}),action:BA}]},{path:"requirements",id:"requirements",loader:eA,element:c.jsx(nA,{}),children:[{path:"new",element:c.jsx(OA,{}),action:XA},{path:":requirementId/edit",element:c.jsx(MA,{}),action:QA}]},{path:"project/edit",element:c.jsx(DA,{}),action:GA},{path:"handoff",loader:JA,element:c.jsx(WA,{})},{path:"handoff/archive",loader:tD,element:c.jsx(aD,{})},{path:"features/:featureId/delete",action:zA},{path:"requirements/:requirementId/delete",action:KA},{path:"features/:featureId/status",action:UA},{path:"features/:featureId/phases/:phaseId",id:"phase-detail",loader:pA,element:c.jsx(yA,{}),children:[{path:"edit",element:c.jsx(jA,{}),action:HA},{path:"tasks/new",element:c.jsx(TA,{}),action:IA}]},{path:"features/:featureId/phases/:phaseId/delete",action:$A},{path:"features/:featureId/phases/:phaseId/status",action:qA},{path:"features/:featureId/phases/:phaseId/tasks/:taskId",id:"task-detail",loader:xA,element:c.jsx(SA,{}),children:[{path:"edit",element:c.jsx(AA,{}),action:YA}]},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/delete",action:FA},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/status",action:PA},{path:"features/:featureId/phases/:phaseId/tasks/:taskId/checklist/:itemId/toggle",action:nD}]}]),G0=document.getElementById("root");if(!G0)throw new Error("#root not found");$S.createRoot(G0).render(c.jsx(v.StrictMode,{children:c.jsx(sN,{router:rD})}));
|