cohorte 3.3.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +23 -3
  3. package/core/agents/cohorte-review.md +11 -3
  4. package/core/agents/implementer.template.md +19 -1
  5. package/core/commands/cohorte-acceptance.md +35 -0
  6. package/core/commands/cohorte-build.md +17 -0
  7. package/core/commands/cohorte-fix.md +6 -0
  8. package/core/commands/cohorte-foundation.md +90 -0
  9. package/core/commands/cohorte-lead.md +90 -0
  10. package/core/commands/cohorte-learn.md +67 -0
  11. package/core/commands/cohorte-po.md +76 -0
  12. package/core/commands/cohorte-product-map.md +53 -0
  13. package/core/commands/cohorte-retro.md +44 -13
  14. package/core/commands/cohorte-scaffold.md +59 -0
  15. package/core/commands/cohorte-vision.md +80 -0
  16. package/lib/install.js +2 -0
  17. package/lib/project.js +1 -1
  18. package/lib/registry.js +4 -3
  19. package/package.json +2 -2
  20. package/profile/PIPELINE.template.md +3 -1
  21. package/profile/schema/kanban.md +23 -0
  22. package/scripts/kanban-move.sh +45 -11
  23. package/ui/dist-server/server/agents.js +100 -0
  24. package/ui/dist-server/server/decider.js +241 -0
  25. package/ui/dist-server/server/features.js +128 -0
  26. package/ui/dist-server/server/flow.js +934 -0
  27. package/ui/dist-server/server/founding.js +706 -0
  28. package/ui/dist-server/server/gitinfo.js +22 -0
  29. package/ui/dist-server/server/history.js +10 -3
  30. package/ui/dist-server/server/legacy.js +3 -1
  31. package/ui/dist-server/server/next.js +91 -0
  32. package/ui/dist-server/server/runs.js +73 -11
  33. package/ui/dist-server/server/server.js +222 -6
  34. package/ui/dist-server/server/settings.js +81 -0
  35. package/ui/dist-server/server/tracker.js +438 -0
  36. package/ui/dist-server/shared/blocks.js +165 -0
  37. package/ui/dist-web/assets/index-BfN944Jm.js +165 -0
  38. package/ui/dist-web/assets/{style-0oNNMjwU.css → style-BMfadlCl.css} +1 -1
  39. package/ui/dist-web/index.html +2 -2
  40. package/ui/dist-web/assets/index-Clp1YW4S.js +0 -152
@@ -0,0 +1,165 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function eh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ec={exports:{}},hl={},tc={exports:{}},A={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its 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 Kr=Symbol.for("react.element"),th=Symbol.for("react.portal"),nh=Symbol.for("react.fragment"),rh=Symbol.for("react.strict_mode"),sh=Symbol.for("react.profiler"),lh=Symbol.for("react.provider"),ih=Symbol.for("react.context"),oh=Symbol.for("react.forward_ref"),ah=Symbol.for("react.suspense"),uh=Symbol.for("react.memo"),ch=Symbol.for("react.lazy"),Ta=Symbol.iterator;function dh(e){return e===null||typeof e!="object"?null:(e=Ta&&e[Ta]||e["@@iterator"],typeof e=="function"?e:null)}var nc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rc=Object.assign,sc={};function Jn(e,t,n){this.props=e,this.context=t,this.refs=sc,this.updater=n||nc}Jn.prototype.isReactComponent={};Jn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Jn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function lc(){}lc.prototype=Jn.prototype;function yo(e,t,n){this.props=e,this.context=t,this.refs=sc,this.updater=n||nc}var xo=yo.prototype=new lc;xo.constructor=yo;rc(xo,Jn.prototype);xo.isPureReactComponent=!0;var _a=Array.isArray,ic=Object.prototype.hasOwnProperty,jo={current:null},oc={key:!0,ref:!0,__self:!0,__source:!0};function ac(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)ic.call(t,r)&&!oc.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];l.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)l[r]===void 0&&(l[r]=a[r]);return{$$typeof:Kr,type:e,key:i,ref:o,props:l,_owner:jo.current}}function fh(e,t){return{$$typeof:Kr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function wo(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kr}function hh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ra=/\/+/g;function Ml(e,t){return typeof e=="object"&&e!==null&&e.key!=null?hh(""+e.key):t.toString(36)}function Ss(e,t,n,r,l){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Kr:case th:o=!0}}if(o)return o=e,l=l(o),e=r===""?"."+Ml(o,0):r,_a(l)?(n="",e!=null&&(n=e.replace(Ra,"$&/")+"/"),Ss(l,t,n,"",function(c){return c})):l!=null&&(wo(l)&&(l=fh(l,n+(!l.key||o&&o.key===l.key?"":(""+l.key).replace(Ra,"$&/")+"/")+e)),t.push(l)),1;if(o=0,r=r===""?".":r+":",_a(e))for(var a=0;a<e.length;a++){i=e[a];var u=r+Ml(i,a);o+=Ss(i,t,n,u,l)}else if(u=dh(e),typeof u=="function")for(e=u.call(e),a=0;!(i=e.next()).done;)i=i.value,u=r+Ml(i,a++),o+=Ss(i,t,n,u,l);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function ls(e,t,n){if(e==null)return e;var r=[],l=0;return Ss(e,r,"","",function(i){return t.call(n,i,l++)}),r}function ph(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var $e={current:null},Ns={transition:null},mh={ReactCurrentDispatcher:$e,ReactCurrentBatchConfig:Ns,ReactCurrentOwner:jo};function uc(){throw Error("act(...) is not supported in production builds of React.")}A.Children={map:ls,forEach:function(e,t,n){ls(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ls(e,function(){t++}),t},toArray:function(e){return ls(e,function(t){return t})||[]},only:function(e){if(!wo(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};A.Component=Jn;A.Fragment=nh;A.Profiler=sh;A.PureComponent=yo;A.StrictMode=rh;A.Suspense=ah;A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mh;A.act=uc;A.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=rc({},e.props),l=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=jo.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)ic.call(t,u)&&!oc.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&a!==void 0?a[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){a=Array(u);for(var c=0;c<u;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Kr,type:e.type,key:l,ref:i,props:r,_owner:o}};A.createContext=function(e){return e={$$typeof:ih,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:lh,_context:e},e.Consumer=e};A.createElement=ac;A.createFactory=function(e){var t=ac.bind(null,e);return t.type=e,t};A.createRef=function(){return{current:null}};A.forwardRef=function(e){return{$$typeof:oh,render:e}};A.isValidElement=wo;A.lazy=function(e){return{$$typeof:ch,_payload:{_status:-1,_result:e},_init:ph}};A.memo=function(e,t){return{$$typeof:uh,type:e,compare:t===void 0?null:t}};A.startTransition=function(e){var t=Ns.transition;Ns.transition={};try{e()}finally{Ns.transition=t}};A.unstable_act=uc;A.useCallback=function(e,t){return $e.current.useCallback(e,t)};A.useContext=function(e){return $e.current.useContext(e)};A.useDebugValue=function(){};A.useDeferredValue=function(e){return $e.current.useDeferredValue(e)};A.useEffect=function(e,t){return $e.current.useEffect(e,t)};A.useId=function(){return $e.current.useId()};A.useImperativeHandle=function(e,t,n){return $e.current.useImperativeHandle(e,t,n)};A.useInsertionEffect=function(e,t){return $e.current.useInsertionEffect(e,t)};A.useLayoutEffect=function(e,t){return $e.current.useLayoutEffect(e,t)};A.useMemo=function(e,t){return $e.current.useMemo(e,t)};A.useReducer=function(e,t,n){return $e.current.useReducer(e,t,n)};A.useRef=function(e){return $e.current.useRef(e)};A.useState=function(e){return $e.current.useState(e)};A.useSyncExternalStore=function(e,t,n){return $e.current.useSyncExternalStore(e,t,n)};A.useTransition=function(){return $e.current.useTransition()};A.version="18.3.1";tc.exports=A;var N=tc.exports;const Ul=eh(N);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 gh=N,vh=Symbol.for("react.element"),yh=Symbol.for("react.fragment"),xh=Object.prototype.hasOwnProperty,jh=gh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,wh={key:!0,ref:!0,__self:!0,__source:!0};function cc(e,t,n){var r,l={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)xh.call(t,r)&&!wh.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:vh,type:e,key:i,ref:o,props:l,_owner:jh.current}}hl.Fragment=yh;hl.jsx=cc;hl.jsxs=cc;ec.exports=hl;var s=ec.exports,dc={exports:{}},Ae={},fc={exports:{}},hc={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(e){function t(P,z){var F=P.length;P.push(z);e:for(;0<F;){var se=F-1>>>1,ue=P[se];if(0<l(ue,z))P[se]=z,P[F]=ue,F=se;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var z=P[0],F=P.pop();if(F!==z){P[0]=F;e:for(var se=0,ue=P.length,rs=ue>>>1;se<rs;){var tn=2*(se+1)-1,Al=P[tn],nn=tn+1,ss=P[nn];if(0>l(Al,F))nn<ue&&0>l(ss,Al)?(P[se]=ss,P[nn]=F,se=nn):(P[se]=Al,P[tn]=F,se=tn);else if(nn<ue&&0>l(ss,F))P[se]=ss,P[nn]=F,se=nn;else break e}}return z}function l(P,z){var F=P.sortIndex-z.sortIndex;return F!==0?F:P.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],c=[],f=1,v=null,p=3,x=!1,j=!1,g=!1,T=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(P){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=P)r(c),z.sortIndex=z.expirationTime,t(u,z);else break;z=n(c)}}function y(P){if(g=!1,m(P),!j)if(n(u)!==null)j=!0,Ol(E);else{var z=n(c);z!==null&&Fl(y,z.startTime-P)}}function E(P,z){j=!1,g&&(g=!1,h(I),I=-1),x=!0;var F=p;try{for(m(z),v=n(u);v!==null&&(!(v.expirationTime>z)||P&&!Xe());){var se=v.callback;if(typeof se=="function"){v.callback=null,p=v.priorityLevel;var ue=se(v.expirationTime<=z);z=e.unstable_now(),typeof ue=="function"?v.callback=ue:v===n(u)&&r(u),m(z)}else r(u);v=n(u)}if(v!==null)var rs=!0;else{var tn=n(c);tn!==null&&Fl(y,tn.startTime-z),rs=!1}return rs}finally{v=null,p=F,x=!1}}var _=!1,R=null,I=-1,re=5,M=-1;function Xe(){return!(e.unstable_now()-M<re)}function nr(){if(R!==null){var P=e.unstable_now();M=P;var z=!0;try{z=R(!0,P)}finally{z?rr():(_=!1,R=null)}}else _=!1}var rr;if(typeof d=="function")rr=function(){d(nr)};else if(typeof MessageChannel<"u"){var Pa=new MessageChannel,Zf=Pa.port2;Pa.port1.onmessage=nr,rr=function(){Zf.postMessage(null)}}else rr=function(){T(nr,0)};function Ol(P){R=P,_||(_=!0,rr())}function Fl(P,z){I=T(function(){P(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){j||x||(j=!0,Ol(E))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(P){switch(p){case 1:case 2:case 3:var z=3;break;default:z=p}var F=p;p=z;try{return P()}finally{p=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,z){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var F=p;p=P;try{return z()}finally{p=F}},e.unstable_scheduleCallback=function(P,z,F){var se=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?se+F:se):F=se,P){case 1:var ue=-1;break;case 2:ue=250;break;case 5:ue=1073741823;break;case 4:ue=1e4;break;default:ue=5e3}return ue=F+ue,P={id:f++,callback:z,priorityLevel:P,startTime:F,expirationTime:ue,sortIndex:-1},F>se?(P.sortIndex=F,t(c,P),n(u)===null&&P===n(c)&&(g?(h(I),I=-1):g=!0,Fl(y,F-se))):(P.sortIndex=ue,t(u,P),j||x||(j=!0,Ol(E))),P},e.unstable_shouldYield=Xe,e.unstable_wrapCallback=function(P){var z=p;return function(){var F=p;p=z;try{return P.apply(this,arguments)}finally{p=F}}}})(hc);fc.exports=hc;var kh=fc.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its 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 Sh=N,Fe=kh;function k(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var pc=new Set,Pr={};function yn(e,t){Bn(e,t),Bn(e+"Capture",t)}function Bn(e,t){for(Pr[e]=t,e=0;e<t.length;e++)pc.add(t[e])}var kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vi=Object.prototype.hasOwnProperty,Nh=/^[: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]*$/,ba={},La={};function Ch(e){return vi.call(La,e)?!0:vi.call(ba,e)?!1:Nh.test(e)?La[e]=!0:(ba[e]=!0,!1)}function Eh(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $h(e,t,n,r){if(t===null||typeof t>"u"||Eh(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pe(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ye[e]=new Pe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ye[t]=new Pe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ye[e]=new Pe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ye[e]=new Pe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ye[e]=new Pe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ye[e]=new Pe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ye[e]=new Pe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ye[e]=new Pe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ye[e]=new Pe(e,5,!1,e.toLowerCase(),null,!1,!1)});var ko=/[\-:]([a-z])/g;function So(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ko,So);ye[t]=new Pe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ko,So);ye[t]=new Pe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ko,So);ye[t]=new Pe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ye[e]=new Pe(e,1,!1,e.toLowerCase(),null,!1,!1)});ye.xlinkHref=new Pe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ye[e]=new Pe(e,1,!1,e.toLowerCase(),null,!0,!0)});function No(e,t,n,r){var l=ye.hasOwnProperty(t)?ye[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($h(t,n,l,r)&&(n=null),r||l===null?Ch(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Et=Sh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,is=Symbol.for("react.element"),Nn=Symbol.for("react.portal"),Cn=Symbol.for("react.fragment"),Co=Symbol.for("react.strict_mode"),yi=Symbol.for("react.profiler"),mc=Symbol.for("react.provider"),gc=Symbol.for("react.context"),Eo=Symbol.for("react.forward_ref"),xi=Symbol.for("react.suspense"),ji=Symbol.for("react.suspense_list"),$o=Symbol.for("react.memo"),Tt=Symbol.for("react.lazy"),vc=Symbol.for("react.offscreen"),Ia=Symbol.iterator;function sr(e){return e===null||typeof e!="object"?null:(e=Ia&&e[Ia]||e["@@iterator"],typeof e=="function"?e:null)}var te=Object.assign,Wl;function fr(e){if(Wl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Wl=t&&t[1]||""}return`
34
+ `+Wl+e}var Bl=!1;function Vl(e,t){if(!e||Bl)return"";Bl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
35
+ `),i=r.stack.split(`
36
+ `),o=l.length-1,a=i.length-1;1<=o&&0<=a&&l[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(l[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||l[o]!==i[a]){var u=`
37
+ `+l[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{Bl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fr(e):""}function Ph(e){switch(e.tag){case 5:return fr(e.type);case 16:return fr("Lazy");case 13:return fr("Suspense");case 19:return fr("SuspenseList");case 0:case 2:case 15:return e=Vl(e.type,!1),e;case 11:return e=Vl(e.type.render,!1),e;case 1:return e=Vl(e.type,!0),e;default:return""}}function wi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Cn:return"Fragment";case Nn:return"Portal";case yi:return"Profiler";case Co:return"StrictMode";case xi:return"Suspense";case ji:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gc:return(e.displayName||"Context")+".Consumer";case mc:return(e._context.displayName||"Context")+".Provider";case Eo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $o:return t=e.displayName||null,t!==null?t:wi(e.type)||"Memo";case Tt:t=e._payload,e=e._init;try{return wi(e(t))}catch{}}return null}function Th(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return wi(t);case 8:return t===Co?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function yc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _h(e){var t=yc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function os(e){e._valueTracker||(e._valueTracker=_h(e))}function xc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=yc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function zs(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}}function ki(e,t){var n=t.checked;return te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Da(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function jc(e,t){t=t.checked,t!=null&&No(e,"checked",t,!1)}function Si(e,t){jc(e,t);var n=Vt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ni(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ni(e,t.type,Vt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function za(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ni(e,t,n){(t!=="number"||zs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var hr=Array.isArray;function zn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Ci(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(k(91));return te({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Oa(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(k(92));if(hr(n)){if(1<n.length)throw Error(k(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vt(n)}}function wc(e,t){var n=Vt(t.value),r=Vt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Fa(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function kc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ei(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?kc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var as,Sc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(as=as||document.createElement("div"),as.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=as.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var gr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Rh=["Webkit","ms","Moz","O"];Object.keys(gr).forEach(function(e){Rh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),gr[t]=gr[e]})});function Nc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||gr.hasOwnProperty(e)&&gr[e]?(""+t).trim():t+"px"}function Cc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Nc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var bh=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $i(e,t){if(t){if(bh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(k(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(k(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(k(61))}if(t.style!=null&&typeof t.style!="object")throw Error(k(62))}}function Pi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Ti=null;function Po(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _i=null,On=null,Fn=null;function Aa(e){if(e=qr(e)){if(typeof _i!="function")throw Error(k(280));var t=e.stateNode;t&&(t=yl(t),_i(e.stateNode,e.type,t))}}function Ec(e){On?Fn?Fn.push(e):Fn=[e]:On=e}function $c(){if(On){var e=On,t=Fn;if(Fn=On=null,Aa(e),t)for(e=0;e<t.length;e++)Aa(t[e])}}function Pc(e,t){return e(t)}function Tc(){}var Hl=!1;function _c(e,t,n){if(Hl)return e(t,n);Hl=!0;try{return Pc(e,t,n)}finally{Hl=!1,(On!==null||Fn!==null)&&(Tc(),$c())}}function _r(e,t){var n=e.stateNode;if(n===null)return null;var r=yl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(k(231,t,typeof n));return n}var Ri=!1;if(kt)try{var lr={};Object.defineProperty(lr,"passive",{get:function(){Ri=!0}}),window.addEventListener("test",lr,lr),window.removeEventListener("test",lr,lr)}catch{Ri=!1}function Lh(e,t,n,r,l,i,o,a,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var vr=!1,Os=null,Fs=!1,bi=null,Ih={onError:function(e){vr=!0,Os=e}};function Dh(e,t,n,r,l,i,o,a,u){vr=!1,Os=null,Lh.apply(Ih,arguments)}function zh(e,t,n,r,l,i,o,a,u){if(Dh.apply(this,arguments),vr){if(vr){var c=Os;vr=!1,Os=null}else throw Error(k(198));Fs||(Fs=!0,bi=c)}}function xn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Rc(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ma(e){if(xn(e)!==e)throw Error(k(188))}function Oh(e){var t=e.alternate;if(!t){if(t=xn(e),t===null)throw Error(k(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var i=l.alternate;if(i===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===i.child){for(i=l.child;i;){if(i===n)return Ma(l),e;if(i===r)return Ma(l),t;i=i.sibling}throw Error(k(188))}if(n.return!==r.return)n=l,r=i;else{for(var o=!1,a=l.child;a;){if(a===n){o=!0,n=l,r=i;break}if(a===r){o=!0,r=l,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=l;break}if(a===r){o=!0,r=i,n=l;break}a=a.sibling}if(!o)throw Error(k(189))}}if(n.alternate!==r)throw Error(k(190))}if(n.tag!==3)throw Error(k(188));return n.stateNode.current===n?e:t}function bc(e){return e=Oh(e),e!==null?Lc(e):null}function Lc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Lc(e);if(t!==null)return t;e=e.sibling}return null}var Ic=Fe.unstable_scheduleCallback,Ua=Fe.unstable_cancelCallback,Fh=Fe.unstable_shouldYield,Ah=Fe.unstable_requestPaint,le=Fe.unstable_now,Mh=Fe.unstable_getCurrentPriorityLevel,To=Fe.unstable_ImmediatePriority,Dc=Fe.unstable_UserBlockingPriority,As=Fe.unstable_NormalPriority,Uh=Fe.unstable_LowPriority,zc=Fe.unstable_IdlePriority,pl=null,dt=null;function Wh(e){if(dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(pl,e,void 0,(e.current.flags&128)===128)}catch{}}var nt=Math.clz32?Math.clz32:Hh,Bh=Math.log,Vh=Math.LN2;function Hh(e){return e>>>=0,e===0?32:31-(Bh(e)/Vh|0)|0}var us=64,cs=4194304;function pr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ms(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~l;a!==0?r=pr(a):(i&=o,i!==0&&(r=pr(i)))}else o=n&~l,o!==0?r=pr(o):i!==0&&(r=pr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-nt(t),l=1<<n,r|=e[n],t&=~l;return r}function Qh(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Kh(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-nt(i),a=1<<o,u=l[o];u===-1?(!(a&n)||a&r)&&(l[o]=Qh(a,t)):u<=t&&(e.expiredLanes|=a),i&=~a}}function Li(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Oc(){var e=us;return us<<=1,!(us&4194240)&&(us=64),e}function Ql(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-nt(t),e[t]=n}function Yh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var l=31-nt(n),i=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~i}}function _o(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nt(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var V=0;function Fc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ac,Ro,Mc,Uc,Wc,Ii=!1,ds=[],zt=null,Ot=null,Ft=null,Rr=new Map,br=new Map,Rt=[],Gh="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 submit".split(" ");function Wa(e,t){switch(e){case"focusin":case"focusout":zt=null;break;case"dragenter":case"dragleave":Ot=null;break;case"mouseover":case"mouseout":Ft=null;break;case"pointerover":case"pointerout":Rr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":br.delete(t.pointerId)}}function ir(e,t,n,r,l,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[l]},t!==null&&(t=qr(t),t!==null&&Ro(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function qh(e,t,n,r,l){switch(t){case"focusin":return zt=ir(zt,e,t,n,r,l),!0;case"dragenter":return Ot=ir(Ot,e,t,n,r,l),!0;case"mouseover":return Ft=ir(Ft,e,t,n,r,l),!0;case"pointerover":var i=l.pointerId;return Rr.set(i,ir(Rr.get(i)||null,e,t,n,r,l)),!0;case"gotpointercapture":return i=l.pointerId,br.set(i,ir(br.get(i)||null,e,t,n,r,l)),!0}return!1}function Bc(e){var t=on(e.target);if(t!==null){var n=xn(t);if(n!==null){if(t=n.tag,t===13){if(t=Rc(n),t!==null){e.blockedOn=t,Wc(e.priority,function(){Mc(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Cs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Di(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ti=r,n.target.dispatchEvent(r),Ti=null}else return t=qr(n),t!==null&&Ro(t),e.blockedOn=n,!1;t.shift()}return!0}function Ba(e,t,n){Cs(e)&&n.delete(t)}function Xh(){Ii=!1,zt!==null&&Cs(zt)&&(zt=null),Ot!==null&&Cs(Ot)&&(Ot=null),Ft!==null&&Cs(Ft)&&(Ft=null),Rr.forEach(Ba),br.forEach(Ba)}function or(e,t){e.blockedOn===t&&(e.blockedOn=null,Ii||(Ii=!0,Fe.unstable_scheduleCallback(Fe.unstable_NormalPriority,Xh)))}function Lr(e){function t(l){return or(l,e)}if(0<ds.length){or(ds[0],e);for(var n=1;n<ds.length;n++){var r=ds[n];r.blockedOn===e&&(r.blockedOn=null)}}for(zt!==null&&or(zt,e),Ot!==null&&or(Ot,e),Ft!==null&&or(Ft,e),Rr.forEach(t),br.forEach(t),n=0;n<Rt.length;n++)r=Rt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rt.length&&(n=Rt[0],n.blockedOn===null);)Bc(n),n.blockedOn===null&&Rt.shift()}var An=Et.ReactCurrentBatchConfig,Us=!0;function Jh(e,t,n,r){var l=V,i=An.transition;An.transition=null;try{V=1,bo(e,t,n,r)}finally{V=l,An.transition=i}}function Zh(e,t,n,r){var l=V,i=An.transition;An.transition=null;try{V=4,bo(e,t,n,r)}finally{V=l,An.transition=i}}function bo(e,t,n,r){if(Us){var l=Di(e,t,n,r);if(l===null)ni(e,t,r,Ws,n),Wa(e,r);else if(qh(l,e,t,n,r))r.stopPropagation();else if(Wa(e,r),t&4&&-1<Gh.indexOf(e)){for(;l!==null;){var i=qr(l);if(i!==null&&Ac(i),i=Di(e,t,n,r),i===null&&ni(e,t,r,Ws,n),i===l)break;l=i}l!==null&&r.stopPropagation()}else ni(e,t,r,null,n)}}var Ws=null;function Di(e,t,n,r){if(Ws=null,e=Po(r),e=on(e),e!==null)if(t=xn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Rc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ws=e,null}function Vc(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Mh()){case To:return 1;case Dc:return 4;case As:case Uh:return 16;case zc:return 536870912;default:return 16}default:return 16}}var Lt=null,Lo=null,Es=null;function Hc(){if(Es)return Es;var e,t=Lo,n=t.length,r,l="value"in Lt?Lt.value:Lt.textContent,i=l.length;for(e=0;e<n&&t[e]===l[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===l[i-r];r++);return Es=l.slice(e,1<r?1-r:void 0)}function $s(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function fs(){return!0}function Va(){return!1}function Me(e){function t(n,r,l,i,o){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?fs:Va,this.isPropagationStopped=Va,this}return te(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=fs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var Zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=Me(Zn),Gr=te({},Zn,{view:0,detail:0}),ep=Me(Gr),Kl,Yl,ar,ml=te({},Gr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Do,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!==ar&&(ar&&e.type==="mousemove"?(Kl=e.screenX-ar.screenX,Yl=e.screenY-ar.screenY):Yl=Kl=0,ar=e),Kl)},movementY:function(e){return"movementY"in e?e.movementY:Yl}}),Ha=Me(ml),tp=te({},ml,{dataTransfer:0}),np=Me(tp),rp=te({},Gr,{relatedTarget:0}),Gl=Me(rp),sp=te({},Zn,{animationName:0,elapsedTime:0,pseudoElement:0}),lp=Me(sp),ip=te({},Zn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),op=Me(ip),ap=te({},Zn,{data:0}),Qa=Me(ap),up={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cp={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"},dp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dp[e])?!!t[e]:!1}function Do(){return fp}var hp=te({},Gr,{key:function(e){if(e.key){var t=up[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$s(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Do,charCode:function(e){return e.type==="keypress"?$s(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$s(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pp=Me(hp),mp=te({},ml,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ka=Me(mp),gp=te({},Gr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Do}),vp=Me(gp),yp=te({},Zn,{propertyName:0,elapsedTime:0,pseudoElement:0}),xp=Me(yp),jp=te({},ml,{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}),wp=Me(jp),kp=[9,13,27,32],zo=kt&&"CompositionEvent"in window,yr=null;kt&&"documentMode"in document&&(yr=document.documentMode);var Sp=kt&&"TextEvent"in window&&!yr,Qc=kt&&(!zo||yr&&8<yr&&11>=yr),Ya=" ",Ga=!1;function Kc(e,t){switch(e){case"keyup":return kp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var En=!1;function Np(e,t){switch(e){case"compositionend":return Yc(t);case"keypress":return t.which!==32?null:(Ga=!0,Ya);case"textInput":return e=t.data,e===Ya&&Ga?null:e;default:return null}}function Cp(e,t){if(En)return e==="compositionend"||!zo&&Kc(e,t)?(e=Hc(),Es=Lo=Lt=null,En=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Qc&&t.locale!=="ko"?null:t.data;default:return null}}var Ep={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 qa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ep[e.type]:t==="textarea"}function Gc(e,t,n,r){Ec(r),t=Bs(t,"onChange"),0<t.length&&(n=new Io("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xr=null,Ir=null;function $p(e){id(e,0)}function gl(e){var t=Tn(e);if(xc(t))return e}function Pp(e,t){if(e==="change")return t}var qc=!1;if(kt){var ql;if(kt){var Xl="oninput"in document;if(!Xl){var Xa=document.createElement("div");Xa.setAttribute("oninput","return;"),Xl=typeof Xa.oninput=="function"}ql=Xl}else ql=!1;qc=ql&&(!document.documentMode||9<document.documentMode)}function Ja(){xr&&(xr.detachEvent("onpropertychange",Xc),Ir=xr=null)}function Xc(e){if(e.propertyName==="value"&&gl(Ir)){var t=[];Gc(t,Ir,e,Po(e)),_c($p,t)}}function Tp(e,t,n){e==="focusin"?(Ja(),xr=t,Ir=n,xr.attachEvent("onpropertychange",Xc)):e==="focusout"&&Ja()}function _p(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gl(Ir)}function Rp(e,t){if(e==="click")return gl(t)}function bp(e,t){if(e==="input"||e==="change")return gl(t)}function Lp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var st=typeof Object.is=="function"?Object.is:Lp;function Dr(e,t){if(st(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!vi.call(t,l)||!st(e[l],t[l]))return!1}return!0}function Za(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eu(e,t){var n=Za(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Za(n)}}function Jc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zc(){for(var e=window,t=zs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=zs(e.document)}return t}function Oo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Ip(e){var t=Zc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Jc(n.ownerDocument.documentElement,n)){if(r!==null&&Oo(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=eu(n,i);var o=eu(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Dp=kt&&"documentMode"in document&&11>=document.documentMode,$n=null,zi=null,jr=null,Oi=!1;function tu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Oi||$n==null||$n!==zs(r)||(r=$n,"selectionStart"in r&&Oo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Dr(jr,r)||(jr=r,r=Bs(zi,"onSelect"),0<r.length&&(t=new Io("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=$n)))}function hs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Pn={animationend:hs("Animation","AnimationEnd"),animationiteration:hs("Animation","AnimationIteration"),animationstart:hs("Animation","AnimationStart"),transitionend:hs("Transition","TransitionEnd")},Jl={},ed={};kt&&(ed=document.createElement("div").style,"AnimationEvent"in window||(delete Pn.animationend.animation,delete Pn.animationiteration.animation,delete Pn.animationstart.animation),"TransitionEvent"in window||delete Pn.transitionend.transition);function vl(e){if(Jl[e])return Jl[e];if(!Pn[e])return e;var t=Pn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ed)return Jl[e]=t[n];return e}var td=vl("animationend"),nd=vl("animationiteration"),rd=vl("animationstart"),sd=vl("transitionend"),ld=new Map,nu="abort auxClick 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(" ");function Gt(e,t){ld.set(e,t),yn(t,[e])}for(var Zl=0;Zl<nu.length;Zl++){var ei=nu[Zl],zp=ei.toLowerCase(),Op=ei[0].toUpperCase()+ei.slice(1);Gt(zp,"on"+Op)}Gt(td,"onAnimationEnd");Gt(nd,"onAnimationIteration");Gt(rd,"onAnimationStart");Gt("dblclick","onDoubleClick");Gt("focusin","onFocus");Gt("focusout","onBlur");Gt(sd,"onTransitionEnd");Bn("onMouseEnter",["mouseout","mouseover"]);Bn("onMouseLeave",["mouseout","mouseover"]);Bn("onPointerEnter",["pointerout","pointerover"]);Bn("onPointerLeave",["pointerout","pointerover"]);yn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yn("onBeforeInput",["compositionend","keypress","textInput","paste"]);yn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mr="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(" "),Fp=new Set("cancel close invalid load scroll toggle".split(" ").concat(mr));function ru(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,zh(r,t,void 0,e),e.currentTarget=null}function id(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],u=a.instance,c=a.currentTarget;if(a=a.listener,u!==i&&l.isPropagationStopped())break e;ru(l,a,c),i=u}else for(o=0;o<r.length;o++){if(a=r[o],u=a.instance,c=a.currentTarget,a=a.listener,u!==i&&l.isPropagationStopped())break e;ru(l,a,c),i=u}}}if(Fs)throw e=bi,Fs=!1,bi=null,e}function K(e,t){var n=t[Wi];n===void 0&&(n=t[Wi]=new Set);var r=e+"__bubble";n.has(r)||(od(t,e,2,!1),n.add(r))}function ti(e,t,n){var r=0;t&&(r|=4),od(n,e,r,t)}var ps="_reactListening"+Math.random().toString(36).slice(2);function zr(e){if(!e[ps]){e[ps]=!0,pc.forEach(function(n){n!=="selectionchange"&&(Fp.has(n)||ti(n,!1,e),ti(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ps]||(t[ps]=!0,ti("selectionchange",!1,t))}}function od(e,t,n,r){switch(Vc(t)){case 1:var l=Jh;break;case 4:l=Zh;break;default:l=bo}n=l.bind(null,t,n,e),l=void 0,!Ri||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function ni(e,t,n,r,l){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===l||a.nodeType===8&&a.parentNode===l)break;if(o===4)for(o=r.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;o=o.return}for(;a!==null;){if(o=on(a),o===null)return;if(u=o.tag,u===5||u===6){r=i=o;continue e}a=a.parentNode}}r=r.return}_c(function(){var c=i,f=Po(n),v=[];e:{var p=ld.get(e);if(p!==void 0){var x=Io,j=e;switch(e){case"keypress":if($s(n)===0)break e;case"keydown":case"keyup":x=pp;break;case"focusin":j="focus",x=Gl;break;case"focusout":j="blur",x=Gl;break;case"beforeblur":case"afterblur":x=Gl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Ha;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=np;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=vp;break;case td:case nd:case rd:x=lp;break;case sd:x=xp;break;case"scroll":x=ep;break;case"wheel":x=wp;break;case"copy":case"cut":case"paste":x=op;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Ka}var g=(t&4)!==0,T=!g&&e==="scroll",h=g?p!==null?p+"Capture":null:p;g=[];for(var d=c,m;d!==null;){m=d;var y=m.stateNode;if(m.tag===5&&y!==null&&(m=y,h!==null&&(y=_r(d,h),y!=null&&g.push(Or(d,y,m)))),T)break;d=d.return}0<g.length&&(p=new x(p,j,null,n,f),v.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",p&&n!==Ti&&(j=n.relatedTarget||n.fromElement)&&(on(j)||j[St]))break e;if((x||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,x?(j=n.relatedTarget||n.toElement,x=c,j=j?on(j):null,j!==null&&(T=xn(j),j!==T||j.tag!==5&&j.tag!==6)&&(j=null)):(x=null,j=c),x!==j)){if(g=Ha,y="onMouseLeave",h="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(g=Ka,y="onPointerLeave",h="onPointerEnter",d="pointer"),T=x==null?p:Tn(x),m=j==null?p:Tn(j),p=new g(y,d+"leave",x,n,f),p.target=T,p.relatedTarget=m,y=null,on(f)===c&&(g=new g(h,d+"enter",j,n,f),g.target=m,g.relatedTarget=T,y=g),T=y,x&&j)t:{for(g=x,h=j,d=0,m=g;m;m=kn(m))d++;for(m=0,y=h;y;y=kn(y))m++;for(;0<d-m;)g=kn(g),d--;for(;0<m-d;)h=kn(h),m--;for(;d--;){if(g===h||h!==null&&g===h.alternate)break t;g=kn(g),h=kn(h)}g=null}else g=null;x!==null&&su(v,p,x,g,!1),j!==null&&T!==null&&su(v,T,j,g,!0)}}e:{if(p=c?Tn(c):window,x=p.nodeName&&p.nodeName.toLowerCase(),x==="select"||x==="input"&&p.type==="file")var E=Pp;else if(qa(p))if(qc)E=bp;else{E=_p;var _=Tp}else(x=p.nodeName)&&x.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(E=Rp);if(E&&(E=E(e,c))){Gc(v,E,n,f);break e}_&&_(e,p,c),e==="focusout"&&(_=p._wrapperState)&&_.controlled&&p.type==="number"&&Ni(p,"number",p.value)}switch(_=c?Tn(c):window,e){case"focusin":(qa(_)||_.contentEditable==="true")&&($n=_,zi=c,jr=null);break;case"focusout":jr=zi=$n=null;break;case"mousedown":Oi=!0;break;case"contextmenu":case"mouseup":case"dragend":Oi=!1,tu(v,n,f);break;case"selectionchange":if(Dp)break;case"keydown":case"keyup":tu(v,n,f)}var R;if(zo)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else En?Kc(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(Qc&&n.locale!=="ko"&&(En||I!=="onCompositionStart"?I==="onCompositionEnd"&&En&&(R=Hc()):(Lt=f,Lo="value"in Lt?Lt.value:Lt.textContent,En=!0)),_=Bs(c,I),0<_.length&&(I=new Qa(I,e,null,n,f),v.push({event:I,listeners:_}),R?I.data=R:(R=Yc(n),R!==null&&(I.data=R)))),(R=Sp?Np(e,n):Cp(e,n))&&(c=Bs(c,"onBeforeInput"),0<c.length&&(f=new Qa("onBeforeInput","beforeinput",null,n,f),v.push({event:f,listeners:c}),f.data=R))}id(v,t)})}function Or(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Bs(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,i=l.stateNode;l.tag===5&&i!==null&&(l=i,i=_r(e,n),i!=null&&r.unshift(Or(e,i,l)),i=_r(e,t),i!=null&&r.push(Or(e,i,l))),e=e.return}return r}function kn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function su(e,t,n,r,l){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,u=a.alternate,c=a.stateNode;if(u!==null&&u===r)break;a.tag===5&&c!==null&&(a=c,l?(u=_r(n,i),u!=null&&o.unshift(Or(n,u,a))):l||(u=_r(n,i),u!=null&&o.push(Or(n,u,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Ap=/\r\n?/g,Mp=/\u0000|\uFFFD/g;function lu(e){return(typeof e=="string"?e:""+e).replace(Ap,`
38
+ `).replace(Mp,"")}function ms(e,t,n){if(t=lu(t),lu(e)!==t&&n)throw Error(k(425))}function Vs(){}var Fi=null,Ai=null;function Mi(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ui=typeof setTimeout=="function"?setTimeout:void 0,Up=typeof clearTimeout=="function"?clearTimeout:void 0,iu=typeof Promise=="function"?Promise:void 0,Wp=typeof queueMicrotask=="function"?queueMicrotask:typeof iu<"u"?function(e){return iu.resolve(null).then(e).catch(Bp)}:Ui;function Bp(e){setTimeout(function(){throw e})}function ri(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),Lr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);Lr(t)}function At(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ou(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var er=Math.random().toString(36).slice(2),ot="__reactFiber$"+er,Fr="__reactProps$"+er,St="__reactContainer$"+er,Wi="__reactEvents$"+er,Vp="__reactListeners$"+er,Hp="__reactHandles$"+er;function on(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[St]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ou(e);e!==null;){if(n=e[ot])return n;e=ou(e)}return t}e=n,n=e.parentNode}return null}function qr(e){return e=e[ot]||e[St],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Tn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(k(33))}function yl(e){return e[Fr]||null}var Bi=[],_n=-1;function qt(e){return{current:e}}function Y(e){0>_n||(e.current=Bi[_n],Bi[_n]=null,_n--)}function Q(e,t){_n++,Bi[_n]=e.current,e.current=t}var Ht={},Se=qt(Ht),Re=qt(!1),fn=Ht;function Vn(e,t){var n=e.type.contextTypes;if(!n)return Ht;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function be(e){return e=e.childContextTypes,e!=null}function Hs(){Y(Re),Y(Se)}function au(e,t,n){if(Se.current!==Ht)throw Error(k(168));Q(Se,t),Q(Re,n)}function ad(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(k(108,Th(e)||"Unknown",l));return te({},n,r)}function Qs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,fn=Se.current,Q(Se,e),Q(Re,Re.current),!0}function uu(e,t,n){var r=e.stateNode;if(!r)throw Error(k(169));n?(e=ad(e,t,fn),r.__reactInternalMemoizedMergedChildContext=e,Y(Re),Y(Se),Q(Se,e)):Y(Re),Q(Re,n)}var gt=null,xl=!1,si=!1;function ud(e){gt===null?gt=[e]:gt.push(e)}function Qp(e){xl=!0,ud(e)}function Xt(){if(!si&&gt!==null){si=!0;var e=0,t=V;try{var n=gt;for(V=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}gt=null,xl=!1}catch(l){throw gt!==null&&(gt=gt.slice(e+1)),Ic(To,Xt),l}finally{V=t,si=!1}}return null}var Rn=[],bn=0,Ks=null,Ys=0,We=[],Be=0,hn=null,vt=1,yt="";function sn(e,t){Rn[bn++]=Ys,Rn[bn++]=Ks,Ks=e,Ys=t}function cd(e,t,n){We[Be++]=vt,We[Be++]=yt,We[Be++]=hn,hn=e;var r=vt;e=yt;var l=32-nt(r)-1;r&=~(1<<l),n+=1;var i=32-nt(t)+l;if(30<i){var o=l-l%5;i=(r&(1<<o)-1).toString(32),r>>=o,l-=o,vt=1<<32-nt(t)+l|n<<l|r,yt=i+e}else vt=1<<i|n<<l|r,yt=e}function Fo(e){e.return!==null&&(sn(e,1),cd(e,1,0))}function Ao(e){for(;e===Ks;)Ks=Rn[--bn],Rn[bn]=null,Ys=Rn[--bn],Rn[bn]=null;for(;e===hn;)hn=We[--Be],We[Be]=null,yt=We[--Be],We[Be]=null,vt=We[--Be],We[Be]=null}var Oe=null,ze=null,G=!1,tt=null;function dd(e,t){var n=Ve(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function cu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Oe=e,ze=At(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Oe=e,ze=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=hn!==null?{id:vt,overflow:yt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ve(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Oe=e,ze=null,!0):!1;default:return!1}}function Vi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Hi(e){if(G){var t=ze;if(t){var n=t;if(!cu(e,t)){if(Vi(e))throw Error(k(418));t=At(n.nextSibling);var r=Oe;t&&cu(e,t)?dd(r,n):(e.flags=e.flags&-4097|2,G=!1,Oe=e)}}else{if(Vi(e))throw Error(k(418));e.flags=e.flags&-4097|2,G=!1,Oe=e}}}function du(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Oe=e}function gs(e){if(e!==Oe)return!1;if(!G)return du(e),G=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Mi(e.type,e.memoizedProps)),t&&(t=ze)){if(Vi(e))throw fd(),Error(k(418));for(;t;)dd(e,t),t=At(t.nextSibling)}if(du(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(k(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ze=At(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ze=null}}else ze=Oe?At(e.stateNode.nextSibling):null;return!0}function fd(){for(var e=ze;e;)e=At(e.nextSibling)}function Hn(){ze=Oe=null,G=!1}function Mo(e){tt===null?tt=[e]:tt.push(e)}var Kp=Et.ReactCurrentBatchConfig;function ur(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(k(309));var r=n.stateNode}if(!r)throw Error(k(147,e));var l=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=l.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(k(284));if(!n._owner)throw Error(k(290,e))}return e}function vs(e,t){throw e=Object.prototype.toString.call(t),Error(k(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fu(e){var t=e._init;return t(e._payload)}function hd(e){function t(h,d){if(e){var m=h.deletions;m===null?(h.deletions=[d],h.flags|=16):m.push(d)}}function n(h,d){if(!e)return null;for(;d!==null;)t(h,d),d=d.sibling;return null}function r(h,d){for(h=new Map;d!==null;)d.key!==null?h.set(d.key,d):h.set(d.index,d),d=d.sibling;return h}function l(h,d){return h=Bt(h,d),h.index=0,h.sibling=null,h}function i(h,d,m){return h.index=m,e?(m=h.alternate,m!==null?(m=m.index,m<d?(h.flags|=2,d):m):(h.flags|=2,d)):(h.flags|=1048576,d)}function o(h){return e&&h.alternate===null&&(h.flags|=2),h}function a(h,d,m,y){return d===null||d.tag!==6?(d=di(m,h.mode,y),d.return=h,d):(d=l(d,m),d.return=h,d)}function u(h,d,m,y){var E=m.type;return E===Cn?f(h,d,m.props.children,y,m.key):d!==null&&(d.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Tt&&fu(E)===d.type)?(y=l(d,m.props),y.ref=ur(h,d,m),y.return=h,y):(y=Is(m.type,m.key,m.props,null,h.mode,y),y.ref=ur(h,d,m),y.return=h,y)}function c(h,d,m,y){return d===null||d.tag!==4||d.stateNode.containerInfo!==m.containerInfo||d.stateNode.implementation!==m.implementation?(d=fi(m,h.mode,y),d.return=h,d):(d=l(d,m.children||[]),d.return=h,d)}function f(h,d,m,y,E){return d===null||d.tag!==7?(d=dn(m,h.mode,y,E),d.return=h,d):(d=l(d,m),d.return=h,d)}function v(h,d,m){if(typeof d=="string"&&d!==""||typeof d=="number")return d=di(""+d,h.mode,m),d.return=h,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case is:return m=Is(d.type,d.key,d.props,null,h.mode,m),m.ref=ur(h,null,d),m.return=h,m;case Nn:return d=fi(d,h.mode,m),d.return=h,d;case Tt:var y=d._init;return v(h,y(d._payload),m)}if(hr(d)||sr(d))return d=dn(d,h.mode,m,null),d.return=h,d;vs(h,d)}return null}function p(h,d,m,y){var E=d!==null?d.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return E!==null?null:a(h,d,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case is:return m.key===E?u(h,d,m,y):null;case Nn:return m.key===E?c(h,d,m,y):null;case Tt:return E=m._init,p(h,d,E(m._payload),y)}if(hr(m)||sr(m))return E!==null?null:f(h,d,m,y,null);vs(h,m)}return null}function x(h,d,m,y,E){if(typeof y=="string"&&y!==""||typeof y=="number")return h=h.get(m)||null,a(d,h,""+y,E);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case is:return h=h.get(y.key===null?m:y.key)||null,u(d,h,y,E);case Nn:return h=h.get(y.key===null?m:y.key)||null,c(d,h,y,E);case Tt:var _=y._init;return x(h,d,m,_(y._payload),E)}if(hr(y)||sr(y))return h=h.get(m)||null,f(d,h,y,E,null);vs(d,y)}return null}function j(h,d,m,y){for(var E=null,_=null,R=d,I=d=0,re=null;R!==null&&I<m.length;I++){R.index>I?(re=R,R=null):re=R.sibling;var M=p(h,R,m[I],y);if(M===null){R===null&&(R=re);break}e&&R&&M.alternate===null&&t(h,R),d=i(M,d,I),_===null?E=M:_.sibling=M,_=M,R=re}if(I===m.length)return n(h,R),G&&sn(h,I),E;if(R===null){for(;I<m.length;I++)R=v(h,m[I],y),R!==null&&(d=i(R,d,I),_===null?E=R:_.sibling=R,_=R);return G&&sn(h,I),E}for(R=r(h,R);I<m.length;I++)re=x(R,h,I,m[I],y),re!==null&&(e&&re.alternate!==null&&R.delete(re.key===null?I:re.key),d=i(re,d,I),_===null?E=re:_.sibling=re,_=re);return e&&R.forEach(function(Xe){return t(h,Xe)}),G&&sn(h,I),E}function g(h,d,m,y){var E=sr(m);if(typeof E!="function")throw Error(k(150));if(m=E.call(m),m==null)throw Error(k(151));for(var _=E=null,R=d,I=d=0,re=null,M=m.next();R!==null&&!M.done;I++,M=m.next()){R.index>I?(re=R,R=null):re=R.sibling;var Xe=p(h,R,M.value,y);if(Xe===null){R===null&&(R=re);break}e&&R&&Xe.alternate===null&&t(h,R),d=i(Xe,d,I),_===null?E=Xe:_.sibling=Xe,_=Xe,R=re}if(M.done)return n(h,R),G&&sn(h,I),E;if(R===null){for(;!M.done;I++,M=m.next())M=v(h,M.value,y),M!==null&&(d=i(M,d,I),_===null?E=M:_.sibling=M,_=M);return G&&sn(h,I),E}for(R=r(h,R);!M.done;I++,M=m.next())M=x(R,h,I,M.value,y),M!==null&&(e&&M.alternate!==null&&R.delete(M.key===null?I:M.key),d=i(M,d,I),_===null?E=M:_.sibling=M,_=M);return e&&R.forEach(function(nr){return t(h,nr)}),G&&sn(h,I),E}function T(h,d,m,y){if(typeof m=="object"&&m!==null&&m.type===Cn&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case is:e:{for(var E=m.key,_=d;_!==null;){if(_.key===E){if(E=m.type,E===Cn){if(_.tag===7){n(h,_.sibling),d=l(_,m.props.children),d.return=h,h=d;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Tt&&fu(E)===_.type){n(h,_.sibling),d=l(_,m.props),d.ref=ur(h,_,m),d.return=h,h=d;break e}n(h,_);break}else t(h,_);_=_.sibling}m.type===Cn?(d=dn(m.props.children,h.mode,y,m.key),d.return=h,h=d):(y=Is(m.type,m.key,m.props,null,h.mode,y),y.ref=ur(h,d,m),y.return=h,h=y)}return o(h);case Nn:e:{for(_=m.key;d!==null;){if(d.key===_)if(d.tag===4&&d.stateNode.containerInfo===m.containerInfo&&d.stateNode.implementation===m.implementation){n(h,d.sibling),d=l(d,m.children||[]),d.return=h,h=d;break e}else{n(h,d);break}else t(h,d);d=d.sibling}d=fi(m,h.mode,y),d.return=h,h=d}return o(h);case Tt:return _=m._init,T(h,d,_(m._payload),y)}if(hr(m))return j(h,d,m,y);if(sr(m))return g(h,d,m,y);vs(h,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,d!==null&&d.tag===6?(n(h,d.sibling),d=l(d,m),d.return=h,h=d):(n(h,d),d=di(m,h.mode,y),d.return=h,h=d),o(h)):n(h,d)}return T}var Qn=hd(!0),pd=hd(!1),Gs=qt(null),qs=null,Ln=null,Uo=null;function Wo(){Uo=Ln=qs=null}function Bo(e){var t=Gs.current;Y(Gs),e._currentValue=t}function Qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Mn(e,t){qs=e,Uo=Ln=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_e=!0),e.firstContext=null)}function Ye(e){var t=e._currentValue;if(Uo!==e)if(e={context:e,memoizedValue:t,next:null},Ln===null){if(qs===null)throw Error(k(308));Ln=e,qs.dependencies={lanes:0,firstContext:e}}else Ln=Ln.next=e;return t}var an=null;function Vo(e){an===null?an=[e]:an.push(e)}function md(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Vo(t)):(n.next=l.next,l.next=n),t.interleaved=n,Nt(e,r)}function Nt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _t=!1;function Ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function xt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,B&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Nt(e,n)}return l=r.interleaved,l===null?(t.next=t,Vo(r)):(t.next=l.next,l.next=t),r.interleaved=t,Nt(e,n)}function Ps(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_o(e,n)}}function hu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xs(e,t,n,r){var l=e.updateQueue;_t=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,c=u.next;u.next=null,o===null?i=c:o.next=c,o=u;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==o&&(a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=u))}if(i!==null){var v=l.baseState;o=0,f=c=u=null,a=i;do{var p=a.lane,x=a.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:x,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var j=e,g=a;switch(p=t,x=n,g.tag){case 1:if(j=g.payload,typeof j=="function"){v=j.call(x,v,p);break e}v=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=g.payload,p=typeof j=="function"?j.call(x,v,p):j,p==null)break e;v=te({},v,p);break e;case 2:_t=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=l.effects,p===null?l.effects=[a]:p.push(a))}else x={eventTime:x,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(c=f=x,u=v):f=f.next=x,o|=p;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;p=a,a=p.next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}}while(!0);if(f===null&&(u=v),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=f,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);mn|=o,e.lanes=o,e.memoizedState=v}}function pu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(k(191,l));l.call(r)}}}var Xr={},ft=qt(Xr),Ar=qt(Xr),Mr=qt(Xr);function un(e){if(e===Xr)throw Error(k(174));return e}function Qo(e,t){switch(Q(Mr,t),Q(Ar,e),Q(ft,Xr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ei(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ei(t,e)}Y(ft),Q(ft,t)}function Kn(){Y(ft),Y(Ar),Y(Mr)}function vd(e){un(Mr.current);var t=un(ft.current),n=Ei(t,e.type);t!==n&&(Q(Ar,e),Q(ft,n))}function Ko(e){Ar.current===e&&(Y(ft),Y(Ar))}var Z=qt(0);function Js(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var li=[];function Yo(){for(var e=0;e<li.length;e++)li[e]._workInProgressVersionPrimary=null;li.length=0}var Ts=Et.ReactCurrentDispatcher,ii=Et.ReactCurrentBatchConfig,pn=0,ee=null,oe=null,ce=null,Zs=!1,wr=!1,Ur=0,Yp=0;function je(){throw Error(k(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!st(e[n],t[n]))return!1;return!0}function qo(e,t,n,r,l,i){if(pn=i,ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ts.current=e===null||e.memoizedState===null?Jp:Zp,e=n(r,l),wr){i=0;do{if(wr=!1,Ur=0,25<=i)throw Error(k(301));i+=1,ce=oe=null,t.updateQueue=null,Ts.current=em,e=n(r,l)}while(wr)}if(Ts.current=el,t=oe!==null&&oe.next!==null,pn=0,ce=oe=ee=null,Zs=!1,t)throw Error(k(300));return e}function Xo(){var e=Ur!==0;return Ur=0,e}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ce===null?ee.memoizedState=ce=e:ce=ce.next=e,ce}function Ge(){if(oe===null){var e=ee.alternate;e=e!==null?e.memoizedState:null}else e=oe.next;var t=ce===null?ee.memoizedState:ce.next;if(t!==null)ce=t,oe=e;else{if(e===null)throw Error(k(310));oe=e,e={memoizedState:oe.memoizedState,baseState:oe.baseState,baseQueue:oe.baseQueue,queue:oe.queue,next:null},ce===null?ee.memoizedState=ce=e:ce=ce.next=e}return ce}function Wr(e,t){return typeof t=="function"?t(e):t}function oi(e){var t=Ge(),n=t.queue;if(n===null)throw Error(k(311));n.lastRenderedReducer=e;var r=oe,l=r.baseQueue,i=n.pending;if(i!==null){if(l!==null){var o=l.next;l.next=i.next,i.next=o}r.baseQueue=l=i,n.pending=null}if(l!==null){i=l.next,r=r.baseState;var a=o=null,u=null,c=i;do{var f=c.lane;if((pn&f)===f)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var v={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(a=u=v,o=r):u=u.next=v,ee.lanes|=f,mn|=f}c=c.next}while(c!==null&&c!==i);u===null?o=r:u.next=a,st(r,t.memoizedState)||(_e=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do i=l.lane,ee.lanes|=i,mn|=i,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ai(e){var t=Ge(),n=t.queue;if(n===null)throw Error(k(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,i=t.memoizedState;if(l!==null){n.pending=null;var o=l=l.next;do i=e(i,o.action),o=o.next;while(o!==l);st(i,t.memoizedState)||(_e=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function yd(){}function xd(e,t){var n=ee,r=Ge(),l=t(),i=!st(r.memoizedState,l);if(i&&(r.memoizedState=l,_e=!0),r=r.queue,Jo(kd.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ce!==null&&ce.memoizedState.tag&1){if(n.flags|=2048,Br(9,wd.bind(null,n,r,l,t),void 0,null),pe===null)throw Error(k(349));pn&30||jd(n,t,l)}return l}function jd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ee.updateQueue,t===null?(t={lastEffect:null,stores:null},ee.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wd(e,t,n,r){t.value=n,t.getSnapshot=r,Sd(t)&&Nd(e)}function kd(e,t,n){return n(function(){Sd(t)&&Nd(e)})}function Sd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!st(e,n)}catch{return!0}}function Nd(e){var t=Nt(e,1);t!==null&&rt(t,e,1,-1)}function mu(e){var t=it();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:e},t.queue=e,e=e.dispatch=Xp.bind(null,ee,e),[t.memoizedState,e]}function Br(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ee.updateQueue,t===null?(t={lastEffect:null,stores:null},ee.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Cd(){return Ge().memoizedState}function _s(e,t,n,r){var l=it();ee.flags|=e,l.memoizedState=Br(1|t,n,void 0,r===void 0?null:r)}function jl(e,t,n,r){var l=Ge();r=r===void 0?null:r;var i=void 0;if(oe!==null){var o=oe.memoizedState;if(i=o.destroy,r!==null&&Go(r,o.deps)){l.memoizedState=Br(t,n,i,r);return}}ee.flags|=e,l.memoizedState=Br(1|t,n,i,r)}function gu(e,t){return _s(8390656,8,e,t)}function Jo(e,t){return jl(2048,8,e,t)}function Ed(e,t){return jl(4,2,e,t)}function $d(e,t){return jl(4,4,e,t)}function Pd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Td(e,t,n){return n=n!=null?n.concat([e]):null,jl(4,4,Pd.bind(null,t,e),n)}function Zo(){}function _d(e,t){var n=Ge();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Rd(e,t){var n=Ge();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Go(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function bd(e,t,n){return pn&21?(st(n,t)||(n=Oc(),ee.lanes|=n,mn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_e=!0),e.memoizedState=n)}function Gp(e,t){var n=V;V=n!==0&&4>n?n:4,e(!0);var r=ii.transition;ii.transition={};try{e(!1),t()}finally{V=n,ii.transition=r}}function Ld(){return Ge().memoizedState}function qp(e,t,n){var r=Wt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Id(e))Dd(t,n);else if(n=md(e,t,n,r),n!==null){var l=Ce();rt(n,e,r,l),zd(n,t,r)}}function Xp(e,t,n){var r=Wt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Id(e))Dd(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(l.hasEagerState=!0,l.eagerState=a,st(a,o)){var u=t.interleaved;u===null?(l.next=l,Vo(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=md(e,t,l,r),n!==null&&(l=Ce(),rt(n,e,r,l),zd(n,t,r))}}function Id(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function Dd(e,t){wr=Zs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_o(e,n)}}var el={readContext:Ye,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},Jp={readContext:Ye,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:Ye,useEffect:gu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_s(4194308,4,Pd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){return _s(4,2,e,t)},useMemo:function(e,t){var n=it();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=it();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qp.bind(null,ee,e),[r.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:mu,useDebugValue:Zo,useDeferredValue:function(e){return it().memoizedState=e},useTransition:function(){var e=mu(!1),t=e[0];return e=Gp.bind(null,e[1]),it().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ee,l=it();if(G){if(n===void 0)throw Error(k(407));n=n()}else{if(n=t(),pe===null)throw Error(k(349));pn&30||jd(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,gu(kd.bind(null,r,i,e),[e]),r.flags|=2048,Br(9,wd.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=it(),t=pe.identifierPrefix;if(G){var n=yt,r=vt;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ur++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Yp++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Zp={readContext:Ye,useCallback:_d,useContext:Ye,useEffect:Jo,useImperativeHandle:Td,useInsertionEffect:Ed,useLayoutEffect:$d,useMemo:Rd,useReducer:oi,useRef:Cd,useState:function(){return oi(Wr)},useDebugValue:Zo,useDeferredValue:function(e){var t=Ge();return bd(t,oe.memoizedState,e)},useTransition:function(){var e=oi(Wr)[0],t=Ge().memoizedState;return[e,t]},useMutableSource:yd,useSyncExternalStore:xd,useId:Ld,unstable_isNewReconciler:!1},em={readContext:Ye,useCallback:_d,useContext:Ye,useEffect:Jo,useImperativeHandle:Td,useInsertionEffect:Ed,useLayoutEffect:$d,useMemo:Rd,useReducer:ai,useRef:Cd,useState:function(){return ai(Wr)},useDebugValue:Zo,useDeferredValue:function(e){var t=Ge();return oe===null?t.memoizedState=e:bd(t,oe.memoizedState,e)},useTransition:function(){var e=ai(Wr)[0],t=Ge().memoizedState;return[e,t]},useMutableSource:yd,useSyncExternalStore:xd,useId:Ld,unstable_isNewReconciler:!1};function Ze(e,t){if(e&&e.defaultProps){t=te({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ki(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:te({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wl={isMounted:function(e){return(e=e._reactInternals)?xn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ce(),l=Wt(e),i=xt(r,l);i.payload=t,n!=null&&(i.callback=n),t=Mt(e,i,l),t!==null&&(rt(t,e,l,r),Ps(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ce(),l=Wt(e),i=xt(r,l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Mt(e,i,l),t!==null&&(rt(t,e,l,r),Ps(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ce(),r=Wt(e),l=xt(n,r);l.tag=2,t!=null&&(l.callback=t),t=Mt(e,l,r),t!==null&&(rt(t,e,r,n),Ps(t,e,r))}};function vu(e,t,n,r,l,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Dr(n,r)||!Dr(l,i):!0}function Od(e,t,n){var r=!1,l=Ht,i=t.contextType;return typeof i=="object"&&i!==null?i=Ye(i):(l=be(t)?fn:Se.current,r=t.contextTypes,i=(r=r!=null)?Vn(e,l):Ht),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=wl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=i),t}function yu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&wl.enqueueReplaceState(t,t.state,null)}function Yi(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Ho(e);var i=t.contextType;typeof i=="object"&&i!==null?l.context=Ye(i):(i=be(t)?fn:Se.current,l.context=Vn(e,i)),l.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ki(e,t,i,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&wl.enqueueReplaceState(l,l.state,null),Xs(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Yn(e,t){try{var n="",r=t;do n+=Ph(r),r=r.return;while(r);var l=n}catch(i){l=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:l,digest:null}}function ui(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Gi(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var tm=typeof WeakMap=="function"?WeakMap:Map;function Fd(e,t,n){n=xt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){nl||(nl=!0,lo=r),Gi(e,t)},n}function Ad(e,t,n){n=xt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Gi(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Gi(e,t),typeof r!="function"&&(Ut===null?Ut=new Set([this]):Ut.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function xu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new tm;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=mm.bind(null,e,t,n),t.then(e,e))}function ju(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function wu(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=xt(-1,1),t.tag=2,Mt(n,t,1))),n.lanes|=1),e)}var nm=Et.ReactCurrentOwner,_e=!1;function Ne(e,t,n,r){t.child=e===null?pd(t,null,n,r):Qn(t,e.child,n,r)}function ku(e,t,n,r,l){n=n.render;var i=t.ref;return Mn(t,l),r=qo(e,t,n,r,i,l),n=Xo(),e!==null&&!_e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ct(e,t,l)):(G&&n&&Fo(t),t.flags|=1,Ne(e,t,r,l),t.child)}function Su(e,t,n,r,l){if(e===null){var i=n.type;return typeof i=="function"&&!oa(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Md(e,t,i,r,l)):(e=Is(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&l)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Dr,n(o,r)&&e.ref===t.ref)return Ct(e,t,l)}return t.flags|=1,e=Bt(i,r),e.ref=t.ref,e.return=t,t.child=e}function Md(e,t,n,r,l){if(e!==null){var i=e.memoizedProps;if(Dr(i,r)&&e.ref===t.ref)if(_e=!1,t.pendingProps=r=i,(e.lanes&l)!==0)e.flags&131072&&(_e=!0);else return t.lanes=e.lanes,Ct(e,t,l)}return qi(e,t,n,r,l)}function Ud(e,t,n){var r=t.pendingProps,l=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Q(Dn,De),De|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Q(Dn,De),De|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Q(Dn,De),De|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Q(Dn,De),De|=r;return Ne(e,t,l,n),t.child}function Wd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function qi(e,t,n,r,l){var i=be(n)?fn:Se.current;return i=Vn(t,i),Mn(t,l),n=qo(e,t,n,r,i,l),r=Xo(),e!==null&&!_e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ct(e,t,l)):(G&&r&&Fo(t),t.flags|=1,Ne(e,t,n,l),t.child)}function Nu(e,t,n,r,l){if(be(n)){var i=!0;Qs(t)}else i=!1;if(Mn(t,l),t.stateNode===null)Rs(e,t),Od(t,n,r),Yi(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var u=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ye(c):(c=be(n)?fn:Se.current,c=Vn(t,c));var f=n.getDerivedStateFromProps,v=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";v||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||u!==c)&&yu(t,o,r,c),_t=!1;var p=t.memoizedState;o.state=p,Xs(t,r,o,l),u=t.memoizedState,a!==r||p!==u||Re.current||_t?(typeof f=="function"&&(Ki(t,n,f,r),u=t.memoizedState),(a=_t||vu(t,n,a,r,p,u,c))?(v||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,gd(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Ze(t.type,a),o.props=c,v=t.pendingProps,p=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ye(u):(u=be(n)?fn:Se.current,u=Vn(t,u));var x=n.getDerivedStateFromProps;(f=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==v||p!==u)&&yu(t,o,r,u),_t=!1,p=t.memoizedState,o.state=p,Xs(t,r,o,l);var j=t.memoizedState;a!==v||p!==j||Re.current||_t?(typeof x=="function"&&(Ki(t,n,x,r),j=t.memoizedState),(c=_t||vu(t,n,c,r,p,j,u)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,j,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,j,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=j),o.props=r,o.state=j,o.context=u,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Xi(e,t,n,r,i,l)}function Xi(e,t,n,r,l,i){Wd(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&uu(t,n,!1),Ct(e,t,i);r=t.stateNode,nm.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Qn(t,e.child,null,i),t.child=Qn(t,null,a,i)):Ne(e,t,a,i),t.memoizedState=r.state,l&&uu(t,n,!0),t.child}function Bd(e){var t=e.stateNode;t.pendingContext?au(e,t.pendingContext,t.pendingContext!==t.context):t.context&&au(e,t.context,!1),Qo(e,t.containerInfo)}function Cu(e,t,n,r,l){return Hn(),Mo(l),t.flags|=256,Ne(e,t,n,r),t.child}var Ji={dehydrated:null,treeContext:null,retryLane:0};function Zi(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vd(e,t,n){var r=t.pendingProps,l=Z.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(l&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),Q(Z,l&1),e===null)return Hi(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Nl(o,r,0,null),e=dn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Zi(n),t.memoizedState=Ji,e):ea(t,o));if(l=e.memoizedState,l!==null&&(a=l.dehydrated,a!==null))return rm(e,t,o,r,a,l,n);if(i){i=r.fallback,o=t.mode,l=e.child,a=l.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Bt(l,u),r.subtreeFlags=l.subtreeFlags&14680064),a!==null?i=Bt(a,i):(i=dn(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Zi(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Ji,r}return i=e.child,e=i.sibling,r=Bt(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ea(e,t){return t=Nl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ys(e,t,n,r){return r!==null&&Mo(r),Qn(t,e.child,null,n),e=ea(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rm(e,t,n,r,l,i,o){if(n)return t.flags&256?(t.flags&=-257,r=ui(Error(k(422))),ys(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,l=t.mode,r=Nl({mode:"visible",children:r.children},l,0,null),i=dn(i,l,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Qn(t,e.child,null,o),t.child.memoizedState=Zi(o),t.memoizedState=Ji,i);if(!(t.mode&1))return ys(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(k(419)),r=ui(i,r,void 0),ys(e,t,o,r)}if(a=(o&e.childLanes)!==0,_e||a){if(r=pe,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==i.retryLane&&(i.retryLane=l,Nt(e,l),rt(r,e,l,-1))}return ia(),r=ui(Error(k(421))),ys(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=gm.bind(null,e),l._reactRetry=t,null):(e=i.treeContext,ze=At(l.nextSibling),Oe=t,G=!0,tt=null,e!==null&&(We[Be++]=vt,We[Be++]=yt,We[Be++]=hn,vt=e.id,yt=e.overflow,hn=t),t=ea(t,r.children),t.flags|=4096,t)}function Eu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qi(e.return,t,n)}function ci(e,t,n,r,l){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=l)}function Hd(e,t,n){var r=t.pendingProps,l=r.revealOrder,i=r.tail;if(Ne(e,t,r.children,n),r=Z.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Eu(e,n,t);else if(e.tag===19)Eu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Q(Z,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Js(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),ci(t,!1,l,n,i);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Js(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}ci(t,!0,n,null,i);break;case"together":ci(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Rs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ct(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(k(153));if(t.child!==null){for(e=t.child,n=Bt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sm(e,t,n){switch(t.tag){case 3:Bd(t),Hn();break;case 5:vd(t);break;case 1:be(t.type)&&Qs(t);break;case 4:Qo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;Q(Gs,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Q(Z,Z.current&1),t.flags|=128,null):n&t.child.childLanes?Vd(e,t,n):(Q(Z,Z.current&1),e=Ct(e,t,n),e!==null?e.sibling:null);Q(Z,Z.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Hd(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Q(Z,Z.current),r)break;return null;case 22:case 23:return t.lanes=0,Ud(e,t,n)}return Ct(e,t,n)}var Qd,eo,Kd,Yd;Qd=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};eo=function(){};Kd=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,un(ft.current);var i=null;switch(n){case"input":l=ki(e,l),r=ki(e,r),i=[];break;case"select":l=te({},l,{value:void 0}),r=te({},r,{value:void 0}),i=[];break;case"textarea":l=Ci(e,l),r=Ci(e,r),i=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Vs)}$i(n,r);var o;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var a=l[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Pr.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var u=r[c];if(a=l?.[c],r.hasOwnProperty(c)&&u!==a&&(u!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&a[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(i||(i=[]),i.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,a=a?a.__html:void 0,u!=null&&a!==u&&(i=i||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Pr.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&K("scroll",e),i||a===u||(i=[])):(i=i||[]).push(c,u))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};Yd=function(e,t,n,r){n!==r&&(t.flags|=4)};function cr(e,t){if(!G)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function we(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function lm(e,t,n){var r=t.pendingProps;switch(Ao(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return we(t),null;case 1:return be(t.type)&&Hs(),we(t),null;case 3:return r=t.stateNode,Kn(),Y(Re),Y(Se),Yo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(gs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,tt!==null&&(ao(tt),tt=null))),eo(e,t),we(t),null;case 5:Ko(t);var l=un(Mr.current);if(n=t.type,e!==null&&t.stateNode!=null)Kd(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(k(166));return we(t),null}if(e=un(ft.current),gs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ot]=t,r[Fr]=i,e=(t.mode&1)!==0,n){case"dialog":K("cancel",r),K("close",r);break;case"iframe":case"object":case"embed":K("load",r);break;case"video":case"audio":for(l=0;l<mr.length;l++)K(mr[l],r);break;case"source":K("error",r);break;case"img":case"image":case"link":K("error",r),K("load",r);break;case"details":K("toggle",r);break;case"input":Da(r,i),K("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},K("invalid",r);break;case"textarea":Oa(r,i),K("invalid",r)}$i(n,i),l=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&ms(r.textContent,a,e),l=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ms(r.textContent,a,e),l=["children",""+a]):Pr.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&K("scroll",r)}switch(n){case"input":os(r),za(r,i,!0);break;case"textarea":os(r),Fa(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Vs)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=kc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ot]=t,e[Fr]=r,Qd(e,t,!1,!1),t.stateNode=e;e:{switch(o=Pi(n,r),n){case"dialog":K("cancel",e),K("close",e),l=r;break;case"iframe":case"object":case"embed":K("load",e),l=r;break;case"video":case"audio":for(l=0;l<mr.length;l++)K(mr[l],e);l=r;break;case"source":K("error",e),l=r;break;case"img":case"image":case"link":K("error",e),K("load",e),l=r;break;case"details":K("toggle",e),l=r;break;case"input":Da(e,r),l=ki(e,r),K("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=te({},r,{value:void 0}),K("invalid",e);break;case"textarea":Oa(e,r),l=Ci(e,r),K("invalid",e);break;default:l=r}$i(n,l),a=l;for(i in a)if(a.hasOwnProperty(i)){var u=a[i];i==="style"?Cc(e,u):i==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Sc(e,u)):i==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Tr(e,u):typeof u=="number"&&Tr(e,""+u):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Pr.hasOwnProperty(i)?u!=null&&i==="onScroll"&&K("scroll",e):u!=null&&No(e,i,u,o))}switch(n){case"input":os(e),za(e,r,!1);break;case"textarea":os(e),Fa(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vt(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?zn(e,!!r.multiple,i,!1):r.defaultValue!=null&&zn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Vs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return we(t),null;case 6:if(e&&t.stateNode!=null)Yd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(k(166));if(n=un(Mr.current),un(ft.current),gs(t)){if(r=t.stateNode,n=t.memoizedProps,r[ot]=t,(i=r.nodeValue!==n)&&(e=Oe,e!==null))switch(e.tag){case 3:ms(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ms(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ot]=t,t.stateNode=r}return we(t),null;case 13:if(Y(Z),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(G&&ze!==null&&t.mode&1&&!(t.flags&128))fd(),Hn(),t.flags|=98560,i=!1;else if(i=gs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(k(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(k(317));i[ot]=t}else Hn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;we(t),i=!1}else tt!==null&&(ao(tt),tt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Z.current&1?ae===0&&(ae=3):ia())),t.updateQueue!==null&&(t.flags|=4),we(t),null);case 4:return Kn(),eo(e,t),e===null&&zr(t.stateNode.containerInfo),we(t),null;case 10:return Bo(t.type._context),we(t),null;case 17:return be(t.type)&&Hs(),we(t),null;case 19:if(Y(Z),i=t.memoizedState,i===null)return we(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)cr(i,!1);else{if(ae!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Js(e),o!==null){for(t.flags|=128,cr(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Q(Z,Z.current&1|2),t.child}e=e.sibling}i.tail!==null&&le()>Gn&&(t.flags|=128,r=!0,cr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Js(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!G)return we(t),null}else 2*le()-i.renderingStartTime>Gn&&n!==1073741824&&(t.flags|=128,r=!0,cr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=le(),t.sibling=null,n=Z.current,Q(Z,r?n&1|2:n&1),t):(we(t),null);case 22:case 23:return la(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?De&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(k(156,t.tag))}function im(e,t){switch(Ao(t),t.tag){case 1:return be(t.type)&&Hs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kn(),Y(Re),Y(Se),Yo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ko(t),null;case 13:if(Y(Z),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(k(340));Hn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(Z),null;case 4:return Kn(),null;case 10:return Bo(t.type._context),null;case 22:case 23:return la(),null;case 24:return null;default:return null}}var xs=!1,ke=!1,om=typeof WeakSet=="function"?WeakSet:Set,$=null;function In(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ne(e,t,r)}else n.current=null}function to(e,t,n){try{n()}catch(r){ne(e,t,r)}}var $u=!1;function am(e,t){if(Fi=Us,e=Zc(),Oo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,c=0,f=0,v=e,p=null;t:for(;;){for(var x;v!==n||l!==0&&v.nodeType!==3||(a=o+l),v!==i||r!==0&&v.nodeType!==3||(u=o+r),v.nodeType===3&&(o+=v.nodeValue.length),(x=v.firstChild)!==null;)p=v,v=x;for(;;){if(v===e)break t;if(p===n&&++c===l&&(a=o),p===i&&++f===r&&(u=o),(x=v.nextSibling)!==null)break;v=p,p=v.parentNode}v=x}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ai={focusedElem:e,selectionRange:n},Us=!1,$=t;$!==null;)if(t=$,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$=e;else for(;$!==null;){t=$;try{var j=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var g=j.memoizedProps,T=j.memoizedState,h=t.stateNode,d=h.getSnapshotBeforeUpdate(t.elementType===t.type?g:Ze(t.type,g),T);h.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(k(163))}}catch(y){ne(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,$=e;break}$=t.return}return j=$u,$u=!1,j}function kr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&to(t,n,i)}l=l.next}while(l!==r)}}function kl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function no(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Gd(e){var t=e.alternate;t!==null&&(e.alternate=null,Gd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ot],delete t[Fr],delete t[Wi],delete t[Vp],delete t[Hp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qd(e){return e.tag===5||e.tag===3||e.tag===4}function Pu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qd(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.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 ro(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vs));else if(r!==4&&(e=e.child,e!==null))for(ro(e,t,n),e=e.sibling;e!==null;)ro(e,t,n),e=e.sibling}function so(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(so(e,t,n),e=e.sibling;e!==null;)so(e,t,n),e=e.sibling}var me=null,et=!1;function Pt(e,t,n){for(n=n.child;n!==null;)Xd(e,t,n),n=n.sibling}function Xd(e,t,n){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(pl,n)}catch{}switch(n.tag){case 5:ke||In(n,t);case 6:var r=me,l=et;me=null,Pt(e,t,n),me=r,et=l,me!==null&&(et?(e=me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):me.removeChild(n.stateNode));break;case 18:me!==null&&(et?(e=me,n=n.stateNode,e.nodeType===8?ri(e.parentNode,n):e.nodeType===1&&ri(e,n),Lr(e)):ri(me,n.stateNode));break;case 4:r=me,l=et,me=n.stateNode.containerInfo,et=!0,Pt(e,t,n),me=r,et=l;break;case 0:case 11:case 14:case 15:if(!ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&to(n,t,o),l=l.next}while(l!==r)}Pt(e,t,n);break;case 1:if(!ke&&(In(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ne(n,t,a)}Pt(e,t,n);break;case 21:Pt(e,t,n);break;case 22:n.mode&1?(ke=(r=ke)||n.memoizedState!==null,Pt(e,t,n),ke=r):Pt(e,t,n);break;default:Pt(e,t,n)}}function Tu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new om),t.forEach(function(r){var l=vm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Je(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:me=a.stateNode,et=!1;break e;case 3:me=a.stateNode.containerInfo,et=!0;break e;case 4:me=a.stateNode.containerInfo,et=!0;break e}a=a.return}if(me===null)throw Error(k(160));Xd(i,o,l),me=null,et=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(c){ne(l,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Jd(t,e),t=t.sibling}function Jd(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Je(t,e),lt(e),r&4){try{kr(3,e,e.return),kl(3,e)}catch(g){ne(e,e.return,g)}try{kr(5,e,e.return)}catch(g){ne(e,e.return,g)}}break;case 1:Je(t,e),lt(e),r&512&&n!==null&&In(n,n.return);break;case 5:if(Je(t,e),lt(e),r&512&&n!==null&&In(n,n.return),e.flags&32){var l=e.stateNode;try{Tr(l,"")}catch(g){ne(e,e.return,g)}}if(r&4&&(l=e.stateNode,l!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&jc(l,i),Pi(a,o);var c=Pi(a,i);for(o=0;o<u.length;o+=2){var f=u[o],v=u[o+1];f==="style"?Cc(l,v):f==="dangerouslySetInnerHTML"?Sc(l,v):f==="children"?Tr(l,v):No(l,f,v,c)}switch(a){case"input":Si(l,i);break;case"textarea":wc(l,i);break;case"select":var p=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!i.multiple;var x=i.value;x!=null?zn(l,!!i.multiple,x,!1):p!==!!i.multiple&&(i.defaultValue!=null?zn(l,!!i.multiple,i.defaultValue,!0):zn(l,!!i.multiple,i.multiple?[]:"",!1))}l[Fr]=i}catch(g){ne(e,e.return,g)}}break;case 6:if(Je(t,e),lt(e),r&4){if(e.stateNode===null)throw Error(k(162));l=e.stateNode,i=e.memoizedProps;try{l.nodeValue=i}catch(g){ne(e,e.return,g)}}break;case 3:if(Je(t,e),lt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lr(t.containerInfo)}catch(g){ne(e,e.return,g)}break;case 4:Je(t,e),lt(e);break;case 13:Je(t,e),lt(e),l=e.child,l.flags&8192&&(i=l.memoizedState!==null,l.stateNode.isHidden=i,!i||l.alternate!==null&&l.alternate.memoizedState!==null||(ra=le())),r&4&&Tu(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(ke=(c=ke)||f,Je(t,e),ke=c):Je(t,e),lt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for($=e,f=e.child;f!==null;){for(v=$=f;$!==null;){switch(p=$,x=p.child,p.tag){case 0:case 11:case 14:case 15:kr(4,p,p.return);break;case 1:In(p,p.return);var j=p.stateNode;if(typeof j.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,j.props=t.memoizedProps,j.state=t.memoizedState,j.componentWillUnmount()}catch(g){ne(r,n,g)}}break;case 5:In(p,p.return);break;case 22:if(p.memoizedState!==null){Ru(v);continue}}x!==null?(x.return=p,$=x):Ru(v)}f=f.sibling}e:for(f=null,v=e;;){if(v.tag===5){if(f===null){f=v;try{l=v.stateNode,c?(i=l.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=v.stateNode,u=v.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,a.style.display=Nc("display",o))}catch(g){ne(e,e.return,g)}}}else if(v.tag===6){if(f===null)try{v.stateNode.nodeValue=c?"":v.memoizedProps}catch(g){ne(e,e.return,g)}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===e)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===e)break e;for(;v.sibling===null;){if(v.return===null||v.return===e)break e;f===v&&(f=null),v=v.return}f===v&&(f=null),v.sibling.return=v.return,v=v.sibling}}break;case 19:Je(t,e),lt(e),r&4&&Tu(e);break;case 21:break;default:Je(t,e),lt(e)}}function lt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(qd(n)){var r=n;break e}n=n.return}throw Error(k(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(Tr(l,""),r.flags&=-33);var i=Pu(e);so(e,i,l);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Pu(e);ro(e,a,o);break;default:throw Error(k(161))}}catch(u){ne(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function um(e,t,n){$=e,Zd(e)}function Zd(e,t,n){for(var r=(e.mode&1)!==0;$!==null;){var l=$,i=l.child;if(l.tag===22&&r){var o=l.memoizedState!==null||xs;if(!o){var a=l.alternate,u=a!==null&&a.memoizedState!==null||ke;a=xs;var c=ke;if(xs=o,(ke=u)&&!c)for($=l;$!==null;)o=$,u=o.child,o.tag===22&&o.memoizedState!==null?bu(l):u!==null?(u.return=o,$=u):bu(l);for(;i!==null;)$=i,Zd(i),i=i.sibling;$=l,xs=a,ke=c}_u(e)}else l.subtreeFlags&8772&&i!==null?(i.return=l,$=i):_u(e)}}function _u(e){for(;$!==null;){var t=$;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ke||kl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ke)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:Ze(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&pu(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}pu(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var v=f.dehydrated;v!==null&&Lr(v)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(k(163))}ke||t.flags&512&&no(t)}catch(p){ne(t,t.return,p)}}if(t===e){$=null;break}if(n=t.sibling,n!==null){n.return=t.return,$=n;break}$=t.return}}function Ru(e){for(;$!==null;){var t=$;if(t===e){$=null;break}var n=t.sibling;if(n!==null){n.return=t.return,$=n;break}$=t.return}}function bu(e){for(;$!==null;){var t=$;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{kl(4,t)}catch(u){ne(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){ne(t,l,u)}}var i=t.return;try{no(t)}catch(u){ne(t,i,u)}break;case 5:var o=t.return;try{no(t)}catch(u){ne(t,o,u)}}}catch(u){ne(t,t.return,u)}if(t===e){$=null;break}var a=t.sibling;if(a!==null){a.return=t.return,$=a;break}$=t.return}}var cm=Math.ceil,tl=Et.ReactCurrentDispatcher,ta=Et.ReactCurrentOwner,Qe=Et.ReactCurrentBatchConfig,B=0,pe=null,ie=null,ge=0,De=0,Dn=qt(0),ae=0,Vr=null,mn=0,Sl=0,na=0,Sr=null,Te=null,ra=0,Gn=1/0,mt=null,nl=!1,lo=null,Ut=null,js=!1,It=null,rl=0,Nr=0,io=null,bs=-1,Ls=0;function Ce(){return B&6?le():bs!==-1?bs:bs=le()}function Wt(e){return e.mode&1?B&2&&ge!==0?ge&-ge:Kp.transition!==null?(Ls===0&&(Ls=Oc()),Ls):(e=V,e!==0||(e=window.event,e=e===void 0?16:Vc(e.type)),e):1}function rt(e,t,n,r){if(50<Nr)throw Nr=0,io=null,Error(k(185));Yr(e,n,r),(!(B&2)||e!==pe)&&(e===pe&&(!(B&2)&&(Sl|=n),ae===4&&bt(e,ge)),Le(e,r),n===1&&B===0&&!(t.mode&1)&&(Gn=le()+500,xl&&Xt()))}function Le(e,t){var n=e.callbackNode;Kh(e,t);var r=Ms(e,e===pe?ge:0);if(r===0)n!==null&&Ua(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ua(n),t===1)e.tag===0?Qp(Lu.bind(null,e)):ud(Lu.bind(null,e)),Wp(function(){!(B&6)&&Xt()}),n=null;else{switch(Fc(r)){case 1:n=To;break;case 4:n=Dc;break;case 16:n=As;break;case 536870912:n=zc;break;default:n=As}n=af(n,ef.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ef(e,t){if(bs=-1,Ls=0,B&6)throw Error(k(327));var n=e.callbackNode;if(Un()&&e.callbackNode!==n)return null;var r=Ms(e,e===pe?ge:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=sl(e,r);else{t=r;var l=B;B|=2;var i=nf();(pe!==e||ge!==t)&&(mt=null,Gn=le()+500,cn(e,t));do try{hm();break}catch(a){tf(e,a)}while(!0);Wo(),tl.current=i,B=l,ie!==null?t=0:(pe=null,ge=0,t=ae)}if(t!==0){if(t===2&&(l=Li(e),l!==0&&(r=l,t=oo(e,l))),t===1)throw n=Vr,cn(e,0),bt(e,r),Le(e,le()),n;if(t===6)bt(e,r);else{if(l=e.current.alternate,!(r&30)&&!dm(l)&&(t=sl(e,r),t===2&&(i=Li(e),i!==0&&(r=i,t=oo(e,i))),t===1))throw n=Vr,cn(e,0),bt(e,r),Le(e,le()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(k(345));case 2:ln(e,Te,mt);break;case 3:if(bt(e,r),(r&130023424)===r&&(t=ra+500-le(),10<t)){if(Ms(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){Ce(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=Ui(ln.bind(null,e,Te,mt),t);break}ln(e,Te,mt);break;case 4:if(bt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var o=31-nt(r);i=1<<o,o=t[o],o>l&&(l=o),r&=~i}if(r=l,r=le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*cm(r/1960))-r,10<r){e.timeoutHandle=Ui(ln.bind(null,e,Te,mt),r);break}ln(e,Te,mt);break;case 5:ln(e,Te,mt);break;default:throw Error(k(329))}}}return Le(e,le()),e.callbackNode===n?ef.bind(null,e):null}function oo(e,t){var n=Sr;return e.current.memoizedState.isDehydrated&&(cn(e,t).flags|=256),e=sl(e,t),e!==2&&(t=Te,Te=n,t!==null&&ao(t)),e}function ao(e){Te===null?Te=e:Te.push.apply(Te,e)}function dm(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var l=n[r],i=l.getSnapshot;l=l.value;try{if(!st(i(),l))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bt(e,t){for(t&=~na,t&=~Sl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-nt(t),r=1<<n;e[n]=-1,t&=~r}}function Lu(e){if(B&6)throw Error(k(327));Un();var t=Ms(e,0);if(!(t&1))return Le(e,le()),null;var n=sl(e,t);if(e.tag!==0&&n===2){var r=Li(e);r!==0&&(t=r,n=oo(e,r))}if(n===1)throw n=Vr,cn(e,0),bt(e,t),Le(e,le()),n;if(n===6)throw Error(k(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ln(e,Te,mt),Le(e,le()),null}function sa(e,t){var n=B;B|=1;try{return e(t)}finally{B=n,B===0&&(Gn=le()+500,xl&&Xt())}}function gn(e){It!==null&&It.tag===0&&!(B&6)&&Un();var t=B;B|=1;var n=Qe.transition,r=V;try{if(Qe.transition=null,V=1,e)return e()}finally{V=r,Qe.transition=n,B=t,!(B&6)&&Xt()}}function la(){De=Dn.current,Y(Dn)}function cn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Up(n)),ie!==null)for(n=ie.return;n!==null;){var r=n;switch(Ao(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Hs();break;case 3:Kn(),Y(Re),Y(Se),Yo();break;case 5:Ko(r);break;case 4:Kn();break;case 13:Y(Z);break;case 19:Y(Z);break;case 10:Bo(r.type._context);break;case 22:case 23:la()}n=n.return}if(pe=e,ie=e=Bt(e.current,null),ge=De=t,ae=0,Vr=null,na=Sl=mn=0,Te=Sr=null,an!==null){for(t=0;t<an.length;t++)if(n=an[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=l,r.next=o}n.pending=r}an=null}return e}function tf(e,t){do{var n=ie;try{if(Wo(),Ts.current=el,Zs){for(var r=ee.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}Zs=!1}if(pn=0,ce=oe=ee=null,wr=!1,Ur=0,ta.current=null,n===null||n.return===null){ae=1,Vr=t,ie=null;break}e:{var i=e,o=n.return,a=n,u=t;if(t=ge,a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,f=a,v=f.tag;if(!(f.mode&1)&&(v===0||v===11||v===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var x=ju(o);if(x!==null){x.flags&=-257,wu(x,o,a,i,t),x.mode&1&&xu(i,c,t),t=x,u=c;var j=t.updateQueue;if(j===null){var g=new Set;g.add(u),t.updateQueue=g}else j.add(u);break e}else{if(!(t&1)){xu(i,c,t),ia();break e}u=Error(k(426))}}else if(G&&a.mode&1){var T=ju(o);if(T!==null){!(T.flags&65536)&&(T.flags|=256),wu(T,o,a,i,t),Mo(Yn(u,a));break e}}i=u=Yn(u,a),ae!==4&&(ae=2),Sr===null?Sr=[i]:Sr.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=Fd(i,u,t);hu(i,h);break e;case 1:a=u;var d=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof d.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ut===null||!Ut.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var y=Ad(i,a,t);hu(i,y);break e}}i=i.return}while(i!==null)}sf(n)}catch(E){t=E,ie===n&&n!==null&&(ie=n=n.return);continue}break}while(!0)}function nf(){var e=tl.current;return tl.current=el,e===null?el:e}function ia(){(ae===0||ae===3||ae===2)&&(ae=4),pe===null||!(mn&268435455)&&!(Sl&268435455)||bt(pe,ge)}function sl(e,t){var n=B;B|=2;var r=nf();(pe!==e||ge!==t)&&(mt=null,cn(e,t));do try{fm();break}catch(l){tf(e,l)}while(!0);if(Wo(),B=n,tl.current=r,ie!==null)throw Error(k(261));return pe=null,ge=0,ae}function fm(){for(;ie!==null;)rf(ie)}function hm(){for(;ie!==null&&!Fh();)rf(ie)}function rf(e){var t=of(e.alternate,e,De);e.memoizedProps=e.pendingProps,t===null?sf(e):ie=t,ta.current=null}function sf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=im(n,t),n!==null){n.flags&=32767,ie=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ae=6,ie=null;return}}else if(n=lm(n,t,De),n!==null){ie=n;return}if(t=t.sibling,t!==null){ie=t;return}ie=t=e}while(t!==null);ae===0&&(ae=5)}function ln(e,t,n){var r=V,l=Qe.transition;try{Qe.transition=null,V=1,pm(e,t,n,r)}finally{Qe.transition=l,V=r}return null}function pm(e,t,n,r){do Un();while(It!==null);if(B&6)throw Error(k(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(k(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Yh(e,i),e===pe&&(ie=pe=null,ge=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||js||(js=!0,af(As,function(){return Un(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Qe.transition,Qe.transition=null;var o=V;V=1;var a=B;B|=4,ta.current=null,am(e,n),Jd(n,e),Ip(Ai),Us=!!Fi,Ai=Fi=null,e.current=n,um(n),Ah(),B=a,V=o,Qe.transition=i}else e.current=n;if(js&&(js=!1,It=e,rl=l),i=e.pendingLanes,i===0&&(Ut=null),Wh(n.stateNode),Le(e,le()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(nl)throw nl=!1,e=lo,lo=null,e;return rl&1&&e.tag!==0&&Un(),i=e.pendingLanes,i&1?e===io?Nr++:(Nr=0,io=e):Nr=0,Xt(),null}function Un(){if(It!==null){var e=Fc(rl),t=Qe.transition,n=V;try{if(Qe.transition=null,V=16>e?16:e,It===null)var r=!1;else{if(e=It,It=null,rl=0,B&6)throw Error(k(331));var l=B;for(B|=4,$=e.current;$!==null;){var i=$,o=i.child;if($.flags&16){var a=i.deletions;if(a!==null){for(var u=0;u<a.length;u++){var c=a[u];for($=c;$!==null;){var f=$;switch(f.tag){case 0:case 11:case 15:kr(8,f,i)}var v=f.child;if(v!==null)v.return=f,$=v;else for(;$!==null;){f=$;var p=f.sibling,x=f.return;if(Gd(f),f===c){$=null;break}if(p!==null){p.return=x,$=p;break}$=x}}}var j=i.alternate;if(j!==null){var g=j.child;if(g!==null){j.child=null;do{var T=g.sibling;g.sibling=null,g=T}while(g!==null)}}$=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,$=o;else e:for(;$!==null;){if(i=$,i.flags&2048)switch(i.tag){case 0:case 11:case 15:kr(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,$=h;break e}$=i.return}}var d=e.current;for($=d;$!==null;){o=$;var m=o.child;if(o.subtreeFlags&2064&&m!==null)m.return=o,$=m;else e:for(o=d;$!==null;){if(a=$,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:kl(9,a)}}catch(E){ne(a,a.return,E)}if(a===o){$=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,$=y;break e}$=a.return}}if(B=l,Xt(),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(pl,e)}catch{}r=!0}return r}finally{V=n,Qe.transition=t}}return!1}function Iu(e,t,n){t=Yn(n,t),t=Fd(e,t,1),e=Mt(e,t,1),t=Ce(),e!==null&&(Yr(e,1,t),Le(e,t))}function ne(e,t,n){if(e.tag===3)Iu(e,e,n);else for(;t!==null;){if(t.tag===3){Iu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ut===null||!Ut.has(r))){e=Yn(n,e),e=Ad(t,e,1),t=Mt(t,e,1),e=Ce(),t!==null&&(Yr(t,1,e),Le(t,e));break}}t=t.return}}function mm(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ce(),e.pingedLanes|=e.suspendedLanes&n,pe===e&&(ge&n)===n&&(ae===4||ae===3&&(ge&130023424)===ge&&500>le()-ra?cn(e,0):na|=n),Le(e,t)}function lf(e,t){t===0&&(e.mode&1?(t=cs,cs<<=1,!(cs&130023424)&&(cs=4194304)):t=1);var n=Ce();e=Nt(e,t),e!==null&&(Yr(e,t,n),Le(e,n))}function gm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),lf(e,n)}function vm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(k(314))}r!==null&&r.delete(t),lf(e,n)}var of;of=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Re.current)_e=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _e=!1,sm(e,t,n);_e=!!(e.flags&131072)}else _e=!1,G&&t.flags&1048576&&cd(t,Ys,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Rs(e,t),e=t.pendingProps;var l=Vn(t,Se.current);Mn(t,n),l=qo(null,t,r,e,l,n);var i=Xo();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,be(r)?(i=!0,Qs(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ho(t),l.updater=wl,t.stateNode=l,l._reactInternals=t,Yi(t,r,e,n),t=Xi(null,t,r,!0,i,n)):(t.tag=0,G&&i&&Fo(t),Ne(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Rs(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=xm(r),e=Ze(r,e),l){case 0:t=qi(null,t,r,e,n);break e;case 1:t=Nu(null,t,r,e,n);break e;case 11:t=ku(null,t,r,e,n);break e;case 14:t=Su(null,t,r,Ze(r.type,e),n);break e}throw Error(k(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ze(r,l),qi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ze(r,l),Nu(e,t,r,l,n);case 3:e:{if(Bd(t),e===null)throw Error(k(387));r=t.pendingProps,i=t.memoizedState,l=i.element,gd(e,t),Xs(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Yn(Error(k(423)),t),t=Cu(e,t,r,n,l);break e}else if(r!==l){l=Yn(Error(k(424)),t),t=Cu(e,t,r,n,l);break e}else for(ze=At(t.stateNode.containerInfo.firstChild),Oe=t,G=!0,tt=null,n=pd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hn(),r===l){t=Ct(e,t,n);break e}Ne(e,t,r,n)}t=t.child}return t;case 5:return vd(t),e===null&&Hi(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,Mi(r,l)?o=null:i!==null&&Mi(r,i)&&(t.flags|=32),Wd(e,t),Ne(e,t,o,n),t.child;case 6:return e===null&&Hi(t),null;case 13:return Vd(e,t,n);case 4:return Qo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qn(t,null,r,n):Ne(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ze(r,l),ku(e,t,r,l,n);case 7:return Ne(e,t,t.pendingProps,n),t.child;case 8:return Ne(e,t,t.pendingProps.children,n),t.child;case 12:return Ne(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,Q(Gs,r._currentValue),r._currentValue=o,i!==null)if(st(i.value,o)){if(i.children===l.children&&!Re.current){t=Ct(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=xt(-1,n&-n),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Qi(i.return,n,t),a.lanes|=n;break}u=u.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(k(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Qi(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Ne(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Mn(t,n),l=Ye(l),r=r(l),t.flags|=1,Ne(e,t,r,n),t.child;case 14:return r=t.type,l=Ze(r,t.pendingProps),l=Ze(r.type,l),Su(e,t,r,l,n);case 15:return Md(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ze(r,l),Rs(e,t),t.tag=1,be(r)?(e=!0,Qs(t)):e=!1,Mn(t,n),Od(t,r,l),Yi(t,r,l,n),Xi(null,t,r,!0,e,n);case 19:return Hd(e,t,n);case 22:return Ud(e,t,n)}throw Error(k(156,t.tag))};function af(e,t){return Ic(e,t)}function ym(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ve(e,t,n,r){return new ym(e,t,n,r)}function oa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xm(e){if(typeof e=="function")return oa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Eo)return 11;if(e===$o)return 14}return 2}function Bt(e,t){var n=e.alternate;return n===null?(n=Ve(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Is(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")oa(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Cn:return dn(n.children,l,i,t);case Co:o=8,l|=8;break;case yi:return e=Ve(12,n,t,l|2),e.elementType=yi,e.lanes=i,e;case xi:return e=Ve(13,n,t,l),e.elementType=xi,e.lanes=i,e;case ji:return e=Ve(19,n,t,l),e.elementType=ji,e.lanes=i,e;case vc:return Nl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mc:o=10;break e;case gc:o=9;break e;case Eo:o=11;break e;case $o:o=14;break e;case Tt:o=16,r=null;break e}throw Error(k(130,e==null?e:typeof e,""))}return t=Ve(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function dn(e,t,n,r){return e=Ve(7,e,r,t),e.lanes=n,e}function Nl(e,t,n,r){return e=Ve(22,e,r,t),e.elementType=vc,e.lanes=n,e.stateNode={isHidden:!1},e}function di(e,t,n){return e=Ve(6,e,null,t),e.lanes=n,e}function fi(e,t,n){return t=Ve(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jm(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function aa(e,t,n,r,l,i,o,a,u){return e=new jm(e,t,n,a,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ve(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ho(i),e}function wm(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Nn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function uf(e){if(!e)return Ht;e=e._reactInternals;e:{if(xn(e)!==e||e.tag!==1)throw Error(k(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(be(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(k(171))}if(e.tag===1){var n=e.type;if(be(n))return ad(e,n,t)}return t}function cf(e,t,n,r,l,i,o,a,u){return e=aa(n,r,!0,e,l,i,o,a,u),e.context=uf(null),n=e.current,r=Ce(),l=Wt(n),i=xt(r,l),i.callback=t??null,Mt(n,i,l),e.current.lanes=l,Yr(e,l,r),Le(e,r),e}function Cl(e,t,n,r){var l=t.current,i=Ce(),o=Wt(l);return n=uf(n),t.context===null?t.context=n:t.pendingContext=n,t=xt(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Mt(l,t,o),e!==null&&(rt(e,l,o,i),Ps(e,l,o)),o}function ll(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Du(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ua(e,t){Du(e,t),(e=e.alternate)&&Du(e,t)}function km(){return null}var df=typeof reportError=="function"?reportError:function(e){console.error(e)};function ca(e){this._internalRoot=e}El.prototype.render=ca.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(k(409));Cl(e,t,null,null)};El.prototype.unmount=ca.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gn(function(){Cl(null,e,null,null)}),t[St]=null}};function El(e){this._internalRoot=e}El.prototype.unstable_scheduleHydration=function(e){if(e){var t=Uc();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rt.length&&t!==0&&t<Rt[n].priority;n++);Rt.splice(n,0,e),n===0&&Bc(e)}};function da(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function zu(){}function Sm(e,t,n,r,l){if(l){if(typeof r=="function"){var i=r;r=function(){var c=ll(o);i.call(c)}}var o=cf(t,r,e,0,null,!1,!1,"",zu);return e._reactRootContainer=o,e[St]=o.current,zr(e.nodeType===8?e.parentNode:e),gn(),o}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var a=r;r=function(){var c=ll(u);a.call(c)}}var u=aa(e,0,!1,null,null,!1,!1,"",zu);return e._reactRootContainer=u,e[St]=u.current,zr(e.nodeType===8?e.parentNode:e),gn(function(){Cl(t,u,n,r)}),u}function Pl(e,t,n,r,l){var i=n._reactRootContainer;if(i){var o=i;if(typeof l=="function"){var a=l;l=function(){var u=ll(o);a.call(u)}}Cl(t,o,e,l)}else o=Sm(n,t,e,l,r);return ll(o)}Ac=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=pr(t.pendingLanes);n!==0&&(_o(t,n|1),Le(t,le()),!(B&6)&&(Gn=le()+500,Xt()))}break;case 13:gn(function(){var r=Nt(e,1);if(r!==null){var l=Ce();rt(r,e,1,l)}}),ua(e,1)}};Ro=function(e){if(e.tag===13){var t=Nt(e,134217728);if(t!==null){var n=Ce();rt(t,e,134217728,n)}ua(e,134217728)}};Mc=function(e){if(e.tag===13){var t=Wt(e),n=Nt(e,t);if(n!==null){var r=Ce();rt(n,e,t,r)}ua(e,t)}};Uc=function(){return V};Wc=function(e,t){var n=V;try{return V=e,t()}finally{V=n}};_i=function(e,t,n){switch(t){case"input":if(Si(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=yl(r);if(!l)throw Error(k(90));xc(r),Si(r,l)}}}break;case"textarea":wc(e,n);break;case"select":t=n.value,t!=null&&zn(e,!!n.multiple,t,!1)}};Pc=sa;Tc=gn;var Nm={usingClientEntryPoint:!1,Events:[qr,Tn,yl,Ec,$c,sa]},dr={findFiberByHostInstance:on,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Cm={bundleType:dr.bundleType,version:dr.version,rendererPackageName:dr.rendererPackageName,rendererConfig:dr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Et.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=bc(e),e===null?null:e.stateNode},findFiberByHostInstance:dr.findFiberByHostInstance||km,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ws=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ws.isDisabled&&ws.supportsFiber)try{pl=ws.inject(Cm),dt=ws}catch{}}Ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nm;Ae.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!da(t))throw Error(k(200));return wm(e,t,null,n)};Ae.createRoot=function(e,t){if(!da(e))throw Error(k(299));var n=!1,r="",l=df;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=aa(e,1,!1,null,null,n,!1,r,l),e[St]=t.current,zr(e.nodeType===8?e.parentNode:e),new ca(t)};Ae.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(k(188)):(e=Object.keys(e).join(","),Error(k(268,e)));return e=bc(t),e=e===null?null:e.stateNode,e};Ae.flushSync=function(e){return gn(e)};Ae.hydrate=function(e,t,n){if(!$l(t))throw Error(k(200));return Pl(null,e,t,!0,n)};Ae.hydrateRoot=function(e,t,n){if(!da(e))throw Error(k(405));var r=n!=null&&n.hydratedSources||null,l=!1,i="",o=df;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=cf(t,null,e,1,n??null,l,!1,i,o),e[St]=t.current,zr(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new El(t)};Ae.render=function(e,t,n){if(!$l(t))throw Error(k(200));return Pl(null,e,t,!1,n)};Ae.unmountComponentAtNode=function(e){if(!$l(e))throw Error(k(40));return e._reactRootContainer?(gn(function(){Pl(null,null,e,!1,function(){e._reactRootContainer=null,e[St]=null})}),!0):!1};Ae.unstable_batchedUpdates=sa;Ae.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$l(n))throw Error(k(200));if(e==null||e._reactInternals===void 0)throw Error(k(38));return Pl(e,t,n,!1,r)};Ae.version="18.3.1-next-f1338f8080-20240426";function ff(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ff)}catch(e){console.error(e)}}ff(),dc.exports=Ae;var Em=dc.exports,hf,Ou=Em;hf=Ou.createRoot,Ou.hydrateRoot;function $m(){try{const e=/token=([0-9a-f]+)/.exec(location.hash);return e&&(sessionStorage.setItem("cohorte-token",e[1]),history.replaceState(null,"",location.pathname)),sessionStorage.getItem("cohorte-token")}catch{return null}}const il=$m();class tr extends Error{constructor(t,n,r){super(t),this.status=n,this.body=r}}async function J(e,t={}){const n=await fetch(`/api${e}`,{method:t.method??"GET",headers:{Authorization:`Bearer ${il}`,...t.body!==void 0?{"Content-Type":"application/json"}:{}},body:t.body!==void 0?JSON.stringify(t.body):void 0}),r=await n.json().catch(()=>({}));if(!n.ok)throw new tr(String(r.error??`HTTP ${n.status}`),n.status,r);return r}const H=(e,t={})=>J(e,{method:"POST",body:t}),L={state:()=>J("/state"),discover:()=>J("/discover"),commands:()=>J("/commands"),addProject:e=>H("/projects",{path:e}),removeProject:e=>J(`/projects/${e}`,{method:"DELETE"}),project:e=>J(`/projects/${e}`),spec:(e,t)=>J(`/projects/${e}/specs/${encodeURIComponent(t)}`),git:e=>J(`/projects/${e}/git`),diffList:(e,t)=>J(`/projects/${e}/diff?worktree=${encodeURIComponent(t)}`),fileDiff:(e,t,n)=>J(`/projects/${e}/diff?worktree=${encodeURIComponent(t)}&file=${encodeURIComponent(n)}`),activity:()=>J("/activity"),metrics:e=>J(`/projects/${e}/metrics`),docker:e=>J(`/projects/${e}/docker`),dockerAct:(e,t)=>H(`/projects/${e}/docker`,t),startDev:(e,t)=>H(`/projects/${e}/dev`,t),createWorktree:(e,t)=>H(`/projects/${e}/worktrees`,t),removeWorktree:(e,t)=>H(`/projects/${e}/worktrees/remove`,t),jobLogs:(e,t,n)=>J(`/projects/${e}/jobs/${t}/logs?since=${n}`),stopJob:(e,t)=>H(`/projects/${e}/jobs/${t}/stop`),startRun:(e,t)=>H(`/projects/${e}/runs`,t),run:(e,t,n)=>J(`/projects/${e}/runs/${t}?since=${n}`),stopRun:(e,t)=>H(`/projects/${e}/runs/${t}/stop`),reply:(e,t,n)=>H(`/projects/${e}/runs/${t}/reply`,{text:n}),respond:(e,t,n)=>H(`/projects/${e}/runs/${t}/respond`,n),inbox:()=>J("/inbox"),tickets:e=>J(`/projects/${e}/tickets`),createTicket:(e,t)=>H(`/projects/${e}/tickets`,t),decideTicket:(e,t,n)=>H(`/projects/${e}/tickets/${t}/decide`,{action:n}),takeTicket:(e,t,n={})=>H(`/projects/${e}/tickets/${t}/take`,n),acceptance:(e,t,n)=>H(`/projects/${e}/tickets/${t}/acceptance`,n),startPO:(e,t)=>H(`/projects/${e}/po`,t),features:e=>J(`/projects/${e}/features`),feature:(e,t)=>J(`/projects/${e}/features/${t}`),checkpoint:(e,t,n)=>H(`/projects/${e}/features/${t}/checkpoint`,n),replyLead:(e,t,n)=>H(`/projects/${e}/features/${t}/lead`,{text:n}),merge:(e,t)=>H(`/projects/${e}/features/${t}/merge`),contest:(e,t,n,r)=>H(`/projects/${e}/features/${t}/decisions/${n}/contest`,{note:r}),settings:e=>J(`/projects/${e}/settings`),saveSettings:(e,t)=>H(`/projects/${e}/settings`,t),connectObsidian:(e,t)=>H(`/projects/${e}/tracker`,t),productMap:e=>H(`/projects/${e}/product-map`),newProject:e=>H("/founding",e),founding:e=>J(`/projects/${e}/founding`),foundingReply:(e,t)=>H(`/projects/${e}/founding/reply`,{text:t}),foundingCheckpoint:(e,t)=>H(`/projects/${e}/founding/checkpoint`,t),remote:e=>J(`/projects/${e}/remote`),connectRemote:(e,t)=>H(`/projects/${e}/remote`,t),learning:e=>J(`/projects/${e}/learning`)},jt=e=>e instanceof Error?e.message:String(e),Pm=/^[0-9a-f]{10}$/;function pf(e,t){const n=/^#\/p\/([^/?#]+)(?:\/([^/?#]+))?/.exec(e);return!n||!Pm.test(n[1])?{projectId:null,tab:null}:{projectId:n[1],tab:n[2]&&t.includes(n[2])?n[2]:null}}function Tm(e,t){return e?t&&t!=="overview"?`#/p/${e}/${t}`:`#/p/${e}`:"#/"}const _m="modulepreload",Rm=function(e,t){return new URL(e,t).href},Fu={},mf=function(t,n,r){let l=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");l=Promise.allSettled(n.map(c=>{if(c=Rm(c,r),c in Fu)return;Fu[c]=!0;const f=c.endsWith(".css"),v=f?'[rel="stylesheet"]':"";if(!!r)for(let j=o.length-1;j>=0;j--){const g=o[j];if(g.href===c&&(!f||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${v}`))return;const x=document.createElement("link");if(x.rel=f?"stylesheet":_m,f||(x.as="script"),x.crossOrigin="",x.href=c,u&&x.setAttribute("nonce",u),document.head.appendChild(x),f)return new Promise((j,g)=>{x.addEventListener("load",j),x.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return l.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})},Au=e=>{let t;const n=new Set,r=(c,f)=>{const v=typeof c=="function"?c(t):c;if(!Object.is(v,t)){const p=t;t=f??(typeof v!="object"||v===null)?v:Object.assign({},t,v),n.forEach(x=>x(t,p))}},l=()=>t,a={setState:r,getState:l,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(r,l,a);return a},bm=e=>e?Au(e):Au,Lm=e=>e;function Im(e,t=Lm){const n=Ul.useSyncExternalStore(e.subscribe,Ul.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return Ul.useDebugValue(n),n}const Mu=e=>{const t=bm(e),n=r=>Im(t,r);return Object.assign(n,t),n},Ie=e=>e?Mu(e):Mu,Tl=[["overview","Overview"],["tickets","Tickets"],["features","Features"],["specs","Specs"],["run","Run"],["worktrees","Worktrees"],["docker","Docker"],["health","Health"],["cost","Cost"],["settings","Settings"]],gf=[],Jt=e=>{gf.push(e)},w=Ie((e,t)=>({version:"",projects:[],suggestions:[],sel:null,tab:"overview",detail:null,error:null,busy:!1,async guard(n){e({busy:!0});try{await n(),e({error:null})}catch(r){e({error:jt(r)})}e({busy:!1})},async refresh(){const[n,r]=await Promise.all([L.state(),L.discover()]);let l=t().sel;l&&!n.projects.some(i=>i.id===l)&&(l=null),e({projects:n.projects,version:n.version,suggestions:r.suggestions,sel:l})},async loadDetail(){const n=t().sel;if(e({detail:null}),!!n)try{const r=await L.project(n);t().sel===n&&e({detail:r,error:null})}catch(r){e({error:jt(r)})}},async reloadDetail(){const n=t().sel;if(n)try{const r=await L.project(n);t().sel===n&&e({detail:r})}catch(r){e({error:jt(r)})}},async act(n){await t().guard(async()=>{await n(),await t().reloadDetail()})},setError:n=>e({error:n}),setTab:n=>e({tab:n})})),Jr=(e,t="overview")=>{gf.forEach(n=>n()),w.setState({sel:e,tab:t,detail:null})},fa=e=>!!e&&Tl.some(([t])=>t===e),Qt=(e,t="overview")=>w.getState().guard(async()=>{Jr(e,t),await w.getState().loadDetail()}),ha=()=>{w.getState().sel!==null&&Jr(null)},Uu=e=>w.getState().guard(async()=>{let t;try{t=await L.addProject(e)}catch(n){if(n instanceof tr&&n.body.notCohorte&&window.confirm(`${n.message.replace(/ — run.*$/,"")}.
41
+
42
+ Set cohorte up in this repository from here?`)){const{openNewProject:r}=await mf(async()=>{const{openNewProject:l}=await Promise.resolve().then(()=>Sf);return{openNewProject:l}},void 0,import.meta.url);r("existing",e);return}throw n}await w.getState().refresh(),Jr(t.project.id),await w.getState().loadDetail()}),Dm=e=>w.getState().guard(async()=>{await L.removeProject(e),Jr(null),await w.getState().refresh()}),zm=e=>w.getState().guard(async()=>{await w.getState().refresh();const{projects:t}=w.getState();e.projectId&&t.some(n=>n.id===e.projectId)&&(Jr(e.projectId,fa(e.tab)?e.tab:"overview"),await w.getState().loadDetail())});function Om(e){const t=e.split(`
43
+
44
+ `),n=t.pop()??"",r=[];for(const l of t){const i=l.split(`
45
+ `).filter(o=>o.startsWith("data:")).map(o=>o.slice(5).trimStart()).join(`
46
+ `);if(i)try{const o=JSON.parse(i);for(const a of Array.isArray(o)?o:[o])Fm(a)&&r.push(a)}catch{}}return{events:r,rest:n}}function Fm(e){if(!e||typeof e!="object")return!1;const t=e;return(t.type==="job"||t.type==="run")&&typeof t.id=="string"&&typeof t.projectId=="string"&&typeof t.status=="string"}const Am=e=>Math.min(15e3,1e3*2**Math.max(0,e));function Mm({onEvents:e,onStatus:t}){let n=!1,r=null,l=0,i;const o=async()=>{r=new AbortController;try{const a=await fetch("/api/stream",{headers:{Authorization:`Bearer ${il}`,Accept:"text/event-stream"},signal:r.signal});if(!a.ok||!a.body)throw new Error(`HTTP ${a.status}`);l=0,t("live");const u=a.body.getReader(),c=new TextDecoder;let f="";for(;;){const{value:v,done:p}=await u.read();if(p)break;f+=c.decode(v,{stream:!0});const{events:x,rest:j}=Om(f);f=j,x.length&&e(x)}}catch{}n||(l+=1,t(l>=3?"polling":"reconnecting"),i=setTimeout(()=>{o()},Am(l)))};return t("connecting"),o(),()=>{n=!0,clearTimeout(i),r?.abort()}}function Um(e,t,n){return t.type!=="run"||!n?null:(t.pending??0)>(e?.pending??0)?"gate":e?.status==="running"&&(t.status==="done"||t.status==="failed")?"finished":null}const Wm=(e,t,n,r)=>e==="gate"?{title:`${t} needs you`,body:`${n} is waiting for an approval or an answer`}:{title:`${t}: ${r==="failed"?"failed":"done"}`,body:n},Bm=e=>e>0?`(${e}) Cohorte`:"Cohorte",qn=Ie(()=>({items:[]}));async function Cr(){try{qn.setState({items:(await L.activity()).items})}catch{}}function vf(e){const t={};for(const n of e){const r=t[n.projectId]??={running:0,pending:0};r.running+=1,r.pending+=n.pending}return t}const Vm=e=>e.reduce((t,n)=>t+n.pending,0),ol=Ie(()=>({git:null,error:null})),wt=Ie(()=>({wt:null,base:null,files:null,file:null,error:null}));Jt(()=>{ol.setState({git:null,error:null}),wt.setState({wt:null,base:null,files:null,file:null,error:null})});async function uo(){const e=w.getState().sel;if(e)try{const t=await L.git(e);w.getState().sel===e&&ol.setState({git:t,error:null})}catch(t){ol.setState({error:jt(t)})}}async function Hm(e){const t=w.getState().sel;if(t){wt.setState({wt:e,base:null,files:null,file:null,error:null});try{const n=await L.diffList(t,e);wt.setState({base:n.base,files:n.files})}catch(n){wt.setState({error:jt(n)})}}}async function Qm(e){const t=w.getState().sel,n=wt.getState().wt;if(!(!t||!n))try{wt.setState({file:await L.fileDiff(t,n,e),error:null})}catch(r){wt.setState({error:jt(r)})}}const Km=()=>wt.setState({wt:null,base:null,files:null,file:null,error:null}),Kt=["starting","running","ready"],xe=Ie((e,t)=>({job:null,watch:n=>e({job:{...n,lines:[],cursor:0}}),async poll(){const n=t().job,r=w.getState().sel;if(!n||!r)return!1;const l=await L.jobLogs(r,n.id,n.cursor),i=n.lines.concat(l.lines??[]).slice(-1500);e({job:{...l,lines:i,cursor:l.cursor??n.cursor}});const o=l.status!==n.status;return o&&await w.getState().reloadDetail(),Kt.includes(l.status)||o}}));Jt(()=>xe.setState({job:null}));const yf=e=>w.getState().act(async()=>{const t=w.getState().sel;t&&await L.stopJob(t,e)});function Ym(e){return!e||e.needsConfirmation!==!0?null:{command:e.command??"",reason:e.reason??""}}const Gm=e=>`The project's gate asks before running:
47
+
48
+ ${e.command}
49
+
50
+ ${e.reason}
51
+
52
+ Run it?`,xf=(e,t)=>`${e}
53
+
54
+ Fix: ${t||"run claude once in this folder and accept the trust dialog"}
55
+
56
+ Run anyway?`,qm=(e,t)=>`${e} usually takes an argument ${t}. Without one it may ask a free-text question this dashboard cannot answer.
57
+
58
+ Run without?`;function Xm(e,t){return!!e&&!t.trim()}const co=e=>({...e,events:e.events??[],cursor:e.cursor??0,pending:e.pending??[]}),de=Ie((e,t)=>({commands:null,form:{},run:null,setForm:n=>e({form:{...t().form,...n}}),watch:n=>e({run:co(n)}),async poll(){const n=t().run,r=w.getState().sel;if(!n||!r)return!1;const l=await L.run(r,n.id,n.cursor);return e({run:{...co(l),events:n.events.concat(l.events??[]).slice(-1500),cursor:l.cursor??n.cursor}}),l.status!=="running"?(await w.getState().reloadDetail(),!1):!0}}));Jt(()=>de.setState({run:null,form:{}}));async function pa(){if(!de.getState().commands)try{de.setState({commands:(await L.commands()).commands})}catch{de.setState({commands:[]})}}async function Jm(e){const t=w.getState().sel;if(!t)return;const n=(de.getState().commands??[]).find(l=>l.name===e.cmd);if(n&&Xm(n.argumentHint,e.args)&&!window.confirm(qm(n.name,n.argumentHint)))return;const r={worktree:e.wt,command:e.cmd,args:e.args,permissionMode:e.mode};await w.getState().guard(async()=>{let l;try{l=await L.startRun(t,r)}catch(i){if(!(i instanceof tr)||!i.body.untrusted)throw i;if(!window.confirm(xf(i.message,i.body.fix)))throw new Error("cancelled");l=await L.startRun(t,{...r,acknowledgeUntrusted:!0})}de.getState().watch(l.run)})}const Zm=e=>w.getState().guard(async()=>{const t=w.getState().sel,n=de.getState().run;if(!t||!n)return;const r=await L.reply(t,n.id,e);de.setState({run:{...co(r.run),events:n.events.concat(r.run.events?.slice(n.cursor)??[]),cursor:r.run.cursor??n.cursor}})});async function eg(e,t,n){const r=w.getState().sel,l=de.getState().run;if(!(!r||!l))try{await L.respond(r,l.id,{requestId:e,behavior:t,answers:n}),await de.getState().poll()}catch(i){w.getState().setError(i instanceof Error?i.message:String(i))}}const al=e=>w.getState().guard(async()=>{const t=w.getState().sel;t&&de.getState().watch(await L.run(t,e,0))}),Wu=e=>{try{return localStorage.getItem(e)}catch{return null}},Bu=(e,t)=>{try{localStorage.setItem(e,t)}catch{}},Ke=Ie(e=>({paletteOpen:!1,helpOpen:!1,specView:Wu("cohorte-spec-view")==="board"?"board":"list",notify:Wu("cohorte-notify")==="1",setPalette:t=>e({paletteOpen:t}),setHelp:t=>e({helpOpen:t}),setSpecView:t=>{Bu("cohorte-spec-view",t),e({specView:t})},setNotify:t=>{Bu("cohorte-notify",t?"1":"0"),e({notify:t})}})),Zr=e=>({...e,events:e.events??[],cursor:e.cursor??0,pending:e.pending??[]}),D=Ie(()=>({tickets:null,features:null,ticketId:null,featureId:null,feature:null,chat:null,inbox:[],settings:null,learning:null}));Jt(()=>D.setState({tickets:null,features:null,ticketId:null,featureId:null,feature:null,chat:null,settings:null,learning:null}));const X=()=>w.getState().sel,Ue=e=>w.getState().guard(e);async function jn(){const e=X();if(e)try{const t=await L.tickets(e);X()===e&&D.setState({tickets:t})}catch(t){w.getState().setError(t instanceof Error?t.message:String(t))}}async function _l(){const e=X();if(e)try{const t=await L.features(e);X()===e&&D.setState({features:t.features})}catch{}}async function $t(){const e=X(),t=D.getState().featureId;if(!(!e||!t))try{const n=await L.feature(e,t);X()===e&&D.getState().featureId===t&&D.setState({feature:n})}catch(n){w.getState().setError(n instanceof Error?n.message:String(n))}}async function ma(){try{D.setState({inbox:(await L.inbox()).items})}catch{}}async function Rl(){const e=X();if(e)try{const[t,n]=await Promise.all([L.settings(e),L.learning(e)]);X()===e&&D.setState({settings:t,learning:n})}catch(t){w.getState().setError(t instanceof Error?t.message:String(t))}}const ga=e=>D.setState({ticketId:e});async function Hr(e){D.setState({featureId:e,feature:null}),e&&await $t()}async function He(e){const t=X();if(!t||!e){D.setState({chat:null});return}try{D.setState({chat:Zr(await L.run(t,e,0))})}catch{D.setState({chat:null})}}async function Zt(){const e=X(),t=D.getState().chat;if(!e||!t)return!1;const n=await L.run(e,t.id,t.cursor);return D.getState().chat?.id!==t.id?!1:(D.setState({chat:{...Zr(n),events:t.events.concat(n.events??[]).slice(-2e3),cursor:n.cursor??t.cursor}}),n.status==="running")}const tg=e=>Ue(async()=>{const t=X(),n=D.getState().chat;!t||!n||(await L.reply(t,n.id,e),await Zt())});async function ng(e,t,n){const r=X(),l=D.getState().chat;if(!(!r||!l))try{await L.respond(r,l.id,{requestId:e,behavior:t,answers:n}),await Zt()}catch(i){w.getState().setError(i instanceof Error?i.message:String(i))}}const es=async()=>{await Promise.all([jn(),_l(),$t(),ma()])},rg=(e,t,n)=>Ue(async()=>{const r=X();if(!r)return;const l=await L.startPO(r,{text:e,requester:t,parent:n});D.setState({chat:Zr(l.run)}),await jn()}),Vu=(e,t)=>Ue(async()=>{const n=X();n&&(await L.decideTicket(n,e,t),await es())}),sg=e=>Ue(async()=>{const t=X();t&&(await L.createTicket(t,e),await jn())}),Hu=(e,t,n)=>Ue(async()=>{const r=X();if(!r)return;const l=await L.acceptance(r,e,{action:t,text:n});l.run&&D.setState({chat:Zr(l.run)}),await es()}),lg=e=>Ue(async()=>{const t=X();if(!t)return;let n={};for(let r=0;r<3;r++)try{await L.takeTicket(t,e,n);break}catch(l){if(!(l instanceof tr))throw l;if(l.body.needsConfirmation){if(!window.confirm(`The project's gate asks before running:
59
+
60
+ ${l.body.command}
61
+
62
+ ${l.body.reason??""}
63
+
64
+ Run it?`))throw new Error("cancelled");n={...n,confirmed:!0}}else if(l.body.dockerPreflight){if(!window.confirm(`${l.message}
65
+
66
+ Create the worktree anyway?`))throw new Error("cancelled");n={...n,skipDockerCheck:!0}}else if(l.body.untrusted){if(!window.confirm(xf(l.message,l.body.fix)))throw new Error("cancelled");n={...n,confirmed:!0}}else throw l}await es(),D.setState({featureId:e}),w.getState().setTab("features"),await $t()}),Qu=(e,t)=>Ue(async()=>{const n=X(),r=D.getState().featureId;!n||!r||(await L.checkpoint(n,r,{action:e,text:t}),await es())}),ig=e=>Ue(async()=>{const t=X(),n=D.getState().featureId;!t||!n||(await L.replyLead(t,n,e),await Promise.all([$t(),Zt()]))}),og=(e,t)=>Ue(async()=>{const n=X(),r=D.getState().featureId;n&&r&&(await L.contest(n,r,e,t),await $t())}),ag=()=>Ue(async()=>{const e=X(),t=D.getState().featureId;e&&t&&(await L.merge(e,t),await es())}),ug=e=>Ue(async()=>{const t=X();t&&D.setState({settings:await L.saveSettings(t,e)})}),cg=(e,t)=>Ue(async()=>{const n=X();n&&(await L.connectObsidian(n,{vault:e,board:t||void 0}),await Promise.all([Rl(),jn()]))}),dg=()=>Ue(async()=>{const e=X();if(!e)return;const t=await L.productMap(e);D.setState({chat:Zr(t.run)})});function hi(){if(ma(),w.getState().projects.find(n=>n.id===w.getState().sel)?.founding){mf(()=>Promise.resolve().then(()=>Sf),void 0,import.meta.url).then(n=>n.loadFounding());return}const t=w.getState().tab;t==="tickets"&&jn(),t==="features"&&(_l(),$t()),t==="settings"&&Rl()}const wn=Ie(()=>({status:"connecting"})),ts=e=>e==="live",Ku=new Map;let Yu={};const pt=(e,t,n)=>{clearTimeout(Yu[e]),Yu[e]=setTimeout(n,t)};async function fg(e){const t=Ku.get(e.id);if(e.type==="run"&&Ku.set(e.id,{status:e.status,pending:e.pending??0}),!Ke.getState().notify||typeof Notification>"u"||Notification.permission!=="granted")return;const n=Um(t,e,document.hidden);if(!n)return;qn.getState().items.some(a=>a.id===e.id)||await Cr();const r=w.getState().projects.find(a=>a.id===e.projectId),l=qn.getState().items.find(a=>a.id===e.id),{title:i,body:o}=Wm(n,r?.title||r?.name||"Cohorte",l?.label??"a cohorte command",e.status);try{const a=new Notification(i,{body:o,tag:`cohorte-${e.id}-${n}`});a.onclick=()=>{window.focus(),location.hash=`#/p/${e.projectId}/run`,a.close()}}catch{}}function hg(e){const t=w.getState();for(const n of e){if(n.type==="flow"){pt("flow",250,hi);continue}if(fg(n),n.type==="run"&&D.getState().chat?.id===n.id&&pt(`chat:${n.id}`,100,()=>{Zt()}),n.projectId!==t.sel){n.type==="run"&&pt("flow",400,hi);continue}if(n.type==="job"){const r=xe.getState().job;r&&r.id===n.id&&pt(`job:${n.id}`,150,()=>{xe.getState().poll()}),pt("detail",400,()=>{w.getState().reloadDetail(),w.getState().tab==="worktrees"&&uo()})}else{const r=de.getState().run;r&&r.id===n.id&&pt(`run:${n.id}`,100,()=>{de.getState().poll()}),n.status!=="running"&&pt("detail",300,()=>{w.getState().reloadDetail()}),pt("flow",400,hi)}}pt("activity",300,()=>{Cr()})}let Gu=!1;function pg(){Gu||(Gu=!0,Cr(),Mm({onEvents:hg,onStatus:e=>{wn.setState({status:e}),e==="live"&&Cr()}}),setInterval(()=>{Cr()},2e4))}function S({variant:e="default",className:t="",...n}){return s.jsx("button",{type:"button",className:`btn btn-${e} ${t}`.trim(),...n})}function C({tone:e="",children:t}){return s.jsx("span",{className:`pill${e?` pill-${e}`:""}`,children:t})}function va({tone:e}){return s.jsx("span",{className:`dot dot-${e}`,"aria-hidden":"true"})}function O({children:e,tone:t,className:n=""}){return s.jsx("div",{className:`card${t?` card-${t}`:""} ${n}`.trim(),children:e})}function at({value:e,label:t,tone:n,onClick:r}){const l=s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"stat-v",children:e}),s.jsx("div",{className:"muted",children:t})]});return r?s.jsx("button",{type:"button",className:`card stat link${n?` card-${n}`:""}`,onClick:r,children:l}):s.jsx("div",{className:`card stat${n?` card-${n}`:""}`,children:l})}const bl=({children:e})=>s.jsx("div",{className:"cards",children:e}),U=({children:e,plain:t=!1})=>s.jsx("h3",{className:`section${t?" plain":""}`,children:e}),b=({children:e,mono:t=!1})=>s.jsx("div",{className:`muted${t?" mono":""}`,children:e}),Ee=({children:e})=>s.jsx("div",{className:"empty",children:e}),Qr=({children:e})=>s.jsx("div",{className:"error",role:"alert",children:e}),Ll=({children:e,id:t,max:n})=>s.jsx("pre",{id:t,className:`pre${n===!1?"":" pre-max"}`,children:e});function ve({head:e,children:t}){return s.jsxs("table",{className:"table",children:[e?s.jsx("thead",{children:s.jsx("tr",{children:e.map((n,r)=>s.jsx("th",{scope:"col",children:n},r))})}):null,s.jsx("tbody",{children:t})]})}const fe=Ie(()=>({form:null,view:null,remote:null,remoteFor:null,remoteBusy:!1}));Jt(()=>fe.setState({view:null,remote:null,remoteFor:null}));const vn=()=>w.getState().sel,Il=e=>w.getState().guard(e),ul=(e="idea",t)=>{fe.setState({form:{mode:e,path:t}}),w.getState().sel&&w.setState({sel:null,detail:null})},jf=()=>fe.setState({form:null}),wf=e=>Il(async()=>{const t=await L.newProject(e);fe.setState({form:null,view:t.founding}),await w.getState().refresh(),await Qt(t.project.id),await He(t.founding.currentRunId)});async function fo(){const e=vn();if(e)try{const t=await L.founding(e);if(vn()!==e)return;const n=fe.getState().view;fe.setState({view:t});const r=D.getState().chat,l=t.currentRunId||t.stages[t.stages.length-1]?.runId||null;l&&(!r||n?.currentRunId!==t.currentRunId&&r.id!==l)&&await He(l),(t.phase==="done"||t.phase==="abandoned")&&await w.getState().refresh()}catch{}}const kf=e=>Il(async()=>{const t=vn();t&&(fe.setState({view:await L.foundingReply(t,e)}),await Zt())}),cl=(e,t)=>Il(async()=>{const n=vn();if(!n)return;const r=await L.foundingCheckpoint(n,{action:e,text:t});fe.setState({view:r}),r.currentRunId&&await He(r.currentRunId),e==="abandon"&&await w.getState().refresh()});async function ho(e=!1){const t=vn();if(t&&!(!e&&fe.getState().remoteFor===t)){fe.setState({remoteBusy:!0});try{const n=await L.remote(t);vn()===t&&fe.setState({remote:n,remoteFor:t})}catch(n){w.getState().setError(jt(n))}fe.setState({remoteBusy:!1})}}const po=e=>Il(async()=>{const t=vn();if(!t)return;const n=await L.connectRemote(t,e);xe.getState().watch(n.job)}),Sf=Object.freeze(Object.defineProperty({__proto__:null,closeNewProject:jf,connectRemote:po,createProject:wf,foundingCheckpoint:cl,foundingReply:kf,loadFounding:fo,loadRemote:ho,openNewProject:ul,useFounding:fe},Symbol.toStringTag,{value:"Module"})),mg=e=>e.error||e.missing||!e.summary||e.summary.bad?"bad":e.summary.warn?"warn":"ok";function gg(){const{projects:e,suggestions:t,sel:n,version:r}=w(),[l,i]=N.useState(""),o=vf(qn(u=>u.items)),a=u=>{u.preventDefault();const c=l.trim();c&&(Uu(c),i(""))};return s.jsxs("aside",{className:"sidebar",children:[s.jsxs("h1",{children:[s.jsx("button",{type:"button",className:"brand",onClick:ha,title:"Home","aria-label":"Cohorte home",children:"Cohorte"})," ",s.jsx("span",{className:"muted mono",children:r?`v${r}`:""})]}),s.jsx(S,{variant:"primary",className:"new-project-btn",onClick:()=>ul("idea"),children:"+ New project"}),s.jsxs("form",{className:"row-form",onSubmit:a,children:[s.jsx("input",{value:l,onChange:u=>i(u.target.value),placeholder:"/path/to/project","aria-label":"Project path"}),s.jsx(S,{type:"submit",children:"Add"})]}),s.jsx("nav",{"aria-label":"Projects",children:e.map(u=>s.jsxs("button",{type:"button",className:`proj${u.id===n?" sel":""}`,"aria-current":u.id===n?"true":void 0,onClick:()=>void Qt(u.id),children:[s.jsxs("span",{className:"proj-name",children:[s.jsx(va,{tone:mg(u)}),u.title||u.name,o[u.id]?.pending?s.jsx("span",{className:"badge-attn",title:"Waiting for you",children:o[u.id].pending}):o[u.id]?.running?s.jsx("span",{className:"badge-run",title:"Something is running",children:o[u.id].running}):null]}),s.jsx("span",{className:"muted mono",children:u.founding?"new project":u.missing?"folder missing":`${u.specTotal??0} spec${u.specTotal===1?"":"s"}`})]},u.id))}),t.length?s.jsx(U,{children:"Found on this machine"}):null,t.map(u=>s.jsxs("div",{className:"sug",children:[s.jsxs("span",{children:[s.jsx("div",{children:u.name}),s.jsx("div",{className:"muted mono",children:u.root})]}),s.jsx(S,{onClick:()=>void Uu(u.root),children:"Add"})]},u.root))]})}const mo={o:"overview",h:"health",s:"specs",r:"run",w:"worktrees",d:"docker",c:"cost"},vg=1200,yg=[["⌘K / Ctrl+K","Command palette"],["?","This help"],["g o","Overview"],["g h","Health"],["g s","Specs"],["g r","Run"],["g w","Worktrees"],["g d","Docker"],["g c","Cost"],["Esc","Close a dialog"]];function xg(e,t){return(e.meta||e.ctrl)&&e.key.toLowerCase()==="k"?{kind:"palette"}:e.typing||e.meta||e.ctrl||e.alt?null:t&&mo[e.key]?{kind:"tab",tab:mo[e.key]}:e.key==="g"?{kind:"chord"}:e.key==="?"?{kind:"help"}:null}const Dl=Ie(()=>({spec:null})),Er=Ie(()=>({metrics:null}));Jt(()=>{Dl.setState({spec:null}),Er.setState({metrics:null})});const dl=e=>w.getState().guard(async()=>{const t=w.getState().sel;t&&Dl.setState({spec:await L.spec(t,e)})}),jg=()=>Dl.setState({spec:null});async function ya(){const e=w.getState().sel;if(!(!e||Er.getState().metrics))try{Er.setState({metrics:await L.metrics(e)})}catch(t){Er.setState({metrics:{error:jt(t)}})}}function xa(e){w.getState().setTab(e),e==="run"&&pa(),e==="cost"&&ya(),Nf(e)}function Nf(e){e==="tickets"&&jn(),e==="features"&&(_l(),$t()),e==="settings"&&Rl()}const Cf=e=>{fa(e)&&xa(e)};function Ef(e){de.getState().setForm(e),xa("run")}const wg=e=>{const t=e;return!!t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable)};function kg(){return N.useEffect(()=>{let e=0;const t=n=>{const r=xg({key:n.key,meta:n.metaKey,ctrl:n.ctrlKey,alt:n.altKey,typing:wg(n.target)},Date.now()-e<vg);r&&(r.kind==="palette"?(n.preventDefault(),Ke.getState().setPalette(!Ke.getState().paletteOpen)):r.kind==="help"?(n.preventDefault(),Ke.getState().setHelp(!0)):r.kind==="chord"?e=Date.now():w.getState().sel&&(n.preventDefault(),e=0,Cf(r.tab)))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),null}function Sg({tabs:e,value:t,onChange:n,label:r}){const l=N.useRef([]),i=(o,a)=>{const u=o.key==="ArrowRight"?a+1:o.key==="ArrowLeft"?a-1:-1;if(u<0)return;const c=(u+e.length)%e.length;l.current[c]?.focus(),n(e[c].id)};return s.jsx("div",{className:"tabs",role:"tablist","aria-label":r,children:e.map((o,a)=>s.jsx("button",{ref:u=>{l.current[a]=u},type:"button",role:"tab",id:`tab-${o.id}`,"aria-selected":o.id===t,"aria-controls":"tabpanel",tabIndex:o.id===t?0:-1,className:`tab${o.id===t?" sel":""}`,onClick:()=>n(o.id),onKeyDown:u=>i(u,a),children:o.label},o.id))})}const qe=e=>typeof e=="number"?`$${e.toFixed(2)}`:"–",ks=e=>typeof e=="number"?e.toLocaleString():"–",$f=e=>e?`${Math.round(e/1e3)}s`:"";function Yt(e,t=Date.now()){const n=e?Date.parse(e):NaN;if(Number.isNaN(n))return"";const r=Math.max(0,Math.round((t-n)/1e3));return r<45?"just now":r<3600?`${Math.round(r/60)}m ago`:r<86400?`${Math.round(r/3600)}h ago`:`${Math.round(r/86400)}d ago`}function Ng(){const e=Er(r=>r.metrics);if(N.useEffect(()=>{ya()},[]),!e)return s.jsx(Ee,{children:"Loading…"});if("error"in e&&typeof e.error=="string")return s.jsx(Qr,{children:e.error});const t=e,n=t.totals??{};return s.jsxs("div",{children:[s.jsxs(bl,{children:[s.jsx(at,{value:qe(n.cost),label:"Total"}),s.jsx(at,{value:ks(n.runs),label:"Runs"}),s.jsx(at,{value:ks(n.sessions),label:"Sessions"}),s.jsx(at,{value:ks(n.agents),label:"Subagents"})]}),s.jsx(U,{children:"By command (last 30 days)"}),s.jsx(ve,{head:["Command","Runs","Cost"],children:(t.commands??[]).map(r=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:r.command}),s.jsx("td",{children:ks(r.runs)}),s.jsx("td",{children:qe(typeof r.cost=="object"?r.cost.total:r.cost)})]},r.command))})]})}function ht(e,t,n,r){const l=N.useRef(e);l.current=e,N.useEffect(()=>{if(!n)return;let i=!1,o;const a=async()=>{let u=!0;try{u=await l.current()!==!1}catch{}!i&&u&&(o=setTimeout(a,t))};return o=setTimeout(a,t),()=>{i=!0,clearTimeout(o)}},[t,n,r])}async function zl(e,t=n=>window.confirm(n)){try{return await e(!1)}catch(n){const r=n instanceof tr?Ym(n.body):null;if(!r)throw n;if(!t(Gm(r)))throw new Error("cancelled");return e(!0)}}const $r=Ie(e=>({docker:null,async load(){const t=w.getState().sel;if(t)try{e({docker:await L.docker(t)})}catch(n){e({docker:{error:jt(n)}})}}}));Jt(()=>$r.setState({docker:null}));const Dt=(e,t)=>w.getState().act(async()=>{const n=w.getState().sel;if(!n||e==="down"&&!window.confirm(`Stop and remove the stack’s containers?
67
+
68
+ Volumes (your data) are kept.`))return;const r=await zl(l=>L.dockerAct(n,{action:e,service:t,confirmed:l}));xe.getState().watch(r.job),setTimeout(()=>{w.getState().tab==="docker"&&$r.getState().load()},2500)});function fl({only:e}){const t=xe(r=>r.job),n=N.useRef(null);return N.useEffect(()=>{const r=n.current;r&&(r.scrollTop=r.scrollHeight)},[t?.lines.length]),!t||e&&!e.test(t.label)?null:s.jsxs(s.Fragment,{children:[s.jsxs(U,{children:[t.label," · ",s.jsx("span",{"aria-live":"polite",children:t.status}),Kt.includes(t.status)?s.jsxs(s.Fragment,{children:[" ",s.jsx(S,{onClick:()=>void yf(t.id),children:"Stop"})]}):null]}),s.jsx(b,{mono:!0,children:t.command}),s.jsx("pre",{ref:n,className:"pre pre-max","aria-label":"Job output",children:t.lines.join(`
69
+ `)})]})}const Cg={running:"ok",exited:"warn",dead:"bad",restarting:"warn"},Eg=e=>e==="healthy"?"ok":e==="unhealthy"?"bad":"warn";function $g({v:e,up:t,busy:n}){return s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:e.name}),s.jsxs("td",{children:[s.jsx(C,{tone:Cg[e.state]??"",children:e.state}),e.health?s.jsxs(s.Fragment,{children:[" ",s.jsx(C,{tone:Eg(e.health),children:e.health})]}):null]}),s.jsx("td",{className:"mono",children:e.ports.join(", ")}),s.jsx("td",{className:"muted",children:e.status}),s.jsx("td",{children:s.jsx("div",{className:"actions",children:t?s.jsxs(s.Fragment,{children:[e.state==="running"?s.jsx(S,{disabled:n,onClick:()=>void Dt("stop",e.name),children:"Stop"}):s.jsx(S,{disabled:n,onClick:()=>void Dt("up",e.name),children:"Start"}),s.jsx(S,{disabled:n,onClick:()=>void Dt("restart",e.name),children:"Restart"}),s.jsx(S,{onClick:()=>void Dt("logs",e.name),children:"Logs"})]}):null})})]})}function Pg({d:e}){const t=$r(f=>f.docker),n=xe(f=>f.job),r=w(f=>f.tab);if(N.useEffect(()=>{$r.getState().load()},[]),ht(async()=>{await $r.getState().load()},4e3,r==="docker","docker"),!e.docker)return s.jsx(Ee,{children:"No compose file here. Declare isolation.compose_file in PIPELINE.md, or add a docker-compose.yml at the repo root."});if(!t)return s.jsx(Ee,{children:"Loading…"});if("error"in t&&typeof t.error=="string")return s.jsx(Qr,{children:t.error});const l=t,i=l.daemon,o=l.services??[],a=!!i?.up,u=!!n&&Kt.includes(n.status)&&/^docker/.test(n.label),c=!a||u;return s.jsxs("div",{children:[s.jsxs(bl,{children:[s.jsxs(O,{children:[s.jsxs("div",{className:"stat-v",children:[s.jsx(va,{tone:a?"ok":"bad"})," ",a?"Docker up":"Docker down"]}),s.jsx("div",{className:"muted",children:a?`engine ${i?.version??""}`:i?.error})]}),s.jsxs(O,{children:[s.jsx("div",{className:"stat-v",children:`${l.running??0}/${o.length}`}),s.jsx("div",{className:"muted",children:"services running"})]}),s.jsxs(O,{children:[s.jsx("div",{className:"stat-v mono small",children:l.file}),s.jsx("div",{className:"muted",children:"compose file"})]})]}),l.configError?s.jsx(Qr,{children:`compose: ${l.configError}`}):null,a?null:s.jsx(b,{children:"Start Docker Desktop (or the docker service). scripts/new-feature.sh needs it to create a worktree’s database."}),s.jsxs("div",{className:"toolbar",children:[s.jsx(S,{disabled:c,onClick:()=>void Dt("up"),children:"Start stack"}),s.jsx(S,{disabled:c,onClick:()=>void Dt("restart"),children:"Restart all"}),s.jsx(S,{disabled:c,onClick:()=>void Dt("stop"),children:"Stop all"}),s.jsx(S,{disabled:c,onClick:()=>void Dt("down"),children:"Down (keeps volumes)"})]}),s.jsx(ve,{head:["Service","State","Ports","Status",""],children:o.map(f=>s.jsx($g,{v:f,up:a,busy:u},f.name))}),s.jsx(fl,{only:/^docker/})]})}const Tg=e=>e==="ok"?"ok":e==="warn"?"warn":e==="bad"?"bad":"";function _g({d:e}){const t=e.doctor.summary;return s.jsxs("div",{children:[s.jsx(bl,{children:["ok","warn","bad","skip"].map(n=>s.jsx(at,{value:t[n],label:n},n))}),s.jsx(U,{children:"Checks"}),s.jsx(ve,{head:["Check","Status","Detail"],children:e.doctor.checks.map((n,r)=>s.jsxs("tr",{children:[s.jsx("td",{children:n.label}),s.jsx("td",{children:s.jsx(C,{tone:Tg(n.status),children:n.status})}),s.jsxs("td",{children:[n.detail,n.fix?s.jsx("div",{className:"fix",children:`fix: ${n.fix}`}):null]})]},r))})]})}/**
70
+ * @license lucide-react v1.75.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const Rg=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
75
+ * @license lucide-react v1.75.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */function bg(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:Rg(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}/**
80
+ * @license lucide-react v1.75.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const Lg=e=>{let t="",n=!1;for(const r of e){if(r==="-"||r==="_"||r<=" "){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t};/**
85
+ * @license lucide-react v1.75.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const Ig=e=>{const t=Lg(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
90
+ * @license lucide-react v1.75.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const go=(...e)=>{const t=new Set;for(const n of e)if(typeof n=="string")for(const r of n.split(/\s+/))r&&t.add(r);return[...t].join(" ")};/**
95
+ * @license lucide-react v1.75.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const rn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
100
+ * @license lucide-react v1.75.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */function pi(e){return e!=null}function Dg(e,t={}){const n=t.attributeNames??{},r=p=>n[p]??p,l=e.size??e.width??rn.width,i=e.size??e.height??rn.height,o=e.aliases?.filter(p=>typeof p=="string"&&p.trim()!=="").map(p=>`lucide-${p}`)??[],a=[...e.name?[`lucide-${e.name}`]:[],...o],u=t.className?.split(" ").filter(Boolean)??[],c=t.includeDefaultClasses===!1?go(...u):go("lucide",...a,...u),f=t.absoluteStrokeWidth?Number(t.strokeWidth??rn["stroke-width"])*Number(e.size??e.width??rn.width)/Number(t.size??t.width??rn.width):t.strokeWidth??rn["stroke-width"];return["svg",{...Object.entries(rn).reduce((p,[x,j])=>(p[r(x)]=j,p),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&pi(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&pi(t.width)&&{[r("width")]:t.width},..."height"in t&&pi(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:f,...c&&{[r("class")]:c},[r("viewBox")]:`0 0 ${l} ${i}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(p=>{const[x,j,g]=p,T=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...j}:j;return g?[x,T,g]:[x,T]})]}/**
105
+ * @license lucide-react v1.75.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */function zg(e,t={}){return Dg(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
110
+ * @license lucide-react v1.75.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const Og=e=>{if(e==null||typeof e!="object")return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith("aria-")||t==="role"||t==="title")&&e[t]!=null)return!0;return!1},Fg=N.createContext({}),Ag=()=>N.useContext(Fg),Mg=N.forwardRef(({color:e,size:t,width:n,height:r,strokeWidth:l,absoluteStrokeWidth:i,nonScalingStroke:o,className:a="",children:u,iconNode:c=[],icon:f={node:c,aliases:[],size:24},...v},p)=>{const{size:x=24,strokeWidth:j=2,absoluteStrokeWidth:g=!1,nonScalingStroke:T=!1,color:h="currentColor",className:d=""}=Ag()??{},m=!!u||Og(v),[y,E,_=[]]=zg(f,{color:e??h,width:n??t??x,height:r??t??x,strokeWidth:l??j,absoluteStrokeWidth:i??g,nonScalingStroke:o??T,className:go(d,a),hasA11yProp:m,attributes:v});return N.createElement(y,{ref:p,...E},[..._.map(([R,I])=>N.createElement(R,I)),...Array.isArray(u)?u:[u]])});/**
115
+ * @license lucide-react v1.75.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */function en(e,t=[],n=[]){const r=typeof e=="string"?bg(e,t,n):e,l=N.forwardRef(({className:i,...o},a)=>N.createElement(Mg,{ref:a,icon:r,className:i,...o}));return r.name&&(l.displayName=Ig(r.name)),l}/**
120
+ * @license lucide-react v1.75.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const Pf={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};Pf.node;const Ug=en(Pf);/**
125
+ * @license lucide-react v1.75.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const Tf={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};Tf.node;const Wg=en(Tf);/**
130
+ * @license lucide-react v1.75.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const _f={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5",key:"1awbb0"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};_f.node;const Bg=en(_f);/**
135
+ * @license lucide-react v1.75.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const Rf={name:"layout-grid",size:24,node:[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]};Rf.node;const Vg=en(Rf);/**
140
+ * @license lucide-react v1.75.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const bf={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};bf.node;const Hg=en(bf);/**
145
+ * @license lucide-react v1.75.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Lf={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};Lf.node;const Qg=en(Lf);/**
150
+ * @license lucide-react v1.75.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const If={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};If.node;const Kg=en(If);/**
155
+ * @license lucide-react v1.75.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const Df={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};Df.node;const Yg=en(Df),Gg=[{key:"spec",label:"Spec"},{key:"build",label:"Build"},{key:"review",label:"Review"},{key:"verify",label:"Verify"},{key:"ship",label:"Ship"},{key:"done",label:"Closed"}];function qg(e){return e.status==="abandoned"?"done":(e.pipeline?.stages??[]).find(r=>r.state!=="done"&&r.state!=="skipped")?.key??"done"}function zf(e,t){const n=e.pipeline?.next;if(!n)return null;const r=t.filter(i=>!i.bare),l=r.find(i=>i.branch&&e.branch&&i.branch===e.branch)??r.find(i=>i.main)??r[0];return l?{wt:l.path,cmd:n.command,args:n.args}:null}const Xg=e=>{const t=e.pipeline?.next;return t?`Run /${t.command} ${t.args}`:""};function ja({spec:e,worktrees:t,why:n=!1}){const r=zf(e,t),l=e.pipeline?.next;return!l||!r?null:s.jsxs("span",{className:"next",children:[s.jsx(S,{variant:"primary",title:l.why,onClick:i=>{i.stopPropagation(),Ef(r)},children:Xg(e)}),n?s.jsxs("span",{className:"muted",children:[" — ",l.why]}):null]})}const wa=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:null,q=e=>typeof e=="string"?e:typeof e=="number"?String(e):"",Xn=e=>Array.isArray(e)?e:[];function Jg(e){return Xn(e.checks).map(t=>wa(t)).filter(t=>!!t).map(t=>({name:q(t.name),status:q(t.status),note:q(t.note)}))}function vo(e){const t=wa(e.surfaces);return t?Object.entries(t).map(([n,r])=>({name:n,state:q(r)})):Xn(e.surfaces).map(n=>({name:q(n),state:""}))}const Of=["CRITICAL","HIGH","MEDIUM","LOW"];function Zg(e){const t=Object.fromEntries(Of.map(n=>[n,0]));for(const n of e)t[n.severity]=(t[n.severity]??0)+1;return t}const ev={CRITICAL:"bad",HIGH:"bad",MEDIUM:"warn",LOW:""};function qu({rows:e,deferred:t}){return s.jsx(ve,{head:["Severity","Location","Category","Problem","Fix",...t?["Out of scope"]:[]],children:e.map((n,r)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(C,{tone:ev[n.severity]??"",children:n.severity.toLowerCase()})}),s.jsx("td",{className:"mono nowrap",children:n.file?`${n.file}${n.line!=null?`:${n.line}`:""}`:""}),s.jsx("td",{children:n.category}),s.jsx("td",{children:n.problem}),s.jsx("td",{children:n.fix}),t?s.jsx("td",{className:"muted",children:n.outOfScope}):null]},r))})}function tv({rows:e}){const t=Zg(e);return s.jsx("div",{className:"sev-strip","aria-label":"Findings by severity",children:Of.map(n=>s.jsxs("span",{className:`sev sev-${n.toLowerCase()}${t[n]?"":" zero"}`,children:[s.jsx("strong",{children:t[n]})," ",n.toLowerCase()]},n))})}function nv({review:e}){return e.findings.length||e.deferred.length||e.raw?s.jsxs("div",{children:[s.jsxs(U,{children:["Review findings",e.verdict?` · ${e.verdict}`:""]}),s.jsx(tv,{rows:e.findings}),e.findings.length?s.jsx(qu,{rows:e.findings,deferred:!1}):s.jsx(b,{children:"None."}),e.deferred.length?s.jsxs(s.Fragment,{children:[s.jsxs(U,{children:["Deferred (",e.deferred.length,")"]}),s.jsx(qu,{rows:e.deferred,deferred:!0})]}):null,e.raw?s.jsxs("details",{className:"disclose",children:[s.jsx("summary",{children:"Raw review report"}),s.jsx(Ll,{children:e.raw})]}):null]}):s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"Review findings"}),s.jsx(b,{children:"No review report yet — /cohorte-review writes specs/reports/<id>.md."})]})}const rv={READY:"ok",SHIP:"ok",PASS:"ok",REVISE:"warn",SKIPPED:"",BLOCK:"bad",FAIL:"bad"},ka=e=>rv[e]??"warn";function ns({title:e,r:t}){return s.jsxs("div",{className:"rc-head",children:[s.jsx("strong",{children:e}),q(t.ts)?s.jsx("span",{className:"muted mono",children:q(t.ts)}):null]})}function sv({r:e}){const t=Xn(e.gaps).map(q).filter(Boolean);return s.jsxs(O,{children:[s.jsx(ns,{title:"Readiness",r:e}),s.jsx(C,{tone:ka(q(e.verdict)),children:q(e.verdict)||"–"}),vo(e).length?s.jsx("div",{className:"rc-row",children:vo(e).map(n=>s.jsx(C,{children:n.name},n.name))}):null,t.length?s.jsx("ul",{className:"rc-list",children:t.map((n,r)=>s.jsx("li",{children:n},r))}):s.jsx(b,{children:"No gaps."})]})}function lv({r:e}){const t=Xn(e.dead).map(q).filter(Boolean);return s.jsxs(O,{children:[s.jsx(ns,{title:"Build",r:e}),s.jsx("div",{className:"rc-row",children:vo(e).map(n=>s.jsx(C,{tone:n.state==="ok"?"ok":"bad",children:`${n.name}: ${n.state||"?"}`},n.name))}),t.length?s.jsxs(b,{children:["Agents that died: ",t.join(", ")]}):null]})}function iv({r:e}){const t=n=>typeof e[n]=="number"?String(e[n]):"–";return s.jsxs(O,{children:[s.jsx(ns,{title:"Review verdict",r:e}),s.jsx(C,{tone:ka(q(e.verdict)),children:q(e.verdict)||"–"}),s.jsx("div",{className:"rc-row muted",children:`${t("blocking")} blocking · ${t("findings")} findings · ${t("security")} security · ${t("deferred")} deferred`}),q(e.aborted)?s.jsxs(b,{children:["Aborted: ",q(e.aborted)]}):null,Xn(e.unreviewed).length?s.jsxs(b,{children:["Unreviewed surfaces: ",Xn(e.unreviewed).map(q).join(", ")]}):null]})}function ov({r:e}){const t=Jg(e);return s.jsxs(O,{children:[s.jsx(ns,{title:"Verify",r:e}),s.jsx(C,{tone:ka(q(e.verdict)),children:q(e.verdict)||"–"}),q(e.reason)?s.jsx(b,{children:q(e.reason)}):null,t.length?s.jsx("ul",{className:"rc-list",children:t.map((n,r)=>s.jsxs("li",{children:[s.jsx(C,{tone:n.status==="PASS"?"ok":n.status==="FAIL"?"bad":"",children:n.status||"–"})," ",s.jsx("span",{className:"mono",children:n.name}),n.note?s.jsxs("span",{className:"muted",children:[" — ",n.note]}):null]},r))}):null]})}function av({r:e}){return s.jsxs(O,{children:[s.jsx(ns,{title:"Loop",r:e}),s.jsx(C,{tone:q(e.outcome)?"bad":"warn",children:q(e.outcome)||"resumable"}),q(e.reason)?s.jsx(b,{children:q(e.reason)}):null]})}const uv=[["readiness",e=>s.jsx(sv,{r:e})],["build",e=>s.jsx(lv,{r:e})],["verdict",e=>s.jsx(iv,{r:e})],["verify",e=>s.jsx(ov,{r:e})],["loop",e=>s.jsx(av,{r:e})]];function cv({reports:e}){const t=uv.map(([n,r])=>[n,wa(e[n]),r]).filter(n=>!!n[1]);return t.length?s.jsxs("div",{children:[s.jsx(U,{children:"Reports"}),s.jsx("div",{className:"cards rc",children:t.map(([n,r,l])=>s.jsx("div",{children:l(r)},n))}),s.jsxs("details",{className:"disclose",children:[s.jsx("summary",{children:"Raw JSON"}),t.map(([n,r])=>s.jsxs("div",{children:[s.jsx(U,{children:n}),s.jsx(Ll,{children:JSON.stringify(r,null,2)})]},n))]})]}):null}const dv={done:"✓",current:"●",blocked:"!",skipped:"–",todo:""};function Ff({stages:e}){return s.jsx("ol",{className:"stepper","aria-label":"Pipeline stages",children:e.map(t=>s.jsxs("li",{className:`step step-${t.state}`,title:`${t.label}: ${t.state}`,children:[s.jsx("span",{className:"step-mark","aria-hidden":"true",children:dv[t.state]}),s.jsxs("span",{className:"step-label",children:[t.label,s.jsx("span",{className:"sr-only",children:` — ${t.state}`})]})]},t.key))})}const fv=(e,t)=>e==="SHIP"&&!t?"ok":e==="BLOCK"?"bad":e==="REVISE"?"warn":"";function Sa({v:e}){if(!e)return null;const t=e.findings!=null?` · ${e.blocking??0} blocking / ${e.findings}`:"";return s.jsx(C,{tone:fv(e.verdict,e.blocking),children:`${e.verdict||"no verdict"}${t}`})}function hv({spec:e,d:t}){const n=e.spec;return s.jsxs("div",{children:[s.jsx(S,{onClick:jg,children:"← Specs"}),s.jsx("h2",{className:"spec-title",children:n.title||n.id}),s.jsx(b,{mono:!0,children:`${n.id} · ${n.status||"unknown"}${n.kind?` · ${n.kind}`:""}${n.branch?` · ${n.branch}`:""}`}),s.jsxs("div",{className:"spec-head",children:[s.jsx(Ff,{stages:e.pipeline.stages}),s.jsx(Sa,{v:e.pipeline.verdict})]}),s.jsx(ja,{spec:{...n,pipeline:e.pipeline},worktrees:t.worktrees,why:!0}),s.jsx(nv,{review:e.review}),s.jsx(cv,{reports:e.reports}),s.jsx(U,{children:"Spec"}),s.jsx(Ll,{children:e.body})]})}const Af={shipped:"ok",merged:"ok",blocked:"bad",abandoned:"warn"},Mf=e=>Af[e.status]??(e.tone==="warn"?"warn":""),Uf=e=>({tabIndex:0,onClick:()=>void dl(e),onKeyDown:t=>{t.key==="Enter"&&dl(e)}});function pv(){const{specView:e,setSpecView:t}=Ke(),n=(r,l,i)=>s.jsxs("button",{type:"button",className:`seg${e===r?" sel":""}`,"aria-pressed":e===r,onClick:()=>t(r),children:[i,l]});return s.jsxs("div",{className:"seg-group",role:"group","aria-label":"Spec layout",children:[n("list","List",s.jsx(Hg,{size:13})),n("board","Board",s.jsx(Vg,{size:13}))]})}function mv({d:e}){return s.jsx(ve,{head:["Spec","Pipeline","Status","Next"],children:e.specs.map(t=>s.jsxs("tr",{className:"click",...Uf(t.id),children:[s.jsxs("td",{children:[s.jsx("div",{className:"mono",children:t.id}),s.jsx("div",{children:t.title}),t.branch?s.jsx("div",{className:"muted mono",children:t.branch}):null]}),s.jsx("td",{children:t.pipeline?s.jsx(Ff,{stages:t.pipeline.stages}):null}),s.jsxs("td",{children:[s.jsx(C,{tone:Mf(t),children:t.status}),t.pipeline?.verdict?s.jsx("div",{className:"gap-top",children:s.jsx(Sa,{v:t.pipeline.verdict})}):null]}),s.jsx("td",{children:s.jsx(ja,{spec:t,worktrees:e.worktrees})})]},t.id))})}function gv({d:e}){return s.jsx("div",{className:"board",role:"list",children:Gg.map(t=>{const n=e.specs.filter(r=>qg(r)===t.key);return s.jsxs("section",{className:"col",role:"listitem","aria-label":`${t.label}, ${n.length} specs`,children:[s.jsxs("h4",{className:"col-head",children:[t.label,s.jsx("span",{className:"count",children:n.length})]}),n.map(r=>s.jsxs("article",{className:"spec-card click",...Uf(r.id),children:[s.jsx("div",{className:"mono",children:r.id}),s.jsx("div",{children:r.title}),s.jsxs("div",{className:"spec-card-meta",children:[s.jsx(C,{tone:Mf(r),children:r.status}),s.jsx(Sa,{v:r.pipeline?.verdict??null})]}),s.jsx(ja,{spec:r,worktrees:e.worktrees})]},r.id))]},t.key)})})}function vv({d:e}){const t=Dl(r=>r.spec),n=Ke(r=>r.specView);return t?s.jsx(hv,{spec:t,d:e}):e.specs.length?s.jsxs("div",{children:[s.jsxs("div",{className:"toolbar between",children:[s.jsx("span",{className:"muted",children:`${e.specs.length} spec${e.specs.length===1?"":"s"}`}),s.jsx(pv,{})]}),n==="board"?s.jsx(gv,{d:e}):s.jsx(mv,{d:e})]}):s.jsx(Ee,{children:"No specs yet. Run /cohorte-brainstorm in Claude Code."})}function Wf({compact:e=!1}){const t=w(T=>T.sel),n=w(T=>T.projects.find(h=>h.id===T.sel)),r=fe(T=>T.remote),l=fe(T=>T.remoteBusy),i=xe(T=>T.job),[o,a]=N.useState("github"),[u,c]=N.useState(""),[f,v]=N.useState("private"),[p,x]=N.useState("");N.useEffect(()=>{ho()},[t]),N.useEffect(()=>{n&&!u&&c(n.name)},[n?.name]);const j=!!i&&/^(GitHub|push) · /.test(i.label);if(ht(async()=>{const T=await xe.getState().poll();return T||await ho(!0),T},1200,j&&Kt.includes(i?.status??""),`${i?.id}:${i?.status}`),!r)return e?null:s.jsx(O,{children:s.jsx(b,{children:l?"Looking at the code host…":"Unknown."})});if(r.origin)return e?null:s.jsxs(O,{children:[s.jsx(C,{tone:"ok",children:"Hosted"}),s.jsx("div",{className:"mono gap-top",children:r.origin}),r.ahead?s.jsx(b,{children:`${r.ahead} commit${r.ahead===1?"":"s"} not pushed yet on ${r.branch}`}):null,j?s.jsx(fl,{}):null]});const g=T=>{T.preventDefault(),o==="github"?u.trim()&&po({kind:o,name:u.trim(),visibility:f}):p.trim()&&po({kind:o,url:p.trim()})};return s.jsxs(O,{children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:"idle",children:"On this machine only"}),s.jsx("span",{className:"muted",children:"No code host yet — the code is safe here, but pull requests need one."})]}),s.jsxs("form",{onSubmit:g,className:"gap-top",children:[s.jsxs("div",{className:"seg",role:"radiogroup","aria-label":"Code host",children:[s.jsxs("label",{children:[s.jsx("input",{type:"radio",name:"host",checked:o==="github",onChange:()=>a("github")})," A new GitHub repository"]}),s.jsxs("label",{children:[s.jsx("input",{type:"radio",name:"host",checked:o==="url",onChange:()=>a("url")})," A repository I already created (GitLab, GitHub, other)"]})]}),o==="github"?r.gh.installed?r.gh.authed?s.jsxs("div",{className:"row-form wrap",children:[s.jsx("input",{value:u,onChange:T=>c(T.target.value),"aria-label":"Repository name",placeholder:"name, or owner/name for an organisation"}),s.jsxs("select",{value:f,onChange:T=>v(T.target.value),"aria-label":"Visibility",children:[s.jsx("option",{value:"private",children:"Private"}),s.jsx("option",{value:"internal",children:"Internal"}),s.jsx("option",{value:"public",children:"Public"})]}),s.jsx(S,{type:"submit",variant:"primary",disabled:!u.trim()||j&&Kt.includes(i?.status??""),children:`Create on GitHub as ${r.gh.user??"you"} and push`})]}):s.jsxs(b,{children:["The GitHub CLI is not signed in: run ",s.jsx("span",{className:"mono",children:"gh auth login"})," in a terminal once, then reload this page."]}):s.jsx(b,{children:"The GitHub CLI is not installed: install it from cli.github.com, or use a repository you created yourself."}):s.jsxs("div",{className:"row-form wrap",children:[s.jsx("input",{value:p,onChange:T=>x(T.target.value),"aria-label":"Repository URL",placeholder:"git@gitlab.com:team/project.git or https://…"}),s.jsx(S,{type:"submit",variant:"primary",disabled:!p.trim(),children:"Connect and push"})]}),s.jsx(b,{children:"The pipeline profile is pointed at the new host (so shipping opens pull requests there), committed, then everything is pushed."})]}),j?s.jsx(fl,{}):null]})}function yv({d:e}){const t=w(c=>c.setTab),n=xe(c=>c.watch),r=e.doctor.summary,l={};for(const c of e.specs)l[c.status||"unknown"]=(l[c.status||"unknown"]??0)+1;const i=e.worktrees.filter(c=>c.dev&&Kt.includes(c.dev.status)),o=(e.runs??[]).filter(c=>c.status==="running"),a=e.doctor.checks.filter(c=>c.status==="bad"||c.status==="warn"),u=Object.entries(l).map(([c,f])=>`${f} ${c}`).join(", ");return s.jsxs("div",{children:[s.jsx(Wf,{compact:!0}),s.jsxs(bl,{children:[s.jsx(at,{value:r.bad?`${r.bad} failing`:r.warn?`${r.warn} to review`:"Healthy",label:"pipeline health",tone:r.bad?"bad":r.warn?"warn":"ok",onClick:()=>t("health")}),s.jsx(at,{value:e.specs.length,label:`specs${u?` · ${u}`:""}`,onClick:()=>t("specs")}),s.jsx(at,{value:e.worktrees.length,label:`worktree${e.worktrees.length===1?"":"s"} · ${i.length} dev server${i.length===1?"":"s"} up`,onClick:()=>t("worktrees")}),s.jsx(at,{value:o.length?`${o.length} running`:"Idle",label:"cohorte commands",onClick:()=>t("run")}),e.docker?s.jsx(at,{value:"Docker",label:e.docker.file,onClick:()=>t("docker")}):null]}),s.jsx(U,{children:"Needs attention"}),a.length?s.jsx(ve,{children:a.map((c,f)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(C,{tone:c.status==="bad"?"bad":"warn",children:c.status})}),s.jsx("td",{children:c.label}),s.jsxs("td",{children:[c.detail,c.fix?s.jsx("div",{className:"fix",children:`fix: ${c.fix}`}):null]})]},f))}):s.jsx(b,{children:"Nothing — every check passes."}),i.length?s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"Running now"}),s.jsx(ve,{children:i.map(c=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:c.branch||c.path}),s.jsx("td",{children:s.jsx(C,{tone:c.dev?.status==="ready"?"ok":"",children:`dev · ${c.dev?.status}`})}),s.jsx("td",{children:s.jsx(S,{onClick:()=>{c.dev&&n(c.dev),t("worktrees")},children:"Logs"})})]},c.path))})]}):null,e.specs.length?s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"Latest specs"}),s.jsx(ve,{children:e.specs.slice(0,5).map(c=>s.jsxs("tr",{className:"click",tabIndex:0,onClick:()=>{t("specs"),dl(c.id)},onKeyDown:f=>{f.key==="Enter"&&(t("specs"),dl(c.id))},children:[s.jsx("td",{className:"mono",children:c.id}),s.jsx("td",{children:c.title}),s.jsx("td",{children:s.jsx(C,{tone:Af[c.status]??"",children:c.status})})]},c.id))})]}):null]})}function xv(e,t){for(let n=t-1;n>=0;n--){const r=e[n];if(r.kind==="text")return r.text}}const jv=(e,t)=>!!e&&e!==t;function wv({e,last:t}){switch(e.kind){case"text":return s.jsx("div",{className:"ev",children:e.text});case"tool":return s.jsx("div",{className:"ev muted mono",children:`▸ ${e.name} ${e.summary}`});case"tool_result":return e.error?s.jsx("div",{className:"ev error mono",children:`✗ ${e.text}`}):null;case"reply":return s.jsxs("div",{className:"ev reply",children:[s.jsx("span",{className:"muted",children:"you · "}),e.text]});case"resolved":return s.jsx("div",{className:"ev muted",children:`gate: ${e.decision}`});case"result":return s.jsxs("div",{className:`ev${e.ok?"":" error"}`,children:[s.jsx("strong",{children:e.ok?"Done":"Failed"}),e.costUsd!=null?` · ${qe(e.costUsd)}`:"",e.durationMs?` · ${$f(e.durationMs)}`:"",jv(e.text,t)?s.jsx("div",{children:e.text}):null]});case"stderr":case"system":return s.jsx("div",{className:"ev error mono",children:e.text});default:return null}}function kv({events:e}){return s.jsx("div",{className:"feed","aria-live":"polite",children:e.map((t,n)=>s.jsx(wv,{e:t,last:xv(e,n)},n))})}function Sv({p:e,onRespond:t}){const[n,r]=N.useState(()=>{const i=e.questions?.[0];return e.advice?.choice&&i?{[i.question]:[e.advice.choice]}:{}}),l=(i,o)=>r(a=>({...a,[i]:o}));return e.deciding?s.jsxs(O,{className:"gate",children:[s.jsx(C,{tone:"info",children:"Decider"})," ",s.jsx("span",{className:"muted",children:"is checking whether what you already decided answers this…"}),(e.questions??[]).map(i=>s.jsx("div",{className:"gap-top",children:i.question},i.question))]}):s.jsxs(O,{tone:"warn",className:"gate",children:[s.jsx(C,{tone:"warn",children:"Question"}),e.advice?s.jsxs("div",{className:"advice",children:[s.jsx("span",{className:"muted",children:"Decider: "}),e.advice.choice?s.jsxs(s.Fragment,{children:["would pick ",s.jsx("strong",{children:e.advice.choice}),e.advice.rationale?` — ${e.advice.rationale}`:"",". "]}):null,s.jsx("span",{className:"muted",children:`Handed to you: ${e.advice.escalated}.`})]}):null,(e.questions??[]).map(i=>{const o=n[i.question]??[];return s.jsxs("fieldset",{className:"q",children:[s.jsxs("legend",{children:[i.header?`${i.header} — `:"",i.question]}),i.options.map(a=>s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:i.multiSelect?"checkbox":"radio",name:i.question,checked:o.includes(a.label),onChange:u=>l(i.question,i.multiSelect?u.target.checked?o.concat(a.label):o.filter(c=>c!==a.label):[a.label])}),a.label,a.description?s.jsx("span",{className:"muted",children:` — ${a.description}`}):null]},a.label)),s.jsx("input",{className:"other",placeholder:"Other…","aria-label":"Other answer",onChange:a=>l(i.question,a.target.value?[a.target.value]:[])})]},i.question)}),s.jsx(S,{onClick:()=>void t(e.requestId,"allow",n),children:"Answer"})," ",s.jsx(S,{onClick:()=>void t(e.requestId,"deny"),children:"Skip"})]})}function Bf({p:e,onRespond:t=eg}){return e.kind==="question"?s.jsx(Sv,{p:e,onRespond:t}):s.jsxs(O,{tone:"warn",className:"gate",children:[s.jsx(C,{tone:"warn",children:`Permission · ${e.tool}${e.via?` · ${e.via}`:""}`}),s.jsx(Ll,{children:e.summary}),e.reason?s.jsx("div",{className:"fix",children:e.reason}):null,s.jsx(S,{onClick:()=>void t(e.requestId,"allow"),children:"Allow"})," ",s.jsx(S,{onClick:()=>void t(e.requestId,"deny"),children:"Deny"})]})}const Nv=[["default","ask for edits"],["acceptEdits","accept edits"],["plan","plan only"]];function Cv({command:e}){const[t,n]=N.useState(""),r=l=>{l.preventDefault();const i=t.trim();i&&(Zm(i),n(""))};return s.jsxs("form",{className:"reply-box",onSubmit:r,children:[s.jsx("textarea",{rows:3,value:t,onChange:l=>n(l.target.value),placeholder:`Reply to ${e.split(" ")[0]} (same session)…`,"aria-label":"Reply to the command"}),s.jsx(S,{type:"submit",children:"Send"}),s.jsx(b,{children:"Goes to this Cohorte command only — it is not a general chat."})]})}const Ev={done:"ok",failed:"bad",stopped:"warn",running:"info"};function $v({d:e,currentId:t}){const n=[...e.runs??[]].sort((r,l)=>l.startedAt.localeCompare(r.startedAt));return n.length?s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"History"}),s.jsx(ve,{head:["Command","Status","Cost","Took","When"],children:n.map(r=>s.jsxs("tr",{className:`click${r.id===t?" current":""}`,tabIndex:0,"aria-current":r.id===t?"true":void 0,onClick:()=>void al(r.id),onKeyDown:l=>{l.key==="Enter"&&al(r.id)},children:[s.jsx("td",{className:"mono",children:r.command}),s.jsx("td",{children:s.jsx(C,{tone:Ev[r.status]??"",children:r.status})}),s.jsx("td",{children:r.result?.costUsd!=null?qe(r.result.costUsd):""}),s.jsx("td",{children:$f(r.result?.durationMs)}),s.jsx("td",{className:"muted",children:Yt(r.startedAt)})]},r.id))})]}):null}function Pv({d:e}){const{commands:t,form:n,run:r}=de(),l=w(g=>g.tab),i=ts(wn(g=>g.status));N.useEffect(()=>{pa()},[]);const o=(e.runs??[]).find(g=>g.status==="running");N.useEffect(()=>{!r&&o&&al(o.id)},[r,o?.id]),ht(()=>de.getState().poll(),1e3,l==="run"&&r?.status==="running"&&!i,`${r?.id}:${r?.status}`);const a=t??[],u=e.worktrees.filter(g=>!g.bare),c={wt:n.wt??u[0]?.path??"",cmd:n.cmd??a[0]?.name??"",args:n.args??"",mode:n.mode??"default"},f=a.find(g=>g.name===c.cmd),v=de.getState().setForm,p=g=>{g.preventDefault(),Jm(c)},x=r?.status==="running",j=()=>{const g=w.getState().sel;g&&r&&L.stopRun(g,r.id).then(()=>de.getState().poll())};return s.jsxs("div",{children:[t&&!a.length?s.jsx(b,{children:"No /cohorte-* commands found in ~/.claude/commands — run `cohorte install`."}):null,s.jsxs("form",{className:"row-form wrap",onSubmit:p,children:[s.jsx("select",{"aria-label":"Worktree",value:c.wt,onChange:g=>v({wt:g.target.value}),children:u.map(g=>s.jsx("option",{value:g.path,children:`${g.main?"(main) ":""}${g.branch||g.path}`},g.path))}),s.jsx("select",{"aria-label":"Command",value:c.cmd,onChange:g=>v({cmd:g.target.value}),children:a.map(g=>s.jsx("option",{value:g.name,title:g.description,children:g.name},g.name))}),s.jsx("input",{"aria-label":"Argument",value:c.args,onChange:g=>v({args:g.target.value}),placeholder:"argument (feature id, text…)"}),s.jsx("select",{"aria-label":"Permission mode",value:c.mode,onChange:g=>v({mode:g.target.value}),children:Nv.map(([g,T])=>s.jsx("option",{value:g,children:T},g))}),s.jsx(S,{type:"submit",variant:"primary",disabled:x,children:"Run"})]}),s.jsx(b,{children:f?`${f.description}${f.argumentHint?` [${f.argumentHint}]`:""}`:""}),s.jsx(b,{children:"Headless run (claude -p): gates and questions appear below. Talking to the agent stays in Claude Code or Francois."}),r?s.jsxs(s.Fragment,{children:[s.jsxs(U,{plain:!0,children:[`${r.command} · ${r.status}`,x?s.jsxs(s.Fragment,{children:[" ",s.jsx(S,{onClick:j,children:"Stop"})]}):null]}),r.pending.map(g=>s.jsx(Bf,{p:g},g.requestId)),s.jsx(kv,{events:r.events}),!x&&r.sessionId?s.jsx(Cv,{command:r.command}):null]}):null,s.jsx($v,{d:e,currentId:r?.id})]})}const Wn=Ie(()=>({preflight:null}));Jt(()=>Wn.setState({preflight:null}));const Na=()=>w.getState().sel,Tv=e=>w.getState().act(async()=>{const t=Na();if(!t)return;const n=await zl(r=>L.startDev(t,{worktree:e.path,confirmed:r}));xe.getState().watch(n.job)}),Vf=(e,t=!1)=>w.getState().act(async()=>{const n=Na();if(n){Wn.setState({preflight:null});try{const r=await zl(l=>L.createWorktree(n,{feature:e,confirmed:l,skipDockerCheck:t||void 0}));xe.getState().watch(r.job)}catch(r){if(!(r instanceof tr)||!r.body.dockerPreflight)throw r;Wn.setState({preflight:{feature:e,...r.body.dockerPreflight,message:r.message}})}}}),_v=e=>w.getState().act(async()=>{const t=Na();if(!t||!window.confirm(`Remove the worktree ${e.path}?
160
+
161
+ Git refuses if it has uncommitted changes. The branch is kept.`))return;const n=await zl(r=>L.removeWorktree(t,{path:e.path,confirmed:r}));xe.getState().watch(n.job)});function Rv(e){return e.startsWith("@@")?"hunk":e.startsWith("+++")||e.startsWith("---")||e.startsWith("diff ")||e.startsWith("index ")||e.startsWith("new file")||e.startsWith("deleted file")||e.startsWith("similarity")||e.startsWith("rename ")||e.startsWith("\\ No newline")?"meta":e.startsWith("+")?"add":e.startsWith("-")?"remove":"context"}const bv={added:"A",modified:"M",deleted:"D",renamed:"R",copied:"C",untracked:"?",changed:"T"};function Lv(){const{wt:e,base:t,files:n,file:r,error:l}=wt();if(!e)return null;const i=r?r.diff.split(`
162
+ `):[];return s.jsxs("section",{className:"diff-panel","aria-label":"Diff",children:[s.jsxs(U,{children:[`Diff · ${e.split(/[\\/]/).pop()} vs ${t??"HEAD"} `,s.jsx(S,{onClick:Km,children:"Close"})]}),l?s.jsx("div",{className:"error",role:"alert",children:l}):null,n?n.length?s.jsxs("div",{className:"diff-grid",children:[s.jsx("ul",{className:"file-list","aria-label":"Changed files",children:n.map(o=>s.jsx("li",{children:s.jsxs("button",{type:"button",className:`file${r?.file===o.path?" sel":""}`,onClick:()=>void Qm(o.path),children:[s.jsx("span",{className:`badge badge-${o.status}`,title:o.status,children:bv[o.status]??"·"}),s.jsx("span",{className:"mono",children:o.path})]})},o.path))}),s.jsx("div",{className:"diff-view",children:r?s.jsxs("pre",{className:"diff","aria-label":`Diff of ${r.file}`,children:[i.map((o,a)=>s.jsx("div",{className:`dl dl-${Rv(o)}`,children:o||" "},a)),r.truncated?s.jsx("div",{className:"dl dl-meta",children:"… diff truncated"}):null]}):s.jsx(b,{children:"Pick a file."})})]}):s.jsx(b,{children:"No changed files."}):s.jsx(b,{children:"Loading…"})]})}const Iv=/^https?:\/\//i;function Dv({g:e}){return e?e.error?s.jsx("div",{className:"muted",children:e.error}):s.jsxs("div",{className:"git-state",children:[e.ahead?s.jsx("span",{className:"mono",title:`${e.ahead} commit(s) ahead of ${e.upstream??"upstream"}`,children:`↑${e.ahead}`}):null,e.behind?s.jsx("span",{className:"mono",title:`${e.behind} commit(s) behind ${e.upstream??"upstream"}`,children:`↓${e.behind}`}):null,e.conflicted?s.jsx(C,{tone:"bad",children:`${e.conflicted} conflicted`}):null,e.clean?s.jsx("span",{className:"muted",children:"clean"}):s.jsx("span",{className:"muted mono",children:[e.staged&&`${e.staged} staged`,e.modified&&`${e.modified} modified`,e.untracked&&`${e.untracked} untracked`].filter(Boolean).join(" · ")})]}):null}function zv({g:e}){return e?.lastCommit?s.jsxs("div",{className:"muted last-commit",children:[s.jsx("span",{className:"mono",children:e.lastCommit.sha}),` ${e.lastCommit.subject} · ${e.lastCommit.when}`]}):null}function Ov({g:e}){if(!e||e.error||!e.base)return s.jsx("span",{className:"muted",children:"–"});const t=e.diff;return t.files?s.jsxs("span",{className:"mono",title:`against ${e.base}`,children:[s.jsx("span",{className:"add",children:`+${t.insertions}`})," ",s.jsx("span",{className:"del",children:`−${t.deletions}`}),s.jsx("span",{className:"muted",children:` · ${t.files} file${t.files===1?"":"s"}`})]}):s.jsxs("span",{className:"muted",children:["no changes vs ",e.base]})}const Fv=e=>e.state==="MERGED"?"info":e.state==="CLOSED"?"bad":e.draft?"":"ok";function Av({p:e}){if(!e)return null;const t=`#${e.number} ${e.draft?"draft":e.state.toLowerCase()}`,n=e.checks?` · checks ${e.checks==="success"?"✓":e.checks==="failure"?"✗":"…"}`:"",r=e.review?` · ${e.review.toLowerCase().replace(/_/g," ")}`:"",l=e.checks==="failure"?"bad":Fv(e),i=`${t}${n}${r}`,o=`pill pill-${l||"idle"} pr-chip`;return Iv.test(e.url)?s.jsx("a",{className:o,href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title,children:i}):s.jsx("span",{className:o,title:e.title,children:i})}const Mv=/^https?:\/\/(localhost|127\.0\.0\.1|\[::1\]):\d+/;function Uv({urls:e}){const t=(e??[]).filter(n=>Mv.test(n));return t.length?s.jsx(s.Fragment,{children:t.map(n=>s.jsx("a",{className:"open-link mono",href:n,target:"_blank",rel:"noopener noreferrer",children:`Open ${n.replace(/^https?:\/\//,"")} ↗`},n))}):null}function Wv(){const e=Wn(l=>l.preflight),t=w(l=>l.setTab),n=xe(l=>l.watch);if(!e)return null;const r=()=>void w.getState().act(async()=>{const l=w.getState().sel;Wn.setState({preflight:null}),l&&n((await L.dockerAct(l,{action:"up"})).job)});return s.jsxs(O,{tone:"warn",className:"gate",children:[s.jsx(C,{tone:"warn",children:"Docker is not ready"}),s.jsx("p",{children:e.message}),e.daemonUp?s.jsx(S,{onClick:r,children:"Start the stack"}):s.jsx(S,{onClick:()=>t("docker"),children:"Open the Docker tab"})," ",s.jsx(S,{onClick:()=>void Vf(e.feature,!0),children:"Create anyway"})," ",s.jsx(S,{onClick:()=>Wn.setState({preflight:null}),children:"Cancel"}),e.daemonUp?null:s.jsx("div",{className:"fix",children:"Start Docker Desktop (or the docker service), then try again."})]})}function Bv({d:e}){const[t,n]=N.useState(""),r=xe(a=>a.watch),l=ol(a=>a.git);N.useEffect(()=>{uo()},[e.id,e.worktrees.length]),ht(async()=>{await uo()},2e4,!0,e.id);const i=a=>{a.preventDefault();const u=t.trim();u&&Vf(u)},o=a=>!!a&&Kt.includes(a);return s.jsxs("div",{children:[s.jsx(b,{children:e.dev.command?s.jsxs(s.Fragment,{children:["Dev command: ",s.jsx("span",{className:"mono",children:e.dev.command})]}):"No commands.dev in this project’s profile — dev servers cannot be started from here."}),s.jsx(ve,{head:["Worktree","Branch","Changes","Dev server",""],children:e.worktrees.map(a=>{const u=l?.worktrees[a.path];return s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx("span",{className:"mono",children:a.path}),a.main?s.jsxs(s.Fragment,{children:[" ",s.jsx(C,{children:"main"})]}):null,s.jsx(zv,{g:u})]}),s.jsxs("td",{children:[s.jsx("span",{className:"mono",children:a.branch||(a.bare?"bare":"detached")}),s.jsx(Dv,{g:u})]}),s.jsxs("td",{children:[s.jsx(Ov,{g:u}),u?.pull?s.jsx("div",{className:"gap-top",children:s.jsx(Av,{p:u.pull})}):null]}),s.jsxs("td",{children:[a.dev?s.jsx(C,{tone:a.dev.status==="ready"?"ok":a.dev.status==="failed"?"bad":"",children:a.dev.status}):s.jsx("span",{className:"muted",children:"stopped"}),s.jsx("div",{className:"open-links",children:s.jsx(Uv,{urls:a.dev?.urls})})]}),s.jsx("td",{children:s.jsxs("div",{className:"actions",children:[o(a.dev?.status)&&a.dev?s.jsx(S,{onClick:()=>void yf(a.dev.id),children:"Stop"}):e.dev.command&&!a.bare?s.jsx(S,{onClick:()=>void Tv(a),children:"Start dev"}):null,a.dev?s.jsx(S,{onClick:()=>r(a.dev),children:"Logs"}):null,a.bare?null:s.jsx(S,{onClick:()=>void Hm(a.path),children:"Diff"}),a.main?null:s.jsx(S,{onClick:()=>void _v(a),children:"Remove"})]})})]},a.path)})}),l&&!l.gh?s.jsx(b,{children:"Install and sign in to the GitHub CLI (gh) to see each branch’s pull request and checks here."}):null,s.jsx(Lv,{}),s.jsx(U,{children:"New worktree"}),s.jsxs("form",{className:"row-form",onSubmit:i,children:[s.jsx("input",{value:t,onChange:a=>n(a.target.value),placeholder:"feature-id (kebab-case)","aria-label":"Feature id"}),s.jsx(S,{type:"submit",children:"Create"})]}),s.jsx(b,{children:e.isolation.create?"Uses scripts/new-feature.sh (own DB and ports).":"Plain git worktree next to the repo, on a new branch."}),s.jsx(Wv,{}),s.jsx(fl,{})]})}const Vv=[{v:"idea",label:"Start from an idea",text:"The product owner talks it through with you (or with the person who has the idea): who it is for, what the first version must do. Then a developer chooses the stack with the lead."},{v:"stack",label:"I know what to build",text:"Straight to the lead: describe the project, choose the stack together, and the skeleton is generated."},{v:"existing",label:"A repository I already have",text:"A git repository that does not use cohorte yet: the pipeline is set up in it from here."}];function Hv(e){const t=e.map(r=>r.replace(/[\\/][^\\/]+$/,"")),n=new Map;for(const r of t)n.set(r,(n.get(r)??0)+1);return[...n.entries()].sort((r,l)=>l[1]-r[1])[0]?.[0]??"~"}function Xu(){const e=fe(y=>y.form),t=w(y=>y.projects),n=w(y=>y.busy),[r,l]=N.useState(e?.mode??"idea"),[i,o]=N.useState(""),[a,u]=N.useState(()=>Hv(t.map(y=>y.root))),[c,f]=N.useState(e?.path??""),[v,p]=N.useState(""),[x,j]=N.useState(""),[g,T]=N.useState("");if(N.useEffect(()=>{e&&(l(e.mode),e.path&&f(e.path))},[e]),!e)return null;const h=t.filter(y=>!y.founding&&!y.missing),d=r==="existing"?!!c.trim():!!i.trim()&&!!a.trim()&&(r!=="idea"||!!v.trim()),m=y=>{y.preventDefault(),d&&wf(r==="existing"?{mode:r,path:c.trim()}:{mode:r,name:i.trim(),parent:a.trim(),brief:v.trim(),requester:x.trim()||void 0,basedOn:g||null})};return s.jsx(O,{className:"new-project",children:s.jsxs("form",{onSubmit:m,children:[s.jsxs("div",{className:"toolbar between",children:[s.jsx(U,{plain:!0,children:"New project"}),s.jsx(S,{type:"button",onClick:jf,children:"Cancel"})]}),s.jsx("div",{className:"mode-pick",role:"radiogroup","aria-label":"How to start",children:Vv.map(y=>s.jsxs("label",{className:`mode${r===y.v?" sel":""}`,children:[s.jsx("input",{type:"radio",name:"mode",checked:r===y.v,onChange:()=>l(y.v)}),s.jsx("strong",{children:y.label}),s.jsx("span",{className:"muted",children:y.text})]},y.v))}),r==="existing"?s.jsxs("div",{className:"field",children:[s.jsx("label",{htmlFor:"np-path",children:"Repository folder"}),s.jsx("input",{id:"np-path",value:c,onChange:y=>f(y.target.value),placeholder:"/absolute/path/to/the/repo"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"row-form wrap",children:[s.jsxs("div",{className:"field grow",children:[s.jsx("label",{htmlFor:"np-name",children:"Folder name"}),s.jsx("input",{id:"np-name",value:i,onChange:y=>o(y.target.value.replace(/\s+/g,"-")),placeholder:"my-product"})]}),s.jsxs("div",{className:"field grow",children:[s.jsx("label",{htmlFor:"np-parent",children:"Created in"}),s.jsx("input",{id:"np-parent",value:a,onChange:y=>u(y.target.value),placeholder:"~/dev"})]})]}),s.jsxs("div",{className:"field",children:[s.jsx("label",{htmlFor:"np-brief",children:r==="idea"?"The idea, in your words":"What you want to build (optional — the lead asks)"}),s.jsx("textarea",{id:"np-brief",rows:4,value:v,onChange:y=>p(y.target.value),placeholder:r==="idea"?"Who has which problem, and what you imagine… No technical detail needed.":"A web app + API for…, the stack you have in mind, constraints…"})]}),r==="idea"?s.jsxs("div",{className:"field",children:[s.jsx("label",{htmlFor:"np-req",children:"Who is asking (optional)"}),s.jsx("input",{id:"np-req",value:x,onChange:y=>j(y.target.value),placeholder:"Their name or role — they validate the vision"})]}):null,h.length?s.jsxs("div",{className:"field",children:[s.jsx("label",{htmlFor:"np-from",children:"Start from one of my projects (optional)"}),s.jsxs("select",{id:"np-from",value:g,onChange:y=>T(y.target.value),children:[s.jsx("option",{value:"",children:"No — choose the stack from scratch"}),h.map(y=>s.jsx("option",{value:y.id,children:y.title||y.name},y.id))]}),s.jsx(b,{children:"Same structure, tooling and conventions — none of its business code."})]}):null]}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{type:"submit",variant:"primary",disabled:!d||n,children:r==="existing"?"Set up cohorte in it":r==="idea"?"Talk to the product owner":"Talk to the lead"}),s.jsx(b,{children:r==="existing"?"Nothing is committed for you: you review the pipeline files and commit them.":"The folder is created with git. Nothing is pushed anywhere until you connect a code host."})]})]})})}const Qv=e=>e.error||e.missing||!e.summary||e.summary.bad?"bad":e.summary.warn?"warn":"ok",Kv={dev:"worktrees",job:"worktrees",docker:"docker",run:"run"};function Yv({p:e,running:t,pending:n}){const r=Object.entries(e.specCounts??{});return s.jsxs("button",{type:"button",className:"card home-card link",onClick:()=>void Qt(e.id),children:[s.jsxs("span",{className:"proj-name",children:[s.jsx(va,{tone:Qv(e)}),e.title||e.name]}),s.jsx("span",{className:"muted home-line",children:e.founding?"being founded — open it to continue":e.missing?"folder missing":e.error?e.error:e.oneLiner||e.root}),e.summary?s.jsx("span",{className:"muted home-line",children:`${e.summary.ok} ok · ${e.summary.warn} to review · ${e.summary.bad} failing`}):null,s.jsxs("span",{className:"home-chips",children:[r.map(([l,i])=>s.jsx(C,{children:`${i} ${l}`},l)),t?s.jsx(C,{tone:"info",children:`${t} running`}):null,n?s.jsx(C,{tone:"warn",children:`${n} needs you`}):null]})]})}const Ju={cp0:["CP0 · ticket to validate","tickets"],cp1:["CP1 · plan to approve","features"],cp2:["CP2 · course check","features"],cp3:["CP3 · ready to ship","features"],cp4:["CP4 · delivery to accept","tickets"],pr:["PR to merge","features"],question:["question","features"],permission:["permission","features"],founding:["new project","overview"]};function Gv(){const e=D(n=>n.inbox);N.useEffect(()=>{ma()},[]);const t=async n=>{const[,r]=Ju[n.kind];if(n.kind==="founding"||w.getState().projects.find(l=>l.id===n.projectId)?.founding){await Qt(n.projectId);return}await Qt(n.projectId,n.kind==="question"||n.kind==="permission"?n.feature?"features":"overview":r),r==="tickets"?ga(n.ref):n.feature?await Hr(n.feature):(n.kind==="question"||n.kind==="permission")&&(await He(n.ref),D.getState().chat?.meta?.role==="po"?w.getState().setTab("tickets"):(w.getState().setTab("run"),await al(n.ref)))};return s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"Waiting for you"}),e.length?s.jsx("ul",{className:"activity",children:e.map(n=>s.jsx("li",{children:s.jsxs("button",{type:"button",className:"act-row",onClick:()=>void t(n),children:[s.jsx("span",{className:"mono act-proj",children:n.projectName}),s.jsx(C,{tone:"warn",children:Ju[n.kind][0]}),s.jsxs("span",{className:"act-label",children:[n.title,s.jsx("span",{className:"muted",children:` — ${n.detail}`})]})]})},`${n.kind}:${n.projectId}:${n.ref}:${n.detail}`))}):s.jsx(b,{children:"Nothing waits on you."})]})}function qv(){const e=w(i=>i.projects),t=qn(i=>i.items),n=vf(t),r=[...t].sort((i,o)=>o.pending-i.pending||o.startedAt.localeCompare(i.startedAt)),l=fe(i=>i.form);return e.length?s.jsxs("div",{children:[s.jsxs("div",{className:"toolbar between",children:[s.jsx("h2",{children:"Home"}),l?null:s.jsx(S,{variant:"primary",onClick:()=>ul("idea"),children:"New project"})]}),s.jsx(Xu,{}),s.jsx(b,{children:`${e.length} project${e.length===1?"":"s"} on this machine`}),s.jsx(Gv,{}),s.jsx(U,{children:"Projects"}),s.jsx("div",{className:"cards home-cards",children:e.map(i=>s.jsx(Yv,{p:i,running:n[i.id]?.running??0,pending:n[i.id]?.pending??0},i.id))}),s.jsx(U,{children:"Activity"}),r.length?s.jsx("ul",{className:"activity",children:r.map(i=>s.jsx("li",{children:s.jsxs("button",{type:"button",className:"act-row",onClick:()=>void Qt(i.projectId,Kv[i.kind]),children:[s.jsx("span",{className:"mono act-proj",children:i.projectName}),s.jsx(C,{tone:i.kind==="run"?"info":"",children:i.kind}),s.jsx("span",{className:"act-label",children:i.label}),s.jsx("span",{className:"muted",children:i.status}),i.pending?s.jsx(C,{tone:"warn",children:"needs you"}):null]})},`${i.kind}:${i.id}`))}):s.jsx(b,{children:"Nothing is running. Dev servers, Cohorte commands and Docker jobs show up here."})]}):s.jsx("div",{children:l?s.jsx(Xu,{}):s.jsxs(Ee,{children:[s.jsx("h2",{children:"No project yet"}),s.jsx("p",{children:"Start a new one from an idea or a stack, set up a repository you already have, or add a cohorte project with the field on the left."}),s.jsx(S,{variant:"primary",onClick:()=>ul("idea"),children:"New project"})]})})}function Sn(e,t){const n=[],r=new RegExp("```"+t+"[^\\n]*\\n([\\s\\S]*?)\\n?```","g");for(const l of e.matchAll(r))try{n.push(JSON.parse(l[1]))}catch{}return n}function Xv(e){return e.replace(/```cohorte-(ticket|plan|acceptance|vision|foundation|scaffold)[^\n]*\n[\s\S]*?\n?```/g,"").replace(/\n{3,}/g,`
163
+
164
+ `).trim()}const W=(e,t=4e3)=>typeof e=="string"?e.trim().slice(0,t):"",he=(e,t=40)=>Array.isArray(e)?e.map(n=>W(n,1e3)).filter(Boolean).slice(0,t):[],Ds=(e,t,n)=>typeof e=="string"&&t.includes(e)?e:n,Jv=["feature","bug","tech"],Zv=["high","medium","low"],Hf=["S","M","L","?"];function Qf(e,t=48){return e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,t).replace(/-+$/,"")||"ticket"}function ey(e){if(!e||typeof e!="object")return null;const t=e,n=W(t.title,200);return n?{ref:Qf(W(t.ref,60)||n,60),title:n,type:Ds(t.type,Jv,"feature"),need:W(t.need),value:W(t.value),criteria:he(t.criteria),outOfScope:he(t.outOfScope??t.out_of_scope),priority:Ds(t.priority,Zv,"medium"),size:Ds(t.size,Hf,"?"),parent:W(t.parent,100)||null}:null}function ty(e){if(!e||typeof e!="object")return null;const t=e,n=W(t.summary);if(!n)return null;const r=(Array.isArray(t.criteria)?t.criteria:[]).map((i,o)=>{if(typeof i=="string")return{id:`C${o+1}`,text:i.trim()};const a=i||{};return{id:W(a.id,12)||`C${o+1}`,text:W(a.text,1e3)}}).filter(i=>i.text).slice(0,40),l=(Array.isArray(t.surfaces)?t.surfaces:[]).map(i=>{const o=i||{};return{key:W(o.key,60),tasks:he(o.tasks)}}).filter(i=>i.key).slice(0,20);return{summary:n,criteria:r,contract:W(t.contract),surfaces:l,risks:he(t.risks),assumptions:he(t.assumptions),questions:he(t.questions),size:Ds(t.size,Hf,"?")}}function ny(e){if(!e||typeof e!="object")return null;const t=e,n=W(t.summary);return n?{summary:n,changes:he(t.changes),howToTest:he(t.howToTest??t.how_to_test),outOfScope:he(t.outOfScope??t.out_of_scope)}:null}function ry(e){if(!e||typeof e!="object")return null;const t=e,n=W(t.pitch,1e3),r=he(t.firstVersion??t.first_version);return!n||!r.length?null:{name:W(t.name,120),pitch:n,users:he(t.users),problem:W(t.problem),today:W(t.today),firstVersion:r,later:he(t.later),success:W(t.success,1e3),constraints:he(t.constraints),language:W(t.language,60)}}const ut=e=>W(e,400).replace(/[\r\n]+/g," ");function sy(e){if(!e||typeof e!="object")return null;const t=e,n=W(t.summary),r=(Array.isArray(t.surfaces)?t.surfaces:[]).map(l=>{const i=l||{},o=W(i.key,40),a=o?Qf(o,40):"";return{key:a,path:W(i.path,120).replace(/^\.?\/+/,"")||a,stack:W(i.stack,300),generate:ut(i.generate)||null,packageManager:W(i.packageManager??i.package_manager,20),test:ut(i.test),lint:ut(i.lint),build:ut(i.build)}}).filter(l=>l.key).slice(0,12);return!n||!r.length?null:{summary:n,surfaces:r,data:W(t.data,1e3),auth:W(t.auth,1e3),hosting:W(t.hosting,1e3),devCommand:ut(t.devCommand??t.dev_command),ci:W(t.ci,1e3),basedOn:W(t.basedOn??t.based_on,200)||null,conventions:he(t.conventions),skeleton:W(t.skeleton,1e3),decisions:he(t.decisions),assumptions:he(t.assumptions),questions:he(t.questions)}}function ly(e){if(!e||typeof e!="object")return null;const t=e;if(t.status!=="ok"&&t.status!=="failed")return null;const n=(Array.isArray(t.surfaces)?t.surfaces:[]).map(l=>{const i=l||{};return{key:W(i.key,40),path:W(i.path,120),test:ut(i.test),lint:ut(i.lint),build:ut(i.build),ok:i.ok===!0}}).filter(l=>l.key).slice(0,12),r=(Array.isArray(t.checks)?t.checks:[]).map(l=>{const i=l||{};return{command:ut(i.command),ok:i.ok===!0,note:W(i.note,500)}}).filter(l=>l.command).slice(0,40);return{status:t.status,surfaces:n,devCommand:ut(t.devCommand??t.dev_command),checks:r,assumptions:he(t.assumptions),notes:W(t.notes,2e3)}}const ct=({label:e,xs:t})=>t.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:e}),s.jsx("ul",{className:"rc-list",children:t.map((n,r)=>s.jsx("li",{children:n},r))})]}):null;function Ca({v:e,name:t="",tickets:n=[]}){return s.jsxs(O,{className:"plan",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:"info",children:"Vision"}),s.jsx("strong",{children:e.name||t})]}),s.jsx("p",{className:"pre-wrap",children:s.jsx("strong",{children:e.pitch})}),s.jsx(ct,{label:"For",xs:e.users}),e.problem?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"The problem"}),s.jsx("p",{className:"pre-wrap",children:e.problem})]}):null,e.today?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Today"}),s.jsx("p",{className:"pre-wrap",children:e.today})]}):null,s.jsx(ct,{label:"The first version",xs:e.firstVersion}),s.jsx(ct,{label:"Later",xs:e.later}),e.success?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Success"}),s.jsx("p",{className:"pre-wrap",children:e.success})]}):null,s.jsx(ct,{label:"Constraints",xs:e.constraints}),n.length?s.jsx(ct,{label:`The first version's tickets (${n.length}) — filed in the backlog when the project is ready`,xs:n.map(r=>`${r.title}${r.size!=="?"?` · ${r.size}`:""}`)}):null]})}function Ea({p:e}){return s.jsxs(O,{className:"plan",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:"info",children:"Foundations"}),e.basedOn?s.jsx("span",{className:"muted",children:`following ${e.basedOn}`}):null]}),s.jsx("p",{className:"pre-wrap",children:e.summary}),s.jsx(ve,{head:["Surface","Stack","Generated by","Checks"],children:e.surfaces.map(t=>s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx("div",{className:"mono",children:t.key}),s.jsxs("div",{className:"muted mono",children:[t.path,"/"]})]}),s.jsx("td",{children:t.stack}),s.jsx("td",{className:"mono",children:t.generate??"— (a plain folder)"}),s.jsx("td",{className:"mono",children:[t.test,t.lint,t.build].filter(Boolean).join(" · ")})]},t.key))}),s.jsxs("div",{className:"kv",children:[e.data?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"label",children:"Data"}),s.jsx("span",{children:e.data})]}):null,e.auth?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"label",children:"Auth"}),s.jsx("span",{children:e.auth})]}):null,e.hosting?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"label",children:"Hosting"}),s.jsx("span",{children:e.hosting})]}):null,e.ci?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"label",children:"CI"}),s.jsx("span",{children:e.ci})]}):null,e.devCommand?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"label",children:"Run it"}),s.jsx("span",{className:"mono",children:e.devCommand})]}):null,e.skeleton?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"label",children:"Skeleton proves"}),s.jsx("span",{children:e.skeleton})]}):null]}),s.jsx(ct,{label:"Conventions from day one",xs:e.conventions}),s.jsx(ct,{label:"Decided together",xs:e.decisions}),s.jsx(ct,{label:"Assumed without asking — veto any",xs:e.assumptions}),s.jsx(ct,{label:"Still open",xs:e.questions})]})}function Kf({r:e}){return s.jsxs(O,{className:"plan",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:e.status==="ok"?"ok":"bad",children:`Skeleton ${e.status}`}),e.devCommand?s.jsx("span",{className:"mono",children:e.devCommand}):null]}),e.checks.length?s.jsx("ul",{className:"rc-list",children:e.checks.map((t,n)=>s.jsxs("li",{className:t.ok?"add":"error",children:[`${t.ok?"✓":"✗"} `,s.jsx("span",{className:"mono",children:t.command}),t.note?s.jsx("span",{className:"muted",children:` — ${t.note}`}):null]},n))}):null,s.jsx(ct,{label:"Assumed",xs:e.assumptions}),e.notes?s.jsx("p",{className:"pre-wrap muted",children:e.notes}):null]})}function Yf({plan:e}){return s.jsxs(O,{className:"plan",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:"info",children:"Plan"}),s.jsx("span",{className:"muted",children:`size ${e.size}`})]}),s.jsx("p",{className:"pre-wrap",children:e.summary}),e.criteria.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Acceptance criteria"}),s.jsx("ul",{className:"rc-list",children:e.criteria.map(t=>s.jsxs("li",{children:[s.jsx("span",{className:"mono",children:t.id})," ",t.text]},t.id))})]}):null,e.contract&&e.contract!=="none"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Contract"}),s.jsx("p",{className:"pre-wrap",children:e.contract})]}):null,e.surfaces.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Work by surface"}),e.surfaces.map(t=>s.jsxs("div",{children:[s.jsx("span",{className:"mono",children:t.key}),s.jsx("ul",{className:"rc-list",children:t.tasks.map((n,r)=>s.jsx("li",{children:n},r))})]},t.key))]}):null,e.risks.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Risks"}),s.jsx("ul",{className:"rc-list",children:e.risks.map((t,n)=>s.jsx("li",{children:t},n))})]}):null,e.assumptions.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Assumed without asking — veto any"}),s.jsx("ul",{className:"rc-list",children:e.assumptions.map((t,n)=>s.jsx("li",{children:t},n))})]}):null,e.questions.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Still open"}),s.jsx("ul",{className:"rc-list",children:e.questions.map((t,n)=>s.jsx("li",{children:t},n))})]}):null]})}function iy({p:e,ticket:t}){const n=t?t.status==="validate"?"waiting for validation":t.status==="rejected"?"rejected":`validated · ${t.status}`:"proposed";return s.jsxs(O,{className:"proposal",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:t&&t.status!=="validate"&&t.status!=="rejected"?"ok":"warn",children:e.type==="bug"?"Bug":"Ticket"}),s.jsx("strong",{children:e.title}),s.jsx("span",{className:"muted",children:n})]}),e.need?s.jsx("p",{className:"pre-wrap",children:e.need}):null,e.criteria.length?s.jsx("ul",{className:"rc-list",children:e.criteria.map((r,l)=>s.jsx("li",{children:r},l))}):null,s.jsxs("div",{className:"rc-row",children:[s.jsx(C,{children:`priority ${e.priority}`}),s.jsx(C,{children:`size ${e.size}`})]})]})}function oy({text:e,tickets:t,refs:n}){const r=[];return Sn(e,"cohorte-ticket").forEach((l,i)=>{const o=ey(l);o&&r.push(s.jsx(iy,{p:o,ticket:t.find(a=>a.id===n[o.ref])??null},`t${i}`))}),Sn(e,"cohorte-plan").forEach((l,i)=>{const o=ty(l);o&&r.push(s.jsx(Yf,{plan:o},`p${i}`))}),Sn(e,"cohorte-vision").forEach((l,i)=>{const o=ry(l);o&&r.push(s.jsx(Ca,{v:o},`v${i}`))}),Sn(e,"cohorte-foundation").forEach((l,i)=>{const o=sy(l);o&&r.push(s.jsx(Ea,{p:o},`f${i}`))}),Sn(e,"cohorte-scaffold").forEach((l,i)=>{const o=ly(l);o&&r.push(s.jsx(Kf,{r:o},`s${i}`))}),Sn(e,"cohorte-acceptance").forEach((l,i)=>{const o=ny(l);o&&r.push(s.jsxs(O,{className:"proposal",children:[s.jsx(C,{tone:"info",children:"Acceptance note"}),s.jsx("p",{className:"pre-wrap",children:o.summary})]},`a${i}`))}),s.jsx(s.Fragment,{children:r})}function ay({e,quiet:t,tickets:n,refs:r,agent:l}){switch(e.kind){case"text":{const i=Xv(e.text);return s.jsxs(s.Fragment,{children:[i?s.jsxs("div",{className:"bubble bubble-agent",children:[s.jsx("div",{className:"bubble-who",children:l}),s.jsx("div",{className:"pre-wrap",children:i})]}):null,s.jsx(oy,{text:e.text,tickets:n,refs:r})]})}case"reply":return s.jsxs("div",{className:"bubble bubble-you",children:[s.jsx("div",{className:"bubble-who",children:"you"}),s.jsx("div",{className:"pre-wrap",children:e.text})]});case"tool":return t?null:s.jsx("div",{className:"ev muted mono",children:`▸ ${e.name} ${e.summary}`});case"tool_result":return!t&&e.error?s.jsx("div",{className:"ev error mono",children:`✗ ${e.text}`}):null;case"result":return e.ok?t?null:s.jsx("div",{className:"ev muted",children:`turn done${e.costUsd!=null?` · ${qe(e.costUsd)}`:""}`}):s.jsx("div",{className:"ev error",children:`The agent stopped: ${e.text}`});case"stderr":case"system":return t?null:s.jsx("div",{className:"ev error mono",children:e.text});default:return null}}function $a({chat:e,agent:t,quiet:n=!1,tickets:r=[],refs:l={},onReply:i,replyHint:o,empty:a}){const[u,c]=N.useState(""),f=e.status==="running",v=p=>{p.preventDefault();const x=u.trim();x&&i&&(i(x),c(""))};return s.jsxs("div",{className:"chat",children:[s.jsxs("div",{className:"chat-feed","aria-live":"polite",children:[e.events.length?e.events.map((p,x)=>s.jsx(ay,{e:p,quiet:n,tickets:r,refs:l,agent:t},x)):s.jsx(b,{children:a??"Starting…"}),f&&!e.pending.length?s.jsx("div",{className:"typing muted",children:`${t} is working…`}):null]}),e.pending.map(p=>s.jsx(Bf,{p,onRespond:ng},p.requestId)),i?s.jsxs("form",{className:"reply-box",onSubmit:v,children:[s.jsx("textarea",{rows:3,value:u,onChange:p=>c(p.target.value),placeholder:o??"Your answer…","aria-label":"Your message",onKeyDown:p=>{p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&v(p)}}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{type:"submit",variant:"primary",disabled:f||!u.trim(),children:"Send"}),s.jsx(b,{children:f?"Wait for the answer to finish…":"⌘/Ctrl-Enter to send"})]})]}):null]})}const uy=[{key:"validate",label:"To validate",statuses:["discussion","validate"],hint:"proposed by the PO — the requester validates (CP0)"},{key:"backlog",label:"Backlog",statuses:["backlog"],hint:"validated — a developer takes one"},{key:"framing",label:"Framing",statuses:["framing"],hint:"a developer and the lead plan it (CP1)"},{key:"building",label:"In progress",statuses:["building","checkpoint"],hint:"the autopilot builds; the developer signs off (CP3)"},{key:"pr",label:"PR open",statuses:["pr"],hint:"waiting for the merge"},{key:"acceptance",label:"Acceptance",statuses:["acceptance"],hint:"delivered — the requester checks it (CP4)"},{key:"done",label:"Done",statuses:["done"],hint:""}],cy={validate:"warn",acceptance:"warn",checkpoint:"warn",building:"info",pr:"info",done:"ok",rejected:"bad"};function dy({t:e}){const[t,n]=N.useState(""),r=(D(o=>o.features)??[]).find(o=>o.id===e.id),l=e.conversation,i=()=>{w.getState().setTab("features"),Hr(e.id)};return s.jsxs(O,{className:"ticket-detail",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:cy[e.status]??"",children:e.status}),s.jsx("h3",{className:"ticket-title",children:e.title}),s.jsx("span",{className:"muted mono",children:e.id}),s.jsx(S,{className:"push-right",onClick:()=>ga(null),"aria-label":"Close",children:"Close"})]}),s.jsxs("div",{className:"rc-row",children:[s.jsx(C,{children:e.type}),s.jsx(C,{children:`priority ${e.priority}`}),s.jsx(C,{children:`size ${e.size}`}),e.requester?s.jsx(C,{children:`asked by ${e.requester}`}):null,e.parent?s.jsx(C,{children:`follows ${e.parent}`}):null,e.pr?s.jsx(C,{tone:"info",children:`PR ${e.pr}`}):null]}),e.need?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Need"}),s.jsx("p",{className:"pre-wrap",children:e.need})]}):null,e.value?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Value"}),s.jsx("p",{className:"pre-wrap",children:e.value})]}):null,e.criteria.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Acceptance criteria"}),s.jsx("ul",{className:"rc-list",children:e.criteria.map((o,a)=>s.jsxs("li",{children:[s.jsx("span",{className:"mono",children:`C${a+1}`})," ",o]},a))})]}):null,e.outOfScope.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Out of scope"}),s.jsx("ul",{className:"rc-list",children:e.outOfScope.map((o,a)=>s.jsx("li",{children:o},a))})]}):null,e.acceptance?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Acceptance note"}),s.jsx("p",{className:"pre-wrap",children:e.acceptance.summary}),e.acceptance.changes.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"What changed"}),s.jsx("ul",{className:"rc-list",children:e.acceptance.changes.map((o,a)=>s.jsx("li",{children:o},a))})]}):null,e.acceptance.howToTest.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"How to check it"}),s.jsx("ol",{className:"rc-list",children:e.acceptance.howToTest.map((o,a)=>s.jsx("li",{children:o},a))})]}):null,e.acceptance.outOfScope.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Not in this delivery"}),s.jsx("ul",{className:"rc-list",children:e.acceptance.outOfScope.map((o,a)=>s.jsx("li",{children:o},a))})]}):null]}):null,e.feedback.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Feedback"}),s.jsx("ul",{className:"rc-list",children:e.feedback.map((o,a)=>s.jsx("li",{children:o},a))})]}):null,s.jsxs("div",{className:"checkpoint-actions",children:[e.status==="validate"||e.status==="discussion"?s.jsxs(s.Fragment,{children:[s.jsx(b,{children:"CP0 — is this ticket what was asked? Validating sends it to the backlog, where a developer picks it up."}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{variant:"primary",onClick:()=>void Vu(e.id,"validate"),children:"Validate"}),s.jsx(S,{onClick:()=>{window.confirm("Reject this ticket?")&&Vu(e.id,"reject")},children:"Reject"}),l?s.jsx(S,{onClick:()=>void He(l),children:"Discuss it with the PO"}):null]})]}):null,e.status==="backlog"&&!r?s.jsxs(s.Fragment,{children:[s.jsx(b,{children:"For a developer: taking it creates its worktree and starts framing it with the lead."}),s.jsx("div",{className:"actions",children:s.jsx(S,{variant:"primary",onClick:()=>void lg(e.id),children:"Take it"})})]}):null,r&&!["acceptance","done"].includes(e.status)?s.jsx("div",{className:"actions",children:s.jsx(S,{onClick:i,children:`Open the feature · ${r.phase}`})}):null,e.status==="acceptance"?s.jsxs(s.Fragment,{children:[s.jsx(b,{children:"CP4 — check the delivery against the note above. Is it what you asked for?"}),s.jsx("textarea",{rows:3,value:t,onChange:o=>n(o.target.value),placeholder:"What is not quite right (opens a follow-up with the PO)…","aria-label":"Acceptance feedback"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{variant:"primary",onClick:()=>void Hu(e.id,"accept",t.trim()||void 0),children:"It is what I asked for"}),s.jsx(S,{disabled:!t.trim(),onClick:()=>{Hu(e.id,"not-quite",t.trim()),n("")},children:"Not quite"})]})]}):null]})]})}function fy({tickets:e}){const t=D(n=>n.ticketId);return s.jsx("div",{className:"board board-flow",children:uy.map(n=>{const r=e.filter(l=>n.statuses.includes(l.status));return s.jsxs("section",{className:"col","aria-label":n.label,title:n.hint,children:[s.jsxs("div",{className:"col-head",children:[s.jsx("span",{children:n.label}),s.jsx("span",{className:"count",children:r.length})]}),r.map(l=>s.jsxs("button",{type:"button",className:`spec-card ticket-card${t===l.id?" sel":""}`,onClick:()=>ga(l.id),children:[s.jsx("span",{className:"ticket-card-title",children:l.title}),s.jsxs("span",{className:"spec-card-meta",children:[s.jsx(C,{tone:l.type==="bug"?"bad":l.type==="tech"?"idle":"",children:l.type}),l.priority==="high"?s.jsx(C,{tone:"warn",children:"high"}):null,l.status==="checkpoint"?s.jsx(C,{tone:"warn",children:"to validate · dev"}):null]})]},l.id))]},n.key)})})}function hy(){const e=D(o=>o.settings),[t,n]=N.useState(e?.settings.requester??""),[r,l]=N.useState(""),i=o=>{o.preventDefault();const a=r.trim();a&&(rg(a,t.trim()),l(""))};return s.jsxs("form",{onSubmit:i,className:"new-request",children:[s.jsx("div",{className:"row-form",children:s.jsx("input",{value:t,onChange:o=>n(o.target.value),placeholder:"Your name (optional)","aria-label":"Your name"})}),s.jsx("textarea",{rows:4,value:r,onChange:o=>l(o.target.value),"aria-label":"Your request",placeholder:"Describe what you need, an idea, or a problem you hit — in your own words. The product owner will ask what it needs to know."}),s.jsx(S,{type:"submit",variant:"primary",disabled:!r.trim(),children:"Talk to the product owner"})]})}function py({onDone:e}){const[t,n]=N.useState(""),[r,l]=N.useState("tech"),[i,o]=N.useState(""),[a,u]=N.useState(""),c=f=>{f.preventDefault(),t.trim()&&sg({title:t.trim(),type:r,need:i.trim(),criteria:a.split(`
165
+ `).map(v=>v.trim()).filter(Boolean)}).then(e)};return s.jsxs("form",{onSubmit:c,className:"card new-ticket",children:[s.jsx(b,{children:"A ticket with nothing for the business to discuss (tech debt, an upgrade, a bug you found) goes straight to the backlog."}),s.jsxs("div",{className:"row-form",children:[s.jsx("input",{value:t,onChange:f=>n(f.target.value),placeholder:"Title","aria-label":"Title"}),s.jsxs("select",{value:r,onChange:f=>l(f.target.value),"aria-label":"Type",children:[s.jsx("option",{value:"tech",children:"tech"}),s.jsx("option",{value:"bug",children:"bug"}),s.jsx("option",{value:"feature",children:"feature"})]})]}),s.jsx("textarea",{rows:3,value:i,onChange:f=>o(f.target.value),placeholder:"Why, and what done looks like","aria-label":"Description"}),s.jsx("textarea",{rows:3,value:a,onChange:f=>u(f.target.value),placeholder:"Acceptance criteria, one per line (optional)","aria-label":"Acceptance criteria"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{type:"submit",variant:"primary",disabled:!t.trim(),children:"Add to the backlog"}),s.jsx(S,{onClick:e,children:"Cancel"})]})]})}function my({tickets:e}){const t=D(u=>u.tickets),n=D(u=>u.chat),r=ts(wn(u=>u.status)),l=w(u=>u.tab);ht(()=>Zt(),1200,l==="tickets"&&n?.status==="running"&&!r,`${n?.id}:${n?.status}`);const i=t?.conversations??[],o=n&&n.meta?.role==="po"?n:null,a=o?i.find(u=>u.runId===o.id)?.tickets??{}:{};return s.jsxs("div",{className:"convo-grid",children:[s.jsxs("div",{children:[s.jsx(U,{children:"New request"}),s.jsx(hy,{}),i.length?s.jsx(U,{children:"Conversations"}):null,s.jsx("ul",{className:"convo-list",children:i.map(u=>s.jsx("li",{children:s.jsxs("button",{type:"button",className:`act-row${o?.id===u.runId?" sel":""}`,onClick:()=>void He(u.runId),children:[s.jsx("span",{className:"act-label",children:u.title}),u.pending?s.jsx(C,{tone:"warn",children:"needs you"}):u.status==="running"?s.jsx(C,{tone:"info",children:"…"}):null,s.jsx("span",{className:"muted",children:`${Object.keys(u.tickets).length} ticket${Object.keys(u.tickets).length===1?"":"s"} · ${Yt(u.startedAt)}`})]})},u.runId))})]}),s.jsx("div",{children:o?s.jsx($a,{chat:o,agent:"Product owner",quiet:!0,tickets:e,refs:a,onReply:u=>void tg(u),replyHint:"Answer the product owner…"}):s.jsx(Ee,{children:"Start a request, or open a conversation."})})]})}function gy({d:e}){const t=D(f=>f.tickets),n=D(f=>f.ticketId),[r,l]=N.useState("board"),[i,o]=N.useState(!1);N.useEffect(()=>{jn()},[e.id]);const a=D(f=>f.chat);if(N.useEffect(()=>{a?.meta?.role==="po"&&l("talk")},[a?.id]),!t)return s.jsx(Ee,{children:"Loading tickets…"});const u=t.tickets,c=n?u.find(f=>f.id===n):null;return s.jsxs("div",{children:[s.jsxs("div",{className:"toolbar between",children:[s.jsxs("div",{className:"seg-group",role:"tablist","aria-label":"Tickets view",children:[s.jsx("button",{type:"button",className:`seg${r==="board"?" sel":""}`,onClick:()=>l("board"),children:"Board"}),s.jsx("button",{type:"button",className:`seg${r==="talk"?" sel":""}`,onClick:()=>l("talk"),children:"Talk to the product owner"})]}),s.jsx("div",{className:"actions",children:s.jsx(S,{onClick:()=>o(f=>!f),children:"New tech ticket"})})]}),s.jsx(b,{children:t.tracker.kind==="obsidian"?`Tickets live in your Obsidian vault — ${t.tracker.dir}`:`Tickets live on this machine (${t.tracker.reason}).`}),i?s.jsx(py,{onDone:()=>o(!1)}):null,r==="board"?s.jsxs(s.Fragment,{children:[u.length?s.jsx(fy,{tickets:u.filter(f=>f.status!=="rejected")}):s.jsx(Ee,{children:"No ticket yet. Talk to the product owner to create the first ones."}),c?s.jsx(dy,{t:c}):null]}):s.jsx(my,{tickets:u})]})}const Gf={provisioning:["creating the worktree","info"],framing:["framing with the lead","info"],cp1:["CP1 · plan to validate","warn"],freezing:["freezing the spec","info"],autopilot:["autopilot","info"],cp2:["CP2 · course check","warn"],cp3:["CP3 · ready to ship","warn"],shipping:["opening the PR","info"],pr:["PR open","info"],merging:["merging","info"],closing:["closing (journal, acceptance note)","info"],acceptance:["waiting for acceptance","warn"],done:["done","ok"],abandoned:["abandoned","idle"],failed:["failed","bad"]};function vy({f:e}){const t=["framing","cp1","autopilot","cp3","pr","acceptance","done"],r=(i=>({provisioning:0,framing:0,cp1:1,freezing:1,autopilot:2,cp2:2,cp3:3,shipping:3,pr:4,merging:4,closing:4,acceptance:5,done:6})[i]??-1)(e.phase),l=["Framing","CP1 Plan","Autopilot","CP3 Sign-off","PR","CP4 Acceptance","Done"];return s.jsx("ol",{className:"stepper timeline","aria-label":"Feature milestones",children:t.map((i,o)=>{const a=e.phase==="abandoned"||e.phase==="failed"?o<r?"done":"todo":o<r?"done":o===r?e.checkpoint?"blocked":"current":"todo";return s.jsxs("li",{className:`step step-${a==="blocked"?"current attn":a}`,children:[s.jsx("span",{className:"step-mark",children:a==="done"?"✓":o===r?"●":"○"}),l[o]]},i)})})}function yy({f:e}){const[t,n]=N.useState(null),[r,l]=N.useState("");if(!e.decisions.length)return null;const i=o=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(C,{tone:o.by==="decider"?"info":"",children:o.by==="decider"?"decider":"you"})}),s.jsxs("td",{children:[o.question,o.header?s.jsx("span",{className:"muted",children:` · ${o.header}`}):null]}),s.jsxs("td",{children:[s.jsx("strong",{children:o.chosen}),o.source&&o.source.kind!=="none"?s.jsx("div",{className:"muted",children:`${o.source.kind}${o.source.ref?` · ${o.source.ref}`:""}${o.source.quote?` — “${o.source.quote}”`:""}`}):null]}),s.jsx("td",{children:o.contested?s.jsx(C,{tone:"bad",children:"contested"}):o.confirmed?s.jsx(C,{tone:"ok",children:"confirmed"}):o.by==="decider"?t===o.id?s.jsxs("div",{className:"contest",children:[s.jsx("textarea",{rows:2,value:r,onChange:a=>l(a.target.value),placeholder:"What you would have chosen, and why","aria-label":"Your note"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{onClick:()=>{og(o.id,r.trim()),n(null),l("")},children:"Contest"}),s.jsx(S,{onClick:()=>n(null),children:"Cancel"})]})]}):s.jsx(S,{onClick:()=>n(o.id),children:"I would not have done that"}):null})]},o.id);return s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"Decisions taken during the run"}),s.jsx(b,{children:"What the decider settled on your behalf (and why), and what you answered. Contesting teaches it; add a correction at CP3 to change the code."}),s.jsx(ve,{head:["By","Question","Answer",""],children:e.decisions.map(i)})]})}function xy({f:e}){const[t,n]=N.useState(""),r=e.checkpoint;if(!r)return null;const l=(o,a=!1)=>{a&&!t.trim()||(Qu(o,t.trim()||void 0),n(""))},i=()=>{window.confirm("Abandon this feature? The worktree is kept; the ticket goes back to the backlog.")&&Qu("abandon")};return s.jsxs(O,{tone:"warn",className:"checkpoint",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:"warn",children:r.kind==="cp1"?"CP1 · Plan":r.kind==="cp2"?"CP2 · Course check":"CP3 · Ship sign-off"}),s.jsx("span",{children:r.reason}),s.jsx("span",{className:"muted push-right",children:Yt(r.openedAt)})]}),r.kind==="cp1"?s.jsxs(s.Fragment,{children:[e.plan?s.jsx(Yf,{plan:e.plan}):s.jsx(b,{children:"The lead has not posted a plan yet."}),s.jsx("textarea",{rows:2,value:t,onChange:o=>n(o.target.value),placeholder:"Optional: a last instruction with the approval, or what to change instead","aria-label":"Your note"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{variant:"primary",onClick:()=>l("approve"),children:"Approve the plan — build it"}),s.jsx(S,{disabled:!t.trim(),onClick:()=>l("reply",!0),children:"Ask the lead to change it"}),s.jsx(S,{onClick:i,children:"Abandon"})]}),s.jsx(b,{children:"After approval the lead freezes the spec and the autopilot builds, reviews, fixes and verifies. You are only asked again if something needs you."})]}):null,r.kind==="cp2"?s.jsxs(s.Fragment,{children:[s.jsx("textarea",{rows:3,value:t,onChange:o=>n(o.target.value),placeholder:"What should change (for Correct or Re-frame)","aria-label":"Your instruction"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{variant:"primary",onClick:()=>l("continue"),children:"Continue"}),s.jsx(S,{disabled:!t.trim(),onClick:()=>l("correct",!0),children:"Correct the code"}),s.jsx(S,{disabled:!t.trim(),onClick:()=>l("reframe",!0),children:"Re-frame with the lead"}),s.jsx(S,{onClick:i,children:"Abandon"})]})]}):null,r.kind==="cp3"?s.jsx(jy,{f:e,text:t,setText:n,act:l,abandon:i}):null]})}function jy({f:e,text:t,setText:n,act:r,abandon:l}){const i=e.dod.filter(a=>!a.done),o=e.decisions.filter(a=>a.by==="decider"&&!a.contested);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"rc-row",children:[e.pipeline?.verdict?s.jsx(C,{tone:e.pipeline.verdict.verdict==="SHIP"?"ok":"bad",children:`review ${e.pipeline.verdict.verdict}`}):null,e.review?s.jsx(C,{children:`${e.review.findings.length} finding${e.review.findings.length===1?"":"s"} · ${e.review.deferred.length} deferred`}):null,e.diff?s.jsx(C,{children:`${e.diff.files} files · +${e.diff.insertions} −${e.diff.deletions}`}):null,s.jsx(C,{children:`${e.rounds} fix round${e.rounds===1?"":"s"}`}),s.jsx(C,{children:qe(e.costUsd)})]}),e.dod.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:`Definition of done — ${e.dod.length-i.length}/${e.dod.length}`}),s.jsx("ul",{className:"rc-list dod",children:e.dod.map((a,u)=>s.jsx("li",{className:a.done?"add":"muted",children:`${a.done?"✓":"○"} ${a.text}`},u))})]}):null,e.assumptions.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"label",children:"Assumed by the implementers — veto any"}),s.jsx("ul",{className:"rc-list",children:e.assumptions.map((a,u)=>s.jsx("li",{children:a},u))})]}):null,o.length?s.jsx(b,{children:`${o.length} decision${o.length===1?"":"s"} taken on your behalf — listed below. Shipping confirms them.`}):null,s.jsx("textarea",{rows:3,value:t,onChange:a=>n(a.target.value),placeholder:"What to correct before shipping","aria-label":"Correction"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{variant:"primary",onClick:()=>r("approve"),children:"Ship it — open the PR"}),s.jsx(S,{disabled:!t.trim(),onClick:()=>r("correct",!0),children:"Correct first"}),s.jsx(S,{onClick:l,children:"Abandon"})]})]})}function wy({f:e}){return!e.pr||!["pr","merging"].includes(e.phase)?null:s.jsxs(O,{className:"checkpoint",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:"info",children:`PR #${e.pr.number}`}),s.jsx("a",{className:"open-link",href:e.pr.url,target:"_blank",rel:"noreferrer noopener",children:e.pr.url}),e.pr.checks?s.jsx(C,{tone:e.pr.checks==="success"?"ok":e.pr.checks==="failure"?"bad":"info",children:`checks ${e.pr.checks}`}):null]}),s.jsx(b,{children:"Merge it on the host when you are ready — cohorte notices — or let cohorte merge it now."}),s.jsx("div",{className:"actions",children:s.jsx(S,{disabled:e.phase==="merging"||e.pr.checks==="failure",onClick:()=>{window.confirm(`Merge PR #${e.pr?.number}?`)&&ag()},children:"Merge it"})})]})}function ky({f:e}){const t=D(c=>c.chat),n=ts(wn(c=>c.status)),r=w(c=>c.tab),i=["framing","cp1","cp2","freezing","provisioning"].includes(e.phase)?e.leadRunId:e.currentRunId||e.leadRunId;N.useEffect(()=>{He(i)},[i]),ht(()=>Zt(),1200,r==="features"&&t?.status==="running"&&!n,`${t?.id}:${t?.status}`),ht(async()=>(await $t(),!0),5e3,r==="features"&&!n,e.id);const o=t?.meta?.role==="lead",[a,u]=Gf[e.phase]??[e.phase,""];return s.jsxs("div",{children:[s.jsxs("div",{className:"spec-head",children:[s.jsx(S,{onClick:()=>void Hr(null),children:"← All features"}),s.jsx("h2",{children:e.title}),s.jsx(C,{tone:u,children:a}),s.jsx("span",{className:"muted mono",children:e.branch??""}),s.jsx("span",{className:"muted",children:qe(e.costUsd)})]}),s.jsx(vy,{f:e}),e.error?s.jsx(O,{tone:"bad",className:"gate",children:s.jsx("div",{className:"error pre-wrap",children:e.error})}):null,e.warning?s.jsx(O,{tone:"warn",className:"gate",children:s.jsx("div",{className:"pre-wrap",children:e.warning})}):null,s.jsx(xy,{f:e}),s.jsx(wy,{f:e}),e.stages.length?s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"Stages"}),s.jsx(ve,{head:["Stage","Model","Status","Cost","When",""],children:e.stages.map(c=>s.jsxs("tr",{className:`click${t?.id===c.runId?" current":""}`,onClick:()=>void He(c.runId),tabIndex:0,onKeyDown:f=>{f.key==="Enter"&&He(c.runId)},children:[s.jsx("td",{className:"mono",children:c.stage}),s.jsx("td",{className:"mono",children:c.model}),s.jsx("td",{children:s.jsx(C,{tone:c.status==="done"?"ok":c.status==="running"?"info":"bad",children:c.status})}),s.jsx("td",{children:c.costUsd!=null?qe(c.costUsd):""}),s.jsx("td",{className:"muted",children:Yt(c.startedAt)}),s.jsx("td",{className:"muted",children:c.note??""})]},c.runId))})]}):null,s.jsx(yy,{f:e}),s.jsxs("div",{className:"toolbar between",children:[s.jsx(U,{children:o?"Conversation with the lead":t?`Run · ${t.command}`:"Conversation"}),e.leadRunId&&!o?s.jsx(S,{onClick:()=>void He(e.leadRunId),children:"Open the lead conversation"}):null]}),t?s.jsx($a,{chat:t,agent:o?"Lead":"Agent",quiet:!1,onReply:o&&["framing","cp1","cp2"].includes(e.phase)?c=>void ig(c):void 0,replyHint:"Answer the lead, or tell it what you want…",empty:e.phase==="provisioning"?"Creating the worktree…":void 0}):s.jsx(b,{children:"No conversation yet."})]})}function Sy({features:e}){return e.length?s.jsx(ve,{head:["Feature","Where","Rounds","Cost","Updated"],children:e.map(t=>{const[n,r]=Gf[t.phase]??[t.phase,""];return s.jsxs("tr",{className:"click",tabIndex:0,onClick:()=>void Hr(t.id),onKeyDown:l=>{l.key==="Enter"&&Hr(t.id)},children:[s.jsxs("td",{children:[s.jsx("div",{children:t.title}),s.jsx("div",{className:"muted mono",children:t.id})]}),s.jsxs("td",{children:[s.jsx(C,{tone:r,children:n}),t.checkpoint?s.jsx("div",{className:"muted",children:t.checkpoint.reason}):null]}),s.jsx("td",{children:t.rounds}),s.jsx("td",{children:qe(t.costUsd)}),s.jsx("td",{className:"muted",children:Yt(t.updatedAt)})]},t.id)})}):s.jsx(Ee,{children:"No feature in progress. Take a ticket from the backlog (Tickets tab) to start one."})}function Ny({d:e}){const t=D(l=>l.features),n=D(l=>l.featureId),r=D(l=>l.feature);return N.useEffect(()=>{_l(),n&&$t()},[e.id]),n?r?s.jsx(ky,{f:r}):s.jsx(Ee,{children:"Loading the feature…"}):t?s.jsx(Sy,{features:t}):s.jsx(Ee,{children:"Loading features…"})}const Cy=[{v:"prudent",label:"Prudent",text:"The decider only settles internal, reversible choices that a written decision (plan, spec, decisions, your past answers) answers word for word — unanimously."},{v:"balanced",label:"Balanced",text:"Also choices only you would notice (a library, a layout) when something you already decided answers them, unanimously. The default."},{v:"autonomous",label:"Autonomous",text:"Also accepts a precedent in the code and a 2-out-of-3 vote. Behaviour, contracts, security, cost and irreversible steps are always yours, whatever the level."}],Ey=[{r:"po",label:"Product owner (business conversations)"},{r:"lead",label:"Lead (framing with you)"},{r:"build",label:"Build stage"},{r:"implementer",label:"Implementer agents"},{r:"review",label:"Review stage"},{r:"fix",label:"Fix stage"},{r:"verify",label:"Verify stage"},{r:"ship",label:"Ship stage"},{r:"learn",label:"Learning journal"},{r:"acceptance",label:"Acceptance note"},{r:"productMap",label:"Product map"},{r:"scaffold",label:"New project — skeleton"},{r:"setup",label:"New project — pipeline set-up"},{r:"decider",label:"Decider — first vote"},{r:"deciderEscalation",label:"Decider — on a split vote"}];function $y(){const e=D(a=>a.settings),[t,n]=N.useState(""),[r,l]=N.useState("");if(!e)return null;const i=e.tracker,o=a=>{a.preventDefault(),t.trim()&&cg(t.trim(),r.trim())};return s.jsxs(O,{children:[i.kind==="obsidian"?s.jsxs(s.Fragment,{children:[s.jsx(C,{tone:"ok",children:"Obsidian connected"}),s.jsx("div",{className:"mono gap-top",children:i.board}),s.jsx(b,{children:`Tickets are notes in ${i.dir}. The board is moved for you at every step.`})]}):s.jsxs(s.Fragment,{children:[s.jsx(C,{tone:"warn",children:"Local tickets"}),s.jsx(b,{children:i.reason})]}),s.jsxs("form",{onSubmit:o,className:"gap-top",children:[s.jsxs("div",{className:"row-form wrap",children:[s.jsx("input",{value:t,onChange:a=>n(a.target.value),placeholder:"Vault folder — the absolute path you open in Obsidian","aria-label":"Obsidian vault path"}),s.jsx("input",{value:r,onChange:a=>l(a.target.value),placeholder:`Board file in the vault (default ${i.projectName??"<project>"}/Tasks.md)`,"aria-label":"Board file"}),s.jsx(S,{type:"submit",disabled:!t.trim(),children:i.kind==="obsidian"?"Reconnect":"Connect Obsidian"})]}),s.jsx(b,{children:"Creates the board (company layout) if it does not exist, and a Tickets folder next to it. Needs the Obsidian Kanban plugin to show the board."})]})]})}function Py(){const e=D(a=>a.settings),t=D(a=>a.learning),n=w(a=>a.sel),[r,l]=N.useState(null);if(N.useEffect(()=>{Rl()},[n]),N.useEffect(()=>{e&&l(e.settings)},[e]),!e||!r)return s.jsx(Ee,{children:"Loading settings…"});const i=a=>l({...r,...a}),o=JSON.stringify(r)!==JSON.stringify(e.settings);return s.jsxs("div",{children:[s.jsx(U,{children:"Where the code is hosted"}),s.jsx(Wf,{}),s.jsx(U,{children:"Where tickets live"}),s.jsx($y,{}),s.jsx(U,{children:"Product map"}),s.jsxs(O,{children:[e.productMap.exists?s.jsxs(s.Fragment,{children:[s.jsx(C,{tone:"ok",children:"PRODUCT.md"})," ",s.jsx("span",{className:"muted",children:`updated ${Yt(e.productMap.updated??"")}`})]}):s.jsx(C,{tone:"warn",children:"No product map yet"}),s.jsx(b,{children:"What the product does, in business language, discovered from the code. The product owner reads it so it never proposes what already exists. Refresh it after a few merges."}),s.jsx("div",{className:"actions gap-top",children:s.jsx(S,{onClick:()=>void dg(),children:e.productMap.exists?"Refresh the product map":"Generate the product map"})})]}),s.jsx(U,{children:"Autopilot"}),s.jsxs(O,{children:[s.jsxs("label",{className:"opt",children:[s.jsx("input",{type:"checkbox",checked:r.autopilot,onChange:a=>i({autopilot:a.target.checked})}),"Run the stages between checkpoints on its own (build → review → fix → verify)"]}),s.jsxs("div",{className:"row-form wrap",children:[s.jsxs("label",{className:"field",children:["Fix rounds before asking you ",s.jsx("input",{type:"number",min:1,max:8,value:r.maxRounds,onChange:a=>i({maxRounds:Number(a.target.value)})})]}),s.jsxs("label",{className:"field",children:["Merge method ",s.jsxs("select",{value:r.mergeMethod,onChange:a=>i({mergeMethod:a.target.value}),children:[s.jsx("option",{value:"squash",children:"squash"}),s.jsx("option",{value:"merge",children:"merge"}),s.jsx("option",{value:"rebase",children:"rebase"})]})]}),s.jsxs("label",{className:"field",children:["Default requester name ",s.jsx("input",{value:r.requester,onChange:a=>i({requester:a.target.value}),placeholder:"who usually talks to the PO"})]})]})]}),s.jsx(U,{children:"Decider"}),s.jsxs(O,{children:[s.jsx(b,{children:"Questions an agent asks mid-run go to the decider first. It answers only what you already settled, cites its source, and hands you the rest with its reading. Everything it decided is listed at CP3."}),Cy.map(a=>s.jsxs("label",{className:"opt choice",children:[s.jsx("input",{type:"radio",name:"autonomy",checked:r.autonomy===a.v,onChange:()=>i({autonomy:a.v})}),s.jsx("strong",{children:a.label})," ",s.jsxs("span",{className:"muted",children:["— ",a.text]})]},a.v)),s.jsx("div",{className:"row-form",children:s.jsxs("label",{className:"field",children:["Votes per question ",s.jsx("input",{type:"number",min:1,max:7,value:r.deciderVotes,onChange:a=>i({deciderVotes:Number(a.target.value)})})]})})]}),s.jsx(U,{children:"Models"}),s.jsxs(O,{children:[s.jsx(b,{children:"Each role runs on its own model: the strongest where judgment is the product, a lighter one where a frozen spec already did the thinking. An alias (opus, sonnet, haiku, fable) or a full model id. A failed stage retries one model up."}),s.jsx(ve,{children:Ey.map(({r:a,label:u})=>s.jsxs("tr",{children:[s.jsx("td",{children:u}),s.jsx("td",{children:s.jsx("input",{className:"mono",value:r.models[a],onChange:c=>i({models:{...r.models,[a]:c.target.value}}),"aria-label":u})}),s.jsx("td",{className:"muted",children:r.models[a]!==e.defaults.models[a]?`default ${e.defaults.models[a]}`:""})]},a))})]}),s.jsxs("div",{className:"actions gap-top",children:[s.jsx(S,{variant:"primary",disabled:!o,onClick:()=>void ug(r),children:"Save"}),s.jsx(S,{disabled:!o,onClick:()=>l(e.settings),children:"Discard"})]}),t?s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"What it learned"}),s.jsxs("div",{className:"cards",children:[s.jsxs(O,{children:[s.jsx("div",{className:"stat-v",children:t.decisions.byDecider}),s.jsx("div",{className:"muted",children:"decided for you"})]}),s.jsxs(O,{children:[s.jsx("div",{className:"stat-v",children:t.decisions.confirmed}),s.jsx("div",{className:"muted",children:"confirmed at CP3"})]}),s.jsxs(O,{tone:t.decisions.contested?"warn":void 0,children:[s.jsx("div",{className:"stat-v",children:t.decisions.contested}),s.jsx("div",{className:"muted",children:"contested"})]}),s.jsxs(O,{children:[s.jsx("div",{className:"stat-v",children:t.preferences}),s.jsx("div",{className:"muted",children:"answers remembered"})]})]}),t.stages.length?s.jsx(ve,{head:["Stage","Model","Runs","Finished","Cost"],children:t.stages.map(a=>s.jsxs("tr",{children:[s.jsx("td",{className:"mono",children:a.stage}),s.jsx("td",{className:"mono",children:a.model}),s.jsx("td",{children:a.runs}),s.jsx("td",{children:`${a.ok}/${a.runs}`}),s.jsx("td",{children:qe(a.costUsd)})]},`${a.stage}|${a.model}`))}):null,s.jsx(b,{children:"Rules for the agents come from /cohorte-retro: it reads the journal every merged feature leaves, and you ratify each rule."})]}):null]})}const qf="cohorte-theme";function Xf(){try{const e=localStorage.getItem(qf);if(e==="dark"||e==="light")return e}catch{}return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function Jf(e){document.documentElement.dataset.theme=e;try{localStorage.setItem(qf,e)}catch{}}function Ty(){const[e,t]=N.useState(()=>document.documentElement.dataset.theme==="light"?"light":Xf()),n=()=>{const r=e==="dark"?"light":"dark";Jf(r),t(r)};return s.jsx("button",{type:"button",className:"btn icon",onClick:n,"aria-label":`Switch to ${e==="dark"?"light":"dark"} theme`,title:"Toggle theme",children:e==="dark"?s.jsx(Yg,{size:14}):s.jsx(Qg,{size:14})})}const _y={connecting:"connecting",live:"live",reconnecting:"reconnecting",polling:"polling"},Ry={connecting:"Connecting to the live update stream",live:"Live: changes are pushed as they happen",reconnecting:"The live stream dropped — reconnecting",polling:"Live stream unavailable — refreshing on a timer"};async function by(){const{notify:e,setNotify:t}=Ke.getState();if(e){t(!1);return}try{if(typeof Notification>"u"){w.getState().setError("This browser has no notification support.");return}(Notification.permission==="granted"?"granted":await Notification.requestPermission())==="granted"?t(!0):w.getState().setError("Notifications are blocked for this page — allow them in the browser’s site settings.")}catch{w.getState().setError("Could not enable notifications here.")}}function Zu(){const e=wn(l=>l.status),{notify:t,setPalette:n,setHelp:r}=Ke();return s.jsxs("div",{className:"topbar",children:[s.jsxs("span",{className:`live live-${e}`,title:Ry[e],role:"status",children:[s.jsx("span",{className:"live-dot","aria-hidden":"true"}),_y[e]]}),s.jsxs("button",{type:"button",className:"btn icon",onClick:()=>n(!0),"aria-label":"Open the command palette",title:"Command palette (Ctrl/⌘ K)",children:[s.jsx(Kg,{size:14}),s.jsx("span",{className:"kbd",children:"⌘K"})]}),s.jsx("button",{type:"button",className:"btn icon",onClick:()=>void by(),"aria-pressed":t,"aria-label":t?"Turn notifications off":"Turn notifications on",title:t?"Notifications on: runs that need you or finish while this tab is hidden":"Notify me when a run needs me or finishes",children:t?s.jsx(Wg,{size:14}):s.jsx(Ug,{size:14})}),s.jsx("button",{type:"button",className:"btn icon",onClick:()=>r(!0),"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts (?)",children:s.jsx(Bg,{size:14})}),s.jsx(Ty,{})]})}const Ly={vision:["shaping the vision","info"],"cp-vision":["vision to validate","warn"],foundation:["choosing the stack","info"],"cp-foundation":["foundations to approve","warn"],scaffold:["generating the skeleton","info"],"cp-scaffold":["the skeleton needs you","warn"],setup:["setting up the pipeline","info"],done:["ready","ok"],abandoned:["abandoned","idle"]},mi=[{label:"Vision",phases:["vision","cp-vision"]},{label:"Foundations",phases:["foundation","cp-foundation"]},{label:"Skeleton",phases:["scaffold","cp-scaffold"]},{label:"Pipeline",phases:["setup"]},{label:"Ready",phases:["done"]}],gi={vision:"Product owner",foundation:"Lead",scaffold:"Scaffold",setup:"Pipeline set-up"};function Iy({f:e}){const t=e.mode==="existing"?mi.slice(3):e.mode==="stack"?mi.slice(1):mi,n=t.findIndex(r=>r.phases.includes(e.phase));return s.jsx("ol",{className:"stepper timeline","aria-label":"New project steps",children:t.map((r,l)=>{const i=l<n?"done":l===n?e.phase.startsWith("cp-")?"current attn":"current":"todo";return s.jsxs("li",{className:`step step-${i}`,children:[s.jsx("span",{className:"step-mark",children:l<n?"✓":l===n?"●":"○"}),r.label]},r.label)})})}function Dy({f:e}){const[t,n]=N.useState(""),r=(l,i=!1)=>{i&&!t.trim()||(cl(l,t.trim()||void 0),n(""))};return e.phase==="cp-vision"&&e.vision?s.jsxs(O,{tone:"warn",className:"checkpoint",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:"warn",children:"Vision · to validate"}),s.jsx("span",{children:`by ${e.requester||"the person with the idea"}`})]}),s.jsx(Ca,{v:e.vision,name:e.name,tickets:e.tickets}),s.jsx("textarea",{rows:2,value:t,onChange:l=>n(l.target.value),placeholder:"What to change instead (sent to the product owner)","aria-label":"Your note"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{variant:"primary",onClick:()=>r("approve"),children:"Validate the vision"}),s.jsx(S,{disabled:!t.trim(),onClick:()=>r("reply",!0),children:"Ask for a change"})]}),s.jsx(b,{children:"Validating writes PRODUCT.md and hands over to a developer and the lead, who choose how to build it."})]}):e.phase==="cp-foundation"&&e.foundation?s.jsxs(O,{tone:"warn",className:"checkpoint",children:[s.jsx("div",{className:"plan-head",children:s.jsx(C,{tone:"warn",children:"Foundations · to approve"})}),s.jsx(Ea,{p:e.foundation}),s.jsx("textarea",{rows:2,value:t,onChange:l=>n(l.target.value),placeholder:"Optional: a last instruction for the skeleton, or what the lead should change","aria-label":"Your note"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{variant:"primary",onClick:()=>r("approve"),children:"Approve — generate the skeleton"}),s.jsx(S,{disabled:!t.trim(),onClick:()=>r("reply",!0),children:"Ask the lead to change it"})]}),s.jsx(b,{children:"The skeleton is generated with each framework's own generator, its checks run and it is committed. The tools the plan names run without asking; anything else asks you here."})]}):e.phase==="cp-scaffold"?s.jsxs(O,{tone:"warn",className:"checkpoint",children:[s.jsxs("div",{className:"plan-head",children:[s.jsx(C,{tone:"warn",children:"Skeleton · needs you"}),s.jsx("span",{children:e.error})]}),e.scaffold?s.jsx(Kf,{r:e.scaffold}):null,s.jsx("textarea",{rows:2,value:t,onChange:l=>n(l.target.value),placeholder:"What to do differently (for Retry), or an answer to the agent","aria-label":"Your note"}),s.jsxs("div",{className:"actions",children:[s.jsx(S,{variant:"primary",onClick:()=>r("retry"),children:"Retry (one model up)"}),s.jsx(S,{disabled:!t.trim(),onClick:()=>r("reply",!0),children:"Answer the agent"}),s.jsx(S,{onClick:()=>{window.confirm("Set up the pipeline on the skeleton as it is now? Its failing checks stay failing.")&&r("continue")},children:"Keep it as is"})]})]}):null}function zy(){const e=w(c=>c.sel),t=fe(c=>c.view),n=D(c=>c.chat),r=ts(wn(c=>c.status));if(N.useEffect(()=>{fo()},[e]),ht(()=>Zt(),1200,n?.status==="running"&&!r,`${n?.id}:${n?.status}`),ht(async()=>(await fo(),!0),5e3,!r,e),!t||t.projectId!==e)return s.jsx(Ee,{children:"Loading…"});const[l,i]=Ly[t.phase],o=n?.meta?.role??"",a=["vision","foundation","setup","scaffold"].includes(t.phase)||t.phase.startsWith("cp-"),u=()=>{window.confirm("Abandon this project? The folder stays on disk; it is only no longer being founded.")&&cl("abandon")};return s.jsxs("div",{children:[s.jsxs("div",{className:"spec-head",children:[s.jsx("h2",{children:`New project · ${t.name}`}),s.jsx(C,{tone:i,children:l}),s.jsx("span",{className:"muted",children:qe(t.costUsd)}),s.jsx("span",{className:"muted push-right",children:`started ${Yt(t.createdAt)}`}),t.phase!=="done"&&t.phase!=="abandoned"?s.jsx(S,{onClick:u,children:"Abandon"}):null]}),s.jsx(Iy,{f:t}),t.error&&t.phase!=="cp-scaffold"?s.jsxs(O,{tone:"bad",className:"gate",children:[s.jsx("div",{className:"error pre-wrap",children:t.error}),t.phase==="setup"?s.jsx("div",{className:"actions",children:s.jsx(S,{onClick:()=>void cl("retry"),children:"Restart the set-up"})}):null]}):null,t.warning?s.jsx(O,{tone:"warn",className:"gate",children:s.jsx("div",{className:"pre-wrap",children:t.warning})}):null,s.jsx(Dy,{f:t}),t.phase!=="cp-vision"&&t.vision?s.jsxs("details",{className:"gap-top",children:[s.jsx("summary",{children:"The validated vision"}),s.jsx(Ca,{v:t.vision,name:t.name,tickets:t.tickets})]}):null,t.phase!=="cp-foundation"&&t.foundation&&["scaffold","cp-scaffold","setup","done"].includes(t.phase)?s.jsxs("details",{className:"gap-top",children:[s.jsx("summary",{children:"The approved foundations"}),s.jsx(Ea,{p:t.foundation})]}):null,t.stages.length>1?s.jsxs(s.Fragment,{children:[s.jsx(U,{children:"Steps so far"}),s.jsx(ve,{head:["Step","Model","Status","Cost","When"],children:t.stages.map(c=>s.jsxs("tr",{className:`click${n?.id===c.runId?" current":""}`,tabIndex:0,onClick:()=>void He(c.runId),onKeyDown:f=>{f.key==="Enter"&&He(c.runId)},children:[s.jsx("td",{children:gi[c.stage]??c.stage}),s.jsx("td",{className:"mono",children:c.model}),s.jsx("td",{children:s.jsx(C,{tone:c.status==="done"?"ok":c.status==="running"?"info":"bad",children:c.status})}),s.jsx("td",{children:c.costUsd!=null?qe(c.costUsd):""}),s.jsx("td",{className:"muted",children:Yt(c.startedAt)})]},c.runId))})]}):null,s.jsx(U,{children:n?`Conversation · ${gi[o]??"Agent"}`:"Conversation"}),n?s.jsx($a,{chat:n,agent:gi[o]??"Agent",quiet:o==="vision",onReply:a&&n.id===(t.currentRunId||t.stages[t.stages.length-1]?.runId)?c=>void kf(c):void 0,replyHint:o==="vision"?"Answer the product owner…":o==="foundation"?"Answer the lead, or tell it what you want…":"Answer the agent…"}):s.jsx(b,{children:"Starting…"})]})}const Oy={overview:e=>s.jsx(yv,{d:e}),health:e=>s.jsx(_g,{d:e}),specs:e=>s.jsx(vv,{d:e}),run:e=>s.jsx(Pv,{d:e}),worktrees:e=>s.jsx(Bv,{d:e}),docker:e=>s.jsx(Pg,{d:e}),cost:()=>s.jsx(Ng,{}),tickets:e=>s.jsx(gy,{d:e}),features:e=>s.jsx(Ny,{d:e}),settings:()=>s.jsx(Py,{})},Fy=Tl.map(([e,t])=>({id:e,label:t}));function Ay(){const{projects:e,sel:t,detail:n,tab:r,error:l,busy:i}=w(),o=u=>xa(u),a=e.find(u=>u.id===t);return!t||!a?s.jsxs("main",{className:"main",children:[s.jsx(Zu,{}),l?s.jsx(Qr,{children:l}):null,s.jsx(qv,{})]}):s.jsxs("main",{className:"main",children:[s.jsx(Zu,{}),l?s.jsx(Qr,{children:l}):null,a?s.jsxs("header",{children:[s.jsx("h2",{children:a.title||a.name}),s.jsx(b,{children:a.oneLiner??""}),s.jsx(b,{mono:!0,children:a.root}),s.jsx("div",{className:"head-actions",children:s.jsx(S,{onClick:()=>{window.confirm("Remove this project from the dashboard? Nothing on disk is touched.")&&Dm(a.id)},children:"Remove from dashboard"})})]}):null,a.founding?s.jsx(zy,{}):s.jsxs(s.Fragment,{children:[s.jsx(Sg,{tabs:Fy,value:r,onChange:o,label:"Project sections"}),s.jsx("div",{id:"tabpanel",role:"tabpanel","aria-labelledby":`tab-${r}`,children:n?Oy[r](n):s.jsx(Ee,{children:i?"Loading…":"Nothing to show."})})]})]})}const My={overview:"Overview",health:"Health",specs:"Specs",run:"Run",worktrees:"Worktrees",docker:"Docker",cost:"Cost"};function Uy(e,t,n){const r=[{id:"home",group:"Go to",label:"Home",hint:"all projects and activity",action:{kind:"home"}}];if(t){for(const[l,i]of Object.entries(mo))r.push({id:`tab:${i}`,group:"Go to",label:My[i]??i,hint:`g ${l}`,action:{kind:"tab",tab:i}});for(const l of n?.specs??[]){const i=l.pipeline?.next;i&&r.push({id:`run:${l.id}`,group:"Run",label:`Run /${i.command} ${i.args}`,hint:i.why,action:{kind:"run",specId:l.id}})}}for(const l of e)r.push({id:`p:${l.id}`,group:"Projects",label:l.title||l.name,hint:l.root,action:{kind:"project",id:l.id}});return r}function Wy(e,t){const n=t.toLowerCase().split(/\s+/).filter(Boolean);return n.length?e.filter(r=>{const l=`${r.label} ${r.hint}`.toLowerCase();return n.every(i=>l.includes(i))}):e}function By(e){const t=e.action,n=w.getState();if(t.kind==="home")ha();else if(t.kind==="project")Qt(t.id);else if(t.kind==="tab")Cf(t.tab);else{const r=n.detail?.specs.find(i=>i.id===t.specId),l=r&&n.detail?zf(r,n.detail.worktrees):null;l&&Ef(l)}}function Vy(){const e=Ke(g=>g.paletteOpen),t=Ke(g=>g.setPalette),{projects:n,sel:r,detail:l}=w(),[i,o]=N.useState(""),[a,u]=N.useState(0),c=N.useRef(null),f=N.useMemo(()=>Uy(n,r,l),[n,r,l]),v=N.useMemo(()=>Wy(f,i),[f,i]);if(N.useEffect(()=>{e&&(o(""),u(0),setTimeout(()=>c.current?.focus(),0))},[e]),N.useEffect(()=>{u(0)},[i]),!e)return null;const p=g=>{g&&(t(!1),By(g))},x=g=>{g.key==="Escape"?(g.preventDefault(),t(!1)):g.key==="ArrowDown"?(g.preventDefault(),u(T=>Math.min(v.length-1,T+1))):g.key==="ArrowUp"?(g.preventDefault(),u(T=>Math.max(0,T-1))):g.key==="Enter"&&(g.preventDefault(),p(v[a]))};let j="";return s.jsx("div",{className:"overlay",onMouseDown:g=>{g.target===g.currentTarget&&t(!1)},children:s.jsxs("div",{className:"dialog palette",role:"dialog","aria-modal":"true","aria-label":"Command palette",onKeyDown:x,children:[s.jsx("input",{ref:c,value:i,onChange:g=>o(g.target.value),placeholder:"Jump to a project, a tab, or run a next step…","aria-label":"Search commands",role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":v[a]?`pal-${v[a].id}`:void 0}),s.jsx("ul",{id:"palette-list",role:"listbox",className:"palette-list",children:v.length?v.map((g,T)=>{const h=g.group!==j?s.jsx("li",{className:"palette-group",role:"presentation",children:g.group},`g-${g.group}`):null;return j=g.group,[h,s.jsxs("li",{id:`pal-${g.id}`,role:"option","aria-selected":T===a,className:`palette-item${T===a?" sel":""}`,onMouseMove:()=>u(T),onClick:()=>p(g),children:[s.jsx("span",{children:g.label}),s.jsx("span",{className:"muted mono palette-hint",children:g.hint})]},g.id)]}):s.jsx("li",{className:"palette-empty",role:"presentation",children:"No match"})})]})})}function Hy(){const e=w(r=>r.tab),t=xe(r=>r.job),n=ts(wn(r=>r.status));return ht(()=>xe.getState().poll(),1200,!!t&&(e==="worktrees"||e==="docker")&&Kt.includes(t.status)&&!n,`${t?.id}:${t?.status}`),null}const Qy=Tl.map(([e])=>e);function Ky(){const e=w(n=>n.sel),t=w(n=>n.tab);return N.useEffect(()=>{const n=Tm(e,t);location.hash!==n&&history.pushState(null,"",`${location.pathname}${n}`)},[e,t]),N.useEffect(()=>{const n=()=>{const r=pf(location.hash,Qy),l=w.getState();if(!r.projectId){ha();return}if(!l.projects.some(o=>o.id===r.projectId))return;const i=fa(r.tab)?r.tab:"overview";r.projectId!==l.sel?Qt(r.projectId,i):i!==l.tab&&(l.setTab(i),i==="run"&&pa(),i==="cost"&&ya(),Nf(i))};return window.addEventListener("hashchange",n),window.addEventListener("popstate",n),()=>{window.removeEventListener("hashchange",n),window.removeEventListener("popstate",n)}},[]),null}function Yy(){const e=Ke(n=>n.helpOpen),t=Ke(n=>n.setHelp);return N.useEffect(()=>{if(!e)return;const n=r=>{r.key==="Escape"&&t(!1)};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,t]),e?s.jsx("div",{className:"overlay",onMouseDown:n=>{n.target===n.currentTarget&&t(!1)},children:s.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[s.jsx("h2",{children:"Keyboard shortcuts"}),s.jsx("dl",{className:"shortcuts",children:yg.map(([n,r])=>s.jsxs("div",{children:[s.jsx("dt",{className:"kbd",children:n}),s.jsx("dd",{children:r})]},n))}),s.jsx(S,{onClick:()=>t(!1),children:"Close"})]})}):null}function Gy(){const e=qn(t=>Vm(t.items));return N.useEffect(()=>{document.title=Bm(e)},[e]),null}function qy(){return N.useEffect(()=>{il&&(zm(pf(location.hash,Tl.map(([e])=>e))),pg())},[]),il?s.jsxs("div",{className:"layout",children:[s.jsx(gg,{}),s.jsx(Ay,{}),s.jsx(Hy,{}),s.jsx(Ky,{}),s.jsx(kg,{}),s.jsx(Gy,{}),s.jsx(Vy,{}),s.jsx(Yy,{})]}):s.jsx(Ee,{children:"Open the URL printed by `cohorte ui` — it carries this session’s token."})}Jf(Xf());hf(document.getElementById("root")).render(s.jsx(N.StrictMode,{children:s.jsx(qy,{})}));