@vibeflow-tools/cli 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import{a as A,b as xe,c as ke,d as mt,e as ht,f as we,g as vt,h as Q,i as yt,j as fe,k as J,l as Y,m as Z,n as $,o as Ee,p as Ke,q as Se,r as Ie,s as xt,u as q,v as kt,w as wt,x as St,y as Ye}from"./chunk-Y5ZURUI5.js";import{a as V,b as Ct,c as _t}from"./chunk-KJ5LYG6A.js";import{Command as Sa}from"commander";import{execSync as gt,execFileSync as qe}from"child_process";import{readFileSync as Tr,readdirSync as Er,statSync as Ir,existsSync as ct,writeFileSync as Jt,mkdirSync as Xt,unlinkSync as an}from"fs";import{createRequire as Pr}from"module";import{join as K,resolve as Rr,basename as X,extname as on,dirname as Nr}from"path";import{createServer as ln}from"http";import{spawn as Zt,execSync as _e}from"child_process";import{networkInterfaces as Lr}from"os";import te from"express";import{WebSocketServer as sn,WebSocket as cn}from"ws";import w from"chalk";import{createExpressMiddleware as Mr}from"@trpc/server/adapters/express";import*as Vn from"cheerio";import{readdirSync as La,statSync as Ma}from"fs";import{join as Oa,extname as Aa}from"path";function jt(t,e){let r=`<script data-vibeflow-overlay>${e}</script>`,c=t.lastIndexOf("</body>");return c!==-1?t.slice(0,c)+r+`
2
+ import{a as A,b as xe,c as ke,d as bt,e as mt,f as we,g as ht,h as Q,i as vt,j as fe,k as X,l as Y,m as Z,n as $,o as Ie,p as Ke,q as Se,r as Pe,s as yt,u as q,v as xt,w as kt,x as wt}from"./chunk-Y5ZURUI5.js";import{a as V,b as St,c as Ct}from"./chunk-KJ5LYG6A.js";import{Command as Ca}from"commander";import{execSync as ft,execFileSync as qe}from"child_process";import{readFileSync as Tr,readdirSync as Er,statSync as Ir,existsSync as st,writeFileSync as Qt,mkdirSync as Xt,unlinkSync as an}from"fs";import{createRequire as Pr}from"module";import{join as K,resolve as Rr,basename as J,extname as on,dirname as Nr}from"path";import{createServer as ln}from"http";import{spawn as Jt,execSync as _e}from"child_process";import{networkInterfaces as Lr}from"os";import te from"express";import{WebSocketServer as sn,WebSocket as cn}from"ws";import w from"chalk";import{createExpressMiddleware as Mr}from"@trpc/server/adapters/express";import*as Vn from"cheerio";import{readdirSync as Ma,statSync as za}from"fs";import{join as Aa,extname as $a}from"path";function _t(t,e){let r=`<script data-vibeflow-overlay>${e}</script>`,c=t.lastIndexOf("</body>");return c!==-1?t.slice(0,c)+r+`
3
3
  `+t.slice(c):t+`
4
- `+r}import{watch as Kn}from"chokidar";function Ge(t,e){let r=Kn(t,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});return r.on("change",c=>{e.onChange(c)}),e.onAdd&&r.on("add",e.onAdd),e.onUnlink&&r.on("unlink",e.onUnlink),r}function Qe(t,e){return Ge(t,{onChange:e.onChanged,onAdd:e.onChanged,onUnlink:e.onDeleted})}var Je=`"use strict";(()=>{var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_react_production_min=__commonJS({"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js"(exports){"use strict";var l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){return a===null||typeof a!="object"?null:(a=z&&a[z]||a["@@iterator"],typeof a=="function"?a:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a,this.context=b,this.refs=D,this.updater=e||B}E.prototype.isReactComponent={};E.prototype.setState=function(a,b){if(typeof a!="object"&&typeof a!="function"&&a!=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,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a,this.context=b,this.refs=D,this.updater=e||B}var H=G.prototype=new F;H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function M(a,b,e){var d,c={},k=null,h=null;if(b!=null)for(d in b.ref!==void 0&&(h=b.ref),b.key!==void 0&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(g===1)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)c[d]===void 0&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}function N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return typeof a=="object"&&a!==null&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a2){return b[a2]})}var P=/\\/+/g;function Q(a,b){return typeof a=="object"&&a!==null&&a.key!=null?escape(""+a.key):b.toString(36)}function R(a,b,e,d,c){var k=typeof a;(k==="undefined"||k==="boolean")&&(a=null);var h=!1;if(a===null)h=!0;else switch(k){case"string":case"number":h=!0;break;case"object":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=d===""?"."+Q(h,0):d,I(c)?(e="",a!=null&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a2){return a2})):c!=null&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;if(h=0,d=d===""?".":d+":",I(a))for(var g=0;g<a.length;g++){k=a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),typeof f=="function")for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if(k==="object")throw b=String(a),Error("Objects are not valid as a React child (found: "+(b==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}function S(a,b,e){if(a==null)return a;var d=[],c=0;return R(a,d,"","",function(a2){return b.call(e,a2,c++)}),d}function T(a){if(a._status===-1){var b=a._result;b=b(),b.then(function(b2){(a._status===0||a._status===-1)&&(a._status=1,a._result=b2)},function(b2){(a._status===0||a._status===-1)&&(a._status=2,a._result=b2)}),a._status===-1&&(a._status=0,a._result=b)}if(a._status===1)return a._result.default;throw a._result}var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error("act(...) is not supported in production builds of React.")}exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;return S(a,function(){b++}),b},toArray:function(a){return S(a,function(a2){return a2})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};exports.Component=E;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;exports.act=X;exports.cloneElement=function(a,b,e){if(a==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(b!=null){if(b.ref!==void 0&&(k=b.ref,h=K.current),b.key!==void 0&&(c=""+b.key),a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=b[f]===void 0&&g!==void 0?g[f]:b[f])}var f=arguments.length-2;if(f===1)d.children=e;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){return a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},a.Provider={$$typeof:t,_context:a},a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);return b.type=a,b};exports.createRef=function(){return{current:null}};exports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:b===void 0?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=X;exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};exports.useTransition=function(){return U.current.useTransition()};exports.version="18.3.1"}});var require_react=__commonJS({"../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"(exports,module){"use strict";module.exports=require_react_production_min()}});var require_react_jsx_runtime_production_min=__commonJS({"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js"(exports){"use strict";var f=require_react(),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;g!==void 0&&(e=""+g),a.key!==void 0&&(e=""+a.key),a.ref!==void 0&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)d[b]===void 0&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q}});var require_jsx_runtime=__commonJS({"../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"(exports,module){"use strict";module.exports=require_react_jsx_runtime_production_min()}});var require_scheduler_production_min=__commonJS({"../../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js"(exports){"use strict";function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return a.length===0?null:a[0]}function k(a){if(a.length===0)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,w=e>>>1;d<w;){var m=2*(d+1)-1,C=a[m],n=m+1,x=a[n];if(0>g(C,c))n<e&&0>g(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(n<e&&0>g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}function g(a,b){var c=a.sortIndex-b.sortIndex;return c!==0?c:a.id-b.id}typeof performance=="object"&&typeof performance.now=="function"?(l=performance,exports.unstable_now=function(){return l.now()}):(p=Date,q=p.now(),exports.unstable_now=function(){return p.now()-q});var l,p,q,r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);b!==null;){if(b.callback===null)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){if(B=!1,G(a),!A)if(h(r)!==null)A=!0,I(J);else{var b=h(t);b!==null&&K(H,b.startTime-a)}}function J(a,b){A=!1,B&&(B=!1,E(L),L=-1),z=!0;var c=y;try{for(G(b),v=h(r);v!==null&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(typeof d=="function"){v.callback=null,y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now(),typeof e=="function"?v.callback=e:v===h(r)&&k(r),G(b)}else k(r);v=h(r)}if(v!==null)var w=!0;else{var m=h(t);m!==null&&K(H,m.startTime-b),w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;function M(){return!(exports.unstable_now()-Q<P)}function R(){if(O!==null){var a=exports.unstable_now();Q=a;var b=!0;try{b=O(!0,a)}finally{b?S():(N=!1,O=null)}}else N=!1}var S;typeof F=="function"?S=function(){F(R)}:typeof MessageChannel<"u"?(T=new MessageChannel,U=T.port2,T.port1.onmessage=R,S=function(){U.postMessage(null)}):S=function(){D(R,0)};var T,U;function I(a){O=a,N||(N=!0,S())}function K(a,b){L=D(function(){a(exports.unstable_now())},b)}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){A||z||(A=!0,I(J))};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<a?Math.floor(1e3/a):5};exports.unstable_getCurrentPriorityLevel=function(){return y};exports.unstable_getFirstCallbackNode=function(){return h(r)};exports.unstable_next=function(a){switch(y){case 1:case 2:case 3:var b=3;break;default:b=y}var c=y;y=b;try{return a()}finally{y=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=y;y=a;try{return b()}finally{y=c}};exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();switch(typeof c=="object"&&c!==null?(c=c.delay,c=typeof c=="number"&&0<c?d+c:d):c=d,a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1e4;break;default:e=5e3}return e=c+e,a={id:u++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1},c>d?(a.sortIndex=c,f(t,a),h(r)===null&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J))),a};exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}}}});var require_scheduler=__commonJS({"../../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/index.js"(exports,module){"use strict";module.exports=require_scheduler_production_min()}});var require_react_dom_production_min=__commonJS({"../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js"(exports){"use strict";var aa=require_react(),ca=require_scheduler();function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da=new Set,ea={};function fa(a,b){ha(a,b),ha(a+"Capture",b)}function ha(a,b){for(ea[a]=b,a=0;a<b.length;a++)da.add(b[a])}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[: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]*$/,la={},ma={};function oa(a){return ja.call(ma,a)?!0:ja.call(la,a)?!1:ka.test(a)?ma[a]=!0:(la[a]=!0,!1)}function pa(a,b,c,d){if(c!==null&&c.type===0)return!1;switch(typeof b){case"function":case"symbol":return!0;case"boolean":return d?!1:c!==null?!c.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function qa(a,b,c,d){if(b===null||typeof b>"u"||pa(a,b,c,d))return!0;if(d)return!1;if(c!==null)switch(c.type){case 3:return!b;case 4:return b===!1;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=b===2||b===3||b===4,this.attributeName=d,this.attributeNamespace=e,this.mustUseProperty=c,this.propertyName=a,this.type=b,this.sanitizeURL=f,this.removeEmptyString=g}var z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){z[a]=new v(a,2,!1,a,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(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[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(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});function ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;(e!==null?e.type!==0:d||!(2<b.length)||b[0]!=="o"&&b[0]!=="O"||b[1]!=="n"&&b[1]!=="N")&&(qa(b,c,e,d)&&(c=null),d||e===null?oa(b)&&(c===null?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=c===null?e.type===3?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,c===null?a.removeAttribute(b):(e=e.type,c=e===3||e===4&&c===!0?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Ia=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Ja=Symbol.iterator;function Ka(a){return a===null||typeof a!="object"?null:(a=Ja&&a[Ja]||a["@@iterator"],typeof a=="function"?a:null)}var A=Object.assign,La;function Ma(a){if(La===void 0)try{throw Error()}catch(c){var b=c.stack.trim().match(/\\n( *(at )?)/);La=b&&b[1]||""}return\`
4
+ `+r}import{watch as Kn}from"chokidar";function Ye(t,e){let r=Kn(t,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});return r.on("change",c=>{e.onChange(c)}),e.onAdd&&r.on("add",e.onAdd),e.onUnlink&&r.on("unlink",e.onUnlink),r}function Ge(t,e){return Ye(t,{onChange:e.onChanged,onAdd:e.onChanged,onUnlink:e.onDeleted})}var Qe=`"use strict";(()=>{var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_react_production_min=__commonJS({"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js"(exports){"use strict";var l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){return a===null||typeof a!="object"?null:(a=z&&a[z]||a["@@iterator"],typeof a=="function"?a:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a,this.context=b,this.refs=D,this.updater=e||B}E.prototype.isReactComponent={};E.prototype.setState=function(a,b){if(typeof a!="object"&&typeof a!="function"&&a!=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,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a,this.context=b,this.refs=D,this.updater=e||B}var H=G.prototype=new F;H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function M(a,b,e){var d,c={},k=null,h=null;if(b!=null)for(d in b.ref!==void 0&&(h=b.ref),b.key!==void 0&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(g===1)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)c[d]===void 0&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}function N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return typeof a=="object"&&a!==null&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a2){return b[a2]})}var P=/\\/+/g;function Q(a,b){return typeof a=="object"&&a!==null&&a.key!=null?escape(""+a.key):b.toString(36)}function R(a,b,e,d,c){var k=typeof a;(k==="undefined"||k==="boolean")&&(a=null);var h=!1;if(a===null)h=!0;else switch(k){case"string":case"number":h=!0;break;case"object":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=d===""?"."+Q(h,0):d,I(c)?(e="",a!=null&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a2){return a2})):c!=null&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;if(h=0,d=d===""?".":d+":",I(a))for(var g=0;g<a.length;g++){k=a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),typeof f=="function")for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if(k==="object")throw b=String(a),Error("Objects are not valid as a React child (found: "+(b==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}function S(a,b,e){if(a==null)return a;var d=[],c=0;return R(a,d,"","",function(a2){return b.call(e,a2,c++)}),d}function T(a){if(a._status===-1){var b=a._result;b=b(),b.then(function(b2){(a._status===0||a._status===-1)&&(a._status=1,a._result=b2)},function(b2){(a._status===0||a._status===-1)&&(a._status=2,a._result=b2)}),a._status===-1&&(a._status=0,a._result=b)}if(a._status===1)return a._result.default;throw a._result}var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error("act(...) is not supported in production builds of React.")}exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;return S(a,function(){b++}),b},toArray:function(a){return S(a,function(a2){return a2})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};exports.Component=E;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;exports.act=X;exports.cloneElement=function(a,b,e){if(a==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(b!=null){if(b.ref!==void 0&&(k=b.ref,h=K.current),b.key!==void 0&&(c=""+b.key),a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=b[f]===void 0&&g!==void 0?g[f]:b[f])}var f=arguments.length-2;if(f===1)d.children=e;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){return a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},a.Provider={$$typeof:t,_context:a},a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);return b.type=a,b};exports.createRef=function(){return{current:null}};exports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:b===void 0?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=X;exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};exports.useTransition=function(){return U.current.useTransition()};exports.version="18.3.1"}});var require_react=__commonJS({"../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js"(exports,module){"use strict";module.exports=require_react_production_min()}});var require_react_jsx_runtime_production_min=__commonJS({"../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js"(exports){"use strict";var f=require_react(),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function q(c,a,g){var b,d={},e=null,h=null;g!==void 0&&(e=""+g),a.key!==void 0&&(e=""+a.key),a.ref!==void 0&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)d[b]===void 0&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q}});var require_jsx_runtime=__commonJS({"../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"(exports,module){"use strict";module.exports=require_react_jsx_runtime_production_min()}});var require_scheduler_production_min=__commonJS({"../../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js"(exports){"use strict";function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return a.length===0?null:a[0]}function k(a){if(a.length===0)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,w=e>>>1;d<w;){var m=2*(d+1)-1,C=a[m],n=m+1,x=a[n];if(0>g(C,c))n<e&&0>g(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(n<e&&0>g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}function g(a,b){var c=a.sortIndex-b.sortIndex;return c!==0?c:a.id-b.id}typeof performance=="object"&&typeof performance.now=="function"?(l=performance,exports.unstable_now=function(){return l.now()}):(p=Date,q=p.now(),exports.unstable_now=function(){return p.now()-q});var l,p,q,r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);b!==null;){if(b.callback===null)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){if(B=!1,G(a),!A)if(h(r)!==null)A=!0,I(J);else{var b=h(t);b!==null&&K(H,b.startTime-a)}}function J(a,b){A=!1,B&&(B=!1,E(L),L=-1),z=!0;var c=y;try{for(G(b),v=h(r);v!==null&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(typeof d=="function"){v.callback=null,y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now(),typeof e=="function"?v.callback=e:v===h(r)&&k(r),G(b)}else k(r);v=h(r)}if(v!==null)var w=!0;else{var m=h(t);m!==null&&K(H,m.startTime-b),w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;function M(){return!(exports.unstable_now()-Q<P)}function R(){if(O!==null){var a=exports.unstable_now();Q=a;var b=!0;try{b=O(!0,a)}finally{b?S():(N=!1,O=null)}}else N=!1}var S;typeof F=="function"?S=function(){F(R)}:typeof MessageChannel<"u"?(T=new MessageChannel,U=T.port2,T.port1.onmessage=R,S=function(){U.postMessage(null)}):S=function(){D(R,0)};var T,U;function I(a){O=a,N||(N=!0,S())}function K(a,b){L=D(function(){a(exports.unstable_now())},b)}exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){A||z||(A=!0,I(J))};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<a?Math.floor(1e3/a):5};exports.unstable_getCurrentPriorityLevel=function(){return y};exports.unstable_getFirstCallbackNode=function(){return h(r)};exports.unstable_next=function(a){switch(y){case 1:case 2:case 3:var b=3;break;default:b=y}var c=y;y=b;try{return a()}finally{y=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=y;y=a;try{return b()}finally{y=c}};exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();switch(typeof c=="object"&&c!==null?(c=c.delay,c=typeof c=="number"&&0<c?d+c:d):c=d,a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1e4;break;default:e=5e3}return e=c+e,a={id:u++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1},c>d?(a.sortIndex=c,f(t,a),h(r)===null&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J))),a};exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}}}});var require_scheduler=__commonJS({"../../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/index.js"(exports,module){"use strict";module.exports=require_scheduler_production_min()}});var require_react_dom_production_min=__commonJS({"../../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js"(exports){"use strict";var aa=require_react(),ca=require_scheduler();function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da=new Set,ea={};function fa(a,b){ha(a,b),ha(a+"Capture",b)}function ha(a,b){for(ea[a]=b,a=0;a<b.length;a++)da.add(b[a])}var ia=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[: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]*$/,la={},ma={};function oa(a){return ja.call(ma,a)?!0:ja.call(la,a)?!1:ka.test(a)?ma[a]=!0:(la[a]=!0,!1)}function pa(a,b,c,d){if(c!==null&&c.type===0)return!1;switch(typeof b){case"function":case"symbol":return!0;case"boolean":return d?!1:c!==null?!c.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function qa(a,b,c,d){if(b===null||typeof b>"u"||pa(a,b,c,d))return!0;if(d)return!1;if(c!==null)switch(c.type){case 3:return!b;case 4:return b===!1;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=b===2||b===3||b===4,this.attributeName=d,this.attributeNamespace=e,this.mustUseProperty=c,this.propertyName=a,this.type=b,this.sanitizeURL=f,this.removeEmptyString=g}var z={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){z[a]=new v(a,2,!1,a,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(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[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(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});function ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;(e!==null?e.type!==0:d||!(2<b.length)||b[0]!=="o"&&b[0]!=="O"||b[1]!=="n"&&b[1]!=="N")&&(qa(b,c,e,d)&&(c=null),d||e===null?oa(b)&&(c===null?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=c===null?e.type===3?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,c===null?a.removeAttribute(b):(e=e.type,c=e===3||e===4&&c===!0?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Ia=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Ja=Symbol.iterator;function Ka(a){return a===null||typeof a!="object"?null:(a=Ja&&a[Ja]||a["@@iterator"],typeof a=="function"?a:null)}var A=Object.assign,La;function Ma(a){if(La===void 0)try{throw Error()}catch(c){var b=c.stack.trim().match(/\\n( *(at )?)/);La=b&&b[1]||""}return\`
5
5
  \`+La+a}var Na=!1;function Oa(a,b){if(!a||Na)return"";Na=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error()},Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(l){var d=l}Reflect.construct(a,[],b)}else{try{b.call()}catch(l){d=l}a.call(b.prototype)}else{try{throw Error()}catch(l){d=l}a()}}catch(l){if(l&&d&&typeof l.stack=="string"){for(var e=l.stack.split(\`
6
6
  \`),f=d.stack.split(\`
7
7
  \`),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(g!==1||h!==1)do if(g--,h--,0>h||e[g]!==f[h]){var k=\`
@@ -1618,7 +1618,7 @@ npm run dev (NODE_ENV=development)
1618
1618
  next dev (or: npm run dev)
1619
1619
 
1620
1620
  # Vite
1621
- npm run dev (NODE_ENV=development)\`)),rows.push(el("div",{className:"rq-note"},"Dev mode enables React debug stacks (_debugStack) and source maps. No Babel plugins or extra config required \\u2014 file + line are resolved automatically via source maps."))),rows)}async function showPopover(element,x,y){if(!state.root)return;state.popover&&(state.popover.remove(),state.popover=null);let pointer=await buildSourcePointerAsync(element),selector=pointer.selector,cssSelector=buildCssSelector(element),displayName=pointer.display,targetIcon=el("div",{className:"popover-target-icon"},"\\u2B21"),targetName=el("div",{className:"popover-target-name"},displayName.slice(0,50)),reactQuality=detectReactQuality(),showBadge=reactQuality!=="not-react"&&reactQuality!=="full",qualityTooltip={none:"React production build \\u2014 no component context available (click to learn more)",partial:"React partial context \\u2014 component name only, no source file (click to learn more)",full:"Drag to move","not-react":"Drag to move"},dragHandleClass=showBadge?\`popover-drag-handle popover-drag-handle--quality-\${reactQuality}\`:"popover-drag-handle",dragHandle=el("div",{className:dragHandleClass,title:qualityTooltip[reactQuality]??"Drag to move"});if(showBadge)dragHandle.appendChild(document.createTextNode("\\u26A0"));else{let gripSvg=document.createElementNS("http://www.w3.org/2000/svg","svg");gripSvg.setAttribute("width","12"),gripSvg.setAttribute("height","16"),gripSvg.setAttribute("viewBox","0 0 12 16"),gripSvg.setAttribute("fill","currentColor"),gripSvg.setAttribute("aria-hidden","true");let gripDots=[[3,3],[9,3],[3,8],[9,8],[3,13],[9,13]];for(let[cx,cy]of gripDots){let circle=document.createElementNS("http://www.w3.org/2000/svg","circle");circle.setAttribute("cx",String(cx)),circle.setAttribute("cy",String(cy)),circle.setAttribute("r","1.5"),gripSvg.appendChild(circle)}dragHandle.appendChild(gripSvg)}let header=el("div",{className:"popover-header"},targetIcon,targetName,dragHandle),sourceRow=el("div",{className:"popover-source"});if(pointer.file){let label=pointer.file.replace(/\\\\/g,"/").split("/").slice(-2).join("/")+(pointer.line!=null?\`:\${pointer.line}\`:""),srcLink=el("a",{href:\`vscode://file\${pointer.file}\${pointer.line!=null?\`:\${pointer.line}\`:""}\`,target:"_blank",title:pointer.file},label);pointer.component?sourceRow.append(srcLink,el("span",{className:"popover-source-sep"}," \\xB7 \\u2B21 "+pointer.component)):sourceRow.appendChild(srcLink)}else pointer.component&&sourceRow.appendChild(el("span",null,"\\u2B21 "+pointer.component));let titleInput=el("input",{type:"text",placeholder:"Task title..."}),textarea=el("textarea",{placeholder:"Describe your feedback..."}),typePicker=buildTypePickerEl("Task"),titleRow=el("div",{className:"popover-title-row"},typePicker.el,titleInput),body=el("div",{className:"popover-body"},titleRow,textarea),btnSave=el("button",{className:"btn-primary"},"Save"),btnCancel=el("button",null,"Cancel"),spacer=el("div",{className:"popover-actions-spacer"}),actions=el("div",{className:"popover-actions"},btnSave,btnCancel,spacer),popover=el("div",{className:"vibeflow-popover"},header,sourceRow,body,actions);state.popover=popover,showBadge&&!hasShownQualityModal()&&(markQualityModalShown(),window.setTimeout(()=>showReactQualityModal(reactQuality),200)),showBadge&&dragHandle.addEventListener("click",e=>{e.stopPropagation(),showReactQualityModal(reactQuality)}),popover.addEventListener("click",e=>{var _a;e.target.closest(".type-picker")||(_a=popover.querySelector(".type-picker-dropdown"))==null||_a.classList.remove("open")});let posX=x!==void 0?x:element.getBoundingClientRect().left,posY=y!==void 0?y:element.getBoundingClientRect().bottom+8;popover.style.left=\`\${Math.min(posX,window.innerWidth-620)}px\`,popover.style.top=\`\${Math.min(posY,window.innerHeight-350)}px\`;let dragState=null;dragHandle.addEventListener("pointerdown",e=>{e.preventDefault(),dragHandle.setPointerCapture(e.pointerId),dragState={startX:e.clientX,startY:e.clientY,origLeft:parseInt(popover.style.left,10)||0,origTop:parseInt(popover.style.top,10)||0},popover.classList.add("popover-dragging")}),dragHandle.addEventListener("pointermove",e=>{if(!dragState)return;let dx=e.clientX-dragState.startX,dy=e.clientY-dragState.startY,maxX=window.innerWidth-(popover.offsetWidth||480),maxY=window.innerHeight-(popover.offsetHeight||250);popover.style.left=\`\${Math.max(0,Math.min(maxX,dragState.origLeft+dx))}px\`,popover.style.top=\`\${Math.max(0,Math.min(maxY,dragState.origTop+dy))}px\`}),dragHandle.addEventListener("pointerup",()=>{dragState=null,popover.classList.remove("popover-dragging")}),dragHandle.addEventListener("pointercancel",()=>{dragState=null,popover.classList.remove("popover-dragging")}),state.root.appendChild(popover),titleInput.focus(),btnSave.addEventListener("click",()=>{var _a,_b;let text=textarea.value.trim(),rawTitle=titleInput.value.trim();if(!rawTitle){titleInput.classList.remove("input-error"),titleInput.offsetWidth,titleInput.classList.add("input-error"),titleInput.focus();let clear=()=>{titleInput.classList.remove("input-error"),titleInput.removeEventListener("input",clear)};titleInput.addEventListener("input",clear);return}let title=rawTitle;if(!text&&!title)return;let rawInnerText=((_a=element.innerText)==null?void 0:_a.trim())??"",capturedHtmlText=rawInnerText?rawInnerText.slice(0,300):void 0,selectedType=typePicker.getValue(),desc=text||title;if(selectedType==="Bug"){let logs=getRecordedLogs();logs&&(desc+=logs)}submitTask(selector,cssSelector,title,desc,void 0,{file:pointer.file,line:pointer.line,col:pointer.col,component:pointer.component},selectedType||void 0,capturedHtmlText),(_b=state.popover)==null||_b.remove(),state.popover=null,clearAnnotateHighlight(),flashOverlayTrigger()}),btnCancel.addEventListener("click",()=>{var _a;(_a=state.popover)==null||_a.remove(),state.popover=null,clearAnnotateHighlight()})}function toggleSidebar(){fetchTasks()}function hasPrototypingApi2(){return typeof window<"u"&&"__vf_prototyping"in window}function openPrototypingPanel2(){let api=window.__vf_prototyping;api==null||api.openPanel()}function showContextMenu(element,x,y){if(hideContextMenu(),state.disabled)return;let displayName=buildSourcePointer(element).display;if(setAnnotateHighlight(element),!state.root)return;let menu=el("div",{className:"vibeflow-context-menu"});menu.style.left=\`\${Math.min(x,window.innerWidth-220)}px\`,menu.style.top=\`\${Math.min(y,window.innerHeight-200)}px\`;let annotateBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F4DD}"),\`Annotate "\${displayName.slice(0,30)}"\`);annotateBtn.addEventListener("click",()=>{hideContextMenu(!0),showPopover(element,x,y)}),menu.appendChild(annotateBtn);let inspectBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F50D}"),"Inspect selector");if(inspectBtn.addEventListener("click",()=>{hideContextMenu(),buildSourcePointerAsync(element).then(ptr=>showInspectModal(element,ptr))}),menu.appendChild(inspectBtn),hasPrototypingApi2()){let prototypingBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F3A8}"),"Prototyping");prototypingBtn.addEventListener("click",()=>{hideContextMenu(),openPrototypingPanel2()}),menu.appendChild(prototypingBtn)}if((()=>{try{return localStorage.getItem(TRIGGER_HIDDEN_KEY)==="1"}catch{return!1}})()){let showBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F441}"),"Show Vibeflow");showBtn.addEventListener("click",()=>{hideContextMenu(),showOverlayTrigger()}),menu.appendChild(showBtn)}else{let hideBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F441}"),"Hide Vibeflow");hideBtn.addEventListener("click",()=>{hideContextMenu(),hideOverlayTrigger()}),menu.appendChild(hideBtn)}let disableBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F6AB}"),"Disable Vibeflow");disableBtn.addEventListener("click",()=>{hideContextMenu(),disableVibeflowOverlay()}),menu.appendChild(disableBtn),state.contextMenu=menu,state.root.appendChild(menu),setTimeout(()=>{document.addEventListener("click",()=>hideContextMenu(),{once:!0})},0)}function hideContextMenu(keepHighlight){state.contextMenu&&(state.contextMenu.remove(),state.contextMenu=null),keepHighlight||clearAnnotateHighlight()}function setupKeyboardShortcuts(host){document.addEventListener("keydown",e=>{e.altKey&&e.key==="a"&&(e.preventDefault(),toggleAnnotationMode(host)),e.altKey&&e.key==="s"&&(e.preventDefault(),toggleSidebar()),e.key==="Escape"&&(state.contextMenu?hideContextMenu():state.popover?(state.popover.remove(),state.popover=null,clearAnnotateHighlight()):state.annotationMode?toggleAnnotationMode(host):state.sidebarPinned&&void 0)},!0)}function toggleAnnotationMode(host){state.annotationMode=!state.annotationMode,document.body.classList.toggle("vibeflow-overlay-active",state.annotationMode),state.annotationMode,state.annotationMode?startAnnotationHover(host):(stopAnnotationHover(host),state.popover&&(state.popover.remove(),state.popover=null))}function setupContextMenuListener(host){document.addEventListener("contextmenu",e=>{let target=e.target;!target||target===document.body||target===document.documentElement||e.composedPath().indexOf(host)===-1&&(e.preventDefault(),showContextMenu(target,e.clientX,e.clientY))},!0)}function setupClickToAnnotate(host){document.addEventListener("click",e=>{if(!state.annotationMode||e.composedPath().indexOf(host)!==-1)return;let target=e.target;!target||target===document.body||target===document.documentElement||(e.preventDefault(),e.stopPropagation(),showPopover(target,e.clientX,e.clientY))},!0)}function setupSpaNavigation(onRouteChange){let _protoOrigPush=history.pushState.bind(history);history.pushState=(...args)=>{_protoOrigPush(...args),onRouteChange()};let _protoOrigReplace=history.replaceState.bind(history);history.replaceState=(...args)=>{_protoOrigReplace(...args),onRouteChange()},window.addEventListener("popstate",onRouteChange),window.addEventListener("hashchange",onRouteChange)}var import_react26=__toESM(require_react(),1),import_client=__toESM(require_client(),1);function main(){startRecording();let selfScript=document.querySelector("script[data-board-id]")??document.querySelector('script[src*="vibeflow-overlay"]');selfScript&&!selfScript.hasAttribute("data-vibeflow-overlay")&&selfScript.setAttribute("data-vibeflow-overlay",""),selfScript!=null&&selfScript.dataset.boardId&&!PROTO_CONFIG.boardId&&(PROTO_CONFIG.boardId=selfScript.dataset.boardId);let globalBoardId=window.__PROTO_BOARD_ID;if(globalBoardId&&!PROTO_CONFIG.boardId&&(PROTO_CONFIG.boardId=globalBoardId),selfScript!=null&&selfScript.dataset.overlayApiKey&&!PROTO_CONFIG.overlayApiKey&&(PROTO_CONFIG.overlayApiKey=selfScript.dataset.overlayApiKey),document.getElementById("vibeflow-studio-root"))return;try{localStorage.removeItem(TRIGGER_HIDDEN_KEY)}catch{}let{host,root}=setupShadowDom();state.host=host,state.root=root,loadPrefs();let indicatorContainer=el("div",{className:"vibeflow-indicators"});state.indicatorContainer=indicatorContainer,root.appendChild(indicatorContainer);let reactContainer=document.createElement("div");reactContainer.className="vibeflow-react-root",root.appendChild(reactContainer),(0,import_client.createRoot)(reactContainer).render(import_react26.default.createElement(OverlayApp,{onOpenKanban:()=>{if(PROTO_CONFIG.boardId){let origin=new URL(PROTO_CONFIG.apiUrl).origin;window.open(\`\${origin}/kanban?board=\${encodeURIComponent(PROTO_CONFIG.boardId)}\`,"_blank","noopener")}else if(PROTO_CONFIG.wsUrl){let kanbanUrl=PROTO_CONFIG.apiUrl.replace("/api/tasks","/kanban");window.open(kanbanUrl,"_blank","noopener")}},onSubmitTask:(selector,cssSelector,title,description,status,type,meta)=>{submitTask(selector,cssSelector,title,description,status,meta,type)}})),state.onTasksFetched=()=>{renderIndicators()},state.onTasksUpdatedMessage=fetchTasks,connectWS(),setupWsVisibilityReconnect(),fetchTasks(),fetchPages(),setupKeyboardShortcuts(host),setupContextMenuListener(host),setupClickToAnnotate(host),setupIndicatorScrollRefresh(),setupInteractionDebounce(host),setupClickOutsideTooltipClose(host),setupSpaNavigation(()=>{location.href!==state.currentHref&&(state.currentHref=location.href,renderIndicators())})}main();})();
1621
+ npm run dev (NODE_ENV=development)\`)),rows.push(el("div",{className:"rq-note"},"Dev mode enables React debug stacks (_debugStack) and source maps. No Babel plugins or extra config required \\u2014 file + line are resolved automatically via source maps."))),rows)}async function showPopover(element,x,y){if(!state.root)return;state.popover&&(state.popover.remove(),state.popover=null);let pointer=await buildSourcePointerAsync(element),selector=pointer.selector,cssSelector=buildCssSelector(element),displayName=pointer.display,targetIcon=el("div",{className:"popover-target-icon"},"\\u2B21"),targetName=el("div",{className:"popover-target-name"},displayName.slice(0,50)),reactQuality=detectReactQuality(),showBadge=reactQuality!=="not-react"&&reactQuality!=="full",qualityTooltip={none:"React production build \\u2014 no component context available (click to learn more)",partial:"React partial context \\u2014 component name only, no source file (click to learn more)",full:"Drag to move","not-react":"Drag to move"},dragHandleClass=showBadge?\`popover-drag-handle popover-drag-handle--quality-\${reactQuality}\`:"popover-drag-handle",dragHandle=el("div",{className:dragHandleClass,title:qualityTooltip[reactQuality]??"Drag to move"});if(showBadge)dragHandle.appendChild(document.createTextNode("\\u26A0"));else{let gripSvg=document.createElementNS("http://www.w3.org/2000/svg","svg");gripSvg.setAttribute("width","12"),gripSvg.setAttribute("height","16"),gripSvg.setAttribute("viewBox","0 0 12 16"),gripSvg.setAttribute("fill","currentColor"),gripSvg.setAttribute("aria-hidden","true");let gripDots=[[3,3],[9,3],[3,8],[9,8],[3,13],[9,13]];for(let[cx,cy]of gripDots){let circle=document.createElementNS("http://www.w3.org/2000/svg","circle");circle.setAttribute("cx",String(cx)),circle.setAttribute("cy",String(cy)),circle.setAttribute("r","1.5"),gripSvg.appendChild(circle)}dragHandle.appendChild(gripSvg)}let header=el("div",{className:"popover-header"},targetIcon,targetName,dragHandle),sourceRow=el("div",{className:"popover-source"});if(pointer.file){let label=pointer.file.replace(/\\\\/g,"/").split("/").slice(-2).join("/")+(pointer.line!=null?\`:\${pointer.line}\`:""),srcLink=el("a",{href:\`vscode://file\${pointer.file}\${pointer.line!=null?\`:\${pointer.line}\`:""}\`,target:"_blank",title:pointer.file},label);pointer.component?sourceRow.append(srcLink,el("span",{className:"popover-source-sep"}," \\xB7 \\u2B21 "+pointer.component)):sourceRow.appendChild(srcLink)}else pointer.component&&sourceRow.appendChild(el("span",null,"\\u2B21 "+pointer.component));let titleInput=el("input",{type:"text",placeholder:"Task title..."}),textarea=el("textarea",{placeholder:"Describe your feedback..."}),typePicker=buildTypePickerEl("Task"),titleRow=el("div",{className:"popover-title-row"},typePicker.el,titleInput),body=el("div",{className:"popover-body"},titleRow,textarea),btnSave=el("button",{className:"btn-primary"},"Save"),btnCancel=el("button",null,"Cancel"),spacer=el("div",{className:"popover-actions-spacer"}),actions=el("div",{className:"popover-actions"},btnSave,btnCancel,spacer),popover=el("div",{className:"vibeflow-popover"},header,sourceRow,body,actions);state.popover=popover,showBadge&&!hasShownQualityModal()&&(markQualityModalShown(),window.setTimeout(()=>showReactQualityModal(reactQuality),200)),showBadge&&dragHandle.addEventListener("click",e=>{e.stopPropagation(),showReactQualityModal(reactQuality)}),popover.addEventListener("click",e=>{var _a;e.target.closest(".type-picker")||(_a=popover.querySelector(".type-picker-dropdown"))==null||_a.classList.remove("open")});let posX=x!==void 0?x:element.getBoundingClientRect().left,posY=y!==void 0?y:element.getBoundingClientRect().bottom+8;popover.style.left=\`\${Math.min(posX,window.innerWidth-620)}px\`,popover.style.top=\`\${Math.min(posY,window.innerHeight-350)}px\`;let dragState=null;dragHandle.addEventListener("pointerdown",e=>{e.preventDefault(),dragHandle.setPointerCapture(e.pointerId),dragState={startX:e.clientX,startY:e.clientY,origLeft:parseInt(popover.style.left,10)||0,origTop:parseInt(popover.style.top,10)||0},popover.classList.add("popover-dragging")}),dragHandle.addEventListener("pointermove",e=>{if(!dragState)return;let dx=e.clientX-dragState.startX,dy=e.clientY-dragState.startY,maxX=window.innerWidth-(popover.offsetWidth||480),maxY=window.innerHeight-(popover.offsetHeight||250);popover.style.left=\`\${Math.max(0,Math.min(maxX,dragState.origLeft+dx))}px\`,popover.style.top=\`\${Math.max(0,Math.min(maxY,dragState.origTop+dy))}px\`}),dragHandle.addEventListener("pointerup",()=>{dragState=null,popover.classList.remove("popover-dragging")}),dragHandle.addEventListener("pointercancel",()=>{dragState=null,popover.classList.remove("popover-dragging")}),state.root.appendChild(popover),titleInput.focus(),btnSave.addEventListener("click",()=>{var _a,_b;let text=textarea.value.trim(),rawTitle=titleInput.value.trim();if(!rawTitle){titleInput.classList.remove("input-error"),titleInput.offsetWidth,titleInput.classList.add("input-error"),titleInput.focus();let clear=()=>{titleInput.classList.remove("input-error"),titleInput.removeEventListener("input",clear)};titleInput.addEventListener("input",clear);return}let title=rawTitle;if(!text&&!title)return;let rawInnerText=((_a=element.innerText)==null?void 0:_a.trim())??"",capturedHtmlText=rawInnerText?rawInnerText.slice(0,300):void 0,selectedType=typePicker.getValue(),desc=text||title;if(selectedType==="Bug"){let logs=getRecordedLogs();logs&&(desc+=logs)}submitTask(selector,cssSelector,title,desc,void 0,{file:pointer.file,line:pointer.line,col:pointer.col,component:pointer.component},selectedType||void 0,capturedHtmlText),(_b=state.popover)==null||_b.remove(),state.popover=null,clearAnnotateHighlight(),flashOverlayTrigger()}),btnCancel.addEventListener("click",()=>{var _a;(_a=state.popover)==null||_a.remove(),state.popover=null,clearAnnotateHighlight()})}function toggleSidebar(){fetchTasks()}function hasPrototypingApi2(){return typeof window<"u"&&"__vf_prototyping"in window}function openPrototypingPanel2(){let api=window.__vf_prototyping;api==null||api.openPanel()}function showContextMenu(element,x,y){if(hideContextMenu(),state.disabled)return;let displayName=buildSourcePointer(element).display;if(setAnnotateHighlight(element),!state.root)return;let menu=el("div",{className:"vibeflow-context-menu"});menu.style.left=\`\${Math.min(x,window.innerWidth-220)}px\`,menu.style.top=\`\${Math.min(y,window.innerHeight-200)}px\`;let annotateBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F4DD}"),\`Annotate "\${displayName.slice(0,30)}"\`);annotateBtn.addEventListener("click",()=>{hideContextMenu(!0),showPopover(element,x,y)}),menu.appendChild(annotateBtn);let inspectBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F50D}"),"Inspect selector");if(inspectBtn.addEventListener("click",()=>{hideContextMenu(),buildSourcePointerAsync(element).then(ptr=>showInspectModal(element,ptr))}),menu.appendChild(inspectBtn),hasPrototypingApi2()){let prototypingBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F3A8}"),"Prototyping");prototypingBtn.addEventListener("click",()=>{hideContextMenu(),openPrototypingPanel2()}),menu.appendChild(prototypingBtn)}if((()=>{try{return localStorage.getItem(TRIGGER_HIDDEN_KEY)==="1"}catch{return!1}})()){let showBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F441}"),"Show Vibeflow");showBtn.addEventListener("click",()=>{hideContextMenu(),showOverlayTrigger()}),menu.appendChild(showBtn)}else{let hideBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F441}"),"Hide Vibeflow");hideBtn.addEventListener("click",()=>{hideContextMenu(),hideOverlayTrigger()}),menu.appendChild(hideBtn)}let disableBtn=el("button",null,el("span",{className:"menu-icon"},"\\u{1F6AB}"),"Disable Vibeflow");disableBtn.addEventListener("click",()=>{hideContextMenu(),disableVibeflowOverlay()}),menu.appendChild(disableBtn),state.contextMenu=menu,state.root.appendChild(menu),setTimeout(()=>{document.addEventListener("click",()=>hideContextMenu(),{once:!0})},0)}function hideContextMenu(keepHighlight){state.contextMenu&&(state.contextMenu.remove(),state.contextMenu=null),keepHighlight||clearAnnotateHighlight()}function setupKeyboardShortcuts(host){document.addEventListener("keydown",e=>{e.altKey&&e.key==="a"&&(e.preventDefault(),toggleAnnotationMode(host)),e.altKey&&e.key==="s"&&(e.preventDefault(),toggleSidebar()),e.key==="Escape"&&(state.contextMenu?hideContextMenu():state.popover?(state.popover.remove(),state.popover=null,clearAnnotateHighlight()):state.annotationMode?toggleAnnotationMode(host):state.sidebarPinned&&void 0)},!0)}function toggleAnnotationMode(host){state.annotationMode=!state.annotationMode,document.body.classList.toggle("vibeflow-overlay-active",state.annotationMode),state.annotationMode,state.annotationMode?startAnnotationHover(host):(stopAnnotationHover(host),state.popover&&(state.popover.remove(),state.popover=null))}function setupContextMenuListener(host){document.addEventListener("contextmenu",e=>{let target=e.target;!target||!(target instanceof Element)||target===document.body||target===document.documentElement||e.composedPath().indexOf(host)===-1&&(e.preventDefault(),showContextMenu(target,e.clientX,e.clientY))},!0)}function setupClickToAnnotate(host){document.addEventListener("click",e=>{if(!state.annotationMode||e.composedPath().indexOf(host)!==-1)return;let target=e.target;!target||!(target instanceof Element)||target===document.body||target===document.documentElement||(e.preventDefault(),e.stopPropagation(),showPopover(target,e.clientX,e.clientY))},!0)}function setupSpaNavigation(onRouteChange){let _protoOrigPush=history.pushState.bind(history);history.pushState=(...args)=>{_protoOrigPush(...args),onRouteChange()};let _protoOrigReplace=history.replaceState.bind(history);history.replaceState=(...args)=>{_protoOrigReplace(...args),onRouteChange()},window.addEventListener("popstate",onRouteChange),window.addEventListener("hashchange",onRouteChange)}var import_react26=__toESM(require_react(),1),import_client=__toESM(require_client(),1);function main(){startRecording();let selfScript=document.querySelector("script[data-board-id]")??document.querySelector('script[src*="vibeflow-overlay"]');selfScript&&!selfScript.hasAttribute("data-vibeflow-overlay")&&selfScript.setAttribute("data-vibeflow-overlay",""),selfScript!=null&&selfScript.dataset.boardId&&!PROTO_CONFIG.boardId&&(PROTO_CONFIG.boardId=selfScript.dataset.boardId);let globalBoardId=window.__PROTO_BOARD_ID;if(globalBoardId&&!PROTO_CONFIG.boardId&&(PROTO_CONFIG.boardId=globalBoardId),selfScript!=null&&selfScript.dataset.overlayApiKey&&!PROTO_CONFIG.overlayApiKey&&(PROTO_CONFIG.overlayApiKey=selfScript.dataset.overlayApiKey),document.getElementById("vibeflow-studio-root"))return;try{localStorage.removeItem(TRIGGER_HIDDEN_KEY)}catch{}let{host,root}=setupShadowDom();state.host=host,state.root=root,loadPrefs();let indicatorContainer=el("div",{className:"vibeflow-indicators"});state.indicatorContainer=indicatorContainer,root.appendChild(indicatorContainer);let reactContainer=document.createElement("div");reactContainer.className="vibeflow-react-root",root.appendChild(reactContainer),(0,import_client.createRoot)(reactContainer).render(import_react26.default.createElement(OverlayApp,{onOpenKanban:()=>{if(PROTO_CONFIG.boardId){let origin=new URL(PROTO_CONFIG.apiUrl).origin;window.open(\`\${origin}/kanban?board=\${encodeURIComponent(PROTO_CONFIG.boardId)}\`,"_blank","noopener")}else if(PROTO_CONFIG.wsUrl){let kanbanUrl=PROTO_CONFIG.apiUrl.replace("/api/tasks","/kanban");window.open(kanbanUrl,"_blank","noopener")}},onSubmitTask:(selector,cssSelector,title,description,status,type,meta)=>{submitTask(selector,cssSelector,title,description,status,meta,type)}})),state.onTasksFetched=()=>{renderIndicators()},state.onTasksUpdatedMessage=fetchTasks,connectWS(),setupWsVisibilityReconnect(),fetchTasks(),fetchPages(),setupKeyboardShortcuts(host),setupContextMenuListener(host),setupClickToAnnotate(host),setupIndicatorScrollRefresh(),setupInteractionDebounce(host),setupClickOutsideTooltipClose(host),setupSpaNavigation(()=>{location.href!==state.currentHref&&(state.currentHref=location.href,renderIndicators())})}main();})();
1622
1622
  /*! Bundled license information:
1623
1623
 
1624
1624
  react/cjs/react.production.min.js:
@@ -1692,9 +1692,9 @@ var PROTO_CONFIG = {
1692
1692
  pagesUrl: _vfOrigin + '/api/pages',
1693
1693
  screenshotsUrl: _vfOrigin + '/screenshots/'
1694
1694
  };
1695
- `+Je}function Tt(t){return`var PROTO_CONFIG = ${JSON.stringify({port:0,wsUrl:"",apiUrl:`${t}/api/overlay/tasks`,pagesUrl:"",screenshotsUrl:""})};
1696
- `+Je}import{existsSync as Yn,readFileSync as Gn}from"fs";import{dirname as Qn,join as et}from"path";import{fileURLToPath as Jn}from"url";var Et=`*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
1697
- /*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.mb-0\\.5{margin-bottom:.125rem}.ml-1\\.5{margin-left:.375rem}.mr-0\\.5{margin-right:.125rem}.mt-0\\.5{margin-top:.125rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-7{height:1.75rem}.min-h-\\[30px\\]{min-height:30px}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-10{width:2.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-7{width:1.75rem}.w-full{width:100%}.min-w-\\[100px\\]{min-width:100px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-text{cursor:text}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-hidden{overflow-y:hidden}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-none{border-style:none}.border-slate-700{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.border-slate-700\\/60{border-color:rgba(51,65,85,.6)}.border-slate-800\\/60{border-color:rgba(30,41,59,.6)}.border-violet-700\\/50{border-color:rgba(109,40,217,.5)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity,1))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity,1))}.bg-slate-800{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-violet-900\\/30{background-color:rgba(76,29,149,.3)}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\\[10px\\]{font-size:10px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-tight{line-height:1.25}.text-green-400{--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.text-violet-300{--tw-text-opacity:1;color:rgb(196 181 253/var(--tw-text-opacity,1))}.text-violet-400{--tw-text-opacity:1;color:rgb(167 139 250/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(100 116 139/var(--tw-placeholder-opacity,1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity:1;color:rgb(100 116 139/var(--tw-placeholder-opacity,1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.\\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--p-bg:#020c1b;--p-surface:#080f1e;--p-card:#0a0f1e;--p-input:#050d1a;--p-hover:#0d1f38;--p-border:#1e293b;--p-border-s:#1e3a5f;--p-border-t:#334155;--p-text:#e2e8f0;--p-text-sub:#cbd5e1;--p-text-m:#94a3b8;--p-text-f:#64748b;--p-text-g:#475569;--p-white:#fff;--p-blue:#2563eb;--p-blue-700:#1d4ed8;--p-blue-300:#60a5fa;--p-blue-200:#93c5fd;--p-purple:#a78bfa;--p-purple-300:#c4b5fd;--p-cyan-300:#7dd3fc;--p-amber:#f59e0b;--p-amber-300:#fcd34d;--p-green:#22c55e;--p-green-300:#6ee7b7;--p-red:#f87171;--p-red-500:#ef4444;--p-bg-2:#0f172a;--p-bg-3:#1e293b;--p-shadow-lg:0 8px 24px rgba(2,6,23,.28);--p-overlay:rgba(15,23,42,.2)}body,html{height:100%;margin:0;padding:0}body{font-family:Inter,sans-serif;background:var(--p-bg);color:var(--p-text)}#root{height:100%;display:flex;flex-direction:column;overflow:hidden}*{scrollbar-width:thin;scrollbar-color:var(--p-border-t) transparent}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--p-border-t);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--p-text-g)}#kanban-board{scrollbar-width:none;-ms-overflow-style:none;overflow-x:auto;overflow-y:hidden}#kanban-board::-webkit-scrollbar{display:none}#kanban-scroll-track{position:fixed;bottom:0;left:0;right:0;height:6px;background:transparent;z-index:40;pointer-events:none}#kanban-scroll-thumb{position:absolute;top:1px;height:4px;border-radius:2px;background:var(--p-border-t);cursor:pointer;pointer-events:auto;transition:background .15s}#kanban-scroll-thumb.dragging,#kanban-scroll-thumb:hover{background:var(--p-text-g)}.board-column{flex:0 0 280px;width:280px;display:flex;flex-direction:column;gap:6px;min-height:0}.column-header{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--p-surface);border:1px solid var(--p-border)}.column-scroll{flex:1;overflow-y:auto;min-height:0;gap:5px;padding-bottom:8px}.column-scroll,.task-card{display:flex;flex-direction:column}.task-card{background:var(--p-card);border:1px solid var(--p-border);border-radius:10px;padding:11px 13px;cursor:grab;transition:border-color .12s,background .12s,box-shadow .12s,transform .12s;gap:7px}.task-card:hover{border-color:var(--p-border-s);background:var(--p-hover);box-shadow:0 4px 16px rgba(0,0,0,.3);transform:translateY(-1px)}.task-card:active{cursor:grabbing;transform:scale(.98)}.task-card.dragging{opacity:.4}.drag-over{outline:2px dashed rgba(59,130,246,.5);outline-offset:-3px;border-radius:10px;background:rgba(59,130,246,.04)}.file-compact-actions{opacity:0}.group\\/file-compact:hover .file-compact-actions{opacity:1}.file-normal-actions,.group\\/file-compact:hover .file-compact-ts{opacity:0}.group\\/file:hover .file-normal-actions{opacity:1}.group\\/file:hover{background:rgba(30,41,59,.6)}.status-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.sd-backlog{background:#475569}.sd-todo{background:#f59e0b}.sd-inprogress{background:#3b82f6;animation:pulse-prog 2s ease-in-out infinite}.sd-review{background:#a855f7}.sd-done{background:#22c55e}@keyframes pulse-prog{0%,to{box-shadow:0 0 0 0 rgba(59,130,246,.5)}50%{box-shadow:0 0 0 4px rgba(59,130,246,0)}}.type-badge{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:20px;font-size:10px;font-weight:500;border:1px solid}.type-bug{color:#fca5a5;background:rgba(239,68,68,.1);border-color:rgba(239,68,68,.25)}.type-feature{color:#86efac;background:rgba(34,197,94,.08);border-color:rgba(34,197,94,.2)}.type-enhancement{color:#93c5fd;background:rgba(59,130,246,.08);border-color:rgba(59,130,246,.2)}.type-task{color:#cbd5e1;background:rgba(148,163,184,.08);border-color:rgba(148,163,184,.2)}.type-research{color:#c4b5fd;background:rgba(139,92,246,.08);border-color:rgba(139,92,246,.2)}.source-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:6px;font-size:10px;font-family:JetBrains Mono,monospace;background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15);color:#60a5fa;cursor:pointer;text-decoration:none;transition:background .1s,border-color .1s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.source-pill:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.3)}@keyframes spin{to{transform:rotate(1turn)}}.spinner{display:inline-block;width:11px;height:11px;border:2px solid rgba(96,165,250,.3);border-top-color:#60a5fa;border-radius:50%;animation:spin .7s linear infinite}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:50;display:flex;align-items:center;justify-content:center}.modal-box{background:var(--p-card);border:1px solid var(--p-border);border-radius:14px;width:520px;max-width:95vw;overflow:hidden}.type-picker{display:flex;align-items:center;gap:6px}.type-picker-trigger{display:flex;align-items:center;gap:4px;width:auto;height:30px;padding:0 8px;border-radius:8px;border:1px solid var(--p-border-t);background:var(--p-card);color:var(--p-text-sub);font-size:13px;cursor:pointer;white-space:nowrap}.type-picker-label{font-size:11px;font-weight:500;color:var(--p-text-m);letter-spacing:.02em}.type-picker-trigger:hover{border-color:var(--p-text-g);color:var(--p-text)}.type-picker-options{display:none;align-items:center;gap:4px}.type-picker-options.open{display:flex}.type-picker-option{width:28px;height:28px;border-radius:7px;border:1px solid var(--p-border-t);background:var(--p-card);color:var(--p-text-sub);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px}.type-picker-option:hover{border-color:#60a5fa;color:#bfdbfe}#detail-panel-container{min-width:360px;max-width:min(860px,100%);position:absolute;right:0;top:0;bottom:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid #1e293b;animation:panel-slide-in .18s ease-out}#detail-panel-container.resizing{box-shadow:-12px 0 32px rgba(2,8,23,.6)}#detail-panel-resize-handle{position:absolute;left:0;top:0;width:12px;height:100%;cursor:ew-resize;z-index:5}#detail-panel-resize-handle:hover{background:linear-gradient(90deg,rgba(59,130,246,.22),rgba(59,130,246,0))}body.proto-resizing-panel{cursor:ew-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}#detail-panel{flex:1;background:var(--p-card);display:flex;flex-direction:column;overflow:hidden}@keyframes panel-slide-in{0%{width:0;opacity:0}to{width:420px;opacity:1}}.dp-header{padding:14px 16px 10px}.dp-header,.dp-tabs{border-bottom:1px solid var(--p-border);background:var(--p-surface);flex-shrink:0}.dp-tabs{display:flex;gap:0}.dp-tab{padding:8px 14px;font-size:12px;font-weight:500;color:var(--p-text-g);cursor:pointer;transition:color .12s,border-color .12s;background:none;border:none;border-bottom:2px solid transparent}.dp-tab:hover{color:var(--p-text-m)}.dp-tab.active{color:#93c5fd;border-bottom-color:#3b82f6}.dp-body{overflow:hidden}.dp-body,.dp-body>.dp-pane{flex:1;display:flex;flex-direction:column;gap:12px;min-height:0}.dp-body>.dp-pane{padding:14px 16px}#dp-details-pane,.dp-body>.dp-pane{overflow-y:auto;background:var(--p-card)}.dp-footer{padding:10px 16px 12px;border-top:1px solid var(--p-border);flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--p-card)}.dp-source-pill{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:6px;font-size:10px;font-family:monospace;background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15);color:#60a5fa;white-space:nowrap}.dp-source-pill:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.3)}.dp-status-btn{padding:3px 10px;border-radius:6px;font-size:10px;font-weight:500;border:1px solid var(--p-border-t);color:var(--p-text-f);background:transparent;cursor:pointer;transition:background .12s,border-color .12s,color .12s}.dp-status-btn:hover{border-color:var(--p-text-g);color:var(--p-text-m)}.dp-status-btn.active-backlog{border-color:#475569;background:rgba(100,116,139,.1);color:#94a3b8}.dp-status-btn.active-todo{border-color:rgba(245,158,11,.5);background:rgba(245,158,11,.1);color:#f59e0b}.dp-status-btn.active-in-progress{border-color:rgba(59,130,246,.5);background:rgba(59,130,246,.1);color:#60a5fa}.dp-status-btn.active-review{border-color:rgba(168,85,247,.5);background:rgba(168,85,247,.1);color:#a855f7}.dp-status-btn.active-done{border-color:rgba(34,197,94,.4);background:rgba(34,197,94,.08);color:#22c55e}.dp-input{width:100%;padding:7px 10px;border:1px solid var(--p-border-s);border-radius:8px;background:var(--p-input);color:var(--p-text);font-size:13px;font-family:inherit;outline:none;transition:border-color .12s,box-shadow .12s;box-sizing:border-box}.dp-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.dp-input::-moz-placeholder{color:var(--p-border-t)}.dp-input::placeholder{color:var(--p-border-t)}.dp-textarea{width:100%;padding:8px 10px;border:1px solid var(--p-border-s);border-radius:8px;background:var(--p-input);color:var(--p-text);font-size:12px;font-family:monospace;line-height:1.6;resize:vertical;outline:none;box-sizing:border-box;transition:border-color .12s,box-shadow .12s}.dp-textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.dp-textarea::-moz-placeholder{color:var(--p-border-t)}.dp-textarea::placeholder{color:var(--p-border-t)}.dp-meta-label{font-size:10px;font-weight:600;color:var(--p-text-g);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}@keyframes pulse-live{0%,to{box-shadow:0 0 0 0 rgba(74,222,128,.4)}50%{box-shadow:0 0 0 4px rgba(74,222,128,0)}}@keyframes agent-pulse{0%,to{opacity:.5}50%{opacity:1}}@keyframes skeleton-pulse{0%,to{opacity:1}50%{opacity:.4}}@keyframes away-glow{0%,to{box-shadow:0 0 0 0 rgba(37,99,235,.45),0 0 24px rgba(37,99,235,.1);border-color:rgba(37,99,235,.35)}50%{box-shadow:0 0 0 14px rgba(37,99,235,0),0 0 48px rgba(37,99,235,.2);border-color:rgba(96,165,250,.6)}}@keyframes away-fade-in{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.focus-within\\:border-blue-500:focus-within{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.hover\\:bg-red-900\\/40:hover{background-color:rgba(127,29,29,.4)}.hover\\:bg-slate-700:hover{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity,1))}.hover\\:bg-slate-700\\/50:hover{background-color:rgba(51,65,85,.5)}.hover\\:bg-slate-700\\/60:hover{background-color:rgba(51,65,85,.6)}.hover\\:bg-slate-800:hover{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.hover\\:bg-violet-800\\/30:hover{background-color:rgba(91,33,182,.3)}.hover\\:text-slate-200:hover{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.hover\\:text-slate-300:hover{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.hover\\:text-violet-300:hover{--tw-text-opacity:1;color:rgb(196 181 253/var(--tw-text-opacity,1))}.hover\\:underline:hover{text-decoration-line:underline}.group\\/comment:hover .group-hover\\/comment\\:opacity-100{opacity:1}`;var Ze='"use strict";(()=>{var Gg=Object.create;var cf=Object.defineProperty;var Kg=Object.getOwnPropertyDescriptor;var jg=Object.getOwnPropertyNames;var Xg=Object.getPrototypeOf,Qg=Object.prototype.hasOwnProperty;var wa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Yg=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jg(t))!Qg.call(e,o)&&o!==a&&cf(e,o,{get:()=>t[o],enumerable:!(r=Kg(t,o))||r.enumerable});return e};var E=(e,t,a)=>(a=e!=null?Gg(Xg(e)):{},Yg(t||!e||!e.__esModule?cf(a,"default",{value:e,enumerable:!0}):a,e));var wf=wa(he=>{"use strict";var Jo=Symbol.for("react.element"),Zg=Symbol.for("react.portal"),Jg=Symbol.for("react.fragment"),eh=Symbol.for("react.strict_mode"),th=Symbol.for("react.profiler"),ah=Symbol.for("react.provider"),rh=Symbol.for("react.context"),oh=Symbol.for("react.forward_ref"),nh=Symbol.for("react.suspense"),lh=Symbol.for("react.memo"),sh=Symbol.for("react.lazy"),pf=Symbol.iterator;function ih(e){return e===null||typeof e!="object"?null:(e=pf&&e[pf]||e["@@iterator"],typeof e=="function"?e:null)}var hf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xf=Object.assign,vf={};function uo(e,t,a){this.props=e,this.context=t,this.refs=vf,this.updater=a||hf}uo.prototype.isReactComponent={};uo.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")};uo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function yf(){}yf.prototype=uo.prototype;function gi(e,t,a){this.props=e,this.context=t,this.refs=vf,this.updater=a||hf}var hi=gi.prototype=new yf;hi.constructor=gi;xf(hi,uo.prototype);hi.isPureReactComponent=!0;var mf=Array.isArray,Lf=Object.prototype.hasOwnProperty,xi={current:null},Sf={key:!0,ref:!0,__self:!0,__source:!0};function If(e,t,a){var r,o={},n=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(n=""+t.key),t)Lf.call(t,r)&&!Sf.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=a;else if(1<s){for(var i=Array(s),d=0;d<s;d++)i[d]=arguments[d+2];o.children=i}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return{$$typeof:Jo,type:e,key:n,ref:l,props:o,_owner:xi.current}}function uh(e,t){return{$$typeof:Jo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function vi(e){return typeof e=="object"&&e!==null&&e.$$typeof===Jo}function dh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var gf=/\\/+/g;function mi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dh(""+e.key):t.toString(36)}function kl(e,t,a,r,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(n){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Jo:case Zg:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+mi(l,0):r,mf(o)?(a="",e!=null&&(a=e.replace(gf,"$&/")+"/"),kl(o,t,a,"",function(d){return d})):o!=null&&(vi(o)&&(o=uh(o,a+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(gf,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",mf(e))for(var s=0;s<e.length;s++){n=e[s];var i=r+mi(n,s);l+=kl(n,t,a,i,o)}else if(i=ih(e),typeof i=="function")for(e=i.call(e),s=0;!(n=e.next()).done;)n=n.value,i=r+mi(n,s++),l+=kl(n,t,a,i,o);else if(n==="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 l}function wl(e,t,a){if(e==null)return e;var r=[],o=0;return kl(e,r,"","",function(n){return t.call(a,n,o++)}),r}function fh(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var gt={current:null},bl={transition:null},ch={ReactCurrentDispatcher:gt,ReactCurrentBatchConfig:bl,ReactCurrentOwner:xi};function Cf(){throw Error("act(...) is not supported in production builds of React.")}he.Children={map:wl,forEach:function(e,t,a){wl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return wl(e,function(){t++}),t},toArray:function(e){return wl(e,function(t){return t})||[]},only:function(e){if(!vi(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};he.Component=uo;he.Fragment=Jg;he.Profiler=th;he.PureComponent=gi;he.StrictMode=eh;he.Suspense=nh;he.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ch;he.act=Cf;he.cloneElement=function(e,t,a){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=xf({},e.props),o=e.key,n=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,l=xi.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(i in t)Lf.call(t,i)&&!Sf.hasOwnProperty(i)&&(r[i]=t[i]===void 0&&s!==void 0?s[i]:t[i])}var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){s=Array(i);for(var d=0;d<i;d++)s[d]=arguments[d+2];r.children=s}return{$$typeof:Jo,type:e.type,key:o,ref:n,props:r,_owner:l}};he.createContext=function(e){return e={$$typeof:rh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ah,_context:e},e.Consumer=e};he.createElement=If;he.createFactory=function(e){var t=If.bind(null,e);return t.type=e,t};he.createRef=function(){return{current:null}};he.forwardRef=function(e){return{$$typeof:oh,render:e}};he.isValidElement=vi;he.lazy=function(e){return{$$typeof:sh,_payload:{_status:-1,_result:e},_init:fh}};he.memo=function(e,t){return{$$typeof:lh,type:e,compare:t===void 0?null:t}};he.startTransition=function(e){var t=bl.transition;bl.transition={};try{e()}finally{bl.transition=t}};he.unstable_act=Cf;he.useCallback=function(e,t){return gt.current.useCallback(e,t)};he.useContext=function(e){return gt.current.useContext(e)};he.useDebugValue=function(){};he.useDeferredValue=function(e){return gt.current.useDeferredValue(e)};he.useEffect=function(e,t){return gt.current.useEffect(e,t)};he.useId=function(){return gt.current.useId()};he.useImperativeHandle=function(e,t,a){return gt.current.useImperativeHandle(e,t,a)};he.useInsertionEffect=function(e,t){return gt.current.useInsertionEffect(e,t)};he.useLayoutEffect=function(e,t){return gt.current.useLayoutEffect(e,t)};he.useMemo=function(e,t){return gt.current.useMemo(e,t)};he.useReducer=function(e,t,a){return gt.current.useReducer(e,t,a)};he.useRef=function(e){return gt.current.useRef(e)};he.useState=function(e){return gt.current.useState(e)};he.useSyncExternalStore=function(e,t,a){return gt.current.useSyncExternalStore(e,t,a)};he.useTransition=function(){return gt.current.useTransition()};he.version="18.3.1"});var Oe=wa((Iy,kf)=>{"use strict";kf.exports=wf()});var Bf=wa(ze=>{"use strict";function Ii(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Tl(o,t))e[r]=t,e[a]=o,a=r;else break e}}function ta(e){return e.length===0?null:e[0]}function Rl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,o=e.length,n=o>>>1;r<n;){var l=2*(r+1)-1,s=e[l],i=l+1,d=e[i];if(0>Tl(s,a))i<o&&0>Tl(d,s)?(e[r]=d,e[i]=a,r=i):(e[r]=s,e[l]=a,r=l);else if(i<o&&0>Tl(d,a))e[r]=d,e[i]=a,r=i;else break e}}return t}function Tl(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(bf=performance,ze.unstable_now=function(){return bf.now()}):(yi=Date,Tf=yi.now(),ze.unstable_now=function(){return yi.now()-Tf});var bf,yi,Tf,pa=[],$a=[],ph=1,Ut=null,dt=3,Ml=!1,Tr=!1,tn=!1,Mf=typeof setTimeout=="function"?setTimeout:null,Af=typeof clearTimeout=="function"?clearTimeout:null,Pf=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ci(e){for(var t=ta($a);t!==null;){if(t.callback===null)Rl($a);else if(t.startTime<=e)Rl($a),t.sortIndex=t.expirationTime,Ii(pa,t);else break;t=ta($a)}}function wi(e){if(tn=!1,Ci(e),!Tr)if(ta(pa)!==null)Tr=!0,bi(ki);else{var t=ta($a);t!==null&&Ti(wi,t.startTime-e)}}function ki(e,t){Tr=!1,tn&&(tn=!1,Af(an),an=-1),Ml=!0;var a=dt;try{for(Ci(t),Ut=ta(pa);Ut!==null&&(!(Ut.expirationTime>t)||e&&!Ff());){var r=Ut.callback;if(typeof r=="function"){Ut.callback=null,dt=Ut.priorityLevel;var o=r(Ut.expirationTime<=t);t=ze.unstable_now(),typeof o=="function"?Ut.callback=o:Ut===ta(pa)&&Rl(pa),Ci(t)}else Rl(pa);Ut=ta(pa)}if(Ut!==null)var n=!0;else{var l=ta($a);l!==null&&Ti(wi,l.startTime-t),n=!1}return n}finally{Ut=null,dt=a,Ml=!1}}var Al=!1,Pl=null,an=-1,Df=5,Ef=-1;function Ff(){return!(ze.unstable_now()-Ef<Df)}function Li(){if(Pl!==null){var e=ze.unstable_now();Ef=e;var t=!0;try{t=Pl(!0,e)}finally{t?en():(Al=!1,Pl=null)}}else Al=!1}var en;typeof Pf=="function"?en=function(){Pf(Li)}:typeof MessageChannel<"u"?(Si=new MessageChannel,Rf=Si.port2,Si.port1.onmessage=Li,en=function(){Rf.postMessage(null)}):en=function(){Mf(Li,0)};var Si,Rf;function bi(e){Pl=e,Al||(Al=!0,en())}function Ti(e,t){an=Mf(function(){e(ze.unstable_now())},t)}ze.unstable_IdlePriority=5;ze.unstable_ImmediatePriority=1;ze.unstable_LowPriority=4;ze.unstable_NormalPriority=3;ze.unstable_Profiling=null;ze.unstable_UserBlockingPriority=2;ze.unstable_cancelCallback=function(e){e.callback=null};ze.unstable_continueExecution=function(){Tr||Ml||(Tr=!0,bi(ki))};ze.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Df=0<e?Math.floor(1e3/e):5};ze.unstable_getCurrentPriorityLevel=function(){return dt};ze.unstable_getFirstCallbackNode=function(){return ta(pa)};ze.unstable_next=function(e){switch(dt){case 1:case 2:case 3:var t=3;break;default:t=dt}var a=dt;dt=t;try{return e()}finally{dt=a}};ze.unstable_pauseExecution=function(){};ze.unstable_requestPaint=function(){};ze.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=dt;dt=e;try{return t()}finally{dt=a}};ze.unstable_scheduleCallback=function(e,t,a){var r=ze.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=a+o,e={id:ph++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Ii($a,e),ta(pa)===null&&e===ta($a)&&(tn?(Af(an),an=-1):tn=!0,Ti(wi,a-r))):(e.sortIndex=o,Ii(pa,e),Tr||Ml||(Tr=!0,bi(ki))),e};ze.unstable_shouldYield=Ff;ze.unstable_wrapCallback=function(e){var t=dt;return function(){var a=dt;dt=t;try{return e.apply(this,arguments)}finally{dt=a}}}});var zf=wa((wy,Of)=>{"use strict";Of.exports=Bf()});var qm=wa(Bt=>{"use strict";var mh=Oe(),Et=zf();function M(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);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 $c=new Set,kn={};function Hr(e,t){Ao(e,t),Ao(e+"Capture",t)}function Ao(e,t){for(kn[e]=t,e=0;e<t.length;e++)$c.add(t[e])}var Ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qi=Object.prototype.hasOwnProperty,gh=/^[: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]*$/,Nf={},Uf={};function hh(e){return Qi.call(Uf,e)?!0:Qi.call(Nf,e)?!1:gh.test(e)?Uf[e]=!0:(Nf[e]=!0,!1)}function xh(e,t,a,r){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function vh(e,t,a,r){if(t===null||typeof t>"u"||xh(e,t,a,r))return!0;if(r)return!1;if(a!==null)switch(a.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 vt(e,t,a,r,o,n,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=l}var it={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){it[e]=new vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];it[t]=new vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){it[e]=new vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){it[e]=new vt(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){it[e]=new vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){it[e]=new vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){it[e]=new vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){it[e]=new vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){it[e]=new vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var _u=/[\\-:]([a-z])/g;function Wu(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(_u,Wu);it[t]=new vt(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(_u,Wu);it[t]=new vt(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(_u,Wu);it[t]=new vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){it[e]=new vt(e,1,!1,e.toLowerCase(),null,!1,!1)});it.xlinkHref=new vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){it[e]=new vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function $u(e,t,a,r){var o=it.hasOwnProperty(t)?it[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(vh(t,a,o,r)&&(a=null),r||o===null?hh(t)&&(a===null?e.removeAttribute(t):e.setAttribute(t,""+a)):o.mustUseProperty?e[o.propertyName]=a===null?o.type===3?!1:"":a:(t=o.attributeName,r=o.attributeNamespace,a===null?e.removeAttribute(t):(o=o.type,a=o===3||o===4&&a===!0?"":""+a,r?e.setAttributeNS(r,t,a):e.setAttribute(t,a))))}var Fa=mh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Dl=Symbol.for("react.element"),po=Symbol.for("react.portal"),mo=Symbol.for("react.fragment"),Vu=Symbol.for("react.strict_mode"),Yi=Symbol.for("react.profiler"),Vc=Symbol.for("react.provider"),Gc=Symbol.for("react.context"),Gu=Symbol.for("react.forward_ref"),Zi=Symbol.for("react.suspense"),Ji=Symbol.for("react.suspense_list"),Ku=Symbol.for("react.memo"),Ga=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Kc=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Hf=Symbol.iterator;function rn(e){return e===null||typeof e!="object"?null:(e=Hf&&e[Hf]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Object.assign,Pi;function cn(e){if(Pi===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\\n( *(at )?)/);Pi=t&&t[1]||""}return`\n`+Pi+e}var Ri=!1;function Mi(e,t){if(!e||Ri)return"";Ri=!0;var a=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(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var o=d.stack.split(`\n`),n=r.stack.split(`\n`),l=o.length-1,s=n.length-1;1<=l&&0<=s&&o[l]!==n[s];)s--;for(;1<=l&&0<=s;l--,s--)if(o[l]!==n[s]){if(l!==1||s!==1)do if(l--,s--,0>s||o[l]!==n[s]){var i=`\n`+o[l].replace(" at new "," at ");return e.displayName&&i.includes("<anonymous>")&&(i=i.replace("<anonymous>",e.displayName)),i}while(1<=l&&0<=s);break}}}finally{Ri=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?cn(e):""}function yh(e){switch(e.tag){case 5:return cn(e.type);case 16:return cn("Lazy");case 13:return cn("Suspense");case 19:return cn("SuspenseList");case 0:case 2:case 15:return e=Mi(e.type,!1),e;case 11:return e=Mi(e.type.render,!1),e;case 1:return e=Mi(e.type,!0),e;default:return""}}function eu(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 mo:return"Fragment";case po:return"Portal";case Yi:return"Profiler";case Vu:return"StrictMode";case Zi:return"Suspense";case Ji:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Gc:return(e.displayName||"Context")+".Consumer";case Vc:return(e._context.displayName||"Context")+".Provider";case Gu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ku:return t=e.displayName||null,t!==null?t:eu(e.type)||"Memo";case Ga:t=e._payload,e=e._init;try{return eu(e(t))}catch{}}return null}function Lh(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 eu(t);case 8:return t===Vu?"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 lr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Sh(e){var t=jc(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,n=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,n.call(this,l)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function El(e){e._valueTracker||(e._valueTracker=Sh(e))}function Xc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=jc(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function ss(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 tu(e,t){var a=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function qf(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=lr(t.value!=null?t.value:a),e._wrapperState={initialChecked:r,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qc(e,t){t=t.checked,t!=null&&$u(e,"checked",t,!1)}function au(e,t){Qc(e,t);var a=lr(t.value),r=t.type;if(a!=null)r==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ru(e,t.type,a):t.hasOwnProperty("defaultValue")&&ru(e,t.type,lr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _f(e,t,a){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,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function ru(e,t,a){(t!=="number"||ss(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var pn=Array.isArray;function ko(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+lr(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ou(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return Ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wf(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(M(92));if(pn(a)){if(1<a.length)throw Error(M(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:lr(a)}}function Yc(e,t){var a=lr(t.value),r=lr(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),r!=null&&(e.defaultValue=""+r)}function $f(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Zc(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 nu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Zc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fl,Jc=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,a,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fl=Fl||document.createElement("div"),Fl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var hn={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},Ih=["Webkit","ms","Moz","O"];Object.keys(hn).forEach(function(e){Ih.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),hn[t]=hn[e]})});function ep(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||hn.hasOwnProperty(e)&&hn[e]?(""+t).trim():t+"px"}function tp(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=ep(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var Ch=Ge({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 lu(e,t){if(t){if(Ch[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function su(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 iu=null;function ju(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var uu=null,bo=null,To=null;function Vf(e){if(e=$n(e)){if(typeof uu!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Bs(t),uu(e.stateNode,e.type,t))}}function ap(e){bo?To?To.push(e):To=[e]:bo=e}function rp(){if(bo){var e=bo,t=To;if(To=bo=null,Vf(e),t)for(e=0;e<t.length;e++)Vf(t[e])}}function op(e,t){return e(t)}function np(){}var Ai=!1;function lp(e,t,a){if(Ai)return e(t,a);Ai=!0;try{return op(e,t,a)}finally{Ai=!1,(bo!==null||To!==null)&&(np(),rp())}}function Tn(e,t){var a=e.stateNode;if(a===null)return null;var r=Bs(a);if(r===null)return null;a=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(a&&typeof a!="function")throw Error(M(231,t,typeof a));return a}var du=!1;if(Ma)try{fo={},Object.defineProperty(fo,"passive",{get:function(){du=!0}}),window.addEventListener("test",fo,fo),window.removeEventListener("test",fo,fo)}catch{du=!1}var fo;function wh(e,t,a,r,o,n,l,s,i){var d=Array.prototype.slice.call(arguments,3);try{t.apply(a,d)}catch(f){this.onError(f)}}var xn=!1,is=null,us=!1,fu=null,kh={onError:function(e){xn=!0,is=e}};function bh(e,t,a,r,o,n,l,s,i){xn=!1,is=null,wh.apply(kh,arguments)}function Th(e,t,a,r,o,n,l,s,i){if(bh.apply(this,arguments),xn){if(xn){var d=is;xn=!1,is=null}else throw Error(M(198));us||(us=!0,fu=d)}}function qr(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function sp(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 Gf(e){if(qr(e)!==e)throw Error(M(188))}function Ph(e){var t=e.alternate;if(!t){if(t=qr(e),t===null)throw Error(M(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var n=o.alternate;if(n===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===a)return Gf(o),e;if(n===r)return Gf(o),t;n=n.sibling}throw Error(M(188))}if(a.return!==r.return)a=o,r=n;else{for(var l=!1,s=o.child;s;){if(s===a){l=!0,a=o,r=n;break}if(s===r){l=!0,r=o,a=n;break}s=s.sibling}if(!l){for(s=n.child;s;){if(s===a){l=!0,a=n,r=o;break}if(s===r){l=!0,r=n,a=o;break}s=s.sibling}if(!l)throw Error(M(189))}}if(a.alternate!==r)throw Error(M(190))}if(a.tag!==3)throw Error(M(188));return a.stateNode.current===a?e:t}function ip(e){return e=Ph(e),e!==null?up(e):null}function up(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=up(e);if(t!==null)return t;e=e.sibling}return null}var dp=Et.unstable_scheduleCallback,Kf=Et.unstable_cancelCallback,Rh=Et.unstable_shouldYield,Mh=Et.unstable_requestPaint,Qe=Et.unstable_now,Ah=Et.unstable_getCurrentPriorityLevel,Xu=Et.unstable_ImmediatePriority,fp=Et.unstable_UserBlockingPriority,ds=Et.unstable_NormalPriority,Dh=Et.unstable_LowPriority,cp=Et.unstable_IdlePriority,As=null,xa=null;function Eh(e){if(xa&&typeof xa.onCommitFiberRoot=="function")try{xa.onCommitFiberRoot(As,e,void 0,(e.current.flags&128)===128)}catch{}}var la=Math.clz32?Math.clz32:Oh,Fh=Math.log,Bh=Math.LN2;function Oh(e){return e>>>=0,e===0?32:31-(Fh(e)/Bh|0)|0}var Bl=64,Ol=4194304;function mn(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 fs(e,t){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,n=e.pingedLanes,l=a&268435455;if(l!==0){var s=l&~o;s!==0?r=mn(s):(n&=l,n!==0&&(r=mn(n)))}else l=a&~o,l!==0?r=mn(l):n!==0&&(r=mn(n));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((r&4)!==0&&(r|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)a=31-la(t),o=1<<a,r|=e[a],t&=~o;return r}function zh(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 Nh(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var l=31-la(n),s=1<<l,i=o[l];i===-1?((s&a)===0||(s&r)!==0)&&(o[l]=zh(s,t)):i<=t&&(e.expiredLanes|=s),n&=~s}}function cu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function pp(){var e=Bl;return Bl<<=1,(Bl&4194240)===0&&(Bl=64),e}function Di(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function _n(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-la(t),e[t]=a}function Uh(e,t){var a=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<a;){var o=31-la(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function Qu(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-la(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var Re=0;function mp(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var gp,Yu,hp,xp,vp,pu=!1,zl=[],Za=null,Ja=null,er=null,Pn=new Map,Rn=new Map,ja=[],Hh="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 jf(e,t){switch(e){case"focusin":case"focusout":Za=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":er=null;break;case"pointerover":case"pointerout":Pn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rn.delete(t.pointerId)}}function on(e,t,a,r,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[o]},t!==null&&(t=$n(t),t!==null&&Yu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function qh(e,t,a,r,o){switch(t){case"focusin":return Za=on(Za,e,t,a,r,o),!0;case"dragenter":return Ja=on(Ja,e,t,a,r,o),!0;case"mouseover":return er=on(er,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return Pn.set(n,on(Pn.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,Rn.set(n,on(Rn.get(n)||null,e,t,a,r,o)),!0}return!1}function yp(e){var t=Mr(e.target);if(t!==null){var a=qr(t);if(a!==null){if(t=a.tag,t===13){if(t=sp(a),t!==null){e.blockedOn=t,vp(e.priority,function(){hp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Yl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=mu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);iu=r,a.target.dispatchEvent(r),iu=null}else return t=$n(a),t!==null&&Yu(t),e.blockedOn=a,!1;t.shift()}return!0}function Xf(e,t,a){Yl(e)&&a.delete(t)}function _h(){pu=!1,Za!==null&&Yl(Za)&&(Za=null),Ja!==null&&Yl(Ja)&&(Ja=null),er!==null&&Yl(er)&&(er=null),Pn.forEach(Xf),Rn.forEach(Xf)}function nn(e,t){e.blockedOn===t&&(e.blockedOn=null,pu||(pu=!0,Et.unstable_scheduleCallback(Et.unstable_NormalPriority,_h)))}function Mn(e){function t(o){return nn(o,e)}if(0<zl.length){nn(zl[0],e);for(var a=1;a<zl.length;a++){var r=zl[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Za!==null&&nn(Za,e),Ja!==null&&nn(Ja,e),er!==null&&nn(er,e),Pn.forEach(t),Rn.forEach(t),a=0;a<ja.length;a++)r=ja[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<ja.length&&(a=ja[0],a.blockedOn===null);)yp(a),a.blockedOn===null&&ja.shift()}var Po=Fa.ReactCurrentBatchConfig,cs=!0;function Wh(e,t,a,r){var o=Re,n=Po.transition;Po.transition=null;try{Re=1,Zu(e,t,a,r)}finally{Re=o,Po.transition=n}}function $h(e,t,a,r){var o=Re,n=Po.transition;Po.transition=null;try{Re=4,Zu(e,t,a,r)}finally{Re=o,Po.transition=n}}function Zu(e,t,a,r){if(cs){var o=mu(e,t,a,r);if(o===null)Ui(e,t,r,ps,a),jf(e,r);else if(qh(o,e,t,a,r))r.stopPropagation();else if(jf(e,r),t&4&&-1<Hh.indexOf(e)){for(;o!==null;){var n=$n(o);if(n!==null&&gp(n),n=mu(e,t,a,r),n===null&&Ui(e,t,r,ps,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else Ui(e,t,r,null,a)}}var ps=null;function mu(e,t,a,r){if(ps=null,e=ju(r),e=Mr(e),e!==null)if(t=qr(e),t===null)e=null;else if(a=t.tag,a===13){if(e=sp(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ps=e,null}function Lp(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(Ah()){case Xu:return 1;case fp:return 4;case ds:case Dh:return 16;case cp:return 536870912;default:return 16}default:return 16}}var Qa=null,Ju=null,Zl=null;function Sp(){if(Zl)return Zl;var e,t=Ju,a=t.length,r,o="value"in Qa?Qa.value:Qa.textContent,n=o.length;for(e=0;e<a&&t[e]===o[e];e++);var l=a-e;for(r=1;r<=l&&t[a-r]===o[n-r];r++);return Zl=o.slice(e,1<r?1-r:void 0)}function Jl(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 Nl(){return!0}function Qf(){return!1}function Ft(e){function t(a,r,o,n,l){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=n,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(a=e[s],this[s]=a?a(n):n[s]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Nl:Qf,this.isPropagationStopped=Qf,this}return Ge(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nl)},persist:function(){},isPersistent:Nl}),t}var No={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ed=Ft(No),Wn=Ge({},No,{view:0,detail:0}),Vh=Ft(Wn),Ei,Fi,ln,Ds=Ge({},Wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:td,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!==ln&&(ln&&e.type==="mousemove"?(Ei=e.screenX-ln.screenX,Fi=e.screenY-ln.screenY):Fi=Ei=0,ln=e),Ei)},movementY:function(e){return"movementY"in e?e.movementY:Fi}}),Yf=Ft(Ds),Gh=Ge({},Ds,{dataTransfer:0}),Kh=Ft(Gh),jh=Ge({},Wn,{relatedTarget:0}),Bi=Ft(jh),Xh=Ge({},No,{animationName:0,elapsedTime:0,pseudoElement:0}),Qh=Ft(Xh),Yh=Ge({},No,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zh=Ft(Yh),Jh=Ge({},No,{data:0}),Zf=Ft(Jh),ex={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tx={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"},ax={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ax[e])?!!t[e]:!1}function td(){return rx}var ox=Ge({},Wn,{key:function(e){if(e.key){var t=ex[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Jl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?tx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:td,charCode:function(e){return e.type==="keypress"?Jl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Jl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nx=Ft(ox),lx=Ge({},Ds,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jf=Ft(lx),sx=Ge({},Wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:td}),ix=Ft(sx),ux=Ge({},No,{propertyName:0,elapsedTime:0,pseudoElement:0}),dx=Ft(ux),fx=Ge({},Ds,{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}),cx=Ft(fx),px=[9,13,27,32],ad=Ma&&"CompositionEvent"in window,vn=null;Ma&&"documentMode"in document&&(vn=document.documentMode);var mx=Ma&&"TextEvent"in window&&!vn,Ip=Ma&&(!ad||vn&&8<vn&&11>=vn),ec=" ",tc=!1;function Cp(e,t){switch(e){case"keyup":return px.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var go=!1;function gx(e,t){switch(e){case"compositionend":return wp(t);case"keypress":return t.which!==32?null:(tc=!0,ec);case"textInput":return e=t.data,e===ec&&tc?null:e;default:return null}}function hx(e,t){if(go)return e==="compositionend"||!ad&&Cp(e,t)?(e=Sp(),Zl=Ju=Qa=null,go=!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 Ip&&t.locale!=="ko"?null:t.data;default:return null}}var xx={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 ac(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xx[e.type]:t==="textarea"}function kp(e,t,a,r){ap(r),t=ms(t,"onChange"),0<t.length&&(a=new ed("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var yn=null,An=null;function vx(e){Op(e,0)}function Es(e){var t=vo(e);if(Xc(t))return e}function yx(e,t){if(e==="change")return t}var bp=!1;Ma&&(Ma?(Hl="oninput"in document,Hl||(Oi=document.createElement("div"),Oi.setAttribute("oninput","return;"),Hl=typeof Oi.oninput=="function"),Ul=Hl):Ul=!1,bp=Ul&&(!document.documentMode||9<document.documentMode));var Ul,Hl,Oi;function rc(){yn&&(yn.detachEvent("onpropertychange",Tp),An=yn=null)}function Tp(e){if(e.propertyName==="value"&&Es(An)){var t=[];kp(t,An,e,ju(e)),lp(vx,t)}}function Lx(e,t,a){e==="focusin"?(rc(),yn=t,An=a,yn.attachEvent("onpropertychange",Tp)):e==="focusout"&&rc()}function Sx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Es(An)}function Ix(e,t){if(e==="click")return Es(t)}function Cx(e,t){if(e==="input"||e==="change")return Es(t)}function wx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ia=typeof Object.is=="function"?Object.is:wx;function Dn(e,t){if(ia(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!Qi.call(t,o)||!ia(e[o],t[o]))return!1}return!0}function oc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nc(e,t){var a=oc(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=oc(a)}}function Pp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rp(){for(var e=window,t=ss();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ss(e.document)}return t}function rd(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 kx(e){var t=Rp(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&Pp(a.ownerDocument.documentElement,a)){if(r!==null&&rd(a)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=a.textContent.length,n=Math.min(r.start,o);r=r.end===void 0?n:Math.min(r.end,o),!e.extend&&n>r&&(o=r,r=n,n=o),o=nc(a,n);var l=nc(a,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var bx=Ma&&"documentMode"in document&&11>=document.documentMode,ho=null,gu=null,Ln=null,hu=!1;function lc(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;hu||ho==null||ho!==ss(r)||(r=ho,"selectionStart"in r&&rd(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}),Ln&&Dn(Ln,r)||(Ln=r,r=ms(gu,"onSelect"),0<r.length&&(t=new ed("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=ho)))}function ql(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var xo={animationend:ql("Animation","AnimationEnd"),animationiteration:ql("Animation","AnimationIteration"),animationstart:ql("Animation","AnimationStart"),transitionend:ql("Transition","TransitionEnd")},zi={},Mp={};Ma&&(Mp=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function Fs(e){if(zi[e])return zi[e];if(!xo[e])return e;var t=xo[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Mp)return zi[e]=t[a];return e}var Ap=Fs("animationend"),Dp=Fs("animationiteration"),Ep=Fs("animationstart"),Fp=Fs("transitionend"),Bp=new Map,sc="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 ir(e,t){Bp.set(e,t),Hr(t,[e])}for(_l=0;_l<sc.length;_l++)Wl=sc[_l],ic=Wl.toLowerCase(),uc=Wl[0].toUpperCase()+Wl.slice(1),ir(ic,"on"+uc);var Wl,ic,uc,_l;ir(Ap,"onAnimationEnd");ir(Dp,"onAnimationIteration");ir(Ep,"onAnimationStart");ir("dblclick","onDoubleClick");ir("focusin","onFocus");ir("focusout","onBlur");ir(Fp,"onTransitionEnd");Ao("onMouseEnter",["mouseout","mouseover"]);Ao("onMouseLeave",["mouseout","mouseover"]);Ao("onPointerEnter",["pointerout","pointerover"]);Ao("onPointerLeave",["pointerout","pointerover"]);Hr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Hr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Hr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Hr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Hr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Hr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gn="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(" "),Tx=new Set("cancel close invalid load scroll toggle".split(" ").concat(gn));function dc(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,Th(r,t,void 0,e),e.currentTarget=null}function Op(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var l=r.length-1;0<=l;l--){var s=r[l],i=s.instance,d=s.currentTarget;if(s=s.listener,i!==n&&o.isPropagationStopped())break e;dc(o,s,d),n=i}else for(l=0;l<r.length;l++){if(s=r[l],i=s.instance,d=s.currentTarget,s=s.listener,i!==n&&o.isPropagationStopped())break e;dc(o,s,d),n=i}}}if(us)throw e=fu,us=!1,fu=null,e}function He(e,t){var a=t[Su];a===void 0&&(a=t[Su]=new Set);var r=e+"__bubble";a.has(r)||(zp(t,e,2,!1),a.add(r))}function Ni(e,t,a){var r=0;t&&(r|=4),zp(a,e,r,t)}var $l="_reactListening"+Math.random().toString(36).slice(2);function En(e){if(!e[$l]){e[$l]=!0,$c.forEach(function(a){a!=="selectionchange"&&(Tx.has(a)||Ni(a,!1,e),Ni(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$l]||(t[$l]=!0,Ni("selectionchange",!1,t))}}function zp(e,t,a,r){switch(Lp(t)){case 1:var o=Wh;break;case 4:o=$h;break;default:o=Zu}a=o.bind(null,t,a,e),o=void 0,!du||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function Ui(e,t,a,r,o){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===o||s.nodeType===8&&s.parentNode===o)break;if(l===4)for(l=r.return;l!==null;){var i=l.tag;if((i===3||i===4)&&(i=l.stateNode.containerInfo,i===o||i.nodeType===8&&i.parentNode===o))return;l=l.return}for(;s!==null;){if(l=Mr(s),l===null)return;if(i=l.tag,i===5||i===6){r=n=l;continue e}s=s.parentNode}}r=r.return}lp(function(){var d=n,f=ju(a),m=[];e:{var g=Bp.get(e);if(g!==void 0){var L=ed,x=e;switch(e){case"keypress":if(Jl(a)===0)break e;case"keydown":case"keyup":L=nx;break;case"focusin":x="focus",L=Bi;break;case"focusout":x="blur",L=Bi;break;case"beforeblur":case"afterblur":L=Bi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=Yf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=Kh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=ix;break;case Ap:case Dp:case Ep:L=Qh;break;case Fp:L=dx;break;case"scroll":L=Vh;break;case"wheel":L=cx;break;case"copy":case"cut":case"paste":L=Zh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Jf}var I=(t&4)!==0,H=!I&&e==="scroll",p=I?g!==null?g+"Capture":null:g;I=[];for(var u=d,c;u!==null;){c=u;var v=c.stateNode;if(c.tag===5&&v!==null&&(c=v,p!==null&&(v=Tn(u,p),v!=null&&I.push(Fn(u,v,c)))),H)break;u=u.return}0<I.length&&(g=new L(g,x,null,a,f),m.push({event:g,listeners:I}))}}if((t&7)===0){e:{if(g=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",g&&a!==iu&&(x=a.relatedTarget||a.fromElement)&&(Mr(x)||x[Aa]))break e;if((L||g)&&(g=f.window===f?f:(g=f.ownerDocument)?g.defaultView||g.parentWindow:window,L?(x=a.relatedTarget||a.toElement,L=d,x=x?Mr(x):null,x!==null&&(H=qr(x),x!==H||x.tag!==5&&x.tag!==6)&&(x=null)):(L=null,x=d),L!==x)){if(I=Yf,v="onMouseLeave",p="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(I=Jf,v="onPointerLeave",p="onPointerEnter",u="pointer"),H=L==null?g:vo(L),c=x==null?g:vo(x),g=new I(v,u+"leave",L,a,f),g.target=H,g.relatedTarget=c,v=null,Mr(f)===d&&(I=new I(p,u+"enter",x,a,f),I.target=c,I.relatedTarget=H,v=I),H=v,L&&x)t:{for(I=L,p=x,u=0,c=I;c;c=co(c))u++;for(c=0,v=p;v;v=co(v))c++;for(;0<u-c;)I=co(I),u--;for(;0<c-u;)p=co(p),c--;for(;u--;){if(I===p||p!==null&&I===p.alternate)break t;I=co(I),p=co(p)}I=null}else I=null;L!==null&&fc(m,g,L,I,!1),x!==null&&H!==null&&fc(m,H,x,I,!0)}}e:{if(g=d?vo(d):window,L=g.nodeName&&g.nodeName.toLowerCase(),L==="select"||L==="input"&&g.type==="file")var w=yx;else if(ac(g))if(bp)w=Cx;else{w=Sx;var C=Lx}else(L=g.nodeName)&&L.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(w=Ix);if(w&&(w=w(e,d))){kp(m,w,a,f);break e}C&&C(e,g,d),e==="focusout"&&(C=g._wrapperState)&&C.controlled&&g.type==="number"&&ru(g,"number",g.value)}switch(C=d?vo(d):window,e){case"focusin":(ac(C)||C.contentEditable==="true")&&(ho=C,gu=d,Ln=null);break;case"focusout":Ln=gu=ho=null;break;case"mousedown":hu=!0;break;case"contextmenu":case"mouseup":case"dragend":hu=!1,lc(m,a,f);break;case"selectionchange":if(bx)break;case"keydown":case"keyup":lc(m,a,f)}var y;if(ad)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else go?Cp(e,a)&&(k="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(k="onCompositionStart");k&&(Ip&&a.locale!=="ko"&&(go||k!=="onCompositionStart"?k==="onCompositionEnd"&&go&&(y=Sp()):(Qa=f,Ju="value"in Qa?Qa.value:Qa.textContent,go=!0)),C=ms(d,k),0<C.length&&(k=new Zf(k,e,null,a,f),m.push({event:k,listeners:C}),y?k.data=y:(y=wp(a),y!==null&&(k.data=y)))),(y=mx?gx(e,a):hx(e,a))&&(d=ms(d,"onBeforeInput"),0<d.length&&(f=new Zf("onBeforeInput","beforeinput",null,a,f),m.push({event:f,listeners:d}),f.data=y))}Op(m,t)})}function Fn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ms(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=Tn(e,a),n!=null&&r.unshift(Fn(e,n,o)),n=Tn(e,t),n!=null&&r.push(Fn(e,n,o))),e=e.return}return r}function co(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fc(e,t,a,r,o){for(var n=t._reactName,l=[];a!==null&&a!==r;){var s=a,i=s.alternate,d=s.stateNode;if(i!==null&&i===r)break;s.tag===5&&d!==null&&(s=d,o?(i=Tn(a,n),i!=null&&l.unshift(Fn(a,i,s))):o||(i=Tn(a,n),i!=null&&l.push(Fn(a,i,s)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var Px=/\\r\\n?/g,Rx=/\\u0000|\\uFFFD/g;function cc(e){return(typeof e=="string"?e:""+e).replace(Px,`\n`).replace(Rx,"")}function Vl(e,t,a){if(t=cc(t),cc(e)!==t&&a)throw Error(M(425))}function gs(){}var xu=null,vu=null;function yu(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 Lu=typeof setTimeout=="function"?setTimeout:void 0,Mx=typeof clearTimeout=="function"?clearTimeout:void 0,pc=typeof Promise=="function"?Promise:void 0,Ax=typeof queueMicrotask=="function"?queueMicrotask:typeof pc<"u"?function(e){return pc.resolve(null).then(e).catch(Dx)}:Lu;function Dx(e){setTimeout(function(){throw e})}function Hi(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),Mn(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);Mn(t)}function tr(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 mc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var Uo=Math.random().toString(36).slice(2),ha="__reactFiber$"+Uo,Bn="__reactProps$"+Uo,Aa="__reactContainer$"+Uo,Su="__reactEvents$"+Uo,Ex="__reactListeners$"+Uo,Fx="__reactHandles$"+Uo;function Mr(e){var t=e[ha];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Aa]||a[ha]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=mc(e);e!==null;){if(a=e[ha])return a;e=mc(e)}return t}e=a,a=e.parentNode}return null}function $n(e){return e=e[ha]||e[Aa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function vo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function Bs(e){return e[Bn]||null}var Iu=[],yo=-1;function ur(e){return{current:e}}function qe(e){0>yo||(e.current=Iu[yo],Iu[yo]=null,yo--)}function Ne(e,t){yo++,Iu[yo]=e.current,e.current=t}var sr={},mt=ur(sr),wt=ur(!1),Br=sr;function Do(e,t){var a=e.type.contextTypes;if(!a)return sr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function kt(e){return e=e.childContextTypes,e!=null}function hs(){qe(wt),qe(mt)}function gc(e,t,a){if(mt.current!==sr)throw Error(M(168));Ne(mt,t),Ne(wt,a)}function Np(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(M(108,Lh(e)||"Unknown",o));return Ge({},a,r)}function xs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sr,Br=mt.current,Ne(mt,e),Ne(wt,wt.current),!0}function hc(e,t,a){var r=e.stateNode;if(!r)throw Error(M(169));a?(e=Np(e,t,Br),r.__reactInternalMemoizedMergedChildContext=e,qe(wt),qe(mt),Ne(mt,e)):qe(wt),Ne(wt,a)}var ba=null,Os=!1,qi=!1;function Up(e){ba===null?ba=[e]:ba.push(e)}function Bx(e){Os=!0,Up(e)}function dr(){if(!qi&&ba!==null){qi=!0;var e=0,t=Re;try{var a=ba;for(Re=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}ba=null,Os=!1}catch(o){throw ba!==null&&(ba=ba.slice(e+1)),dp(Xu,dr),o}finally{Re=t,qi=!1}}return null}var Lo=[],So=0,vs=null,ys=0,Ht=[],qt=0,Or=null,Ta=1,Pa="";function Pr(e,t){Lo[So++]=ys,Lo[So++]=vs,vs=e,ys=t}function Hp(e,t,a){Ht[qt++]=Ta,Ht[qt++]=Pa,Ht[qt++]=Or,Or=e;var r=Ta;e=Pa;var o=32-la(r)-1;r&=~(1<<o),a+=1;var n=32-la(t)+o;if(30<n){var l=o-o%5;n=(r&(1<<l)-1).toString(32),r>>=l,o-=l,Ta=1<<32-la(t)+o|a<<o|r,Pa=n+e}else Ta=1<<n|a<<o|r,Pa=e}function od(e){e.return!==null&&(Pr(e,1),Hp(e,1,0))}function nd(e){for(;e===vs;)vs=Lo[--So],Lo[So]=null,ys=Lo[--So],Lo[So]=null;for(;e===Or;)Or=Ht[--qt],Ht[qt]=null,Pa=Ht[--qt],Ht[qt]=null,Ta=Ht[--qt],Ht[qt]=null}var Dt=null,At=null,_e=!1,na=null;function qp(e,t){var a=_t(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function xc(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Dt=e,At=tr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Dt=e,At=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Or!==null?{id:Ta,overflow:Pa}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=_t(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Dt=e,At=null,!0):!1;default:return!1}}function Cu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function wu(e){if(_e){var t=At;if(t){var a=t;if(!xc(e,t)){if(Cu(e))throw Error(M(418));t=tr(a.nextSibling);var r=Dt;t&&xc(e,t)?qp(r,a):(e.flags=e.flags&-4097|2,_e=!1,Dt=e)}}else{if(Cu(e))throw Error(M(418));e.flags=e.flags&-4097|2,_e=!1,Dt=e}}}function vc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Dt=e}function Gl(e){if(e!==Dt)return!1;if(!_e)return vc(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!yu(e.type,e.memoizedProps)),t&&(t=At)){if(Cu(e))throw _p(),Error(M(418));for(;t;)qp(e,t),t=tr(t.nextSibling)}if(vc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){At=tr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}At=null}}else At=Dt?tr(e.stateNode.nextSibling):null;return!0}function _p(){for(var e=At;e;)e=tr(e.nextSibling)}function Eo(){At=Dt=null,_e=!1}function ld(e){na===null?na=[e]:na.push(e)}var Ox=Fa.ReactCurrentBatchConfig;function sn(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(M(309));var r=a.stateNode}if(!r)throw Error(M(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(l){var s=o.refs;l===null?delete s[n]:s[n]=l},t._stringRef=n,t)}if(typeof e!="string")throw Error(M(284));if(!a._owner)throw Error(M(290,e))}return e}function Kl(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yc(e){var t=e._init;return t(e._payload)}function Wp(e){function t(p,u){if(e){var c=p.deletions;c===null?(p.deletions=[u],p.flags|=16):c.push(u)}}function a(p,u){if(!e)return null;for(;u!==null;)t(p,u),u=u.sibling;return null}function r(p,u){for(p=new Map;u!==null;)u.key!==null?p.set(u.key,u):p.set(u.index,u),u=u.sibling;return p}function o(p,u){return p=nr(p,u),p.index=0,p.sibling=null,p}function n(p,u,c){return p.index=c,e?(c=p.alternate,c!==null?(c=c.index,c<u?(p.flags|=2,u):c):(p.flags|=2,u)):(p.flags|=1048576,u)}function l(p){return e&&p.alternate===null&&(p.flags|=2),p}function s(p,u,c,v){return u===null||u.tag!==6?(u=ji(c,p.mode,v),u.return=p,u):(u=o(u,c),u.return=p,u)}function i(p,u,c,v){var w=c.type;return w===mo?f(p,u,c.props.children,v,c.key):u!==null&&(u.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ga&&yc(w)===u.type)?(v=o(u,c.props),v.ref=sn(p,u,c),v.return=p,v):(v=ls(c.type,c.key,c.props,null,p.mode,v),v.ref=sn(p,u,c),v.return=p,v)}function d(p,u,c,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==c.containerInfo||u.stateNode.implementation!==c.implementation?(u=Xi(c,p.mode,v),u.return=p,u):(u=o(u,c.children||[]),u.return=p,u)}function f(p,u,c,v,w){return u===null||u.tag!==7?(u=Fr(c,p.mode,v,w),u.return=p,u):(u=o(u,c),u.return=p,u)}function m(p,u,c){if(typeof u=="string"&&u!==""||typeof u=="number")return u=ji(""+u,p.mode,c),u.return=p,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Dl:return c=ls(u.type,u.key,u.props,null,p.mode,c),c.ref=sn(p,null,u),c.return=p,c;case po:return u=Xi(u,p.mode,c),u.return=p,u;case Ga:var v=u._init;return m(p,v(u._payload),c)}if(pn(u)||rn(u))return u=Fr(u,p.mode,c,null),u.return=p,u;Kl(p,u)}return null}function g(p,u,c,v){var w=u!==null?u.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return w!==null?null:s(p,u,""+c,v);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case Dl:return c.key===w?i(p,u,c,v):null;case po:return c.key===w?d(p,u,c,v):null;case Ga:return w=c._init,g(p,u,w(c._payload),v)}if(pn(c)||rn(c))return w!==null?null:f(p,u,c,v,null);Kl(p,c)}return null}function L(p,u,c,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return p=p.get(c)||null,s(u,p,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Dl:return p=p.get(v.key===null?c:v.key)||null,i(u,p,v,w);case po:return p=p.get(v.key===null?c:v.key)||null,d(u,p,v,w);case Ga:var C=v._init;return L(p,u,c,C(v._payload),w)}if(pn(v)||rn(v))return p=p.get(c)||null,f(u,p,v,w,null);Kl(u,v)}return null}function x(p,u,c,v){for(var w=null,C=null,y=u,k=u=0,z=null;y!==null&&k<c.length;k++){y.index>k?(z=y,y=null):z=y.sibling;var N=g(p,y,c[k],v);if(N===null){y===null&&(y=z);break}e&&y&&N.alternate===null&&t(p,y),u=n(N,u,k),C===null?w=N:C.sibling=N,C=N,y=z}if(k===c.length)return a(p,y),_e&&Pr(p,k),w;if(y===null){for(;k<c.length;k++)y=m(p,c[k],v),y!==null&&(u=n(y,u,k),C===null?w=y:C.sibling=y,C=y);return _e&&Pr(p,k),w}for(y=r(p,y);k<c.length;k++)z=L(y,p,k,c[k],v),z!==null&&(e&&z.alternate!==null&&y.delete(z.key===null?k:z.key),u=n(z,u,k),C===null?w=z:C.sibling=z,C=z);return e&&y.forEach(function(U){return t(p,U)}),_e&&Pr(p,k),w}function I(p,u,c,v){var w=rn(c);if(typeof w!="function")throw Error(M(150));if(c=w.call(c),c==null)throw Error(M(151));for(var C=w=null,y=u,k=u=0,z=null,N=c.next();y!==null&&!N.done;k++,N=c.next()){y.index>k?(z=y,y=null):z=y.sibling;var U=g(p,y,N.value,v);if(U===null){y===null&&(y=z);break}e&&y&&U.alternate===null&&t(p,y),u=n(U,u,k),C===null?w=U:C.sibling=U,C=U,y=z}if(N.done)return a(p,y),_e&&Pr(p,k),w;if(y===null){for(;!N.done;k++,N=c.next())N=m(p,N.value,v),N!==null&&(u=n(N,u,k),C===null?w=N:C.sibling=N,C=N);return _e&&Pr(p,k),w}for(y=r(p,y);!N.done;k++,N=c.next())N=L(y,p,k,N.value,v),N!==null&&(e&&N.alternate!==null&&y.delete(N.key===null?k:N.key),u=n(N,u,k),C===null?w=N:C.sibling=N,C=N);return e&&y.forEach(function(_){return t(p,_)}),_e&&Pr(p,k),w}function H(p,u,c,v){if(typeof c=="object"&&c!==null&&c.type===mo&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case Dl:e:{for(var w=c.key,C=u;C!==null;){if(C.key===w){if(w=c.type,w===mo){if(C.tag===7){a(p,C.sibling),u=o(C,c.props.children),u.return=p,p=u;break e}}else if(C.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ga&&yc(w)===C.type){a(p,C.sibling),u=o(C,c.props),u.ref=sn(p,C,c),u.return=p,p=u;break e}a(p,C);break}else t(p,C);C=C.sibling}c.type===mo?(u=Fr(c.props.children,p.mode,v,c.key),u.return=p,p=u):(v=ls(c.type,c.key,c.props,null,p.mode,v),v.ref=sn(p,u,c),v.return=p,p=v)}return l(p);case po:e:{for(C=c.key;u!==null;){if(u.key===C)if(u.tag===4&&u.stateNode.containerInfo===c.containerInfo&&u.stateNode.implementation===c.implementation){a(p,u.sibling),u=o(u,c.children||[]),u.return=p,p=u;break e}else{a(p,u);break}else t(p,u);u=u.sibling}u=Xi(c,p.mode,v),u.return=p,p=u}return l(p);case Ga:return C=c._init,H(p,u,C(c._payload),v)}if(pn(c))return x(p,u,c,v);if(rn(c))return I(p,u,c,v);Kl(p,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,u!==null&&u.tag===6?(a(p,u.sibling),u=o(u,c),u.return=p,p=u):(a(p,u),u=ji(c,p.mode,v),u.return=p,p=u),l(p)):a(p,u)}return H}var Fo=Wp(!0),$p=Wp(!1),Ls=ur(null),Ss=null,Io=null,sd=null;function id(){sd=Io=Ss=null}function ud(e){var t=Ls.current;qe(Ls),e._currentValue=t}function ku(e,t,a){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===a)break;e=e.return}}function Ro(e,t){Ss=e,sd=Io=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ct=!0),e.firstContext=null)}function $t(e){var t=e._currentValue;if(sd!==e)if(e={context:e,memoizedValue:t,next:null},Io===null){if(Ss===null)throw Error(M(308));Io=e,Ss.dependencies={lanes:0,firstContext:e}}else Io=Io.next=e;return t}var Ar=null;function dd(e){Ar===null?Ar=[e]:Ar.push(e)}function Vp(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,dd(t)):(a.next=o.next,o.next=a),t.interleaved=a,Da(e,r)}function Da(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var Ka=!1;function fd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gp(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 Ra(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ar(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Le&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Da(e,a)}return o=r.interleaved,o===null?(t.next=t,dd(r)):(t.next=o.next,o.next=t),r.interleaved=t,Da(e,a)}function es(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qu(e,a)}}function Lc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var l={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=l:n=n.next=l,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function Is(e,t,a,r){var o=e.updateQueue;Ka=!1;var n=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var i=s,d=i.next;i.next=null,l===null?n=d:l.next=d,l=i;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=d:s.next=d,f.lastBaseUpdate=i))}if(n!==null){var m=o.baseState;l=0,f=d=i=null,s=n;do{var g=s.lane,L=s.eventTime;if((r&g)===g){f!==null&&(f=f.next={eventTime:L,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,I=s;switch(g=t,L=a,I.tag){case 1:if(x=I.payload,typeof x=="function"){m=x.call(L,m,g);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=I.payload,g=typeof x=="function"?x.call(L,m,g):x,g==null)break e;m=Ge({},m,g);break e;case 2:Ka=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,g=o.effects,g===null?o.effects=[s]:g.push(s))}else L={eventTime:L,lane:g,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(d=f=L,i=m):f=f.next=L,l|=g;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;g=s,s=g.next,g.next=null,o.lastBaseUpdate=g,o.shared.pending=null}}while(!0);if(f===null&&(i=m),o.baseState=i,o.firstBaseUpdate=d,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);Nr|=l,e.lanes=l,e.memoizedState=m}}function Sc(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(M(191,o));o.call(r)}}}var Vn={},va=ur(Vn),On=ur(Vn),zn=ur(Vn);function Dr(e){if(e===Vn)throw Error(M(174));return e}function cd(e,t){switch(Ne(zn,t),Ne(On,e),Ne(va,Vn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:nu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=nu(t,e)}qe(va),Ne(va,t)}function Bo(){qe(va),qe(On),qe(zn)}function Kp(e){Dr(zn.current);var t=Dr(va.current),a=nu(t,e.type);t!==a&&(Ne(On,e),Ne(va,a))}function pd(e){On.current===e&&(qe(va),qe(On))}var $e=ur(0);function Cs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)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 _i=[];function md(){for(var e=0;e<_i.length;e++)_i[e]._workInProgressVersionPrimary=null;_i.length=0}var ts=Fa.ReactCurrentDispatcher,Wi=Fa.ReactCurrentBatchConfig,zr=0,Ve=null,et=null,rt=null,ws=!1,Sn=!1,Nn=0,zx=0;function ft(){throw Error(M(321))}function gd(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ia(e[a],t[a]))return!1;return!0}function hd(e,t,a,r,o,n){if(zr=n,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ts.current=e===null||e.memoizedState===null?qx:_x,e=a(r,o),Sn){n=0;do{if(Sn=!1,Nn=0,25<=n)throw Error(M(301));n+=1,rt=et=null,t.updateQueue=null,ts.current=Wx,e=a(r,o)}while(Sn)}if(ts.current=ks,t=et!==null&&et.next!==null,zr=0,rt=et=Ve=null,ws=!1,t)throw Error(M(300));return e}function xd(){var e=Nn!==0;return Nn=0,e}function ga(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Ve.memoizedState=rt=e:rt=rt.next=e,rt}function Vt(){if(et===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=rt===null?Ve.memoizedState:rt.next;if(t!==null)rt=t,et=e;else{if(e===null)throw Error(M(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},rt===null?Ve.memoizedState=rt=e:rt=rt.next=e}return rt}function Un(e,t){return typeof t=="function"?t(e):t}function $i(e){var t=Vt(),a=t.queue;if(a===null)throw Error(M(311));a.lastRenderedReducer=e;var r=et,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var l=o.next;o.next=n.next,n.next=l}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var s=l=null,i=null,d=n;do{var f=d.lane;if((zr&f)===f)i!==null&&(i=i.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var m={lane:f,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};i===null?(s=i=m,l=r):i=i.next=m,Ve.lanes|=f,Nr|=f}d=d.next}while(d!==null&&d!==n);i===null?l=r:i.next=s,ia(r,t.memoizedState)||(Ct=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=i,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,Ve.lanes|=n,Nr|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function Vi(e){var t=Vt(),a=t.queue;if(a===null)throw Error(M(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var l=o=o.next;do n=e(n,l.action),l=l.next;while(l!==o);ia(n,t.memoizedState)||(Ct=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function jp(){}function Xp(e,t){var a=Ve,r=Vt(),o=t(),n=!ia(r.memoizedState,o);if(n&&(r.memoizedState=o,Ct=!0),r=r.queue,vd(Zp.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||rt!==null&&rt.memoizedState.tag&1){if(a.flags|=2048,Hn(9,Yp.bind(null,a,r,o,t),void 0,null),ot===null)throw Error(M(349));(zr&30)!==0||Qp(a,t,o)}return o}function Qp(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Yp(e,t,a,r){t.value=a,t.getSnapshot=r,Jp(t)&&em(e)}function Zp(e,t,a){return a(function(){Jp(t)&&em(e)})}function Jp(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ia(e,a)}catch{return!0}}function em(e){var t=Da(e,1);t!==null&&sa(t,e,1,-1)}function Ic(e){var t=ga();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:e},t.queue=e,e=e.dispatch=Hx.bind(null,Ve,e),[t.memoizedState,e]}function Hn(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function tm(){return Vt().memoizedState}function as(e,t,a,r){var o=ga();Ve.flags|=e,o.memoizedState=Hn(1|t,a,void 0,r===void 0?null:r)}function zs(e,t,a,r){var o=Vt();r=r===void 0?null:r;var n=void 0;if(et!==null){var l=et.memoizedState;if(n=l.destroy,r!==null&&gd(r,l.deps)){o.memoizedState=Hn(t,a,n,r);return}}Ve.flags|=e,o.memoizedState=Hn(1|t,a,n,r)}function Cc(e,t){return as(8390656,8,e,t)}function vd(e,t){return zs(2048,8,e,t)}function am(e,t){return zs(4,2,e,t)}function rm(e,t){return zs(4,4,e,t)}function om(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 nm(e,t,a){return a=a!=null?a.concat([e]):null,zs(4,4,om.bind(null,t,e),a)}function yd(){}function lm(e,t){var a=Vt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&gd(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function sm(e,t){var a=Vt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&gd(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function im(e,t,a){return(zr&21)===0?(e.baseState&&(e.baseState=!1,Ct=!0),e.memoizedState=a):(ia(a,t)||(a=pp(),Ve.lanes|=a,Nr|=a,e.baseState=!0),t)}function Nx(e,t){var a=Re;Re=a!==0&&4>a?a:4,e(!0);var r=Wi.transition;Wi.transition={};try{e(!1),t()}finally{Re=a,Wi.transition=r}}function um(){return Vt().memoizedState}function Ux(e,t,a){var r=or(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},dm(e))fm(t,a);else if(a=Vp(e,t,a,r),a!==null){var o=xt();sa(a,e,r,o),cm(a,t,r)}}function Hx(e,t,a){var r=or(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(dm(e))fm(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var l=t.lastRenderedState,s=n(l,a);if(o.hasEagerState=!0,o.eagerState=s,ia(s,l)){var i=t.interleaved;i===null?(o.next=o,dd(t)):(o.next=i.next,i.next=o),t.interleaved=o;return}}catch{}finally{}a=Vp(e,t,o,r),a!==null&&(o=xt(),sa(a,e,r,o),cm(a,t,r))}}function dm(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function fm(e,t){Sn=ws=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function cm(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qu(e,a)}}var ks={readContext:$t,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useInsertionEffect:ft,useLayoutEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useMutableSource:ft,useSyncExternalStore:ft,useId:ft,unstable_isNewReconciler:!1},qx={readContext:$t,useCallback:function(e,t){return ga().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:Cc,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,as(4194308,4,om.bind(null,t,e),a)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){return as(4,2,e,t)},useMemo:function(e,t){var a=ga();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=ga();return t=a!==void 0?a(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=Ux.bind(null,Ve,e),[r.memoizedState,e]},useRef:function(e){var t=ga();return e={current:e},t.memoizedState=e},useState:Ic,useDebugValue:yd,useDeferredValue:function(e){return ga().memoizedState=e},useTransition:function(){var e=Ic(!1),t=e[0];return e=Nx.bind(null,e[1]),ga().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=Ve,o=ga();if(_e){if(a===void 0)throw Error(M(407));a=a()}else{if(a=t(),ot===null)throw Error(M(349));(zr&30)!==0||Qp(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,Cc(Zp.bind(null,r,n,e),[e]),r.flags|=2048,Hn(9,Yp.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=ga(),t=ot.identifierPrefix;if(_e){var a=Pa,r=Ta;a=(r&~(1<<32-la(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=Nn++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=zx++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_x={readContext:$t,useCallback:lm,useContext:$t,useEffect:vd,useImperativeHandle:nm,useInsertionEffect:am,useLayoutEffect:rm,useMemo:sm,useReducer:$i,useRef:tm,useState:function(){return $i(Un)},useDebugValue:yd,useDeferredValue:function(e){var t=Vt();return im(t,et.memoizedState,e)},useTransition:function(){var e=$i(Un)[0],t=Vt().memoizedState;return[e,t]},useMutableSource:jp,useSyncExternalStore:Xp,useId:um,unstable_isNewReconciler:!1},Wx={readContext:$t,useCallback:lm,useContext:$t,useEffect:vd,useImperativeHandle:nm,useInsertionEffect:am,useLayoutEffect:rm,useMemo:sm,useReducer:Vi,useRef:tm,useState:function(){return Vi(Un)},useDebugValue:yd,useDeferredValue:function(e){var t=Vt();return et===null?t.memoizedState=e:im(t,et.memoizedState,e)},useTransition:function(){var e=Vi(Un)[0],t=Vt().memoizedState;return[e,t]},useMutableSource:jp,useSyncExternalStore:Xp,useId:um,unstable_isNewReconciler:!1};function ra(e,t){if(e&&e.defaultProps){t=Ge({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function bu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ge({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ns={isMounted:function(e){return(e=e._reactInternals)?qr(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=xt(),o=or(e),n=Ra(r,o);n.payload=t,a!=null&&(n.callback=a),t=ar(e,n,o),t!==null&&(sa(t,e,o,r),es(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=xt(),o=or(e),n=Ra(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=ar(e,n,o),t!==null&&(sa(t,e,o,r),es(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=xt(),r=or(e),o=Ra(a,r);o.tag=2,t!=null&&(o.callback=t),t=ar(e,o,r),t!==null&&(sa(t,e,r,a),es(t,e,r))}};function wc(e,t,a,r,o,n,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,l):t.prototype&&t.prototype.isPureReactComponent?!Dn(a,r)||!Dn(o,n):!0}function pm(e,t,a){var r=!1,o=sr,n=t.contextType;return typeof n=="object"&&n!==null?n=$t(n):(o=kt(t)?Br:mt.current,r=t.contextTypes,n=(r=r!=null)?Do(e,o):sr),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ns,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function kc(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Ns.enqueueReplaceState(t,t.state,null)}function Tu(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},fd(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=$t(n):(n=kt(t)?Br:mt.current,o.context=Do(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(bu(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Ns.enqueueReplaceState(o,o.state,null),Is(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Oo(e,t){try{var a="",r=t;do a+=yh(r),r=r.return;while(r);var o=a}catch(n){o=`\nError generating stack: `+n.message+`\n`+n.stack}return{value:e,source:t,stack:o,digest:null}}function Gi(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Pu(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var $x=typeof WeakMap=="function"?WeakMap:Map;function mm(e,t,a){a=Ra(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Ts||(Ts=!0,Nu=r),Pu(e,t)},a}function gm(e,t,a){a=Ra(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){Pu(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Pu(e,t),typeof r!="function"&&(rr===null?rr=new Set([this]):rr.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),a}function bc(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new $x;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=ov.bind(null,e,t,a),t.then(e,e))}function Tc(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 Pc(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=Ra(-1,1),t.tag=2,ar(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Vx=Fa.ReactCurrentOwner,Ct=!1;function ht(e,t,a,r){t.child=e===null?$p(t,null,a,r):Fo(t,e.child,a,r)}function Rc(e,t,a,r,o){a=a.render;var n=t.ref;return Ro(t,o),r=hd(e,t,a,r,n,o),a=xd(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ea(e,t,o)):(_e&&a&&od(t),t.flags|=1,ht(e,t,r,o),t.child)}function Mc(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Td(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,hm(e,t,n,r,o)):(e=ls(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var l=n.memoizedProps;if(a=a.compare,a=a!==null?a:Dn,a(l,r)&&e.ref===t.ref)return Ea(e,t,o)}return t.flags|=1,e=nr(n,r),e.ref=t.ref,e.return=t,t.child=e}function hm(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(Dn(n,r)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,Ea(e,t,o)}return Ru(e,t,a,r,o)}function xm(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(wo,Mt),Mt|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ne(wo,Mt),Mt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,Ne(wo,Mt),Mt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,Ne(wo,Mt),Mt|=r;return ht(e,t,o,a),t.child}function vm(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Ru(e,t,a,r,o){var n=kt(a)?Br:mt.current;return n=Do(t,n),Ro(t,o),a=hd(e,t,a,r,n,o),r=xd(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ea(e,t,o)):(_e&&r&&od(t),t.flags|=1,ht(e,t,a,o),t.child)}function Ac(e,t,a,r,o){if(kt(a)){var n=!0;xs(t)}else n=!1;if(Ro(t,o),t.stateNode===null)rs(e,t),pm(t,a,r),Tu(t,a,r,o),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var i=l.context,d=a.contextType;typeof d=="object"&&d!==null?d=$t(d):(d=kt(a)?Br:mt.current,d=Do(t,d));var f=a.getDerivedStateFromProps,m=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function";m||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||i!==d)&&kc(t,l,r,d),Ka=!1;var g=t.memoizedState;l.state=g,Is(t,r,l,o),i=t.memoizedState,s!==r||g!==i||wt.current||Ka?(typeof f=="function"&&(bu(t,a,f,r),i=t.memoizedState),(s=Ka||wc(t,a,s,r,g,i,d))?(m||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=i),l.props=r,l.state=i,l.context=d,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,Gp(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:ra(t.type,s),l.props=d,m=t.pendingProps,g=l.context,i=a.contextType,typeof i=="object"&&i!==null?i=$t(i):(i=kt(a)?Br:mt.current,i=Do(t,i));var L=a.getDerivedStateFromProps;(f=typeof L=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==m||g!==i)&&kc(t,l,r,i),Ka=!1,g=t.memoizedState,l.state=g,Is(t,r,l,o);var x=t.memoizedState;s!==m||g!==x||wt.current||Ka?(typeof L=="function"&&(bu(t,a,L,r),x=t.memoizedState),(d=Ka||wc(t,a,d,r,g,x,i)||!1)?(f||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,x,i),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,x,i)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),l.props=r,l.state=x,l.context=i,r=d):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return Mu(e,t,a,r,n,o)}function Mu(e,t,a,r,o,n){vm(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&hc(t,a,!1),Ea(e,t,n);r=t.stateNode,Vx.current=t;var s=l&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Fo(t,e.child,null,n),t.child=Fo(t,null,s,n)):ht(e,t,s,n),t.memoizedState=r.state,o&&hc(t,a,!0),t.child}function ym(e){var t=e.stateNode;t.pendingContext?gc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gc(e,t.context,!1),cd(e,t.containerInfo)}function Dc(e,t,a,r,o){return Eo(),ld(o),t.flags|=256,ht(e,t,a,r),t.child}var Au={dehydrated:null,treeContext:null,retryLane:0};function Du(e){return{baseLanes:e,cachePool:null,transitions:null}}function Lm(e,t,a){var r=t.pendingProps,o=$e.current,n=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(o&2)!==0),s?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ne($e,o&1),e===null)return wu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(l=r.children,e=r.fallback,n?(r=t.mode,n=t.child,l={mode:"hidden",children:l},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=l):n=qs(l,r,0,null),e=Fr(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Du(a),t.memoizedState=Au,e):Ld(t,l));if(o=e.memoizedState,o!==null&&(s=o.dehydrated,s!==null))return Gx(e,t,l,r,s,o,a);if(n){n=r.fallback,l=t.mode,o=e.child,s=o.sibling;var i={mode:"hidden",children:r.children};return(l&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=i,t.deletions=null):(r=nr(o,i),r.subtreeFlags=o.subtreeFlags&14680064),s!==null?n=nr(s,n):(n=Fr(n,l,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,l=e.child.memoizedState,l=l===null?Du(a):{baseLanes:l.baseLanes|a,cachePool:null,transitions:l.transitions},n.memoizedState=l,n.childLanes=e.childLanes&~a,t.memoizedState=Au,r}return n=e.child,e=n.sibling,r=nr(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function Ld(e,t){return t=qs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function jl(e,t,a,r){return r!==null&&ld(r),Fo(t,e.child,null,a),e=Ld(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gx(e,t,a,r,o,n,l){if(a)return t.flags&256?(t.flags&=-257,r=Gi(Error(M(422))),jl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=qs({mode:"visible",children:r.children},o,0,null),n=Fr(n,o,l,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&Fo(t,e.child,null,l),t.child.memoizedState=Du(l),t.memoizedState=Au,n);if((t.mode&1)===0)return jl(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var s=r.dgst;return r=s,n=Error(M(419)),r=Gi(n,r,void 0),jl(e,t,l,r)}if(s=(l&e.childLanes)!==0,Ct||s){if(r=ot,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|l))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,Da(e,o),sa(r,e,o,-1))}return bd(),r=Gi(Error(M(421))),jl(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=nv.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,At=tr(o.nextSibling),Dt=t,_e=!0,na=null,e!==null&&(Ht[qt++]=Ta,Ht[qt++]=Pa,Ht[qt++]=Or,Ta=e.id,Pa=e.overflow,Or=t),t=Ld(t,r.children),t.flags|=4096,t)}function Ec(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ku(e.return,t,a)}function Ki(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function Sm(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(ht(e,t,r.children,a),r=$e.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,a,t);else if(e.tag===19)Ec(e,a,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(Ne($e,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Cs(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),Ki(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Cs(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}Ki(t,!0,a,null,n);break;case"together":Ki(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rs(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ea(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Nr|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,a=nr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=nr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Kx(e,t,a){switch(t.tag){case 3:ym(t),Eo();break;case 5:Kp(t);break;case 1:kt(t.type)&&xs(t);break;case 4:cd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ne(Ls,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ne($e,$e.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?Lm(e,t,a):(Ne($e,$e.current&1),e=Ea(e,t,a),e!==null?e.sibling:null);Ne($e,$e.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Sm(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ne($e,$e.current),r)break;return null;case 22:case 23:return t.lanes=0,xm(e,t,a)}return Ea(e,t,a)}var Im,Eu,Cm,wm;Im=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};Eu=function(){};Cm=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Dr(va.current);var n=null;switch(a){case"input":o=tu(e,o),r=tu(e,r),n=[];break;case"select":o=Ge({},o,{value:void 0}),r=Ge({},r,{value:void 0}),n=[];break;case"textarea":o=ou(e,o),r=ou(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=gs)}lu(a,r);var l;a=null;for(d in o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var s=o[d];for(l in s)s.hasOwnProperty(l)&&(a||(a={}),a[l]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(kn.hasOwnProperty(d)?n||(n=[]):(n=n||[]).push(d,null));for(d in r){var i=r[d];if(s=o!=null?o[d]:void 0,r.hasOwnProperty(d)&&i!==s&&(i!=null||s!=null))if(d==="style")if(s){for(l in s)!s.hasOwnProperty(l)||i&&i.hasOwnProperty(l)||(a||(a={}),a[l]="");for(l in i)i.hasOwnProperty(l)&&s[l]!==i[l]&&(a||(a={}),a[l]=i[l])}else a||(n||(n=[]),n.push(d,a)),a=i;else d==="dangerouslySetInnerHTML"?(i=i?i.__html:void 0,s=s?s.__html:void 0,i!=null&&s!==i&&(n=n||[]).push(d,i)):d==="children"?typeof i!="string"&&typeof i!="number"||(n=n||[]).push(d,""+i):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(kn.hasOwnProperty(d)?(i!=null&&d==="onScroll"&&He("scroll",e),n||s===i||(n=[])):(n=n||[]).push(d,i))}a&&(n=n||[]).push("style",a);var d=n;(t.updateQueue=d)&&(t.flags|=4)}};wm=function(e,t,a,r){a!==r&&(t.flags|=4)};function un(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function jx(e,t,a){var r=t.pendingProps;switch(nd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(t),null;case 1:return kt(t.type)&&hs(),ct(t),null;case 3:return r=t.stateNode,Bo(),qe(wt),qe(mt),md(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,na!==null&&(qu(na),na=null))),Eu(e,t),ct(t),null;case 5:pd(t);var o=Dr(zn.current);if(a=t.type,e!==null&&t.stateNode!=null)Cm(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return ct(t),null}if(e=Dr(va.current),Gl(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[ha]=t,r[Bn]=n,e=(t.mode&1)!==0,a){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(o=0;o<gn.length;o++)He(gn[o],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":qf(r,n),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},He("invalid",r);break;case"textarea":Wf(r,n),He("invalid",r)}lu(a,n),o=null;for(var l in n)if(n.hasOwnProperty(l)){var s=n[l];l==="children"?typeof s=="string"?r.textContent!==s&&(n.suppressHydrationWarning!==!0&&Vl(r.textContent,s,e),o=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(n.suppressHydrationWarning!==!0&&Vl(r.textContent,s,e),o=["children",""+s]):kn.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&He("scroll",r)}switch(a){case"input":El(r),_f(r,n,!0);break;case"textarea":El(r),$f(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=gs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Zc(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=l.createElement("div"),e.innerHTML="<script><\\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(a,{is:r.is}):(e=l.createElement(a),a==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,a),e[ha]=t,e[Bn]=r,Im(e,t,!1,!1),t.stateNode=e;e:{switch(l=su(a,r),a){case"dialog":He("cancel",e),He("close",e),o=r;break;case"iframe":case"object":case"embed":He("load",e),o=r;break;case"video":case"audio":for(o=0;o<gn.length;o++)He(gn[o],e);o=r;break;case"source":He("error",e),o=r;break;case"img":case"image":case"link":He("error",e),He("load",e),o=r;break;case"details":He("toggle",e),o=r;break;case"input":qf(e,r),o=tu(e,r),He("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ge({},r,{value:void 0}),He("invalid",e);break;case"textarea":Wf(e,r),o=ou(e,r),He("invalid",e);break;default:o=r}lu(a,o),s=o;for(n in s)if(s.hasOwnProperty(n)){var i=s[n];n==="style"?tp(e,i):n==="dangerouslySetInnerHTML"?(i=i?i.__html:void 0,i!=null&&Jc(e,i)):n==="children"?typeof i=="string"?(a!=="textarea"||i!=="")&&bn(e,i):typeof i=="number"&&bn(e,""+i):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(kn.hasOwnProperty(n)?i!=null&&n==="onScroll"&&He("scroll",e):i!=null&&$u(e,n,i,l))}switch(a){case"input":El(e),_f(e,r,!1);break;case"textarea":El(e),$f(e);break;case"option":r.value!=null&&e.setAttribute("value",""+lr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?ko(e,!!r.multiple,n,!1):r.defaultValue!=null&&ko(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=gs)}switch(a){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 ct(t),null;case 6:if(e&&t.stateNode!=null)wm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(a=Dr(zn.current),Dr(va.current),Gl(t)){if(r=t.stateNode,a=t.memoizedProps,r[ha]=t,(n=r.nodeValue!==a)&&(e=Dt,e!==null))switch(e.tag){case 3:Vl(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vl(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[ha]=t,t.stateNode=r}return ct(t),null;case 13:if(qe($e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&At!==null&&(t.mode&1)!==0&&(t.flags&128)===0)_p(),Eo(),t.flags|=98560,n=!1;else if(n=Gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(M(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(M(317));n[ha]=t}else Eo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),n=!1}else na!==null&&(qu(na),na=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||($e.current&1)!==0?tt===0&&(tt=3):bd())),t.updateQueue!==null&&(t.flags|=4),ct(t),null);case 4:return Bo(),Eu(e,t),e===null&&En(t.stateNode.containerInfo),ct(t),null;case 10:return ud(t.type._context),ct(t),null;case 17:return kt(t.type)&&hs(),ct(t),null;case 19:if(qe($e),n=t.memoizedState,n===null)return ct(t),null;if(r=(t.flags&128)!==0,l=n.rendering,l===null)if(r)un(n,!1);else{if(tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(l=Cs(e),l!==null){for(t.flags|=128,un(n,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,l=n.alternate,l===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,e=l.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return Ne($e,$e.current&1|2),t.child}e=e.sibling}n.tail!==null&&Qe()>zo&&(t.flags|=128,r=!0,un(n,!1),t.lanes=4194304)}else{if(!r)if(e=Cs(l),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),un(n,!0),n.tail===null&&n.tailMode==="hidden"&&!l.alternate&&!_e)return ct(t),null}else 2*Qe()-n.renderingStartTime>zo&&a!==1073741824&&(t.flags|=128,r=!0,un(n,!1),t.lanes=4194304);n.isBackwards?(l.sibling=t.child,t.child=l):(a=n.last,a!==null?a.sibling=l:t.child=l,n.last=l)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Qe(),t.sibling=null,a=$e.current,Ne($e,r?a&1|2:a&1),t):(ct(t),null);case 22:case 23:return kd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Mt&1073741824)!==0&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function Xx(e,t){switch(nd(t),t.tag){case 1:return kt(t.type)&&hs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bo(),qe(wt),qe(mt),md(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return pd(t),null;case 13:if(qe($e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Eo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe($e),null;case 4:return Bo(),null;case 10:return ud(t.type._context),null;case 22:case 23:return kd(),null;case 24:return null;default:return null}}var Xl=!1,pt=!1,Qx=typeof WeakSet=="function"?WeakSet:Set,G=null;function Co(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){je(e,t,r)}else a.current=null}function Fu(e,t,a){try{a()}catch(r){je(e,t,r)}}var Fc=!1;function Yx(e,t){if(xu=cs,e=Rp(),rd(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var l=0,s=-1,i=-1,d=0,f=0,m=e,g=null;t:for(;;){for(var L;m!==a||o!==0&&m.nodeType!==3||(s=l+o),m!==n||r!==0&&m.nodeType!==3||(i=l+r),m.nodeType===3&&(l+=m.nodeValue.length),(L=m.firstChild)!==null;)g=m,m=L;for(;;){if(m===e)break t;if(g===a&&++d===o&&(s=l),g===n&&++f===r&&(i=l),(L=m.nextSibling)!==null)break;m=g,g=m.parentNode}m=L}a=s===-1||i===-1?null:{start:s,end:i}}else a=null}a=a||{start:0,end:0}}else a=null;for(vu={focusedElem:e,selectionRange:a},cs=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var I=x.memoizedProps,H=x.memoizedState,p=t.stateNode,u=p.getSnapshotBeforeUpdate(t.elementType===t.type?I:ra(t.type,I),H);p.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(v){je(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return x=Fc,Fc=!1,x}function In(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&Fu(t,a,n)}o=o.next}while(o!==r)}}function Us(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function Bu(e){var t=e.ref;if(t!==null){var a=e.stateNode;switch(e.tag){case 5:e=a;break;default:e=a}typeof t=="function"?t(e):t.current=e}}function km(e){var t=e.alternate;t!==null&&(e.alternate=null,km(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ha],delete t[Bn],delete t[Su],delete t[Ex],delete t[Fx])),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 bm(e){return e.tag===5||e.tag===3||e.tag===4}function Bc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bm(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 Ou(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=gs));else if(r!==4&&(e=e.child,e!==null))for(Ou(e,t,a),e=e.sibling;e!==null;)Ou(e,t,a),e=e.sibling}function zu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(zu(e,t,a),e=e.sibling;e!==null;)zu(e,t,a),e=e.sibling}var lt=null,oa=!1;function Va(e,t,a){for(a=a.child;a!==null;)Tm(e,t,a),a=a.sibling}function Tm(e,t,a){if(xa&&typeof xa.onCommitFiberUnmount=="function")try{xa.onCommitFiberUnmount(As,a)}catch{}switch(a.tag){case 5:pt||Co(a,t);case 6:var r=lt,o=oa;lt=null,Va(e,t,a),lt=r,oa=o,lt!==null&&(oa?(e=lt,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):lt.removeChild(a.stateNode));break;case 18:lt!==null&&(oa?(e=lt,a=a.stateNode,e.nodeType===8?Hi(e.parentNode,a):e.nodeType===1&&Hi(e,a),Mn(e)):Hi(lt,a.stateNode));break;case 4:r=lt,o=oa,lt=a.stateNode.containerInfo,oa=!0,Va(e,t,a),lt=r,oa=o;break;case 0:case 11:case 14:case 15:if(!pt&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,l=n.destroy;n=n.tag,l!==void 0&&((n&2)!==0||(n&4)!==0)&&Fu(a,t,l),o=o.next}while(o!==r)}Va(e,t,a);break;case 1:if(!pt&&(Co(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(s){je(a,t,s)}Va(e,t,a);break;case 21:Va(e,t,a);break;case 22:a.mode&1?(pt=(r=pt)||a.memoizedState!==null,Va(e,t,a),pt=r):Va(e,t,a);break;default:Va(e,t,a)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new Qx),t.forEach(function(r){var o=lv.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function aa(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:lt=s.stateNode,oa=!1;break e;case 3:lt=s.stateNode.containerInfo,oa=!0;break e;case 4:lt=s.stateNode.containerInfo,oa=!0;break e}s=s.return}if(lt===null)throw Error(M(160));Tm(n,l,o),lt=null,oa=!1;var i=o.alternate;i!==null&&(i.return=null),o.return=null}catch(d){je(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Pm(t,e),t=t.sibling}function Pm(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(aa(t,e),ma(e),r&4){try{In(3,e,e.return),Us(3,e)}catch(I){je(e,e.return,I)}try{In(5,e,e.return)}catch(I){je(e,e.return,I)}}break;case 1:aa(t,e),ma(e),r&512&&a!==null&&Co(a,a.return);break;case 5:if(aa(t,e),ma(e),r&512&&a!==null&&Co(a,a.return),e.flags&32){var o=e.stateNode;try{bn(o,"")}catch(I){je(e,e.return,I)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,l=a!==null?a.memoizedProps:n,s=e.type,i=e.updateQueue;if(e.updateQueue=null,i!==null)try{s==="input"&&n.type==="radio"&&n.name!=null&&Qc(o,n),su(s,l);var d=su(s,n);for(l=0;l<i.length;l+=2){var f=i[l],m=i[l+1];f==="style"?tp(o,m):f==="dangerouslySetInnerHTML"?Jc(o,m):f==="children"?bn(o,m):$u(o,f,m,d)}switch(s){case"input":au(o,n);break;case"textarea":Yc(o,n);break;case"select":var g=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var L=n.value;L!=null?ko(o,!!n.multiple,L,!1):g!==!!n.multiple&&(n.defaultValue!=null?ko(o,!!n.multiple,n.defaultValue,!0):ko(o,!!n.multiple,n.multiple?[]:"",!1))}o[Bn]=n}catch(I){je(e,e.return,I)}}break;case 6:if(aa(t,e),ma(e),r&4){if(e.stateNode===null)throw Error(M(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(I){je(e,e.return,I)}}break;case 3:if(aa(t,e),ma(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Mn(t.containerInfo)}catch(I){je(e,e.return,I)}break;case 4:aa(t,e),ma(e);break;case 13:aa(t,e),ma(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(Cd=Qe())),r&4&&Oc(e);break;case 22:if(f=a!==null&&a.memoizedState!==null,e.mode&1?(pt=(d=pt)||f,aa(t,e),pt=d):aa(t,e),ma(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!f&&(e.mode&1)!==0)for(G=e,f=e.child;f!==null;){for(m=G=f;G!==null;){switch(g=G,L=g.child,g.tag){case 0:case 11:case 14:case 15:In(4,g,g.return);break;case 1:Co(g,g.return);var x=g.stateNode;if(typeof x.componentWillUnmount=="function"){r=g,a=g.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(I){je(r,a,I)}}break;case 5:Co(g,g.return);break;case 22:if(g.memoizedState!==null){Nc(m);continue}}L!==null?(L.return=g,G=L):Nc(m)}f=f.sibling}e:for(f=null,m=e;;){if(m.tag===5){if(f===null){f=m;try{o=m.stateNode,d?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(s=m.stateNode,i=m.memoizedProps.style,l=i!=null&&i.hasOwnProperty("display")?i.display:null,s.style.display=ep("display",l))}catch(I){je(e,e.return,I)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(I){je(e,e.return,I)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:aa(t,e),ma(e),r&4&&Oc(e);break;case 21:break;default:aa(t,e),ma(e)}}function ma(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(bm(a)){var r=a;break e}a=a.return}throw Error(M(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(bn(o,""),r.flags&=-33);var n=Bc(e);zu(e,n,o);break;case 3:case 4:var l=r.stateNode.containerInfo,s=Bc(e);Ou(e,s,l);break;default:throw Error(M(161))}}catch(i){je(e,e.return,i)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Zx(e,t,a){G=e,Rm(e,t,a)}function Rm(e,t,a){for(var r=(e.mode&1)!==0;G!==null;){var o=G,n=o.child;if(o.tag===22&&r){var l=o.memoizedState!==null||Xl;if(!l){var s=o.alternate,i=s!==null&&s.memoizedState!==null||pt;s=Xl;var d=pt;if(Xl=l,(pt=i)&&!d)for(G=o;G!==null;)l=G,i=l.child,l.tag===22&&l.memoizedState!==null?Uc(o):i!==null?(i.return=l,G=i):Uc(o);for(;n!==null;)G=n,Rm(n,t,a),n=n.sibling;G=o,Xl=s,pt=d}zc(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,G=n):zc(e,t,a)}}function zc(e){for(;G!==null;){var t=G;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:pt||Us(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!pt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:ra(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&Sc(t,n,r);break;case 3:var l=t.updateQueue;if(l!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}Sc(t,l,a)}break;case 5:var s=t.stateNode;if(a===null&&t.flags&4){a=s;var i=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break;case"img":i.src&&(a.src=i.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var f=d.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&Mn(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}pt||t.flags&512&&Bu(t)}catch(g){je(t,t.return,g)}}if(t===e){G=null;break}if(a=t.sibling,a!==null){a.return=t.return,G=a;break}G=t.return}}function Nc(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}function Uc(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{Us(4,t)}catch(i){je(t,a,i)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(i){je(t,o,i)}}var n=t.return;try{Bu(t)}catch(i){je(t,n,i)}break;case 5:var l=t.return;try{Bu(t)}catch(i){je(t,l,i)}}}catch(i){je(t,t.return,i)}if(t===e){G=null;break}var s=t.sibling;if(s!==null){s.return=t.return,G=s;break}G=t.return}}var Jx=Math.ceil,bs=Fa.ReactCurrentDispatcher,Sd=Fa.ReactCurrentOwner,Wt=Fa.ReactCurrentBatchConfig,Le=0,ot=null,Ye=null,st=0,Mt=0,wo=ur(0),tt=0,qn=null,Nr=0,Hs=0,Id=0,Cn=null,It=null,Cd=0,zo=1/0,ka=null,Ts=!1,Nu=null,rr=null,Ql=!1,Ya=null,Ps=0,wn=0,Uu=null,os=-1,ns=0;function xt(){return(Le&6)!==0?Qe():os!==-1?os:os=Qe()}function or(e){return(e.mode&1)===0?1:(Le&2)!==0&&st!==0?st&-st:Ox.transition!==null?(ns===0&&(ns=pp()),ns):(e=Re,e!==0||(e=window.event,e=e===void 0?16:Lp(e.type)),e)}function sa(e,t,a,r){if(50<wn)throw wn=0,Uu=null,Error(M(185));_n(e,a,r),((Le&2)===0||e!==ot)&&(e===ot&&((Le&2)===0&&(Hs|=a),tt===4&&Xa(e,st)),bt(e,r),a===1&&Le===0&&(t.mode&1)===0&&(zo=Qe()+500,Os&&dr()))}function bt(e,t){var a=e.callbackNode;Nh(e,t);var r=fs(e,e===ot?st:0);if(r===0)a!==null&&Kf(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&Kf(a),t===1)e.tag===0?Bx(Hc.bind(null,e)):Up(Hc.bind(null,e)),Ax(function(){(Le&6)===0&&dr()}),a=null;else{switch(mp(r)){case 1:a=Xu;break;case 4:a=fp;break;case 16:a=ds;break;case 536870912:a=cp;break;default:a=ds}a=zm(a,Mm.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function Mm(e,t){if(os=-1,ns=0,(Le&6)!==0)throw Error(M(327));var a=e.callbackNode;if(Mo()&&e.callbackNode!==a)return null;var r=fs(e,e===ot?st:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Rs(e,r);else{t=r;var o=Le;Le|=2;var n=Dm();(ot!==e||st!==t)&&(ka=null,zo=Qe()+500,Er(e,t));do try{av();break}catch(s){Am(e,s)}while(!0);id(),bs.current=n,Le=o,Ye!==null?t=0:(ot=null,st=0,t=tt)}if(t!==0){if(t===2&&(o=cu(e),o!==0&&(r=o,t=Hu(e,o))),t===1)throw a=qn,Er(e,0),Xa(e,r),bt(e,Qe()),a;if(t===6)Xa(e,r);else{if(o=e.current.alternate,(r&30)===0&&!ev(o)&&(t=Rs(e,r),t===2&&(n=cu(e),n!==0&&(r=n,t=Hu(e,n))),t===1))throw a=qn,Er(e,0),Xa(e,r),bt(e,Qe()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:Rr(e,It,ka);break;case 3:if(Xa(e,r),(r&130023424)===r&&(t=Cd+500-Qe(),10<t)){if(fs(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){xt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Lu(Rr.bind(null,e,It,ka),t);break}Rr(e,It,ka);break;case 4:if(Xa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-la(r);n=1<<l,l=t[l],l>o&&(o=l),r&=~n}if(r=o,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Jx(r/1960))-r,10<r){e.timeoutHandle=Lu(Rr.bind(null,e,It,ka),r);break}Rr(e,It,ka);break;case 5:Rr(e,It,ka);break;default:throw Error(M(329))}}}return bt(e,Qe()),e.callbackNode===a?Mm.bind(null,e):null}function Hu(e,t){var a=Cn;return e.current.memoizedState.isDehydrated&&(Er(e,t).flags|=256),e=Rs(e,t),e!==2&&(t=It,It=a,t!==null&&qu(t)),e}function qu(e){It===null?It=e:It.push.apply(It,e)}function ev(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!ia(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Xa(e,t){for(t&=~Id,t&=~Hs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-la(t),r=1<<a;e[a]=-1,t&=~r}}function Hc(e){if((Le&6)!==0)throw Error(M(327));Mo();var t=fs(e,0);if((t&1)===0)return bt(e,Qe()),null;var a=Rs(e,t);if(e.tag!==0&&a===2){var r=cu(e);r!==0&&(t=r,a=Hu(e,r))}if(a===1)throw a=qn,Er(e,0),Xa(e,t),bt(e,Qe()),a;if(a===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rr(e,It,ka),bt(e,Qe()),null}function wd(e,t){var a=Le;Le|=1;try{return e(t)}finally{Le=a,Le===0&&(zo=Qe()+500,Os&&dr())}}function Ur(e){Ya!==null&&Ya.tag===0&&(Le&6)===0&&Mo();var t=Le;Le|=1;var a=Wt.transition,r=Re;try{if(Wt.transition=null,Re=1,e)return e()}finally{Re=r,Wt.transition=a,Le=t,(Le&6)===0&&dr()}}function kd(){Mt=wo.current,qe(wo)}function Er(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,Mx(a)),Ye!==null)for(a=Ye.return;a!==null;){var r=a;switch(nd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&hs();break;case 3:Bo(),qe(wt),qe(mt),md();break;case 5:pd(r);break;case 4:Bo();break;case 13:qe($e);break;case 19:qe($e);break;case 10:ud(r.type._context);break;case 22:case 23:kd()}a=a.return}if(ot=e,Ye=e=nr(e.current,null),st=Mt=t,tt=0,qn=null,Id=Hs=Nr=0,It=Cn=null,Ar!==null){for(t=0;t<Ar.length;t++)if(a=Ar[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var l=n.next;n.next=o,r.next=l}a.pending=r}Ar=null}return e}function Am(e,t){do{var a=Ye;try{if(id(),ts.current=ks,ws){for(var r=Ve.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ws=!1}if(zr=0,rt=et=Ve=null,Sn=!1,Nn=0,Sd.current=null,a===null||a.return===null){tt=1,qn=t,Ye=null;break}e:{var n=e,l=a.return,s=a,i=t;if(t=st,s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){var d=i,f=s,m=f.tag;if((f.mode&1)===0&&(m===0||m===11||m===15)){var g=f.alternate;g?(f.updateQueue=g.updateQueue,f.memoizedState=g.memoizedState,f.lanes=g.lanes):(f.updateQueue=null,f.memoizedState=null)}var L=Tc(l);if(L!==null){L.flags&=-257,Pc(L,l,s,n,t),L.mode&1&&bc(n,d,t),t=L,i=d;var x=t.updateQueue;if(x===null){var I=new Set;I.add(i),t.updateQueue=I}else x.add(i);break e}else{if((t&1)===0){bc(n,d,t),bd();break e}i=Error(M(426))}}else if(_e&&s.mode&1){var H=Tc(l);if(H!==null){(H.flags&65536)===0&&(H.flags|=256),Pc(H,l,s,n,t),ld(Oo(i,s));break e}}n=i=Oo(i,s),tt!==4&&(tt=2),Cn===null?Cn=[n]:Cn.push(n),n=l;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var p=mm(n,i,t);Lc(n,p);break e;case 1:s=i;var u=n.type,c=n.stateNode;if((n.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(rr===null||!rr.has(c)))){n.flags|=65536,t&=-t,n.lanes|=t;var v=gm(n,s,t);Lc(n,v);break e}}n=n.return}while(n!==null)}Fm(a)}catch(w){t=w,Ye===a&&a!==null&&(Ye=a=a.return);continue}break}while(!0)}function Dm(){var e=bs.current;return bs.current=ks,e===null?ks:e}function bd(){(tt===0||tt===3||tt===2)&&(tt=4),ot===null||(Nr&268435455)===0&&(Hs&268435455)===0||Xa(ot,st)}function Rs(e,t){var a=Le;Le|=2;var r=Dm();(ot!==e||st!==t)&&(ka=null,Er(e,t));do try{tv();break}catch(o){Am(e,o)}while(!0);if(id(),Le=a,bs.current=r,Ye!==null)throw Error(M(261));return ot=null,st=0,tt}function tv(){for(;Ye!==null;)Em(Ye)}function av(){for(;Ye!==null&&!Rh();)Em(Ye)}function Em(e){var t=Om(e.alternate,e,Mt);e.memoizedProps=e.pendingProps,t===null?Fm(e):Ye=t,Sd.current=null}function Fm(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=jx(a,t,Mt),a!==null){Ye=a;return}}else{if(a=Xx(a,t),a!==null){a.flags&=32767,Ye=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tt=6,Ye=null;return}}if(t=t.sibling,t!==null){Ye=t;return}Ye=t=e}while(t!==null);tt===0&&(tt=5)}function Rr(e,t,a){var r=Re,o=Wt.transition;try{Wt.transition=null,Re=1,rv(e,t,a,r)}finally{Wt.transition=o,Re=r}return null}function rv(e,t,a,r){do Mo();while(Ya!==null);if((Le&6)!==0)throw Error(M(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(M(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(Uh(e,n),e===ot&&(Ye=ot=null,st=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||Ql||(Ql=!0,zm(ds,function(){return Mo(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=Wt.transition,Wt.transition=null;var l=Re;Re=1;var s=Le;Le|=4,Sd.current=null,Yx(e,a),Pm(a,e),kx(vu),cs=!!xu,vu=xu=null,e.current=a,Zx(a,e,o),Mh(),Le=s,Re=l,Wt.transition=n}else e.current=a;if(Ql&&(Ql=!1,Ya=e,Ps=o),n=e.pendingLanes,n===0&&(rr=null),Eh(a.stateNode,r),bt(e,Qe()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ts)throw Ts=!1,e=Nu,Nu=null,e;return(Ps&1)!==0&&e.tag!==0&&Mo(),n=e.pendingLanes,(n&1)!==0?e===Uu?wn++:(wn=0,Uu=e):wn=0,dr(),null}function Mo(){if(Ya!==null){var e=mp(Ps),t=Wt.transition,a=Re;try{if(Wt.transition=null,Re=16>e?16:e,Ya===null)var r=!1;else{if(e=Ya,Ya=null,Ps=0,(Le&6)!==0)throw Error(M(331));var o=Le;for(Le|=4,G=e.current;G!==null;){var n=G,l=n.child;if((G.flags&16)!==0){var s=n.deletions;if(s!==null){for(var i=0;i<s.length;i++){var d=s[i];for(G=d;G!==null;){var f=G;switch(f.tag){case 0:case 11:case 15:In(8,f,n)}var m=f.child;if(m!==null)m.return=f,G=m;else for(;G!==null;){f=G;var g=f.sibling,L=f.return;if(km(f),f===d){G=null;break}if(g!==null){g.return=L,G=g;break}G=L}}}var x=n.alternate;if(x!==null){var I=x.child;if(I!==null){x.child=null;do{var H=I.sibling;I.sibling=null,I=H}while(I!==null)}}G=n}}if((n.subtreeFlags&2064)!==0&&l!==null)l.return=n,G=l;else e:for(;G!==null;){if(n=G,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:In(9,n,n.return)}var p=n.sibling;if(p!==null){p.return=n.return,G=p;break e}G=n.return}}var u=e.current;for(G=u;G!==null;){l=G;var c=l.child;if((l.subtreeFlags&2064)!==0&&c!==null)c.return=l,G=c;else e:for(l=u;G!==null;){if(s=G,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:Us(9,s)}}catch(w){je(s,s.return,w)}if(s===l){G=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,G=v;break e}G=s.return}}if(Le=o,dr(),xa&&typeof xa.onPostCommitFiberRoot=="function")try{xa.onPostCommitFiberRoot(As,e)}catch{}r=!0}return r}finally{Re=a,Wt.transition=t}}return!1}function qc(e,t,a){t=Oo(a,t),t=mm(e,t,1),e=ar(e,t,1),t=xt(),e!==null&&(_n(e,1,t),bt(e,t))}function je(e,t,a){if(e.tag===3)qc(e,e,a);else for(;t!==null;){if(t.tag===3){qc(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(rr===null||!rr.has(r))){e=Oo(a,e),e=gm(t,e,1),t=ar(t,e,1),e=xt(),t!==null&&(_n(t,1,e),bt(t,e));break}}t=t.return}}function ov(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=xt(),e.pingedLanes|=e.suspendedLanes&a,ot===e&&(st&a)===a&&(tt===4||tt===3&&(st&130023424)===st&&500>Qe()-Cd?Er(e,0):Id|=a),bt(e,t)}function Bm(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ol,Ol<<=1,(Ol&130023424)===0&&(Ol=4194304)));var a=xt();e=Da(e,t),e!==null&&(_n(e,t,a),bt(e,a))}function nv(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Bm(e,a)}function lv(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),Bm(e,a)}var Om;Om=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||wt.current)Ct=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return Ct=!1,Kx(e,t,a);Ct=(e.flags&131072)!==0}else Ct=!1,_e&&(t.flags&1048576)!==0&&Hp(t,ys,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;rs(e,t),e=t.pendingProps;var o=Do(t,mt.current);Ro(t,a),o=hd(null,t,r,e,o,a);var n=xd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kt(r)?(n=!0,xs(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,fd(t),o.updater=Ns,t.stateNode=o,o._reactInternals=t,Tu(t,r,e,a),t=Mu(null,t,r,!0,n,a)):(t.tag=0,_e&&n&&od(t),ht(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(rs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=iv(r),e=ra(r,e),o){case 0:t=Ru(null,t,r,e,a);break e;case 1:t=Ac(null,t,r,e,a);break e;case 11:t=Rc(null,t,r,e,a);break e;case 14:t=Mc(null,t,r,ra(r.type,e),a);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ra(r,o),Ru(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ra(r,o),Ac(e,t,r,o,a);case 3:e:{if(ym(t),e===null)throw Error(M(387));r=t.pendingProps,n=t.memoizedState,o=n.element,Gp(e,t),Is(t,r,null,a);var l=t.memoizedState;if(r=l.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=Oo(Error(M(423)),t),t=Dc(e,t,r,a,o);break e}else if(r!==o){o=Oo(Error(M(424)),t),t=Dc(e,t,r,a,o);break e}else for(At=tr(t.stateNode.containerInfo.firstChild),Dt=t,_e=!0,na=null,a=$p(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Eo(),r===o){t=Ea(e,t,a);break e}ht(e,t,r,a)}t=t.child}return t;case 5:return Kp(t),e===null&&wu(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,l=o.children,yu(r,o)?l=null:n!==null&&yu(r,n)&&(t.flags|=32),vm(e,t),ht(e,t,l,a),t.child;case 6:return e===null&&wu(t),null;case 13:return Lm(e,t,a);case 4:return cd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fo(t,null,r,a):ht(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ra(r,o),Rc(e,t,r,o,a);case 7:return ht(e,t,t.pendingProps,a),t.child;case 8:return ht(e,t,t.pendingProps.children,a),t.child;case 12:return ht(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,l=o.value,Ne(Ls,r._currentValue),r._currentValue=l,n!==null)if(ia(n.value,l)){if(n.children===o.children&&!wt.current){t=Ea(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var s=n.dependencies;if(s!==null){l=n.child;for(var i=s.firstContext;i!==null;){if(i.context===r){if(n.tag===1){i=Ra(-1,a&-a),i.tag=2;var d=n.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?i.next=i:(i.next=f.next,f.next=i),d.pending=i}}n.lanes|=a,i=n.alternate,i!==null&&(i.lanes|=a),ku(n.return,a,t),s.lanes|=a;break}i=i.next}}else if(n.tag===10)l=n.type===t.type?null:n.child;else if(n.tag===18){if(l=n.return,l===null)throw Error(M(341));l.lanes|=a,s=l.alternate,s!==null&&(s.lanes|=a),ku(l,a,t),l=n.sibling}else l=n.child;if(l!==null)l.return=n;else for(l=n;l!==null;){if(l===t){l=null;break}if(n=l.sibling,n!==null){n.return=l.return,l=n;break}l=l.return}n=l}ht(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ro(t,a),o=$t(o),r=r(o),t.flags|=1,ht(e,t,r,a),t.child;case 14:return r=t.type,o=ra(r,t.pendingProps),o=ra(r.type,o),Mc(e,t,r,o,a);case 15:return hm(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ra(r,o),rs(e,t),t.tag=1,kt(r)?(e=!0,xs(t)):e=!1,Ro(t,a),pm(t,r,o),Tu(t,r,o,a),Mu(null,t,r,!0,e,a);case 19:return Sm(e,t,a);case 22:return xm(e,t,a)}throw Error(M(156,t.tag))};function zm(e,t){return dp(e,t)}function sv(e,t,a,r){this.tag=e,this.key=a,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 _t(e,t,a,r){return new sv(e,t,a,r)}function Td(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iv(e){if(typeof e=="function")return Td(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Gu)return 11;if(e===Ku)return 14}return 2}function nr(e,t){var a=e.alternate;return a===null?(a=_t(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function ls(e,t,a,r,o,n){var l=2;if(r=e,typeof e=="function")Td(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case mo:return Fr(a.children,o,n,t);case Vu:l=8,o|=8;break;case Yi:return e=_t(12,a,t,o|2),e.elementType=Yi,e.lanes=n,e;case Zi:return e=_t(13,a,t,o),e.elementType=Zi,e.lanes=n,e;case Ji:return e=_t(19,a,t,o),e.elementType=Ji,e.lanes=n,e;case Kc:return qs(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vc:l=10;break e;case Gc:l=9;break e;case Gu:l=11;break e;case Ku:l=14;break e;case Ga:l=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=_t(l,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Fr(e,t,a,r){return e=_t(7,e,r,t),e.lanes=a,e}function qs(e,t,a,r){return e=_t(22,e,r,t),e.elementType=Kc,e.lanes=a,e.stateNode={isHidden:!1},e}function ji(e,t,a){return e=_t(6,e,null,t),e.lanes=a,e}function Xi(e,t,a){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uv(e,t,a,r,o){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=Di(0),this.expirationTimes=Di(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Di(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Pd(e,t,a,r,o,n,l,s,i){return e=new uv(e,t,a,s,i),t===1?(t=1,n===!0&&(t|=8)):t=0,n=_t(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},fd(n),e}function dv(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:po,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function Nm(e){if(!e)return sr;e=e._reactInternals;e:{if(qr(e)!==e||e.tag!==1)throw Error(M(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(M(171))}if(e.tag===1){var a=e.type;if(kt(a))return Np(e,a,t)}return t}function Um(e,t,a,r,o,n,l,s,i){return e=Pd(a,r,!0,e,o,n,l,s,i),e.context=Nm(null),a=e.current,r=xt(),o=or(a),n=Ra(r,o),n.callback=t??null,ar(a,n,o),e.current.lanes=o,_n(e,o,r),bt(e,r),e}function _s(e,t,a,r){var o=t.current,n=xt(),l=or(o);return a=Nm(a),t.context===null?t.context=a:t.pendingContext=a,t=Ra(n,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ar(o,t,l),e!==null&&(sa(e,o,l,n),es(e,o,l)),l}function Ms(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 _c(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Rd(e,t){_c(e,t),(e=e.alternate)&&_c(e,t)}function fv(){return null}var Hm=typeof reportError=="function"?reportError:function(e){console.error(e)};function Md(e){this._internalRoot=e}Ws.prototype.render=Md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));_s(e,t,null,null)};Ws.prototype.unmount=Md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ur(function(){_s(null,e,null,null)}),t[Aa]=null}};function Ws(e){this._internalRoot=e}Ws.prototype.unstable_scheduleHydration=function(e){if(e){var t=xp();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ja.length&&t!==0&&t<ja[a].priority;a++);ja.splice(a,0,e),a===0&&yp(e)}};function Ad(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Wc(){}function cv(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var d=Ms(l);n.call(d)}}var l=Um(t,r,e,0,null,!1,!1,"",Wc);return e._reactRootContainer=l,e[Aa]=l.current,En(e.nodeType===8?e.parentNode:e),Ur(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var s=r;r=function(){var d=Ms(i);s.call(d)}}var i=Pd(e,0,!1,null,null,!1,!1,"",Wc);return e._reactRootContainer=i,e[Aa]=i.current,En(e.nodeType===8?e.parentNode:e),Ur(function(){_s(t,i,a,r)}),i}function Vs(e,t,a,r,o){var n=a._reactRootContainer;if(n){var l=n;if(typeof o=="function"){var s=o;o=function(){var i=Ms(l);s.call(i)}}_s(t,l,e,o)}else l=cv(a,t,e,o,r);return Ms(l)}gp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=mn(t.pendingLanes);a!==0&&(Qu(t,a|1),bt(t,Qe()),(Le&6)===0&&(zo=Qe()+500,dr()))}break;case 13:Ur(function(){var r=Da(e,1);if(r!==null){var o=xt();sa(r,e,1,o)}}),Rd(e,1)}};Yu=function(e){if(e.tag===13){var t=Da(e,134217728);if(t!==null){var a=xt();sa(t,e,134217728,a)}Rd(e,134217728)}};hp=function(e){if(e.tag===13){var t=or(e),a=Da(e,t);if(a!==null){var r=xt();sa(a,e,t,r)}Rd(e,t)}};xp=function(){return Re};vp=function(e,t){var a=Re;try{return Re=e,t()}finally{Re=a}};uu=function(e,t,a){switch(t){case"input":if(au(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+\'][type="radio"]\'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=Bs(r);if(!o)throw Error(M(90));Xc(r),au(r,o)}}}break;case"textarea":Yc(e,a);break;case"select":t=a.value,t!=null&&ko(e,!!a.multiple,t,!1)}};op=wd;np=Ur;var pv={usingClientEntryPoint:!1,Events:[$n,vo,Bs,ap,rp,wd]},dn={findFiberByHostInstance:Mr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mv={bundleType:dn.bundleType,version:dn.version,rendererPackageName:dn.rendererPackageName,rendererConfig:dn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ip(e),e===null?null:e.stateNode},findFiberByHostInstance:dn.findFiberByHostInstance||fv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(fn=__REACT_DEVTOOLS_GLOBAL_HOOK__,!fn.isDisabled&&fn.supportsFiber))try{As=fn.inject(mv),xa=fn}catch{}var fn;Bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pv;Bt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ad(t))throw Error(M(200));return dv(e,t,null,a)};Bt.createRoot=function(e,t){if(!Ad(e))throw Error(M(299));var a=!1,r="",o=Hm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Pd(e,1,!1,null,null,a,!1,r,o),e[Aa]=t.current,En(e.nodeType===8?e.parentNode:e),new Md(t)};Bt.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(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=ip(t),e=e===null?null:e.stateNode,e};Bt.flushSync=function(e){return Ur(e)};Bt.hydrate=function(e,t,a){if(!$s(t))throw Error(M(200));return Vs(null,e,t,!0,a)};Bt.hydrateRoot=function(e,t,a){if(!Ad(e))throw Error(M(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",l=Hm;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(l=a.onRecoverableError)),t=Um(t,null,e,1,a??null,o,!1,n,l),e[Aa]=t.current,En(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new Ws(t)};Bt.render=function(e,t,a){if(!$s(t))throw Error(M(200));return Vs(null,e,t,!1,a)};Bt.unmountComponentAtNode=function(e){if(!$s(e))throw Error(M(40));return e._reactRootContainer?(Ur(function(){Vs(null,null,e,!1,function(){e._reactRootContainer=null,e[Aa]=null})}),!0):!1};Bt.unstable_batchedUpdates=wd;Bt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!$s(a))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return Vs(e,t,a,!1,r)};Bt.version="18.3.1-next-f1338f8080-20240426"});var _r=wa((by,Wm)=>{"use strict";function _m(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_m)}catch(e){console.error(e)}}_m(),Wm.exports=qm()});var Vm=wa(Dd=>{"use strict";var $m=_r();Dd.createRoot=$m.createRoot,Dd.hydrateRoot=$m.hydrateRoot;var Ty});var Ym=wa(Zs=>{"use strict";var vv=Oe(),yv=Symbol.for("react.element"),Lv=Symbol.for("react.fragment"),Sv=Object.prototype.hasOwnProperty,Iv=vv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Cv={key:!0,ref:!0,__self:!0,__source:!0};function Qm(e,t,a){var r,o={},n=null,l=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)Sv.call(t,r)&&!Cv.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:yv,type:e,key:n,ref:l,props:o,_owner:Iv.current}}Zs.Fragment=Lv;Zs.jsx=Qm;Zs.jsxs=Qm});var j=wa((SL,Zm)=>{"use strict";Zm.exports=Ym()});var Eg=E(Vm(),1);var ie=E(Oe(),1),Rg=E(_r(),1);function Gm(e){return e.trim().replace(/^\\|/,"").replace(/\\|$/,"").split("|").map(a=>a.trim())}function gv(e){return/^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(e)}function hv(e){let t=e.split(`\n`),a=[],r=0;for(;r<t.length;){let o=t[r]??"",n=t[r+1]??"";if(o.includes("|")&&gv(n)){let l=Gm(o),s=[];for(r+=2;r<t.length&&t[r].includes("|")&&t[r].trim()!=="";)s.push(Gm(t[r])),r+=1;let i=`<tr>${l.map(f=>`<th style="text-align:left;padding:7px 10px;border:1px solid #334155;color:#e2e8f0;background:#0f172a;">${f}</th>`).join("")}</tr>`,d=s.map(f=>`<tr>${f.map(m=>`<td style="padding:7px 10px;border:1px solid #334155;color:#cbd5e1;vertical-align:top;">${m}</td>`).join("")}</tr>`).join("");a.push(`<div style="overflow-x:auto;margin:0.65em 0;"><table style="border-collapse:collapse;min-width:360px;width:100%;font-size:12px;"><thead>${i}</thead><tbody>${d}</tbody></table></div>`);continue}a.push(t[r]),r+=1}return a.join(`\n`)}function Gs(e){if(!e)return\'<span style="color:#475569;font-style:italic;">No description yet</span>\';let t=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return hv(t).replace(/^### (.+)$/gm,\'<h3 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.05em;color:#cbd5e1;">$1</h3>\').replace(/^## (.+)$/gm,\'<h2 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.2em;color:#f1f5f9;">$1</h2>\').replace(/^# (.+)$/gm,\'<h1 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.4em;color:#f1f5f9;">$1</h1>\').replace(/[*][*]([^\\n]+?)[*][*]/g,\'<strong style="font-weight:700;color:#f1f5f9;">$1</strong>\').replace(/__([^\\n]+?)__/g,\'<strong style="font-weight:700;color:#f1f5f9;">$1</strong>\').replace(/[*]([^\\n*]+?)[*]/g,\'<em style="font-style:italic;color:#94a3b8;">$1</em>\').replace(/(?<![a-zA-Z0-9])_([^_\\n]+?)_(?![a-zA-Z0-9])/g,\'<em style="font-style:italic;color:#94a3b8;">$1</em>\').replace(/`(.+?)`/g,\'<code style="font-family:Menlo,monospace;font-size:12px;background:#1e293b;padding:1px 5px;border-radius:3px;color:#7dd3fc;">$1</code>\').replace(/\\[([^\\]]+)\\]\\((https?:\\/\\/[^)]+)\\)/g,\'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#60a5fa;text-decoration:underline;">$1</a>\').replace(/(^|[\\s(>])((https?:\\/\\/)[^\\s<>"\']+)/g,\'$1<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#60a5fa;text-decoration:underline;word-break:break-all;">$2</a>\').replace(/(^|[^\\w])#([a-f0-9]{30})(?![a-f0-9])/gi,\'$1<a href="#task-$2" data-task-ref="$2" style="color:#60a5fa;text-decoration:underline;font-family:Menlo,monospace;">#$2</a>\').replace(/^[-*] (.+)$/gm,\'<li style="margin:0.2em 0;display:list-item;">$1</li>\').replace(/^---$/gm,\'<hr style="border:none;border-top:1px solid #334155;margin:0.8em 0;">\').replace(/(<li[^>]*>[\\s\\S]*?<\\/li>\\n?)+/g,r=>`<ul style="padding-left:1.5em;margin:0.4em 0;list-style-type:disc;">${r}</ul>`).replace(/^(?!<[a-z]|$).+$/gm,r=>`<p style="margin:0.5em 0;">${r}</p>`)}var xv="proto-comments-seen";function Ed(e,t){try{let a=localStorage.getItem(xv),r=a?JSON.parse(a):{};return t>(r[e]??0)}catch{return!1}}function Fd(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Tt(e){try{return new Date(e).toLocaleString()}catch{return e}}var Bd=16,Ho=1000000n,Xs=BigInt("9".repeat(Bd));function Gt(e){return(e<0n?0n:e>Xs?Xs:e).toString().padStart(Bd,"0")}function Ks(e){let t=e.split(".")[0];return/^\\d+$/.test(t)?BigInt(t):Xs}function js(e){let t=e.indexOf(".");return t>=0?e.slice(t+1):null}function Ba(e,t){if(t===null){if(e===null)return Gt(Ho);let l=Ks(e);if(l<Xs-Ho)return Gt(l+Ho);let s=js(e)??"0".repeat(Bd);return Gt(l)+"."+Ba(s,null)}if(e===null){let l=Ks(t),s=js(t);return l>Ho?Gt(l-Ho):s!==null?Gt(l)+"."+Ba(null,s):l>0n?Gt(l/2n):Gt(0n)+".0"}let a=Ks(e),r=Ks(t),o=js(e),n=js(t);return r>a+1n?Gt((a+r)/2n):r===a+1n?Gt(a)+"."+Ba(o,null):o===null&&n===null?Gt(a)+"."+Gt(Ho):Gt(a)+"."+Ba(o,n)}function Wr(e,t){return e.sortKey&&t.sortKey?e.sortKey<t.sortKey?-1:e.sortKey>t.sortKey?1:0:e.sortKey?-1:t.sortKey?1:(e.updatedAt??e.createdAt??"").localeCompare(t.updatedAt??t.createdAt??"")}function Od(e,t,a,r){let o=new Map,n=null;for(let m of e)m.sortKey&&m.sortKey!=="n"&&(o.set(m.id,m.sortKey),n=m.sortKey);let l=[],s=e.filter(m=>!m.sortKey||m.sortKey==="n");if(s.length>0){let m=n;for(let g of s){let L=Ba(m,null);o.set(g.id,L),m=L,g.id!==t&&l.push({id:g.id,sortKey:L})}}let i=a?o.get(a)??null:null,d=r?o.get(r)??null:null;return{newSortKey:Ba(i,d),normalizationPatches:l}}var jt=E(Oe(),1);var Ys=E(Oe());var Km=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qs=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var Gn=E(Oe());var jm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Xm=(0,Gn.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:l,...s},i)=>(0,Gn.createElement)("svg",{ref:i,...jm,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Qs("lucide",o),...s},[...l.map(([d,f])=>(0,Gn.createElement)(d,f)),...Array.isArray(n)?n:[n]]));var X=(e,t)=>{let a=(0,Ys.forwardRef)(({className:r,...o},n)=>(0,Ys.createElement)(Xm,{ref:n,iconNode:t,className:Qs(`lucide-${Km(e)}`,r),...o}));return a.displayName=`${e}`,a};var Kt=X("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var ya=X("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var Kn=X("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var fr=X("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var cr=X("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);var $r=X("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var jn=X("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var qo=X("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var Xn=X("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);var Qn=X("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var Yn=X("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);var Zn=X("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var Jn=X("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var el=X("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var Vr=X("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var pr=X("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);var Gr=X("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);var Kr=X("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);var tl=X("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var jr=X("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var Xr=X("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var al=X("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var Qr=X("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var _o=X("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var rl=X("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var mr=X("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var Wo=X("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var ol=X("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var Xe=X("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Oa=E(Oe(),1),dg=E(_r(),1);var tg=E(j(),1),Jm={Bug:{background:"rgba(239,68,68,0.12)",color:"#f87171",border:"rgba(239,68,68,0.25)"},Research:{background:"rgba(192,132,252,0.12)",color:"#c084fc",border:"rgba(139,92,246,0.2)"},Task:{background:"rgba(148,163,184,0.1)",color:"#94a3b8",border:"rgba(148,163,184,0.2)"}};function eg({type:e,style:t}){let a=typeof e=="string"&&e.trim()&&e!=="[object Object]"&&Jm[e]?e:"Task",r=Jm[a];return(0,tg.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:r.background,color:r.color,border:`1px solid ${r.border}`,lineHeight:"1.5",...t},children:a})}var og=E(j(),1),ag={Critical:{background:"rgba(239,68,68,0.15)",color:"#f87171",border:"rgba(239,68,68,0.3)"},High:{background:"rgba(249,115,22,0.12)",color:"#fb923c",border:"rgba(249,115,22,0.25)"},Medium:{background:"rgba(234,179,8,0.12)",color:"#facc15",border:"rgba(234,179,8,0.25)"},Low:{background:"rgba(148,163,184,0.1)",color:"#94a3b8",border:"rgba(148,163,184,0.2)"}};function rg({priority:e,style:t}){if(!e||!ag[e])return null;let a=ag[e];return(0,og.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:a.background,color:a.color,border:`1px solid ${a.border}`,lineHeight:"1.5",...t},children:e})}var Yr=[{value:"Task",icon:"\\u2611",label:"Task",css:"type-task",tooltip:"A general task or feature to implement."},{value:"Bug",icon:"\\u{1F41E}",label:"Bug",css:"type-bug",tooltip:"A defect \\u2014 annotator collects page errors and console logs to help reproduce it."},{value:"Research",icon:"\\u{1F52C}",label:"Research",css:"type-research",tooltip:"A research task \\u2014 agent will NOT write code but must attach a findings report."}],wL=Yr.map(e=>e.value),lg=Object.fromEntries(Yr.map(e=>[e.value,e.icon])),kL=Object.fromEntries(Yr.map(e=>[e.value,e.css])),ng={Task:"#94a3b8",Bug:"#ef4444",Research:"#a855f7"};function nl(e){return ng[e??"Task"]??ng.Task}var sg=[{bg:"color-mix(in srgb, var(--p-blue) 14%, transparent)",text:"var(--p-blue-200)",border:"color-mix(in srgb, var(--p-blue) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-green) 14%, transparent)",text:"var(--p-green-300)",border:"color-mix(in srgb, var(--p-green) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-purple) 14%, transparent)",text:"var(--p-purple-300)",border:"color-mix(in srgb, var(--p-purple) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-amber) 14%, transparent)",text:"var(--p-amber-300)",border:"color-mix(in srgb, var(--p-amber) 30%, transparent)"},{bg:"color-mix(in srgb, #f472b6 14%, transparent)",text:"#f9a8d4",border:"color-mix(in srgb, #f472b6 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-cyan) 14%, transparent)",text:"var(--p-cyan-300)",border:"color-mix(in srgb, var(--p-cyan) 30%, transparent)"},{bg:"color-mix(in srgb, #f87171 14%, transparent)",text:"#fca5a5",border:"color-mix(in srgb, #f87171 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-text-g) 14%, transparent)",text:"var(--p-text-m)",border:"color-mix(in srgb, var(--p-text-g) 30%, transparent)"}];function wv(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)>>>0;return t%sg.length}function ua(e){return sg[wv(e)]}var ll=E(j(),1);function sl({tags:e,onRemove:t,size:a="sm"}){if(!e.length)return null;let r=a==="xs"?"1px 6px":"2px 7px",o=a==="xs"?9:10;return(0,ll.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3,alignItems:"center"},children:e.map(n=>{let{bg:l,text:s,border:i}=ua(n);return(0,ll.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding:r,borderRadius:100,background:l,border:`1px solid ${i}`,color:s,fontSize:o,fontWeight:600,whiteSpace:"nowrap"},children:[n,t&&(0,ll.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),t(n)},style:{display:"flex",background:"none",border:"none",color:s,cursor:"pointer",padding:0,lineHeight:1,opacity:.7},onMouseEnter:d=>{d.currentTarget.style.opacity="1"},onMouseLeave:d=>{d.currentTarget.style.opacity="0.7"},children:"\\xD7"})]},n)})})}var de=E(j(),1);function kv(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function fg(e,t){if(!/^#[0-9a-fA-F]{6}$/.test(e))return;let a=Math.max(0,Math.min(1,t)),r=Math.round(a*255).toString(16).padStart(2,"0");return`${e}${r}`}function cg(e,t){return fg(e,t==="Critical"?.36:t==="High"?.3:.24)??"color-mix(in srgb, var(--p-text-g) 40%, transparent)"}function bv(e){return fg(e,.05)??"transparent"}var Tv={padding:"7px 8px",gap:4,opacity:.45,userSelect:"none"},Pv={display:"flex",alignItems:"center",gap:5},Rv={width:12,height:12,color:"color-mix(in srgb, var(--p-green) 55%, transparent)",flexShrink:0},Mv={fontSize:11.5,fontWeight:600,color:"var(--p-text-g)",textDecoration:"line-through",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},Av={display:"flex",alignItems:"center",gap:5,minWidth:0},ig={flexShrink:0},Dv={fontSize:11.5,fontWeight:600,color:"var(--p-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},Ev={display:"flex",alignItems:"flex-start",gap:8},Fv={fontSize:10,color:"var(--p-text-g)",lineHeight:"1.45",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,flex:1,minWidth:0},Bv={position:"relative",flexShrink:0},Ov={width:52,height:34,borderRadius:6,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 90%, transparent)",display:"block",cursor:"pointer"},zv={display:"flex",alignItems:"center",gap:2,marginTop:1},Nv={flex:1},zd=Oa.default.memo(function({task:t,col:a,liveActivity:r,onOpen:o,onDragStart:n,selectMode:l,selected:s,onToggleSelect:i,agentStatus:d,experimentalAgents:f,multiDragCount:m,onEnterSelectMode:g}){var We;let L=a.id==="in-progress",x=a.id==="done",[I,H]=Oa.default.useState(!1),[p,u]=Oa.default.useState(null),c=Oa.default.useRef(null),v=Oa.default.useRef(null),w=Oa.default.useRef(!1),C=Oa.default.useRef(null),y=750,k=5,z=t.commentCount??0,N=t.fileCount??0,U=z>0&&Ed(t.id,z),_=cg(a.color,t.priority),re=nl(t.type),ce=bv(re),Se=(We=t.files)==null?void 0:We.find(oe=>kv(oe.name)),Z=Se?`/api/tasks/${t.id}/files/${encodeURIComponent(Se.name)}`:null;function ke(oe){n(oe,t.id),oe.currentTarget.classList.add("dragging")}function be(oe){oe.currentTarget.classList.remove("dragging")}function ve(oe){l||(w.current=!1,C.current={x:oe.clientX,y:oe.clientY},v.current=setTimeout(()=>{w.current=!0,g==null||g(t.id)},y))}function W(oe){if(!v.current||!C.current)return;let Te=oe.clientX-C.current.x,Je=oe.clientY-C.current.y;Math.sqrt(Te*Te+Je*Je)>k&&(clearTimeout(v.current),v.current=null,C.current=null)}function D(){v.current&&(clearTimeout(v.current),v.current=null)}function b(){v.current&&(clearTimeout(v.current),v.current=null)}function B(oe){if(w.current){w.current=!1;return}if(l){oe.stopPropagation(),i==null||i(t.id);return}o(t)}function te(oe){oe.stopPropagation(),i==null||i(t.id)}let Ie=f===!0&&d==="running"?"1px solid rgba(59,130,246,0.5)":f===!0&&d==="queued"?"1px solid color-mix(in srgb, var(--p-amber) 45%, transparent)":f===!0&&d==="done"?"1px solid color-mix(in srgb, var(--p-green) 40%, transparent)":void 0,Be=f===!0&&d==="running"?"color-mix(in srgb, var(--p-blue) 6%, var(--p-card))":f===!0&&d==="queued"?"color-mix(in srgb, var(--p-amber) 5%, var(--p-card))":f===!0&&d==="done"?"color-mix(in srgb, var(--p-green) 5%, var(--p-card))":void 0;return x?(0,de.jsx)("article",{className:"task-card",draggable:!0,"data-task-id":t.id,style:{...Tv,...l&&s?{borderColor:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 10%, var(--p-card))"}:{}},onDragStart:ke,onDragEnd:be,onMouseDown:ve,onMouseMove:W,onMouseUp:D,onMouseLeave:b,onClick:B,children:(0,de.jsxs)("div",{style:Pv,children:[l&&(0,de.jsx)("span",{onClick:te,style:{width:12,height:12,borderRadius:3,border:s?"1px solid var(--p-blue)":"1px solid var(--p-border-s)",background:s?"var(--p-blue)":"var(--p-input)",flexShrink:0,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s&&(0,de.jsx)("span",{style:{color:"#fff",fontSize:9,fontWeight:700},children:"\\u2713"})}),(0,de.jsx)(fr,{style:Rv}),(0,de.jsx)("span",{style:Mv,children:t.title}),m!=null&&(0,de.jsxs)("span",{style:{fontSize:9,fontWeight:700,padding:"1px 5px",borderRadius:4,background:"var(--p-blue)",color:"#fff",flexShrink:0,marginLeft:4},children:["+",m-1]})]})}):(0,de.jsxs)("article",{className:`task-card${r?" task-live-edit":""}`,draggable:!0,"data-task-id":t.id,style:{padding:"7px 8px",gap:4,userSelect:"none",background:r?"rgba(59,130,246,0.08)":Be??ce,border:Ie??(r?"1px solid rgba(59,130,246,0.5)":_?`1px solid ${_}`:void 0),...r?{boxShadow:"0 0 0 2px rgba(59,130,246,0.14)"}:{},...l&&s?{borderColor:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 10%, var(--p-card))"}:{}},onDragStart:ke,onDragEnd:be,onMouseDown:ve,onMouseMove:W,onMouseUp:D,onMouseLeave:b,onClick:B,children:[(0,de.jsxs)("div",{style:Av,children:[l&&(0,de.jsx)("span",{onClick:te,style:{width:14,height:14,borderRadius:3,border:s?"1px solid var(--p-blue)":"1px solid var(--p-border-s)",background:s?"var(--p-blue)":"var(--p-input)",flexShrink:0,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",marginRight:2},children:s&&(0,de.jsx)("span",{style:{color:"#fff",fontSize:9,fontWeight:700},children:"\\u2713"})}),L&&(0,de.jsx)("span",{className:"spinner",style:ig}),f===!0&&d==="running"&&!L&&(0,de.jsx)("span",{className:"spinner",style:ig}),(0,de.jsx)("span",{style:Dv,children:t.title}),m!=null&&(0,de.jsxs)("span",{style:{fontSize:9,fontWeight:700,padding:"1px 5px",borderRadius:4,background:"var(--p-blue)",color:"#fff",flexShrink:0,marginLeft:4},children:["+",m-1]})]}),(t.description||Z)&&(0,de.jsxs)("div",{style:Ev,children:[t.description&&(0,de.jsx)("div",{style:Fv,children:t.description}),Z&&(0,de.jsxs)("div",{style:Bv,onMouseEnter:()=>{if(c.current){let oe=c.current.getBoundingClientRect();u({top:oe.top,right:oe.right})}H(!0)},onMouseLeave:()=>{H(!1),u(null)},children:[(0,de.jsx)("img",{ref:c,src:Z,alt:"Task screenshot","data-role":"task-thumb",style:Ov}),I&&p&&dg.default.createPortal((0,de.jsx)("img",{src:Z,alt:"Task screenshot enlarged preview","data-role":"task-thumb-preview",style:{position:"fixed",right:window.innerWidth-p.right,bottom:window.innerHeight-p.top+8,width:220,height:138,borderRadius:8,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 96%, transparent)",boxShadow:"0 10px 24px color-mix(in srgb, var(--p-bg) 75%, transparent)",pointerEvents:"none",zIndex:9999,background:"var(--p-bg)"}}),document.body)]})]}),(0,de.jsxs)("div",{className:"flex items-center",style:zv,children:[(0,de.jsx)(eg,{type:t.type}),t.priority&&(0,de.jsx)(rg,{priority:t.priority}),f===!0&&d==="running"&&(0,de.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(59,130,246,0.12)",color:"#60a5fa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:[(0,de.jsx)("span",{className:"spinner",style:{width:8,height:8,borderWidth:1.5}}),"Agent"]}),f===!0&&d==="queued"&&(0,de.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(245,158,11,0.12)",color:"var(--p-amber)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:"\\u23F3 Queued"}),f===!0&&d==="done"&&(0,de.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(34,197,94,0.12)",color:"var(--p-green)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:"\\u2713 Done"}),L&&t.assigneeName&&(0,de.jsx)("span",{style:{fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(59,130,246,0.12)",color:"#60a5fa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:80},children:t.assigneeName}),t.tags&&t.tags.length>0&&(0,de.jsx)(sl,{tags:t.tags,size:"xs"}),(0,de.jsx)("div",{style:Nv}),r&&(0,de.jsx)(Nd,{activity:r}),(0,de.jsx)(ug,{icon:(0,de.jsx)(Vr,{style:{width:9,height:9}}),label:z>0?String(z):"",color:U?"var(--p-purple)":z>0?"var(--p-text-m)":"var(--p-border-t)",hoverColor:U?"var(--p-purple-300)":"var(--p-text)",title:z>0?`${z} comment(s)`:"Add comment",badge:U,badgeColor:"var(--p-purple)",onClick:oe=>{oe.stopPropagation(),o(t,"comments")}}),(0,de.jsx)(ug,{icon:(0,de.jsx)(Gr,{style:{width:9,height:9}}),label:N>0?String(N):"",color:N>0?"var(--p-blue-300)":"var(--p-border-t)",hoverColor:N>0?"var(--p-cyan-300)":"var(--p-text-sub)",title:N>0?`${N} file(s) attached`:"Files",onClick:oe=>{oe.stopPropagation(),o(t,"files")}})]})]})});function ug({icon:e,label:t,color:a,hoverColor:r,title:o,badge:n,badgeColor:l,onClick:s}){let[i,d]=Oa.default.useState(!1);return(0,de.jsxs)("button",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 3px",borderRadius:3,border:"none",background:i?"color-mix(in srgb, var(--p-text-m) 10%, transparent)":"transparent",cursor:"pointer",fontSize:9,color:i?r:a,transition:"color .1s, background .1s"},title:o,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:s,children:[e,t&&(0,de.jsx)("span",{children:t}),n&&(0,de.jsx)("span",{style:{width:4,height:4,background:l??a,borderRadius:"50%",flexShrink:0}})]})}function Nd({activity:e}){let t=e.state==="locked"||e.state==="editing",a=t?(0,de.jsx)(el,{style:{width:8,height:8}}):(0,de.jsx)(jn,{style:{width:8,height:8}}),r=t?`Locked by ${e.user}`:`${e.user} viewing`;return(0,de.jsxs)("span",{style:t?{display:"inline-flex",alignItems:"center",gap:3,borderRadius:999,padding:"1px 5px",fontSize:9,fontWeight:600,border:"1px solid rgba(244,114,182,0.35)",color:"#f9a8d4",background:"rgba(157,23,77,0.28)",flexShrink:0,maxWidth:110,overflow:"hidden",whiteSpace:"nowrap",flexWrap:"nowrap"}:{display:"inline-flex",alignItems:"center",gap:3,borderRadius:999,padding:"1px 5px",fontSize:9,fontWeight:600,border:"1px solid rgba(59,130,246,0.35)",color:"#93c5fd",background:"rgba(30,58,138,0.28)",flexShrink:0,maxWidth:110,overflow:"hidden",whiteSpace:"nowrap",flexWrap:"nowrap"},title:r,"data-testid":"live-activity-badge",children:[a,(0,de.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:"1 1 0"},children:e.user})]})}var pe=E(j(),1),gr=[{id:"backlog",label:"Backlog",color:"var(--p-text-f)",accent:"color-mix(in srgb, var(--p-text-g) 20%, transparent)"},{id:"todo",label:"Todo",color:"var(--p-amber)",accent:"color-mix(in srgb, var(--p-amber) 12%, transparent)"},{id:"in-progress",label:"In Progress",color:"var(--p-blue)",accent:"color-mix(in srgb, var(--p-blue) 12%, transparent)",glow:!0},{id:"review",label:"Review",color:"var(--p-purple)",accent:"color-mix(in srgb, var(--p-purple) 12%, transparent)"},{id:"done",label:"Done",color:"var(--p-green)",accent:"color-mix(in srgb, var(--p-green) 10%, transparent)"}];var Uv=3;function Hv(){return(0,pe.jsxs)("div",{style:{borderRadius:8,border:"1px solid var(--p-border-t)",padding:"10px 12px",background:"var(--p-bg-2)",marginBottom:6,animation:"skeleton-pulse 1.5s ease-in-out infinite"},children:[(0,pe.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"75%",marginBottom:8}}),(0,pe.jsx)("div",{style:{height:10,borderRadius:4,background:"var(--p-border-s)",width:"50%",marginBottom:8}}),(0,pe.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,pe.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:48}}),(0,pe.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})]})}function Ud({tasks:e,visibleCols:t,searchQuery:a,isLoading:r,liveActivities:o,onOpenPanel:n,onDrop:l,onReorder:s,selectMode:i,selectedTaskIds:d,onToggleSelect:f,onEnterSelectMode:m,agentStatuses:g,onRunSelectedAgents:L,onExitSelectMode:x,experimentalAgents:I}){let H=jt.default.useRef(null),p=jt.default.useRef(null),[u,c]=jt.default.useState(null),[v,w]=jt.default.useState(null),[C,y]=jt.default.useState(null),k=jt.default.useRef(null),z=jt.default.useRef(null),[N,U]=jt.default.useState([]),_=jt.default.useRef([]),re=a?e.filter(D=>(D.title??"").toLowerCase().includes(a.toLowerCase())||(D.description??"").toLowerCase().includes(a.toLowerCase())):e,ce=gr.filter(D=>t.includes(D.id));jt.default.useEffect(()=>{let D=H.current,b=p.current;if(!D||!b)return;function B(){if(!D||!b)return;let Me=D.scrollWidth>D.clientWidth?D.clientWidth/D.scrollWidth:1,Pe=Math.max(40,D.clientWidth*Me);b.style.width=`${Pe}px`;let Ke=D.scrollWidth-D.clientWidth,ye=D.clientWidth-Pe;b.style.left=`${Ke>0?D.scrollLeft/Ke*ye:0}px`,b.style.opacity=Me<1?"1":"0"}D.addEventListener("scroll",B);let te=new ResizeObserver(B);te.observe(D),B();let Ie=!1,Be=0,We=0;function oe(Me){Ie=!0,Be=Me.clientX,We=D.scrollLeft,b.classList.add("dragging"),document.addEventListener("mousemove",Te),document.addEventListener("mouseup",Je)}function Te(Me){if(!Ie||!D||!b)return;let Pe=D.scrollWidth>D.clientWidth?D.scrollWidth/D.clientWidth:1;D.scrollLeft=We+(Me.clientX-Be)*Pe}function Je(){Ie=!1,b==null||b.classList.remove("dragging"),document.removeEventListener("mousemove",Te),document.removeEventListener("mouseup",Je)}return b.addEventListener("mousedown",oe),()=>{D.removeEventListener("scroll",B),te.disconnect(),b.removeEventListener("mousedown",oe)}},[ce.length]);function Se(D,b){k.current=b,c(b),D.dataTransfer.effectAllowed="move",i&&(x==null||x()),_.current=[],U([])}function Z(D,b){D.preventDefault(),w(b)}function ke(D,b){D.preventDefault(),D.stopPropagation();let B=D.currentTarget.getBoundingClientRect(),te=D.clientY<B.top+B.height/2?"before":"after",Ie={taskId:b,position:te};z.current=Ie,y(Be=>(Be==null?void 0:Be.taskId)===b&&Be.position===te?Be:Ie)}function be(D,b,B){D.preventDefault(),w(null);let te=z.current;z.current=null,y(null);let Ie=k.current;k.current=null,c(null);let Be=_.current;if(_.current=[],U([]),!!Ie){if(Be.length>1&&s){let We=Be.map(ye=>e.find(De=>De.id===ye)).filter(Boolean).sort(Wr).map(ye=>ye.id),Te=e.filter(ye=>ye.status===b).sort(Wr).filter(ye=>!Be.includes(ye.id)),Je;if(te){let ye=Te.findIndex(De=>De.id===te.taskId);Je=te.position==="before"?ye:ye+1}else Je=Te.length;let Me=We.map(ye=>e.find(De=>De.id===ye)),Pe=[...Te.slice(0,Je),...Me,...Te.slice(Je)],Ke=new Map;for(let ye of Pe)Ke.set(ye.id,ye.sortKey??null);for(let ye=0;ye<Pe.length;ye++){let De=Pe[ye];if(!Be.includes(De.id))continue;let at=ye>0?Pe[ye-1].id:null,Ot=ye<Pe.length-1?Pe[ye+1].id:null,zt=at?Ke.get(at)??null:null,Yt=Ot?Ke.get(Ot)??null:null,Pt=Ba(zt,Yt);Ke.set(De.id,Pt),s(De.id,b,at,Ot,Pt)}return}if(s&&te){let We=B.findIndex(Je=>Je.id===te.taskId),oe=null,Te=null;te.position==="before"?(Te=te.taskId,oe=We>0?B[We-1].id:null):(oe=te.taskId,Te=We<B.length-1?B[We+1].id:null),s(Ie,b,oe,Te)}else l(Ie,b)}}function ve(){k.current=null,c(null),w(null),z.current=null,y(null),_.current=[],U([])}let W=(d==null?void 0:d.size)??0;return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("main",{id:"kanban-board",ref:H,className:"flex-1 flex overflow-x-auto overflow-y-hidden",style:{padding:"16px 20px",gap:16},onDragEnd:ve,children:ce.map(D=>{let b=r?[]:re.filter(te=>te.status===D.id).sort(Wr),B=D.id==="done"?[...b].reverse():b;return(0,pe.jsx)(qv,{col:D,tasks:B,isLoading:r,liveActivities:o,isDragOver:v===D.id&&!C,onDragOver:te=>Z(te,D.id),onDrop:te=>be(te,D.id,b),onDragLeave:te=>{let Ie=te.relatedTarget;Ie&&te.currentTarget.contains(Ie)||(w(null),z.current=null,y(null))},onStatusChange:(te,Ie)=>l(te,Ie),onAddTask:()=>n(null,"details",D.id),onOpenTask:n,onDragStart:Se,onCardDragOver:ke,cardDropTarget:C,selectMode:i,selectedTaskIds:d,onToggleSelect:f,onEnterSelectMode:m,agentStatuses:I===!0?g:void 0,experimentalAgents:I,multiDragIds:N},D.id)})}),I===!0&&i&&W>0&&(0,pe.jsxs)("div",{style:{position:"fixed",bottom:14,left:"50%",transform:"translateX(-50%)",zIndex:45,display:"flex",alignItems:"center",gap:10,background:"var(--p-surface)",border:"1px solid var(--p-border-s)",borderRadius:10,padding:"8px 14px",boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"},children:[(0,pe.jsxs)("span",{style:{fontSize:12,color:"var(--p-text-m)",fontWeight:500},children:[(0,pe.jsx)("strong",{style:{color:"var(--p-text)"},children:W})," task",W!==1?"s":""," selected"]}),(0,pe.jsx)("div",{style:{width:1,height:16,background:"var(--p-border)"}}),(0,pe.jsxs)("button",{onClick:()=>L==null?void 0:L(Array.from(d)),style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 12px",borderRadius:6,border:"1px solid var(--p-purple)",background:"var(--p-purple)",color:"#fff",fontSize:11,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:D=>{D.currentTarget.style.background="#9333ea"},onMouseLeave:D=>{D.currentTarget.style.background="var(--p-purple)"},children:[(0,pe.jsx)(Kr,{style:{width:10,height:10}}),"Run Agents (",W,")"]}),(0,pe.jsxs)("button",{onClick:x,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",borderRadius:6,border:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-m)",fontSize:11,cursor:"pointer",transition:"all .12s"},onMouseEnter:D=>{D.currentTarget.style.borderColor="var(--p-border-s)",D.currentTarget.style.color="var(--p-text)"},onMouseLeave:D=>{D.currentTarget.style.borderColor="var(--p-border)",D.currentTarget.style.color="var(--p-text-m)"},children:[(0,pe.jsx)(Xe,{style:{width:10,height:10}}),"Clear"]})]}),(0,pe.jsx)("div",{id:"kanban-scroll-track",style:{position:"fixed",bottom:0,left:0,right:0,height:6,background:"transparent",zIndex:40,pointerEvents:"none"},children:(0,pe.jsx)("div",{id:"kanban-scroll-thumb",ref:p,style:{position:"absolute",top:1,height:4,borderRadius:2,background:"var(--p-border-t)",cursor:"pointer",pointerEvents:"auto",transition:"background 0.15s",opacity:0},onMouseEnter:D=>{D.currentTarget.style.background="var(--p-text-g)"},onMouseLeave:D=>{D.currentTarget.classList.contains("dragging")||(D.currentTarget.style.background="var(--p-border-t)")}})})]})}function qv({col:e,tasks:t,isLoading:a,liveActivities:r,isDragOver:o,onDragOver:n,onDrop:l,onDragLeave:s,onStatusChange:i,onAddTask:d,onOpenTask:f,onDragStart:m,onCardDragOver:g,cardDropTarget:L,selectMode:x,selectedTaskIds:I,onToggleSelect:H,onEnterSelectMode:p,agentStatuses:u,experimentalAgents:c,multiDragIds:v}){let[w,C]=jt.default.useState(!1),y=e.id==="in-progress"?"sd-inprogress":`sd-${e.id}`,k=20,z=e.id==="done",N=z&&t.length>k?t.length-k:0,U=z?t.slice(0,k):t;return(0,pe.jsxs)("section",{className:"board-column","data-column-id":e.id,style:{outline:o?`2px dashed ${e.color}66`:void 0,outlineOffset:-2,borderRadius:8},onDragOver:n,onDragLeave:s,onDrop:l,children:[(0,pe.jsxs)("div",{className:"column-header",style:{background:e.accent,borderColor:`color-mix(in srgb, ${e.color} 30%, transparent)`},children:[(0,pe.jsx)("div",{className:`status-dot ${y}`}),(0,pe.jsxs)("span",{style:{fontSize:12,fontWeight:600,color:e.id==="done"?`${e.color}b3`:e.color},children:[e.label,a?"":` \\xB7 ${t.length}`]}),(0,pe.jsx)("span",{style:{marginLeft:"auto"}}),(0,pe.jsx)("button",{type:"button",title:`Add task to ${e.label}`,style:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:"none",background:"transparent",color:w?e.color:"var(--p-text-g)",cursor:"pointer",transition:"color .15s",padding:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),onClick:d,children:(0,pe.jsx)(tl,{style:{width:14,height:14}})})]}),(0,pe.jsx)("div",{className:"column-scroll","data-status":e.id,children:a?Array.from({length:Uv}).map((_,re)=>(0,pe.jsx)(Hv,{},re)):t.length===0?(0,pe.jsxs)("div",{style:{border:"1px dashed var(--p-border-t)",borderRadius:8,padding:"10px 8px",fontSize:11,color:"var(--p-text-f)",textAlign:"center"},children:["No tasks in ",e.label.toLowerCase(),"."]}):(0,pe.jsxs)(pe.Fragment,{children:[U.map(_=>(0,pe.jsxs)("div",{style:{position:"relative"},onDragOver:re=>g(re,_.id),children:[(L==null?void 0:L.taskId)===_.id&&L.position==="before"&&(0,pe.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}}),(0,pe.jsx)(zd,{task:_,col:e,liveActivity:r==null?void 0:r.get(_.id),onOpen:f,onDragStart:m,selectMode:x,selected:I==null?void 0:I.has(_.id),onToggleSelect:H,onEnterSelectMode:p,agentStatus:u==null?void 0:u.get(_.id),experimentalAgents:c,multiDragCount:v&&v.length>1&&v[0]===_.id?v.length:void 0}),(L==null?void 0:L.taskId)===_.id&&L.position==="after"&&(0,pe.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}})]},_.id)),N>0&&(0,pe.jsxs)("div",{style:{margin:"4px 0 2px",padding:"6px 8px",borderRadius:6,border:"1px dashed var(--p-border-t)",fontSize:11,color:"var(--p-text-g)",textAlign:"center",lineHeight:1.4},children:["+",N," older ",N===1?"task":"tasks"," not shown"]})]})})]})}var Zr=E(Oe(),1);var me=E(j(),1),pg={backlog:{text:"var(--p-text-m)",bg:"color-mix(in srgb, var(--p-text-g) 14%, transparent)",border:"color-mix(in srgb, var(--p-text-g) 30%, transparent)"},todo:{text:"var(--p-amber-300)",bg:"color-mix(in srgb, var(--p-amber) 14%, transparent)",border:"color-mix(in srgb, var(--p-amber) 30%, transparent)"},"in-progress":{text:"var(--p-blue-200)",bg:"color-mix(in srgb, var(--p-blue) 14%, transparent)",border:"color-mix(in srgb, var(--p-blue) 30%, transparent)"},review:{text:"var(--p-purple-300)",bg:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"color-mix(in srgb, var(--p-purple) 30%, transparent)"},done:{text:"var(--p-green-300)",bg:"color-mix(in srgb, var(--p-green) 12%, transparent)",border:"color-mix(in srgb, var(--p-green) 30%, transparent)"}},_v=lg,mg={Critical:"var(--p-red)",High:"var(--p-amber-300)",Medium:"var(--p-text-m)",Low:"var(--p-text-f)"},Hd=["in-progress","review","todo","backlog","done"];function Wv(){return(0,me.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"18px 1fr auto auto",alignItems:"center",gap:10,padding:"6px 10px",borderRadius:8,border:"1px solid var(--p-border-t)",background:"var(--p-bg-2)",animation:"skeleton-pulse 1.5s ease-in-out infinite"},children:[(0,me.jsx)("div",{style:{width:14,height:14,borderRadius:3,background:"var(--p-border-s)"}}),(0,me.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"60%"}}),(0,me.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:44}}),(0,me.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})}function qd({tasks:e,searchQuery:t,isLoading:a,liveActivities:r,onOpenPanel:o,onAddTask:n,onDrop:l,experimentalAgents:s}){let[i,d]=Zr.default.useState(null),[f,m]=Zr.default.useState(null),[g,L]=Zr.default.useState(null),[x,I]=Zr.default.useState({backlog:!1,todo:!1,"in-progress":!1,review:!1,done:!1}),H=t?e.filter(u=>(u.title??"").toLowerCase().includes(t.toLowerCase())||(u.description??"").toLowerCase().includes(t.toLowerCase())):e,p=Zr.default.useMemo(()=>{let u=new Map;for(let c of Hd)u.set(c,[]);for(let c of H)(u.get(c.status)??[]).push(c);return u},[H]);return(0,me.jsxs)("div",{id:"kanban-list-view",style:{flex:1,overflowY:"auto",padding:"16px 24px",minHeight:0},children:[a?Hd.slice(0,3).map(u=>{let c=pg[u];return(0,me.jsxs)("div",{style:{marginBottom:24},children:[(0,me.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,me.jsx)("div",{style:{width:18,height:18,borderRadius:5,background:"var(--p-border-s)",animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,me.jsx)("div",{style:{height:18,borderRadius:6,background:c.bg,border:`1px solid ${c.border}`,width:72,animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,me.jsx)("div",{style:{height:14,borderRadius:4,background:"var(--p-border-s)",width:16,animation:"skeleton-pulse 1.5s ease-in-out infinite"}})]}),(0,me.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:Array.from({length:3}).map((v,w)=>(0,me.jsx)(Wv,{},w))})]},u)}):Hd.map(u=>{let c=p.get(u)??[];if(c.length===0)return null;let v=pg[u];return(0,me.jsxs)("div",{style:{marginBottom:24},children:[(0,me.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8,padding:"4px 6px",borderRadius:6,transition:"background .1s",background:f===u?v.bg:"transparent",outline:f===u?`1px dashed ${v.border}`:void 0},onDragOver:w=>{w.preventDefault(),m(u)},onDragLeave:()=>m(null),onDrop:w=>{w.preventDefault(),m(null),L(null),i&&l(i,u),d(null)},children:[(0,me.jsx)("button",{type:"button",title:x[u]?"Expand":"Collapse",onClick:w=>{w.stopPropagation(),I(C=>({...C,[u]:!C[u]}))},style:{width:18,height:18,borderRadius:5,border:"1px solid var(--p-border-t)",background:"var(--p-surface)",color:"var(--p-text-m)",fontSize:10,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:x[u]?"+":"\\u2212"}),(0,me.jsx)("span",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"2px 8px",borderRadius:6,background:v.bg,border:`1px solid ${v.border}`,color:v.text},children:u}),(0,me.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:c.length}),(0,me.jsx)("button",{type:"button",title:`Add task to ${u}`,onClick:w=>{w.stopPropagation(),n(u)},style:{marginLeft:"auto",width:22,height:22,borderRadius:7,border:`1px solid ${v.border}`,background:v.bg,color:v.text,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:600},children:"+"})]}),(0,me.jsx)("div",{style:{display:x[u]?"none":"flex",flexDirection:"column",gap:2},children:c.map(w=>(0,me.jsx)($v,{task:w,liveActivity:r==null?void 0:r.get(w.id),onOpen:o,onDragStart:C=>d(C),dragOver:g===w.id,onDragOver:()=>L(w.id),onDragLeave:()=>L(C=>C===w.id?null:C),onDropToStatus:()=>{i&&l(i,w.status),d(null),L(null)},experimentalAgents:s},w.id))})]},u)}),!a&&H.length===0&&(0,me.jsx)("div",{style:{textAlign:"center",color:"var(--p-text-g)",fontSize:13,marginTop:60},children:"No tasks found"})]})}function $v({task:e,liveActivity:t,onOpen:a,onDragStart:r,dragOver:o,onDragOver:n,onDragLeave:l,onDropToStatus:s,experimentalAgents:i}){let[d,f]=Zr.default.useState(!1),m=_v[e.type??"Task"]??"\\u2611",g=e.commentCount??0,L=e.fileCount??0;return(0,me.jsxs)("div",{"data-task-id":e.id,"data-proto-id":"list-row",draggable:!0,style:{display:"grid",gridTemplateColumns:"18px 1fr auto auto auto",alignItems:"center",gap:10,padding:"6px 10px",borderRadius:8,background:o?"color-mix(in srgb, var(--p-blue) 10%, transparent)":d?"var(--p-hover)":"transparent",border:`1px solid ${o?"color-mix(in srgb, var(--p-blue) 40%, transparent)":d?"var(--p-border)":"transparent"}`,cursor:"grab",transition:"background .1s,border-color .1s",userSelect:"none"},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:()=>a(e),onDragStart:x=>{x.dataTransfer.effectAllowed="move",r(e.id),x.currentTarget.style.opacity="0.4"},onDragEnd:x=>{x.currentTarget.style.opacity="1"},onDragOver:x=>{x.preventDefault(),n()},onDragLeave:l,onDrop:x=>{x.preventDefault(),s()},children:[(0,me.jsx)("span",{style:{fontSize:12,textAlign:"center",flexShrink:0},children:m}),(0,me.jsxs)("div",{style:{minWidth:0},children:[(0,me.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,me.jsx)("span",{style:{fontSize:13,fontWeight:500,color:"var(--p-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),e.priority&&mg[e.priority]&&(0,me.jsx)(Xn,{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:mg[e.priority]}}),e.component&&(0,me.jsx)("span",{style:{fontSize:10,padding:"1px 6px",borderRadius:10,background:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 30%, transparent)",color:"var(--p-purple-300)",flexShrink:0,fontFamily:"monospace"},children:e.component})]}),e.description&&(0,me.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:1,maxWidth:"100%"},children:e.description.replace(/\\s+/g," ").trim()})]}),(0,me.jsxs)("button",{title:g>0?`${g} comment(s)`:"Add comment",style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:g>0?"var(--p-text-m)":"var(--p-border-t)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:x=>{x.stopPropagation(),a(e,"comments")},children:[(0,me.jsx)(Vr,{className:"w-3 h-3"}),g>0&&(0,me.jsx)("span",{children:g})]}),L>0&&(0,me.jsxs)("button",{title:`${L} file(s)`,style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:"var(--p-blue-300)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:x=>{x.stopPropagation(),a(e,"files")},children:[(0,me.jsx)(Gr,{className:"w-3 h-3"}),(0,me.jsx)("span",{children:L})]}),t&&(0,me.jsx)(Nd,{activity:t})]})}var $o=E(Oe(),1);var hr=E(j(),1);function gg({size:e=32,style:t,className:a}){return(0,hr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:a,"aria-label":"Vibeflow",children:[(0,hr.jsx)("rect",{width:"32",height:"32",rx:"7",fill:"#2563eb"}),(0,hr.jsx)("rect",{x:"7",y:"13",width:"3.5",height:"10",rx:"1.5",fill:"white",opacity:"0.75"}),(0,hr.jsx)("rect",{x:"12.25",y:"8.5",width:"3.5",height:"15",rx:"1.5",fill:"white"}),(0,hr.jsx)("rect",{x:"17.5",y:"14.5",width:"3.5",height:"8",rx:"1.5",fill:"white",opacity:"0.75"}),(0,hr.jsx)("rect",{x:"22.5",y:"11",width:"2.5",height:"11",rx:"1.25",fill:"white",opacity:"0.85"})]})}var Js=E(j(),1);function il({id:e,title:t,onClick:a,label:r,icon:o,variant:n="neutral"}){return(0,Js.jsxs)("button",{id:e,onClick:a,title:t,className:`h-7 inline-flex items-center justify-center rounded-lg border transition-colors ${n==="accent"?"border-violet-700/50 bg-violet-900/30 text-violet-300 hover:bg-violet-800/30":"border-slate-700/60 bg-slate-800 text-slate-400 hover:bg-slate-700/50 hover:text-slate-200"} ${r?"gap-1.5 px-3 text-xs font-medium":"w-7"}`,type:"button",children:[o,r&&(0,Js.jsx)("span",{children:r})]})}var K=E(j(),1);function _d({projectName:e,projectIcon:t,missingProjectIconStyle:a="initial",wsConnected:r,port:o,searchQuery:n,premiumUsage:l,isLoading:s,filterTags:i,allTags:d,onToggleTag:f,backHref:m,backLabel:g,onSearchChange:L,onSettings:x,extraActions:I,taskSummary:H,agentRuns:p,selectMode:u,selectedCount:c,agentQueueCount:v,onOpenAgentQueue:w,experimentalAgents:C}){let[y,k]=$o.default.useState(!1),[z,N]=$o.default.useState(0),U=$o.default.useRef(null),_=$o.default.useRef(null),re=n.match(/(?:^|\\s)#(\\S*)$/),ce=re?re[1]:null,Se=i??[],Z=(d??[]).filter(B=>!Se.includes(B)),ke=ce!==null?Z.filter(B=>B.toLowerCase().includes(ce.toLowerCase())):[];$o.default.useEffect(()=>{N(0)},[ke.length]);function be(B){var Ie;let te=n.replace(/\\s*#\\S*$/,"");L(te),f==null||f(B),(Ie=U.current)==null||Ie.focus()}function ve(B){if(B.key==="Backspace"&&n===""&&Se.length>0){B.preventDefault(),f==null||f(Se[Se.length-1]);return}if(!(ce===null||ke.length===0)){if(B.key==="ArrowDown")B.preventDefault(),N(te=>Math.min(te+1,ke.length-1));else if(B.key==="ArrowUp")B.preventDefault(),N(te=>Math.max(te-1,0));else if(B.key==="Enter")B.preventDefault(),ke[z]&&be(ke[z]);else if(B.key==="Escape"){let te=n.replace(/\\s*#\\S*$/,"");L(te)}}}let W=(t??"").trim(),D=e?e.charAt(0).toUpperCase()+e.slice(1):"Vibeflow Board",b=n||Se.length>0;return(0,K.jsxs)("header",{className:"px-5 py-3 flex items-center gap-3 border-b border-slate-800/60 flex-shrink-0",children:[(0,K.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[m&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("a",{id:"header-back-link",href:m,className:"text-xs text-slate-400 hover:text-slate-200 transition-colors no-underline",style:{textDecoration:"none",fontWeight:500},children:g??"Back"}),(0,K.jsx)(Kn,{className:"w-3 h-3 text-slate-600 flex-shrink-0"})]}),(0,K.jsx)("div",{className:"flex-shrink-0",style:{width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center",...W?{fontSize:20}:void 0},children:W||(a==="vibeflow"?(0,K.jsx)(gg,{size:32}):(0,K.jsx)("div",{style:{width:32,height:32,borderRadius:8,flexShrink:0,background:"linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%)",border:"1px solid rgba(37,99,235,0.3)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:"#93c5fd",letterSpacing:"-0.01em"},title:D,children:D.charAt(0).toUpperCase()}))}),(0,K.jsxs)("div",{children:[(0,K.jsxs)("div",{className:"flex items-center gap-2",children:[(0,K.jsx)("h1",{id:"header-project-name",className:"text-sm font-semibold text-white leading-tight",children:D}),r&&(0,K.jsxs)("div",{id:"header-live-pill",className:"flex items-center gap-1.5 rounded-full px-2 py-0.5",style:{background:"color-mix(in srgb, var(--p-green) 30%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 28%, transparent)"},children:[(0,K.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-green-400",style:{animation:"pulse-live 2s ease-in-out infinite"}}),(0,K.jsxs)("span",{className:"text-[10px] font-medium text-green-400",children:["live \\xB7 :",o]})]})]}),(0,K.jsxs)("p",{className:"text-[10px] text-slate-500 font-mono mt-0.5",children:[H,s&&(0,K.jsx)("span",{id:"header-loading-indicator",className:"inline-block ml-1.5 w-1 h-1 rounded-full bg-blue-400",style:{animation:"pulse-live 1.4s ease-in-out infinite",verticalAlign:"middle"}})]})]})]}),(0,K.jsx)("div",{className:"flex-1 flex justify-center px-4",children:(0,K.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,K.jsxs)("div",{className:"flex flex-wrap items-center gap-1 w-full min-h-[30px] rounded-lg bg-slate-800 border border-slate-700/60 px-2 py-1 cursor-text transition-colors focus-within:border-blue-500",onClick:()=>{var B;return(B=U.current)==null?void 0:B.focus()},children:[(0,K.jsx)(jr,{className:"w-3.5 h-3.5 text-slate-500 flex-shrink-0 mr-0.5"}),Se.map(B=>{let{bg:te,text:Ie,border:Be}=ua(B);return(0,K.jsxs)("span",{style:{background:te,color:Ie,border:`1px solid ${Be}`,display:"inline-flex",alignItems:"center",gap:3,padding:"1px 7px",borderRadius:100,fontSize:11,fontWeight:500,whiteSpace:"nowrap"},children:[B,(0,K.jsx)("button",{onClick:We=>{We.stopPropagation(),f==null||f(B)},style:{background:"none",border:"none",cursor:"pointer",padding:0,lineHeight:1,color:"inherit",opacity:.7,display:"flex"},children:(0,K.jsx)(Xe,{style:{width:9,height:9}})})]},B)}),(0,K.jsx)("input",{ref:U,id:"global-search",type:"text",placeholder:Se.length===0?"Search\\u2026 or type #tag":"#tag or search\\u2026",value:n,onChange:B=>L(B.target.value),onKeyDown:ve,className:"flex-1 min-w-[100px] bg-transparent border-none outline-none text-xs text-slate-200 placeholder-slate-500",autoComplete:"off",spellCheck:!1}),b&&(0,K.jsx)("button",{id:"global-search-clear",onClick:()=>{L(""),Se.forEach(B=>f==null?void 0:f(B))},className:"text-slate-500 hover:text-slate-300 transition-colors flex-shrink-0 flex",title:"Clear search and tag filters",children:(0,K.jsx)(Xe,{className:"w-3.5 h-3.5"})})]}),ce!==null&&ke.length>0&&(0,K.jsxs)("div",{ref:_,style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.3)",zIndex:50,overflow:"hidden"},children:[(0,K.jsx)("div",{style:{padding:"5px 10px",fontSize:10,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--p-text-g)",borderBottom:"1px solid var(--p-border)"},children:"Tags"}),ke.map((B,te)=>{let{bg:Ie,text:Be,border:We}=ua(B);return(0,K.jsxs)("button",{onMouseDown:oe=>{oe.preventDefault(),be(B)},onMouseEnter:()=>N(te),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:8,padding:"7px 12px",background:te===z?"var(--p-hover)":"none",border:"none",cursor:"pointer"},children:[(0,K.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:Be,flexShrink:0}}),(0,K.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:B}),(0,K.jsx)("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:100,fontSize:10,background:Ie,color:Be,border:`1px solid ${We}`},children:"tag"})]},B)}),(0,K.jsx)("div",{style:{padding:"5px 10px",fontSize:10,color:"var(--p-text-g)",borderTop:"1px solid var(--p-border)"},children:"\\u2191\\u2193 navigate \\xB7 Enter select \\xB7 Esc close"})]})]})}),(0,K.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[I,C===!0&&p&&p.length>0&&(0,K.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:10,fontWeight:600,border:"1px solid color-mix(in srgb, var(--p-blue) 40%, transparent)",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)",flexShrink:0},title:`${p.filter(B=>B.status==="running").length} running \\xB7 ${p.filter(B=>B.status==="queued").length} queued`,children:[(0,K.jsx)("span",{className:"spinner",style:{width:9,height:9,borderWidth:1.5}}),p.filter(B=>B.status==="running").length," running",p.filter(B=>B.status==="queued").length>0&&(0,K.jsxs)(K.Fragment,{children:[" \\xB7 ",p.filter(B=>B.status==="queued").length," queued"]})]}),C===!0&&w&&v!==void 0&&v>0&&(0,K.jsx)(il,{id:"btn-agent-queue",title:"Agent Queue",onClick:w,label:`\\u{1F916} Queue ${v}`,icon:(0,K.jsx)(Kt,{className:"w-3.5 h-3.5"})}),u&&(0,K.jsxs)("span",{id:"select-mode-indicator",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"2px 10px",borderRadius:999,fontSize:11,fontWeight:500,border:"1px solid color-mix(in srgb, var(--p-blue) 35%, transparent)",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)",flexShrink:0},children:[(0,K.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--p-blue)",animation:"pulse-live 1.5s ease-in-out infinite"}}),"select",c!=null&&c>0?` \\xB7 ${c}`:"",(0,K.jsx)("kbd",{style:{fontSize:9,fontFamily:"monospace",fontWeight:600,background:"color-mix(in srgb, var(--p-blue) 18%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 30%, transparent)",borderRadius:3,padding:"0 4px",lineHeight:"16px",color:"var(--p-blue-300)",letterSpacing:"0.02em"},children:"esc"})]}),(0,K.jsx)(il,{id:"header-shortcuts-hint",title:"Click to see keyboard shortcuts",onClick:()=>k(!0),label:"? shortcuts"}),(0,K.jsx)(il,{id:"btn-settings",title:"Settings",onClick:x,icon:(0,K.jsx)(Xr,{className:"w-3.5 h-3.5"})})]}),y&&(0,K.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(2,12,27,0.80)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",zIndex:200,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>k(!1),children:(0,K.jsxs)("div",{id:"shortcuts-modal",style:{background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:14,padding:"20px 24px",minWidth:320,maxWidth:420,boxShadow:"var(--p-shadow-lg)"},onClick:B=>B.stopPropagation(),children:[(0,K.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,K.jsx)("span",{style:{fontSize:13,fontWeight:700,color:"var(--p-text)"},children:"Keyboard Shortcuts"}),(0,K.jsx)("button",{onClick:()=>k(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--p-text-f)",padding:2},children:(0,K.jsx)(Xe,{style:{width:14,height:14}})})]}),(0,K.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[["Alt+N","Open new task panel"],["Esc","Close panel / modal"],["?","Show this shortcuts overlay"],["Alt+F","Focus task search"]].map(([B,te])=>(0,K.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,K.jsx)("kbd",{style:{fontSize:10,fontFamily:"monospace",background:"var(--p-surface)",border:"1px solid var(--p-border-t)",borderRadius:4,padding:"2px 7px",color:"var(--p-text-sub)",flexShrink:0},children:B}),(0,K.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:te})]},B))})]})})]})}var Y=E(Oe(),1);var ei=E(Oe(),1);var La=E(j(),1);function ti({id:e,value:t,onChange:a,disabled:r}){let[o,n]=ei.default.useState(!1),l=ei.default.useRef(null),s=Yr.find(i=>i.value===t)??Yr[0];return ei.default.useEffect(()=>{let i=d=>{var f;(f=l.current)!=null&&f.contains(d.target)||n(!1)};return document.addEventListener("click",i),()=>document.removeEventListener("click",i)},[]),(0,La.jsxs)("div",{id:e,ref:l,style:{position:"relative",display:"inline-block"},children:[(0,La.jsxs)("button",{type:"button",title:s==null?void 0:s.tooltip,onClick:i=>{i.preventDefault(),r||n(d=>!d)},style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:6,border:"1px solid var(--p-border, rgba(255,255,255,0.08))",background:"var(--p-hover, rgba(255,255,255,0.05))",color:"var(--p-text-m, rgba(255,255,255,0.7))",fontSize:12,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,La.jsx)("span",{style:{fontSize:13},children:s==null?void 0:s.icon}),(0,La.jsx)("span",{children:s==null?void 0:s.label})]}),o&&(0,La.jsx)("div",{style:{position:"absolute",top:"100%",left:0,marginTop:4,background:"var(--p-card, #1e293b)",border:"1px solid var(--p-border-s, rgba(255,255,255,0.12))",borderRadius:8,padding:"4px 0",zIndex:200,minWidth:140,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:Yr.map(i=>(0,La.jsxs)("button",{type:"button",title:i.tooltip,onClick:()=>{a(i.value),n(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",border:"none",background:i.value===t?"var(--p-hover, rgba(255,255,255,0.06))":"transparent",color:i.value===t?"var(--p-text, #fff)":"var(--p-text-f, rgba(255,255,255,0.55))",fontSize:12,cursor:"pointer",textAlign:"left"},children:[(0,La.jsx)("span",{style:{fontSize:14,lineHeight:1},children:i.icon}),(0,La.jsx)("span",{children:i.label})]},i.value))})]})}var yt=E(Oe(),1);var ul=E(Oe(),1);var xr=E(j(),1);function vr({markdown:e,className:t,style:a}){let r=ul.default.useRef(null),o=ul.default.useRef({}),[n,l]=ul.default.useState(null);return ul.default.useEffect(()=>{let s=r.current;if(!s)return;function i(){l(null)}async function d(m){let g=m.target,L=g==null?void 0:g.closest("a[data-task-ref]");if(!L){i();return}m.preventDefault();let x=L.getAttribute("data-task-ref");if(!x)return;let I=L.getBoundingClientRect(),H=o.current[x];if(H){l({id:x,title:H.title,status:H.status,x:I.left,y:I.bottom+6});return}try{let u=await(await fetch(`/api/tasks/${x}`)).json(),c={title:u.title??`Task ${x}`,status:u.status??"unknown"};o.current[x]=c,l({id:x,title:c.title,status:c.status,x:I.left,y:I.bottom+6})}catch{l({id:x,title:`Task ${x}`,status:"unknown",x:I.left,y:I.bottom+6})}}function f(m){var x,I;let g=(I=(x=m.target)==null?void 0:x.closest)==null?void 0:I.call(x,"a[data-task-ref]");if(!g)return;let L=g.getAttribute("data-task-ref");L&&window.dispatchEvent(new CustomEvent("vibeflow-task-ref-click",{detail:{refId:L}}))}return s.addEventListener("mouseover",d),s.addEventListener("mouseleave",i),s.addEventListener("click",f),()=>{s.removeEventListener("mouseover",d),s.removeEventListener("mouseleave",i),s.removeEventListener("click",f)}},[]),(0,xr.jsxs)("div",{style:{position:"relative"},children:[(0,xr.jsx)("div",{ref:r,className:t,style:a,dangerouslySetInnerHTML:{__html:Gs(e)}}),n&&(0,xr.jsxs)("div",{style:{position:"fixed",left:n.x,top:n.y,background:"#0f172a",border:"1px solid rgba(59,130,246,0.4)",color:"#e2e8f0",borderRadius:8,padding:"8px 10px",fontSize:11,boxShadow:"0 10px 24px rgba(2,6,23,0.55)",zIndex:60,pointerEvents:"none",minWidth:180},children:[(0,xr.jsxs)("div",{style:{color:"#60a5fa",fontFamily:"Menlo,monospace",marginBottom:3},children:["#",n.id]}),(0,xr.jsx)("div",{style:{fontWeight:600,marginBottom:3},children:n.title}),(0,xr.jsxs)("div",{style:{color:"#94a3b8"},children:["status: ",n.status]})]})]})}var dl=E(Oe(),1),hg=E(j(),1),Vo=dl.default.forwardRef(function({value:t,onChange:a,baseRows:r=4,maxRows:o,style:n,...l},s){let i=dl.default.useRef(null),d=o??r*2,f=dl.default.useCallback(()=>{let m=i.current;if(!m)return;m.style.height="auto";let g=window.getComputedStyle(m),L=Number.parseFloat(g.lineHeight||"0")||18,x=Number.parseFloat(g.paddingTop||"0")+Number.parseFloat(g.paddingBottom||"0"),I=Number.parseFloat(g.borderTopWidth||"0")+Number.parseFloat(g.borderBottomWidth||"0"),H=r*L+x+I,p=d*L+x+I,u=Math.max(H,Math.min(m.scrollHeight,p));m.style.height=`${u}px`,m.style.overflowY=m.scrollHeight>p?"auto":"hidden"},[r,d]);return dl.default.useLayoutEffect(()=>{f()},[t,f]),(0,hg.jsx)("textarea",{...l,ref:m=>{i.current=m,typeof s=="function"?s(m):s&&(s.current=m)},rows:r,value:t,onChange:m=>a(m.target.value),style:{...n,resize:"none"}})});var yg=E(Oe(),1);var xg=E(Oe(),1),vg=E(_r(),1),za=E(j(),1);function Jr({open:e,onClose:t,icon:a,title:r,headerActions:o,width:n,maxHeight:l,id:s,children:i,footer:d,boxStyle:f,onKeyDown:m}){if(xg.default.useEffect(()=>{if(!e)return;function x(I){I.key==="Escape"&&t(),m==null||m(I)}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[e,t,m]),!e)return null;let g=!!(a||r||o),L=(0,za.jsx)("div",{id:s,className:"modal-backdrop",onClick:x=>{x.target===x.currentTarget&&t()},onMouseDown:x=>x.stopPropagation(),children:(0,za.jsxs)("div",{className:"modal-box",style:{width:n??"min(420px, 95vw)",maxHeight:l,...f},children:[g&&(0,za.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--p-border)",flexShrink:0},children:[a&&(0,za.jsx)("span",{style:{flexShrink:0,display:"flex",alignItems:"center"},children:a}),r&&(0,za.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1,minWidth:0},children:r}),o&&(0,za.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,marginLeft:"auto"},children:o})]}),i,d&&(0,za.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8,padding:"10px 18px",borderTop:"1px solid var(--p-border)",flexShrink:0},children:d})]})});return(0,vg.createPortal)(L,document.body)}var Xt=E(j(),1);function Sa({open:e,message:t,title:a="Confirm",confirmLabel:r="Delete",cancelLabel:o="Cancel",loading:n,error:l,onConfirm:s,onCancel:i}){let d=yg.default.useCallback(f=>{f.key==="Enter"&&s()},[s]);return(0,Xt.jsx)(Jr,{open:e,onClose:i,id:"confirm-modal",width:"min(380px, 95vw)",icon:(0,Xt.jsx)(mr,{style:{width:20,height:20,color:"#f87171"}}),title:a,onKeyDown:d,footer:(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)("button",{id:"confirm-modal-cancel",onClick:i,disabled:n,style:{padding:"7px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer",transition:"background 0.15s"},children:o}),(0,Xt.jsx)("button",{id:"confirm-modal-confirm",onClick:s,disabled:n,style:{padding:"7px 16px",borderRadius:8,background:"#dc2626",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:n?"wait":"pointer",opacity:n?.6:1,transition:"background 0.15s"},children:n?"Deleting\\u2026":r})]}),children:(0,Xt.jsxs)("div",{style:{padding:"16px 18px"},children:[typeof t=="string"?(0,Xt.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:t}):t,l&&(0,Xt.jsx)("p",{style:{margin:"8px 0 0",fontSize:12,color:"var(--p-red)"},children:l})]})})}var Ze=E(j(),1);function Lg(e){return e.linkedPath?"\\u{1F517}":/\\.(png|jpe?g|gif|webp|svg)$/i.test(e.name)?"\\u{1F5BC}\\uFE0F":/\\.html?$/i.test(e.name)?"\\u{1F310}":/\\.md$/i.test(e.name)||/\\.pdf$/i.test(e.name)?"\\u{1F4C4}":"\\u{1F4CE}"}function Vv(e){return/\\.(png|jpe?g|gif|webp|svg|html?)$/i.test(e.name)}function Gv(e){return/\\.html?$/i.test(e.name)}function ai({file:e,url:t,variant:a,onPreview:r,onDelete:o}){let n=Vv(e),l=Gv(e);function s(){r?r(e,t):window.open(t,"_blank")}return a==="compact"?(0,Ze.jsxs)("div",{className:"group/file-compact",style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:8,background:"var(--p-card)",border:"1px solid var(--p-border)",position:"relative"},children:[(0,Ze.jsx)("span",{style:{fontSize:14,flexShrink:0},children:Lg(e)}),(0,Ze.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Ze.jsx)("button",{onClick:s,style:{fontSize:12,color:"var(--p-blue-300)",background:"none",border:"none",cursor:"pointer",padding:0,textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},title:e.name,children:e.name})}),(0,Ze.jsx)("span",{className:"file-compact-ts",style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:e.createdAt?Tt(e.createdAt):"attached"}),(0,Ze.jsxs)("div",{className:"file-compact-actions",style:{position:"absolute",right:6,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s",background:"var(--p-card)",paddingLeft:8},children:[n&&(0,Ze.jsx)("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:l?"Open in new tab":"Preview",children:l?"\\u2197":"\\u{1F441}"}),(0,Ze.jsx)("a",{href:t,download:e.name,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)",textDecoration:"none"},title:"Download",onClick:i=>i.stopPropagation(),children:"\\u2193"}),o&&(0,Ze.jsx)("button",{onClick:()=>void o(e),style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:"Delete",children:"\\u2715"})]})]}):(0,Ze.jsxs)("div",{className:"group/file",style:{display:"flex",alignItems:"center",gap:10,padding:8,borderRadius:8,border:"1px solid var(--p-border)",transition:"background 0.15s",position:"relative"},children:[(0,Ze.jsx)("span",{style:{fontSize:18,flexShrink:0},children:Lg(e)}),(0,Ze.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ze.jsx)("p",{style:{fontSize:12,fontWeight:500,color:"var(--p-text)",margin:0,cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.name,onClick:s,children:e.name}),(0,Ze.jsx)("p",{style:{fontSize:10,color:"var(--p-text-f)",margin:0},children:e.linkedPath?`linked: ${e.linkedPath}`:Fd(e.size??0)})]}),(0,Ze.jsxs)("div",{className:"file-normal-actions",style:{display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s"},children:[n&&(0,Ze.jsx)("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:l?"Open in new tab":"Preview",children:l?"\\u2197":"\\u{1F441}"}),(0,Ze.jsx)("a",{href:t,download:e.name,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)",textDecoration:"none"},title:"Download",onClick:i=>i.stopPropagation(),children:"\\u2193"}),o&&(0,Ze.jsx)("button",{onClick:()=>void o(e),style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:"Delete",children:"\\u2715"})]})]})}var q=E(j(),1);function Sg({source:e}){return e!=="cli"?null:(0,q.jsx)("span",{title:"Via CLI (agent)",style:{fontSize:9,color:"var(--p-green-300)",background:"rgba(34,197,94,0.1)",border:"1px solid rgba(34,197,94,0.2)",borderRadius:4,padding:"0 4px",fontFamily:"monospace",lineHeight:"16px",flexShrink:0},children:">_"})}function Kv(e,t){if(e.kind==="lifecycle")return e.author??null;if(e.kind==="comment"){let a=e.comment;return a.type==="system"?null:a.author==="agent"?"\\u{1F916} Agent":a.authorName??t}return e.kind==="change"?e.actor:null}function jv(e,t){let a=[];for(let r of e){let o=Kv(r,t),n=a[a.length-1];o&&n&&n.author===o?(n.items.push(r),r.sortKey>n.newestSortKey&&(n.newestSortKey=r.sortKey),r.sortKey<n.oldestSortKey&&(n.oldestSortKey=r.sortKey)):a.push({author:o,newestSortKey:r.sortKey,oldestSortKey:r.sortKey,items:[r]})}return a}function Wd({comments:e,files:t=[],localChanges:a=[],loading:r,error:o,gitUserName:n="You",taskAuthorName:l,baseUrl:s="",taskId:i,taskCreatedAt:d,taskUpdatedAt:f,onEdit:m,onDelete:g,onDeleteFile:L,onFilePreview:x}){let I=yt.default.useRef(null),H=yt.default.useRef(null),[p,u]=yt.default.useState(null),[c,v]=yt.default.useState(""),[w,C]=yt.default.useState(null),[y,k]=yt.default.useState(null),[z,N]=yt.default.useState(()=>{try{return localStorage.getItem("vibeflow-show-updates")!=="false"}catch{return!0}}),U=yt.default.useRef(r),_=yt.default.useMemo(()=>{let Z=[];d&&Z.push({kind:"lifecycle",sortKey:d,label:"Task created",icon:"\\u2726",author:l??n}),f&&f!==d&&Z.push({kind:"lifecycle",sortKey:f,label:"Task edited",icon:"\\u270E"});let ke=e.map(W=>({kind:"comment",sortKey:W.createdAt,comment:W})),be=t.map(W=>{let D=W.url.startsWith("http")?W.url:`${s}${W.url}`;return{kind:"file",sortKey:W.createdAt??"9999",file:W,url:D}}),ve=a.map(W=>({kind:"change",sortKey:W.timestamp,field:W.field,from:W.from,to:W.to,actor:W.actor,source:W.source}));return[...Z,...ke,...be,...ve].sort((W,D)=>D.sortKey.localeCompare(W.sortKey))},[e,t,a,s,d,f]),re=yt.default.useMemo(()=>_.filter(Z=>Z.kind==="lifecycle"||Z.kind==="change").length,[_]),ce=yt.default.useMemo(()=>z?_:_.filter(Z=>Z.kind==="comment"||Z.kind==="file"),[_,z]),Se=yt.default.useMemo(()=>jv(ce,n),[ce,n]);return yt.default.useEffect(()=>{let Z=U.current&&!r;U.current=r,I.current&&Z&&requestAnimationFrame(()=>{I.current&&(I.current.scrollTop=0)})},[r]),yt.default.useEffect(()=>{p&&H.current&&(H.current.focus(),H.current.scrollIntoView({block:"nearest"}))},[p]),r?(0,q.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):o?(0,q.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):_.length===0?(0,q.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No activity yet."}):(0,q.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[re>0&&(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0 4px",flexShrink:0,borderBottom:"1px solid var(--p-border)",marginBottom:4},children:[(0,q.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",flex:1,letterSpacing:"0.04em"},children:z?"":`${re} system event${re!==1?"s":""} hidden`}),(0,q.jsx)("button",{id:"dp-toggle-updates",onClick:()=>N(Z=>{let ke=!Z;try{localStorage.setItem("vibeflow-show-updates",String(ke))}catch{}return ke}),style:{all:"unset",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:5,color:z?"var(--p-text-m)":"var(--p-text-g)",transition:"color .12s, background .12s"},title:z?"Hide system events":`Show ${re} system event${re!==1?"s":""}`,onMouseEnter:Z=>{Z.currentTarget.style.color="var(--p-text)",Z.currentTarget.style.background="var(--p-hover)"},onMouseLeave:Z=>{Z.currentTarget.style.color=z?"var(--p-text-m)":"var(--p-text-g)",Z.currentTarget.style.background="transparent"},children:z?(0,q.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,q.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,q.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,q.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})})]}),(0,q.jsx)("div",{ref:I,style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:2,minHeight:0},children:Se.map((Z,ke)=>{let be=Z.author!==null&&Z.items.length>1,ve=be,W=Z.author==="\\u{1F916} Agent";return(0,q.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[ve&&(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 0 2px",marginTop:4},children:[(0,q.jsx)("span",{style:{fontSize:11,fontWeight:600,color:W?"var(--p-purple)":"var(--p-blue-300)",flexShrink:0},children:Z.author}),(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",flexShrink:0},children:`${Tt(Z.oldestSortKey)} \\u2013 ${Tt(Z.newestSortKey)}`}),(0,q.jsxs)("span",{style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:["(",Z.items.length," activities)"]})]}),(0,q.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:be?4:8,paddingLeft:be?8:0,borderLeft:be?"1.5px solid var(--p-border)":"none",marginLeft:be?4:0},children:Z.items.map((D,b)=>Xv(D,b,ke,be,n,p,c,H,u,v,m,C,L?k:null,x))})]},`group-${ke}`)})}),(0,q.jsx)(Sa,{open:w!==null,message:"Delete this comment? This action cannot be undone.",onConfirm:()=>{w&&g(w),C(null)},onCancel:()=>C(null)}),L&&(0,q.jsx)(Sa,{open:y!==null,message:y?`Delete "${y.name}"? This action cannot be undone.`:"",onConfirm:()=>{y&&L(y),k(null)},onCancel:()=>k(null)})]})}function Xv(e,t,a,r,o,n,l,s,i,d,f,m,g,L){if(e.kind==="lifecycle")return(0,q.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-purple)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:e.icon}),(0,q.jsx)("div",{style:{flex:1,minWidth:0},children:(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)",fontStyle:"italic"},children:e.label}),!r&&(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:Tt(e.sortKey)})]})})]},`lifecycle-${e.sortKey}-${a}-${t}`);if(e.kind==="change"){let w=e.from.length>28?e.from.slice(0,28)+"\\u2026":e.from,C=e.to.length>28?e.to.slice(0,28)+"\\u2026":e.to,y=e.from.length>28||e.to.length>28;return(0,q.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-blue)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:"\\u270E"}),(0,q.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[!r&&(0,q.jsxs)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-blue-300)"},children:["\\u{1F464} ",e.actor]}),!r&&(0,q.jsx)(Sg,{source:e.source}),(0,q.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:["changed ",(0,q.jsx)("strong",{style:{color:"var(--p-text)"},children:e.field})]}),!r&&(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:Tt(e.sortKey)})]}),(0,q.jsxs)("div",{title:y?`${e.from} \\u2192 ${e.to}`:void 0,style:{marginTop:2,fontSize:11,color:"var(--p-text-g)",display:"flex",alignItems:"center",gap:4,cursor:y?"help":"default"},children:[(0,q.jsx)("span",{style:{color:"var(--p-red)",background:"rgba(239,68,68,0.1)",borderRadius:4,padding:"1px 5px",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w}),(0,q.jsx)("span",{style:{color:"var(--p-text-g)"},children:"\\u2192"}),(0,q.jsx)("span",{style:{color:"var(--p-green)",background:"rgba(34,197,94,0.1)",borderRadius:4,padding:"1px 5px",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C})]})]})]},`change-${e.sortKey}-${a}-${t}`)}if(e.kind==="file"){let{file:v,url:w}=e;return(0,q.jsx)(ai,{file:v,url:w,variant:"compact",onPreview:L?(C,y)=>L(C.name,y):void 0,onDelete:g?C=>(g(C),Promise.resolve()):void 0},`file-${v.name}-${a}-${t}`)}let x=e.comment,I=x.author==="agent",H=x.type==="system",p=x.deleted===!0,u=!!x.id&&!I&&!H&&!p&&x.isOwnComment!==!1,c=n===x.id;return H?(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"2px 0",fontSize:11,color:"var(--p-text-g)",fontStyle:"italic"},children:[(0,q.jsx)("span",{style:{opacity:.6},children:"\\u2B21"}),(0,q.jsx)("span",{children:x.text}),!r&&(0,q.jsx)("span",{style:{marginLeft:"auto",flexShrink:0,opacity:.6},children:Tt(x.createdAt)})]},x.id):(0,q.jsxs)("div",{className:"flex flex-col gap-1 group/comment",style:{paddingTop:r?2:4},children:[!r&&(0,q.jsxs)("div",{className:"flex items-center justify-between gap-1.5 text-xs mb-0.5",children:[(0,q.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,q.jsx)("span",{style:{color:p?"var(--p-text-g)":I?"var(--p-purple)":"var(--p-blue-300)"},children:I?"\\u{1F916} Agent":`\\u{1F464} ${x.authorName??o}`}),(0,q.jsx)(Sg,{source:x.source}),(0,q.jsxs)("span",{style:{color:"var(--p-text-g)"},children:[Tt(x.createdAt),!p&&x.updatedAt?" \\xB7 edited":"",p?" \\xB7 deleted":""]})]}),u&&(0,q.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,q.jsx)("button",{onClick:()=>{i(x.id),d(x.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,q.jsx)("button",{onClick:()=>m(x),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),r&&(0,q.jsxs)("div",{className:"flex items-center justify-between gap-1.5",style:{marginBottom:2},children:[(0,q.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-g)"},children:[Tt(x.createdAt),!p&&x.updatedAt?" \\xB7 edited":"",p?" \\xB7 deleted":""]}),u&&(0,q.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,q.jsx)("button",{onClick:()=>{i(x.id),d(x.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,q.jsx)("button",{onClick:()=>m(x),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),c?(0,q.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,q.jsx)(Vo,{ref:s,value:l,onChange:d,baseRows:4,maxRows:12,onKeyDown:v=>{v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),f(x,l).then(()=>i(null)))},style:{width:"100%",background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:6,padding:"8px 10px",fontSize:12,color:"var(--p-text)",outline:"none",fontFamily:"inherit",boxSizing:"border-box"}}),(0,q.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,q.jsx)("button",{onClick:()=>i(null),style:{padding:"4px 10px",background:"var(--p-surface)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-text-sub)",cursor:"pointer"},children:"Cancel"}),(0,q.jsx)("button",{onClick:async()=>{await f(x,l),i(null)},style:{padding:"4px 10px",background:"var(--p-blue)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-white)",cursor:"pointer"},children:"Save"})]})]}):p?(0,q.jsx)("div",{style:{padding:"8px 14px",fontSize:12,color:"var(--p-text-g)",fontStyle:"italic",background:"var(--p-input)",border:"1px dashed var(--p-border)",borderRadius:8},children:"Comment deleted"}):(0,q.jsx)(vr,{markdown:x.text,style:{background:"var(--p-input)",border:"1px solid var(--p-border)",borderRadius:8,padding:"10px 14px",fontSize:12,color:"var(--p-text-sub)",lineHeight:1.6}})]},x.id)}var Ig=E(Oe(),1);var yr=E(j(),1);function $d({files:e,loading:t,error:a,baseUrl:r,onPreview:o,onDelete:n}){let[l,s]=Ig.default.useState(null);return t?(0,yr.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):a?(0,yr.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):e.length===0?(0,yr.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No files attached."}):(0,yr.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.map(i=>{let d=i.url??`${r}/api/files/${encodeURIComponent(i.name)}`;return(0,yr.jsx)(ai,{file:i,url:d,variant:"normal",onPreview:f=>o(f),onDelete:n?f=>(s(f),Promise.resolve()):void 0},i.name)}),n&&(0,yr.jsx)(Sa,{open:l!==null,message:l?`Delete "${l.name}"? This action cannot be undone.`:"",onConfirm:()=>{l&&n(l),s(null)},onCancel:()=>s(null)})]})}var Kd=E(Oe(),1);var Go=E(Oe(),1),Cg=E(_r(),1);var da=E(j(),1);function fl({value:e,onChange:t,previewValue:a,showPreview:r,setShowPreview:o,previewId:n,textareaId:l,placeholder:s,previewEmptyText:i,previewMinHeight:d=54,previewMaxHeight:f=220,baseRows:m=5,maxRows:g=12,autoFocus:L=!1,textareaRef:x,onKeyDown:I,afterTextarea:H,onBlur:p}){let u=Go.default.useRef(null),[c,v]=Go.default.useState([]),[w,C]=Go.default.useState(null),[y,k]=Go.default.useState(null);Go.default.useEffect(()=>{let U=!0;return fetch("/api/tasks").then(_=>_.json()).then(_=>{if(!U)return;let re=(_.tasks??[]).map(ce=>({id:String(ce.id??""),title:String(ce.title??"")})).filter(ce=>ce.id.length>0);v(re)}).catch(()=>{}),()=>{U=!1}},[]);function z(U){let _=u.current;if(!_){C(null);return}let re=_.selectionStart??U.length,ce=U.slice(0,re),Se=-1;for(let ve=ce.length-1;ve>=0;ve--){if(ce[ve]!=="#")continue;let W=ve>0?ce[ve-1]:"";if(W&&!/\\s/.test(W))continue;let D=ce.slice(ve+1);if(!D.includes("#")){if(D.length>80)return;Se=ve;break}}if(Se===-1){C(null);return}let Z=ce.slice(Se+1).trim().toLowerCase(),ke=c.filter(ve=>{if(!Z)return!0;let W=ve.id.toLowerCase(),D=ve.title.toLowerCase();return W.includes(Z)||D.includes(Z)}).sort((ve,W)=>{let D=ve.id.toLowerCase().startsWith(Z)?1:0,b=W.id.toLowerCase().startsWith(Z)?1:0;if(D!==b)return b-D;let B=ve.title.toLowerCase().startsWith(Z)?1:0,te=W.title.toLowerCase().startsWith(Z)?1:0;return B!==te?te-B:ve.id.localeCompare(W.id)}).slice(0,6);if(!ke.length){C(null),k(null);return}let be=_.getBoundingClientRect();k({top:be.top,left:be.left,width:be.width}),C({queryStart:Se,queryEnd:re,items:ke})}function N(U){let _=w;if(!_)return;let re=`${e.slice(0,_.queryStart)}#${U} ${e.slice(_.queryEnd)}`;t(re),C(null),k(null),requestAnimationFrame(()=>{let ce=u.current;if(!ce)return;let Se=_.queryStart+U.length+2;ce.focus(),ce.setSelectionRange(Se,Se)})}return r?(0,da.jsx)("div",{id:n,onClick:U=>{U.target.closest("a")||o(!1)},title:"Click to edit",style:{cursor:"text",minHeight:d,background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:10,fontSize:12,color:"var(--p-text-sub)",lineHeight:1.7,overflow:"auto",maxHeight:f},children:(a??e).trim()?(0,da.jsx)(vr,{markdown:a??e}):(0,da.jsx)("span",{style:{color:"var(--p-border-t)"},children:i??s})}):(0,da.jsxs)("div",{style:{position:"relative"},children:[(0,da.jsx)(Vo,{id:l,ref:U=>{u.current=U,x&&(x.current=U)},className:"dp-textarea",placeholder:s,value:e,onChange:U=>{t(U),z(U)},onFocus:()=>o(!1),onBlur:()=>{C(null),k(null),o(!0),p==null||p()},baseRows:m,maxRows:g,autoFocus:L,onKeyDown:U=>{U.key==="Escape"&&(C(null),k(null)),I==null||I(U)}}),w&&y&&(0,Cg.createPortal)((0,da.jsx)("div",{"data-task-ref-suggest":"true",style:{position:"fixed",left:y.left+8,width:y.width-16,top:y.top,transform:"translateY(-100%)",border:"1px solid var(--p-border-s)",background:"var(--p-card)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",overflow:"hidden",zIndex:9999},children:w.items.map(U=>(0,da.jsxs)("button",{type:"button",onMouseDown:_=>{_.preventDefault(),N(U.id)},style:{width:"100%",display:"flex",alignItems:"center",gap:8,textAlign:"left",border:"none",borderBottom:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-sub)",padding:"7px 10px",fontSize:11,cursor:"pointer"},onMouseEnter:_=>{_.currentTarget.style.background="var(--p-hover)"},onMouseLeave:_=>{_.currentTarget.style.background="transparent"},children:[(0,da.jsxs)("span",{style:{fontFamily:"monospace",color:"var(--p-blue-300)"},children:["#",U.id]}),(0,da.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:U.title})]},U.id))}),document.body),H]})}var eo=E(Oe(),1);var Qt=E(j(),1);function Vd({tags:e,allTags:t,onChange:a,disabled:r}){let[o,n]=eo.default.useState(""),[l,s]=eo.default.useState(!1),i=eo.default.useRef(null),d=eo.default.useRef(null),f=o.trim().toLowerCase(),m=eo.default.useMemo(()=>t.filter(c=>!e.includes(c)&&c.toLowerCase().includes(f)).slice(0,8),[t,e,f]),g=f.length>0&&!t.some(u=>u.toLowerCase()===f)&&!e.some(u=>u.toLowerCase()===f),L=f.length>0&&t.some(u=>u.toLowerCase()===f)&&!e.some(u=>u.toLowerCase()===f);function x(u){var v;let c=u.trim();!c||e.includes(c)||(a([...e,c]),n(""),s(!1),(v=i.current)==null||v.focus())}function I(u){a(e.filter(c=>c!==u))}function H(u){if(u.key==="Enter")if(u.preventDefault(),g||L){let c=t.find(v=>v.toLowerCase()===f);x(c??o.trim())}else m.length>0&&x(m[0]);u.key==="Escape"&&(s(!1),n("")),u.key==="Backspace"&&!o&&e.length>0&&I(e[e.length-1])}eo.default.useEffect(()=>{function u(c){d.current&&!d.current.contains(c.target)&&s(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);let p=l&&(m.length>0||g);return(0,Qt.jsxs)("div",{ref:d,style:{position:"relative"},children:[(0,Qt.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",padding:"5px 8px",borderRadius:8,border:`1px solid ${l?"var(--p-blue)":"var(--p-border)"}`,background:"var(--p-input)",cursor:r?"not-allowed":"text",opacity:r?.6:1,minHeight:34,transition:"border-color .12s"},onClick:()=>{var u;r||(u=i.current)==null||u.focus()},children:[(0,Qt.jsx)(sl,{tags:e,onRemove:r?void 0:I,size:"sm"}),!r&&(0,Qt.jsx)("input",{ref:i,type:"text",value:o,placeholder:e.length?"":"Add tags\\u2026",onChange:u=>{n(u.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:H,style:{background:"none",border:"none",outline:"none",fontSize:12,color:"var(--p-text)",minWidth:80,flex:1,padding:0,lineHeight:"1.4"}})]}),p&&(0,Qt.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onMouseDown:u=>u.preventDefault(),children:[m.map(u=>{let{bg:c,text:v,border:w}=ua(u);return(0,Qt.jsxs)("button",{type:"button",onClick:()=>x(u),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-m)"},onMouseEnter:C=>{C.currentTarget.style.background="var(--p-hover)"},onMouseLeave:C=>{C.currentTarget.style.background="none"},children:[(0,Qt.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:v,border:`1px solid ${w}`,flexShrink:0}}),u]},u)}),g&&(0,Qt.jsxs)("button",{type:"button",onClick:()=>x(o.trim()),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:m.length>0?"1px solid var(--p-border)":"none",borderLeft:"none",borderRight:"none",borderBottom:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-g)"},onMouseEnter:u=>{u.currentTarget.style.background="var(--p-hover)",u.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:u=>{u.currentTarget.style.background="none",u.currentTarget.style.color="var(--p-text-g)"},children:[(0,Qt.jsx)("span",{style:{fontSize:14,lineHeight:1},children:"+"}),\'Create "\',(0,Qt.jsx)("strong",{style:{color:"var(--p-text)"},children:o.trim()}),\'"\']})]})]})}var Q=E(j(),1);function jd({task:e,description:t,setDescription:a,showDescPreview:r,setShowDescPreview:o,priority:n,setPriority:l,onDescriptionBlur:s,onDescriptionDiscard:i,originalDescription:d,onPriorityChange:f,githubUrl:m,onFilePreview:g,onPatch:L,onDeleteScreenshot:x,liveFiles:I,allTags:H=[],overrideTags:p,onTagsChange:u}){var _;let c=(e==null?void 0:e.files)??[],v=I?I.map(re=>({name:re.name,linkedPath:re.linkedPath,addedAt:re.createdAt,url:re.url})):c,w=v==null?void 0:v.find(re=>/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(re.name)),C=e&&w?w.url||`/api/tasks/${e.id}/files/${encodeURIComponent(w.name)}`:null,y=Kd.default.useRef(null),[k,z]=Kd.default.useState(null),{userPart:N,consolePart:U}=Zv(t);return(0,Q.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,Q.jsxs)("div",{children:[(0,Q.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:"Description"}),(0,Q.jsx)(fl,{value:t,previewValue:U?N:void 0,onChange:a,onBlur:s,showPreview:r,setShowPreview:o,previewId:"dp-desc-preview",textareaId:"dp-desc",placeholder:"Description (markdown)\\u2026",previewMinHeight:80,previewMaxHeight:220,baseRows:6,maxRows:12,autoFocus:!0,textareaRef:y,afterTextarea:i&&d!==void 0&&t!==d?(0,Q.jsx)("button",{type:"button",onMouseDown:re=>{re.preventDefault(),i()},title:"Discard changes and restore saved description",style:{marginTop:4,display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--p-text-g)",background:"none",border:"1px solid var(--p-border-t)",borderRadius:6,padding:"3px 8px",cursor:"pointer",transition:"color .12s, border-color .12s"},onMouseEnter:re=>{re.currentTarget.style.color="var(--p-amber-300)",re.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:re=>{re.currentTarget.style.color="var(--p-text-g)",re.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9 Discard changes"}):void 0})]}),U&&(0,Q.jsx)(Jv,{logs:U}),e&&w&&C&&(0,Q.jsxs)("div",{children:[(0,Q.jsx)("div",{className:"dp-meta-label",children:"Screenshot"}),(0,Q.jsxs)("div",{id:"dp-screenshot-preview",style:{border:"1px solid color-mix(in srgb, var(--p-border-t) 70%, transparent)",borderRadius:10,overflow:"hidden",background:"var(--p-card)"},children:[(0,Q.jsx)("button",{onClick:()=>g(w.name,C),style:{width:"100%",height:112,border:"none",padding:0,background:"linear-gradient(135deg, var(--p-border), var(--p-bg))",cursor:"pointer",display:"block",overflow:"hidden"},title:"Preview screenshot",children:(0,Q.jsx)("img",{src:C,alt:"Task screenshot",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),(0,Q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderTop:"1px solid var(--p-border)",background:"var(--p-surface)"},children:[(0,Q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-f)",flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:w.addedAt?`Captured ${Tt(w.addedAt)}`:"Screenshot attached"}),(0,Q.jsx)("button",{onClick:()=>g(w.name,C),style:{fontSize:10,color:"var(--p-text-m)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Preview screenshot",children:"Preview"}),(0,Q.jsx)("button",{onClick:()=>z(w.name),style:{fontSize:10,color:"var(--p-red)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Remove screenshot",children:"Remove"})]})]})]}),(0,Q.jsxs)("div",{children:[(0,Q.jsx)("div",{className:"dp-meta-label",children:"Tags"}),(0,Q.jsx)(Vd,{tags:p??(e==null?void 0:e.tags)??[],allTags:H,disabled:!e&&!u,onChange:re=>{u?u(re):e&&L(e.id,{tags:re})}})]}),(0,Q.jsxs)("div",{children:[(0,Q.jsx)("div",{className:"dp-meta-label",children:"Priority"}),(0,Q.jsxs)("select",{id:"dp-priority",className:"dp-input",value:n,onChange:re=>{let ce=re.target.value;l(ce),f==null||f(ce)},style:{padding:"5px 8px",fontSize:12,cursor:"pointer",width:"auto"},children:[(0,Q.jsx)("option",{value:"",children:"\\u2014"}),(0,Q.jsx)("option",{value:"Critical",children:"Critical"}),(0,Q.jsx)("option",{value:"High",children:"High"}),(0,Q.jsx)("option",{value:"Medium",children:"Medium"}),(0,Q.jsx)("option",{value:"Low",children:"Low"})]})]}),e&&(0,Q.jsxs)("div",{id:"dp-metadata",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,Q.jsx)(Gd,{label:"Created",id:"dp-created",children:e.createdAt?Tt(e.createdAt):"\\u2014"}),(0,Q.jsx)(Gd,{label:"ID",id:"dp-id",children:(0,Q.jsx)("span",{style:{fontFamily:"monospace"},children:e.id})}),(0,Q.jsx)(Gd,{label:"Author",id:"dp-author",children:e.authorName??e.author??"\\u2014"}),(e.commit||((_=e.commits)==null?void 0:_.length))&&(0,Q.jsx)(Qv,{task:e,githubUrl:m}),e.branchName&&(0,Q.jsx)(Yv,{branchName:e.branchName}),e.annotatedElementText&&(0,Q.jsxs)("div",{id:"dp-annotated-text",style:{gridColumn:"1 / -1",background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,Q.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Annotated element text"}),(0,Q.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",fontStyle:"italic",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e.annotatedElementText})]})]}),(0,Q.jsx)(Sa,{open:k!==null,message:"Remove this screenshot? This action cannot be undone.",confirmLabel:"Remove",onConfirm:()=>{k&&x(k),z(null)},onCancel:()=>z(null)})]})}function Gd({label:e,id:t,children:a}){return(0,Q.jsxs)("div",{id:t,style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,Q.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,Q.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",borderBottom:"1px solid var(--p-border)",paddingBottom:4,display:"flex",alignItems:"center",minHeight:16},children:a})]})}function Qv({task:e,githubUrl:t}){var n;let a=(n=e.commits)!=null&&n.length?e.commits:[{sha:e.commit,message:e.title??"",timestamp:e.createdAt??""}],r=a[a.length-1],o=a.map(l=>`${l.sha.slice(0,8)} ${l.timestamp?new Date(l.timestamp).toLocaleString():""} ${l.message.slice(0,60)}`).join(`\n`);return(0,Q.jsxs)("div",{id:"dp-commit",style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px",cursor:"default"},title:a.length>1?`All commits:\n${o}`:`${r.sha}\n${r.message}`,children:[(0,Q.jsxs)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:["Commit",a.length>1?"s":""]}),(0,Q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[t&&e.commitPushed!==!1?(0,Q.jsxs)("a",{href:`${t}/commit/${r.sha}`,target:"_blank",rel:"noopener noreferrer",style:{fontSize:10,color:"var(--p-blue-300)",fontFamily:"monospace",textDecoration:"none"},title:"Open diff on GitHub",onClick:l=>l.stopPropagation(),children:[r.sha.slice(0,8)," \\u2197"]}):(0,Q.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-f)",fontFamily:"monospace"},title:e.commitPushed===!1?"Commit not pushed to remote yet":void 0,children:[r.sha.slice(0,8),e.commitPushed===!1?" \\u23F3":""]}),a.length>1&&(0,Q.jsxs)("span",{style:{fontSize:9,color:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 25%, transparent)",borderRadius:10,padding:"0 5px",fontWeight:600},children:["+",a.length-1]})]})]})}function Yv({branchName:e}){return(0,Q.jsxs)("div",{id:"dp-branch",style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px",cursor:"default"},title:`Branch: ${e}`,children:[(0,Q.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Branch"}),(0,Q.jsxs)("div",{style:{fontSize:10,color:"var(--p-green-300)",fontFamily:"monospace"},children:["\\u2387 ",e]})]})}function Zv(e){let a=e.indexOf(`\n---\n**Console logs**`);return a===-1?{userPart:e,consolePart:null}:{userPart:e.slice(0,a).trim(),consolePart:e.slice(a+1).trim()}}function Jv({logs:e}){let t=e.replace(/^---\\s*\\n/,"").split(`\n`).filter(a=>a.trim());return(0,Q.jsxs)("div",{id:"dp-console-logs",style:{borderRadius:8,border:"1px solid color-mix(in srgb, var(--p-red) 30%, var(--p-border))",background:"color-mix(in srgb, var(--p-red) 4%, var(--p-card))",overflow:"hidden"},children:[(0,Q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",borderBottom:"1px solid color-mix(in srgb, var(--p-red) 20%, var(--p-border))",background:"color-mix(in srgb, var(--p-red) 8%, var(--p-card))"},children:[(0,Q.jsx)("span",{style:{fontSize:10,fontWeight:700,color:"color-mix(in srgb, var(--p-red) 80%, var(--p-text-sub))",letterSpacing:"0.05em",textTransform:"uppercase"},children:"Console Logs"}),(0,Q.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",marginLeft:"auto"},children:"captured at submission"})]}),(0,Q.jsxs)("div",{style:{padding:"6px 10px",maxHeight:200,overflowY:"auto",display:"flex",flexDirection:"column",gap:3},children:[t.map((a,r)=>{let o=a.includes("\\u{1F534}"),n=a.includes("\\u{1F7E1}"),l=a.replace(/^[-*]\\s*/,"");return(0,Q.jsx)("div",{style:{fontFamily:"Menlo, monospace",fontSize:10,lineHeight:1.5,color:o?"var(--p-red)":n?"var(--p-amber-300)":"var(--p-text-f)",wordBreak:"break-all"},children:l},r)}),t.length===0&&(0,Q.jsx)("div",{style:{fontSize:10,color:"var(--p-text-g)",fontStyle:"italic"},children:"No log entries captured."})]})]})}var Ko=E(j(),1);function Xd({commentInput:e,setCommentInput:t,commentSubmitting:a,onSubmit:r,baseRows:o=4}){return(0,Ko.jsx)("div",{id:"dp-comment-input-area",children:(0,Ko.jsx)(fl,{value:e,onChange:t,showPreview:!1,setShowPreview:()=>{},previewId:"dp-comment-tab-edit",textareaId:"dp-comment-input",placeholder:"Add a comment\\u2026 (markdown)",previewEmptyText:"Leave a comment (markdown)\\u2026",previewMinHeight:o<=2?36:54,previewMaxHeight:140,baseRows:o,maxRows:10,autoFocus:!0,onKeyDown:n=>{n.key==="Enter"&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),r())},afterTextarea:(0,Ko.jsx)("button",{id:"dp-comment-submit",disabled:a,onMouseDown:n=>{n.preventDefault(),r()},title:"Send (Ctrl+Enter)",style:{position:"absolute",bottom:16,right:8,width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--p-blue)",border:"none",borderRadius:6,cursor:"pointer",color:"var(--p-white)",transition:"background .15s"},children:(0,Ko.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"},children:(0,Ko.jsx)("path",{d:"M2 8L14 2L10 8L14 14L2 8Z",fill:"currentColor"})})})})})}var Ee=E(Oe(),1),Qd=E(_r(),1);var P=E(j(),1),cl=[{id:"opencode/hy3-preview-free",label:"Hy3 Preview (Free)",provider:"OpenCode",recommended:!0},{id:"opencode/minimax-m2.5-free",label:"MiniMax M2.5 (Free)",provider:"OpenCode",recommended:!0},{id:"opencode/nemotron-3-super-free",label:"Nemotron 3 Super (Free)",provider:"OpenCode",recommended:!0},{id:"opencode-go/deepseek-v4-flash",label:"DeepSeek V4 Flash",provider:"OpenCode Go",recommended:!0},{id:"opencode-go/qwen3.5-plus",label:"Qwen 3.5 Plus",provider:"OpenCode Go",recommended:!0},{id:"opencode-go/qwen3.6-plus",label:"Qwen 3.6 Plus",provider:"OpenCode Go"},{id:"opencode-go/minimax-m2.5",label:"MiniMax M2.5",provider:"OpenCode Go"},{id:"opencode-go/minimax-m2.7",label:"MiniMax M2.7",provider:"OpenCode Go"},{id:"opencode-go/kimi-k2.5",label:"Kimi K2.5",provider:"OpenCode Go"},{id:"opencode-go/glm-5",label:"GLM 5",provider:"OpenCode Go"},{id:"github-copilot/gpt-4o",label:"GPT-4o (Copilot)",provider:"GitHub Copilot",recommended:!0},{id:"github-copilot/gpt-4.1",label:"GPT-4.1 (Copilot)",provider:"GitHub Copilot"},{id:"github-copilot/claude-haiku-4.5",label:"Claude Haiku 4.5 (Copilot)",provider:"GitHub Copilot"},{id:"github-copilot/gpt-5-mini",label:"GPT-5 Mini (Copilot)",provider:"GitHub Copilot"},{id:"openrouter/google/gemma-3-12b-it:free",label:"Gemma 3 12B (Free)",provider:"OpenRouter"},{id:"openrouter/anthropic/claude-3.5-haiku",label:"Claude 3.5 Haiku",provider:"OpenRouter"},{id:"openrouter/anthropic/claude-3.7-sonnet",label:"Claude 3.7 Sonnet",provider:"OpenRouter"},{id:"anthropic/claude-sonnet-4-20250514",label:"Claude Sonnet 4",provider:"Anthropic"},{id:"anthropic/claude-opus-4-20250514",label:"Claude Opus 4",provider:"Anthropic"},{id:"openai/gpt-4o",label:"GPT-4o",provider:"OpenAI"},{id:"openai/gpt-4-turbo",label:"GPT-4 Turbo",provider:"OpenAI"},{id:"google/gemini-2-5-pro",label:"Gemini 2.5 Pro",provider:"Google"},{id:"google/gemini-2-0-flash-exp",label:"Gemini 2.0 Flash",provider:"Google"},{id:"ollama/llama-3-1-8b",label:"Llama 3.1 8B",provider:"Ollama"},{id:"ollama/qwen2-5-coder",label:"Qwen 2.5 Coder",provider:"Ollama"}];function wg(e){if(!e)return"";let t=Date.now()-new Date(e).getTime(),a=Math.floor(t/6e4),r=Math.floor(t%6e4/1e3);return`${a}m ${r.toString().padStart(2,"0")}s`}function ri({value:e,onChange:t,disabled:a=!1,models:r=cl}){let[o,n]=Ee.default.useState(!1),[l,s]=Ee.default.useState(""),i=Ee.default.useRef(null),d=Ee.default.useRef(null),f=r.length>0?r:cl,m=f.find(c=>c.id===e),g=Ee.default.useMemo(()=>{if(!l)return f;let c=l.toLowerCase();return f.filter(v=>v.label.toLowerCase().includes(c)||v.provider.toLowerCase().includes(c)||v.id.toLowerCase().includes(c))},[l,f]),L=Ee.default.useMemo(()=>{let c={};for(let v of g)c[v.provider]||(c[v.provider]=[]),c[v.provider].push(v);return c},[g,f]),[x,I]=Ee.default.useState(null);function H(){a||(n(c=>!c),requestAnimationFrame(()=>{if(i.current){let c=i.current.getBoundingClientRect();I(c)}}))}function p(){n(!1),s(""),I(null)}Ee.default.useEffect(()=>{if(!o)return;function c(v){let w=v.target;i.current&&i.current.contains(w)||d.current&&d.current.contains(w)||p()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[o]),Ee.default.useEffect(()=>{if(!o)return;function c(v){v.key==="Escape"&&p()}return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[o]);let u=o&&x?(0,Qd.createPortal)((0,P.jsxs)("div",{ref:d,"data-model-picker-dropdown":!0,style:{position:"fixed",left:x.left,bottom:window.innerHeight-x.top+4,width:x.width,background:"var(--p-surface)",border:"1px solid var(--p-border)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",zIndex:1e5,maxHeight:320,overflowY:"auto",display:"flex",flexDirection:"column"},children:[(0,P.jsx)("div",{style:{padding:8,borderBottom:"1px solid var(--p-border)",flexShrink:0},children:(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 8px",background:"var(--p-bg-2)",borderRadius:6,border:"1px solid var(--p-border)"},children:[(0,P.jsx)(jr,{style:{width:12,height:12,color:"var(--p-text-g)",flexShrink:0}}),(0,P.jsx)("input",{type:"text",placeholder:"Filter models...",value:l,onChange:c=>s(c.target.value),autoFocus:!0,style:{flex:1,border:"none",background:"transparent",fontSize:12,color:"var(--p-text)",outline:"none"}})]})}),(0,P.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:4},children:[Object.entries(L).map(([c,v])=>(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{style:{padding:"6px 10px 4px",fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:c}),v.map(w=>(0,P.jsxs)("button",{type:"button",onClick:()=>{t(w.id),p()},style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:5,border:"none",background:e===w.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent",color:e===w.id?"var(--p-purple-300)":"var(--p-text-m)",fontSize:12,cursor:"pointer",textAlign:"left",transition:"background .1s"},onMouseEnter:C=>{C.currentTarget.style.background=e===w.id?"color-mix(in srgb, var(--p-purple) 15%, transparent)":"var(--p-hover)"},onMouseLeave:C=>{C.currentTarget.style.background=e===w.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent"},children:[(0,P.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.label}),w.recommended&&(0,P.jsx)("span",{style:{fontSize:8,fontWeight:600,padding:"1px 4px",borderRadius:3,background:"var(--p-purple)",color:"#fff",flexShrink:0},children:"Rec"})]},w.id))]},c)),g.length===0&&(0,P.jsxs)("div",{style:{padding:16,textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:[\'No models match "\',l,\'"\']})]})]}),document.body):null;return(0,P.jsxs)("div",{ref:i,style:{position:"relative"},children:[(0,P.jsxs)("button",{type:"button",onClick:H,disabled:a,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 12px",borderRadius:7,border:`1px solid ${o?"var(--p-purple-300)":"var(--p-border)"}`,background:"var(--p-bg-2)",color:"var(--p-text-m)",fontSize:12,cursor:a?"not-allowed":"pointer",transition:"all .12s",opacity:a?.6:1},onMouseEnter:c=>{a||(c.currentTarget.style.borderColor="var(--p-purple-300)")},onMouseLeave:c=>{a||(c.currentTarget.style.borderColor=o?"var(--p-purple-300)":"var(--p-border)")},children:[(0,P.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[(0,P.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(m==null?void 0:m.label)||"Select model"}),(m==null?void 0:m.recommended)&&(0,P.jsx)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:3,background:"var(--p-purple)",color:"#fff",flexShrink:0},children:"Recommended"})]}),(0,P.jsx)(ya,{style:{width:14,height:14,color:"var(--p-text-g)",flexShrink:0,transition:"transform .15s",transform:o?"rotate(180deg)":void 0}})]}),u]})}function Yd({value:e,onChange:t,disabled:a=!1,agents:r}){var m,g,L;let[o,n]=Ee.default.useState(!1),l=Ee.default.useRef(null),s=Ee.default.useRef(null),i=r.find(x=>x.id===e);function d(){a||n(x=>!x)}function f(){n(!1)}return Ee.default.useEffect(()=>{if(!o)return;function x(I){let H=I.target;l.current&&l.current.contains(H)||s.current&&s.current.contains(H)||f()}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]),(0,P.jsxs)("div",{ref:l,style:{position:"relative"},children:[(0,P.jsxs)("button",{type:"button",onClick:d,disabled:a,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 12px",borderRadius:7,border:`1px solid ${o?"var(--p-purple-300)":"var(--p-border)"}`,background:"var(--p-bg-2)",color:i?"var(--p-text)":"var(--p-text-m)",fontSize:12,cursor:a?"not-allowed":"pointer",transition:"all .12s",opacity:a?.6:1},children:[(0,P.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[(0,P.jsx)(Kt,{style:{width:14,height:14,flexShrink:0,color:"var(--p-purple-300)"}}),(0,P.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(i==null?void 0:i.name)||"Select agent"}),i&&(0,P.jsx)("span",{style:{fontSize:9,fontWeight:500,padding:"1px 5px",borderRadius:3,background:"var(--p-border)",color:"var(--p-text-g)",flexShrink:0},children:i.scope})]}),(0,P.jsx)(ya,{style:{width:14,height:14,color:"var(--p-text-g)",flexShrink:0,transition:"transform .15s",transform:o?"rotate(180deg)":void 0}})]}),o&&(0,Qd.createPortal)((0,P.jsx)("div",{ref:s,"data-agent-picker-dropdown":!0,style:{position:"fixed",left:((m=l.current)==null?void 0:m.getBoundingClientRect().left)??0,bottom:window.innerHeight-(((g=l.current)==null?void 0:g.getBoundingClientRect().top)??0)+4,width:((L=l.current)==null?void 0:L.getBoundingClientRect().width)??200,background:"var(--p-surface)",border:"1px solid var(--p-border)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",zIndex:1e5,maxHeight:240,overflowY:"auto",display:"flex",flexDirection:"column"},children:r.map(x=>(0,P.jsxs)("button",{type:"button",onClick:()=>{t(x.id),f()},style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderRadius:5,border:"none",background:e===x.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent",color:e===x.id?"var(--p-purple-300)":"var(--p-text-m)",fontSize:12,cursor:"pointer",textAlign:"left",transition:"background .1s"},onMouseEnter:I=>{I.currentTarget.style.background=e===x.id?"color-mix(in srgb, var(--p-purple) 15%, transparent)":"var(--p-hover)"},onMouseLeave:I=>{I.currentTarget.style.background=e===x.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent"},children:[(0,P.jsx)(Kt,{style:{width:14,height:14,flexShrink:0,color:"var(--p-purple-300)"}}),(0,P.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.name}),(0,P.jsx)("span",{style:{fontSize:9,fontWeight:500,padding:"1px 4px",borderRadius:3,background:"var(--p-border)",color:"var(--p-text-g)",flexShrink:0},children:x.scope})]},x.id))}),document.body)]})}function ey({status:e}){let t={idle:"var(--p-text-g)",queued:"var(--p-amber)",running:"var(--p-blue)",done:"var(--p-green)",failed:"var(--p-red)"},a={idle:"Idle",queued:"Queued",running:"Running",done:"Completed",failed:"Failed"},[r,o]=Ee.default.useState(!0);return Ee.default.useEffect(()=>{if(e!=="running")return;let n=setInterval(()=>o(l=>!l),800);return()=>{clearInterval(n),o(!0)}},[e]),(0,P.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,color:t[e]},children:[(0,P.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:t[e],opacity:e==="running"?r?1:.3:1,transition:"opacity 0.3s ease"}}),a[e]]})}function ty(e){var a;let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let r=JSON.parse(t);if(r.type==="text"&&typeof r.part=="object"&&r.part){let o=r.part,n=typeof o.text=="string"?o.text:"";return n?(0,P.jsx)("span",{style:{color:"#e2e8f0"},children:n}):null}if(r.type==="tool_use"&&typeof r.part=="object"&&r.part){let o=r.part;if(o.type==="tool"){let n=typeof o.tool=="string"?o.tool:"tool",l=typeof o.state=="object"&&o.state?o.state:{},s=typeof l.input=="object"&&l.input?l.input:{},i=l.output??((a=l.metadata)==null?void 0:a.output),d=l.error,f=typeof l.status=="string"?l.status:"";return(0,P.jsxs)("div",{style:{color:"#94a3b8"},children:[(0,P.jsxs)("div",{children:[(0,P.jsxs)("span",{style:{color:"#60a5fa"},children:["\\u2192 ",n]}),typeof s.description=="string"&&s.description&&(0,P.jsxs)("span",{children:[": ",s.description]}),typeof s.command=="string"&&s.command&&!s.description&&(0,P.jsxs)("span",{children:[": ",s.command]}),typeof s.filePath=="string"&&s.filePath&&(0,P.jsxs)("span",{children:[": ",s.filePath]}),typeof s.url=="string"&&s.url&&(0,P.jsxs)("span",{children:[": ",s.url]})]}),d!==void 0&&(0,P.jsx)("div",{style:{marginLeft:12,color:"#ef4444",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:9},children:String(d).slice(0,2e3)}),i!==void 0&&d===void 0&&(0,P.jsx)("div",{style:{marginLeft:12,color:f==="error"?"#ef4444":"#22c55e",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:9},children:String(i).slice(0,2e3)})]})}}if(r.type==="step_start"||r.type==="step_finish")return null;if(r.type==="error"){let o=typeof r.message=="string"?r.message:JSON.stringify(r);return(0,P.jsxs)("span",{style:{color:"#ef4444"},children:["Error: ",o]})}return(0,P.jsxs)("span",{style:{color:"#64748b",fontSize:9},children:["[",String(r.type),"]"]})}catch{}return t.startsWith("opencode run")?(0,P.jsxs)("span",{style:{color:"#64748b",fontSize:9},children:["$ ",t.split(`\n`)[0]]}):t.startsWith("\\u2713")||t.startsWith("\\u2717")||t.startsWith("\\u25B6")?(0,P.jsx)("span",{children:t}):(0,P.jsx)("span",{style:{color:"#94a3b8"},children:t})}function ay({logs:e,status:t}){let a=Ee.default.useRef(null),r=e.join(""),o=Ee.default.useMemo(()=>r.split(`\n`).filter(n=>n.trim().length>0),[r]);return Ee.default.useEffect(()=>{a.current&&t==="running"&&(a.current.scrollTop=a.current.scrollHeight)},[o.length,t]),(0,P.jsxs)("div",{ref:a,style:{background:"#0a0c10",border:"1px solid var(--p-border)",borderRadius:7,padding:"10px 12px",fontFamily:"\'SF Mono\', \'Fira Code\', monospace",fontSize:10,lineHeight:1.65,color:"#a3e635",maxHeight:200,overflowY:"auto"},children:[o.map((n,l)=>{let s=ty(n);return s===null?null:(0,P.jsx)("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s},l)}).filter(Boolean),t==="running"&&(0,P.jsx)("span",{style:{color:"#a3e635"},children:"\\u258C"})]})}function Zd({task:e,run:t,onRun:a,onStop:r,onDequeue:o,models:n,defaultModel:l,defaultAgent:s,onModelChange:i,agents:d,onAgentChange:f,cliAvailable:m=!0}){var z,N,U;let g=n&&n.length>0?n:cl,[L,x]=Ee.default.useState(e.model??l??((z=g[0])==null?void 0:z.id)),[I,H]=Ee.default.useState(e.agent??s??((N=d==null?void 0:d[0])==null?void 0:N.id)??"");function p(_){x(_),i==null||i(_)}function u(_){H(_),f==null||f(_)}function c(){a(e.id,L,I||void 0)}Ee.default.useEffect(()=>{i==null||i(L)},[]),Ee.default.useEffect(()=>{I&&(f==null||f(I))},[]),Ee.default.useEffect(()=>{e.model&&e.model!==L&&x(e.model),e.agent&&e.agent!==I&&H(e.agent)},[e.model,e.agent]),Ee.default.useEffect(()=>{!I&&s&&H(s)},[s]);let[v,w]=Ee.default.useState("");Ee.default.useEffect(()=>{if((t==null?void 0:t.status)!=="running")return;let _=setInterval(()=>w(wg(t.startedAt)),1e3);return w(wg(t.startedAt)),()=>clearInterval(_)},[t==null?void 0:t.status,t==null?void 0:t.startedAt]);let C=(t==null?void 0:t.status)??"idle",y=(t==null?void 0:t.worktree)??`wt/task-${e.id.slice(0,8)}`,k=(t==null?void 0:t.branch)??`agent/task-${e.id.slice(0,8)}`;return(0,P.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,P.jsx)(ey,{status:C}),C==="running"&&v&&(0,P.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-g)",display:"inline-flex",alignItems:"center",gap:4},children:[(0,P.jsx)(cr,{style:{width:10,height:10}}),v]}),C==="queued"&&(0,P.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:"Waiting for current run to finish\\u2026"})]}),C==="idle"&&!m&&(0,P.jsxs)("div",{style:{borderRadius:8,padding:12,fontSize:12,lineHeight:1.6,background:"color-mix(in srgb, var(--p-red) 6%, transparent)",border:"1px solid color-mix(in srgb, var(--p-red) 25%, transparent)",color:"var(--p-red-300)"},children:[(0,P.jsx)("strong",{children:"Local CLI not connected."})," Agent runs require the local CLI server to be running. Start it with ",(0,P.jsx)("code",{style:{background:"rgba(0,0,0,0.3)",padding:"1px 5px",borderRadius:4},children:"vibeflow serve"})," and refresh this page."]}),C==="idle"&&m&&(0,P.jsxs)("div",{style:{borderRadius:8,padding:12,fontSize:12,lineHeight:1.6,background:"color-mix(in srgb, var(--p-purple) 6%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 25%, transparent)",color:"var(--p-purple-300)"},children:[(0,P.jsx)("strong",{children:"Ready to run."})," The agent will create an isolated worktree, read the task description, and implement a solution. When done, you\'ll review the diff and merge."]}),C==="queued"&&(0,P.jsxs)("div",{style:{borderRadius:8,padding:12,fontSize:12,lineHeight:1.6,background:"color-mix(in srgb, var(--p-amber) 6%, transparent)",border:"1px solid color-mix(in srgb, var(--p-amber) 25%, transparent)",color:"var(--p-amber-300)"},children:[(0,P.jsx)("strong",{children:"\\u23F3 Queued"})," \\u2014 another task is currently running. This task will start automatically when the queue is free."]}),(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:6},children:"Model"}),(0,P.jsx)(ri,{value:L,onChange:p,disabled:C==="running"||C==="queued",models:g})]}),d&&d.length>0&&(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:6},children:"Agent"}),(0,P.jsx)(Yd,{value:I,onChange:u,disabled:C==="running"||C==="queued",agents:d})]}),(0,P.jsxs)("div",{style:{border:"1px solid var(--p-border)",borderRadius:8,padding:10,background:"var(--p-bg-2)",display:"flex",flexDirection:"column",gap:6},children:[(0,P.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Worktree"}),(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--p-text-m)"},children:[(0,P.jsx)(Qn,{style:{width:10,height:10,color:"var(--p-text-g)",flexShrink:0}}),(0,P.jsx)("span",{style:{fontFamily:"monospace",fontSize:10},children:y})]}),(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--p-text-m)"},children:[(0,P.jsx)(Yn,{style:{width:10,height:10,color:"var(--p-text-g)",flexShrink:0}}),(0,P.jsx)("span",{style:{fontFamily:"monospace",fontSize:10},children:k})]})]}),t&&t.logs.length>0&&(0,P.jsxs)("div",{children:[(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6},children:[(0,P.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Live Output"}),C==="running"&&(0,P.jsxs)("span",{style:{fontSize:10,color:"var(--p-blue-300)",display:"flex",alignItems:"center",gap:4},children:[(0,P.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--p-blue)",animation:"pulse 1s ease-in-out infinite"}}),"Streaming..."]})]}),(0,P.jsx)(ay,{logs:t.logs,status:C})]}),e.agent&&!t&&(((U=e.commits)==null?void 0:U.length)??0)>0&&(0,P.jsxs)("div",{style:{fontSize:11,color:"var(--p-text-g)"},children:["Last agent: ",(0,P.jsx)("span",{style:{color:"var(--p-purple-300)"},children:e.agent}),e.model&&(0,P.jsxs)(P.Fragment,{children:[" \\xB7 model ",(0,P.jsx)("span",{style:{color:"var(--p-purple-300)"},children:e.model})]})]}),t&&(t.status==="done"||t.status==="failed")&&(0,P.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:10,display:"flex",flexWrap:"wrap",gap:"10px 16px",fontSize:10,color:"var(--p-text-g)"},children:[t.durationMs!=null&&(0,P.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,P.jsx)(cr,{style:{width:10,height:10}}),ry(t.durationMs)]}),t.totalTokens!=null&&t.totalTokens>0&&(0,P.jsxs)("span",{title:`${t.inputTokens??0} input \\xB7 ${t.outputTokens??0} output${t.reasoningTokens?` \\xB7 ${t.reasoningTokens} reasoning`:""}`,children:[oy(t.totalTokens)," tokens"]}),t.cost!=null&&t.cost>0&&(0,P.jsxs)("span",{style:{color:"var(--p-green)"},children:["$",t.cost.toFixed(4)]})]})]})}function ry(e){let t=Math.floor(e/6e4),a=Math.floor(e%6e4/1e3);return t>0?`${t}m ${a.toString().padStart(2,"0")}s`:`${a}s`}function oy(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:`${e}`}var A=E(j(),1),ny="vibeflow-paste-hint-dismissed";function ly({storageKey:e=ny}){let[t,a]=Y.default.useState(()=>{try{return!localStorage.getItem(e)}catch{return!0}});if(!t)return null;function r(){try{localStorage.setItem(e,"1")}catch{}a(!1)}return(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",margin:"0 0 6px",borderRadius:6,background:"rgba(37,99,235,0.08)",border:"1px solid rgba(37,99,235,0.18)",fontSize:11,color:"var(--p-blue-300)",flexShrink:0},children:[(0,A.jsxs)("span",{style:{flex:1,lineHeight:1.4},children:["\\u{1F4A1} ",(0,A.jsx)("strong",{children:"Tip:"})," Paste screenshots or files anywhere in this panel \\u2014 they attach automatically."]}),(0,A.jsx)("button",{onClick:r,title:"Dismiss",style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",padding:2,color:"var(--p-blue-300)",opacity:.7,display:"flex",alignItems:"center"},onMouseEnter:o=>{o.currentTarget.style.opacity="1"},onMouseLeave:o=>{o.currentTarget.style.opacity="0.7"},children:(0,A.jsx)(Xe,{style:{width:12,height:12}})})]})}var sy=[{id:"backlog",label:"backlog"},{id:"todo",label:"todo"},{id:"in-progress",label:"in-progress"},{id:"review",label:"review"},{id:"done",label:"done"}],iy=5*1024*1024;function Jd(e,t=.8){return new Promise((a,r)=>{let o=new Image,n=URL.createObjectURL(e);o.onload=()=>{let l=document.createElement("canvas");l.width=o.naturalWidth,l.height=o.naturalHeight;let s=l.getContext("2d");if(!s){URL.revokeObjectURL(n),r(new Error("canvas unavailable"));return}s.drawImage(o,0,0),URL.revokeObjectURL(n),l.toBlob(i=>{i?a(i):r(new Error("canvas.toBlob failed"))},"image/jpeg",t)},o.onerror=()=>{URL.revokeObjectURL(n),r(new Error("image load failed"))},o.src=n})}function ef({open:e,task:t,tab:a,addColumnId:r="todo",gitUserName:o="You",githubUrl:n,baseUrl:l,isResizing:s,api:i,onClose:d,onSave:f,onCreate:m,onDelete:g,onPatch:L,onFilePreview:x,onActivityChange:I,externalLocalChanges:H=[],showLockIndicator:p=!0,lockedByUser:u,onGoBack:c,navBackLabel:v,commentVersion:w,allTasks:C=[],agentRun:y,onRunAgent:k,onStopAgent:z,onDequeueAgent:N,models:U,defaultModel:_,perTypeModels:re,defaultModelBug:ce,defaultModelResearch:Se,defaultModelTask:Z,agents:ke,defaultAgent:be,experimentalAgents:ve,cliBaseUrl:W,createBranch:D}){let b=!t,B=t?nl(t.type):nl("Task"),te=Y.default.useRef(null),[Ie,Be]=Y.default.useState([]),We=Y.default.useRef(!1),oe=Y.default.useRef(""),Te=Y.default.useRef(""),Je=Y.default.useMemo(()=>{let S=new Set;for(let V of C)for(let ee of V.tags??[])S.add(ee);return[...S].sort()},[C]),[Me,Pe]=Y.default.useState(a),[Ke,ye]=Y.default.useState(""),[De,at]=Y.default.useState(""),[Ot,zt]=Y.default.useState(r),[Yt,Pt]=Y.default.useState("Task"),[Na,Ua]=Y.default.useState(""),[ml,ao]=Y.default.useState(!1),[si,jo]=Y.default.useState(!1),[Xo,Ia]=Y.default.useState(!1),[St,Zt]=Y.default.useState(""),[gl,Sr]=Y.default.useState(!1),Ca=Y.default.useRef(null),hl=U&&U.length>0?U[0].id:"",Ir=Y.default.useMemo(()=>{if(re&&(t!=null&&t.type)){if(t.type==="Bug"&&ce)return ce;if(t.type==="Research"&&Se)return Se;if(t.type==="Task"&&Z)return Z}return _??hl},[re,t==null?void 0:t.type,_,ce,Se,Z,hl]),[ro,oo]=Y.default.useState((t==null?void 0:t.model)??Ir),[Cr,ca]=Y.default.useState((t==null?void 0:t.agent)??be??"");Y.default.useEffect(()=>{!ro&&Ir&&oo(Ir)},[Ir,ro]),Y.default.useEffect(()=>{!Cr&&be&&ca(be)},[be,Cr]);let ii=Y.default.useCallback(S=>{oo(S),t&&S!==t.model&&L(t.id,{model:S})},[t,L]),ui=Y.default.useCallback(S=>{ca(S),t&&S!==t.agent&&L(t.id,{agent:S})},[t,L]),[di,Ha]=Y.default.useState([]),[fi,xl]=Y.default.useState(!1),[ci,no]=Y.default.useState(null),[qa,lo]=Y.default.useState(""),[vl,yl]=Y.default.useState(!1),[so,Qo]=Y.default.useState([]),[Yo,h]=Y.default.useState(!1),[T,F]=Y.default.useState(null),[J,ue]=Y.default.useState(0),fe=Y.default.useRef(0),[O,ae]=Y.default.useState(0),[xe,le]=Y.default.useState(null),[ge,R]=Y.default.useState([]),[Ue,Rt]=Y.default.useState([]),nt=Y.default.useRef(null),Nt=Y.default.useRef(()=>{}),wr=Y.default.useRef(""),kr=Y.default.useRef(!1);Y.default.useEffect(()=>{wr.current=qa},[qa]),Y.default.useEffect(()=>{kr.current=Xo},[Xo]),Y.default.useEffect(()=>{We.current=s??!1},[s]),Y.default.useEffect(()=>{e||I==null||I(null,"viewing")},[e]),Y.default.useEffect(()=>{if(!e||!t)return;Ke!==oe.current||De!==Te.current?I==null||I(t.id,"locked"):I==null||I(t.id,"viewing")},[Ke,De,e,t==null?void 0:t.id]),Y.default.useEffect(()=>{if(!e)return;function S(V){var ee,Ae,Ce,Jt,ea,Il,io,Cl;if(!We.current&&!((Ae=(ee=V.target)==null?void 0:ee.closest)!=null&&Ae.call(ee,"[data-task-ref-suggest]"))&&!((Jt=(Ce=V.target)==null?void 0:Ce.closest)!=null&&Jt.call(Ce,".modal-backdrop"))&&!((Il=(ea=V.target)==null?void 0:ea.closest)!=null&&Il.call(ea,"[data-model-picker-dropdown]"))&&!((Cl=(io=V.target)==null?void 0:io.closest)!=null&&Cl.call(io,"[data-agent-picker-dropdown]"))&&te.current&&!te.current.contains(V.target)){if(kr.current)return;if(wr.current.trim().length>0){Nt.current(),Ia(!0);return}Nt.current(),d()}}return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[e,d]),Y.default.useEffect(()=>{if(!e)return;function S(V){if(V.key==="Escape"){if(kr.current){Ia(!1),V.stopPropagation();return}if(wr.current.trim().length>0){V.stopPropagation(),Nt.current(),Ia(!0);return}}}return document.addEventListener("keydown",S,{capture:!0}),()=>document.removeEventListener("keydown",S,{capture:!0})},[e]),Y.default.useEffect(()=>{if(e){if(Pe(a),ao(!!t),lo(""),Ha([]),Qo([]),ue(0),ae(0),R([]),Rt([]),oo((t==null?void 0:t.model)??Ir),ca((t==null?void 0:t.agent)??""),Zt((t==null?void 0:t.branchName)??""),Sr(!1),Ca.current=null,t){let S=(t.title??"").trim(),V=(t.description??"").trim();ye(S),at(V),zt(t.status),Pt(t.type??"Task"),Ua(t.priority??""),oe.current=S,Te.current=V,I==null||I(t.id,"viewing")}else ye(""),at(""),zt(r),Pt("Task"),Ua("");t&&(br(t.id),_a(t.id)),setTimeout(()=>{var S;return(S=nt.current)==null?void 0:S.focus()},50)}},[e,t==null?void 0:t.id,a]),Y.default.useEffect(()=>{!e||!t||(Me==="comments"?(Zo(t.id),_a(t.id)):Me==="files"&&_a(t.id))},[Me,e,t==null?void 0:t.id]),Y.default.useEffect(()=>{if(!e||!t||Ke!==oe.current||De!==Te.current)return;let V=(t.title??"").trim(),ee=(t.description??"").trim();(V!==oe.current||ee!==Te.current)&&(ye(V),at(ee),oe.current=V,Te.current=ee),t.status&&t.status!==Ot&&zt(t.status),t.type&&t.type!==Yt&&Pt(t.type),t.priority!==void 0&&t.priority!==Na&&Ua(t.priority??""),t.model&&t.model!==ro&&oo(t.model),t.agent&&t.agent!==Cr&&ca(t.agent);let Ae=t.branchName??"";Ae!==St&&Zt(Ae)},[t==null?void 0:t.title,t==null?void 0:t.description,t==null?void 0:t.status,t==null?void 0:t.type,t==null?void 0:t.priority,t==null?void 0:t.model,t==null?void 0:t.agent,t==null?void 0:t.branchName]),Y.default.useEffect(()=>{!e||!t||w===void 0||(Me==="comments"?Zo(t.id):br(t.id))},[w]);async function br(S){var V,ee;try{let[Ae,Ce]=await Promise.all([i.getComments(S),i.getFiles(S)]);ue(((V=Ae.comments)==null?void 0:V.length)??0),ae(((ee=Ce.files)==null?void 0:ee.length)??0)}catch{}}async function Zo(S){var ee;let V=++fe.current;xl(!0),no(null);try{let Ae=await i.getComments(S);if(fe.current!==V)return;Ha(Ae.comments??[]),ue(((ee=Ae.comments)==null?void 0:ee.length)??0)}catch{if(fe.current!==V)return;no("failed")}finally{fe.current===V&&xl(!1)}}async function _a(S){var V;h(!0),F(null);try{let ee=await i.getFiles(S);Qo(ee.files??[]),ae(((V=ee.files)==null?void 0:V.length)??0)}catch{F("failed")}finally{h(!1)}}async function lf(){var S;if(!Ke.trim()){(S=nt.current)==null||S.focus();return}if(!b&&qa.trim()&&await pi(),b){let V=await m({title:Ke.trim(),description:De.trim()||Ke.trim(),status:Ot,type:Yt,priority:Na||void 0,selector:"/",tags:Ue.length>0?Ue:void 0});if(V&&Ie.length>0){for(let ee of Ie)await i.uploadFile(V,ee).catch(()=>null);Be([])}d()}else Ll()}function Ll(){if(!t||b)return;let S=Ke.trim();if(!S)return;let V=oe.current,ee=Te.current,Ae=S!==V,Ce=De.trim()!==ee;!Ae&&!Ce||(Ae&&Sl("title",V,S),Ce&&Sl("description",ee,De.trim()),L(t.id,{title:S,description:De.trim(),type:Yt,priority:Na||void 0}),oe.current=S,Te.current=De.trim())}Nt.current=Ll;function Sl(S,V,ee){V!==ee&&R(Ae=>[...Ae,{field:S,from:V,to:ee,actor:o,timestamp:new Date().toISOString()}])}async function pi(){if(!(!t||!qa.trim())){yl(!0);try{await i.addComment(t.id,qa.trim()),lo(""),await Zo(t.id)}finally{yl(!1)}}}async function Bg(S,V){t&&(await i.updateComment(t.id,S.id,V),await Zo(t.id))}async function Og(S){t&&(await i.deleteComment(t.id,S.id),await Zo(t.id))}async function zg(S){if(!t)return;let V=t.id;le(null);for(let ee of Array.from(S.target.files??[])){if(!ee.type.startsWith("image/")&&ee.size>iy){le(`"${ee.name}" exceeds the 5 MB limit and was skipped.`);continue}let Ae;if(ee.type.startsWith("image/")){let Ce=await Jd(ee),Jt=ee.name.replace(/\\.(png|bmp|gif|webp|tiff?)$/i,".jpg");Ae=new File([Ce],Jt,{type:"image/jpeg"})}else Ae=ee;await i.uploadFile(V,Ae)}S.target.value="",await _a(V),br(V)}async function Ng(S){if(!t)return;le(null);let V=await Jd(S),Ae=`paste-${new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}.jpg`,Ce=new File([V],Ae,{type:"image/jpeg"});await i.uploadFile(t.id,Ce),await _a(t.id),br(t.id)}async function Ug(S){if(!t)return;let V=Array.from(S.items),ee=V.find(Ce=>Ce.type.startsWith("image/"));if(ee){let Ce=ee.getAsFile();Ce&&await Ng(Ce);return}let Ae=V.filter(Ce=>Ce.kind==="file"&&!Ce.type.startsWith("image/"));if(Ae.length>0){for(let Ce of Ae){let Jt=Ce.getAsFile();Jt&&await i.uploadFile(t.id,Jt)}await _a(t.id),br(t.id);return}}Y.default.useEffect(()=>{if(!e)return;function S(V){if(!V.clipboardData)return;let ee=V.target;if(!((ee.tagName==="TEXTAREA"||ee.tagName==="INPUT"||ee.isContentEditable)&&!Array.from(V.clipboardData.items).some(ea=>ea.kind==="file"))){if(V.preventDefault(),!t){let Jt=Array.from(V.clipboardData.items).find(ea=>ea.type.startsWith("image/"));if(Jt){let ea=Jt.getAsFile();ea&&(async()=>{let Il=await Jd(ea),io=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),Cl=new File([Il],`paste-${io}.jpg`,{type:"image/jpeg"});Be(Vg=>[...Vg,Cl])})()}return}Ug(V.clipboardData)}}return document.addEventListener("paste",S),()=>document.removeEventListener("paste",S)},[e,t==null?void 0:t.id]);async function sf(S){t&&(await i.deleteFile(t.id,S.name),await _a(t.id),br(t.id))}async function Hg(S){if(!t)return;await i.deleteFile(t.id,S);let V=(t.files??[]).filter(ee=>ee.name!==S);L(t.id,{files:V}),await _a(t.id),br(t.id)}function qg(S){if(gl&&S!=="review"&&(Sr(!1),Ca.current=null),zt(S),b||!t)return;if(D&&S==="review"&&!St.trim()){Ca.current={taskId:t.id,patch:{status:S}},Sr(!0);return}let V={status:S};St.trim()&&(V.branchName=St.trim()),L(t.id,V)}function uf(){if(!Ca.current||!t||!St.trim())return;let S={...Ca.current.patch,branchName:St.trim()};L(t.id,S),Sr(!1),Ca.current=null}function df(){Sr(!1),Ca.current=null,t&&zt(t.status)}let _g=S=>S!==Ot?"dp-status-btn":`dp-status-btn active-${S}`;function ff(){if(!kr.current){if(wr.current.trim().length>0){Nt.current(),Ia(!0);return}Nt.current(),d()}}let Wg=e&&t!=null&&(Ke!==oe.current||De!==Te.current),$g=Y.default.useMemo(()=>{let S=[...H,...ge].sort((ee,Ae)=>new Date(ee.timestamp).getTime()-new Date(Ae.timestamp).getTime()),V=[];for(let ee of S)V.some(Ce=>Ce.field===ee.field&&Ce.from.toLowerCase()===ee.from.toLowerCase()&&Ce.to.toLowerCase()===ee.to.toLowerCase()&&Ce.actor===ee.actor&&Math.abs(new Date(Ce.timestamp).getTime()-new Date(ee.timestamp).getTime())<=3e3)||V.push(ee);return V},[H,ge]),Wa=!b&&!!u;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("aside",{id:"detail-panel",className:"open",ref:te,children:[Wa&&(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:"rgba(234,88,12,0.12)",border:"1px solid rgba(234,88,12,0.25)",borderRadius:6,margin:"8px 12px 0",fontSize:12,color:"#f97316",fontWeight:500},children:["\\u{1F512} Locked by ",(0,A.jsx)("strong",{children:u})," \\u2014 editing disabled until they finish."]}),(0,A.jsxs)("div",{className:"dp-header",children:[(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[c&&(0,A.jsx)("button",{id:"dp-back",onClick:c,title:v?`Back to: ${v}`:"Go back",style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"1px solid var(--p-border-t)",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s",fontSize:14,lineHeight:1},onMouseOver:S=>{S.currentTarget.style.background="var(--p-border)",S.currentTarget.style.color="var(--p-blue-300)",S.currentTarget.style.borderColor="var(--p-blue)"},onMouseOut:S=>{S.currentTarget.style.background="transparent",S.currentTarget.style.color="var(--p-text-g)",S.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u2190"}),(0,A.jsx)(ti,{id:"dp-type-picker",value:Yt,disabled:Wa,onChange:S=>{!b&&t&&S!==Yt&&Sl("type",Yt,S),Pt(S),!b&&t&&L(t.id,{type:S})}}),(0,A.jsx)("input",{id:"dp-title",ref:nt,className:"dp-input",type:"text",placeholder:"Task title\\u2026",value:Ke,readOnly:Wa,onChange:S=>ye(S.target.value),onKeyDown:S=>{S.key==="Escape"&&(S.stopPropagation(),ff()),S.key==="Enter"&&b&&lf()},style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",borderColor:"transparent",background:"transparent"},onFocus:S=>{S.currentTarget.style.borderColor="var(--p-blue)",S.currentTarget.style.background="var(--p-input)"},onBlur:S=>{S.currentTarget.style.borderColor="transparent",S.currentTarget.style.background="transparent",b||Ll()}}),!b&&Ke!==oe.current&&Ke.trim()!==""&&(0,A.jsx)("button",{type:"button",title:"Discard title changes",onMouseDown:S=>{S.preventDefault(),ye(oe.current)},style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:"1px solid var(--p-border-t)",background:"none",color:"var(--p-text-g)",cursor:"pointer",fontSize:13,lineHeight:1},onMouseEnter:S=>{S.currentTarget.style.color="var(--p-amber-300)",S.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:S=>{S.currentTarget.style.color="var(--p-text-g)",S.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9"}),(0,A.jsx)("button",{id:"dp-close",onClick:ff,style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s",pointerEvents:"auto"},onMouseOver:S=>{S.currentTarget.style.background="var(--p-border)",S.currentTarget.style.color="var(--p-text-m)"},onMouseOut:S=>{S.currentTarget.style.background="transparent",S.currentTarget.style.color="var(--p-text-g)"},children:(0,A.jsx)(Xe,{style:{width:14,height:14}})}),p&&Wg&&t&&(0,A.jsx)("span",{id:"dp-lock-indicator",title:`Locked by ${o} \\u2014 unsaved changes`,style:{display:"inline-flex",alignItems:"center",gap:3,flexShrink:0,borderRadius:999,padding:"2px 7px",fontSize:10,fontWeight:600,border:"1px solid rgba(244,114,182,0.35)",color:"#f9a8d4",background:"rgba(157,23,77,0.28)"},children:"\\u{1F512} Locked"})]}),(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",...Wa?{pointerEvents:"none",opacity:.6}:{}},children:[(0,A.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Status"}),sy.map(S=>(0,A.jsx)("button",{className:_g(S.id),"data-status":S.id,onClick:()=>qg(S.id),children:S.label},S.id))]}),gl&&!Wa&&(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8,padding:"8px 10px",borderRadius:8,background:"rgba(139,92,246,0.08)",border:"1px solid rgba(139,92,246,0.2)",fontSize:12},children:[(0,A.jsx)("span",{style:{color:"var(--p-purple-300)",fontWeight:500,whiteSpace:"nowrap"},children:"Branch name:"}),(0,A.jsx)("input",{id:"dp-branch-name",type:"text",placeholder:"e.g. feat/add-hover-effect",value:St,onChange:S=>Zt(S.target.value),onKeyDown:S=>{S.key==="Enter"&&St.trim()&&uf(),S.key==="Escape"&&df()},autoFocus:!0,style:{flex:1,fontSize:12,padding:"4px 8px",borderRadius:6,border:"1px solid var(--p-border)",background:"var(--p-input)",color:"var(--p-text)",fontFamily:"monospace"}}),(0,A.jsx)("button",{onClick:uf,disabled:!St.trim(),style:{padding:"4px 12px",borderRadius:6,border:"1px solid var(--p-purple)",background:St.trim()?"var(--p-purple)":"var(--p-border)",color:"#fff",fontSize:11,fontWeight:600,cursor:St.trim()?"pointer":"not-allowed",transition:"background .12s"},children:"Apply & Review"}),(0,A.jsx)("button",{onClick:df,style:{padding:"4px 10px",borderRadius:6,border:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-g)",fontSize:11,cursor:"pointer"},children:"Cancel"})]})]}),!b&&(0,A.jsxs)("div",{className:"dp-tabs",id:"dp-tabs-row",children:[(0,A.jsx)("button",{className:`dp-tab${Me==="details"?" active":""}`,id:"dp-tab-details",onClick:()=>Pe("details"),children:"Details"}),(0,A.jsxs)("button",{className:`dp-tab${Me==="comments"?" active":""}`,id:"dp-tab-activity",onClick:()=>Pe("comments"),children:["Activity ",J>0&&(0,A.jsxs)("span",{id:"dp-activity-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",J,")"]})]}),(0,A.jsxs)("button",{className:`dp-tab${Me==="files"?" active":""}`,id:"dp-tab-files",onClick:()=>Pe("files"),children:["Files ",O>0&&(0,A.jsxs)("span",{id:"dp-file-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",O,")"]})]}),ve===!0&&(0,A.jsxs)("button",{className:`dp-tab${Me==="agent"?" active":""}`,id:"dp-tab-agent",onClick:()=>Pe("agent"),style:{color:Me==="agent"?"#c4b5fd":void 0,borderBottomColor:Me==="agent"?"#a78bfa":void 0},children:["\\u{1F916} Agent",y&&y.status!=="idle"&&(0,A.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:12,borderRadius:10,fontSize:9,fontWeight:700,background:"#a78bfa",color:"#fff",marginLeft:4},children:y.status==="running"?"\\u25CF":y.status==="queued"?"\\u23F3":"\\u2713"})]})]}),(0,A.jsxs)("div",{className:"dp-body",children:[!b&&(0,A.jsx)(ly,{}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-details-pane",style:{display:!t||Me==="details"?"":"none"},children:[(0,A.jsx)("div",{style:Wa?{pointerEvents:"none",opacity:.6,flexShrink:0}:{flexShrink:0},children:(0,A.jsx)(jd,{task:t,description:De,setDescription:at,showDescPreview:ml,setShowDescPreview:ao,priority:Na,setPriority:Ua,onDescriptionBlur:b?void 0:Ll,onDescriptionDiscard:b?void 0:()=>{at(Te.current),ao(!0)},originalDescription:b?void 0:Te.current,onPriorityChange:b?void 0:S=>{t&&(S!==Na&&Sl("priority",Na||"\\u2014",S||"\\u2014"),L(t.id,{priority:S||void 0}))},githubUrl:n,onFilePreview:x,onDeleteScreenshot:Hg,onPatch:L,liveFiles:so.length>0||Yo?so:void 0,allTags:Je,overrideTags:b?Ue:void 0,onTagsChange:b?Rt:void 0})}),!b&&t&&(0,A.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",flexShrink:0,marginTop:12,borderTop:"1px solid var(--p-border)",paddingTop:10},children:(0,A.jsx)(uy,{task:t})})]}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-activity-pane",style:{display:Me==="comments"&&!b?"":"none"},children:[(0,A.jsx)("div",{style:{borderBottom:"1px solid var(--p-border)",paddingBottom:8,flexShrink:0},children:(0,A.jsx)(Xd,{commentInput:qa,setCommentInput:lo,commentSubmitting:vl,onSubmit:()=>void pi(),baseRows:2})}),(0,A.jsx)(Wd,{comments:di,files:so,localChanges:$g,loading:fi,error:ci,gitUserName:o,taskAuthorName:t==null?void 0:t.authorName,baseUrl:l,taskId:t==null?void 0:t.id,taskCreatedAt:t==null?void 0:t.createdAt,taskUpdatedAt:t==null?void 0:t.updatedAt,onEdit:Bg,onDelete:Og,onDeleteFile:sf,onFilePreview:x})]}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-files-pane",style:{display:Me==="files"&&!b?"":"none"},children:[(0,A.jsx)($d,{files:so,loading:Yo,error:T,baseUrl:l,onPreview:S=>x(S.name,S.linkedPath?`${l}/api/tasks/${t==null?void 0:t.id}/files/${encodeURIComponent(S.name)}`:`${l}${S.url}`),onDelete:Wa?void 0:sf}),(0,A.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:8,flexShrink:0,display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",...Wa?{pointerEvents:"none",opacity:.5}:{}},children:[xe&&(0,A.jsx)("div",{style:{width:"100%",fontSize:11,color:"var(--p-red)",background:"rgba(255,80,80,0.08)",border:"1px solid rgba(255,80,80,0.2)",borderRadius:5,padding:"4px 8px"},children:xe}),(0,A.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",padding:"6px 10px",background:"var(--p-card)",border:"1px solid var(--p-border)",borderRadius:8,color:"var(--p-text-m)",fontSize:12,transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-border-t)",S.currentTarget.style.color="var(--p-text)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border)",S.currentTarget.style.color="var(--p-text-m)"},children:[(0,A.jsx)(Wo,{style:{width:12,height:12}}),"Upload",(0,A.jsx)("input",{id:"dp-file-upload",type:"file",style:{display:"none"},multiple:!0,onChange:zg})]}),(0,A.jsx)("span",{style:{fontSize:11,color:"var(--p-border-t)",marginLeft:"auto"},children:"or paste image"})]})]}),ve===!0&&(0,A.jsx)("div",{className:"dp-pane",id:"dp-agent-pane",style:{display:Me==="agent"&&!b&&t?"":"none"},children:t&&(0,A.jsx)(Zd,{task:t,run:y,onRun:(S,V,ee)=>k==null?void 0:k(S,V,ee),onStop:z??(()=>{}),onDequeue:N??(()=>{}),models:U,defaultModel:_,defaultAgent:be,onModelChange:ii,agents:ke,onAgentChange:ui,cliAvailable:!!W})})]}),(0,A.jsxs)("div",{className:"dp-footer",children:[!b&&(0,A.jsx)("button",{id:"dp-delete",onClick:()=>jo(!0),style:{color:"var(--p-red)",background:"none",border:"1px solid var(--p-border-t)",borderRadius:7,padding:"5px 12px",fontSize:12,cursor:"pointer",fontFamily:"inherit",transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-red)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border-t)"},children:"Delete"}),(0,A.jsx)("div",{style:{flex:1}}),b?(0,A.jsxs)(A.Fragment,{children:[Ie.length>0&&(0,A.jsxs)("span",{style:{fontSize:11,color:"var(--p-blue-300)",marginRight:8,background:"rgba(37,99,235,0.1)",border:"1px solid rgba(37,99,235,0.25)",borderRadius:6,padding:"3px 8px"},children:["\\u{1F4CE} ",Ie.length," screenshot",Ie.length!==1?"s":""," will attach on save"]}),(0,A.jsx)("button",{id:"dp-cancel",onClick:d,style:{padding:"5px 14px",borderRadius:7,fontSize:12,fontWeight:500,cursor:"pointer",border:"1px solid var(--p-border-t)",background:"var(--p-border)",color:"var(--p-text-sub)",fontFamily:"inherit",transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-text-g)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border-t)"},children:"Cancel"}),(0,A.jsx)("button",{id:"dp-save",onClick:()=>void lf(),style:{padding:"5px 18px",borderRadius:7,fontSize:12,fontWeight:500,cursor:"pointer",border:"1px solid var(--p-blue-700)",background:"var(--p-blue)",color:"var(--p-white)",fontFamily:"inherit",transition:"background .15s"},onMouseOver:S=>{S.currentTarget.style.background="var(--p-blue-700)"},onMouseOut:S=>{S.currentTarget.style.background="var(--p-blue)"},children:"Add Task"})]}):ve===!0&&Me==="agent"&&t?(0,A.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",justifyContent:"flex-end",flex:1},children:[(!y||y.status==="idle")&&(0,A.jsxs)("button",{id:"dp-run-agent",disabled:!W,onClick:()=>k==null?void 0:k(t.id,ro,Cr||void 0),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-purple)",background:W?"var(--p-purple)":"var(--p-surface)",color:W?"#fff":"var(--p-text-g)",fontSize:12,fontWeight:600,cursor:W?"pointer":"not-allowed",transition:"background .12s"},onMouseEnter:S=>{W&&(S.currentTarget.style.background="#9333ea")},onMouseLeave:S=>{W&&(S.currentTarget.style.background="var(--p-purple)")},title:W?void 0:\'Local CLI server not connected. Run "vibeflow serve" and refresh.\',children:[(0,A.jsx)(Kr,{style:{width:12,height:12}}),"Run Agent"]}),(y==null?void 0:y.status)==="running"&&(0,A.jsxs)("button",{id:"dp-stop-agent",onClick:()=>z==null?void 0:z(t.id),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:12,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 25%, transparent)"},onMouseLeave:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 15%, transparent)"},children:[(0,A.jsx)(Qr,{style:{width:12,height:12}}),"Stop"]}),(y==null?void 0:y.status)==="queued"&&(0,A.jsxs)("button",{id:"dp-dequeue-agent",onClick:()=>N==null?void 0:N(t.id),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:12,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 25%, transparent)"},onMouseLeave:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 15%, transparent)"},children:[(0,A.jsx)(rl,{style:{width:12,height:12}}),"Dequeue"]})]}):(0,A.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)",padding:"5px 4px"},children:"Changes are saved automatically"})]}),(0,A.jsx)(Sa,{open:si,title:"Delete task?",message:`You are about to permanently delete "${(t==null?void 0:t.title)||"this task"}". This action cannot be undone.`,confirmLabel:"Delete task",onConfirm:()=>{jo(!1),g(t.id),d()},onCancel:()=>jo(!1)})]}),Xo&&(0,A.jsx)("div",{style:{position:"fixed",inset:0,zIndex:201,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",background:"rgba(2,12,27,0.80)"},children:(0,A.jsxs)("div",{style:{background:"var(--p-surface)",border:"1px solid var(--p-border-s)",borderRadius:16,padding:"28px 32px",width:"100%",maxWidth:480,boxShadow:"var(--p-shadow-lg)",position:"relative"},children:[(0,A.jsx)("div",{style:{width:44,height:44,borderRadius:12,background:"rgba(139,92,246,0.12)",border:"1px solid rgba(139,92,246,0.25)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16},children:(0,A.jsx)(Wo,{style:{width:20,height:20,color:"var(--p-purple)"}})}),(0,A.jsx)("h2",{style:{margin:"0 0 8px",fontSize:17,fontWeight:700,color:"var(--p-text)"},children:"Send comment?"}),(0,A.jsx)("p",{style:{margin:"0 0 22px",fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:"You have an unsent comment. Do you want to send it before closing?"}),(0,A.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,A.jsx)("button",{onClick:()=>{Ia(!1),pi().then(()=>d())},style:{flex:1,padding:"9px 14px",borderRadius:8,background:"var(--p-purple)",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},children:"Send & Close"}),(0,A.jsx)("button",{type:"button",onClick:()=>{Ia(!1),lo(""),d()},style:{padding:"9px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer"},children:"Discard & Close"}),(0,A.jsx)("button",{type:"button",onClick:()=>Ia(!1),style:{padding:"9px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer"},children:"Keep editing"})]})]})})]})}function uy({task:e}){let t=[];if(e.component&&t.push((0,A.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 36%, transparent)",borderRadius:100,fontSize:10,color:"var(--p-purple-300)",fontFamily:"monospace"},children:["\\u2B21 ",e.component]},"component")),e.file||e.selector&&e.selector!=="/"||e.cssSelector){let r=e.file??"";e.line!=null&&(r+=`:${e.line}`),e.col!=null&&(r+=`:${e.col}`);let o=e.cssSelector??(e.selector&&e.selector!=="/"?e.selector:""),n=r||o;if(n){let l=n.length>40?`\\u2026${n.slice(-40)}`:n,s=e.url?e.url.length>30?`\\u2026${e.url.slice(-30)}`:e.url:"";t.push((0,A.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:0,borderRadius:6,overflow:"hidden",border:"1px solid color-mix(in srgb, var(--p-blue) 15%, transparent)",fontSize:10,fontFamily:"monospace",whiteSpace:"nowrap"},children:[(0,A.jsx)("span",{title:[r,o].filter(Boolean).join(" \\xB7 "),style:{padding:"2px 6px",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)"},children:l}),s&&(0,A.jsx)("span",{title:e.url,style:{padding:"2px 6px",background:"color-mix(in srgb, var(--p-border) 72%, transparent)",color:"var(--p-text-g)",borderLeft:"1px solid color-mix(in srgb, var(--p-blue) 18%, transparent)"},children:s})]},"source"))}}else if(e.url){let r=e.url.length>40?`\\u2026${e.url.slice(-40)}`:e.url;t.push((0,A.jsx)("span",{className:"dp-source-pill",title:e.url,children:r},"url"))}return e.reportBack&&t.push((0,A.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 24%, transparent)",borderRadius:100,fontSize:10,color:"var(--p-purple-300)"},children:"\\u21A9 report back"},"rb")),(0,A.jsx)("div",{id:"dp-meta-row",style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:t})}var to=E(Oe(),1);var se=E(j(),1),dy=[{id:"all",label:"All",dot:""},{id:"todo",label:"Todo",dot:"var(--p-amber)"},{id:"in-progress",label:"In Progress",dot:"var(--p-blue)"},{id:"review",label:"Review",dot:"var(--p-purple)"}],fy={todo:{background:"color-mix(in srgb, var(--p-amber) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-amber) 38%, transparent)",color:"var(--p-amber-300)"},"in-progress":{background:"color-mix(in srgb, var(--p-blue) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 38%, transparent)",color:"var(--p-blue-200)"},review:{background:"color-mix(in srgb, var(--p-purple) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 38%, transparent)",color:"var(--p-purple-300)"},done:{background:"color-mix(in srgb, var(--p-green) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 32%, transparent)",color:"var(--p-green-300)"},backlog:{background:"color-mix(in srgb, var(--p-text-g) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-text-g) 32%, transparent)",color:"var(--p-text-m)"},all:{background:"color-mix(in srgb, var(--p-blue) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 32%, transparent)",color:"var(--p-blue-200)"}};function tf({tasks:e,filter:t,onFilter:a,view:r="board",onViewChange:o,activityCounter:n}){let[l,s]=to.default.useState(!1),[i,d]=to.default.useState(!1),[f,m]=to.default.useState(!1),g=to.default.useMemo(()=>[...new Set(e.map(y=>y.type).filter(Boolean))].sort(),[e]),L=to.default.useMemo(()=>[...new Set(e.map(y=>y.author).filter(Boolean))].sort(),[e]),x=to.default.useMemo(()=>{let y=new Set;for(let k of e)for(let z of k.tags??[])y.add(z);return[...y].sort()},[e]);function I(y){return e.filter(k=>k.status===y).length}function H(y){a({...t,status:y}),s(!1),d(!1),m(!1)}function p(y){a({...t,type:y}),s(!1)}function u(y){a({...t,user:y}),d(!1)}function c(y){let k=t.tags??[],z=k.includes(y)?k.filter(N=>N!==y):[...k,y];a({...t,tags:z})}function v(y){y.stopPropagation();let k=y.currentTarget.dataset.status;k&&H(k)}let w={display:"flex",alignItems:"center",gap:5,padding:"3px 10px",borderRadius:6,fontSize:11,cursor:"pointer",border:"1px solid transparent",background:"transparent",color:"var(--p-text-f)",transition:"all .12s",fontFamily:"inherit",fontWeight:500},C={...w,background:"var(--p-card)",border:"1px solid var(--p-border)",color:"var(--p-text-f)",padding:"3px 10px",position:"relative"};return(0,se.jsxs)("div",{"data-proto-id":"filter-bar",style:{display:"flex",alignItems:"center",gap:6,padding:"7px 16px",background:"var(--p-surface)",borderBottom:"1px solid var(--p-border)",flexShrink:0},onClick:()=>{s(!1),d(!1),m(!1)},children:[(0,se.jsx)("div",{style:{display:"flex",alignItems:"center",gap:2},children:dy.map(y=>{let k=t.status===y.id,z=y.id!=="all"?I(y.id):null,N=k?fy[y.id]:{};return(0,se.jsxs)("button",{"data-status":y.id,style:{...w,...N},onMouseOver:U=>{k||(U.currentTarget.style.background="var(--p-hover)",U.currentTarget.style.color="var(--p-text-m)")},onMouseOut:U=>{k||(U.currentTarget.style.background="transparent",U.currentTarget.style.color="var(--p-text-f)")},onClick:v,children:[y.dot&&(0,se.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:y.dot,flexShrink:0,display:"inline-block"}}),y.label,z!=null&&(0,se.jsx)("span",{style:{color:k?"inherit":"var(--p-border-t)",fontSize:10,opacity:.8},children:z})]},y.id)})}),(0,se.jsx)("div",{style:{flex:1}}),n,t.user&&(0,se.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 24%, transparent)",fontSize:10,color:"var(--p-purple-300)"},children:[t.user,(0,se.jsx)("button",{onClick:()=>u(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-purple-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,se.jsx)(Xe,{style:{width:10,height:10}})})]}),t.type&&(0,se.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 24%, transparent)",fontSize:10,color:"var(--p-cyan-300)"},children:[t.type,(0,se.jsx)("button",{onClick:()=>p(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-cyan-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,se.jsx)(Xe,{style:{width:10,height:10}})})]}),(t.tags??[]).map(y=>{let{bg:k,text:z,border:N}=ua(y);return(0,se.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:k,border:`1px solid ${N}`,fontSize:10,color:z,fontWeight:600},children:[y,(0,se.jsx)("button",{onClick:()=>c(y),style:{display:"flex",background:"none",border:"none",color:z,cursor:"pointer",padding:0,lineHeight:1},children:(0,se.jsx)(Xe,{style:{width:10,height:10}})})]},y)}),(0,se.jsxs)("div",{style:{position:"relative"},children:[(0,se.jsxs)("button",{style:{...C,color:(t.tags??[]).length?"var(--p-green-300)":"var(--p-text-f)",borderColor:(t.tags??[]).length?"color-mix(in srgb, var(--p-green) 36%, transparent)":"var(--p-border)",opacity:x.length?1:.55},onClick:y=>{y.stopPropagation(),x.length&&(d(!1),s(!1),m(k=>!k))},children:[(0,se.jsx)(_o,{style:{width:12,height:12}}),"Tags",(t.tags??[]).length>0&&(0,se.jsx)("span",{style:{fontSize:9,background:"color-mix(in srgb, var(--p-green) 20%, transparent)",color:"var(--p-green-300)",borderRadius:100,padding:"0 4px"},children:(t.tags??[]).length}),(0,se.jsx)(ya,{style:{width:12,height:12}})]}),f&&x.length>0&&(0,se.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:160,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(t.tags??[]).length>0&&(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>a({...t,tags:[]}),children:"Clear tag filters"}),x.map(y=>{let{bg:k,text:z,border:N}=ua(y),U=(t.tags??[]).includes(y);return(0,se.jsxs)("button",{style:{width:"100%",textAlign:"left",padding:"6px 12px",fontSize:11,color:"var(--p-text-m)",background:U?"var(--p-hover)":"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:6},onMouseEnter:_=>{_.currentTarget.style.background="var(--p-hover)"},onMouseLeave:_=>{_.currentTarget.style.background=U?"var(--p-hover)":"none"},onClick:()=>c(y),children:[(0,se.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:z,border:`1px solid ${N}`,flexShrink:0}}),(0,se.jsx)("span",{style:{flex:1},children:y}),U&&(0,se.jsx)("span",{style:{color:z,fontSize:12,lineHeight:1},children:"\\u2713"})]},y)})]})]}),(0,se.jsxs)("div",{style:{position:"relative"},children:[(0,se.jsxs)("button",{style:{...C,color:t.user?"var(--p-purple-300)":"var(--p-text-f)",borderColor:t.user?"color-mix(in srgb, var(--p-purple) 36%, transparent)":"var(--p-border)",opacity:L.length?1:.55},onClick:y=>{y.stopPropagation(),L.length&&(s(!1),d(k=>!k))},children:[(0,se.jsx)(ol,{style:{width:12,height:12}}),"User",(0,se.jsx)(ya,{style:{width:12,height:12}})]}),i&&L.length>0&&(0,se.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:160,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>u(null),children:"All users"}),L.map(y=>(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.user===y?"var(--p-purple-300)":"var(--p-text-m)",background:t.user===y?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:k=>{t.user!==y&&(k.currentTarget.style.background="var(--p-hover)")},onMouseOut:k=>{t.user!==y&&(k.currentTarget.style.background="none")},onClick:()=>u(y),children:y},y))]})]}),(0,se.jsxs)("div",{style:{position:"relative"},children:[(0,se.jsxs)("button",{style:{...C,color:t.type?"var(--p-cyan-300)":"var(--p-text-f)",borderColor:t.type?"color-mix(in srgb, var(--p-blue) 36%, transparent)":"var(--p-border)",opacity:g.length?1:.55},onClick:y=>{y.stopPropagation(),g.length&&s(k=>!k)},children:[(0,se.jsx)(_o,{style:{width:12,height:12}}),"Type",(0,se.jsx)(ya,{style:{width:12,height:12}})]}),l&&g.length>0&&(0,se.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:140,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>p(null),children:"All types"}),g.map(y=>(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.type===y?"var(--p-cyan-300)":"var(--p-text-m)",background:t.type===y?"color-mix(in srgb, var(--p-blue) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:k=>{t.type!==y&&(k.currentTarget.style.background="var(--p-hover)")},onMouseOut:k=>{t.type!==y&&(k.currentTarget.style.background="none")},onClick:()=>p(y),children:y},y))]})]}),(0,se.jsxs)("div",{style:{display:"flex",alignItems:"center",background:"var(--p-card)",border:"1px solid var(--p-border)",borderRadius:8,padding:2,gap:0},children:[(0,se.jsx)("button",{title:"Board view",style:{padding:"4px 7px",borderRadius:5,background:r==="board"?"var(--p-surface)":"none",color:r==="board"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:y=>{y.stopPropagation(),o==null||o("board")},children:(0,se.jsx)(Zn,{style:{width:13,height:13}})}),(0,se.jsx)("button",{title:"List view",style:{padding:"4px 7px",borderRadius:5,background:r==="list"?"var(--p-surface)":"none",color:r==="list"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:y=>{y.stopPropagation(),o==null||o("list")},children:(0,se.jsx)(Jn,{style:{width:13,height:13}})})]})]})}var Lt=E(Oe(),1);var $=E(j(),1),cy=[{id:"board",label:"Board",icon:(0,$.jsx)(pr,{className:"w-3.5 h-3.5"})},{id:"enforcement",label:"Enforcement",icon:(0,$.jsx)(al,{className:"w-3.5 h-3.5"})},{id:"agent",label:"Agent",icon:(0,$.jsx)(Kt,{className:"w-3.5 h-3.5"})}];function rf({open:e,visibleCols:t,settings:a,onClose:r,onSave:o,models:n,agents:l}){var W,D;let s=n&&n.length>0?n:cl,[i,d]=Lt.default.useState("board"),[f,m]=Lt.default.useState({}),[g,L]=Lt.default.useState(a.autoCommit??!1),[x,I]=Lt.default.useState(a.autoComment??!1),[H,p]=Lt.default.useState(a.autoPush??!1),[u,c]=Lt.default.useState(a.createBranch??!1),[v,w]=Lt.default.useState(a.defaultModel??""),[C,y]=Lt.default.useState(a.defaultAgent??"build"),[k,z]=Lt.default.useState(a.perTypeModels??!1),[N,U]=Lt.default.useState(a.defaultModelBug??""),[_,re]=Lt.default.useState(a.defaultModelResearch??""),[ce,Se]=Lt.default.useState(a.defaultModelTask??""),[Z,ke]=Lt.default.useState(a.experimentalAgents??!1);Lt.default.useEffect(()=>{if(!e)return;let b={};gr.forEach(B=>{b[B.id]=t.includes(B.id)}),m(b),L(a.autoCommit??!1),I(a.autoComment??!1),p(a.autoPush??!1),c(a.createBranch??!1),w(a.defaultModel??""),y(a.defaultAgent??"build"),z(a.perTypeModels??!1),U(a.defaultModelBug??""),re(a.defaultModelResearch??""),Se(a.defaultModelTask??""),ke(a.experimentalAgents??!1),d("board")},[e,t,a]);function be(){let b=gr.filter(B=>f[B.id]).map(B=>B.id);o(b,{autoCommit:g,autoComment:x,autoPush:H,createBranch:u,defaultModel:v,defaultAgent:C,perTypeModels:k,defaultModelBug:N,defaultModelResearch:_,defaultModelTask:ce,experimentalAgents:Z}),r()}function ve(b){m(B=>({...B,[b]:!B[b]}))}return(0,$.jsxs)(Jr,{open:e,onClose:r,id:"settings-modal",width:"min(460px, 95vw)",icon:(0,$.jsx)(Xr,{style:{width:14,height:14,color:"var(--p-text-g)"}}),title:"Settings",headerActions:(0,$.jsx)("button",{id:"settings-close",onClick:r,style:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s"},onMouseOver:b=>{b.currentTarget.style.background="var(--p-surface)",b.currentTarget.style.color="var(--p-text-m)"},onMouseOut:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.color="var(--p-text-g)"},children:(0,$.jsx)(Xe,{style:{width:14,height:14}})}),footer:(0,$.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,$.jsx)("button",{id:"settings-cancel",onClick:r,className:"dp-status-btn",style:{padding:"5px 14px",fontSize:12},children:"Cancel"}),(0,$.jsx)("button",{id:"settings-apply",onClick:be,style:{padding:"5px 14px",fontSize:12,fontWeight:500,borderRadius:6,border:"1px solid color-mix(in srgb, var(--p-purple) 55%, transparent)",background:"color-mix(in srgb, var(--p-purple) 18%, transparent)",color:"var(--p-purple-300)",cursor:"pointer",transition:"background .12s"},onMouseOver:b=>{b.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 28%, transparent)"},onMouseOut:b=>{b.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 18%, transparent)"},children:"Apply"})]}),children:[(0,$.jsx)("div",{className:"dp-tabs",children:cy.map(b=>(0,$.jsxs)("button",{onClick:()=>d(b.id),className:`dp-tab${i===b.id?" active":""}`,style:{display:"flex",alignItems:"center",gap:6},children:[b.icon,b.label]},b.id))}),i==="board"&&(0,$.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:10},children:[(0,$.jsx)("div",{className:"dp-meta-label",children:"Visible Columns"}),gr.map(b=>(0,$.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none"},children:[(0,$.jsx)("input",{id:`settings-col-${b.id}`,type:"checkbox",checked:f[b.id]??!0,onChange:()=>ve(b.id),style:{width:14,height:14,accentColor:b.color,cursor:"pointer"}}),(0,$.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:b.color,flexShrink:0}}),(0,$.jsx)("span",{style:{fontSize:13,color:"var(--p-text-m)"},children:b.label})]},b.id))]}),i==="enforcement"&&(0,$.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:16},children:[(0,$.jsx)(oi,{id:"settings-auto-comment",label:"Require comment on review",description:"CLI enforces an implementation report when setting task status to review.",value:x,onChange:I}),(0,$.jsx)("div",{style:{height:1,background:"var(--p-border)",marginTop:-4,marginBottom:-4}}),(0,$.jsx)(oi,{id:"settings-create-branch",label:"Require branch per task",description:"CLI enforces a dedicated branch name when setting task status to review.",value:u,onChange:c}),(0,$.jsx)(oi,{id:"settings-auto-commit",label:"Auto-commit on review",description:"CLI automatically commits staged changes when setting task status to review.",value:g,onChange:L}),(0,$.jsx)(oi,{id:"settings-auto-push",label:"Auto-push after commit",description:`CLI pushes after auto-commit. Requires \'Auto-commit\' to be ON.${g?"":" (Enable Auto-commit first)"}`,value:H&&g,onChange:b=>p(b&&g)})]}),i==="agent"&&(0,$.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:14},children:[(0,$.jsxs)("div",{children:[(0,$.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none",marginBottom:4},children:[(0,$.jsx)("input",{id:"settings-experimental-agents",type:"checkbox",checked:Z,onChange:()=>ke(!Z),style:{width:14,height:14,accentColor:"var(--p-purple)",cursor:"pointer"}}),(0,$.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text-m)"},children:"Enable agent features (experimental)"})]}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginLeft:24},children:"Agent runs, queue, and model selection are experimental and may change."})]}),!Z&&(0,$.jsx)("div",{style:{padding:16,borderRadius:8,background:"var(--p-bg-2)",border:"1px dashed var(--p-border)",textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:"Agent features are disabled. Toggle above to enable."}),Z&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",style:{marginBottom:6},children:"Default Model"}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:"This model will be pre-selected when running the agent on a task."}),(0,$.jsx)(ri,{value:v,onChange:b=>w(b===v?"":b),models:s})]}),v&&(0,$.jsxs)("div",{style:{padding:10,borderRadius:7,background:"color-mix(in srgb, var(--p-green) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 30%, transparent)",fontSize:11,color:"var(--p-green-300)"},children:["\\u2713 Default model set to: ",(0,$.jsx)("strong",{children:(W=s.find(b=>b.id===v))==null?void 0:W.label})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",style:{marginBottom:6},children:"Default Agent"}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:"This agent will be used when running agent on a task without a specific agent set."}),(0,$.jsx)(Yd,{value:C,onChange:b=>y(b),agents:l??[]})]}),C&&(0,$.jsxs)("div",{style:{padding:10,borderRadius:7,background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 30%, transparent)",fontSize:11,color:"var(--p-purple-300)"},children:["\\u2713 Default agent set to: ",(0,$.jsx)("strong",{children:((D=l==null?void 0:l.find(b=>b.id===C))==null?void 0:D.name)??C})]}),(0,$.jsx)("div",{style:{height:1,background:"var(--p-border)",margin:"4px 0"}}),(0,$.jsxs)("div",{children:[(0,$.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none",marginBottom:4},children:[(0,$.jsx)("input",{id:"settings-per-type-models",type:"checkbox",checked:k,onChange:()=>z(!k),style:{width:14,height:14,accentColor:"var(--p-purple)",cursor:"pointer"}}),(0,$.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text-m)"},children:"Use different models per task type"})]}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginLeft:24},children:"Override the default model for specific task types."})]}),k&&(0,$.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12,paddingLeft:24},children:[(0,$.jsx)(af,{id:"dp-type-model-picker-bug",label:"Bug",color:"var(--p-red)",value:N,onChange:b=>U(b===N?"":b),models:s}),(0,$.jsx)(af,{id:"dp-type-model-picker-research",label:"Research",color:"var(--p-blue)",value:_,onChange:b=>re(b===_?"":b),models:s}),(0,$.jsx)(af,{id:"dp-type-model-picker-task",label:"Task",color:"var(--p-green)",value:ce,onChange:b=>Se(b===ce?"":b),models:s})]})]})]})]})}function oi({id:e,label:t,description:a,value:r,onChange:o}){return(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:t}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:a}),(0,$.jsxs)("div",{id:e,style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer"},onClick:()=>o(!r),children:[(0,$.jsxs)("div",{style:{position:"relative",width:36,height:20,flexShrink:0},children:[(0,$.jsx)("div",{style:{width:36,height:20,borderRadius:10,background:r?"var(--p-purple)":"var(--p-card)",border:`1px solid ${r?"var(--p-purple-300)":"var(--p-border)"}`,transition:"all .15s"}}),(0,$.jsx)("div",{style:{position:"absolute",top:3,left:r?18:3,width:14,height:14,borderRadius:"50%",background:r?"var(--p-purple-300)":"var(--p-text-muted)",transition:"all .15s"}})]}),(0,$.jsx)("span",{style:{fontSize:12,color:"var(--p-text-g)"},children:r?"On":"Off"})]})]})}function af({id:e,label:t,color:a,value:r,onChange:o,models:n}){let l=n.find(s=>s.id===r);return(0,$.jsxs)("div",{id:e,children:[(0,$.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[(0,$.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:a,flexShrink:0}}),(0,$.jsx)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-text-m)"},children:t})]}),(0,$.jsx)(ri,{value:r,onChange:o,models:n}),l&&(0,$.jsxs)("div",{style:{fontSize:10,color:"var(--p-text-g)",marginTop:4,paddingLeft:4},children:["\\u2192 ",l.label]})]})}var li=E(Oe(),1);var Fe=E(j(),1);function kg(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function ni(e){return/\\.md$/i.test(e)}function of({open:e,name:t,url:a,onClose:r}){let[o,n]=li.default.useState(null),[l,s]=li.default.useState(!1);return li.default.useEffect(()=>{!e||!a||(ni(t)?(s(!0),n(null),fetch(a).then(i=>i.text()).then(i=>{n(i),s(!1)}).catch(()=>{n("Error loading file."),s(!1)})):n(null))},[e,t,a]),(0,Fe.jsx)(Jr,{open:e,onClose:r,id:"file-preview-modal",width:"min(1100px, 95vw)",maxHeight:"88vh",boxStyle:{display:"flex",flexDirection:"column"},icon:(0,Fe.jsx)(qo,{className:"w-4 h-4 text-slate-400"}),title:t,headerActions:(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("a",{href:a,download:t,className:"text-slate-400 hover:text-slate-200 transition-colors p-1.5 rounded-md hover:bg-slate-700/60",title:"Download",children:(0,Fe.jsx)($r,{className:"w-4 h-4"})}),(0,Fe.jsx)("button",{id:"file-preview-close",onClick:r,className:"text-slate-400 hover:text-slate-200 transition-colors p-1.5 rounded-md hover:bg-slate-700/60",title:"Close",children:(0,Fe.jsx)(Xe,{className:"w-4 h-4"})})]}),footer:(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("a",{href:a,download:t,className:"flex items-center gap-1.5 border border-slate-700 hover:bg-slate-800 text-slate-300 text-sm px-3 py-1.5 rounded-lg transition-colors",children:[(0,Fe.jsx)($r,{className:"w-3.5 h-3.5"}),"Download"]}),(0,Fe.jsx)("button",{id:"file-preview-close-footer",onClick:r,className:"border border-slate-700 hover:bg-slate-800 text-slate-300 text-sm px-4 py-1.5 rounded-lg transition-colors",children:"Close"})]}),children:(0,Fe.jsxs)("div",{className:"flex-1 overflow-auto",style:{minHeight:0,padding:"16px 20px"},children:[kg(t)&&(0,Fe.jsx)("div",{style:{borderRadius:8,overflow:"hidden",border:"1px solid var(--p-border)",background:"var(--p-card)",display:"inline-block",width:"100%"},children:(0,Fe.jsx)("img",{src:a,alt:t,style:{maxWidth:"100%",display:"block",margin:"0 auto",objectFit:"contain"}})}),ni(t)&&l&&(0,Fe.jsx)("p",{className:"text-xs text-slate-500 py-4",children:"Loading\\u2026"}),ni(t)&&!l&&o!==null&&(0,Fe.jsx)("div",{id:"file-preview-md",style:{background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:"10px 14px",fontSize:13,color:"var(--p-text-sub)",lineHeight:1.65},children:(0,Fe.jsx)(vr,{markdown:o})}),!kg(t)&&!ni(t)&&(0,Fe.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-slate-500",children:[(0,Fe.jsx)(qo,{className:"w-10 h-10 opacity-40"}),(0,Fe.jsx)("p",{className:"text-sm",children:"Preview not available for this file type."}),(0,Fe.jsxs)("a",{href:a,download:t,className:"flex items-center gap-1.5 text-violet-400 hover:text-violet-300 hover:underline text-sm transition-colors",children:[(0,Fe.jsx)($r,{className:"w-3.5 h-3.5"}),"Download file"]})]})]})})}var pl=E(Oe(),1);var we=E(j(),1);function py(e){if(!e)return"";let t=Date.now()-new Date(e).getTime(),a=Math.floor(t/6e4),r=Math.floor(t%6e4/1e3);return`${a}m ${r.toString().padStart(2,"0")}s`}var bg={running:"var(--p-blue)",queued:"var(--p-amber)",done:"var(--p-green)",failed:"var(--p-red)"},my={running:"Running",queued:"Queued",done:"Completed",failed:"Failed"};function nf({open:e,runs:t,onStop:a,onOpenTask:r,onClose:o}){let n=pl.default.useRef(null),[l,s]=pl.default.useState({});if(pl.default.useEffect(()=>{if(!e)return;let f=setInterval(()=>{let m={};for(let g of t)g.status==="running"&&g.startedAt&&(m[g.taskId]=py(g.startedAt));s(m)},1e3);return()=>clearInterval(f)},[e,t]),pl.default.useEffect(()=>{if(!e)return;function f(m){n.current&&!n.current.contains(m.target)&&o()}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[e,o]),!e)return null;let i=t.filter(f=>f.status==="running"||f.status==="queued"),d=t.filter(f=>f.status==="done"||f.status==="failed");return(0,we.jsxs)("div",{ref:n,id:"agent-queue-panel",style:{position:"fixed",top:0,right:0,bottom:0,width:"min(420px, 90vw)",background:"var(--p-surface)",borderLeft:"1px solid var(--p-border)",zIndex:40,display:"flex",flexDirection:"column",boxShadow:"var(--p-shadow-lg)"},children:[(0,we.jsxs)("div",{style:{padding:"14px 16px",borderBottom:"1px solid var(--p-border)",display:"flex",alignItems:"center",gap:10},children:[(0,we.jsx)(Kt,{style:{width:16,height:16,color:"var(--p-purple-300)"}}),(0,we.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1},children:"Agent Queue"}),(0,we.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-g)",background:"var(--p-bg-2)",padding:"2px 8px",borderRadius:10},children:[i.length," active \\xB7 ",d.length," completed"]}),(0,we.jsx)("button",{id:"agent-queue-close",onClick:o,style:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer"},onMouseEnter:f=>{f.currentTarget.style.background="var(--p-surface)",f.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color="var(--p-text-g)"},children:(0,we.jsx)(Xe,{style:{width:14,height:14}})})]}),(0,we.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:12,display:"flex",flexDirection:"column",gap:8},children:[t.length===0&&(0,we.jsx)("div",{style:{padding:24,textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:"No agent runs yet. Open a task and click the Agent tab to start."}),t.map(f=>(0,we.jsxs)("div",{style:{padding:"10px 12px",borderRadius:8,border:`1px solid ${f.status==="running"?"color-mix(in srgb, var(--p-blue) 30%, transparent)":"var(--p-border)"}`,background:f.status==="running"?"color-mix(in srgb, var(--p-blue) 6%, transparent)":"var(--p-bg-2)",cursor:"pointer",transition:"background .12s"},onClick:()=>r(f.taskId),onMouseEnter:m=>{m.currentTarget.style.background=f.status==="running"?"color-mix(in srgb, var(--p-blue) 10%, transparent)":"var(--p-hover)"},onMouseLeave:m=>{m.currentTarget.style.background=f.status==="running"?"color-mix(in srgb, var(--p-blue) 6%, transparent)":"var(--p-bg-2)"},children:[(0,we.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[f.status==="running"&&(0,we.jsx)("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),f.status==="queued"&&(0,we.jsx)("span",{style:{color:"var(--p-amber)",fontSize:12},children:"\\u23F3"}),f.status==="done"&&(0,we.jsx)("span",{style:{color:"var(--p-green)",fontSize:12},children:"\\u2713"}),f.status==="failed"&&(0,we.jsx)("span",{style:{color:"var(--p-red)",fontSize:12},children:"\\u2717"}),(0,we.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text)",flex:1},children:f.taskTitle}),(0,we.jsx)("span",{style:{fontSize:10,fontWeight:500,color:bg[f.status]??"var(--p-text-g)",padding:"1px 6px",borderRadius:4,background:`${bg[f.status]??"var(--p-text-g)"}15`},children:my[f.status]??f.status})]}),(0,we.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:10,color:"var(--p-text-g)"},children:[f.model&&(0,we.jsxs)("span",{children:["Model: ",f.model]}),f.status==="running"&&l[f.taskId]&&(0,we.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:3},children:[(0,we.jsx)(cr,{style:{width:9,height:9}}),l[f.taskId]]})]}),f.logs.length>0&&(0,we.jsx)("div",{style:{marginTop:8,padding:"6px 8px",background:"#0a0c10",borderRadius:6,fontFamily:"\'SF Mono\', \'Fira Code\', monospace",fontSize:9,lineHeight:1.5,color:"#a3e635",maxHeight:80,overflowY:"auto"},children:f.logs.slice(-3).map((m,g)=>(0,we.jsx)("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:m.startsWith("$")?(0,we.jsx)("span",{style:{color:"var(--p-text-g)"},children:m}):m.startsWith("\\u2713")?(0,we.jsx)("span",{style:{color:"var(--p-green)"},children:m}):m.startsWith("\\u25B6")||m.startsWith("\\u2192")?(0,we.jsx)("span",{style:{color:"var(--p-blue-300)"},children:m}):m.startsWith("\\u2717")||m.startsWith("Error")?(0,we.jsx)("span",{style:{color:"var(--p-red)"},children:m}):m},g))}),f.status==="running"&&(0,we.jsxs)("button",{onClick:m=>{m.stopPropagation(),a(f.taskId)},style:{marginTop:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:5,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:10,fontWeight:600,cursor:"pointer"},children:[(0,we.jsx)(Qr,{style:{width:8,height:8}}),"Stop"]})]},f.taskId))]})]})}var Lr=window.location.origin,fa=`${Lr}/api/tasks`,ut={async getTasks(){return(await fetch(`${fa}?_=${Date.now()}`,{cache:"no-store"})).json()},async createTask(e){return(await fetch(fa,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()},async updateTask(e,t){return(await fetch(`${fa}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()},async deleteTask(e){await fetch(`${fa}/${e}`,{method:"DELETE"})},async getComments(e){return(await fetch(`${fa}/${e}/comments`)).json()},async addComment(e,t){await fetch(`${fa}/${e}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:"user",text:t,source:"web"})})},async updateComment(e,t,a){await fetch(`${fa}/${e}/comments/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})})},async deleteComment(e,t){await fetch(`${fa}/${e}/comments/${t}`,{method:"DELETE"})},async getFiles(e){return(await fetch(`${fa}/${e}/files`)).json()},async uploadFile(e,t){let a=await t.arrayBuffer();await fetch(`${fa}/${e}/files/${encodeURIComponent(t.name)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:a})},async deleteFile(e,t){await fetch(`${fa}/${e}/files/${encodeURIComponent(t)}`,{method:"DELETE"})},async getProject(){return(await fetch(`${Lr}/api/project`)).json()},async getCopilotStatus(){return(await fetch(`${Lr}/api/copilot/status`)).json()},async copilotLogin(){return(await fetch(`${Lr}/api/copilot/login`,{method:"POST"})).json().catch(()=>({}))},async getSettings(){return(await fetch(`${Lr}/api/settings`,{cache:"no-store"})).json()},async saveSettings(e){await fetch(`${Lr}/api/settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},wsUrl(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`},async getModels(){var a;let t=await(await fetch(`${Lr}/trpc/models`,{cache:"no-store"})).json();return((a=t==null?void 0:t.result)==null?void 0:a.data)??{models:[],error:"Invalid response"}},async getAgents(){return{agents:(await(await fetch(`${Lr}/api/agent/agents`,{cache:"no-store"})).json()).agents??[],error:null}}};var ne=E(j(),1),gy=window.__PORT__??3700,hy=window.__SAAS_MODE__??!1,Tg=window.__BOARD_URL__??"",xy=window.__BOARD_NAME__??"",Mg=window.__IS_ADMIN__??!1;function vy({onClose:e}){let t=window.location.origin,[a,r]=ie.default.useState("idle"),[o,n]=ie.default.useState(!0),[l,s]=ie.default.useState(null),[i,d]=ie.default.useState("");async function f(){r("pushing"),d("");try{let g=await fetch(`${t}/api/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepLocalFiles:o})}),L=await g.json();if(!g.ok){d(L.error??"Push failed"),r("error");return}s({imported:L.imported??0,skipped:L.skipped}),r("done")}catch(g){d(g instanceof Error?g.message:"Network error"),r("error")}}let m=a==="pushing";return(0,ne.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(5, 8, 18, 0.72)",backdropFilter:"blur(10px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20,fontFamily:"Inter, system-ui, -apple-system, sans-serif"},children:(0,ne.jsxs)("div",{style:{background:"#101827",border:"1px solid rgba(255,255,255,0.07)",borderRadius:24,maxWidth:380,width:"100%",boxShadow:"0 0 0 1px rgba(59,130,246,0.07), 0 40px 80px rgba(0,0,0,0.75)",overflow:"hidden",position:"relative"},children:[(0,ne.jsx)("div",{style:{position:"absolute",top:0,left:"20%",right:"20%",height:1,background:"linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent)"}}),(0,ne.jsxs)("div",{style:{padding:"36px 36px 20px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,ne.jsx)("div",{style:{position:"relative",width:52,height:52,marginBottom:22},children:(0,ne.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ne.jsx)("rect",{width:"18",height:"18",rx:"4",fill:"#2563eb"}),(0,ne.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"white",opacity:"0.7"}),(0,ne.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"white"}),(0,ne.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"white",opacity:"0.7"}),(0,ne.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"white",opacity:"0.85"})]})}),(0,ne.jsx)("h1",{style:{fontSize:18,fontWeight:700,color:"#f1f5f9",letterSpacing:"-0.3px",margin:"0 0 7px"},children:"Online Mode Active"}),(0,ne.jsxs)("p",{style:{fontSize:12,color:"rgba(255,255,255,0.36)",lineHeight:1.5,margin:0},children:["Connected to"," ",(0,ne.jsx)("strong",{style:{color:"rgba(255,255,255,0.55)",fontWeight:500},children:xy||"Vibeflow SaaS"})]})]}),a==="done"&&l&&(0,ne.jsxs)("div",{style:{margin:"0 28px 0",padding:"10px 14px",borderRadius:9,fontSize:12,display:"flex",alignItems:"center",gap:9,background:"rgba(16,185,129,0.08)",border:"1px solid rgba(16,185,129,0.18)",color:"#34d399"},children:[(0,ne.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",children:(0,ne.jsx)("path",{d:"M13 5L6.5 11.5 3 8",stroke:"#34d399",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),l.imported," task",l.imported!==1?"s":""," pushed to board",l.skipped!=null&&l.skipped>0?` \\xB7 ${l.skipped} already existed`:""]}),a==="error"&&i&&(0,ne.jsx)("div",{style:{margin:"0 28px 0",padding:"10px 14px",borderRadius:9,fontSize:12,display:"flex",alignItems:"center",gap:9,background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.18)",color:"#f87171"},children:i}),(0,ne.jsxs)("div",{style:{padding:"20px 24px 28px",display:"flex",flexDirection:"column",gap:8},children:[Tg&&(0,ne.jsx)("a",{href:Tg,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,padding:14,background:"#2563eb",border:"none",borderRadius:12,color:"#fff",fontSize:14,fontWeight:600,cursor:"pointer",textDecoration:"none",letterSpacing:"-0.1px",transition:"background 0.15s, transform 0.1s"},onMouseEnter:g=>{g.currentTarget.style.background="#3b82f6",g.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:g=>{g.currentTarget.style.background="#2563eb",g.currentTarget.style.transform="none"},children:"Open Web App \\u2192"}),a!=="done"&&(0,ne.jsx)("button",{onClick:()=>void f(),disabled:m,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,padding:12,background:"transparent",border:"1px solid rgba(255,255,255,0.08)",borderRadius:12,color:m?"rgba(255,255,255,0.25)":"rgba(255,255,255,0.4)",fontSize:13,fontWeight:500,cursor:m?"not-allowed":"pointer",transition:"border-color 0.15s, color 0.15s, background 0.15s"},onMouseEnter:g=>{m||(g.currentTarget.style.borderColor="rgba(255,255,255,0.15)",g.currentTarget.style.color="rgba(255,255,255,0.65)",g.currentTarget.style.background="rgba(255,255,255,0.03)")},onMouseLeave:g=>{m||(g.currentTarget.style.borderColor="rgba(255,255,255,0.08)",g.currentTarget.style.color="rgba(255,255,255,0.4)",g.currentTarget.style.background="transparent")},children:m?"\\u23F3 Pushing\\u2026":"\\u2191 Push local tasks"})]}),(0,ne.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px 20px"},children:[(0,ne.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:7,cursor:"pointer"},children:[(0,ne.jsx)("input",{type:"checkbox",checked:o,onChange:g=>n(g.target.checked),style:{accentColor:"#2563eb",width:13,height:13,cursor:"pointer"}}),(0,ne.jsx)("span",{style:{fontSize:11.5,color:"rgba(255,255,255,0.28)"},children:"Keep local files"})]}),Mg&&e&&(0,ne.jsx)("button",{onClick:e,style:{fontSize:11,color:"rgba(255,255,255,0.2)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2,transition:"color 0.15s"},onMouseEnter:g=>{g.currentTarget.style.color="rgba(255,255,255,0.45)"},onMouseLeave:g=>{g.currentTarget.style.color="rgba(255,255,255,0.2)"},children:"Dismiss (admin)"})]})]})})}var Pg={backlog:"Backlog",todo:"Todo","in-progress":"In Progress",review:"Review",done:"Done"};function yy(e,t,a){let r=a?e.filter(s=>{var i,d;return((i=s.title)==null?void 0:i.toLowerCase().includes(a))||((d=s.description)==null?void 0:d.toLowerCase().includes(a))}):e;if(a)return`${r.length} of ${e.length} tasks`;let o=r.filter(s=>s.status!=="done").length,n=r.filter(s=>s.status==="in-progress").length,l=r.filter(s=>s.status==="review").length;return`${o} open \\xB7 ${n} in-progress \\xB7 ${l} in review`}function Ag(){var Qo,Yo;let[e,t]=ie.default.useState([]),[a,r]=ie.default.useState(!0),[o,n]=ie.default.useState(!1),[l,s]=ie.default.useState({open:!1,task:null,tab:"details"}),[i,d]=ie.default.useState("board"),[f,m]=ie.default.useState(!1),[g,L]=ie.default.useState({open:!1,name:"",url:""}),[x,I]=ie.default.useState(420),[H,p]=ie.default.useState(!1),[u,c]=ie.default.useState(""),[v,w]=ie.default.useState(gr.map(h=>h.id)),[C,y]=ie.default.useState({status:"all",component:null,type:null,user:null,tags:[]}),[k,z]=ie.default.useState("Proto Board"),[N,U]=ie.default.useState(!1),[_,re]=ie.default.useState(!1),[ce,Se]=ie.default.useState("You"),[Z,ke]=ie.default.useState(null),[be,ve]=ie.default.useState(""),[W,D]=ie.default.useState({}),[b,B]=ie.default.useState([]),[te,Ie]=ie.default.useState([]),Be=ie.default.useRef(null),We=ie.default.useRef(null),oe=ie.default.useRef(null),[Te,Je]=ie.default.useState([]),Me=ie.default.useRef(!1),Pe=ie.default.useRef([]),[Ke,ye]=ie.default.useState([]),[De,at]=ie.default.useState([]),[Ot,zt]=ie.default.useState(!1),[Yt,Pt]=ie.default.useState(new Set),[Na,Ua]=ie.default.useState(!1);function ml(h,T,F){let J=Pe.current.find(O=>O.id===h);if(!J)return;J.status!=="in-progress"&&ca(h,{status:"in-progress"});let ue=F||J.agent||W.defaultAgent||"build",fe=`opencode run --model ${T} --agent ${ue} --dangerously-skip-permissions --format json -- ...`;at(O=>{if(O.some(le=>le.taskId===h&&(le.status==="running"||le.status==="queued")))return O;let ae=O.some(le=>le.status==="running"),xe={taskId:h,taskTitle:J.title,status:ae?"queued":"running",model:T,worktree:`wt/task-${h.slice(0,8)}`,branch:`agent/task-${h.slice(0,8)}`,startedAt:ae?void 0:new Date().toISOString(),logs:ae?["\\u23F3 Queued \\u2014 waiting for current run to finish"]:["\\u25B6 Starting agent run\\u2026",`$ ${fe}`]};return[...O,xe]}),fetch(`${no}/api/agent/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:h,model:T,agent:ue})}).then(async O=>{if(!O.ok){let ae=await O.json().catch(()=>({error:"Failed to start agent"}));at(xe=>xe.map(le=>le.taskId===h?{...le,status:"failed",logs:[...le.logs,`\\u2717 ${ae.error??"Failed to start agent"}`]}:le))}}).catch(O=>{at(ae=>ae.map(xe=>xe.taskId===h?{...xe,status:"failed",logs:[...xe.logs,`\\u2717 Network error: ${O.message}`]}:xe))})}function ao(h){fetch(`${no}/api/agent/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:h})}).catch(()=>{}),at(T=>{let F=T.some(ue=>ue.taskId===h&&ue.status==="running"),J=T.map(ue=>ue.taskId===h&&ue.status==="running"?{...ue,status:"failed",logs:[...ue.logs,"\\u2717 Stopped by user"]}:ue);if(F){let ue=J.find(fe=>fe.status==="queued");if(ue)return J.map(fe=>fe.taskId===ue.taskId?{...fe,status:"running",startedAt:new Date().toISOString(),logs:[...fe.logs,"\\u25B6 Starting agent run\\u2026"]}:fe)}return J})}function si(h){at(T=>T.filter(F=>F.taskId!==h))}function jo(h){Pt(T=>{let F=new Set(T);return F.has(h)?F.delete(h):F.add(h),F})}function Xo(h){zt(!0),Pt(new Set([h]))}function Ia(h){for(let T of h)ml(T,"claude-sonnet-4-5");zt(!1),Pt(new Set)}ie.default.useEffect(()=>(Zt(),Sr(),hl(),Ir(),Ca(),ro(),oo(),Cr(),()=>{var h;We.current&&clearTimeout(We.current),(h=Be.current)==null||h.close()}),[]),ie.default.useEffect(()=>{document.body.setAttribute("data-theme","dark")},[]),ie.default.useEffect(()=>{function h(){let J=window.location.hash.match(/^#task-([a-f0-9]{30})$/i);if(!J){oe.current=null;return}let ue=J[1].toLowerCase();if(oe.current===ue)return;let fe=e.find(O=>O.id.toLowerCase()===ue);fe&&(oe.current=ue,Me.current?s(O=>({...O,open:!0,task:fe,tab:"details"})):s(O=>(O.task&&O.task.id!==fe.id&&Je(ae=>[...ae,O.task]),{...O,open:!0,task:fe,tab:"details"})),Me.current=!1)}function T(){}h();let F=()=>{oe.current=null,h()};return window.addEventListener("hashchange",F),window.addEventListener("vibeflow-task-ref-click",T),()=>{window.removeEventListener("hashchange",F),window.removeEventListener("vibeflow-task-ref-click",T)}},[e]),ie.default.useEffect(()=>{if(!l.open||!l.task)return;let h=e.find(J=>J.id===l.task.id);if(!h)return;let T=l.task;Object.keys(h).some(J=>h[J]!==T[J])&&s(J=>({...J,task:h}))},[e,l.open,(Qo=l.task)==null?void 0:Qo.id]),ie.default.useEffect(()=>{function h(T){var ue,fe,O;let F=(ue=T.target)==null?void 0:ue.tagName,J=F==="INPUT"||F==="TEXTAREA"||((fe=T.target)==null?void 0:fe.isContentEditable);if(T.key==="Escape"){if(Ot){zt(!1),Pt(new Set);return}if(g.open){L(ae=>({...ae,open:!1}));return}if(l.open){s(ae=>({...ae,open:!1}));return}if(f){m(!1);return}}if(!J&&((T.key==="?"||T.key==="/"&&T.shiftKey)&&((O=document.getElementById("header-shortcuts-hint"))==null||O.click()),T.altKey&&!T.ctrlKey&&!T.metaKey&&(T.key==="n"||T.key==="N")&&(T.preventDefault(),Ha(null,"details")),T.altKey&&!T.ctrlKey&&!T.metaKey&&(T.key==="f"||T.key==="F"))){T.preventDefault();let ae=document.getElementById("global-search");ae==null||ae.focus(),ae==null||ae.select()}}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[g.open,l.open,f,Ot]);function St(h,T,F,J,ue){let fe=new Date().toISOString(),O=Pg[T]??T,ae=Pg[F]??F,xe=Date.now()-3e3;ye(le=>le.some(R=>R.taskId===h&&R.to===ae&&new Date(R.timestamp).getTime()>xe)?le:[...le,{taskId:h,field:"status",from:O,to:ae,actor:J,timestamp:fe,source:ue}].slice(-500))}async function Zt(){try{let h=await ut.getTasks();Pe.current=h.tasks??[],t(h.tasks??[])}catch{}finally{r(!1)}}let gl=ie.default.useCallback((h,T,F)=>{let J=String(h.id??"");if(!J)return;let ue=h.created??h.createdAt,fe=h.updated?String(h.updated):void 0,O=Array.isArray(h.comments)?h.comments.length:void 0,ae=Array.isArray(h.files)?h.files.length:void 0,xe=h.status?String(h.status):void 0,le=Pe.current.find(ge=>ge.id===J);xe&&le&&le.status!==xe&&St(J,le.status,xe,T??"Someone",F),t(ge=>{let R=ge.find(nt=>nt.id===J),Ue={id:J,title:h.title?String(h.title):(R==null?void 0:R.title)??"Untitled",description:h.description!=null?String(h.description):(R==null?void 0:R.description)??"",status:xe??(R==null?void 0:R.status)??"todo",type:h.type?String(h.type):R==null?void 0:R.type,priority:h.priority?String(h.priority):R==null?void 0:R.priority,agent:h.agent?String(h.agent):R==null?void 0:R.agent,model:h.model?String(h.model):R==null?void 0:R.model,selector:h.selector?String(h.selector):R==null?void 0:R.selector,cssSelector:h.cssSelector?String(h.cssSelector):R==null?void 0:R.cssSelector,file:h.file?String(h.file):R==null?void 0:R.file,line:typeof h.line=="number"?h.line:R==null?void 0:R.line,col:typeof h.col=="number"?h.col:R==null?void 0:R.col,component:h.component?String(h.component):R==null?void 0:R.component,url:h.url?String(h.url):R==null?void 0:R.url,reportBack:h.reportBack===!0||(R==null?void 0:R.reportBack)===!0,commit:h.commit?String(h.commit):R==null?void 0:R.commit,commits:Array.isArray(h.commits)?h.commits:R==null?void 0:R.commits,commentCount:O??(R==null?void 0:R.commentCount),fileCount:ae??(R==null?void 0:R.fileCount),createdAt:ue?String(ue):(R==null?void 0:R.createdAt)??new Date().toISOString(),updatedAt:fe??(R==null?void 0:R.updatedAt),author:h.author?String(h.author):R==null?void 0:R.author,tags:Array.isArray(h.tags)?h.tags:R==null?void 0:R.tags,sortKey:h.sortKey?String(h.sortKey):R==null?void 0:R.sortKey},Rt=ge.filter(nt=>nt.id!==J);return Rt.push(Ue),Rt.sort((nt,Nt)=>{let wr=new Date(nt.updatedAt??nt.createdAt??"").getTime(),kr=new Date(Nt.updatedAt??Nt.createdAt??"").getTime();return wr===kr?nt.id.localeCompare(Nt.id):kr-wr}),Pe.current=Rt,Rt})},[]);async function Sr(){try{let h=await ut.getProject();h.name&&z(h.name),h.gitUserName&&Se(h.gitUserName)}catch{}}async function Ca(){try{let h=await fetch("/api/github-url").then(T=>T.json());ke(h.githubUrl??null)}catch{}}async function hl(){var h;try{let F=await ut.getSettings();F.experimentalAgents===void 0&&(F.experimentalAgents=!0),D(F),(h=F.visibleCols)!=null&&h.length&&w(F.visibleCols),F.viewMode&&d(F.viewMode),F.panelWidth&&F.panelWidth>=280&&F.panelWidth<=900&&I(F.panelWidth)}catch{}}async function Ir(){try{let h=await ut.getCopilotStatus();h!=null&&h.authenticated&&(h!=null&&h.username)?ve(`Copilot: ${h.username}`):ve("Copilot: not logged in")}catch{}}async function ro(){try{if(ut.getModels){let h=await ut.getModels();h.models&&h.models.length>0&&B(h.models)}}catch{}}async function oo(){try{if(ut.getAgents){let h=await ut.getAgents();h.agents&&h.agents.length>0&&Ie(h.agents)}}catch{}}function Cr(){let T=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,F=new WebSocket(T);Be.current=F,F.addEventListener("open",()=>{U(!0),re(!0),Zt()}),F.addEventListener("close",()=>{U(!1),We.current=setTimeout(Cr,1500)}),F.addEventListener("message",ue=>{var fe;try{let O=JSON.parse(ue.data);if(O.type==="tasks-updated"||(fe=O.type)!=null&&fe.startsWith("task:")){Zt();return}if(O.type==="task-changed"&&O.task){let ae=O.task,xe=typeof ae.alteredBy=="string"?ae.alteredBy:typeof ae.author=="string"?ae.author:"Someone",le=O.source==="cli"?"cli":void 0;gl(ae,xe,le);return}if(O.type==="task-deleted"&&O.taskId){let ae=String(O.taskId);t(xe=>{let le=xe.filter(ge=>ge.id!==ae);return Pe.current=le,le})}if(O.type==="agent-run-started"){at(ae=>{if(ae.find(Ue=>Ue.taskId===O.taskId&&(Ue.status==="running"||Ue.status==="queued")))return ae;let le=Pe.current.find(Ue=>Ue.id===O.taskId),ge=ae.some(Ue=>Ue.status==="running"),R={taskId:O.taskId,taskTitle:(le==null?void 0:le.title)??O.taskId.slice(0,8),status:ge?"queued":"running",model:O.model,worktree:`wt/task-${O.taskId.slice(0,8)}`,branch:`agent/task-${O.taskId.slice(0,8)}`,startedAt:ge?void 0:new Date().toISOString(),logs:[O.command??"\\u25B6 Starting agent run\\u2026"]};return[...ae,R]});return}if(O.type==="agent-run-log"){at(ae=>ae.map(xe=>{if(xe.taskId!==O.taskId)return xe;let le={...xe,logs:[...xe.logs,O.log]};for(let ge of O.log.split(`\n`)){let R=ge.trim();if(!(!R||!R.startsWith("{")))try{let Ue=JSON.parse(R);if(Ue.type==="step_finish"&&typeof Ue.part=="object"&&Ue.part){let Rt=Ue.part,nt=Rt.tokens,Nt=typeof Rt.cost=="number"?Rt.cost:0;nt&&(le.inputTokens=(le.inputTokens??0)+(nt.input??0),le.outputTokens=(le.outputTokens??0)+(nt.output??0),le.totalTokens=(le.totalTokens??0)+(nt.total??0),le.reasoningTokens=(le.reasoningTokens??0)+(nt.reasoning??0),le.cost=(le.cost??0)+Nt)}}catch{}}return le}));return}if(O.type==="agent-run-finished"){at(ae=>{let xe=ae.map(ge=>ge.taskId===O.taskId?{...ge,status:O.success?"done":"failed",completedAt:new Date().toISOString(),logs:[...ge.logs,O.success?"\\u2713 Agent run completed":`\\u2717 Agent run failed (exit ${O.exitCode})`],inputTokens:typeof O.inputTokens=="number"?O.inputTokens:ge.inputTokens,outputTokens:typeof O.outputTokens=="number"?O.outputTokens:ge.outputTokens,totalTokens:typeof O.totalTokens=="number"?O.totalTokens:ge.totalTokens,reasoningTokens:typeof O.reasoningTokens=="number"?O.reasoningTokens:ge.reasoningTokens,cost:typeof O.cost=="number"?O.cost:ge.cost,durationMs:ge.startedAt?Date.now()-new Date(ge.startedAt).getTime():void 0}:ge);if(!xe.find(ge=>ge.status==="running")){let ge=xe.find(R=>R.status==="queued");if(ge)return xe.map(R=>R.taskId===ge.taskId?{...R,status:"running",startedAt:new Date().toISOString(),logs:[...R.logs,"\\u25B6 Starting agent run\\u2026"]}:R)}return xe});return}}catch{}});let J=setInterval(()=>{F.readyState===WebSocket.OPEN&&F.send(JSON.stringify({type:"ping"}))},2e4);F.addEventListener("close",()=>clearInterval(J))}async function ca(h,T){let F=Pe.current.find(J=>J.id===h);t(J=>{let ue=J.map(fe=>fe.id===h?{...fe,...T}:fe);return Pe.current=ue,ue}),T.status&&(F!=null&&F.status)&&T.status!==F.status&&St(h,F.status,T.status,ce);try{let J=await ut.updateTask(h,T);J.task&&t(ue=>{let fe=ue.map(O=>O.id===h?J.task:O);return Pe.current=fe,fe})}catch{Zt()}}async function ii(h,T,F,J,ue){let fe=Pe.current.filter(le=>le.status===T).sort(Wr),O=Od(fe,h,F,J),ae=ue??O.newSortKey,xe=O.normalizationPatches;t(le=>{let ge=new Map;for(let{id:Ue,sortKey:Rt}of xe)ge.set(Ue,{sortKey:Rt});ge.set(h,{status:T,sortKey:ae});let R=le.map(Ue=>ge.has(Ue.id)?{...Ue,...ge.get(Ue.id)}:Ue);return Pe.current=R,R}),await ut.updateTask(h,{status:T,sortKey:ae}).catch(()=>{Zt()})}async function ui(h){t(T=>{let F=T.filter(J=>J.id!==h);return Pe.current=F,F});try{await ut.deleteTask(h)}catch{Zt()}}async function di(h){var T;try{let F=await ut.createTask(h);return await Zt(),(T=F==null?void 0:F.task)==null?void 0:T.id}catch{}}function Ha(h,T="details",F){Je([]),s({open:!0,task:h,tab:T,addColumnId:F})}function fi(){Je(h=>{if(h.length===0)return h;let T=h[h.length-1],F=h.slice(0,-1);return Me.current=!0,oe.current=null,window.location.hash=`#task-${T.id}`,s(J=>({...J,open:!0,task:T,tab:"details"})),F})}function xl(h,T){if(/\\.html?$/i.test(h)){window.open(T,"_blank","noopener,noreferrer");return}L({open:!0,name:h,url:T})}let ci=yy(e,v,u.toLowerCase()),no=window.location.origin,qa=ie.default.useMemo(()=>{let h=new Set;return e.forEach(T=>(T.tags??[]).forEach(F=>h.add(F))),Array.from(h).sort()},[e]),lo=ie.default.useMemo(()=>{var T;let h=(T=l.task)==null?void 0:T.id;return h?Ke.filter(F=>F.taskId===h).map(({field:F,from:J,to:ue,actor:fe,timestamp:O,source:ae})=>({field:F,from:J,to:ue,actor:fe,timestamp:O,source:ae})):[]},[(Yo=l.task)==null?void 0:Yo.id,Ke]),vl=ie.default.useMemo(()=>{let h=e;return C.status!=="all"&&(h=h.filter(T=>T.status===C.status)),C.component&&(h=h.filter(T=>T.component===C.component)),C.type&&(h=h.filter(T=>T.type===C.type)),C.user&&(h=h.filter(T=>T.author===C.user)),C.tags&&C.tags.length>0&&(h=h.filter(T=>C.tags.every(F=>(T.tags??[]).includes(F)))),h},[e,C]),yl=ie.default.useMemo(()=>new Map(De.map(h=>[h.taskId,h.status])),[De]),so=_&&!N;return(0,ne.jsxs)(ne.Fragment,{children:[hy&&!o&&(0,ne.jsx)(vy,{onClose:Mg?()=>n(!0):void 0}),(0,ne.jsx)(_d,{projectName:k,missingProjectIconStyle:"vibeflow",wsConnected:N,port:gy,searchQuery:u,filterTags:C.tags,allTags:qa,onToggleTag:h=>{let T=C.tags??[],F=T.includes(h)?T.filter(J=>J!==h):[...T,h];y(J=>({...J,tags:F}))},premiumUsage:be,isLoading:a,taskSummary:ci,onSearchChange:c,onSettings:()=>m(!0),agentRuns:De,selectMode:Ot,selectedCount:Yt.size,agentQueueCount:De.filter(h=>h.status==="running"||h.status==="queued").length,onOpenAgentQueue:()=>Ua(!0),experimentalAgents:W.experimentalAgents}),(0,ne.jsx)(tf,{tasks:e,filter:C,view:i,onFilter:y,onViewChange:h=>{d(h),ut.saveSettings({...W,viewMode:h}),D(T=>({...T,viewMode:h}))}}),(0,ne.jsxs)("div",{className:"flex flex-1 overflow-hidden",style:{minHeight:0,position:"relative"},children:[i==="list"?(0,ne.jsx)(qd,{tasks:vl,searchQuery:u,isLoading:a,onOpenPanel:(h,T)=>Ha(h,T),onAddTask:h=>Ha(null,"details",h),onDrop:(h,T)=>ca(h,{status:T}),experimentalAgents:W.experimentalAgents}):(0,ne.jsx)(Ud,{tasks:vl,visibleCols:v,searchQuery:u,isLoading:a,onOpenPanel:(h,T,F)=>Ha(h,T,F),onDrop:(h,T)=>ca(h,{status:T}),onReorder:ii,selectMode:Ot,selectedTaskIds:Yt,onToggleSelect:jo,onEnterSelectMode:Xo,agentStatuses:W.experimentalAgents===!0?yl:void 0,onRunSelectedAgents:W.experimentalAgents===!0?Ia:void 0,onExitSelectMode:()=>{zt(!1),Pt(new Set)},experimentalAgents:W.experimentalAgents}),l.open&&(0,ne.jsxs)("div",{id:"detail-panel-container",style:{width:x,zIndex:H?30:10},className:H?"resizing":"",children:[(0,ne.jsx)("div",{id:"detail-panel-resize-handle",onMouseDown:h=>{h.preventDefault(),p(!0),document.body.classList.add("vibeflow-resizing-panel");let T=h.clientX,F=x,J=fe=>{let O=F-(fe.clientX-T);I(Math.max(360,Math.min(860,O)))},ue=fe=>{p(!1),document.body.classList.remove("vibeflow-resizing-panel");let O=Math.max(360,Math.min(860,F-(fe.clientX-T)));ut.saveSettings({...W,panelWidth:O}),D(ae=>({...ae,panelWidth:O})),window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",ue)};window.addEventListener("mousemove",J),window.addEventListener("mouseup",ue)}}),(0,ne.jsx)(ef,{open:l.open,task:l.task,tab:l.tab,showLockIndicator:!1,addColumnId:l.addColumnId,gitUserName:ce,githubUrl:Z,baseUrl:no,isResizing:H,api:ut,onClose:()=>{Je([]),s(h=>({...h,open:!1}))},onSave:async h=>{l.task&&await ca(l.task.id,h),s(T=>({...T,open:!1}))},onCreate:async h=>{let T=await di(h);return s(F=>({...F,open:!1})),T},onDelete:async h=>{await ui(h),s(T=>({...T,open:!1}))},onPatch:ca,onFilePreview:xl,onGoBack:Te.length>0?fi:void 0,navBackLabel:Te.length>0?Te[Te.length-1].title:void 0,externalLocalChanges:lo,allTasks:e,agentRun:De.find(h=>{var T;return h.taskId===((T=l.task)==null?void 0:T.id)}),onRunAgent:ml,onStopAgent:ao,onDequeueAgent:si,models:b,defaultModel:W.defaultModel,perTypeModels:W.perTypeModels,defaultModelBug:W.defaultModelBug,defaultModelResearch:W.defaultModelResearch,defaultModelTask:W.defaultModelTask,agents:te,defaultAgent:W.defaultAgent,experimentalAgents:W.experimentalAgents,createBranch:W.createBranch})]})]}),W.experimentalAgents===!0&&(0,ne.jsx)(nf,{open:Na,runs:De,onStop:ao,onOpenTask:h=>{let T=e.find(F=>F.id===h);T&&(Ha(T,"agent"),Ua(!1))},onClose:()=>Ua(!1)}),so&&(0,Rg.createPortal)((0,ne.jsx)("div",{id:"ws-lost-overlay",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:99999,background:"rgba(2, 6, 23, 0.88)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:16,pointerEvents:"all",cursor:"not-allowed"},children:(0,ne.jsxs)("div",{style:{width:"min(420px, 92vw)",borderRadius:14,border:"1px solid var(--p-border-s)",background:"var(--p-card)",boxShadow:"0 16px 40px rgba(2,6,23,0.7)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:10,cursor:"default",pointerEvents:"auto"},children:[(0,ne.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,ne.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"var(--p-text-m)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"spin 1.1s linear infinite",flexShrink:0},children:(0,ne.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),(0,ne.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--p-text)"},children:"Connection Lost"})]}),(0,ne.jsx)("div",{style:{fontSize:12,color:"var(--p-text-m)",lineHeight:1.6},children:"Real-time connection to the server was interrupted. Reconnecting in the background\\u2026"})]})}),document.body),(0,ne.jsx)(rf,{open:f,visibleCols:v,settings:W,models:b,agents:te,onClose:()=>m(!1),onSave:(h,T)=>{w(h);let F={...W,...T,visibleCols:h};D(F),ut.saveSettings(F)}}),(0,ne.jsx)(of,{open:g.open,name:g.name,url:g.url,onClose:()=>L(h=>({...h,open:!1}))})]})}var Fg=E(j(),1),Dg=document.getElementById("root");Dg&&(0,Eg.createRoot)(Dg).render((0,Fg.jsx)(Ag,{}));})();\n/*! Bundled license information:\n\nreact/cjs/react.production.min.js:\n (**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nscheduler/cjs/scheduler.production.min.js:\n (**\n * @license React\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nreact-dom/cjs/react-dom.production.min.js:\n (**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nreact/cjs/react-jsx-runtime.production.min.js:\n (**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nlucide-react/dist/esm/shared/src/utils.js:\nlucide-react/dist/esm/defaultAttributes.js:\nlucide-react/dist/esm/Icon.js:\nlucide-react/dist/esm/createLucideIcon.js:\nlucide-react/dist/esm/icons/bot.js:\nlucide-react/dist/esm/icons/chevron-down.js:\nlucide-react/dist/esm/icons/chevron-right.js:\nlucide-react/dist/esm/icons/circle-check-big.js:\nlucide-react/dist/esm/icons/clock.js:\nlucide-react/dist/esm/icons/download.js:\nlucide-react/dist/esm/icons/eye.js:\nlucide-react/dist/esm/icons/file-text.js:\nlucide-react/dist/esm/icons/flag.js:\nlucide-react/dist/esm/icons/folder-tree.js:\nlucide-react/dist/esm/icons/git-branch.js:\nlucide-react/dist/esm/icons/layout-dashboard.js:\nlucide-react/dist/esm/icons/list.js:\nlucide-react/dist/esm/icons/lock.js:\nlucide-react/dist/esm/icons/message-circle.js:\nlucide-react/dist/esm/icons/panels-top-left.js:\nlucide-react/dist/esm/icons/paperclip.js:\nlucide-react/dist/esm/icons/play.js:\nlucide-react/dist/esm/icons/plus.js:\nlucide-react/dist/esm/icons/search.js:\nlucide-react/dist/esm/icons/settings.js:\nlucide-react/dist/esm/icons/shield-check.js:\nlucide-react/dist/esm/icons/square.js:\nlucide-react/dist/esm/icons/tag.js:\nlucide-react/dist/esm/icons/trash-2.js:\nlucide-react/dist/esm/icons/triangle-alert.js:\nlucide-react/dist/esm/icons/upload.js:\nlucide-react/dist/esm/icons/user.js:\nlucide-react/dist/esm/icons/x.js:\nlucide-react/dist/esm/lucide-react.js:\n (**\n * @license lucide-react v0.468.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n *)\n*/\n';var Xn=Jn(import.meta.url),Zn=Qn(Xn),er=[et(Zn,"kanban-template.html"),et(process.cwd(),"src","server","kanban-template.html"),et(process.cwd(),"dist","server","kanban-template.html")];function tr(t){let e=er.find(r=>Yn(r));if(!e)throw new Error("kanban-template.html not found in expected locations");return Gn(e,"utf8").replaceAll("__PORT__",String(t))}function nr(t){return t.saasMode?`window.__SAAS_MODE__ = true; window.__BOARD_URL__ = ${JSON.stringify(t.boardUrl??"")}; window.__BOARD_NAME__ = ${JSON.stringify(t.boardName??"")}; window.__IS_ADMIN__ = ${t.isAdmin?"true":"false"};`:""}var rr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiByeD0iNCIgZmlsbD0iIzI1NjNlYiIvPjxyZWN0IHg9IjIuNSIgeT0iNSIgd2lkdGg9IjIiIGhlaWdodD0iOCIgcng9IjEiIGZpbGw9IndoaXRlIiBvcGFjaXR5PSIwLjciLz48cmVjdCB4PSI2LjUiIHk9IjIiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiByeD0iMSIgZmlsbD0id2hpdGUiLz48cmVjdCB4PSIxMC41IiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSI2IiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuNyIvPjxyZWN0IHg9IjE0LjUiIHk9IjQiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuODUiLz48L3N2Zz4=";function ar(t){return`<!DOCTYPE html>
1695
+ `+Qe}function jt(t){return`var PROTO_CONFIG = ${JSON.stringify({port:0,wsUrl:"",apiUrl:`${t}/api/overlay/tasks`,pagesUrl:"",screenshotsUrl:""})};
1696
+ `+Qe}import{existsSync as Yn,readFileSync as Gn}from"fs";import{dirname as Qn,join as Ze}from"path";import{fileURLToPath as Xn}from"url";var Tt=`*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
1697
+ /*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.\\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.mb-0\\.5{margin-bottom:.125rem}.ml-1\\.5{margin-left:.375rem}.mr-0\\.5{margin-right:.125rem}.mt-0\\.5{margin-top:.125rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-7{height:1.75rem}.min-h-\\[30px\\]{min-height:30px}.w-1{width:.25rem}.w-1\\.5{width:.375rem}.w-10{width:2.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-7{width:1.75rem}.w-full{width:100%}.min-w-\\[100px\\]{min-width:100px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-text{cursor:text}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-hidden{overflow-y:hidden}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-none{border-style:none}.border-slate-700{--tw-border-opacity:1;border-color:rgb(51 65 85/var(--tw-border-opacity,1))}.border-slate-700\\/60{border-color:rgba(51,65,85,.6)}.border-slate-800\\/60{border-color:rgba(30,41,59,.6)}.border-violet-700\\/50{border-color:rgba(109,40,217,.5)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity,1))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity,1))}.bg-slate-800{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-violet-900\\/30{background-color:rgba(76,29,149,.3)}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\\[10px\\]{font-size:10px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-tight{line-height:1.25}.text-green-400{--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.text-slate-200{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.text-slate-300{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.text-slate-400{--tw-text-opacity:1;color:rgb(148 163 184/var(--tw-text-opacity,1))}.text-slate-500{--tw-text-opacity:1;color:rgb(100 116 139/var(--tw-text-opacity,1))}.text-slate-600{--tw-text-opacity:1;color:rgb(71 85 105/var(--tw-text-opacity,1))}.text-violet-300{--tw-text-opacity:1;color:rgb(196 181 253/var(--tw-text-opacity,1))}.text-violet-400{--tw-text-opacity:1;color:rgb(167 139 250/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.placeholder-slate-500::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(100 116 139/var(--tw-placeholder-opacity,1))}.placeholder-slate-500::placeholder{--tw-placeholder-opacity:1;color:rgb(100 116 139/var(--tw-placeholder-opacity,1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.\\!filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--p-bg:#020c1b;--p-surface:#080f1e;--p-card:#0a0f1e;--p-input:#050d1a;--p-hover:#0d1f38;--p-border:#1e293b;--p-border-s:#1e3a5f;--p-border-t:#334155;--p-text:#e2e8f0;--p-text-sub:#cbd5e1;--p-text-m:#94a3b8;--p-text-f:#64748b;--p-text-g:#475569;--p-white:#fff;--p-blue:#2563eb;--p-blue-700:#1d4ed8;--p-blue-300:#60a5fa;--p-blue-200:#93c5fd;--p-purple:#a78bfa;--p-purple-300:#c4b5fd;--p-cyan-300:#7dd3fc;--p-amber:#f59e0b;--p-amber-300:#fcd34d;--p-green:#22c55e;--p-green-300:#6ee7b7;--p-red:#f87171;--p-red-500:#ef4444;--p-bg-2:#0f172a;--p-bg-3:#1e293b;--p-shadow-lg:0 8px 24px rgba(2,6,23,.28);--p-overlay:rgba(15,23,42,.2)}body,html{height:100%;margin:0;padding:0}body{font-family:Inter,sans-serif;background:var(--p-bg);color:var(--p-text)}#root{height:100%;display:flex;flex-direction:column;overflow:hidden}*{scrollbar-width:thin;scrollbar-color:var(--p-border-t) transparent}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--p-border-t);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--p-text-g)}#kanban-board{scrollbar-width:none;-ms-overflow-style:none;overflow-x:auto;overflow-y:hidden}#kanban-board::-webkit-scrollbar{display:none}#kanban-scroll-track{position:fixed;bottom:0;left:0;right:0;height:6px;background:transparent;z-index:40;pointer-events:none}#kanban-scroll-thumb{position:absolute;top:1px;height:4px;border-radius:2px;background:var(--p-border-t);cursor:pointer;pointer-events:auto;transition:background .15s}#kanban-scroll-thumb.dragging,#kanban-scroll-thumb:hover{background:var(--p-text-g)}.board-column{flex:0 0 280px;width:280px;display:flex;flex-direction:column;gap:6px;min-height:0}.column-header{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:8px;background:var(--p-surface);border:1px solid var(--p-border)}.column-scroll{flex:1;overflow-y:auto;min-height:0;gap:5px;padding-bottom:8px}.column-scroll,.task-card{display:flex;flex-direction:column}.task-card{background:var(--p-card);border:1px solid var(--p-border);border-radius:10px;padding:11px 13px;cursor:grab;transition:border-color .12s,background .12s,box-shadow .12s,transform .12s;gap:7px}.task-card:hover{border-color:var(--p-border-s);background:var(--p-hover);box-shadow:0 4px 16px rgba(0,0,0,.3);transform:translateY(-1px)}.task-card:active{cursor:grabbing;transform:scale(.98)}.task-card.dragging{opacity:.4}.drag-over{outline:2px dashed rgba(59,130,246,.5);outline-offset:-3px;border-radius:10px;background:rgba(59,130,246,.04)}.file-compact-actions{opacity:0}.group\\/file-compact:hover .file-compact-actions{opacity:1}.file-normal-actions,.group\\/file-compact:hover .file-compact-ts{opacity:0}.group\\/file:hover .file-normal-actions{opacity:1}.group\\/file:hover{background:rgba(30,41,59,.6)}.status-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.sd-backlog{background:#475569}.sd-todo{background:#f59e0b}.sd-inprogress{background:#3b82f6;animation:pulse-prog 2s ease-in-out infinite}.sd-review{background:#a855f7}.sd-done{background:#22c55e}@keyframes pulse-prog{0%,to{box-shadow:0 0 0 0 rgba(59,130,246,.5)}50%{box-shadow:0 0 0 4px rgba(59,130,246,0)}}.type-badge{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:20px;font-size:10px;font-weight:500;border:1px solid}.type-bug{color:#fca5a5;background:rgba(239,68,68,.1);border-color:rgba(239,68,68,.25)}.type-feature{color:#86efac;background:rgba(34,197,94,.08);border-color:rgba(34,197,94,.2)}.type-enhancement{color:#93c5fd;background:rgba(59,130,246,.08);border-color:rgba(59,130,246,.2)}.type-task{color:#cbd5e1;background:rgba(148,163,184,.08);border-color:rgba(148,163,184,.2)}.type-research{color:#c4b5fd;background:rgba(139,92,246,.08);border-color:rgba(139,92,246,.2)}.source-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:6px;font-size:10px;font-family:JetBrains Mono,monospace;background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15);color:#60a5fa;cursor:pointer;text-decoration:none;transition:background .1s,border-color .1s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.source-pill:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.3)}@keyframes spin{to{transform:rotate(1turn)}}.spinner{display:inline-block;width:11px;height:11px;border:2px solid rgba(96,165,250,.3);border-top-color:#60a5fa;border-radius:50%;animation:spin .7s linear infinite}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:50;display:flex;align-items:center;justify-content:center}.modal-box{background:var(--p-card);border:1px solid var(--p-border);border-radius:14px;width:520px;max-width:95vw;overflow:hidden}.type-picker{display:flex;align-items:center;gap:6px}.type-picker-trigger{display:flex;align-items:center;gap:4px;width:auto;height:30px;padding:0 8px;border-radius:8px;border:1px solid var(--p-border-t);background:var(--p-card);color:var(--p-text-sub);font-size:13px;cursor:pointer;white-space:nowrap}.type-picker-label{font-size:11px;font-weight:500;color:var(--p-text-m);letter-spacing:.02em}.type-picker-trigger:hover{border-color:var(--p-text-g);color:var(--p-text)}.type-picker-options{display:none;align-items:center;gap:4px}.type-picker-options.open{display:flex}.type-picker-option{width:28px;height:28px;border-radius:7px;border:1px solid var(--p-border-t);background:var(--p-card);color:var(--p-text-sub);display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:13px}.type-picker-option:hover{border-color:#60a5fa;color:#bfdbfe}#detail-panel-container{min-width:360px;max-width:min(860px,100%);position:absolute;right:0;top:0;bottom:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid #1e293b;animation:panel-slide-in .18s ease-out}#detail-panel-container.resizing{box-shadow:-12px 0 32px rgba(2,8,23,.6)}#detail-panel-resize-handle{position:absolute;left:0;top:0;width:12px;height:100%;cursor:ew-resize;z-index:5}#detail-panel-resize-handle:hover{background:linear-gradient(90deg,rgba(59,130,246,.22),rgba(59,130,246,0))}body.proto-resizing-panel{cursor:ew-resize;-webkit-user-select:none;-moz-user-select:none;user-select:none}#detail-panel{flex:1;background:var(--p-card);display:flex;flex-direction:column;overflow:hidden}@keyframes panel-slide-in{0%{width:0;opacity:0}to{width:420px;opacity:1}}.dp-header{padding:14px 16px 10px}.dp-header,.dp-tabs{border-bottom:1px solid var(--p-border);background:var(--p-surface);flex-shrink:0}.dp-tabs{display:flex;gap:0}.dp-tab{padding:8px 14px;font-size:12px;font-weight:500;color:var(--p-text-g);cursor:pointer;transition:color .12s,border-color .12s;background:none;border:none;border-bottom:2px solid transparent}.dp-tab:hover{color:var(--p-text-m)}.dp-tab.active{color:#93c5fd;border-bottom-color:#3b82f6}.dp-body{overflow:hidden}.dp-body,.dp-body>.dp-pane{flex:1;display:flex;flex-direction:column;gap:12px;min-height:0}.dp-body>.dp-pane{padding:14px 16px}#dp-details-pane,.dp-body>.dp-pane{overflow-y:auto;background:var(--p-card)}.dp-footer{padding:10px 16px 12px;border-top:1px solid var(--p-border);flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--p-card)}.dp-source-pill{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:6px;font-size:10px;font-family:monospace;background:rgba(59,130,246,.06);border:1px solid rgba(59,130,246,.15);color:#60a5fa;white-space:nowrap}.dp-source-pill:hover{background:rgba(59,130,246,.12);border-color:rgba(59,130,246,.3)}.dp-status-btn{padding:3px 10px;border-radius:6px;font-size:10px;font-weight:500;border:1px solid var(--p-border-t);color:var(--p-text-f);background:transparent;cursor:pointer;transition:background .12s,border-color .12s,color .12s}.dp-status-btn:hover{border-color:var(--p-text-g);color:var(--p-text-m)}.dp-status-btn.active-backlog{border-color:#475569;background:rgba(100,116,139,.1);color:#94a3b8}.dp-status-btn.active-todo{border-color:rgba(245,158,11,.5);background:rgba(245,158,11,.1);color:#f59e0b}.dp-status-btn.active-in-progress{border-color:rgba(59,130,246,.5);background:rgba(59,130,246,.1);color:#60a5fa}.dp-status-btn.active-review{border-color:rgba(168,85,247,.5);background:rgba(168,85,247,.1);color:#a855f7}.dp-status-btn.active-done{border-color:rgba(34,197,94,.4);background:rgba(34,197,94,.08);color:#22c55e}.dp-input{width:100%;padding:7px 10px;border:1px solid var(--p-border-s);border-radius:8px;background:var(--p-input);color:var(--p-text);font-size:13px;font-family:inherit;outline:none;transition:border-color .12s,box-shadow .12s;box-sizing:border-box}.dp-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.dp-input::-moz-placeholder{color:var(--p-border-t)}.dp-input::placeholder{color:var(--p-border-t)}.dp-textarea{width:100%;padding:8px 10px;border:1px solid var(--p-border-s);border-radius:8px;background:var(--p-input);color:var(--p-text);font-size:12px;font-family:monospace;line-height:1.6;resize:vertical;outline:none;box-sizing:border-box;transition:border-color .12s,box-shadow .12s}.dp-textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}.dp-textarea::-moz-placeholder{color:var(--p-border-t)}.dp-textarea::placeholder{color:var(--p-border-t)}.dp-meta-label{font-size:10px;font-weight:600;color:var(--p-text-g);text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px}@keyframes pulse-live{0%,to{box-shadow:0 0 0 0 rgba(74,222,128,.4)}50%{box-shadow:0 0 0 4px rgba(74,222,128,0)}}@keyframes agent-pulse{0%,to{opacity:.5}50%{opacity:1}}@keyframes skeleton-pulse{0%,to{opacity:1}50%{opacity:.4}}@keyframes away-glow{0%,to{box-shadow:0 0 0 0 rgba(37,99,235,.45),0 0 24px rgba(37,99,235,.1);border-color:rgba(37,99,235,.35)}50%{box-shadow:0 0 0 14px rgba(37,99,235,0),0 0 48px rgba(37,99,235,.2);border-color:rgba(96,165,250,.6)}}@keyframes away-fade-in{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.focus-within\\:border-blue-500:focus-within{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.hover\\:bg-red-900\\/40:hover{background-color:rgba(127,29,29,.4)}.hover\\:bg-slate-700:hover{--tw-bg-opacity:1;background-color:rgb(51 65 85/var(--tw-bg-opacity,1))}.hover\\:bg-slate-700\\/50:hover{background-color:rgba(51,65,85,.5)}.hover\\:bg-slate-700\\/60:hover{background-color:rgba(51,65,85,.6)}.hover\\:bg-slate-800:hover{--tw-bg-opacity:1;background-color:rgb(30 41 59/var(--tw-bg-opacity,1))}.hover\\:bg-violet-800\\/30:hover{background-color:rgba(91,33,182,.3)}.hover\\:text-slate-200:hover{--tw-text-opacity:1;color:rgb(226 232 240/var(--tw-text-opacity,1))}.hover\\:text-slate-300:hover{--tw-text-opacity:1;color:rgb(203 213 225/var(--tw-text-opacity,1))}.hover\\:text-violet-300:hover{--tw-text-opacity:1;color:rgb(196 181 253/var(--tw-text-opacity,1))}.hover\\:underline:hover{text-decoration-line:underline}.group\\/comment:hover .group-hover\\/comment\\:opacity-100{opacity:1}`;var Je='"use strict";(()=>{var Gg=Object.create;var cf=Object.defineProperty;var Kg=Object.getOwnPropertyDescriptor;var jg=Object.getOwnPropertyNames;var Xg=Object.getPrototypeOf,Qg=Object.prototype.hasOwnProperty;var wa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Yg=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of jg(t))!Qg.call(e,o)&&o!==a&&cf(e,o,{get:()=>t[o],enumerable:!(r=Kg(t,o))||r.enumerable});return e};var F=(e,t,a)=>(a=e!=null?Gg(Xg(e)):{},Yg(t||!e||!e.__esModule?cf(a,"default",{value:e,enumerable:!0}):a,e));var wf=wa(he=>{"use strict";var Jo=Symbol.for("react.element"),Zg=Symbol.for("react.portal"),Jg=Symbol.for("react.fragment"),eh=Symbol.for("react.strict_mode"),th=Symbol.for("react.profiler"),ah=Symbol.for("react.provider"),rh=Symbol.for("react.context"),oh=Symbol.for("react.forward_ref"),nh=Symbol.for("react.suspense"),lh=Symbol.for("react.memo"),sh=Symbol.for("react.lazy"),pf=Symbol.iterator;function ih(e){return e===null||typeof e!="object"?null:(e=pf&&e[pf]||e["@@iterator"],typeof e=="function"?e:null)}var hf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xf=Object.assign,vf={};function uo(e,t,a){this.props=e,this.context=t,this.refs=vf,this.updater=a||hf}uo.prototype.isReactComponent={};uo.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")};uo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function yf(){}yf.prototype=uo.prototype;function gi(e,t,a){this.props=e,this.context=t,this.refs=vf,this.updater=a||hf}var hi=gi.prototype=new yf;hi.constructor=gi;xf(hi,uo.prototype);hi.isPureReactComponent=!0;var mf=Array.isArray,Lf=Object.prototype.hasOwnProperty,xi={current:null},Sf={key:!0,ref:!0,__self:!0,__source:!0};function If(e,t,a){var r,o={},n=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(n=""+t.key),t)Lf.call(t,r)&&!Sf.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=a;else if(1<s){for(var i=Array(s),d=0;d<s;d++)i[d]=arguments[d+2];o.children=i}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return{$$typeof:Jo,type:e,key:n,ref:l,props:o,_owner:xi.current}}function uh(e,t){return{$$typeof:Jo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function vi(e){return typeof e=="object"&&e!==null&&e.$$typeof===Jo}function dh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var gf=/\\/+/g;function mi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dh(""+e.key):t.toString(36)}function kl(e,t,a,r,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(n){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Jo:case Zg:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+mi(l,0):r,mf(o)?(a="",e!=null&&(a=e.replace(gf,"$&/")+"/"),kl(o,t,a,"",function(d){return d})):o!=null&&(vi(o)&&(o=uh(o,a+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(gf,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",mf(e))for(var s=0;s<e.length;s++){n=e[s];var i=r+mi(n,s);l+=kl(n,t,a,i,o)}else if(i=ih(e),typeof i=="function")for(e=i.call(e),s=0;!(n=e.next()).done;)n=n.value,i=r+mi(n,s++),l+=kl(n,t,a,i,o);else if(n==="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 l}function wl(e,t,a){if(e==null)return e;var r=[],o=0;return kl(e,r,"","",function(n){return t.call(a,n,o++)}),r}function fh(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var gt={current:null},bl={transition:null},ch={ReactCurrentDispatcher:gt,ReactCurrentBatchConfig:bl,ReactCurrentOwner:xi};function Cf(){throw Error("act(...) is not supported in production builds of React.")}he.Children={map:wl,forEach:function(e,t,a){wl(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return wl(e,function(){t++}),t},toArray:function(e){return wl(e,function(t){return t})||[]},only:function(e){if(!vi(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};he.Component=uo;he.Fragment=Jg;he.Profiler=th;he.PureComponent=gi;he.StrictMode=eh;he.Suspense=nh;he.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ch;he.act=Cf;he.cloneElement=function(e,t,a){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=xf({},e.props),o=e.key,n=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,l=xi.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(i in t)Lf.call(t,i)&&!Sf.hasOwnProperty(i)&&(r[i]=t[i]===void 0&&s!==void 0?s[i]:t[i])}var i=arguments.length-2;if(i===1)r.children=a;else if(1<i){s=Array(i);for(var d=0;d<i;d++)s[d]=arguments[d+2];r.children=s}return{$$typeof:Jo,type:e.type,key:o,ref:n,props:r,_owner:l}};he.createContext=function(e){return e={$$typeof:rh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ah,_context:e},e.Consumer=e};he.createElement=If;he.createFactory=function(e){var t=If.bind(null,e);return t.type=e,t};he.createRef=function(){return{current:null}};he.forwardRef=function(e){return{$$typeof:oh,render:e}};he.isValidElement=vi;he.lazy=function(e){return{$$typeof:sh,_payload:{_status:-1,_result:e},_init:fh}};he.memo=function(e,t){return{$$typeof:lh,type:e,compare:t===void 0?null:t}};he.startTransition=function(e){var t=bl.transition;bl.transition={};try{e()}finally{bl.transition=t}};he.unstable_act=Cf;he.useCallback=function(e,t){return gt.current.useCallback(e,t)};he.useContext=function(e){return gt.current.useContext(e)};he.useDebugValue=function(){};he.useDeferredValue=function(e){return gt.current.useDeferredValue(e)};he.useEffect=function(e,t){return gt.current.useEffect(e,t)};he.useId=function(){return gt.current.useId()};he.useImperativeHandle=function(e,t,a){return gt.current.useImperativeHandle(e,t,a)};he.useInsertionEffect=function(e,t){return gt.current.useInsertionEffect(e,t)};he.useLayoutEffect=function(e,t){return gt.current.useLayoutEffect(e,t)};he.useMemo=function(e,t){return gt.current.useMemo(e,t)};he.useReducer=function(e,t,a){return gt.current.useReducer(e,t,a)};he.useRef=function(e){return gt.current.useRef(e)};he.useState=function(e){return gt.current.useState(e)};he.useSyncExternalStore=function(e,t,a){return gt.current.useSyncExternalStore(e,t,a)};he.useTransition=function(){return gt.current.useTransition()};he.version="18.3.1"});var Oe=wa((Iy,kf)=>{"use strict";kf.exports=wf()});var Bf=wa(ze=>{"use strict";function Ii(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Tl(o,t))e[r]=t,e[a]=o,a=r;else break e}}function ta(e){return e.length===0?null:e[0]}function Rl(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,o=e.length,n=o>>>1;r<n;){var l=2*(r+1)-1,s=e[l],i=l+1,d=e[i];if(0>Tl(s,a))i<o&&0>Tl(d,s)?(e[r]=d,e[i]=a,r=i):(e[r]=s,e[l]=a,r=l);else if(i<o&&0>Tl(d,a))e[r]=d,e[i]=a,r=i;else break e}}return t}function Tl(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(bf=performance,ze.unstable_now=function(){return bf.now()}):(yi=Date,Tf=yi.now(),ze.unstable_now=function(){return yi.now()-Tf});var bf,yi,Tf,pa=[],$a=[],ph=1,Ut=null,dt=3,Ml=!1,Tr=!1,tn=!1,Mf=typeof setTimeout=="function"?setTimeout:null,Af=typeof clearTimeout=="function"?clearTimeout:null,Pf=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ci(e){for(var t=ta($a);t!==null;){if(t.callback===null)Rl($a);else if(t.startTime<=e)Rl($a),t.sortIndex=t.expirationTime,Ii(pa,t);else break;t=ta($a)}}function wi(e){if(tn=!1,Ci(e),!Tr)if(ta(pa)!==null)Tr=!0,bi(ki);else{var t=ta($a);t!==null&&Ti(wi,t.startTime-e)}}function ki(e,t){Tr=!1,tn&&(tn=!1,Af(an),an=-1),Ml=!0;var a=dt;try{for(Ci(t),Ut=ta(pa);Ut!==null&&(!(Ut.expirationTime>t)||e&&!Ff());){var r=Ut.callback;if(typeof r=="function"){Ut.callback=null,dt=Ut.priorityLevel;var o=r(Ut.expirationTime<=t);t=ze.unstable_now(),typeof o=="function"?Ut.callback=o:Ut===ta(pa)&&Rl(pa),Ci(t)}else Rl(pa);Ut=ta(pa)}if(Ut!==null)var n=!0;else{var l=ta($a);l!==null&&Ti(wi,l.startTime-t),n=!1}return n}finally{Ut=null,dt=a,Ml=!1}}var Al=!1,Pl=null,an=-1,Df=5,Ef=-1;function Ff(){return!(ze.unstable_now()-Ef<Df)}function Li(){if(Pl!==null){var e=ze.unstable_now();Ef=e;var t=!0;try{t=Pl(!0,e)}finally{t?en():(Al=!1,Pl=null)}}else Al=!1}var en;typeof Pf=="function"?en=function(){Pf(Li)}:typeof MessageChannel<"u"?(Si=new MessageChannel,Rf=Si.port2,Si.port1.onmessage=Li,en=function(){Rf.postMessage(null)}):en=function(){Mf(Li,0)};var Si,Rf;function bi(e){Pl=e,Al||(Al=!0,en())}function Ti(e,t){an=Mf(function(){e(ze.unstable_now())},t)}ze.unstable_IdlePriority=5;ze.unstable_ImmediatePriority=1;ze.unstable_LowPriority=4;ze.unstable_NormalPriority=3;ze.unstable_Profiling=null;ze.unstable_UserBlockingPriority=2;ze.unstable_cancelCallback=function(e){e.callback=null};ze.unstable_continueExecution=function(){Tr||Ml||(Tr=!0,bi(ki))};ze.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Df=0<e?Math.floor(1e3/e):5};ze.unstable_getCurrentPriorityLevel=function(){return dt};ze.unstable_getFirstCallbackNode=function(){return ta(pa)};ze.unstable_next=function(e){switch(dt){case 1:case 2:case 3:var t=3;break;default:t=dt}var a=dt;dt=t;try{return e()}finally{dt=a}};ze.unstable_pauseExecution=function(){};ze.unstable_requestPaint=function(){};ze.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=dt;dt=e;try{return t()}finally{dt=a}};ze.unstable_scheduleCallback=function(e,t,a){var r=ze.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=a+o,e={id:ph++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Ii($a,e),ta(pa)===null&&e===ta($a)&&(tn?(Af(an),an=-1):tn=!0,Ti(wi,a-r))):(e.sortIndex=o,Ii(pa,e),Tr||Ml||(Tr=!0,bi(ki))),e};ze.unstable_shouldYield=Ff;ze.unstable_wrapCallback=function(e){var t=dt;return function(){var a=dt;dt=t;try{return e.apply(this,arguments)}finally{dt=a}}}});var zf=wa((wy,Of)=>{"use strict";Of.exports=Bf()});var qm=wa(Bt=>{"use strict";var mh=Oe(),Et=zf();function M(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);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 $c=new Set,kn={};function Hr(e,t){Ao(e,t),Ao(e+"Capture",t)}function Ao(e,t){for(kn[e]=t,e=0;e<t.length;e++)$c.add(t[e])}var Ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qi=Object.prototype.hasOwnProperty,gh=/^[: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]*$/,Nf={},Uf={};function hh(e){return Qi.call(Uf,e)?!0:Qi.call(Nf,e)?!1:gh.test(e)?Uf[e]=!0:(Nf[e]=!0,!1)}function xh(e,t,a,r){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function vh(e,t,a,r){if(t===null||typeof t>"u"||xh(e,t,a,r))return!0;if(r)return!1;if(a!==null)switch(a.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 vt(e,t,a,r,o,n,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=l}var it={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){it[e]=new vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];it[t]=new vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){it[e]=new vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){it[e]=new vt(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){it[e]=new vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){it[e]=new vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){it[e]=new vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){it[e]=new vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){it[e]=new vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var _u=/[\\-:]([a-z])/g;function Wu(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(_u,Wu);it[t]=new vt(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(_u,Wu);it[t]=new vt(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(_u,Wu);it[t]=new vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){it[e]=new vt(e,1,!1,e.toLowerCase(),null,!1,!1)});it.xlinkHref=new vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){it[e]=new vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function $u(e,t,a,r){var o=it.hasOwnProperty(t)?it[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(vh(t,a,o,r)&&(a=null),r||o===null?hh(t)&&(a===null?e.removeAttribute(t):e.setAttribute(t,""+a)):o.mustUseProperty?e[o.propertyName]=a===null?o.type===3?!1:"":a:(t=o.attributeName,r=o.attributeNamespace,a===null?e.removeAttribute(t):(o=o.type,a=o===3||o===4&&a===!0?"":""+a,r?e.setAttributeNS(r,t,a):e.setAttribute(t,a))))}var Fa=mh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Dl=Symbol.for("react.element"),po=Symbol.for("react.portal"),mo=Symbol.for("react.fragment"),Vu=Symbol.for("react.strict_mode"),Yi=Symbol.for("react.profiler"),Vc=Symbol.for("react.provider"),Gc=Symbol.for("react.context"),Gu=Symbol.for("react.forward_ref"),Zi=Symbol.for("react.suspense"),Ji=Symbol.for("react.suspense_list"),Ku=Symbol.for("react.memo"),Ga=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Kc=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Hf=Symbol.iterator;function rn(e){return e===null||typeof e!="object"?null:(e=Hf&&e[Hf]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Object.assign,Pi;function cn(e){if(Pi===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\\n( *(at )?)/);Pi=t&&t[1]||""}return`\n`+Pi+e}var Ri=!1;function Mi(e,t){if(!e||Ri)return"";Ri=!0;var a=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(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var o=d.stack.split(`\n`),n=r.stack.split(`\n`),l=o.length-1,s=n.length-1;1<=l&&0<=s&&o[l]!==n[s];)s--;for(;1<=l&&0<=s;l--,s--)if(o[l]!==n[s]){if(l!==1||s!==1)do if(l--,s--,0>s||o[l]!==n[s]){var i=`\n`+o[l].replace(" at new "," at ");return e.displayName&&i.includes("<anonymous>")&&(i=i.replace("<anonymous>",e.displayName)),i}while(1<=l&&0<=s);break}}}finally{Ri=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?cn(e):""}function yh(e){switch(e.tag){case 5:return cn(e.type);case 16:return cn("Lazy");case 13:return cn("Suspense");case 19:return cn("SuspenseList");case 0:case 2:case 15:return e=Mi(e.type,!1),e;case 11:return e=Mi(e.type.render,!1),e;case 1:return e=Mi(e.type,!0),e;default:return""}}function eu(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 mo:return"Fragment";case po:return"Portal";case Yi:return"Profiler";case Vu:return"StrictMode";case Zi:return"Suspense";case Ji:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Gc:return(e.displayName||"Context")+".Consumer";case Vc:return(e._context.displayName||"Context")+".Provider";case Gu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ku:return t=e.displayName||null,t!==null?t:eu(e.type)||"Memo";case Ga:t=e._payload,e=e._init;try{return eu(e(t))}catch{}}return null}function Lh(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 eu(t);case 8:return t===Vu?"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 lr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Sh(e){var t=jc(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,n=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,n.call(this,l)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function El(e){e._valueTracker||(e._valueTracker=Sh(e))}function Xc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=jc(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function ss(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 tu(e,t){var a=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function qf(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=lr(t.value!=null?t.value:a),e._wrapperState={initialChecked:r,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qc(e,t){t=t.checked,t!=null&&$u(e,"checked",t,!1)}function au(e,t){Qc(e,t);var a=lr(t.value),r=t.type;if(a!=null)r==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ru(e,t.type,a):t.hasOwnProperty("defaultValue")&&ru(e,t.type,lr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _f(e,t,a){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,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function ru(e,t,a){(t!=="number"||ss(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var pn=Array.isArray;function ko(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+lr(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ou(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return Ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wf(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(M(92));if(pn(a)){if(1<a.length)throw Error(M(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:lr(a)}}function Yc(e,t){var a=lr(t.value),r=lr(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),r!=null&&(e.defaultValue=""+r)}function $f(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Zc(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 nu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Zc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fl,Jc=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,a,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fl=Fl||document.createElement("div"),Fl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var hn={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},Ih=["Webkit","ms","Moz","O"];Object.keys(hn).forEach(function(e){Ih.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),hn[t]=hn[e]})});function ep(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||hn.hasOwnProperty(e)&&hn[e]?(""+t).trim():t+"px"}function tp(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=ep(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var Ch=Ge({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 lu(e,t){if(t){if(Ch[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function su(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 iu=null;function ju(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var uu=null,bo=null,To=null;function Vf(e){if(e=$n(e)){if(typeof uu!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Bs(t),uu(e.stateNode,e.type,t))}}function ap(e){bo?To?To.push(e):To=[e]:bo=e}function rp(){if(bo){var e=bo,t=To;if(To=bo=null,Vf(e),t)for(e=0;e<t.length;e++)Vf(t[e])}}function op(e,t){return e(t)}function np(){}var Ai=!1;function lp(e,t,a){if(Ai)return e(t,a);Ai=!0;try{return op(e,t,a)}finally{Ai=!1,(bo!==null||To!==null)&&(np(),rp())}}function Tn(e,t){var a=e.stateNode;if(a===null)return null;var r=Bs(a);if(r===null)return null;a=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(a&&typeof a!="function")throw Error(M(231,t,typeof a));return a}var du=!1;if(Ma)try{fo={},Object.defineProperty(fo,"passive",{get:function(){du=!0}}),window.addEventListener("test",fo,fo),window.removeEventListener("test",fo,fo)}catch{du=!1}var fo;function wh(e,t,a,r,o,n,l,s,i){var d=Array.prototype.slice.call(arguments,3);try{t.apply(a,d)}catch(f){this.onError(f)}}var xn=!1,is=null,us=!1,fu=null,kh={onError:function(e){xn=!0,is=e}};function bh(e,t,a,r,o,n,l,s,i){xn=!1,is=null,wh.apply(kh,arguments)}function Th(e,t,a,r,o,n,l,s,i){if(bh.apply(this,arguments),xn){if(xn){var d=is;xn=!1,is=null}else throw Error(M(198));us||(us=!0,fu=d)}}function qr(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function sp(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 Gf(e){if(qr(e)!==e)throw Error(M(188))}function Ph(e){var t=e.alternate;if(!t){if(t=qr(e),t===null)throw Error(M(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var n=o.alternate;if(n===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===a)return Gf(o),e;if(n===r)return Gf(o),t;n=n.sibling}throw Error(M(188))}if(a.return!==r.return)a=o,r=n;else{for(var l=!1,s=o.child;s;){if(s===a){l=!0,a=o,r=n;break}if(s===r){l=!0,r=o,a=n;break}s=s.sibling}if(!l){for(s=n.child;s;){if(s===a){l=!0,a=n,r=o;break}if(s===r){l=!0,r=n,a=o;break}s=s.sibling}if(!l)throw Error(M(189))}}if(a.alternate!==r)throw Error(M(190))}if(a.tag!==3)throw Error(M(188));return a.stateNode.current===a?e:t}function ip(e){return e=Ph(e),e!==null?up(e):null}function up(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=up(e);if(t!==null)return t;e=e.sibling}return null}var dp=Et.unstable_scheduleCallback,Kf=Et.unstable_cancelCallback,Rh=Et.unstable_shouldYield,Mh=Et.unstable_requestPaint,Qe=Et.unstable_now,Ah=Et.unstable_getCurrentPriorityLevel,Xu=Et.unstable_ImmediatePriority,fp=Et.unstable_UserBlockingPriority,ds=Et.unstable_NormalPriority,Dh=Et.unstable_LowPriority,cp=Et.unstable_IdlePriority,As=null,xa=null;function Eh(e){if(xa&&typeof xa.onCommitFiberRoot=="function")try{xa.onCommitFiberRoot(As,e,void 0,(e.current.flags&128)===128)}catch{}}var la=Math.clz32?Math.clz32:Oh,Fh=Math.log,Bh=Math.LN2;function Oh(e){return e>>>=0,e===0?32:31-(Fh(e)/Bh|0)|0}var Bl=64,Ol=4194304;function mn(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 fs(e,t){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,n=e.pingedLanes,l=a&268435455;if(l!==0){var s=l&~o;s!==0?r=mn(s):(n&=l,n!==0&&(r=mn(n)))}else l=a&~o,l!==0?r=mn(l):n!==0&&(r=mn(n));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((r&4)!==0&&(r|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)a=31-la(t),o=1<<a,r|=e[a],t&=~o;return r}function zh(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 Nh(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var l=31-la(n),s=1<<l,i=o[l];i===-1?((s&a)===0||(s&r)!==0)&&(o[l]=zh(s,t)):i<=t&&(e.expiredLanes|=s),n&=~s}}function cu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function pp(){var e=Bl;return Bl<<=1,(Bl&4194240)===0&&(Bl=64),e}function Di(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function _n(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-la(t),e[t]=a}function Uh(e,t){var a=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<a;){var o=31-la(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function Qu(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-la(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var Re=0;function mp(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var gp,Yu,hp,xp,vp,pu=!1,zl=[],Za=null,Ja=null,er=null,Pn=new Map,Rn=new Map,ja=[],Hh="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 jf(e,t){switch(e){case"focusin":case"focusout":Za=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":er=null;break;case"pointerover":case"pointerout":Pn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rn.delete(t.pointerId)}}function on(e,t,a,r,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[o]},t!==null&&(t=$n(t),t!==null&&Yu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function qh(e,t,a,r,o){switch(t){case"focusin":return Za=on(Za,e,t,a,r,o),!0;case"dragenter":return Ja=on(Ja,e,t,a,r,o),!0;case"mouseover":return er=on(er,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return Pn.set(n,on(Pn.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,Rn.set(n,on(Rn.get(n)||null,e,t,a,r,o)),!0}return!1}function yp(e){var t=Mr(e.target);if(t!==null){var a=qr(t);if(a!==null){if(t=a.tag,t===13){if(t=sp(a),t!==null){e.blockedOn=t,vp(e.priority,function(){hp(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Yl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=mu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);iu=r,a.target.dispatchEvent(r),iu=null}else return t=$n(a),t!==null&&Yu(t),e.blockedOn=a,!1;t.shift()}return!0}function Xf(e,t,a){Yl(e)&&a.delete(t)}function _h(){pu=!1,Za!==null&&Yl(Za)&&(Za=null),Ja!==null&&Yl(Ja)&&(Ja=null),er!==null&&Yl(er)&&(er=null),Pn.forEach(Xf),Rn.forEach(Xf)}function nn(e,t){e.blockedOn===t&&(e.blockedOn=null,pu||(pu=!0,Et.unstable_scheduleCallback(Et.unstable_NormalPriority,_h)))}function Mn(e){function t(o){return nn(o,e)}if(0<zl.length){nn(zl[0],e);for(var a=1;a<zl.length;a++){var r=zl[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Za!==null&&nn(Za,e),Ja!==null&&nn(Ja,e),er!==null&&nn(er,e),Pn.forEach(t),Rn.forEach(t),a=0;a<ja.length;a++)r=ja[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<ja.length&&(a=ja[0],a.blockedOn===null);)yp(a),a.blockedOn===null&&ja.shift()}var Po=Fa.ReactCurrentBatchConfig,cs=!0;function Wh(e,t,a,r){var o=Re,n=Po.transition;Po.transition=null;try{Re=1,Zu(e,t,a,r)}finally{Re=o,Po.transition=n}}function $h(e,t,a,r){var o=Re,n=Po.transition;Po.transition=null;try{Re=4,Zu(e,t,a,r)}finally{Re=o,Po.transition=n}}function Zu(e,t,a,r){if(cs){var o=mu(e,t,a,r);if(o===null)Ui(e,t,r,ps,a),jf(e,r);else if(qh(o,e,t,a,r))r.stopPropagation();else if(jf(e,r),t&4&&-1<Hh.indexOf(e)){for(;o!==null;){var n=$n(o);if(n!==null&&gp(n),n=mu(e,t,a,r),n===null&&Ui(e,t,r,ps,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else Ui(e,t,r,null,a)}}var ps=null;function mu(e,t,a,r){if(ps=null,e=ju(r),e=Mr(e),e!==null)if(t=qr(e),t===null)e=null;else if(a=t.tag,a===13){if(e=sp(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ps=e,null}function Lp(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(Ah()){case Xu:return 1;case fp:return 4;case ds:case Dh:return 16;case cp:return 536870912;default:return 16}default:return 16}}var Qa=null,Ju=null,Zl=null;function Sp(){if(Zl)return Zl;var e,t=Ju,a=t.length,r,o="value"in Qa?Qa.value:Qa.textContent,n=o.length;for(e=0;e<a&&t[e]===o[e];e++);var l=a-e;for(r=1;r<=l&&t[a-r]===o[n-r];r++);return Zl=o.slice(e,1<r?1-r:void 0)}function Jl(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 Nl(){return!0}function Qf(){return!1}function Ft(e){function t(a,r,o,n,l){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=n,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(a=e[s],this[s]=a?a(n):n[s]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Nl:Qf,this.isPropagationStopped=Qf,this}return Ge(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Nl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Nl)},persist:function(){},isPersistent:Nl}),t}var No={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ed=Ft(No),Wn=Ge({},No,{view:0,detail:0}),Vh=Ft(Wn),Ei,Fi,ln,Ds=Ge({},Wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:td,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!==ln&&(ln&&e.type==="mousemove"?(Ei=e.screenX-ln.screenX,Fi=e.screenY-ln.screenY):Fi=Ei=0,ln=e),Ei)},movementY:function(e){return"movementY"in e?e.movementY:Fi}}),Yf=Ft(Ds),Gh=Ge({},Ds,{dataTransfer:0}),Kh=Ft(Gh),jh=Ge({},Wn,{relatedTarget:0}),Bi=Ft(jh),Xh=Ge({},No,{animationName:0,elapsedTime:0,pseudoElement:0}),Qh=Ft(Xh),Yh=Ge({},No,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zh=Ft(Yh),Jh=Ge({},No,{data:0}),Zf=Ft(Jh),ex={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tx={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"},ax={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ax[e])?!!t[e]:!1}function td(){return rx}var ox=Ge({},Wn,{key:function(e){if(e.key){var t=ex[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Jl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?tx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:td,charCode:function(e){return e.type==="keypress"?Jl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Jl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nx=Ft(ox),lx=Ge({},Ds,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jf=Ft(lx),sx=Ge({},Wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:td}),ix=Ft(sx),ux=Ge({},No,{propertyName:0,elapsedTime:0,pseudoElement:0}),dx=Ft(ux),fx=Ge({},Ds,{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}),cx=Ft(fx),px=[9,13,27,32],ad=Ma&&"CompositionEvent"in window,vn=null;Ma&&"documentMode"in document&&(vn=document.documentMode);var mx=Ma&&"TextEvent"in window&&!vn,Ip=Ma&&(!ad||vn&&8<vn&&11>=vn),ec=" ",tc=!1;function Cp(e,t){switch(e){case"keyup":return px.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var go=!1;function gx(e,t){switch(e){case"compositionend":return wp(t);case"keypress":return t.which!==32?null:(tc=!0,ec);case"textInput":return e=t.data,e===ec&&tc?null:e;default:return null}}function hx(e,t){if(go)return e==="compositionend"||!ad&&Cp(e,t)?(e=Sp(),Zl=Ju=Qa=null,go=!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 Ip&&t.locale!=="ko"?null:t.data;default:return null}}var xx={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 ac(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xx[e.type]:t==="textarea"}function kp(e,t,a,r){ap(r),t=ms(t,"onChange"),0<t.length&&(a=new ed("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var yn=null,An=null;function vx(e){Op(e,0)}function Es(e){var t=vo(e);if(Xc(t))return e}function yx(e,t){if(e==="change")return t}var bp=!1;Ma&&(Ma?(Hl="oninput"in document,Hl||(Oi=document.createElement("div"),Oi.setAttribute("oninput","return;"),Hl=typeof Oi.oninput=="function"),Ul=Hl):Ul=!1,bp=Ul&&(!document.documentMode||9<document.documentMode));var Ul,Hl,Oi;function rc(){yn&&(yn.detachEvent("onpropertychange",Tp),An=yn=null)}function Tp(e){if(e.propertyName==="value"&&Es(An)){var t=[];kp(t,An,e,ju(e)),lp(vx,t)}}function Lx(e,t,a){e==="focusin"?(rc(),yn=t,An=a,yn.attachEvent("onpropertychange",Tp)):e==="focusout"&&rc()}function Sx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Es(An)}function Ix(e,t){if(e==="click")return Es(t)}function Cx(e,t){if(e==="input"||e==="change")return Es(t)}function wx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ia=typeof Object.is=="function"?Object.is:wx;function Dn(e,t){if(ia(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!Qi.call(t,o)||!ia(e[o],t[o]))return!1}return!0}function oc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nc(e,t){var a=oc(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=oc(a)}}function Pp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rp(){for(var e=window,t=ss();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ss(e.document)}return t}function rd(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 kx(e){var t=Rp(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&Pp(a.ownerDocument.documentElement,a)){if(r!==null&&rd(a)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=a.textContent.length,n=Math.min(r.start,o);r=r.end===void 0?n:Math.min(r.end,o),!e.extend&&n>r&&(o=r,r=n,n=o),o=nc(a,n);var l=nc(a,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var bx=Ma&&"documentMode"in document&&11>=document.documentMode,ho=null,gu=null,Ln=null,hu=!1;function lc(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;hu||ho==null||ho!==ss(r)||(r=ho,"selectionStart"in r&&rd(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}),Ln&&Dn(Ln,r)||(Ln=r,r=ms(gu,"onSelect"),0<r.length&&(t=new ed("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=ho)))}function ql(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var xo={animationend:ql("Animation","AnimationEnd"),animationiteration:ql("Animation","AnimationIteration"),animationstart:ql("Animation","AnimationStart"),transitionend:ql("Transition","TransitionEnd")},zi={},Mp={};Ma&&(Mp=document.createElement("div").style,"AnimationEvent"in window||(delete xo.animationend.animation,delete xo.animationiteration.animation,delete xo.animationstart.animation),"TransitionEvent"in window||delete xo.transitionend.transition);function Fs(e){if(zi[e])return zi[e];if(!xo[e])return e;var t=xo[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Mp)return zi[e]=t[a];return e}var Ap=Fs("animationend"),Dp=Fs("animationiteration"),Ep=Fs("animationstart"),Fp=Fs("transitionend"),Bp=new Map,sc="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 ir(e,t){Bp.set(e,t),Hr(t,[e])}for(_l=0;_l<sc.length;_l++)Wl=sc[_l],ic=Wl.toLowerCase(),uc=Wl[0].toUpperCase()+Wl.slice(1),ir(ic,"on"+uc);var Wl,ic,uc,_l;ir(Ap,"onAnimationEnd");ir(Dp,"onAnimationIteration");ir(Ep,"onAnimationStart");ir("dblclick","onDoubleClick");ir("focusin","onFocus");ir("focusout","onBlur");ir(Fp,"onTransitionEnd");Ao("onMouseEnter",["mouseout","mouseover"]);Ao("onMouseLeave",["mouseout","mouseover"]);Ao("onPointerEnter",["pointerout","pointerover"]);Ao("onPointerLeave",["pointerout","pointerover"]);Hr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Hr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Hr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Hr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Hr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Hr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gn="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(" "),Tx=new Set("cancel close invalid load scroll toggle".split(" ").concat(gn));function dc(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,Th(r,t,void 0,e),e.currentTarget=null}function Op(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var l=r.length-1;0<=l;l--){var s=r[l],i=s.instance,d=s.currentTarget;if(s=s.listener,i!==n&&o.isPropagationStopped())break e;dc(o,s,d),n=i}else for(l=0;l<r.length;l++){if(s=r[l],i=s.instance,d=s.currentTarget,s=s.listener,i!==n&&o.isPropagationStopped())break e;dc(o,s,d),n=i}}}if(us)throw e=fu,us=!1,fu=null,e}function He(e,t){var a=t[Su];a===void 0&&(a=t[Su]=new Set);var r=e+"__bubble";a.has(r)||(zp(t,e,2,!1),a.add(r))}function Ni(e,t,a){var r=0;t&&(r|=4),zp(a,e,r,t)}var $l="_reactListening"+Math.random().toString(36).slice(2);function En(e){if(!e[$l]){e[$l]=!0,$c.forEach(function(a){a!=="selectionchange"&&(Tx.has(a)||Ni(a,!1,e),Ni(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$l]||(t[$l]=!0,Ni("selectionchange",!1,t))}}function zp(e,t,a,r){switch(Lp(t)){case 1:var o=Wh;break;case 4:o=$h;break;default:o=Zu}a=o.bind(null,t,a,e),o=void 0,!du||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function Ui(e,t,a,r,o){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===o||s.nodeType===8&&s.parentNode===o)break;if(l===4)for(l=r.return;l!==null;){var i=l.tag;if((i===3||i===4)&&(i=l.stateNode.containerInfo,i===o||i.nodeType===8&&i.parentNode===o))return;l=l.return}for(;s!==null;){if(l=Mr(s),l===null)return;if(i=l.tag,i===5||i===6){r=n=l;continue e}s=s.parentNode}}r=r.return}lp(function(){var d=n,f=ju(a),m=[];e:{var g=Bp.get(e);if(g!==void 0){var L=ed,x=e;switch(e){case"keypress":if(Jl(a)===0)break e;case"keydown":case"keyup":L=nx;break;case"focusin":x="focus",L=Bi;break;case"focusout":x="blur",L=Bi;break;case"beforeblur":case"afterblur":L=Bi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=Yf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=Kh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=ix;break;case Ap:case Dp:case Ep:L=Qh;break;case Fp:L=dx;break;case"scroll":L=Vh;break;case"wheel":L=cx;break;case"copy":case"cut":case"paste":L=Zh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Jf}var I=(t&4)!==0,H=!I&&e==="scroll",p=I?g!==null?g+"Capture":null:g;I=[];for(var u=d,c;u!==null;){c=u;var v=c.stateNode;if(c.tag===5&&v!==null&&(c=v,p!==null&&(v=Tn(u,p),v!=null&&I.push(Fn(u,v,c)))),H)break;u=u.return}0<I.length&&(g=new L(g,x,null,a,f),m.push({event:g,listeners:I}))}}if((t&7)===0){e:{if(g=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",g&&a!==iu&&(x=a.relatedTarget||a.fromElement)&&(Mr(x)||x[Aa]))break e;if((L||g)&&(g=f.window===f?f:(g=f.ownerDocument)?g.defaultView||g.parentWindow:window,L?(x=a.relatedTarget||a.toElement,L=d,x=x?Mr(x):null,x!==null&&(H=qr(x),x!==H||x.tag!==5&&x.tag!==6)&&(x=null)):(L=null,x=d),L!==x)){if(I=Yf,v="onMouseLeave",p="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(I=Jf,v="onPointerLeave",p="onPointerEnter",u="pointer"),H=L==null?g:vo(L),c=x==null?g:vo(x),g=new I(v,u+"leave",L,a,f),g.target=H,g.relatedTarget=c,v=null,Mr(f)===d&&(I=new I(p,u+"enter",x,a,f),I.target=c,I.relatedTarget=H,v=I),H=v,L&&x)t:{for(I=L,p=x,u=0,c=I;c;c=co(c))u++;for(c=0,v=p;v;v=co(v))c++;for(;0<u-c;)I=co(I),u--;for(;0<c-u;)p=co(p),c--;for(;u--;){if(I===p||p!==null&&I===p.alternate)break t;I=co(I),p=co(p)}I=null}else I=null;L!==null&&fc(m,g,L,I,!1),x!==null&&H!==null&&fc(m,H,x,I,!0)}}e:{if(g=d?vo(d):window,L=g.nodeName&&g.nodeName.toLowerCase(),L==="select"||L==="input"&&g.type==="file")var w=yx;else if(ac(g))if(bp)w=Cx;else{w=Sx;var C=Lx}else(L=g.nodeName)&&L.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(w=Ix);if(w&&(w=w(e,d))){kp(m,w,a,f);break e}C&&C(e,g,d),e==="focusout"&&(C=g._wrapperState)&&C.controlled&&g.type==="number"&&ru(g,"number",g.value)}switch(C=d?vo(d):window,e){case"focusin":(ac(C)||C.contentEditable==="true")&&(ho=C,gu=d,Ln=null);break;case"focusout":Ln=gu=ho=null;break;case"mousedown":hu=!0;break;case"contextmenu":case"mouseup":case"dragend":hu=!1,lc(m,a,f);break;case"selectionchange":if(bx)break;case"keydown":case"keyup":lc(m,a,f)}var y;if(ad)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else go?Cp(e,a)&&(k="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(k="onCompositionStart");k&&(Ip&&a.locale!=="ko"&&(go||k!=="onCompositionStart"?k==="onCompositionEnd"&&go&&(y=Sp()):(Qa=f,Ju="value"in Qa?Qa.value:Qa.textContent,go=!0)),C=ms(d,k),0<C.length&&(k=new Zf(k,e,null,a,f),m.push({event:k,listeners:C}),y?k.data=y:(y=wp(a),y!==null&&(k.data=y)))),(y=mx?gx(e,a):hx(e,a))&&(d=ms(d,"onBeforeInput"),0<d.length&&(f=new Zf("onBeforeInput","beforeinput",null,a,f),m.push({event:f,listeners:d}),f.data=y))}Op(m,t)})}function Fn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ms(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=Tn(e,a),n!=null&&r.unshift(Fn(e,n,o)),n=Tn(e,t),n!=null&&r.push(Fn(e,n,o))),e=e.return}return r}function co(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fc(e,t,a,r,o){for(var n=t._reactName,l=[];a!==null&&a!==r;){var s=a,i=s.alternate,d=s.stateNode;if(i!==null&&i===r)break;s.tag===5&&d!==null&&(s=d,o?(i=Tn(a,n),i!=null&&l.unshift(Fn(a,i,s))):o||(i=Tn(a,n),i!=null&&l.push(Fn(a,i,s)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var Px=/\\r\\n?/g,Rx=/\\u0000|\\uFFFD/g;function cc(e){return(typeof e=="string"?e:""+e).replace(Px,`\n`).replace(Rx,"")}function Vl(e,t,a){if(t=cc(t),cc(e)!==t&&a)throw Error(M(425))}function gs(){}var xu=null,vu=null;function yu(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 Lu=typeof setTimeout=="function"?setTimeout:void 0,Mx=typeof clearTimeout=="function"?clearTimeout:void 0,pc=typeof Promise=="function"?Promise:void 0,Ax=typeof queueMicrotask=="function"?queueMicrotask:typeof pc<"u"?function(e){return pc.resolve(null).then(e).catch(Dx)}:Lu;function Dx(e){setTimeout(function(){throw e})}function Hi(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),Mn(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);Mn(t)}function tr(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 mc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var Uo=Math.random().toString(36).slice(2),ha="__reactFiber$"+Uo,Bn="__reactProps$"+Uo,Aa="__reactContainer$"+Uo,Su="__reactEvents$"+Uo,Ex="__reactListeners$"+Uo,Fx="__reactHandles$"+Uo;function Mr(e){var t=e[ha];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Aa]||a[ha]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=mc(e);e!==null;){if(a=e[ha])return a;e=mc(e)}return t}e=a,a=e.parentNode}return null}function $n(e){return e=e[ha]||e[Aa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function vo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function Bs(e){return e[Bn]||null}var Iu=[],yo=-1;function ur(e){return{current:e}}function qe(e){0>yo||(e.current=Iu[yo],Iu[yo]=null,yo--)}function Ne(e,t){yo++,Iu[yo]=e.current,e.current=t}var sr={},mt=ur(sr),wt=ur(!1),Br=sr;function Do(e,t){var a=e.type.contextTypes;if(!a)return sr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function kt(e){return e=e.childContextTypes,e!=null}function hs(){qe(wt),qe(mt)}function gc(e,t,a){if(mt.current!==sr)throw Error(M(168));Ne(mt,t),Ne(wt,a)}function Np(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(M(108,Lh(e)||"Unknown",o));return Ge({},a,r)}function xs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||sr,Br=mt.current,Ne(mt,e),Ne(wt,wt.current),!0}function hc(e,t,a){var r=e.stateNode;if(!r)throw Error(M(169));a?(e=Np(e,t,Br),r.__reactInternalMemoizedMergedChildContext=e,qe(wt),qe(mt),Ne(mt,e)):qe(wt),Ne(wt,a)}var ba=null,Os=!1,qi=!1;function Up(e){ba===null?ba=[e]:ba.push(e)}function Bx(e){Os=!0,Up(e)}function dr(){if(!qi&&ba!==null){qi=!0;var e=0,t=Re;try{var a=ba;for(Re=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}ba=null,Os=!1}catch(o){throw ba!==null&&(ba=ba.slice(e+1)),dp(Xu,dr),o}finally{Re=t,qi=!1}}return null}var Lo=[],So=0,vs=null,ys=0,Ht=[],qt=0,Or=null,Ta=1,Pa="";function Pr(e,t){Lo[So++]=ys,Lo[So++]=vs,vs=e,ys=t}function Hp(e,t,a){Ht[qt++]=Ta,Ht[qt++]=Pa,Ht[qt++]=Or,Or=e;var r=Ta;e=Pa;var o=32-la(r)-1;r&=~(1<<o),a+=1;var n=32-la(t)+o;if(30<n){var l=o-o%5;n=(r&(1<<l)-1).toString(32),r>>=l,o-=l,Ta=1<<32-la(t)+o|a<<o|r,Pa=n+e}else Ta=1<<n|a<<o|r,Pa=e}function od(e){e.return!==null&&(Pr(e,1),Hp(e,1,0))}function nd(e){for(;e===vs;)vs=Lo[--So],Lo[So]=null,ys=Lo[--So],Lo[So]=null;for(;e===Or;)Or=Ht[--qt],Ht[qt]=null,Pa=Ht[--qt],Ht[qt]=null,Ta=Ht[--qt],Ht[qt]=null}var Dt=null,At=null,_e=!1,na=null;function qp(e,t){var a=_t(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function xc(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Dt=e,At=tr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Dt=e,At=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Or!==null?{id:Ta,overflow:Pa}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=_t(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Dt=e,At=null,!0):!1;default:return!1}}function Cu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function wu(e){if(_e){var t=At;if(t){var a=t;if(!xc(e,t)){if(Cu(e))throw Error(M(418));t=tr(a.nextSibling);var r=Dt;t&&xc(e,t)?qp(r,a):(e.flags=e.flags&-4097|2,_e=!1,Dt=e)}}else{if(Cu(e))throw Error(M(418));e.flags=e.flags&-4097|2,_e=!1,Dt=e}}}function vc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Dt=e}function Gl(e){if(e!==Dt)return!1;if(!_e)return vc(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!yu(e.type,e.memoizedProps)),t&&(t=At)){if(Cu(e))throw _p(),Error(M(418));for(;t;)qp(e,t),t=tr(t.nextSibling)}if(vc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){At=tr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}At=null}}else At=Dt?tr(e.stateNode.nextSibling):null;return!0}function _p(){for(var e=At;e;)e=tr(e.nextSibling)}function Eo(){At=Dt=null,_e=!1}function ld(e){na===null?na=[e]:na.push(e)}var Ox=Fa.ReactCurrentBatchConfig;function sn(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(M(309));var r=a.stateNode}if(!r)throw Error(M(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(l){var s=o.refs;l===null?delete s[n]:s[n]=l},t._stringRef=n,t)}if(typeof e!="string")throw Error(M(284));if(!a._owner)throw Error(M(290,e))}return e}function Kl(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yc(e){var t=e._init;return t(e._payload)}function Wp(e){function t(p,u){if(e){var c=p.deletions;c===null?(p.deletions=[u],p.flags|=16):c.push(u)}}function a(p,u){if(!e)return null;for(;u!==null;)t(p,u),u=u.sibling;return null}function r(p,u){for(p=new Map;u!==null;)u.key!==null?p.set(u.key,u):p.set(u.index,u),u=u.sibling;return p}function o(p,u){return p=nr(p,u),p.index=0,p.sibling=null,p}function n(p,u,c){return p.index=c,e?(c=p.alternate,c!==null?(c=c.index,c<u?(p.flags|=2,u):c):(p.flags|=2,u)):(p.flags|=1048576,u)}function l(p){return e&&p.alternate===null&&(p.flags|=2),p}function s(p,u,c,v){return u===null||u.tag!==6?(u=ji(c,p.mode,v),u.return=p,u):(u=o(u,c),u.return=p,u)}function i(p,u,c,v){var w=c.type;return w===mo?f(p,u,c.props.children,v,c.key):u!==null&&(u.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ga&&yc(w)===u.type)?(v=o(u,c.props),v.ref=sn(p,u,c),v.return=p,v):(v=ls(c.type,c.key,c.props,null,p.mode,v),v.ref=sn(p,u,c),v.return=p,v)}function d(p,u,c,v){return u===null||u.tag!==4||u.stateNode.containerInfo!==c.containerInfo||u.stateNode.implementation!==c.implementation?(u=Xi(c,p.mode,v),u.return=p,u):(u=o(u,c.children||[]),u.return=p,u)}function f(p,u,c,v,w){return u===null||u.tag!==7?(u=Fr(c,p.mode,v,w),u.return=p,u):(u=o(u,c),u.return=p,u)}function m(p,u,c){if(typeof u=="string"&&u!==""||typeof u=="number")return u=ji(""+u,p.mode,c),u.return=p,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case Dl:return c=ls(u.type,u.key,u.props,null,p.mode,c),c.ref=sn(p,null,u),c.return=p,c;case po:return u=Xi(u,p.mode,c),u.return=p,u;case Ga:var v=u._init;return m(p,v(u._payload),c)}if(pn(u)||rn(u))return u=Fr(u,p.mode,c,null),u.return=p,u;Kl(p,u)}return null}function g(p,u,c,v){var w=u!==null?u.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return w!==null?null:s(p,u,""+c,v);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case Dl:return c.key===w?i(p,u,c,v):null;case po:return c.key===w?d(p,u,c,v):null;case Ga:return w=c._init,g(p,u,w(c._payload),v)}if(pn(c)||rn(c))return w!==null?null:f(p,u,c,v,null);Kl(p,c)}return null}function L(p,u,c,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return p=p.get(c)||null,s(u,p,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Dl:return p=p.get(v.key===null?c:v.key)||null,i(u,p,v,w);case po:return p=p.get(v.key===null?c:v.key)||null,d(u,p,v,w);case Ga:var C=v._init;return L(p,u,c,C(v._payload),w)}if(pn(v)||rn(v))return p=p.get(c)||null,f(u,p,v,w,null);Kl(u,v)}return null}function x(p,u,c,v){for(var w=null,C=null,y=u,k=u=0,z=null;y!==null&&k<c.length;k++){y.index>k?(z=y,y=null):z=y.sibling;var N=g(p,y,c[k],v);if(N===null){y===null&&(y=z);break}e&&y&&N.alternate===null&&t(p,y),u=n(N,u,k),C===null?w=N:C.sibling=N,C=N,y=z}if(k===c.length)return a(p,y),_e&&Pr(p,k),w;if(y===null){for(;k<c.length;k++)y=m(p,c[k],v),y!==null&&(u=n(y,u,k),C===null?w=y:C.sibling=y,C=y);return _e&&Pr(p,k),w}for(y=r(p,y);k<c.length;k++)z=L(y,p,k,c[k],v),z!==null&&(e&&z.alternate!==null&&y.delete(z.key===null?k:z.key),u=n(z,u,k),C===null?w=z:C.sibling=z,C=z);return e&&y.forEach(function(U){return t(p,U)}),_e&&Pr(p,k),w}function I(p,u,c,v){var w=rn(c);if(typeof w!="function")throw Error(M(150));if(c=w.call(c),c==null)throw Error(M(151));for(var C=w=null,y=u,k=u=0,z=null,N=c.next();y!==null&&!N.done;k++,N=c.next()){y.index>k?(z=y,y=null):z=y.sibling;var U=g(p,y,N.value,v);if(U===null){y===null&&(y=z);break}e&&y&&U.alternate===null&&t(p,y),u=n(U,u,k),C===null?w=U:C.sibling=U,C=U,y=z}if(N.done)return a(p,y),_e&&Pr(p,k),w;if(y===null){for(;!N.done;k++,N=c.next())N=m(p,N.value,v),N!==null&&(u=n(N,u,k),C===null?w=N:C.sibling=N,C=N);return _e&&Pr(p,k),w}for(y=r(p,y);!N.done;k++,N=c.next())N=L(y,p,k,N.value,v),N!==null&&(e&&N.alternate!==null&&y.delete(N.key===null?k:N.key),u=n(N,u,k),C===null?w=N:C.sibling=N,C=N);return e&&y.forEach(function(_){return t(p,_)}),_e&&Pr(p,k),w}function H(p,u,c,v){if(typeof c=="object"&&c!==null&&c.type===mo&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case Dl:e:{for(var w=c.key,C=u;C!==null;){if(C.key===w){if(w=c.type,w===mo){if(C.tag===7){a(p,C.sibling),u=o(C,c.props.children),u.return=p,p=u;break e}}else if(C.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ga&&yc(w)===C.type){a(p,C.sibling),u=o(C,c.props),u.ref=sn(p,C,c),u.return=p,p=u;break e}a(p,C);break}else t(p,C);C=C.sibling}c.type===mo?(u=Fr(c.props.children,p.mode,v,c.key),u.return=p,p=u):(v=ls(c.type,c.key,c.props,null,p.mode,v),v.ref=sn(p,u,c),v.return=p,p=v)}return l(p);case po:e:{for(C=c.key;u!==null;){if(u.key===C)if(u.tag===4&&u.stateNode.containerInfo===c.containerInfo&&u.stateNode.implementation===c.implementation){a(p,u.sibling),u=o(u,c.children||[]),u.return=p,p=u;break e}else{a(p,u);break}else t(p,u);u=u.sibling}u=Xi(c,p.mode,v),u.return=p,p=u}return l(p);case Ga:return C=c._init,H(p,u,C(c._payload),v)}if(pn(c))return x(p,u,c,v);if(rn(c))return I(p,u,c,v);Kl(p,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,u!==null&&u.tag===6?(a(p,u.sibling),u=o(u,c),u.return=p,p=u):(a(p,u),u=ji(c,p.mode,v),u.return=p,p=u),l(p)):a(p,u)}return H}var Fo=Wp(!0),$p=Wp(!1),Ls=ur(null),Ss=null,Io=null,sd=null;function id(){sd=Io=Ss=null}function ud(e){var t=Ls.current;qe(Ls),e._currentValue=t}function ku(e,t,a){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===a)break;e=e.return}}function Ro(e,t){Ss=e,sd=Io=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ct=!0),e.firstContext=null)}function $t(e){var t=e._currentValue;if(sd!==e)if(e={context:e,memoizedValue:t,next:null},Io===null){if(Ss===null)throw Error(M(308));Io=e,Ss.dependencies={lanes:0,firstContext:e}}else Io=Io.next=e;return t}var Ar=null;function dd(e){Ar===null?Ar=[e]:Ar.push(e)}function Vp(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,dd(t)):(a.next=o.next,o.next=a),t.interleaved=a,Da(e,r)}function Da(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var Ka=!1;function fd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gp(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 Ra(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ar(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Le&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Da(e,a)}return o=r.interleaved,o===null?(t.next=t,dd(r)):(t.next=o.next,o.next=t),r.interleaved=t,Da(e,a)}function es(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qu(e,a)}}function Lc(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var l={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=l:n=n.next=l,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function Is(e,t,a,r){var o=e.updateQueue;Ka=!1;var n=o.firstBaseUpdate,l=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var i=s,d=i.next;i.next=null,l===null?n=d:l.next=d,l=i;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=d:s.next=d,f.lastBaseUpdate=i))}if(n!==null){var m=o.baseState;l=0,f=d=i=null,s=n;do{var g=s.lane,L=s.eventTime;if((r&g)===g){f!==null&&(f=f.next={eventTime:L,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,I=s;switch(g=t,L=a,I.tag){case 1:if(x=I.payload,typeof x=="function"){m=x.call(L,m,g);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=I.payload,g=typeof x=="function"?x.call(L,m,g):x,g==null)break e;m=Ge({},m,g);break e;case 2:Ka=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,g=o.effects,g===null?o.effects=[s]:g.push(s))}else L={eventTime:L,lane:g,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(d=f=L,i=m):f=f.next=L,l|=g;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;g=s,s=g.next,g.next=null,o.lastBaseUpdate=g,o.shared.pending=null}}while(!0);if(f===null&&(i=m),o.baseState=i,o.firstBaseUpdate=d,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);Nr|=l,e.lanes=l,e.memoizedState=m}}function Sc(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(M(191,o));o.call(r)}}}var Vn={},va=ur(Vn),On=ur(Vn),zn=ur(Vn);function Dr(e){if(e===Vn)throw Error(M(174));return e}function cd(e,t){switch(Ne(zn,t),Ne(On,e),Ne(va,Vn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:nu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=nu(t,e)}qe(va),Ne(va,t)}function Bo(){qe(va),qe(On),qe(zn)}function Kp(e){Dr(zn.current);var t=Dr(va.current),a=nu(t,e.type);t!==a&&(Ne(On,e),Ne(va,a))}function pd(e){On.current===e&&(qe(va),qe(On))}var $e=ur(0);function Cs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)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 _i=[];function md(){for(var e=0;e<_i.length;e++)_i[e]._workInProgressVersionPrimary=null;_i.length=0}var ts=Fa.ReactCurrentDispatcher,Wi=Fa.ReactCurrentBatchConfig,zr=0,Ve=null,et=null,rt=null,ws=!1,Sn=!1,Nn=0,zx=0;function ft(){throw Error(M(321))}function gd(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ia(e[a],t[a]))return!1;return!0}function hd(e,t,a,r,o,n){if(zr=n,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ts.current=e===null||e.memoizedState===null?qx:_x,e=a(r,o),Sn){n=0;do{if(Sn=!1,Nn=0,25<=n)throw Error(M(301));n+=1,rt=et=null,t.updateQueue=null,ts.current=Wx,e=a(r,o)}while(Sn)}if(ts.current=ks,t=et!==null&&et.next!==null,zr=0,rt=et=Ve=null,ws=!1,t)throw Error(M(300));return e}function xd(){var e=Nn!==0;return Nn=0,e}function ga(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Ve.memoizedState=rt=e:rt=rt.next=e,rt}function Vt(){if(et===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=rt===null?Ve.memoizedState:rt.next;if(t!==null)rt=t,et=e;else{if(e===null)throw Error(M(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},rt===null?Ve.memoizedState=rt=e:rt=rt.next=e}return rt}function Un(e,t){return typeof t=="function"?t(e):t}function $i(e){var t=Vt(),a=t.queue;if(a===null)throw Error(M(311));a.lastRenderedReducer=e;var r=et,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var l=o.next;o.next=n.next,n.next=l}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var s=l=null,i=null,d=n;do{var f=d.lane;if((zr&f)===f)i!==null&&(i=i.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var m={lane:f,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};i===null?(s=i=m,l=r):i=i.next=m,Ve.lanes|=f,Nr|=f}d=d.next}while(d!==null&&d!==n);i===null?l=r:i.next=s,ia(r,t.memoizedState)||(Ct=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=i,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,Ve.lanes|=n,Nr|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function Vi(e){var t=Vt(),a=t.queue;if(a===null)throw Error(M(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var l=o=o.next;do n=e(n,l.action),l=l.next;while(l!==o);ia(n,t.memoizedState)||(Ct=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function jp(){}function Xp(e,t){var a=Ve,r=Vt(),o=t(),n=!ia(r.memoizedState,o);if(n&&(r.memoizedState=o,Ct=!0),r=r.queue,vd(Zp.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||rt!==null&&rt.memoizedState.tag&1){if(a.flags|=2048,Hn(9,Yp.bind(null,a,r,o,t),void 0,null),ot===null)throw Error(M(349));(zr&30)!==0||Qp(a,t,o)}return o}function Qp(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Yp(e,t,a,r){t.value=a,t.getSnapshot=r,Jp(t)&&em(e)}function Zp(e,t,a){return a(function(){Jp(t)&&em(e)})}function Jp(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ia(e,a)}catch{return!0}}function em(e){var t=Da(e,1);t!==null&&sa(t,e,1,-1)}function Ic(e){var t=ga();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:e},t.queue=e,e=e.dispatch=Hx.bind(null,Ve,e),[t.memoizedState,e]}function Hn(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function tm(){return Vt().memoizedState}function as(e,t,a,r){var o=ga();Ve.flags|=e,o.memoizedState=Hn(1|t,a,void 0,r===void 0?null:r)}function zs(e,t,a,r){var o=Vt();r=r===void 0?null:r;var n=void 0;if(et!==null){var l=et.memoizedState;if(n=l.destroy,r!==null&&gd(r,l.deps)){o.memoizedState=Hn(t,a,n,r);return}}Ve.flags|=e,o.memoizedState=Hn(1|t,a,n,r)}function Cc(e,t){return as(8390656,8,e,t)}function vd(e,t){return zs(2048,8,e,t)}function am(e,t){return zs(4,2,e,t)}function rm(e,t){return zs(4,4,e,t)}function om(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 nm(e,t,a){return a=a!=null?a.concat([e]):null,zs(4,4,om.bind(null,t,e),a)}function yd(){}function lm(e,t){var a=Vt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&gd(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function sm(e,t){var a=Vt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&gd(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function im(e,t,a){return(zr&21)===0?(e.baseState&&(e.baseState=!1,Ct=!0),e.memoizedState=a):(ia(a,t)||(a=pp(),Ve.lanes|=a,Nr|=a,e.baseState=!0),t)}function Nx(e,t){var a=Re;Re=a!==0&&4>a?a:4,e(!0);var r=Wi.transition;Wi.transition={};try{e(!1),t()}finally{Re=a,Wi.transition=r}}function um(){return Vt().memoizedState}function Ux(e,t,a){var r=or(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},dm(e))fm(t,a);else if(a=Vp(e,t,a,r),a!==null){var o=xt();sa(a,e,r,o),cm(a,t,r)}}function Hx(e,t,a){var r=or(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(dm(e))fm(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var l=t.lastRenderedState,s=n(l,a);if(o.hasEagerState=!0,o.eagerState=s,ia(s,l)){var i=t.interleaved;i===null?(o.next=o,dd(t)):(o.next=i.next,i.next=o),t.interleaved=o;return}}catch{}finally{}a=Vp(e,t,o,r),a!==null&&(o=xt(),sa(a,e,r,o),cm(a,t,r))}}function dm(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function fm(e,t){Sn=ws=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function cm(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,Qu(e,a)}}var ks={readContext:$t,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useInsertionEffect:ft,useLayoutEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useMutableSource:ft,useSyncExternalStore:ft,useId:ft,unstable_isNewReconciler:!1},qx={readContext:$t,useCallback:function(e,t){return ga().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:Cc,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,as(4194308,4,om.bind(null,t,e),a)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){return as(4,2,e,t)},useMemo:function(e,t){var a=ga();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=ga();return t=a!==void 0?a(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=Ux.bind(null,Ve,e),[r.memoizedState,e]},useRef:function(e){var t=ga();return e={current:e},t.memoizedState=e},useState:Ic,useDebugValue:yd,useDeferredValue:function(e){return ga().memoizedState=e},useTransition:function(){var e=Ic(!1),t=e[0];return e=Nx.bind(null,e[1]),ga().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=Ve,o=ga();if(_e){if(a===void 0)throw Error(M(407));a=a()}else{if(a=t(),ot===null)throw Error(M(349));(zr&30)!==0||Qp(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,Cc(Zp.bind(null,r,n,e),[e]),r.flags|=2048,Hn(9,Yp.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=ga(),t=ot.identifierPrefix;if(_e){var a=Pa,r=Ta;a=(r&~(1<<32-la(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=Nn++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=zx++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_x={readContext:$t,useCallback:lm,useContext:$t,useEffect:vd,useImperativeHandle:nm,useInsertionEffect:am,useLayoutEffect:rm,useMemo:sm,useReducer:$i,useRef:tm,useState:function(){return $i(Un)},useDebugValue:yd,useDeferredValue:function(e){var t=Vt();return im(t,et.memoizedState,e)},useTransition:function(){var e=$i(Un)[0],t=Vt().memoizedState;return[e,t]},useMutableSource:jp,useSyncExternalStore:Xp,useId:um,unstable_isNewReconciler:!1},Wx={readContext:$t,useCallback:lm,useContext:$t,useEffect:vd,useImperativeHandle:nm,useInsertionEffect:am,useLayoutEffect:rm,useMemo:sm,useReducer:Vi,useRef:tm,useState:function(){return Vi(Un)},useDebugValue:yd,useDeferredValue:function(e){var t=Vt();return et===null?t.memoizedState=e:im(t,et.memoizedState,e)},useTransition:function(){var e=Vi(Un)[0],t=Vt().memoizedState;return[e,t]},useMutableSource:jp,useSyncExternalStore:Xp,useId:um,unstable_isNewReconciler:!1};function ra(e,t){if(e&&e.defaultProps){t=Ge({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function bu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ge({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ns={isMounted:function(e){return(e=e._reactInternals)?qr(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=xt(),o=or(e),n=Ra(r,o);n.payload=t,a!=null&&(n.callback=a),t=ar(e,n,o),t!==null&&(sa(t,e,o,r),es(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=xt(),o=or(e),n=Ra(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=ar(e,n,o),t!==null&&(sa(t,e,o,r),es(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=xt(),r=or(e),o=Ra(a,r);o.tag=2,t!=null&&(o.callback=t),t=ar(e,o,r),t!==null&&(sa(t,e,r,a),es(t,e,r))}};function wc(e,t,a,r,o,n,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,l):t.prototype&&t.prototype.isPureReactComponent?!Dn(a,r)||!Dn(o,n):!0}function pm(e,t,a){var r=!1,o=sr,n=t.contextType;return typeof n=="object"&&n!==null?n=$t(n):(o=kt(t)?Br:mt.current,r=t.contextTypes,n=(r=r!=null)?Do(e,o):sr),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ns,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function kc(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&Ns.enqueueReplaceState(t,t.state,null)}function Tu(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},fd(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=$t(n):(n=kt(t)?Br:mt.current,o.context=Do(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(bu(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Ns.enqueueReplaceState(o,o.state,null),Is(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Oo(e,t){try{var a="",r=t;do a+=yh(r),r=r.return;while(r);var o=a}catch(n){o=`\nError generating stack: `+n.message+`\n`+n.stack}return{value:e,source:t,stack:o,digest:null}}function Gi(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Pu(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var $x=typeof WeakMap=="function"?WeakMap:Map;function mm(e,t,a){a=Ra(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Ts||(Ts=!0,Nu=r),Pu(e,t)},a}function gm(e,t,a){a=Ra(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){Pu(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Pu(e,t),typeof r!="function"&&(rr===null?rr=new Set([this]):rr.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),a}function bc(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new $x;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=ov.bind(null,e,t,a),t.then(e,e))}function Tc(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 Pc(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=Ra(-1,1),t.tag=2,ar(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var Vx=Fa.ReactCurrentOwner,Ct=!1;function ht(e,t,a,r){t.child=e===null?$p(t,null,a,r):Fo(t,e.child,a,r)}function Rc(e,t,a,r,o){a=a.render;var n=t.ref;return Ro(t,o),r=hd(e,t,a,r,n,o),a=xd(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ea(e,t,o)):(_e&&a&&od(t),t.flags|=1,ht(e,t,r,o),t.child)}function Mc(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Td(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,hm(e,t,n,r,o)):(e=ls(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var l=n.memoizedProps;if(a=a.compare,a=a!==null?a:Dn,a(l,r)&&e.ref===t.ref)return Ea(e,t,o)}return t.flags|=1,e=nr(n,r),e.ref=t.ref,e.return=t,t.child=e}function hm(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(Dn(n,r)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,Ea(e,t,o)}return Ru(e,t,a,r,o)}function xm(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(wo,Mt),Mt|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ne(wo,Mt),Mt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,Ne(wo,Mt),Mt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,Ne(wo,Mt),Mt|=r;return ht(e,t,o,a),t.child}function vm(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Ru(e,t,a,r,o){var n=kt(a)?Br:mt.current;return n=Do(t,n),Ro(t,o),a=hd(e,t,a,r,n,o),r=xd(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ea(e,t,o)):(_e&&r&&od(t),t.flags|=1,ht(e,t,a,o),t.child)}function Ac(e,t,a,r,o){if(kt(a)){var n=!0;xs(t)}else n=!1;if(Ro(t,o),t.stateNode===null)rs(e,t),pm(t,a,r),Tu(t,a,r,o),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var i=l.context,d=a.contextType;typeof d=="object"&&d!==null?d=$t(d):(d=kt(a)?Br:mt.current,d=Do(t,d));var f=a.getDerivedStateFromProps,m=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function";m||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||i!==d)&&kc(t,l,r,d),Ka=!1;var g=t.memoizedState;l.state=g,Is(t,r,l,o),i=t.memoizedState,s!==r||g!==i||wt.current||Ka?(typeof f=="function"&&(bu(t,a,f,r),i=t.memoizedState),(s=Ka||wc(t,a,s,r,g,i,d))?(m||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=i),l.props=r,l.state=i,l.context=d,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,Gp(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:ra(t.type,s),l.props=d,m=t.pendingProps,g=l.context,i=a.contextType,typeof i=="object"&&i!==null?i=$t(i):(i=kt(a)?Br:mt.current,i=Do(t,i));var L=a.getDerivedStateFromProps;(f=typeof L=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==m||g!==i)&&kc(t,l,r,i),Ka=!1,g=t.memoizedState,l.state=g,Is(t,r,l,o);var x=t.memoizedState;s!==m||g!==x||wt.current||Ka?(typeof L=="function"&&(bu(t,a,L,r),x=t.memoizedState),(d=Ka||wc(t,a,d,r,g,x,i)||!1)?(f||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,x,i),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,x,i)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),l.props=r,l.state=x,l.context=i,r=d):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return Mu(e,t,a,r,n,o)}function Mu(e,t,a,r,o,n){vm(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&hc(t,a,!1),Ea(e,t,n);r=t.stateNode,Vx.current=t;var s=l&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Fo(t,e.child,null,n),t.child=Fo(t,null,s,n)):ht(e,t,s,n),t.memoizedState=r.state,o&&hc(t,a,!0),t.child}function ym(e){var t=e.stateNode;t.pendingContext?gc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gc(e,t.context,!1),cd(e,t.containerInfo)}function Dc(e,t,a,r,o){return Eo(),ld(o),t.flags|=256,ht(e,t,a,r),t.child}var Au={dehydrated:null,treeContext:null,retryLane:0};function Du(e){return{baseLanes:e,cachePool:null,transitions:null}}function Lm(e,t,a){var r=t.pendingProps,o=$e.current,n=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(o&2)!==0),s?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ne($e,o&1),e===null)return wu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(l=r.children,e=r.fallback,n?(r=t.mode,n=t.child,l={mode:"hidden",children:l},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=l):n=qs(l,r,0,null),e=Fr(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Du(a),t.memoizedState=Au,e):Ld(t,l));if(o=e.memoizedState,o!==null&&(s=o.dehydrated,s!==null))return Gx(e,t,l,r,s,o,a);if(n){n=r.fallback,l=t.mode,o=e.child,s=o.sibling;var i={mode:"hidden",children:r.children};return(l&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=i,t.deletions=null):(r=nr(o,i),r.subtreeFlags=o.subtreeFlags&14680064),s!==null?n=nr(s,n):(n=Fr(n,l,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,l=e.child.memoizedState,l=l===null?Du(a):{baseLanes:l.baseLanes|a,cachePool:null,transitions:l.transitions},n.memoizedState=l,n.childLanes=e.childLanes&~a,t.memoizedState=Au,r}return n=e.child,e=n.sibling,r=nr(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function Ld(e,t){return t=qs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function jl(e,t,a,r){return r!==null&&ld(r),Fo(t,e.child,null,a),e=Ld(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gx(e,t,a,r,o,n,l){if(a)return t.flags&256?(t.flags&=-257,r=Gi(Error(M(422))),jl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=qs({mode:"visible",children:r.children},o,0,null),n=Fr(n,o,l,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&Fo(t,e.child,null,l),t.child.memoizedState=Du(l),t.memoizedState=Au,n);if((t.mode&1)===0)return jl(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var s=r.dgst;return r=s,n=Error(M(419)),r=Gi(n,r,void 0),jl(e,t,l,r)}if(s=(l&e.childLanes)!==0,Ct||s){if(r=ot,r!==null){switch(l&-l){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|l))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,Da(e,o),sa(r,e,o,-1))}return bd(),r=Gi(Error(M(421))),jl(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=nv.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,At=tr(o.nextSibling),Dt=t,_e=!0,na=null,e!==null&&(Ht[qt++]=Ta,Ht[qt++]=Pa,Ht[qt++]=Or,Ta=e.id,Pa=e.overflow,Or=t),t=Ld(t,r.children),t.flags|=4096,t)}function Ec(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ku(e.return,t,a)}function Ki(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function Sm(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(ht(e,t,r.children,a),r=$e.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ec(e,a,t);else if(e.tag===19)Ec(e,a,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(Ne($e,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&Cs(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),Ki(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Cs(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}Ki(t,!0,a,null,n);break;case"together":Ki(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rs(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ea(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Nr|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,a=nr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=nr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Kx(e,t,a){switch(t.tag){case 3:ym(t),Eo();break;case 5:Kp(t);break;case 1:kt(t.type)&&xs(t);break;case 4:cd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ne(Ls,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ne($e,$e.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?Lm(e,t,a):(Ne($e,$e.current&1),e=Ea(e,t,a),e!==null?e.sibling:null);Ne($e,$e.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Sm(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ne($e,$e.current),r)break;return null;case 22:case 23:return t.lanes=0,xm(e,t,a)}return Ea(e,t,a)}var Im,Eu,Cm,wm;Im=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};Eu=function(){};Cm=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Dr(va.current);var n=null;switch(a){case"input":o=tu(e,o),r=tu(e,r),n=[];break;case"select":o=Ge({},o,{value:void 0}),r=Ge({},r,{value:void 0}),n=[];break;case"textarea":o=ou(e,o),r=ou(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=gs)}lu(a,r);var l;a=null;for(d in o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var s=o[d];for(l in s)s.hasOwnProperty(l)&&(a||(a={}),a[l]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(kn.hasOwnProperty(d)?n||(n=[]):(n=n||[]).push(d,null));for(d in r){var i=r[d];if(s=o!=null?o[d]:void 0,r.hasOwnProperty(d)&&i!==s&&(i!=null||s!=null))if(d==="style")if(s){for(l in s)!s.hasOwnProperty(l)||i&&i.hasOwnProperty(l)||(a||(a={}),a[l]="");for(l in i)i.hasOwnProperty(l)&&s[l]!==i[l]&&(a||(a={}),a[l]=i[l])}else a||(n||(n=[]),n.push(d,a)),a=i;else d==="dangerouslySetInnerHTML"?(i=i?i.__html:void 0,s=s?s.__html:void 0,i!=null&&s!==i&&(n=n||[]).push(d,i)):d==="children"?typeof i!="string"&&typeof i!="number"||(n=n||[]).push(d,""+i):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(kn.hasOwnProperty(d)?(i!=null&&d==="onScroll"&&He("scroll",e),n||s===i||(n=[])):(n=n||[]).push(d,i))}a&&(n=n||[]).push("style",a);var d=n;(t.updateQueue=d)&&(t.flags|=4)}};wm=function(e,t,a,r){a!==r&&(t.flags|=4)};function un(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function jx(e,t,a){var r=t.pendingProps;switch(nd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(t),null;case 1:return kt(t.type)&&hs(),ct(t),null;case 3:return r=t.stateNode,Bo(),qe(wt),qe(mt),md(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,na!==null&&(qu(na),na=null))),Eu(e,t),ct(t),null;case 5:pd(t);var o=Dr(zn.current);if(a=t.type,e!==null&&t.stateNode!=null)Cm(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return ct(t),null}if(e=Dr(va.current),Gl(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[ha]=t,r[Bn]=n,e=(t.mode&1)!==0,a){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(o=0;o<gn.length;o++)He(gn[o],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":qf(r,n),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},He("invalid",r);break;case"textarea":Wf(r,n),He("invalid",r)}lu(a,n),o=null;for(var l in n)if(n.hasOwnProperty(l)){var s=n[l];l==="children"?typeof s=="string"?r.textContent!==s&&(n.suppressHydrationWarning!==!0&&Vl(r.textContent,s,e),o=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(n.suppressHydrationWarning!==!0&&Vl(r.textContent,s,e),o=["children",""+s]):kn.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&He("scroll",r)}switch(a){case"input":El(r),_f(r,n,!0);break;case"textarea":El(r),$f(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=gs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Zc(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=l.createElement("div"),e.innerHTML="<script><\\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(a,{is:r.is}):(e=l.createElement(a),a==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,a),e[ha]=t,e[Bn]=r,Im(e,t,!1,!1),t.stateNode=e;e:{switch(l=su(a,r),a){case"dialog":He("cancel",e),He("close",e),o=r;break;case"iframe":case"object":case"embed":He("load",e),o=r;break;case"video":case"audio":for(o=0;o<gn.length;o++)He(gn[o],e);o=r;break;case"source":He("error",e),o=r;break;case"img":case"image":case"link":He("error",e),He("load",e),o=r;break;case"details":He("toggle",e),o=r;break;case"input":qf(e,r),o=tu(e,r),He("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ge({},r,{value:void 0}),He("invalid",e);break;case"textarea":Wf(e,r),o=ou(e,r),He("invalid",e);break;default:o=r}lu(a,o),s=o;for(n in s)if(s.hasOwnProperty(n)){var i=s[n];n==="style"?tp(e,i):n==="dangerouslySetInnerHTML"?(i=i?i.__html:void 0,i!=null&&Jc(e,i)):n==="children"?typeof i=="string"?(a!=="textarea"||i!=="")&&bn(e,i):typeof i=="number"&&bn(e,""+i):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(kn.hasOwnProperty(n)?i!=null&&n==="onScroll"&&He("scroll",e):i!=null&&$u(e,n,i,l))}switch(a){case"input":El(e),_f(e,r,!1);break;case"textarea":El(e),$f(e);break;case"option":r.value!=null&&e.setAttribute("value",""+lr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?ko(e,!!r.multiple,n,!1):r.defaultValue!=null&&ko(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=gs)}switch(a){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 ct(t),null;case 6:if(e&&t.stateNode!=null)wm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(a=Dr(zn.current),Dr(va.current),Gl(t)){if(r=t.stateNode,a=t.memoizedProps,r[ha]=t,(n=r.nodeValue!==a)&&(e=Dt,e!==null))switch(e.tag){case 3:Vl(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vl(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[ha]=t,t.stateNode=r}return ct(t),null;case 13:if(qe($e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&At!==null&&(t.mode&1)!==0&&(t.flags&128)===0)_p(),Eo(),t.flags|=98560,n=!1;else if(n=Gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(M(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(M(317));n[ha]=t}else Eo(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ct(t),n=!1}else na!==null&&(qu(na),na=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||($e.current&1)!==0?tt===0&&(tt=3):bd())),t.updateQueue!==null&&(t.flags|=4),ct(t),null);case 4:return Bo(),Eu(e,t),e===null&&En(t.stateNode.containerInfo),ct(t),null;case 10:return ud(t.type._context),ct(t),null;case 17:return kt(t.type)&&hs(),ct(t),null;case 19:if(qe($e),n=t.memoizedState,n===null)return ct(t),null;if(r=(t.flags&128)!==0,l=n.rendering,l===null)if(r)un(n,!1);else{if(tt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(l=Cs(e),l!==null){for(t.flags|=128,un(n,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,l=n.alternate,l===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,e=l.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return Ne($e,$e.current&1|2),t.child}e=e.sibling}n.tail!==null&&Qe()>zo&&(t.flags|=128,r=!0,un(n,!1),t.lanes=4194304)}else{if(!r)if(e=Cs(l),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),un(n,!0),n.tail===null&&n.tailMode==="hidden"&&!l.alternate&&!_e)return ct(t),null}else 2*Qe()-n.renderingStartTime>zo&&a!==1073741824&&(t.flags|=128,r=!0,un(n,!1),t.lanes=4194304);n.isBackwards?(l.sibling=t.child,t.child=l):(a=n.last,a!==null?a.sibling=l:t.child=l,n.last=l)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Qe(),t.sibling=null,a=$e.current,Ne($e,r?a&1|2:a&1),t):(ct(t),null);case 22:case 23:return kd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Mt&1073741824)!==0&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function Xx(e,t){switch(nd(t),t.tag){case 1:return kt(t.type)&&hs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bo(),qe(wt),qe(mt),md(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return pd(t),null;case 13:if(qe($e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Eo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe($e),null;case 4:return Bo(),null;case 10:return ud(t.type._context),null;case 22:case 23:return kd(),null;case 24:return null;default:return null}}var Xl=!1,pt=!1,Qx=typeof WeakSet=="function"?WeakSet:Set,G=null;function Co(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){je(e,t,r)}else a.current=null}function Fu(e,t,a){try{a()}catch(r){je(e,t,r)}}var Fc=!1;function Yx(e,t){if(xu=cs,e=Rp(),rd(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var l=0,s=-1,i=-1,d=0,f=0,m=e,g=null;t:for(;;){for(var L;m!==a||o!==0&&m.nodeType!==3||(s=l+o),m!==n||r!==0&&m.nodeType!==3||(i=l+r),m.nodeType===3&&(l+=m.nodeValue.length),(L=m.firstChild)!==null;)g=m,m=L;for(;;){if(m===e)break t;if(g===a&&++d===o&&(s=l),g===n&&++f===r&&(i=l),(L=m.nextSibling)!==null)break;m=g,g=m.parentNode}m=L}a=s===-1||i===-1?null:{start:s,end:i}}else a=null}a=a||{start:0,end:0}}else a=null;for(vu={focusedElem:e,selectionRange:a},cs=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var I=x.memoizedProps,H=x.memoizedState,p=t.stateNode,u=p.getSnapshotBeforeUpdate(t.elementType===t.type?I:ra(t.type,I),H);p.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(v){je(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return x=Fc,Fc=!1,x}function In(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&Fu(t,a,n)}o=o.next}while(o!==r)}}function Us(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function Bu(e){var t=e.ref;if(t!==null){var a=e.stateNode;switch(e.tag){case 5:e=a;break;default:e=a}typeof t=="function"?t(e):t.current=e}}function km(e){var t=e.alternate;t!==null&&(e.alternate=null,km(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ha],delete t[Bn],delete t[Su],delete t[Ex],delete t[Fx])),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 bm(e){return e.tag===5||e.tag===3||e.tag===4}function Bc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bm(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 Ou(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=gs));else if(r!==4&&(e=e.child,e!==null))for(Ou(e,t,a),e=e.sibling;e!==null;)Ou(e,t,a),e=e.sibling}function zu(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(zu(e,t,a),e=e.sibling;e!==null;)zu(e,t,a),e=e.sibling}var lt=null,oa=!1;function Va(e,t,a){for(a=a.child;a!==null;)Tm(e,t,a),a=a.sibling}function Tm(e,t,a){if(xa&&typeof xa.onCommitFiberUnmount=="function")try{xa.onCommitFiberUnmount(As,a)}catch{}switch(a.tag){case 5:pt||Co(a,t);case 6:var r=lt,o=oa;lt=null,Va(e,t,a),lt=r,oa=o,lt!==null&&(oa?(e=lt,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):lt.removeChild(a.stateNode));break;case 18:lt!==null&&(oa?(e=lt,a=a.stateNode,e.nodeType===8?Hi(e.parentNode,a):e.nodeType===1&&Hi(e,a),Mn(e)):Hi(lt,a.stateNode));break;case 4:r=lt,o=oa,lt=a.stateNode.containerInfo,oa=!0,Va(e,t,a),lt=r,oa=o;break;case 0:case 11:case 14:case 15:if(!pt&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,l=n.destroy;n=n.tag,l!==void 0&&((n&2)!==0||(n&4)!==0)&&Fu(a,t,l),o=o.next}while(o!==r)}Va(e,t,a);break;case 1:if(!pt&&(Co(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(s){je(a,t,s)}Va(e,t,a);break;case 21:Va(e,t,a);break;case 22:a.mode&1?(pt=(r=pt)||a.memoizedState!==null,Va(e,t,a),pt=r):Va(e,t,a);break;default:Va(e,t,a)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new Qx),t.forEach(function(r){var o=lv.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function aa(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:lt=s.stateNode,oa=!1;break e;case 3:lt=s.stateNode.containerInfo,oa=!0;break e;case 4:lt=s.stateNode.containerInfo,oa=!0;break e}s=s.return}if(lt===null)throw Error(M(160));Tm(n,l,o),lt=null,oa=!1;var i=o.alternate;i!==null&&(i.return=null),o.return=null}catch(d){je(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Pm(t,e),t=t.sibling}function Pm(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(aa(t,e),ma(e),r&4){try{In(3,e,e.return),Us(3,e)}catch(I){je(e,e.return,I)}try{In(5,e,e.return)}catch(I){je(e,e.return,I)}}break;case 1:aa(t,e),ma(e),r&512&&a!==null&&Co(a,a.return);break;case 5:if(aa(t,e),ma(e),r&512&&a!==null&&Co(a,a.return),e.flags&32){var o=e.stateNode;try{bn(o,"")}catch(I){je(e,e.return,I)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,l=a!==null?a.memoizedProps:n,s=e.type,i=e.updateQueue;if(e.updateQueue=null,i!==null)try{s==="input"&&n.type==="radio"&&n.name!=null&&Qc(o,n),su(s,l);var d=su(s,n);for(l=0;l<i.length;l+=2){var f=i[l],m=i[l+1];f==="style"?tp(o,m):f==="dangerouslySetInnerHTML"?Jc(o,m):f==="children"?bn(o,m):$u(o,f,m,d)}switch(s){case"input":au(o,n);break;case"textarea":Yc(o,n);break;case"select":var g=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var L=n.value;L!=null?ko(o,!!n.multiple,L,!1):g!==!!n.multiple&&(n.defaultValue!=null?ko(o,!!n.multiple,n.defaultValue,!0):ko(o,!!n.multiple,n.multiple?[]:"",!1))}o[Bn]=n}catch(I){je(e,e.return,I)}}break;case 6:if(aa(t,e),ma(e),r&4){if(e.stateNode===null)throw Error(M(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(I){je(e,e.return,I)}}break;case 3:if(aa(t,e),ma(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{Mn(t.containerInfo)}catch(I){je(e,e.return,I)}break;case 4:aa(t,e),ma(e);break;case 13:aa(t,e),ma(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(Cd=Qe())),r&4&&Oc(e);break;case 22:if(f=a!==null&&a.memoizedState!==null,e.mode&1?(pt=(d=pt)||f,aa(t,e),pt=d):aa(t,e),ma(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!f&&(e.mode&1)!==0)for(G=e,f=e.child;f!==null;){for(m=G=f;G!==null;){switch(g=G,L=g.child,g.tag){case 0:case 11:case 14:case 15:In(4,g,g.return);break;case 1:Co(g,g.return);var x=g.stateNode;if(typeof x.componentWillUnmount=="function"){r=g,a=g.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(I){je(r,a,I)}}break;case 5:Co(g,g.return);break;case 22:if(g.memoizedState!==null){Nc(m);continue}}L!==null?(L.return=g,G=L):Nc(m)}f=f.sibling}e:for(f=null,m=e;;){if(m.tag===5){if(f===null){f=m;try{o=m.stateNode,d?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(s=m.stateNode,i=m.memoizedProps.style,l=i!=null&&i.hasOwnProperty("display")?i.display:null,s.style.display=ep("display",l))}catch(I){je(e,e.return,I)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(I){je(e,e.return,I)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===e)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===e)break e;for(;m.sibling===null;){if(m.return===null||m.return===e)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:aa(t,e),ma(e),r&4&&Oc(e);break;case 21:break;default:aa(t,e),ma(e)}}function ma(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(bm(a)){var r=a;break e}a=a.return}throw Error(M(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(bn(o,""),r.flags&=-33);var n=Bc(e);zu(e,n,o);break;case 3:case 4:var l=r.stateNode.containerInfo,s=Bc(e);Ou(e,s,l);break;default:throw Error(M(161))}}catch(i){je(e,e.return,i)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Zx(e,t,a){G=e,Rm(e,t,a)}function Rm(e,t,a){for(var r=(e.mode&1)!==0;G!==null;){var o=G,n=o.child;if(o.tag===22&&r){var l=o.memoizedState!==null||Xl;if(!l){var s=o.alternate,i=s!==null&&s.memoizedState!==null||pt;s=Xl;var d=pt;if(Xl=l,(pt=i)&&!d)for(G=o;G!==null;)l=G,i=l.child,l.tag===22&&l.memoizedState!==null?Uc(o):i!==null?(i.return=l,G=i):Uc(o);for(;n!==null;)G=n,Rm(n,t,a),n=n.sibling;G=o,Xl=s,pt=d}zc(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,G=n):zc(e,t,a)}}function zc(e){for(;G!==null;){var t=G;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:pt||Us(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!pt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:ra(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&Sc(t,n,r);break;case 3:var l=t.updateQueue;if(l!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}Sc(t,l,a)}break;case 5:var s=t.stateNode;if(a===null&&t.flags&4){a=s;var i=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break;case"img":i.src&&(a.src=i.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var f=d.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&Mn(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}pt||t.flags&512&&Bu(t)}catch(g){je(t,t.return,g)}}if(t===e){G=null;break}if(a=t.sibling,a!==null){a.return=t.return,G=a;break}G=t.return}}function Nc(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}function Uc(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{Us(4,t)}catch(i){je(t,a,i)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(i){je(t,o,i)}}var n=t.return;try{Bu(t)}catch(i){je(t,n,i)}break;case 5:var l=t.return;try{Bu(t)}catch(i){je(t,l,i)}}}catch(i){je(t,t.return,i)}if(t===e){G=null;break}var s=t.sibling;if(s!==null){s.return=t.return,G=s;break}G=t.return}}var Jx=Math.ceil,bs=Fa.ReactCurrentDispatcher,Sd=Fa.ReactCurrentOwner,Wt=Fa.ReactCurrentBatchConfig,Le=0,ot=null,Ye=null,st=0,Mt=0,wo=ur(0),tt=0,qn=null,Nr=0,Hs=0,Id=0,Cn=null,It=null,Cd=0,zo=1/0,ka=null,Ts=!1,Nu=null,rr=null,Ql=!1,Ya=null,Ps=0,wn=0,Uu=null,os=-1,ns=0;function xt(){return(Le&6)!==0?Qe():os!==-1?os:os=Qe()}function or(e){return(e.mode&1)===0?1:(Le&2)!==0&&st!==0?st&-st:Ox.transition!==null?(ns===0&&(ns=pp()),ns):(e=Re,e!==0||(e=window.event,e=e===void 0?16:Lp(e.type)),e)}function sa(e,t,a,r){if(50<wn)throw wn=0,Uu=null,Error(M(185));_n(e,a,r),((Le&2)===0||e!==ot)&&(e===ot&&((Le&2)===0&&(Hs|=a),tt===4&&Xa(e,st)),bt(e,r),a===1&&Le===0&&(t.mode&1)===0&&(zo=Qe()+500,Os&&dr()))}function bt(e,t){var a=e.callbackNode;Nh(e,t);var r=fs(e,e===ot?st:0);if(r===0)a!==null&&Kf(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&Kf(a),t===1)e.tag===0?Bx(Hc.bind(null,e)):Up(Hc.bind(null,e)),Ax(function(){(Le&6)===0&&dr()}),a=null;else{switch(mp(r)){case 1:a=Xu;break;case 4:a=fp;break;case 16:a=ds;break;case 536870912:a=cp;break;default:a=ds}a=zm(a,Mm.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function Mm(e,t){if(os=-1,ns=0,(Le&6)!==0)throw Error(M(327));var a=e.callbackNode;if(Mo()&&e.callbackNode!==a)return null;var r=fs(e,e===ot?st:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Rs(e,r);else{t=r;var o=Le;Le|=2;var n=Dm();(ot!==e||st!==t)&&(ka=null,zo=Qe()+500,Er(e,t));do try{av();break}catch(s){Am(e,s)}while(!0);id(),bs.current=n,Le=o,Ye!==null?t=0:(ot=null,st=0,t=tt)}if(t!==0){if(t===2&&(o=cu(e),o!==0&&(r=o,t=Hu(e,o))),t===1)throw a=qn,Er(e,0),Xa(e,r),bt(e,Qe()),a;if(t===6)Xa(e,r);else{if(o=e.current.alternate,(r&30)===0&&!ev(o)&&(t=Rs(e,r),t===2&&(n=cu(e),n!==0&&(r=n,t=Hu(e,n))),t===1))throw a=qn,Er(e,0),Xa(e,r),bt(e,Qe()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:Rr(e,It,ka);break;case 3:if(Xa(e,r),(r&130023424)===r&&(t=Cd+500-Qe(),10<t)){if(fs(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){xt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Lu(Rr.bind(null,e,It,ka),t);break}Rr(e,It,ka);break;case 4:if(Xa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-la(r);n=1<<l,l=t[l],l>o&&(o=l),r&=~n}if(r=o,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Jx(r/1960))-r,10<r){e.timeoutHandle=Lu(Rr.bind(null,e,It,ka),r);break}Rr(e,It,ka);break;case 5:Rr(e,It,ka);break;default:throw Error(M(329))}}}return bt(e,Qe()),e.callbackNode===a?Mm.bind(null,e):null}function Hu(e,t){var a=Cn;return e.current.memoizedState.isDehydrated&&(Er(e,t).flags|=256),e=Rs(e,t),e!==2&&(t=It,It=a,t!==null&&qu(t)),e}function qu(e){It===null?It=e:It.push.apply(It,e)}function ev(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!ia(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Xa(e,t){for(t&=~Id,t&=~Hs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-la(t),r=1<<a;e[a]=-1,t&=~r}}function Hc(e){if((Le&6)!==0)throw Error(M(327));Mo();var t=fs(e,0);if((t&1)===0)return bt(e,Qe()),null;var a=Rs(e,t);if(e.tag!==0&&a===2){var r=cu(e);r!==0&&(t=r,a=Hu(e,r))}if(a===1)throw a=qn,Er(e,0),Xa(e,t),bt(e,Qe()),a;if(a===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rr(e,It,ka),bt(e,Qe()),null}function wd(e,t){var a=Le;Le|=1;try{return e(t)}finally{Le=a,Le===0&&(zo=Qe()+500,Os&&dr())}}function Ur(e){Ya!==null&&Ya.tag===0&&(Le&6)===0&&Mo();var t=Le;Le|=1;var a=Wt.transition,r=Re;try{if(Wt.transition=null,Re=1,e)return e()}finally{Re=r,Wt.transition=a,Le=t,(Le&6)===0&&dr()}}function kd(){Mt=wo.current,qe(wo)}function Er(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,Mx(a)),Ye!==null)for(a=Ye.return;a!==null;){var r=a;switch(nd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&hs();break;case 3:Bo(),qe(wt),qe(mt),md();break;case 5:pd(r);break;case 4:Bo();break;case 13:qe($e);break;case 19:qe($e);break;case 10:ud(r.type._context);break;case 22:case 23:kd()}a=a.return}if(ot=e,Ye=e=nr(e.current,null),st=Mt=t,tt=0,qn=null,Id=Hs=Nr=0,It=Cn=null,Ar!==null){for(t=0;t<Ar.length;t++)if(a=Ar[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var l=n.next;n.next=o,r.next=l}a.pending=r}Ar=null}return e}function Am(e,t){do{var a=Ye;try{if(id(),ts.current=ks,ws){for(var r=Ve.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ws=!1}if(zr=0,rt=et=Ve=null,Sn=!1,Nn=0,Sd.current=null,a===null||a.return===null){tt=1,qn=t,Ye=null;break}e:{var n=e,l=a.return,s=a,i=t;if(t=st,s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){var d=i,f=s,m=f.tag;if((f.mode&1)===0&&(m===0||m===11||m===15)){var g=f.alternate;g?(f.updateQueue=g.updateQueue,f.memoizedState=g.memoizedState,f.lanes=g.lanes):(f.updateQueue=null,f.memoizedState=null)}var L=Tc(l);if(L!==null){L.flags&=-257,Pc(L,l,s,n,t),L.mode&1&&bc(n,d,t),t=L,i=d;var x=t.updateQueue;if(x===null){var I=new Set;I.add(i),t.updateQueue=I}else x.add(i);break e}else{if((t&1)===0){bc(n,d,t),bd();break e}i=Error(M(426))}}else if(_e&&s.mode&1){var H=Tc(l);if(H!==null){(H.flags&65536)===0&&(H.flags|=256),Pc(H,l,s,n,t),ld(Oo(i,s));break e}}n=i=Oo(i,s),tt!==4&&(tt=2),Cn===null?Cn=[n]:Cn.push(n),n=l;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var p=mm(n,i,t);Lc(n,p);break e;case 1:s=i;var u=n.type,c=n.stateNode;if((n.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(rr===null||!rr.has(c)))){n.flags|=65536,t&=-t,n.lanes|=t;var v=gm(n,s,t);Lc(n,v);break e}}n=n.return}while(n!==null)}Fm(a)}catch(w){t=w,Ye===a&&a!==null&&(Ye=a=a.return);continue}break}while(!0)}function Dm(){var e=bs.current;return bs.current=ks,e===null?ks:e}function bd(){(tt===0||tt===3||tt===2)&&(tt=4),ot===null||(Nr&268435455)===0&&(Hs&268435455)===0||Xa(ot,st)}function Rs(e,t){var a=Le;Le|=2;var r=Dm();(ot!==e||st!==t)&&(ka=null,Er(e,t));do try{tv();break}catch(o){Am(e,o)}while(!0);if(id(),Le=a,bs.current=r,Ye!==null)throw Error(M(261));return ot=null,st=0,tt}function tv(){for(;Ye!==null;)Em(Ye)}function av(){for(;Ye!==null&&!Rh();)Em(Ye)}function Em(e){var t=Om(e.alternate,e,Mt);e.memoizedProps=e.pendingProps,t===null?Fm(e):Ye=t,Sd.current=null}function Fm(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=jx(a,t,Mt),a!==null){Ye=a;return}}else{if(a=Xx(a,t),a!==null){a.flags&=32767,Ye=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{tt=6,Ye=null;return}}if(t=t.sibling,t!==null){Ye=t;return}Ye=t=e}while(t!==null);tt===0&&(tt=5)}function Rr(e,t,a){var r=Re,o=Wt.transition;try{Wt.transition=null,Re=1,rv(e,t,a,r)}finally{Wt.transition=o,Re=r}return null}function rv(e,t,a,r){do Mo();while(Ya!==null);if((Le&6)!==0)throw Error(M(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(M(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(Uh(e,n),e===ot&&(Ye=ot=null,st=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||Ql||(Ql=!0,zm(ds,function(){return Mo(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=Wt.transition,Wt.transition=null;var l=Re;Re=1;var s=Le;Le|=4,Sd.current=null,Yx(e,a),Pm(a,e),kx(vu),cs=!!xu,vu=xu=null,e.current=a,Zx(a,e,o),Mh(),Le=s,Re=l,Wt.transition=n}else e.current=a;if(Ql&&(Ql=!1,Ya=e,Ps=o),n=e.pendingLanes,n===0&&(rr=null),Eh(a.stateNode,r),bt(e,Qe()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ts)throw Ts=!1,e=Nu,Nu=null,e;return(Ps&1)!==0&&e.tag!==0&&Mo(),n=e.pendingLanes,(n&1)!==0?e===Uu?wn++:(wn=0,Uu=e):wn=0,dr(),null}function Mo(){if(Ya!==null){var e=mp(Ps),t=Wt.transition,a=Re;try{if(Wt.transition=null,Re=16>e?16:e,Ya===null)var r=!1;else{if(e=Ya,Ya=null,Ps=0,(Le&6)!==0)throw Error(M(331));var o=Le;for(Le|=4,G=e.current;G!==null;){var n=G,l=n.child;if((G.flags&16)!==0){var s=n.deletions;if(s!==null){for(var i=0;i<s.length;i++){var d=s[i];for(G=d;G!==null;){var f=G;switch(f.tag){case 0:case 11:case 15:In(8,f,n)}var m=f.child;if(m!==null)m.return=f,G=m;else for(;G!==null;){f=G;var g=f.sibling,L=f.return;if(km(f),f===d){G=null;break}if(g!==null){g.return=L,G=g;break}G=L}}}var x=n.alternate;if(x!==null){var I=x.child;if(I!==null){x.child=null;do{var H=I.sibling;I.sibling=null,I=H}while(I!==null)}}G=n}}if((n.subtreeFlags&2064)!==0&&l!==null)l.return=n,G=l;else e:for(;G!==null;){if(n=G,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:In(9,n,n.return)}var p=n.sibling;if(p!==null){p.return=n.return,G=p;break e}G=n.return}}var u=e.current;for(G=u;G!==null;){l=G;var c=l.child;if((l.subtreeFlags&2064)!==0&&c!==null)c.return=l,G=c;else e:for(l=u;G!==null;){if(s=G,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:Us(9,s)}}catch(w){je(s,s.return,w)}if(s===l){G=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,G=v;break e}G=s.return}}if(Le=o,dr(),xa&&typeof xa.onPostCommitFiberRoot=="function")try{xa.onPostCommitFiberRoot(As,e)}catch{}r=!0}return r}finally{Re=a,Wt.transition=t}}return!1}function qc(e,t,a){t=Oo(a,t),t=mm(e,t,1),e=ar(e,t,1),t=xt(),e!==null&&(_n(e,1,t),bt(e,t))}function je(e,t,a){if(e.tag===3)qc(e,e,a);else for(;t!==null;){if(t.tag===3){qc(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(rr===null||!rr.has(r))){e=Oo(a,e),e=gm(t,e,1),t=ar(t,e,1),e=xt(),t!==null&&(_n(t,1,e),bt(t,e));break}}t=t.return}}function ov(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=xt(),e.pingedLanes|=e.suspendedLanes&a,ot===e&&(st&a)===a&&(tt===4||tt===3&&(st&130023424)===st&&500>Qe()-Cd?Er(e,0):Id|=a),bt(e,t)}function Bm(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ol,Ol<<=1,(Ol&130023424)===0&&(Ol=4194304)));var a=xt();e=Da(e,t),e!==null&&(_n(e,t,a),bt(e,a))}function nv(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Bm(e,a)}function lv(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),Bm(e,a)}var Om;Om=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||wt.current)Ct=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return Ct=!1,Kx(e,t,a);Ct=(e.flags&131072)!==0}else Ct=!1,_e&&(t.flags&1048576)!==0&&Hp(t,ys,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;rs(e,t),e=t.pendingProps;var o=Do(t,mt.current);Ro(t,a),o=hd(null,t,r,e,o,a);var n=xd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kt(r)?(n=!0,xs(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,fd(t),o.updater=Ns,t.stateNode=o,o._reactInternals=t,Tu(t,r,e,a),t=Mu(null,t,r,!0,n,a)):(t.tag=0,_e&&n&&od(t),ht(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(rs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=iv(r),e=ra(r,e),o){case 0:t=Ru(null,t,r,e,a);break e;case 1:t=Ac(null,t,r,e,a);break e;case 11:t=Rc(null,t,r,e,a);break e;case 14:t=Mc(null,t,r,ra(r.type,e),a);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ra(r,o),Ru(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ra(r,o),Ac(e,t,r,o,a);case 3:e:{if(ym(t),e===null)throw Error(M(387));r=t.pendingProps,n=t.memoizedState,o=n.element,Gp(e,t),Is(t,r,null,a);var l=t.memoizedState;if(r=l.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=Oo(Error(M(423)),t),t=Dc(e,t,r,a,o);break e}else if(r!==o){o=Oo(Error(M(424)),t),t=Dc(e,t,r,a,o);break e}else for(At=tr(t.stateNode.containerInfo.firstChild),Dt=t,_e=!0,na=null,a=$p(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Eo(),r===o){t=Ea(e,t,a);break e}ht(e,t,r,a)}t=t.child}return t;case 5:return Kp(t),e===null&&wu(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,l=o.children,yu(r,o)?l=null:n!==null&&yu(r,n)&&(t.flags|=32),vm(e,t),ht(e,t,l,a),t.child;case 6:return e===null&&wu(t),null;case 13:return Lm(e,t,a);case 4:return cd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fo(t,null,r,a):ht(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ra(r,o),Rc(e,t,r,o,a);case 7:return ht(e,t,t.pendingProps,a),t.child;case 8:return ht(e,t,t.pendingProps.children,a),t.child;case 12:return ht(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,l=o.value,Ne(Ls,r._currentValue),r._currentValue=l,n!==null)if(ia(n.value,l)){if(n.children===o.children&&!wt.current){t=Ea(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var s=n.dependencies;if(s!==null){l=n.child;for(var i=s.firstContext;i!==null;){if(i.context===r){if(n.tag===1){i=Ra(-1,a&-a),i.tag=2;var d=n.updateQueue;if(d!==null){d=d.shared;var f=d.pending;f===null?i.next=i:(i.next=f.next,f.next=i),d.pending=i}}n.lanes|=a,i=n.alternate,i!==null&&(i.lanes|=a),ku(n.return,a,t),s.lanes|=a;break}i=i.next}}else if(n.tag===10)l=n.type===t.type?null:n.child;else if(n.tag===18){if(l=n.return,l===null)throw Error(M(341));l.lanes|=a,s=l.alternate,s!==null&&(s.lanes|=a),ku(l,a,t),l=n.sibling}else l=n.child;if(l!==null)l.return=n;else for(l=n;l!==null;){if(l===t){l=null;break}if(n=l.sibling,n!==null){n.return=l.return,l=n;break}l=l.return}n=l}ht(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ro(t,a),o=$t(o),r=r(o),t.flags|=1,ht(e,t,r,a),t.child;case 14:return r=t.type,o=ra(r,t.pendingProps),o=ra(r.type,o),Mc(e,t,r,o,a);case 15:return hm(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ra(r,o),rs(e,t),t.tag=1,kt(r)?(e=!0,xs(t)):e=!1,Ro(t,a),pm(t,r,o),Tu(t,r,o,a),Mu(null,t,r,!0,e,a);case 19:return Sm(e,t,a);case 22:return xm(e,t,a)}throw Error(M(156,t.tag))};function zm(e,t){return dp(e,t)}function sv(e,t,a,r){this.tag=e,this.key=a,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 _t(e,t,a,r){return new sv(e,t,a,r)}function Td(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iv(e){if(typeof e=="function")return Td(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Gu)return 11;if(e===Ku)return 14}return 2}function nr(e,t){var a=e.alternate;return a===null?(a=_t(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function ls(e,t,a,r,o,n){var l=2;if(r=e,typeof e=="function")Td(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case mo:return Fr(a.children,o,n,t);case Vu:l=8,o|=8;break;case Yi:return e=_t(12,a,t,o|2),e.elementType=Yi,e.lanes=n,e;case Zi:return e=_t(13,a,t,o),e.elementType=Zi,e.lanes=n,e;case Ji:return e=_t(19,a,t,o),e.elementType=Ji,e.lanes=n,e;case Kc:return qs(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vc:l=10;break e;case Gc:l=9;break e;case Gu:l=11;break e;case Ku:l=14;break e;case Ga:l=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=_t(l,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Fr(e,t,a,r){return e=_t(7,e,r,t),e.lanes=a,e}function qs(e,t,a,r){return e=_t(22,e,r,t),e.elementType=Kc,e.lanes=a,e.stateNode={isHidden:!1},e}function ji(e,t,a){return e=_t(6,e,null,t),e.lanes=a,e}function Xi(e,t,a){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uv(e,t,a,r,o){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=Di(0),this.expirationTimes=Di(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Di(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Pd(e,t,a,r,o,n,l,s,i){return e=new uv(e,t,a,s,i),t===1?(t=1,n===!0&&(t|=8)):t=0,n=_t(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},fd(n),e}function dv(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:po,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function Nm(e){if(!e)return sr;e=e._reactInternals;e:{if(qr(e)!==e||e.tag!==1)throw Error(M(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(kt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(M(171))}if(e.tag===1){var a=e.type;if(kt(a))return Np(e,a,t)}return t}function Um(e,t,a,r,o,n,l,s,i){return e=Pd(a,r,!0,e,o,n,l,s,i),e.context=Nm(null),a=e.current,r=xt(),o=or(a),n=Ra(r,o),n.callback=t??null,ar(a,n,o),e.current.lanes=o,_n(e,o,r),bt(e,r),e}function _s(e,t,a,r){var o=t.current,n=xt(),l=or(o);return a=Nm(a),t.context===null?t.context=a:t.pendingContext=a,t=Ra(n,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ar(o,t,l),e!==null&&(sa(e,o,l,n),es(e,o,l)),l}function Ms(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 _c(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Rd(e,t){_c(e,t),(e=e.alternate)&&_c(e,t)}function fv(){return null}var Hm=typeof reportError=="function"?reportError:function(e){console.error(e)};function Md(e){this._internalRoot=e}Ws.prototype.render=Md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));_s(e,t,null,null)};Ws.prototype.unmount=Md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ur(function(){_s(null,e,null,null)}),t[Aa]=null}};function Ws(e){this._internalRoot=e}Ws.prototype.unstable_scheduleHydration=function(e){if(e){var t=xp();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ja.length&&t!==0&&t<ja[a].priority;a++);ja.splice(a,0,e),a===0&&yp(e)}};function Ad(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function $s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Wc(){}function cv(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var d=Ms(l);n.call(d)}}var l=Um(t,r,e,0,null,!1,!1,"",Wc);return e._reactRootContainer=l,e[Aa]=l.current,En(e.nodeType===8?e.parentNode:e),Ur(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var s=r;r=function(){var d=Ms(i);s.call(d)}}var i=Pd(e,0,!1,null,null,!1,!1,"",Wc);return e._reactRootContainer=i,e[Aa]=i.current,En(e.nodeType===8?e.parentNode:e),Ur(function(){_s(t,i,a,r)}),i}function Vs(e,t,a,r,o){var n=a._reactRootContainer;if(n){var l=n;if(typeof o=="function"){var s=o;o=function(){var i=Ms(l);s.call(i)}}_s(t,l,e,o)}else l=cv(a,t,e,o,r);return Ms(l)}gp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=mn(t.pendingLanes);a!==0&&(Qu(t,a|1),bt(t,Qe()),(Le&6)===0&&(zo=Qe()+500,dr()))}break;case 13:Ur(function(){var r=Da(e,1);if(r!==null){var o=xt();sa(r,e,1,o)}}),Rd(e,1)}};Yu=function(e){if(e.tag===13){var t=Da(e,134217728);if(t!==null){var a=xt();sa(t,e,134217728,a)}Rd(e,134217728)}};hp=function(e){if(e.tag===13){var t=or(e),a=Da(e,t);if(a!==null){var r=xt();sa(a,e,t,r)}Rd(e,t)}};xp=function(){return Re};vp=function(e,t){var a=Re;try{return Re=e,t()}finally{Re=a}};uu=function(e,t,a){switch(t){case"input":if(au(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+\'][type="radio"]\'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=Bs(r);if(!o)throw Error(M(90));Xc(r),au(r,o)}}}break;case"textarea":Yc(e,a);break;case"select":t=a.value,t!=null&&ko(e,!!a.multiple,t,!1)}};op=wd;np=Ur;var pv={usingClientEntryPoint:!1,Events:[$n,vo,Bs,ap,rp,wd]},dn={findFiberByHostInstance:Mr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},mv={bundleType:dn.bundleType,version:dn.version,rendererPackageName:dn.rendererPackageName,rendererConfig:dn.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ip(e),e===null?null:e.stateNode},findFiberByHostInstance:dn.findFiberByHostInstance||fv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(fn=__REACT_DEVTOOLS_GLOBAL_HOOK__,!fn.isDisabled&&fn.supportsFiber))try{As=fn.inject(mv),xa=fn}catch{}var fn;Bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pv;Bt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ad(t))throw Error(M(200));return dv(e,t,null,a)};Bt.createRoot=function(e,t){if(!Ad(e))throw Error(M(299));var a=!1,r="",o=Hm;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Pd(e,1,!1,null,null,a,!1,r,o),e[Aa]=t.current,En(e.nodeType===8?e.parentNode:e),new Md(t)};Bt.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(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=ip(t),e=e===null?null:e.stateNode,e};Bt.flushSync=function(e){return Ur(e)};Bt.hydrate=function(e,t,a){if(!$s(t))throw Error(M(200));return Vs(null,e,t,!0,a)};Bt.hydrateRoot=function(e,t,a){if(!Ad(e))throw Error(M(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",l=Hm;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(l=a.onRecoverableError)),t=Um(t,null,e,1,a??null,o,!1,n,l),e[Aa]=t.current,En(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new Ws(t)};Bt.render=function(e,t,a){if(!$s(t))throw Error(M(200));return Vs(null,e,t,!1,a)};Bt.unmountComponentAtNode=function(e){if(!$s(e))throw Error(M(40));return e._reactRootContainer?(Ur(function(){Vs(null,null,e,!1,function(){e._reactRootContainer=null,e[Aa]=null})}),!0):!1};Bt.unstable_batchedUpdates=wd;Bt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!$s(a))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return Vs(e,t,a,!1,r)};Bt.version="18.3.1-next-f1338f8080-20240426"});var _r=wa((by,Wm)=>{"use strict";function _m(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_m)}catch(e){console.error(e)}}_m(),Wm.exports=qm()});var Vm=wa(Dd=>{"use strict";var $m=_r();Dd.createRoot=$m.createRoot,Dd.hydrateRoot=$m.hydrateRoot;var Ty});var Ym=wa(Zs=>{"use strict";var vv=Oe(),yv=Symbol.for("react.element"),Lv=Symbol.for("react.fragment"),Sv=Object.prototype.hasOwnProperty,Iv=vv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Cv={key:!0,ref:!0,__self:!0,__source:!0};function Qm(e,t,a){var r,o={},n=null,l=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)Sv.call(t,r)&&!Cv.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:yv,type:e,key:n,ref:l,props:o,_owner:Iv.current}}Zs.Fragment=Lv;Zs.jsx=Qm;Zs.jsxs=Qm});var j=wa((SL,Zm)=>{"use strict";Zm.exports=Ym()});var Eg=F(Vm(),1);var ie=F(Oe(),1),Rg=F(_r(),1);function Gm(e){return e.trim().replace(/^\\|/,"").replace(/\\|$/,"").split("|").map(a=>a.trim())}function gv(e){return/^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(e)}function hv(e){let t=e.split(`\n`),a=[],r=0;for(;r<t.length;){let o=t[r]??"",n=t[r+1]??"";if(o.includes("|")&&gv(n)){let l=Gm(o),s=[];for(r+=2;r<t.length&&t[r].includes("|")&&t[r].trim()!=="";)s.push(Gm(t[r])),r+=1;let i=`<tr>${l.map(f=>`<th style="text-align:left;padding:7px 10px;border:1px solid #334155;color:#e2e8f0;background:#0f172a;">${f}</th>`).join("")}</tr>`,d=s.map(f=>`<tr>${f.map(m=>`<td style="padding:7px 10px;border:1px solid #334155;color:#cbd5e1;vertical-align:top;">${m}</td>`).join("")}</tr>`).join("");a.push(`<div style="overflow-x:auto;margin:0.65em 0;"><table style="border-collapse:collapse;min-width:360px;width:100%;font-size:12px;"><thead>${i}</thead><tbody>${d}</tbody></table></div>`);continue}a.push(t[r]),r+=1}return a.join(`\n`)}function Gs(e){if(!e)return\'<span style="color:#475569;font-style:italic;">No description yet</span>\';let t=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return hv(t).replace(/^### (.+)$/gm,\'<h3 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.05em;color:#cbd5e1;">$1</h3>\').replace(/^## (.+)$/gm,\'<h2 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.2em;color:#f1f5f9;">$1</h2>\').replace(/^# (.+)$/gm,\'<h1 style="font-weight:700;margin:0.8em 0 0.3em;font-size:1.4em;color:#f1f5f9;">$1</h1>\').replace(/[*][*]([^\\n]+?)[*][*]/g,\'<strong style="font-weight:700;color:#f1f5f9;">$1</strong>\').replace(/__([^\\n]+?)__/g,\'<strong style="font-weight:700;color:#f1f5f9;">$1</strong>\').replace(/[*]([^\\n*]+?)[*]/g,\'<em style="font-style:italic;color:#94a3b8;">$1</em>\').replace(/(?<![a-zA-Z0-9])_([^_\\n]+?)_(?![a-zA-Z0-9])/g,\'<em style="font-style:italic;color:#94a3b8;">$1</em>\').replace(/`(.+?)`/g,\'<code style="font-family:Menlo,monospace;font-size:12px;background:#1e293b;padding:1px 5px;border-radius:3px;color:#7dd3fc;">$1</code>\').replace(/\\[([^\\]]+)\\]\\((https?:\\/\\/[^)]+)\\)/g,\'<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#60a5fa;text-decoration:underline;">$1</a>\').replace(/(^|[\\s(>])((https?:\\/\\/)[^\\s<>"\']+)/g,\'$1<a href="$2" target="_blank" rel="noopener noreferrer" style="color:#60a5fa;text-decoration:underline;word-break:break-all;">$2</a>\').replace(/(^|[^\\w])#([a-f0-9]{30})(?![a-f0-9])/gi,\'$1<a href="#task-$2" data-task-ref="$2" style="color:#60a5fa;text-decoration:underline;font-family:Menlo,monospace;">#$2</a>\').replace(/^[-*] (.+)$/gm,\'<li style="margin:0.2em 0;display:list-item;">$1</li>\').replace(/^---$/gm,\'<hr style="border:none;border-top:1px solid #334155;margin:0.8em 0;">\').replace(/(<li[^>]*>[\\s\\S]*?<\\/li>\\n?)+/g,r=>`<ul style="padding-left:1.5em;margin:0.4em 0;list-style-type:disc;">${r}</ul>`).replace(/^(?!<[a-z]|$).+$/gm,r=>`<p style="margin:0.5em 0;">${r}</p>`)}var xv="proto-comments-seen";function Ed(e,t){try{let a=localStorage.getItem(xv),r=a?JSON.parse(a):{};return t>(r[e]??0)}catch{return!1}}function Fd(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Tt(e){try{return new Date(e).toLocaleString()}catch{return e}}var Bd=16,Ho=1000000n,Xs=BigInt("9".repeat(Bd));function Gt(e){return(e<0n?0n:e>Xs?Xs:e).toString().padStart(Bd,"0")}function Ks(e){let t=e.split(".")[0];return/^\\d+$/.test(t)?BigInt(t):Xs}function js(e){let t=e.indexOf(".");return t>=0?e.slice(t+1):null}function Ba(e,t){if(t===null){if(e===null)return Gt(Ho);let l=Ks(e);if(l<Xs-Ho)return Gt(l+Ho);let s=js(e)??"0".repeat(Bd);return Gt(l)+"."+Ba(s,null)}if(e===null){let l=Ks(t),s=js(t);return l>Ho?Gt(l-Ho):s!==null?Gt(l)+"."+Ba(null,s):l>0n?Gt(l/2n):Gt(0n)+".0"}let a=Ks(e),r=Ks(t),o=js(e),n=js(t);return r>a+1n?Gt((a+r)/2n):r===a+1n?Gt(a)+"."+Ba(o,null):o===null&&n===null?Gt(a)+"."+Gt(Ho):Gt(a)+"."+Ba(o,n)}function Wr(e,t){return e.sortKey&&t.sortKey?e.sortKey<t.sortKey?-1:e.sortKey>t.sortKey?1:0:e.sortKey?-1:t.sortKey?1:(e.updatedAt??e.createdAt??"").localeCompare(t.updatedAt??t.createdAt??"")}function Od(e,t,a,r){let o=new Map,n=null;for(let m of e)m.sortKey&&m.sortKey!=="n"&&(o.set(m.id,m.sortKey),n=m.sortKey);let l=[],s=e.filter(m=>!m.sortKey||m.sortKey==="n");if(s.length>0){let m=n;for(let g of s){let L=Ba(m,null);o.set(g.id,L),m=L,g.id!==t&&l.push({id:g.id,sortKey:L})}}let i=a?o.get(a)??null:null,d=r?o.get(r)??null:null;return{newSortKey:Ba(i,d),normalizationPatches:l}}var jt=F(Oe(),1);var Ys=F(Oe());var Km=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Qs=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var Gn=F(Oe());var jm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var Xm=(0,Gn.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:l,...s},i)=>(0,Gn.createElement)("svg",{ref:i,...jm,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Qs("lucide",o),...s},[...l.map(([d,f])=>(0,Gn.createElement)(d,f)),...Array.isArray(n)?n:[n]]));var Q=(e,t)=>{let a=(0,Ys.forwardRef)(({className:r,...o},n)=>(0,Ys.createElement)(Xm,{ref:n,iconNode:t,className:Qs(`lucide-${Km(e)}`,r),...o}));return a.displayName=`${e}`,a};var Kt=Q("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var ya=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var Kn=Q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var fr=Q("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var cr=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);var $r=Q("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);var jn=Q("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var qo=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);var Xn=Q("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);var Qn=Q("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var Yn=Q("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);var Zn=Q("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var Jn=Q("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var el=Q("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var Vr=Q("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var pr=Q("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);var Gr=Q("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);var Kr=Q("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);var tl=Q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var jr=Q("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var Xr=Q("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var al=Q("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var Qr=Q("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var _o=Q("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var rl=Q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var mr=Q("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var Wo=Q("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var ol=Q("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var Xe=Q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Oa=F(Oe(),1),dg=F(_r(),1);var tg=F(j(),1),Jm={Bug:{background:"rgba(239,68,68,0.12)",color:"#f87171",border:"rgba(239,68,68,0.25)"},Research:{background:"rgba(192,132,252,0.12)",color:"#c084fc",border:"rgba(139,92,246,0.2)"},Task:{background:"rgba(148,163,184,0.1)",color:"#94a3b8",border:"rgba(148,163,184,0.2)"}};function eg({type:e,style:t}){let a=typeof e=="string"&&e.trim()&&e!=="[object Object]"&&Jm[e]?e:"Task",r=Jm[a];return(0,tg.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:r.background,color:r.color,border:`1px solid ${r.border}`,lineHeight:"1.5",...t},children:a})}var og=F(j(),1),ag={Critical:{background:"rgba(239,68,68,0.15)",color:"#f87171",border:"rgba(239,68,68,0.3)"},High:{background:"rgba(249,115,22,0.12)",color:"#fb923c",border:"rgba(249,115,22,0.25)"},Medium:{background:"rgba(234,179,8,0.12)",color:"#facc15",border:"rgba(234,179,8,0.25)"},Low:{background:"rgba(148,163,184,0.1)",color:"#94a3b8",border:"rgba(148,163,184,0.2)"}};function rg({priority:e,style:t}){if(!e||!ag[e])return null;let a=ag[e];return(0,og.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:a.background,color:a.color,border:`1px solid ${a.border}`,lineHeight:"1.5",...t},children:e})}var Yr=[{value:"Task",icon:"\\u2611",label:"Task",css:"type-task",tooltip:"A general task or feature to implement."},{value:"Bug",icon:"\\u{1F41E}",label:"Bug",css:"type-bug",tooltip:"A defect \\u2014 annotator collects page errors and console logs to help reproduce it."},{value:"Research",icon:"\\u{1F52C}",label:"Research",css:"type-research",tooltip:"A research task \\u2014 agent will NOT write code but must attach a findings report."}],wL=Yr.map(e=>e.value),lg=Object.fromEntries(Yr.map(e=>[e.value,e.icon])),kL=Object.fromEntries(Yr.map(e=>[e.value,e.css])),ng={Task:"#94a3b8",Bug:"#ef4444",Research:"#a855f7"};function nl(e){return ng[e??"Task"]??ng.Task}var sg=[{bg:"color-mix(in srgb, var(--p-blue) 14%, transparent)",text:"var(--p-blue-200)",border:"color-mix(in srgb, var(--p-blue) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-green) 14%, transparent)",text:"var(--p-green-300)",border:"color-mix(in srgb, var(--p-green) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-purple) 14%, transparent)",text:"var(--p-purple-300)",border:"color-mix(in srgb, var(--p-purple) 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-amber) 14%, transparent)",text:"var(--p-amber-300)",border:"color-mix(in srgb, var(--p-amber) 30%, transparent)"},{bg:"color-mix(in srgb, #f472b6 14%, transparent)",text:"#f9a8d4",border:"color-mix(in srgb, #f472b6 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-cyan) 14%, transparent)",text:"var(--p-cyan-300)",border:"color-mix(in srgb, var(--p-cyan) 30%, transparent)"},{bg:"color-mix(in srgb, #f87171 14%, transparent)",text:"#fca5a5",border:"color-mix(in srgb, #f87171 30%, transparent)"},{bg:"color-mix(in srgb, var(--p-text-g) 14%, transparent)",text:"var(--p-text-m)",border:"color-mix(in srgb, var(--p-text-g) 30%, transparent)"}];function wv(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)>>>0;return t%sg.length}function ua(e){return sg[wv(e)]}var ll=F(j(),1);function sl({tags:e,onRemove:t,size:a="sm"}){if(!e.length)return null;let r=a==="xs"?"1px 6px":"2px 7px",o=a==="xs"?9:10;return(0,ll.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3,alignItems:"center"},children:e.map(n=>{let{bg:l,text:s,border:i}=ua(n);return(0,ll.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding:r,borderRadius:100,background:l,border:`1px solid ${i}`,color:s,fontSize:o,fontWeight:600,whiteSpace:"nowrap"},children:[n,t&&(0,ll.jsx)("button",{type:"button",onClick:d=>{d.stopPropagation(),t(n)},style:{display:"flex",background:"none",border:"none",color:s,cursor:"pointer",padding:0,lineHeight:1,opacity:.7},onMouseEnter:d=>{d.currentTarget.style.opacity="1"},onMouseLeave:d=>{d.currentTarget.style.opacity="0.7"},children:"\\xD7"})]},n)})})}var de=F(j(),1);function kv(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function fg(e,t){if(!/^#[0-9a-fA-F]{6}$/.test(e))return;let a=Math.max(0,Math.min(1,t)),r=Math.round(a*255).toString(16).padStart(2,"0");return`${e}${r}`}function cg(e,t){return fg(e,t==="Critical"?.36:t==="High"?.3:.24)??"color-mix(in srgb, var(--p-text-g) 40%, transparent)"}function bv(e){return fg(e,.05)??"transparent"}var Tv={padding:"7px 8px",gap:4,opacity:.45,userSelect:"none"},Pv={display:"flex",alignItems:"center",gap:5},Rv={width:12,height:12,color:"color-mix(in srgb, var(--p-green) 55%, transparent)",flexShrink:0},Mv={fontSize:11.5,fontWeight:600,color:"var(--p-text-g)",textDecoration:"line-through",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},Av={display:"flex",alignItems:"center",gap:5,minWidth:0},ig={flexShrink:0},Dv={fontSize:11.5,fontWeight:600,color:"var(--p-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},Ev={display:"flex",alignItems:"flex-start",gap:8},Fv={fontSize:10,color:"var(--p-text-g)",lineHeight:"1.45",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,flex:1,minWidth:0},Bv={position:"relative",flexShrink:0},Ov={width:52,height:34,borderRadius:6,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 90%, transparent)",display:"block",cursor:"pointer"},zv={display:"flex",alignItems:"center",gap:2,marginTop:1},Nv={flex:1},zd=Oa.default.memo(function({task:t,col:a,liveActivity:r,onOpen:o,onDragStart:n,selectMode:l,selected:s,onToggleSelect:i,agentStatus:d,experimentalAgents:f,multiDragCount:m,onEnterSelectMode:g}){var We;let L=a.id==="in-progress",x=a.id==="done",[I,H]=Oa.default.useState(!1),[p,u]=Oa.default.useState(null),c=Oa.default.useRef(null),v=Oa.default.useRef(null),w=Oa.default.useRef(!1),C=Oa.default.useRef(null),y=750,k=5,z=t.commentCount??0,N=t.fileCount??0,U=z>0&&Ed(t.id,z),_=cg(a.color,t.priority),re=nl(t.type),ce=bv(re),Se=(We=t.files)==null?void 0:We.find(oe=>kv(oe.name)),J=Se?`/api/tasks/${t.id}/files/${encodeURIComponent(Se.name)}`:null;function be(oe){n(oe,t.id),oe.currentTarget.classList.add("dragging")}function Te(oe){oe.currentTarget.classList.remove("dragging")}function ve(oe){l||(w.current=!1,C.current={x:oe.clientX,y:oe.clientY},v.current=setTimeout(()=>{w.current=!0,g==null||g(t.id)},y))}function W(oe){if(!v.current||!C.current)return;let Pe=oe.clientX-C.current.x,Je=oe.clientY-C.current.y;Math.sqrt(Pe*Pe+Je*Je)>k&&(clearTimeout(v.current),v.current=null,C.current=null)}function D(){v.current&&(clearTimeout(v.current),v.current=null)}function b(){v.current&&(clearTimeout(v.current),v.current=null)}function B(oe){if(w.current){w.current=!1;return}if(l){oe.stopPropagation(),i==null||i(t.id);return}o(t)}function te(oe){oe.stopPropagation(),i==null||i(t.id)}let Ie=f===!0&&d==="running"?"1px solid rgba(59,130,246,0.5)":f===!0&&d==="queued"?"1px solid color-mix(in srgb, var(--p-amber) 45%, transparent)":f===!0&&d==="done"?"1px solid color-mix(in srgb, var(--p-green) 40%, transparent)":void 0,Be=f===!0&&d==="running"?"color-mix(in srgb, var(--p-blue) 6%, var(--p-card))":f===!0&&d==="queued"?"color-mix(in srgb, var(--p-amber) 5%, var(--p-card))":f===!0&&d==="done"?"color-mix(in srgb, var(--p-green) 5%, var(--p-card))":void 0;return x?(0,de.jsx)("article",{className:"task-card",draggable:!0,"data-task-id":t.id,style:{...Tv,...l&&s?{borderColor:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 10%, var(--p-card))"}:{}},onDragStart:be,onDragEnd:Te,onMouseDown:ve,onMouseMove:W,onMouseUp:D,onMouseLeave:b,onClick:B,children:(0,de.jsxs)("div",{style:Pv,children:[l&&(0,de.jsx)("span",{onClick:te,style:{width:12,height:12,borderRadius:3,border:s?"1px solid var(--p-blue)":"1px solid var(--p-border-s)",background:s?"var(--p-blue)":"var(--p-input)",flexShrink:0,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:s&&(0,de.jsx)("span",{style:{color:"#fff",fontSize:9,fontWeight:700},children:"\\u2713"})}),(0,de.jsx)(fr,{style:Rv}),(0,de.jsx)("span",{style:Mv,children:t.title}),m!=null&&(0,de.jsxs)("span",{style:{fontSize:9,fontWeight:700,padding:"1px 5px",borderRadius:4,background:"var(--p-blue)",color:"#fff",flexShrink:0,marginLeft:4},children:["+",m-1]})]})}):(0,de.jsxs)("article",{className:`task-card${r?" task-live-edit":""}`,draggable:!0,"data-task-id":t.id,style:{padding:"7px 8px",gap:4,userSelect:"none",background:r?"rgba(59,130,246,0.08)":Be??ce,border:Ie??(r?"1px solid rgba(59,130,246,0.5)":_?`1px solid ${_}`:void 0),...r?{boxShadow:"0 0 0 2px rgba(59,130,246,0.14)"}:{},...l&&s?{borderColor:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 10%, var(--p-card))"}:{}},onDragStart:be,onDragEnd:Te,onMouseDown:ve,onMouseMove:W,onMouseUp:D,onMouseLeave:b,onClick:B,children:[(0,de.jsxs)("div",{style:Av,children:[l&&(0,de.jsx)("span",{onClick:te,style:{width:14,height:14,borderRadius:3,border:s?"1px solid var(--p-blue)":"1px solid var(--p-border-s)",background:s?"var(--p-blue)":"var(--p-input)",flexShrink:0,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",marginRight:2},children:s&&(0,de.jsx)("span",{style:{color:"#fff",fontSize:9,fontWeight:700},children:"\\u2713"})}),L&&(0,de.jsx)("span",{className:"spinner",style:ig}),f===!0&&d==="running"&&!L&&(0,de.jsx)("span",{className:"spinner",style:ig}),(0,de.jsx)("span",{style:Dv,children:t.title}),m!=null&&(0,de.jsxs)("span",{style:{fontSize:9,fontWeight:700,padding:"1px 5px",borderRadius:4,background:"var(--p-blue)",color:"#fff",flexShrink:0,marginLeft:4},children:["+",m-1]})]}),(t.description||J)&&(0,de.jsxs)("div",{style:Ev,children:[t.description&&(0,de.jsx)("div",{style:Fv,children:t.description}),J&&(0,de.jsxs)("div",{style:Bv,onMouseEnter:()=>{if(c.current){let oe=c.current.getBoundingClientRect();u({top:oe.top,right:oe.right})}H(!0)},onMouseLeave:()=>{H(!1),u(null)},children:[(0,de.jsx)("img",{ref:c,src:J,alt:"Task screenshot","data-role":"task-thumb",style:Ov}),I&&p&&dg.default.createPortal((0,de.jsx)("img",{src:J,alt:"Task screenshot enlarged preview","data-role":"task-thumb-preview",style:{position:"fixed",right:window.innerWidth-p.right,bottom:window.innerHeight-p.top+8,width:220,height:138,borderRadius:8,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 96%, transparent)",boxShadow:"0 10px 24px color-mix(in srgb, var(--p-bg) 75%, transparent)",pointerEvents:"none",zIndex:9999,background:"var(--p-bg)"}}),document.body)]})]}),(0,de.jsxs)("div",{className:"flex items-center",style:zv,children:[(0,de.jsx)(eg,{type:t.type}),t.priority&&(0,de.jsx)(rg,{priority:t.priority}),f===!0&&d==="running"&&(0,de.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(59,130,246,0.12)",color:"#60a5fa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:[(0,de.jsx)("span",{className:"spinner",style:{width:8,height:8,borderWidth:1.5}}),"Agent"]}),f===!0&&d==="queued"&&(0,de.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(245,158,11,0.12)",color:"var(--p-amber)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:"\\u23F3 Queued"}),f===!0&&d==="done"&&(0,de.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(34,197,94,0.12)",color:"var(--p-green)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:90},children:"\\u2713 Done"}),L&&t.assigneeName&&(0,de.jsx)("span",{style:{fontSize:10,fontWeight:600,padding:"1px 6px",borderRadius:6,background:"rgba(59,130,246,0.12)",color:"#60a5fa",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:80},children:t.assigneeName}),t.tags&&t.tags.length>0&&(0,de.jsx)(sl,{tags:t.tags,size:"xs"}),(0,de.jsx)("div",{style:Nv}),r&&(0,de.jsx)(Nd,{activity:r}),(0,de.jsx)(ug,{icon:(0,de.jsx)(Vr,{style:{width:9,height:9}}),label:z>0?String(z):"",color:U?"var(--p-purple)":z>0?"var(--p-text-m)":"var(--p-border-t)",hoverColor:U?"var(--p-purple-300)":"var(--p-text)",title:z>0?`${z} comment(s)`:"Add comment",badge:U,badgeColor:"var(--p-purple)",onClick:oe=>{oe.stopPropagation(),o(t,"comments")}}),(0,de.jsx)(ug,{icon:(0,de.jsx)(Gr,{style:{width:9,height:9}}),label:N>0?String(N):"",color:N>0?"var(--p-blue-300)":"var(--p-border-t)",hoverColor:N>0?"var(--p-cyan-300)":"var(--p-text-sub)",title:N>0?`${N} file(s) attached`:"Files",onClick:oe=>{oe.stopPropagation(),o(t,"files")}})]})]})});function ug({icon:e,label:t,color:a,hoverColor:r,title:o,badge:n,badgeColor:l,onClick:s}){let[i,d]=Oa.default.useState(!1);return(0,de.jsxs)("button",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 3px",borderRadius:3,border:"none",background:i?"color-mix(in srgb, var(--p-text-m) 10%, transparent)":"transparent",cursor:"pointer",fontSize:9,color:i?r:a,transition:"color .1s, background .1s"},title:o,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:s,children:[e,t&&(0,de.jsx)("span",{children:t}),n&&(0,de.jsx)("span",{style:{width:4,height:4,background:l??a,borderRadius:"50%",flexShrink:0}})]})}function Nd({activity:e}){let t=e.state==="locked"||e.state==="editing",a=t?(0,de.jsx)(el,{style:{width:8,height:8}}):(0,de.jsx)(jn,{style:{width:8,height:8}}),r=t?`Locked by ${e.user}`:`${e.user} viewing`;return(0,de.jsxs)("span",{style:t?{display:"inline-flex",alignItems:"center",gap:3,borderRadius:999,padding:"1px 5px",fontSize:9,fontWeight:600,border:"1px solid rgba(244,114,182,0.35)",color:"#f9a8d4",background:"rgba(157,23,77,0.28)",flexShrink:0,maxWidth:110,overflow:"hidden",whiteSpace:"nowrap",flexWrap:"nowrap"}:{display:"inline-flex",alignItems:"center",gap:3,borderRadius:999,padding:"1px 5px",fontSize:9,fontWeight:600,border:"1px solid rgba(59,130,246,0.35)",color:"#93c5fd",background:"rgba(30,58,138,0.28)",flexShrink:0,maxWidth:110,overflow:"hidden",whiteSpace:"nowrap",flexWrap:"nowrap"},title:r,"data-testid":"live-activity-badge",children:[a,(0,de.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:"1 1 0"},children:e.user})]})}var pe=F(j(),1),gr=[{id:"backlog",label:"Backlog",color:"var(--p-text-f)",accent:"color-mix(in srgb, var(--p-text-g) 20%, transparent)"},{id:"todo",label:"Todo",color:"var(--p-amber)",accent:"color-mix(in srgb, var(--p-amber) 12%, transparent)"},{id:"in-progress",label:"In Progress",color:"var(--p-blue)",accent:"color-mix(in srgb, var(--p-blue) 12%, transparent)",glow:!0},{id:"review",label:"Review",color:"var(--p-purple)",accent:"color-mix(in srgb, var(--p-purple) 12%, transparent)"},{id:"done",label:"Done",color:"var(--p-green)",accent:"color-mix(in srgb, var(--p-green) 10%, transparent)"}];var Uv=3;function Hv(){return(0,pe.jsxs)("div",{style:{borderRadius:8,border:"1px solid var(--p-border-t)",padding:"10px 12px",background:"var(--p-bg-2)",marginBottom:6,animation:"skeleton-pulse 1.5s ease-in-out infinite"},children:[(0,pe.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"75%",marginBottom:8}}),(0,pe.jsx)("div",{style:{height:10,borderRadius:4,background:"var(--p-border-s)",width:"50%",marginBottom:8}}),(0,pe.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,pe.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:48}}),(0,pe.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})]})}function Ud({tasks:e,visibleCols:t,searchQuery:a,isLoading:r,liveActivities:o,onOpenPanel:n,onDrop:l,onReorder:s,selectMode:i,selectedTaskIds:d,onToggleSelect:f,onEnterSelectMode:m,agentStatuses:g,onRunSelectedAgents:L,onExitSelectMode:x,experimentalAgents:I}){let H=jt.default.useRef(null),p=jt.default.useRef(null),[u,c]=jt.default.useState(null),[v,w]=jt.default.useState(null),[C,y]=jt.default.useState(null),k=jt.default.useRef(null),z=jt.default.useRef(null),[N,U]=jt.default.useState([]),_=jt.default.useRef([]),re=a?e.filter(D=>(D.title??"").toLowerCase().includes(a.toLowerCase())||(D.description??"").toLowerCase().includes(a.toLowerCase())):e,ce=gr.filter(D=>t.includes(D.id));jt.default.useEffect(()=>{let D=H.current,b=p.current;if(!D||!b)return;function B(){if(!D||!b)return;let Me=D.scrollWidth>D.clientWidth?D.clientWidth/D.scrollWidth:1,Ce=Math.max(40,D.clientWidth*Me);b.style.width=`${Ce}px`;let Ke=D.scrollWidth-D.clientWidth,ye=D.clientWidth-Ce;b.style.left=`${Ke>0?D.scrollLeft/Ke*ye:0}px`,b.style.opacity=Me<1?"1":"0"}D.addEventListener("scroll",B);let te=new ResizeObserver(B);te.observe(D),B();let Ie=!1,Be=0,We=0;function oe(Me){Ie=!0,Be=Me.clientX,We=D.scrollLeft,b.classList.add("dragging"),document.addEventListener("mousemove",Pe),document.addEventListener("mouseup",Je)}function Pe(Me){if(!Ie||!D||!b)return;let Ce=D.scrollWidth>D.clientWidth?D.scrollWidth/D.clientWidth:1;D.scrollLeft=We+(Me.clientX-Be)*Ce}function Je(){Ie=!1,b==null||b.classList.remove("dragging"),document.removeEventListener("mousemove",Pe),document.removeEventListener("mouseup",Je)}return b.addEventListener("mousedown",oe),()=>{D.removeEventListener("scroll",B),te.disconnect(),b.removeEventListener("mousedown",oe)}},[ce.length]);function Se(D,b){k.current=b,c(b),D.dataTransfer.effectAllowed="move",i&&(x==null||x()),_.current=[],U([])}function J(D,b){D.preventDefault(),w(b)}function be(D,b){D.preventDefault(),D.stopPropagation();let B=D.currentTarget.getBoundingClientRect(),te=D.clientY<B.top+B.height/2?"before":"after",Ie={taskId:b,position:te};z.current=Ie,y(Be=>(Be==null?void 0:Be.taskId)===b&&Be.position===te?Be:Ie)}function Te(D,b,B){D.preventDefault(),w(null);let te=z.current;z.current=null,y(null);let Ie=k.current;k.current=null,c(null);let Be=_.current;if(_.current=[],U([]),!!Ie){if(Be.length>1&&s){let We=Be.map(ye=>e.find(De=>De.id===ye)).filter(Boolean).sort(Wr).map(ye=>ye.id),Pe=e.filter(ye=>ye.status===b).sort(Wr).filter(ye=>!Be.includes(ye.id)),Je;if(te){let ye=Pe.findIndex(De=>De.id===te.taskId);Je=te.position==="before"?ye:ye+1}else Je=Pe.length;let Me=We.map(ye=>e.find(De=>De.id===ye)),Ce=[...Pe.slice(0,Je),...Me,...Pe.slice(Je)],Ke=new Map;for(let ye of Ce)Ke.set(ye.id,ye.sortKey??null);for(let ye=0;ye<Ce.length;ye++){let De=Ce[ye];if(!Be.includes(De.id))continue;let at=ye>0?Ce[ye-1].id:null,Ot=ye<Ce.length-1?Ce[ye+1].id:null,zt=at?Ke.get(at)??null:null,Yt=Ot?Ke.get(Ot)??null:null,Pt=Ba(zt,Yt);Ke.set(De.id,Pt),s(De.id,b,at,Ot,Pt)}return}if(s&&te){let We=B.findIndex(Je=>Je.id===te.taskId),oe=null,Pe=null;te.position==="before"?(Pe=te.taskId,oe=We>0?B[We-1].id:null):(oe=te.taskId,Pe=We<B.length-1?B[We+1].id:null),s(Ie,b,oe,Pe)}else l(Ie,b)}}function ve(){k.current=null,c(null),w(null),z.current=null,y(null),_.current=[],U([])}let W=(d==null?void 0:d.size)??0;return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("main",{id:"kanban-board",ref:H,className:"flex-1 flex overflow-x-auto overflow-y-hidden",style:{padding:"16px 20px",gap:16},onDragEnd:ve,children:ce.map(D=>{let b=r?[]:re.filter(te=>te.status===D.id).sort(Wr),B=D.id==="done"?[...b].reverse():b;return(0,pe.jsx)(qv,{col:D,tasks:B,isLoading:r,liveActivities:o,isDragOver:v===D.id&&!C,onDragOver:te=>J(te,D.id),onDrop:te=>Te(te,D.id,b),onDragLeave:te=>{let Ie=te.relatedTarget;Ie&&te.currentTarget.contains(Ie)||(w(null),z.current=null,y(null))},onStatusChange:(te,Ie)=>l(te,Ie),onAddTask:()=>n(null,"details",D.id),onOpenTask:n,onDragStart:Se,onCardDragOver:be,cardDropTarget:C,selectMode:i,selectedTaskIds:d,onToggleSelect:f,onEnterSelectMode:m,agentStatuses:I===!0?g:void 0,experimentalAgents:I,multiDragIds:N},D.id)})}),I===!0&&i&&W>0&&(0,pe.jsxs)("div",{style:{position:"fixed",bottom:14,left:"50%",transform:"translateX(-50%)",zIndex:45,display:"flex",alignItems:"center",gap:10,background:"var(--p-surface)",border:"1px solid var(--p-border-s)",borderRadius:10,padding:"8px 14px",boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"},children:[(0,pe.jsxs)("span",{style:{fontSize:12,color:"var(--p-text-m)",fontWeight:500},children:[(0,pe.jsx)("strong",{style:{color:"var(--p-text)"},children:W})," task",W!==1?"s":""," selected"]}),(0,pe.jsx)("div",{style:{width:1,height:16,background:"var(--p-border)"}}),(0,pe.jsxs)("button",{onClick:()=>L==null?void 0:L(Array.from(d)),style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 12px",borderRadius:6,border:"1px solid var(--p-purple)",background:"var(--p-purple)",color:"#fff",fontSize:11,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:D=>{D.currentTarget.style.background="#9333ea"},onMouseLeave:D=>{D.currentTarget.style.background="var(--p-purple)"},children:[(0,pe.jsx)(Kr,{style:{width:10,height:10}}),"Run Agents (",W,")"]}),(0,pe.jsxs)("button",{onClick:x,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 10px",borderRadius:6,border:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-m)",fontSize:11,cursor:"pointer",transition:"all .12s"},onMouseEnter:D=>{D.currentTarget.style.borderColor="var(--p-border-s)",D.currentTarget.style.color="var(--p-text)"},onMouseLeave:D=>{D.currentTarget.style.borderColor="var(--p-border)",D.currentTarget.style.color="var(--p-text-m)"},children:[(0,pe.jsx)(Xe,{style:{width:10,height:10}}),"Clear"]})]}),(0,pe.jsx)("div",{id:"kanban-scroll-track",style:{position:"fixed",bottom:0,left:0,right:0,height:6,background:"transparent",zIndex:40,pointerEvents:"none"},children:(0,pe.jsx)("div",{id:"kanban-scroll-thumb",ref:p,style:{position:"absolute",top:1,height:4,borderRadius:2,background:"var(--p-border-t)",cursor:"pointer",pointerEvents:"auto",transition:"background 0.15s",opacity:0},onMouseEnter:D=>{D.currentTarget.style.background="var(--p-text-g)"},onMouseLeave:D=>{D.currentTarget.classList.contains("dragging")||(D.currentTarget.style.background="var(--p-border-t)")}})})]})}function qv({col:e,tasks:t,isLoading:a,liveActivities:r,isDragOver:o,onDragOver:n,onDrop:l,onDragLeave:s,onStatusChange:i,onAddTask:d,onOpenTask:f,onDragStart:m,onCardDragOver:g,cardDropTarget:L,selectMode:x,selectedTaskIds:I,onToggleSelect:H,onEnterSelectMode:p,agentStatuses:u,experimentalAgents:c,multiDragIds:v}){let[w,C]=jt.default.useState(!1),y=e.id==="in-progress"?"sd-inprogress":`sd-${e.id}`,k=20,z=e.id==="done",N=z&&t.length>k?t.length-k:0,U=z?t.slice(0,k):t;return(0,pe.jsxs)("section",{className:"board-column","data-column-id":e.id,style:{outline:o?`2px dashed ${e.color}66`:void 0,outlineOffset:-2,borderRadius:8},onDragOver:n,onDragLeave:s,onDrop:l,children:[(0,pe.jsxs)("div",{className:"column-header",style:{background:e.accent,borderColor:`color-mix(in srgb, ${e.color} 30%, transparent)`},children:[(0,pe.jsx)("div",{className:`status-dot ${y}`}),(0,pe.jsxs)("span",{style:{fontSize:12,fontWeight:600,color:e.id==="done"?`${e.color}b3`:e.color},children:[e.label,a?"":` \\xB7 ${t.length}`]}),(0,pe.jsx)("span",{style:{marginLeft:"auto"}}),(0,pe.jsx)("button",{type:"button",title:`Add task to ${e.label}`,style:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:"none",background:"transparent",color:w?e.color:"var(--p-text-g)",cursor:"pointer",transition:"color .15s",padding:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),onClick:d,children:(0,pe.jsx)(tl,{style:{width:14,height:14}})})]}),(0,pe.jsx)("div",{className:"column-scroll","data-status":e.id,children:a?Array.from({length:Uv}).map((_,re)=>(0,pe.jsx)(Hv,{},re)):t.length===0?(0,pe.jsxs)("div",{style:{border:"1px dashed var(--p-border-t)",borderRadius:8,padding:"10px 8px",fontSize:11,color:"var(--p-text-f)",textAlign:"center"},children:["No tasks in ",e.label.toLowerCase(),"."]}):(0,pe.jsxs)(pe.Fragment,{children:[U.map(_=>(0,pe.jsxs)("div",{style:{position:"relative"},onDragOver:re=>g(re,_.id),children:[(L==null?void 0:L.taskId)===_.id&&L.position==="before"&&(0,pe.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}}),(0,pe.jsx)(zd,{task:_,col:e,liveActivity:r==null?void 0:r.get(_.id),onOpen:f,onDragStart:m,selectMode:x,selected:I==null?void 0:I.has(_.id),onToggleSelect:H,onEnterSelectMode:p,agentStatus:u==null?void 0:u.get(_.id),experimentalAgents:c,multiDragCount:v&&v.length>1&&v[0]===_.id?v.length:void 0}),(L==null?void 0:L.taskId)===_.id&&L.position==="after"&&(0,pe.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}})]},_.id)),N>0&&(0,pe.jsxs)("div",{style:{margin:"4px 0 2px",padding:"6px 8px",borderRadius:6,border:"1px dashed var(--p-border-t)",fontSize:11,color:"var(--p-text-g)",textAlign:"center",lineHeight:1.4},children:["+",N," older ",N===1?"task":"tasks"," not shown"]})]})})]})}var Zr=F(Oe(),1);var ge=F(j(),1),pg={backlog:{text:"var(--p-text-m)",bg:"color-mix(in srgb, var(--p-text-g) 14%, transparent)",border:"color-mix(in srgb, var(--p-text-g) 30%, transparent)"},todo:{text:"var(--p-amber-300)",bg:"color-mix(in srgb, var(--p-amber) 14%, transparent)",border:"color-mix(in srgb, var(--p-amber) 30%, transparent)"},"in-progress":{text:"var(--p-blue-200)",bg:"color-mix(in srgb, var(--p-blue) 14%, transparent)",border:"color-mix(in srgb, var(--p-blue) 30%, transparent)"},review:{text:"var(--p-purple-300)",bg:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"color-mix(in srgb, var(--p-purple) 30%, transparent)"},done:{text:"var(--p-green-300)",bg:"color-mix(in srgb, var(--p-green) 12%, transparent)",border:"color-mix(in srgb, var(--p-green) 30%, transparent)"}},_v=lg,mg={Critical:"var(--p-red)",High:"var(--p-amber-300)",Medium:"var(--p-text-m)",Low:"var(--p-text-f)"},Hd=["in-progress","review","todo","backlog","done"];function Wv(){return(0,ge.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"18px 1fr auto auto",alignItems:"center",gap:10,padding:"6px 10px",borderRadius:8,border:"1px solid var(--p-border-t)",background:"var(--p-bg-2)",animation:"skeleton-pulse 1.5s ease-in-out infinite"},children:[(0,ge.jsx)("div",{style:{width:14,height:14,borderRadius:3,background:"var(--p-border-s)"}}),(0,ge.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"60%"}}),(0,ge.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:44}}),(0,ge.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})}function qd({tasks:e,searchQuery:t,isLoading:a,liveActivities:r,onOpenPanel:o,onAddTask:n,onDrop:l,experimentalAgents:s}){let[i,d]=Zr.default.useState(null),[f,m]=Zr.default.useState(null),[g,L]=Zr.default.useState(null),[x,I]=Zr.default.useState({backlog:!1,todo:!1,"in-progress":!1,review:!1,done:!1}),H=t?e.filter(u=>(u.title??"").toLowerCase().includes(t.toLowerCase())||(u.description??"").toLowerCase().includes(t.toLowerCase())):e,p=Zr.default.useMemo(()=>{let u=new Map;for(let c of Hd)u.set(c,[]);for(let c of H)(u.get(c.status)??[]).push(c);return u},[H]);return(0,ge.jsxs)("div",{id:"kanban-list-view",style:{flex:1,overflowY:"auto",padding:"16px 24px",minHeight:0},children:[a?Hd.slice(0,3).map(u=>{let c=pg[u];return(0,ge.jsxs)("div",{style:{marginBottom:24},children:[(0,ge.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,ge.jsx)("div",{style:{width:18,height:18,borderRadius:5,background:"var(--p-border-s)",animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,ge.jsx)("div",{style:{height:18,borderRadius:6,background:c.bg,border:`1px solid ${c.border}`,width:72,animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,ge.jsx)("div",{style:{height:14,borderRadius:4,background:"var(--p-border-s)",width:16,animation:"skeleton-pulse 1.5s ease-in-out infinite"}})]}),(0,ge.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:Array.from({length:3}).map((v,w)=>(0,ge.jsx)(Wv,{},w))})]},u)}):Hd.map(u=>{let c=p.get(u)??[];if(c.length===0)return null;let v=pg[u];return(0,ge.jsxs)("div",{style:{marginBottom:24},children:[(0,ge.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8,padding:"4px 6px",borderRadius:6,transition:"background .1s",background:f===u?v.bg:"transparent",outline:f===u?`1px dashed ${v.border}`:void 0},onDragOver:w=>{w.preventDefault(),m(u)},onDragLeave:()=>m(null),onDrop:w=>{w.preventDefault(),m(null),L(null),i&&l(i,u),d(null)},children:[(0,ge.jsx)("button",{type:"button",title:x[u]?"Expand":"Collapse",onClick:w=>{w.stopPropagation(),I(C=>({...C,[u]:!C[u]}))},style:{width:18,height:18,borderRadius:5,border:"1px solid var(--p-border-t)",background:"var(--p-surface)",color:"var(--p-text-m)",fontSize:10,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:x[u]?"+":"\\u2212"}),(0,ge.jsx)("span",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"2px 8px",borderRadius:6,background:v.bg,border:`1px solid ${v.border}`,color:v.text},children:u}),(0,ge.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:c.length}),(0,ge.jsx)("button",{type:"button",title:`Add task to ${u}`,onClick:w=>{w.stopPropagation(),n(u)},style:{marginLeft:"auto",width:22,height:22,borderRadius:7,border:`1px solid ${v.border}`,background:v.bg,color:v.text,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:600},children:"+"})]}),(0,ge.jsx)("div",{style:{display:x[u]?"none":"flex",flexDirection:"column",gap:2},children:c.map(w=>(0,ge.jsx)($v,{task:w,liveActivity:r==null?void 0:r.get(w.id),onOpen:o,onDragStart:C=>d(C),dragOver:g===w.id,onDragOver:()=>L(w.id),onDragLeave:()=>L(C=>C===w.id?null:C),onDropToStatus:()=>{i&&l(i,w.status),d(null),L(null)},experimentalAgents:s},w.id))})]},u)}),!a&&H.length===0&&(0,ge.jsx)("div",{style:{textAlign:"center",color:"var(--p-text-g)",fontSize:13,marginTop:60},children:"No tasks found"})]})}function $v({task:e,liveActivity:t,onOpen:a,onDragStart:r,dragOver:o,onDragOver:n,onDragLeave:l,onDropToStatus:s,experimentalAgents:i}){let[d,f]=Zr.default.useState(!1),m=_v[e.type??"Task"]??"\\u2611",g=e.commentCount??0,L=e.fileCount??0;return(0,ge.jsxs)("div",{"data-task-id":e.id,"data-proto-id":"list-row",draggable:!0,style:{display:"grid",gridTemplateColumns:"18px 1fr auto auto auto",alignItems:"center",gap:10,padding:"6px 10px",borderRadius:8,background:o?"color-mix(in srgb, var(--p-blue) 10%, transparent)":d?"var(--p-hover)":"transparent",border:`1px solid ${o?"color-mix(in srgb, var(--p-blue) 40%, transparent)":d?"var(--p-border)":"transparent"}`,cursor:"grab",transition:"background .1s,border-color .1s",userSelect:"none"},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:()=>a(e),onDragStart:x=>{x.dataTransfer.effectAllowed="move",r(e.id),x.currentTarget.style.opacity="0.4"},onDragEnd:x=>{x.currentTarget.style.opacity="1"},onDragOver:x=>{x.preventDefault(),n()},onDragLeave:l,onDrop:x=>{x.preventDefault(),s()},children:[(0,ge.jsx)("span",{style:{fontSize:12,textAlign:"center",flexShrink:0},children:m}),(0,ge.jsxs)("div",{style:{minWidth:0},children:[(0,ge.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,ge.jsx)("span",{style:{fontSize:13,fontWeight:500,color:"var(--p-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),e.priority&&mg[e.priority]&&(0,ge.jsx)(Xn,{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:mg[e.priority]}}),e.component&&(0,ge.jsx)("span",{style:{fontSize:10,padding:"1px 6px",borderRadius:10,background:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 30%, transparent)",color:"var(--p-purple-300)",flexShrink:0,fontFamily:"monospace"},children:e.component})]}),e.description&&(0,ge.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:1,maxWidth:"100%"},children:e.description.replace(/\\s+/g," ").trim()})]}),(0,ge.jsxs)("button",{title:g>0?`${g} comment(s)`:"Add comment",style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:g>0?"var(--p-text-m)":"var(--p-border-t)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:x=>{x.stopPropagation(),a(e,"comments")},children:[(0,ge.jsx)(Vr,{className:"w-3 h-3"}),g>0&&(0,ge.jsx)("span",{children:g})]}),L>0&&(0,ge.jsxs)("button",{title:`${L} file(s)`,style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:"var(--p-blue-300)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:x=>{x.stopPropagation(),a(e,"files")},children:[(0,ge.jsx)(Gr,{className:"w-3 h-3"}),(0,ge.jsx)("span",{children:L})]}),t&&(0,ge.jsx)(Nd,{activity:t})]})}var $o=F(Oe(),1);var hr=F(j(),1);function gg({size:e=32,style:t,className:a}){return(0,hr.jsxs)("svg",{width:e,height:e,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:a,"aria-label":"Vibeflow",children:[(0,hr.jsx)("rect",{width:"32",height:"32",rx:"7",fill:"#2563eb"}),(0,hr.jsx)("rect",{x:"7",y:"13",width:"3.5",height:"10",rx:"1.5",fill:"white",opacity:"0.75"}),(0,hr.jsx)("rect",{x:"12.25",y:"8.5",width:"3.5",height:"15",rx:"1.5",fill:"white"}),(0,hr.jsx)("rect",{x:"17.5",y:"14.5",width:"3.5",height:"8",rx:"1.5",fill:"white",opacity:"0.75"}),(0,hr.jsx)("rect",{x:"22.5",y:"11",width:"2.5",height:"11",rx:"1.25",fill:"white",opacity:"0.85"})]})}var Js=F(j(),1);function il({id:e,title:t,onClick:a,label:r,icon:o,variant:n="neutral"}){return(0,Js.jsxs)("button",{id:e,onClick:a,title:t,className:`h-7 inline-flex items-center justify-center rounded-lg border transition-colors ${n==="accent"?"border-violet-700/50 bg-violet-900/30 text-violet-300 hover:bg-violet-800/30":"border-slate-700/60 bg-slate-800 text-slate-400 hover:bg-slate-700/50 hover:text-slate-200"} ${r?"gap-1.5 px-3 text-xs font-medium":"w-7"}`,type:"button",children:[o,r&&(0,Js.jsx)("span",{children:r})]})}var K=F(j(),1);function _d({projectName:e,projectIcon:t,missingProjectIconStyle:a="initial",wsConnected:r,port:o,searchQuery:n,premiumUsage:l,isLoading:s,filterTags:i,allTags:d,onToggleTag:f,backHref:m,backLabel:g,onSearchChange:L,onSettings:x,extraActions:I,taskSummary:H,agentRuns:p,selectMode:u,selectedCount:c,agentQueueCount:v,onOpenAgentQueue:w,experimentalAgents:C}){let[y,k]=$o.default.useState(!1),[z,N]=$o.default.useState(0),U=$o.default.useRef(null),_=$o.default.useRef(null),re=n.match(/(?:^|\\s)#(\\S*)$/),ce=re?re[1]:null,Se=i??[],J=(d??[]).filter(B=>!Se.includes(B)),be=ce!==null?J.filter(B=>B.toLowerCase().includes(ce.toLowerCase())):[];$o.default.useEffect(()=>{N(0)},[be.length]);function Te(B){var Ie;let te=n.replace(/\\s*#\\S*$/,"");L(te),f==null||f(B),(Ie=U.current)==null||Ie.focus()}function ve(B){if(B.key==="Backspace"&&n===""&&Se.length>0){B.preventDefault(),f==null||f(Se[Se.length-1]);return}if(!(ce===null||be.length===0)){if(B.key==="ArrowDown")B.preventDefault(),N(te=>Math.min(te+1,be.length-1));else if(B.key==="ArrowUp")B.preventDefault(),N(te=>Math.max(te-1,0));else if(B.key==="Enter")B.preventDefault(),be[z]&&Te(be[z]);else if(B.key==="Escape"){let te=n.replace(/\\s*#\\S*$/,"");L(te)}}}let W=(t??"").trim(),D=e?e.charAt(0).toUpperCase()+e.slice(1):"Vibeflow Board",b=n||Se.length>0;return(0,K.jsxs)("header",{className:"px-5 py-3 flex items-center gap-3 border-b border-slate-800/60 flex-shrink-0",children:[(0,K.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[m&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("a",{id:"header-back-link",href:m,className:"text-xs text-slate-400 hover:text-slate-200 transition-colors no-underline",style:{textDecoration:"none",fontWeight:500},children:g??"Back"}),(0,K.jsx)(Kn,{className:"w-3 h-3 text-slate-600 flex-shrink-0"})]}),(0,K.jsx)("div",{className:"flex-shrink-0",style:{width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center",...W?{fontSize:20}:void 0},children:W||(a==="vibeflow"?(0,K.jsx)(gg,{size:32}):(0,K.jsx)("div",{style:{width:32,height:32,borderRadius:8,flexShrink:0,background:"linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%)",border:"1px solid rgba(37,99,235,0.3)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:"#93c5fd",letterSpacing:"-0.01em"},title:D,children:D.charAt(0).toUpperCase()}))}),(0,K.jsxs)("div",{children:[(0,K.jsxs)("div",{className:"flex items-center gap-2",children:[(0,K.jsx)("h1",{id:"header-project-name",className:"text-sm font-semibold text-white leading-tight",children:D}),r&&(0,K.jsxs)("div",{id:"header-live-pill",className:"flex items-center gap-1.5 rounded-full px-2 py-0.5",style:{background:"color-mix(in srgb, var(--p-green) 30%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 28%, transparent)"},children:[(0,K.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-green-400",style:{animation:"pulse-live 2s ease-in-out infinite"}}),(0,K.jsxs)("span",{className:"text-[10px] font-medium text-green-400",children:["live \\xB7 :",o]})]})]}),(0,K.jsxs)("p",{className:"text-[10px] text-slate-500 font-mono mt-0.5",children:[H,s&&(0,K.jsx)("span",{id:"header-loading-indicator",className:"inline-block ml-1.5 w-1 h-1 rounded-full bg-blue-400",style:{animation:"pulse-live 1.4s ease-in-out infinite",verticalAlign:"middle"}})]})]})]}),(0,K.jsx)("div",{className:"flex-1 flex justify-center px-4",children:(0,K.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,K.jsxs)("div",{className:"flex flex-wrap items-center gap-1 w-full min-h-[30px] rounded-lg bg-slate-800 border border-slate-700/60 px-2 py-1 cursor-text transition-colors focus-within:border-blue-500",onClick:()=>{var B;return(B=U.current)==null?void 0:B.focus()},children:[(0,K.jsx)(jr,{className:"w-3.5 h-3.5 text-slate-500 flex-shrink-0 mr-0.5"}),Se.map(B=>{let{bg:te,text:Ie,border:Be}=ua(B);return(0,K.jsxs)("span",{style:{background:te,color:Ie,border:`1px solid ${Be}`,display:"inline-flex",alignItems:"center",gap:3,padding:"1px 7px",borderRadius:100,fontSize:11,fontWeight:500,whiteSpace:"nowrap"},children:[B,(0,K.jsx)("button",{onClick:We=>{We.stopPropagation(),f==null||f(B)},style:{background:"none",border:"none",cursor:"pointer",padding:0,lineHeight:1,color:"inherit",opacity:.7,display:"flex"},children:(0,K.jsx)(Xe,{style:{width:9,height:9}})})]},B)}),(0,K.jsx)("input",{ref:U,id:"global-search",type:"text",placeholder:Se.length===0?"Search\\u2026 or type #tag":"#tag or search\\u2026",value:n,onChange:B=>L(B.target.value),onKeyDown:ve,className:"flex-1 min-w-[100px] bg-transparent border-none outline-none text-xs text-slate-200 placeholder-slate-500",autoComplete:"off",spellCheck:!1}),b&&(0,K.jsx)("button",{id:"global-search-clear",onClick:()=>{L(""),Se.forEach(B=>f==null?void 0:f(B))},className:"text-slate-500 hover:text-slate-300 transition-colors flex-shrink-0 flex",title:"Clear search and tag filters",children:(0,K.jsx)(Xe,{className:"w-3.5 h-3.5"})})]}),ce!==null&&be.length>0&&(0,K.jsxs)("div",{ref:_,style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.3)",zIndex:50,overflow:"hidden"},children:[(0,K.jsx)("div",{style:{padding:"5px 10px",fontSize:10,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--p-text-g)",borderBottom:"1px solid var(--p-border)"},children:"Tags"}),be.map((B,te)=>{let{bg:Ie,text:Be,border:We}=ua(B);return(0,K.jsxs)("button",{onMouseDown:oe=>{oe.preventDefault(),Te(B)},onMouseEnter:()=>N(te),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:8,padding:"7px 12px",background:te===z?"var(--p-hover)":"none",border:"none",cursor:"pointer"},children:[(0,K.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:Be,flexShrink:0}}),(0,K.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:B}),(0,K.jsx)("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:100,fontSize:10,background:Ie,color:Be,border:`1px solid ${We}`},children:"tag"})]},B)}),(0,K.jsx)("div",{style:{padding:"5px 10px",fontSize:10,color:"var(--p-text-g)",borderTop:"1px solid var(--p-border)"},children:"\\u2191\\u2193 navigate \\xB7 Enter select \\xB7 Esc close"})]})]})}),(0,K.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[I,C===!0&&p&&p.length>0&&(0,K.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:10,fontWeight:600,border:"1px solid color-mix(in srgb, var(--p-blue) 40%, transparent)",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)",flexShrink:0},title:`${p.filter(B=>B.status==="running").length} running \\xB7 ${p.filter(B=>B.status==="queued").length} queued`,children:[(0,K.jsx)("span",{className:"spinner",style:{width:9,height:9,borderWidth:1.5}}),p.filter(B=>B.status==="running").length," running",p.filter(B=>B.status==="queued").length>0&&(0,K.jsxs)(K.Fragment,{children:[" \\xB7 ",p.filter(B=>B.status==="queued").length," queued"]})]}),C===!0&&w&&v!==void 0&&v>0&&(0,K.jsx)(il,{id:"btn-agent-queue",title:"Agent Queue",onClick:w,label:`\\u{1F916} Queue ${v}`,icon:(0,K.jsx)(Kt,{className:"w-3.5 h-3.5"})}),u&&(0,K.jsxs)("span",{id:"select-mode-indicator",style:{display:"inline-flex",alignItems:"center",gap:6,padding:"2px 10px",borderRadius:999,fontSize:11,fontWeight:500,border:"1px solid color-mix(in srgb, var(--p-blue) 35%, transparent)",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)",flexShrink:0},children:[(0,K.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--p-blue)",animation:"pulse-live 1.5s ease-in-out infinite"}}),"select",c!=null&&c>0?` \\xB7 ${c}`:"",(0,K.jsx)("kbd",{style:{fontSize:9,fontFamily:"monospace",fontWeight:600,background:"color-mix(in srgb, var(--p-blue) 18%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 30%, transparent)",borderRadius:3,padding:"0 4px",lineHeight:"16px",color:"var(--p-blue-300)",letterSpacing:"0.02em"},children:"esc"})]}),(0,K.jsx)(il,{id:"header-shortcuts-hint",title:"Click to see keyboard shortcuts",onClick:()=>k(!0),label:"? shortcuts"}),(0,K.jsx)(il,{id:"btn-settings",title:"Settings",onClick:x,icon:(0,K.jsx)(Xr,{className:"w-3.5 h-3.5"})})]}),y&&(0,K.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(2,12,27,0.80)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",zIndex:200,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>k(!1),children:(0,K.jsxs)("div",{id:"shortcuts-modal",style:{background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:14,padding:"20px 24px",minWidth:320,maxWidth:420,boxShadow:"var(--p-shadow-lg)"},onClick:B=>B.stopPropagation(),children:[(0,K.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,K.jsx)("span",{style:{fontSize:13,fontWeight:700,color:"var(--p-text)"},children:"Keyboard Shortcuts"}),(0,K.jsx)("button",{onClick:()=>k(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--p-text-f)",padding:2},children:(0,K.jsx)(Xe,{style:{width:14,height:14}})})]}),(0,K.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[["Alt+N","Open new task panel"],["Esc","Close panel / modal"],["?","Show this shortcuts overlay"],["Alt+F","Focus task search"]].map(([B,te])=>(0,K.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,K.jsx)("kbd",{style:{fontSize:10,fontFamily:"monospace",background:"var(--p-surface)",border:"1px solid var(--p-border-t)",borderRadius:4,padding:"2px 7px",color:"var(--p-text-sub)",flexShrink:0},children:B}),(0,K.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:te})]},B))})]})})]})}var Z=F(Oe(),1);var ei=F(Oe(),1);var La=F(j(),1);function ti({id:e,value:t,onChange:a,disabled:r}){let[o,n]=ei.default.useState(!1),l=ei.default.useRef(null),s=Yr.find(i=>i.value===t)??Yr[0];return ei.default.useEffect(()=>{let i=d=>{var f;(f=l.current)!=null&&f.contains(d.target)||n(!1)};return document.addEventListener("click",i),()=>document.removeEventListener("click",i)},[]),(0,La.jsxs)("div",{id:e,ref:l,style:{position:"relative",display:"inline-block"},children:[(0,La.jsxs)("button",{type:"button",title:s==null?void 0:s.tooltip,onClick:i=>{i.preventDefault(),r||n(d=>!d)},style:{display:"inline-flex",alignItems:"center",gap:5,padding:"3px 8px",borderRadius:6,border:"1px solid var(--p-border, rgba(255,255,255,0.08))",background:"var(--p-hover, rgba(255,255,255,0.05))",color:"var(--p-text-m, rgba(255,255,255,0.7))",fontSize:12,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,La.jsx)("span",{style:{fontSize:13},children:s==null?void 0:s.icon}),(0,La.jsx)("span",{children:s==null?void 0:s.label})]}),o&&(0,La.jsx)("div",{style:{position:"absolute",top:"100%",left:0,marginTop:4,background:"var(--p-card, #1e293b)",border:"1px solid var(--p-border-s, rgba(255,255,255,0.12))",borderRadius:8,padding:"4px 0",zIndex:200,minWidth:140,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:Yr.map(i=>(0,La.jsxs)("button",{type:"button",title:i.tooltip,onClick:()=>{a(i.value),n(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",border:"none",background:i.value===t?"var(--p-hover, rgba(255,255,255,0.06))":"transparent",color:i.value===t?"var(--p-text, #fff)":"var(--p-text-f, rgba(255,255,255,0.55))",fontSize:12,cursor:"pointer",textAlign:"left"},children:[(0,La.jsx)("span",{style:{fontSize:14,lineHeight:1},children:i.icon}),(0,La.jsx)("span",{children:i.label})]},i.value))})]})}var yt=F(Oe(),1);var ul=F(Oe(),1);var xr=F(j(),1);function vr({markdown:e,className:t,style:a}){let r=ul.default.useRef(null),o=ul.default.useRef({}),[n,l]=ul.default.useState(null);return ul.default.useEffect(()=>{let s=r.current;if(!s)return;function i(){l(null)}async function d(m){let g=m.target,L=g==null?void 0:g.closest("a[data-task-ref]");if(!L){i();return}m.preventDefault();let x=L.getAttribute("data-task-ref");if(!x)return;let I=L.getBoundingClientRect(),H=o.current[x];if(H){l({id:x,title:H.title,status:H.status,x:I.left,y:I.bottom+6});return}try{let u=await(await fetch(`/api/tasks/${x}`)).json(),c={title:u.title??`Task ${x}`,status:u.status??"unknown"};o.current[x]=c,l({id:x,title:c.title,status:c.status,x:I.left,y:I.bottom+6})}catch{l({id:x,title:`Task ${x}`,status:"unknown",x:I.left,y:I.bottom+6})}}function f(m){var x,I;let g=(I=(x=m.target)==null?void 0:x.closest)==null?void 0:I.call(x,"a[data-task-ref]");if(!g)return;let L=g.getAttribute("data-task-ref");L&&window.dispatchEvent(new CustomEvent("vibeflow-task-ref-click",{detail:{refId:L}}))}return s.addEventListener("mouseover",d),s.addEventListener("mouseleave",i),s.addEventListener("click",f),()=>{s.removeEventListener("mouseover",d),s.removeEventListener("mouseleave",i),s.removeEventListener("click",f)}},[]),(0,xr.jsxs)("div",{style:{position:"relative"},children:[(0,xr.jsx)("div",{ref:r,className:t,style:a,dangerouslySetInnerHTML:{__html:Gs(e)}}),n&&(0,xr.jsxs)("div",{style:{position:"fixed",left:n.x,top:n.y,background:"#0f172a",border:"1px solid rgba(59,130,246,0.4)",color:"#e2e8f0",borderRadius:8,padding:"8px 10px",fontSize:11,boxShadow:"0 10px 24px rgba(2,6,23,0.55)",zIndex:60,pointerEvents:"none",minWidth:180},children:[(0,xr.jsxs)("div",{style:{color:"#60a5fa",fontFamily:"Menlo,monospace",marginBottom:3},children:["#",n.id]}),(0,xr.jsx)("div",{style:{fontWeight:600,marginBottom:3},children:n.title}),(0,xr.jsxs)("div",{style:{color:"#94a3b8"},children:["status: ",n.status]})]})]})}var dl=F(Oe(),1),hg=F(j(),1),Vo=dl.default.forwardRef(function({value:t,onChange:a,baseRows:r=4,maxRows:o,style:n,...l},s){let i=dl.default.useRef(null),d=o??r*2,f=dl.default.useCallback(()=>{let m=i.current;if(!m)return;m.style.height="auto";let g=window.getComputedStyle(m),L=Number.parseFloat(g.lineHeight||"0")||18,x=Number.parseFloat(g.paddingTop||"0")+Number.parseFloat(g.paddingBottom||"0"),I=Number.parseFloat(g.borderTopWidth||"0")+Number.parseFloat(g.borderBottomWidth||"0"),H=r*L+x+I,p=d*L+x+I,u=Math.max(H,Math.min(m.scrollHeight,p));m.style.height=`${u}px`,m.style.overflowY=m.scrollHeight>p?"auto":"hidden"},[r,d]);return dl.default.useLayoutEffect(()=>{f()},[t,f]),(0,hg.jsx)("textarea",{...l,ref:m=>{i.current=m,typeof s=="function"?s(m):s&&(s.current=m)},rows:r,value:t,onChange:m=>a(m.target.value),style:{...n,resize:"none"}})});var yg=F(Oe(),1);var xg=F(Oe(),1),vg=F(_r(),1),za=F(j(),1);function Jr({open:e,onClose:t,icon:a,title:r,headerActions:o,width:n,maxHeight:l,id:s,children:i,footer:d,boxStyle:f,onKeyDown:m}){if(xg.default.useEffect(()=>{if(!e)return;function x(I){I.key==="Escape"&&t(),m==null||m(I)}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[e,t,m]),!e)return null;let g=!!(a||r||o),L=(0,za.jsx)("div",{id:s,className:"modal-backdrop",onClick:x=>{x.target===x.currentTarget&&t()},onMouseDown:x=>x.stopPropagation(),children:(0,za.jsxs)("div",{className:"modal-box",style:{width:n??"min(420px, 95vw)",maxHeight:l,...f},children:[g&&(0,za.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--p-border)",flexShrink:0},children:[a&&(0,za.jsx)("span",{style:{flexShrink:0,display:"flex",alignItems:"center"},children:a}),r&&(0,za.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1,minWidth:0},children:r}),o&&(0,za.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,marginLeft:"auto"},children:o})]}),i,d&&(0,za.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8,padding:"10px 18px",borderTop:"1px solid var(--p-border)",flexShrink:0},children:d})]})});return(0,vg.createPortal)(L,document.body)}var Xt=F(j(),1);function Sa({open:e,message:t,title:a="Confirm",confirmLabel:r="Delete",cancelLabel:o="Cancel",loading:n,error:l,onConfirm:s,onCancel:i}){let d=yg.default.useCallback(f=>{f.key==="Enter"&&s()},[s]);return(0,Xt.jsx)(Jr,{open:e,onClose:i,id:"confirm-modal",width:"min(380px, 95vw)",icon:(0,Xt.jsx)(mr,{style:{width:20,height:20,color:"#f87171"}}),title:a,onKeyDown:d,footer:(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)("button",{id:"confirm-modal-cancel",onClick:i,disabled:n,style:{padding:"7px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer",transition:"background 0.15s"},children:o}),(0,Xt.jsx)("button",{id:"confirm-modal-confirm",onClick:s,disabled:n,style:{padding:"7px 16px",borderRadius:8,background:"#dc2626",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:n?"wait":"pointer",opacity:n?.6:1,transition:"background 0.15s"},children:n?"Deleting\\u2026":r})]}),children:(0,Xt.jsxs)("div",{style:{padding:"16px 18px"},children:[typeof t=="string"?(0,Xt.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:t}):t,l&&(0,Xt.jsx)("p",{style:{margin:"8px 0 0",fontSize:12,color:"var(--p-red)"},children:l})]})})}var Ze=F(j(),1);function Lg(e){return e.linkedPath?"\\u{1F517}":/\\.(png|jpe?g|gif|webp|svg)$/i.test(e.name)?"\\u{1F5BC}\\uFE0F":/\\.html?$/i.test(e.name)?"\\u{1F310}":/\\.md$/i.test(e.name)||/\\.pdf$/i.test(e.name)?"\\u{1F4C4}":"\\u{1F4CE}"}function Vv(e){return/\\.(png|jpe?g|gif|webp|svg|html?)$/i.test(e.name)}function Gv(e){return/\\.html?$/i.test(e.name)}function ai({file:e,url:t,variant:a,onPreview:r,onDelete:o}){let n=Vv(e),l=Gv(e);function s(){r?r(e,t):window.open(t,"_blank")}return a==="compact"?(0,Ze.jsxs)("div",{className:"group/file-compact",style:{display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:8,background:"var(--p-card)",border:"1px solid var(--p-border)",position:"relative"},children:[(0,Ze.jsx)("span",{style:{fontSize:14,flexShrink:0},children:Lg(e)}),(0,Ze.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Ze.jsx)("button",{onClick:s,style:{fontSize:12,color:"var(--p-blue-300)",background:"none",border:"none",cursor:"pointer",padding:0,textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},title:e.name,children:e.name})}),(0,Ze.jsx)("span",{className:"file-compact-ts",style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:e.createdAt?Tt(e.createdAt):"attached"}),(0,Ze.jsxs)("div",{className:"file-compact-actions",style:{position:"absolute",right:6,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s",background:"var(--p-card)",paddingLeft:8},children:[n&&(0,Ze.jsx)("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:l?"Open in new tab":"Preview",children:l?"\\u2197":"\\u{1F441}"}),(0,Ze.jsx)("a",{href:t,download:e.name,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)",textDecoration:"none"},title:"Download",onClick:i=>i.stopPropagation(),children:"\\u2193"}),o&&(0,Ze.jsx)("button",{onClick:()=>void o(e),style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:"Delete",children:"\\u2715"})]})]}):(0,Ze.jsxs)("div",{className:"group/file",style:{display:"flex",alignItems:"center",gap:10,padding:8,borderRadius:8,border:"1px solid var(--p-border)",transition:"background 0.15s",position:"relative"},children:[(0,Ze.jsx)("span",{style:{fontSize:18,flexShrink:0},children:Lg(e)}),(0,Ze.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ze.jsx)("p",{style:{fontSize:12,fontWeight:500,color:"var(--p-text)",margin:0,cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.name,onClick:s,children:e.name}),(0,Ze.jsx)("p",{style:{fontSize:10,color:"var(--p-text-f)",margin:0},children:e.linkedPath?`linked: ${e.linkedPath}`:Fd(e.size??0)})]}),(0,Ze.jsxs)("div",{className:"file-normal-actions",style:{display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s"},children:[n&&(0,Ze.jsx)("button",{onClick:s,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:l?"Open in new tab":"Preview",children:l?"\\u2197":"\\u{1F441}"}),(0,Ze.jsx)("a",{href:t,download:e.name,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)",textDecoration:"none"},title:"Download",onClick:i=>i.stopPropagation(),children:"\\u2193"}),o&&(0,Ze.jsx)("button",{onClick:()=>void o(e),style:{background:"none",border:"none",cursor:"pointer",padding:"4px",borderRadius:4,fontSize:11,color:"var(--p-text-m)"},title:"Delete",children:"\\u2715"})]})]})}var q=F(j(),1);function Sg({source:e}){return e!=="cli"?null:(0,q.jsx)("span",{title:"Via CLI (agent)",style:{fontSize:9,color:"var(--p-green-300)",background:"rgba(34,197,94,0.1)",border:"1px solid rgba(34,197,94,0.2)",borderRadius:4,padding:"0 4px",fontFamily:"monospace",lineHeight:"16px",flexShrink:0},children:">_"})}function Kv(e,t){if(e.kind==="lifecycle")return e.author??null;if(e.kind==="comment"){let a=e.comment;return a.type==="system"?null:a.author==="agent"?"\\u{1F916} Agent":a.authorName??t}return e.kind==="change"?e.actor:null}function jv(e,t){let a=[];for(let r of e){let o=Kv(r,t),n=a[a.length-1];o&&n&&n.author===o?(n.items.push(r),r.sortKey>n.newestSortKey&&(n.newestSortKey=r.sortKey),r.sortKey<n.oldestSortKey&&(n.oldestSortKey=r.sortKey)):a.push({author:o,newestSortKey:r.sortKey,oldestSortKey:r.sortKey,items:[r]})}return a}function Wd({comments:e,files:t=[],localChanges:a=[],loading:r,error:o,gitUserName:n="You",taskAuthorName:l,baseUrl:s="",taskId:i,taskCreatedAt:d,taskUpdatedAt:f,onEdit:m,onDelete:g,onDeleteFile:L,onFilePreview:x}){let I=yt.default.useRef(null),H=yt.default.useRef(null),[p,u]=yt.default.useState(null),[c,v]=yt.default.useState(""),[w,C]=yt.default.useState(null),[y,k]=yt.default.useState(null),[z,N]=yt.default.useState(()=>{try{return localStorage.getItem("vibeflow-show-updates")!=="false"}catch{return!0}}),U=yt.default.useRef(r),_=yt.default.useMemo(()=>{let J=[];d&&J.push({kind:"lifecycle",sortKey:d,label:"Task created",icon:"\\u2726",author:l??n}),f&&f!==d&&J.push({kind:"lifecycle",sortKey:f,label:"Task edited",icon:"\\u270E"});let be=e.map(W=>({kind:"comment",sortKey:W.createdAt,comment:W})),Te=t.map(W=>{let D=W.url.startsWith("http")?W.url:`${s}${W.url}`;return{kind:"file",sortKey:W.createdAt??"9999",file:W,url:D}}),ve=a.map(W=>({kind:"change",sortKey:W.timestamp,field:W.field,from:W.from,to:W.to,actor:W.actor,source:W.source}));return[...J,...be,...Te,...ve].sort((W,D)=>D.sortKey.localeCompare(W.sortKey))},[e,t,a,s,d,f]),re=yt.default.useMemo(()=>_.filter(J=>J.kind==="lifecycle"||J.kind==="change").length,[_]),ce=yt.default.useMemo(()=>z?_:_.filter(J=>J.kind==="comment"||J.kind==="file"),[_,z]),Se=yt.default.useMemo(()=>jv(ce,n),[ce,n]);return yt.default.useEffect(()=>{let J=U.current&&!r;U.current=r,I.current&&J&&requestAnimationFrame(()=>{I.current&&(I.current.scrollTop=0)})},[r]),yt.default.useEffect(()=>{p&&H.current&&(H.current.focus(),H.current.scrollIntoView({block:"nearest"}))},[p]),r?(0,q.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):o?(0,q.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):_.length===0?(0,q.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No activity yet."}):(0,q.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[re>0&&(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0 4px",flexShrink:0,borderBottom:"1px solid var(--p-border)",marginBottom:4},children:[(0,q.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",flex:1,letterSpacing:"0.04em"},children:z?"":`${re} system event${re!==1?"s":""} hidden`}),(0,q.jsx)("button",{id:"dp-toggle-updates",onClick:()=>N(J=>{let be=!J;try{localStorage.setItem("vibeflow-show-updates",String(be))}catch{}return be}),style:{all:"unset",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:5,color:z?"var(--p-text-m)":"var(--p-text-g)",transition:"color .12s, background .12s"},title:z?"Hide system events":`Show ${re} system event${re!==1?"s":""}`,onMouseEnter:J=>{J.currentTarget.style.color="var(--p-text)",J.currentTarget.style.background="var(--p-hover)"},onMouseLeave:J=>{J.currentTarget.style.color=z?"var(--p-text-m)":"var(--p-text-g)",J.currentTarget.style.background="transparent"},children:z?(0,q.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,q.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,q.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,q.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})})]}),(0,q.jsx)("div",{ref:I,style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:2,minHeight:0},children:Se.map((J,be)=>{let Te=J.author!==null&&J.items.length>1,ve=Te,W=J.author==="\\u{1F916} Agent";return(0,q.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[ve&&(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 0 2px",marginTop:4},children:[(0,q.jsx)("span",{style:{fontSize:11,fontWeight:600,color:W?"var(--p-purple)":"var(--p-blue-300)",flexShrink:0},children:J.author}),(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",flexShrink:0},children:`${Tt(J.oldestSortKey)} \\u2013 ${Tt(J.newestSortKey)}`}),(0,q.jsxs)("span",{style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:["(",J.items.length," activities)"]})]}),(0,q.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:Te?4:8,paddingLeft:Te?8:0,borderLeft:Te?"1.5px solid var(--p-border)":"none",marginLeft:Te?4:0},children:J.items.map((D,b)=>Xv(D,b,be,Te,n,p,c,H,u,v,m,C,L?k:null,x))})]},`group-${be}`)})}),(0,q.jsx)(Sa,{open:w!==null,message:"Delete this comment? This action cannot be undone.",onConfirm:()=>{w&&g(w),C(null)},onCancel:()=>C(null)}),L&&(0,q.jsx)(Sa,{open:y!==null,message:y?`Delete "${y.name}"? This action cannot be undone.`:"",onConfirm:()=>{y&&L(y),k(null)},onCancel:()=>k(null)})]})}function Xv(e,t,a,r,o,n,l,s,i,d,f,m,g,L){if(e.kind==="lifecycle")return(0,q.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-purple)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:e.icon}),(0,q.jsx)("div",{style:{flex:1,minWidth:0},children:(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)",fontStyle:"italic"},children:e.label}),!r&&(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:Tt(e.sortKey)})]})})]},`lifecycle-${e.sortKey}-${a}-${t}`);if(e.kind==="change"){let w=e.from.length>28?e.from.slice(0,28)+"\\u2026":e.from,C=e.to.length>28?e.to.slice(0,28)+"\\u2026":e.to,y=e.from.length>28||e.to.length>28;return(0,q.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-blue)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:"\\u270E"}),(0,q.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[!r&&(0,q.jsxs)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-blue-300)"},children:["\\u{1F464} ",e.actor]}),!r&&(0,q.jsx)(Sg,{source:e.source}),(0,q.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:["changed ",(0,q.jsx)("strong",{style:{color:"var(--p-text)"},children:e.field})]}),!r&&(0,q.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:Tt(e.sortKey)})]}),(0,q.jsxs)("div",{title:y?`${e.from} \\u2192 ${e.to}`:void 0,style:{marginTop:2,fontSize:11,color:"var(--p-text-g)",display:"flex",alignItems:"center",gap:4,cursor:y?"help":"default"},children:[(0,q.jsx)("span",{style:{color:"var(--p-red)",background:"rgba(239,68,68,0.1)",borderRadius:4,padding:"1px 5px",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w}),(0,q.jsx)("span",{style:{color:"var(--p-text-g)"},children:"\\u2192"}),(0,q.jsx)("span",{style:{color:"var(--p-green)",background:"rgba(34,197,94,0.1)",borderRadius:4,padding:"1px 5px",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C})]})]})]},`change-${e.sortKey}-${a}-${t}`)}if(e.kind==="file"){let{file:v,url:w}=e;return(0,q.jsx)(ai,{file:v,url:w,variant:"compact",onPreview:L?(C,y)=>L(C.name,y):void 0,onDelete:g?C=>(g(C),Promise.resolve()):void 0},`file-${v.name}-${a}-${t}`)}let x=e.comment,I=x.author==="agent",H=x.type==="system",p=x.deleted===!0,u=!!x.id&&!I&&!H&&!p&&x.isOwnComment!==!1,c=n===x.id;return H?(0,q.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"2px 0",fontSize:11,color:"var(--p-text-g)",fontStyle:"italic"},children:[(0,q.jsx)("span",{style:{opacity:.6},children:"\\u2B21"}),(0,q.jsx)("span",{children:x.text}),!r&&(0,q.jsx)("span",{style:{marginLeft:"auto",flexShrink:0,opacity:.6},children:Tt(x.createdAt)})]},x.id):(0,q.jsxs)("div",{className:"flex flex-col gap-1 group/comment",style:{paddingTop:r?2:4},children:[!r&&(0,q.jsxs)("div",{className:"flex items-center justify-between gap-1.5 text-xs mb-0.5",children:[(0,q.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,q.jsx)("span",{style:{color:p?"var(--p-text-g)":I?"var(--p-purple)":"var(--p-blue-300)"},children:I?"\\u{1F916} Agent":`\\u{1F464} ${x.authorName??o}`}),(0,q.jsx)(Sg,{source:x.source}),(0,q.jsxs)("span",{style:{color:"var(--p-text-g)"},children:[Tt(x.createdAt),!p&&x.updatedAt?" \\xB7 edited":"",p?" \\xB7 deleted":""]})]}),u&&(0,q.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,q.jsx)("button",{onClick:()=>{i(x.id),d(x.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,q.jsx)("button",{onClick:()=>m(x),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),r&&(0,q.jsxs)("div",{className:"flex items-center justify-between gap-1.5",style:{marginBottom:2},children:[(0,q.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-g)"},children:[Tt(x.createdAt),!p&&x.updatedAt?" \\xB7 edited":"",p?" \\xB7 deleted":""]}),u&&(0,q.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,q.jsx)("button",{onClick:()=>{i(x.id),d(x.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,q.jsx)("button",{onClick:()=>m(x),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,q.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),c?(0,q.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,q.jsx)(Vo,{ref:s,value:l,onChange:d,baseRows:4,maxRows:12,onKeyDown:v=>{v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),f(x,l).then(()=>i(null)))},style:{width:"100%",background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:6,padding:"8px 10px",fontSize:12,color:"var(--p-text)",outline:"none",fontFamily:"inherit",boxSizing:"border-box"}}),(0,q.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,q.jsx)("button",{onClick:()=>i(null),style:{padding:"4px 10px",background:"var(--p-surface)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-text-sub)",cursor:"pointer"},children:"Cancel"}),(0,q.jsx)("button",{onClick:async()=>{await f(x,l),i(null)},style:{padding:"4px 10px",background:"var(--p-blue)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-white)",cursor:"pointer"},children:"Save"})]})]}):p?(0,q.jsx)("div",{style:{padding:"8px 14px",fontSize:12,color:"var(--p-text-g)",fontStyle:"italic",background:"var(--p-input)",border:"1px dashed var(--p-border)",borderRadius:8},children:"Comment deleted"}):(0,q.jsx)(vr,{markdown:x.text,style:{background:"var(--p-input)",border:"1px solid var(--p-border)",borderRadius:8,padding:"10px 14px",fontSize:12,color:"var(--p-text-sub)",lineHeight:1.6}})]},x.id)}var Ig=F(Oe(),1);var yr=F(j(),1);function $d({files:e,loading:t,error:a,baseUrl:r,onPreview:o,onDelete:n}){let[l,s]=Ig.default.useState(null);return t?(0,yr.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):a?(0,yr.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):e.length===0?(0,yr.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No files attached."}):(0,yr.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.map(i=>{let d=i.url??`${r}/api/files/${encodeURIComponent(i.name)}`;return(0,yr.jsx)(ai,{file:i,url:d,variant:"normal",onPreview:f=>o(f),onDelete:n?f=>(s(f),Promise.resolve()):void 0},i.name)}),n&&(0,yr.jsx)(Sa,{open:l!==null,message:l?`Delete "${l.name}"? This action cannot be undone.`:"",onConfirm:()=>{l&&n(l),s(null)},onCancel:()=>s(null)})]})}var Kd=F(Oe(),1);var Go=F(Oe(),1),Cg=F(_r(),1);var da=F(j(),1);function fl({value:e,onChange:t,previewValue:a,showPreview:r,setShowPreview:o,previewId:n,textareaId:l,placeholder:s,previewEmptyText:i,previewMinHeight:d=54,previewMaxHeight:f=220,baseRows:m=5,maxRows:g=12,autoFocus:L=!1,textareaRef:x,onKeyDown:I,afterTextarea:H,onBlur:p}){let u=Go.default.useRef(null),[c,v]=Go.default.useState([]),[w,C]=Go.default.useState(null),[y,k]=Go.default.useState(null);Go.default.useEffect(()=>{let U=!0;return fetch("/api/tasks").then(_=>_.json()).then(_=>{if(!U)return;let re=(_.tasks??[]).map(ce=>({id:String(ce.id??""),title:String(ce.title??"")})).filter(ce=>ce.id.length>0);v(re)}).catch(()=>{}),()=>{U=!1}},[]);function z(U){let _=u.current;if(!_){C(null);return}let re=_.selectionStart??U.length,ce=U.slice(0,re),Se=-1;for(let ve=ce.length-1;ve>=0;ve--){if(ce[ve]!=="#")continue;let W=ve>0?ce[ve-1]:"";if(W&&!/\\s/.test(W))continue;let D=ce.slice(ve+1);if(!D.includes("#")){if(D.length>80)return;Se=ve;break}}if(Se===-1){C(null);return}let J=ce.slice(Se+1).trim().toLowerCase(),be=c.filter(ve=>{if(!J)return!0;let W=ve.id.toLowerCase(),D=ve.title.toLowerCase();return W.includes(J)||D.includes(J)}).sort((ve,W)=>{let D=ve.id.toLowerCase().startsWith(J)?1:0,b=W.id.toLowerCase().startsWith(J)?1:0;if(D!==b)return b-D;let B=ve.title.toLowerCase().startsWith(J)?1:0,te=W.title.toLowerCase().startsWith(J)?1:0;return B!==te?te-B:ve.id.localeCompare(W.id)}).slice(0,6);if(!be.length){C(null),k(null);return}let Te=_.getBoundingClientRect();k({top:Te.top,left:Te.left,width:Te.width}),C({queryStart:Se,queryEnd:re,items:be})}function N(U){let _=w;if(!_)return;let re=`${e.slice(0,_.queryStart)}#${U} ${e.slice(_.queryEnd)}`;t(re),C(null),k(null),requestAnimationFrame(()=>{let ce=u.current;if(!ce)return;let Se=_.queryStart+U.length+2;ce.focus(),ce.setSelectionRange(Se,Se)})}return r?(0,da.jsx)("div",{id:n,onClick:U=>{U.target.closest("a")||o(!1)},title:"Click to edit",style:{cursor:"text",minHeight:d,background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:10,fontSize:12,color:"var(--p-text-sub)",lineHeight:1.7,overflow:"auto",maxHeight:f},children:(a??e).trim()?(0,da.jsx)(vr,{markdown:a??e}):(0,da.jsx)("span",{style:{color:"var(--p-border-t)"},children:i??s})}):(0,da.jsxs)("div",{style:{position:"relative"},children:[(0,da.jsx)(Vo,{id:l,ref:U=>{u.current=U,x&&(x.current=U)},className:"dp-textarea",placeholder:s,value:e,onChange:U=>{t(U),z(U)},onFocus:()=>o(!1),onBlur:()=>{C(null),k(null),o(!0),p==null||p()},baseRows:m,maxRows:g,autoFocus:L,onKeyDown:U=>{U.key==="Escape"&&(C(null),k(null)),I==null||I(U)}}),w&&y&&(0,Cg.createPortal)((0,da.jsx)("div",{"data-task-ref-suggest":"true",style:{position:"fixed",left:y.left+8,width:y.width-16,top:y.top,transform:"translateY(-100%)",border:"1px solid var(--p-border-s)",background:"var(--p-card)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",overflow:"hidden",zIndex:9999},children:w.items.map(U=>(0,da.jsxs)("button",{type:"button",onMouseDown:_=>{_.preventDefault(),N(U.id)},style:{width:"100%",display:"flex",alignItems:"center",gap:8,textAlign:"left",border:"none",borderBottom:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-sub)",padding:"7px 10px",fontSize:11,cursor:"pointer"},onMouseEnter:_=>{_.currentTarget.style.background="var(--p-hover)"},onMouseLeave:_=>{_.currentTarget.style.background="transparent"},children:[(0,da.jsxs)("span",{style:{fontFamily:"monospace",color:"var(--p-blue-300)"},children:["#",U.id]}),(0,da.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:U.title})]},U.id))}),document.body),H]})}var eo=F(Oe(),1);var Qt=F(j(),1);function Vd({tags:e,allTags:t,onChange:a,disabled:r}){let[o,n]=eo.default.useState(""),[l,s]=eo.default.useState(!1),i=eo.default.useRef(null),d=eo.default.useRef(null),f=o.trim().toLowerCase(),m=eo.default.useMemo(()=>t.filter(c=>!e.includes(c)&&c.toLowerCase().includes(f)).slice(0,8),[t,e,f]),g=f.length>0&&!t.some(u=>u.toLowerCase()===f)&&!e.some(u=>u.toLowerCase()===f),L=f.length>0&&t.some(u=>u.toLowerCase()===f)&&!e.some(u=>u.toLowerCase()===f);function x(u){var v;let c=u.trim();!c||e.includes(c)||(a([...e,c]),n(""),s(!1),(v=i.current)==null||v.focus())}function I(u){a(e.filter(c=>c!==u))}function H(u){if(u.key==="Enter")if(u.preventDefault(),g||L){let c=t.find(v=>v.toLowerCase()===f);x(c??o.trim())}else m.length>0&&x(m[0]);u.key==="Escape"&&(s(!1),n("")),u.key==="Backspace"&&!o&&e.length>0&&I(e[e.length-1])}eo.default.useEffect(()=>{function u(c){d.current&&!d.current.contains(c.target)&&s(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);let p=l&&(m.length>0||g);return(0,Qt.jsxs)("div",{ref:d,style:{position:"relative"},children:[(0,Qt.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",padding:"5px 8px",borderRadius:8,border:`1px solid ${l?"var(--p-blue)":"var(--p-border)"}`,background:"var(--p-input)",cursor:r?"not-allowed":"text",opacity:r?.6:1,minHeight:34,transition:"border-color .12s"},onClick:()=>{var u;r||(u=i.current)==null||u.focus()},children:[(0,Qt.jsx)(sl,{tags:e,onRemove:r?void 0:I,size:"sm"}),!r&&(0,Qt.jsx)("input",{ref:i,type:"text",value:o,placeholder:e.length?"":"Add tags\\u2026",onChange:u=>{n(u.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:H,style:{background:"none",border:"none",outline:"none",fontSize:12,color:"var(--p-text)",minWidth:80,flex:1,padding:0,lineHeight:"1.4"}})]}),p&&(0,Qt.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onMouseDown:u=>u.preventDefault(),children:[m.map(u=>{let{bg:c,text:v,border:w}=ua(u);return(0,Qt.jsxs)("button",{type:"button",onClick:()=>x(u),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-m)"},onMouseEnter:C=>{C.currentTarget.style.background="var(--p-hover)"},onMouseLeave:C=>{C.currentTarget.style.background="none"},children:[(0,Qt.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:v,border:`1px solid ${w}`,flexShrink:0}}),u]},u)}),g&&(0,Qt.jsxs)("button",{type:"button",onClick:()=>x(o.trim()),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:m.length>0?"1px solid var(--p-border)":"none",borderLeft:"none",borderRight:"none",borderBottom:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-g)"},onMouseEnter:u=>{u.currentTarget.style.background="var(--p-hover)",u.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:u=>{u.currentTarget.style.background="none",u.currentTarget.style.color="var(--p-text-g)"},children:[(0,Qt.jsx)("span",{style:{fontSize:14,lineHeight:1},children:"+"}),\'Create "\',(0,Qt.jsx)("strong",{style:{color:"var(--p-text)"},children:o.trim()}),\'"\']})]})]})}var Y=F(j(),1);function jd({task:e,description:t,setDescription:a,showDescPreview:r,setShowDescPreview:o,priority:n,setPriority:l,onDescriptionBlur:s,onDescriptionDiscard:i,originalDescription:d,onPriorityChange:f,githubUrl:m,onFilePreview:g,onPatch:L,onDeleteScreenshot:x,liveFiles:I,allTags:H=[],overrideTags:p,onTagsChange:u}){var _;let c=(e==null?void 0:e.files)??[],v=I?I.map(re=>({name:re.name,linkedPath:re.linkedPath,addedAt:re.createdAt,url:re.url})):c,w=v==null?void 0:v.find(re=>/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(re.name)),C=e&&w?w.url||`/api/tasks/${e.id}/files/${encodeURIComponent(w.name)}`:null,y=Kd.default.useRef(null),[k,z]=Kd.default.useState(null),{userPart:N,consolePart:U}=Zv(t);return(0,Y.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,Y.jsxs)("div",{children:[(0,Y.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:"Description"}),(0,Y.jsx)(fl,{value:t,previewValue:U?N:void 0,onChange:a,onBlur:s,showPreview:r,setShowPreview:o,previewId:"dp-desc-preview",textareaId:"dp-desc",placeholder:"Description (markdown)\\u2026",previewMinHeight:80,previewMaxHeight:220,baseRows:6,maxRows:12,autoFocus:!0,textareaRef:y,afterTextarea:i&&d!==void 0&&t!==d?(0,Y.jsx)("button",{type:"button",onMouseDown:re=>{re.preventDefault(),i()},title:"Discard changes and restore saved description",style:{marginTop:4,display:"flex",alignItems:"center",gap:4,fontSize:11,color:"var(--p-text-g)",background:"none",border:"1px solid var(--p-border-t)",borderRadius:6,padding:"3px 8px",cursor:"pointer",transition:"color .12s, border-color .12s"},onMouseEnter:re=>{re.currentTarget.style.color="var(--p-amber-300)",re.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:re=>{re.currentTarget.style.color="var(--p-text-g)",re.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9 Discard changes"}):void 0})]}),U&&(0,Y.jsx)(Jv,{logs:U}),e&&w&&C&&(0,Y.jsxs)("div",{children:[(0,Y.jsx)("div",{className:"dp-meta-label",children:"Screenshot"}),(0,Y.jsxs)("div",{id:"dp-screenshot-preview",style:{border:"1px solid color-mix(in srgb, var(--p-border-t) 70%, transparent)",borderRadius:10,overflow:"hidden",background:"var(--p-card)"},children:[(0,Y.jsx)("button",{onClick:()=>g(w.name,C),style:{width:"100%",height:112,border:"none",padding:0,background:"linear-gradient(135deg, var(--p-border), var(--p-bg))",cursor:"pointer",display:"block",overflow:"hidden"},title:"Preview screenshot",children:(0,Y.jsx)("img",{src:C,alt:"Task screenshot",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderTop:"1px solid var(--p-border)",background:"var(--p-surface)"},children:[(0,Y.jsx)("span",{style:{fontSize:10,color:"var(--p-text-f)",flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:w.addedAt?`Captured ${Tt(w.addedAt)}`:"Screenshot attached"}),(0,Y.jsx)("button",{onClick:()=>g(w.name,C),style:{fontSize:10,color:"var(--p-text-m)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Preview screenshot",children:"Preview"}),(0,Y.jsx)("button",{onClick:()=>z(w.name),style:{fontSize:10,color:"var(--p-red)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Remove screenshot",children:"Remove"})]})]})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("div",{className:"dp-meta-label",children:"Tags"}),(0,Y.jsx)(Vd,{tags:p??(e==null?void 0:e.tags)??[],allTags:H,disabled:!e&&!u,onChange:re=>{u?u(re):e&&L(e.id,{tags:re})}})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("div",{className:"dp-meta-label",children:"Priority"}),(0,Y.jsxs)("select",{id:"dp-priority",className:"dp-input",value:n,onChange:re=>{let ce=re.target.value;l(ce),f==null||f(ce)},style:{padding:"5px 8px",fontSize:12,cursor:"pointer",width:"auto"},children:[(0,Y.jsx)("option",{value:"",children:"\\u2014"}),(0,Y.jsx)("option",{value:"Critical",children:"Critical"}),(0,Y.jsx)("option",{value:"High",children:"High"}),(0,Y.jsx)("option",{value:"Medium",children:"Medium"}),(0,Y.jsx)("option",{value:"Low",children:"Low"})]})]}),e&&(0,Y.jsxs)("div",{id:"dp-metadata",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,Y.jsx)(Gd,{label:"Created",id:"dp-created",children:e.createdAt?Tt(e.createdAt):"\\u2014"}),(0,Y.jsx)(Gd,{label:"ID",id:"dp-id",children:(0,Y.jsx)("span",{style:{fontFamily:"monospace"},children:e.id})}),(0,Y.jsx)(Gd,{label:"Author",id:"dp-author",children:e.authorName??e.author??"\\u2014"}),(e.commit||((_=e.commits)==null?void 0:_.length))&&(0,Y.jsx)(Qv,{task:e,githubUrl:m}),e.branchName&&(0,Y.jsx)(Yv,{branchName:e.branchName}),e.annotatedElementText&&(0,Y.jsxs)("div",{id:"dp-annotated-text",style:{gridColumn:"1 / -1",background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,Y.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Annotated element text"}),(0,Y.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",fontStyle:"italic",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e.annotatedElementText})]})]}),(0,Y.jsx)(Sa,{open:k!==null,message:"Remove this screenshot? This action cannot be undone.",confirmLabel:"Remove",onConfirm:()=>{k&&x(k),z(null)},onCancel:()=>z(null)})]})}function Gd({label:e,id:t,children:a}){return(0,Y.jsxs)("div",{id:t,style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,Y.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,Y.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",borderBottom:"1px solid var(--p-border)",paddingBottom:4,display:"flex",alignItems:"center",minHeight:16},children:a})]})}function Qv({task:e,githubUrl:t}){var n;let a=(n=e.commits)!=null&&n.length?e.commits:[{sha:e.commit,message:e.title??"",timestamp:e.createdAt??""}],r=a[a.length-1],o=a.map(l=>`${l.sha.slice(0,8)} ${l.timestamp?new Date(l.timestamp).toLocaleString():""} ${l.message.slice(0,60)}`).join(`\n`);return(0,Y.jsxs)("div",{id:"dp-commit",style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px",cursor:"default"},title:a.length>1?`All commits:\n${o}`:`${r.sha}\n${r.message}`,children:[(0,Y.jsxs)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:["Commit",a.length>1?"s":""]}),(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[t&&e.commitPushed!==!1?(0,Y.jsxs)("a",{href:`${t}/commit/${r.sha}`,target:"_blank",rel:"noopener noreferrer",style:{fontSize:10,color:"var(--p-blue-300)",fontFamily:"monospace",textDecoration:"none"},title:"Open diff on GitHub",onClick:l=>l.stopPropagation(),children:[r.sha.slice(0,8)," \\u2197"]}):(0,Y.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-f)",fontFamily:"monospace"},title:e.commitPushed===!1?"Commit not pushed to remote yet":void 0,children:[r.sha.slice(0,8),e.commitPushed===!1?" \\u23F3":""]}),a.length>1&&(0,Y.jsxs)("span",{style:{fontSize:9,color:"var(--p-blue)",background:"color-mix(in srgb, var(--p-blue) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 25%, transparent)",borderRadius:10,padding:"0 5px",fontWeight:600},children:["+",a.length-1]})]})]})}function Yv({branchName:e}){return(0,Y.jsxs)("div",{id:"dp-branch",style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px",cursor:"default"},title:`Branch: ${e}`,children:[(0,Y.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Branch"}),(0,Y.jsxs)("div",{style:{fontSize:10,color:"var(--p-green-300)",fontFamily:"monospace"},children:["\\u2387 ",e]})]})}function Zv(e){let a=e.indexOf(`\n---\n**Console logs**`);return a===-1?{userPart:e,consolePart:null}:{userPart:e.slice(0,a).trim(),consolePart:e.slice(a+1).trim()}}function Jv({logs:e}){let t=e.replace(/^---\\s*\\n/,"").split(`\n`).filter(a=>a.trim());return(0,Y.jsxs)("div",{id:"dp-console-logs",style:{borderRadius:8,border:"1px solid color-mix(in srgb, var(--p-red) 30%, var(--p-border))",background:"color-mix(in srgb, var(--p-red) 4%, var(--p-card))",overflow:"hidden"},children:[(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 10px",borderBottom:"1px solid color-mix(in srgb, var(--p-red) 20%, var(--p-border))",background:"color-mix(in srgb, var(--p-red) 8%, var(--p-card))"},children:[(0,Y.jsx)("span",{style:{fontSize:10,fontWeight:700,color:"color-mix(in srgb, var(--p-red) 80%, var(--p-text-sub))",letterSpacing:"0.05em",textTransform:"uppercase"},children:"Console Logs"}),(0,Y.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",marginLeft:"auto"},children:"captured at submission"})]}),(0,Y.jsxs)("div",{style:{padding:"6px 10px",maxHeight:200,overflowY:"auto",display:"flex",flexDirection:"column",gap:3},children:[t.map((a,r)=>{let o=a.includes("\\u{1F534}"),n=a.includes("\\u{1F7E1}"),l=a.replace(/^[-*]\\s*/,"");return(0,Y.jsx)("div",{style:{fontFamily:"Menlo, monospace",fontSize:10,lineHeight:1.5,color:o?"var(--p-red)":n?"var(--p-amber-300)":"var(--p-text-f)",wordBreak:"break-all"},children:l},r)}),t.length===0&&(0,Y.jsx)("div",{style:{fontSize:10,color:"var(--p-text-g)",fontStyle:"italic"},children:"No log entries captured."})]})]})}var Ko=F(j(),1);function Xd({commentInput:e,setCommentInput:t,commentSubmitting:a,onSubmit:r,baseRows:o=4}){return(0,Ko.jsx)("div",{id:"dp-comment-input-area",children:(0,Ko.jsx)(fl,{value:e,onChange:t,showPreview:!1,setShowPreview:()=>{},previewId:"dp-comment-tab-edit",textareaId:"dp-comment-input",placeholder:"Add a comment\\u2026 (markdown)",previewEmptyText:"Leave a comment (markdown)\\u2026",previewMinHeight:o<=2?36:54,previewMaxHeight:140,baseRows:o,maxRows:10,autoFocus:!0,onKeyDown:n=>{n.key==="Enter"&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),r())},afterTextarea:(0,Ko.jsx)("button",{id:"dp-comment-submit",disabled:a,onMouseDown:n=>{n.preventDefault(),r()},title:"Send (Ctrl+Enter)",style:{position:"absolute",bottom:16,right:8,width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--p-blue)",border:"none",borderRadius:6,cursor:"pointer",color:"var(--p-white)",transition:"background .15s"},children:(0,Ko.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"},children:(0,Ko.jsx)("path",{d:"M2 8L14 2L10 8L14 14L2 8Z",fill:"currentColor"})})})})})}var Ee=F(Oe(),1),Qd=F(_r(),1);var P=F(j(),1),cl=[{id:"opencode/hy3-preview-free",label:"Hy3 Preview (Free)",provider:"OpenCode",recommended:!0},{id:"opencode/minimax-m2.5-free",label:"MiniMax M2.5 (Free)",provider:"OpenCode",recommended:!0},{id:"opencode/nemotron-3-super-free",label:"Nemotron 3 Super (Free)",provider:"OpenCode",recommended:!0},{id:"opencode-go/deepseek-v4-flash",label:"DeepSeek V4 Flash",provider:"OpenCode Go",recommended:!0},{id:"opencode-go/qwen3.5-plus",label:"Qwen 3.5 Plus",provider:"OpenCode Go",recommended:!0},{id:"opencode-go/qwen3.6-plus",label:"Qwen 3.6 Plus",provider:"OpenCode Go"},{id:"opencode-go/minimax-m2.5",label:"MiniMax M2.5",provider:"OpenCode Go"},{id:"opencode-go/minimax-m2.7",label:"MiniMax M2.7",provider:"OpenCode Go"},{id:"opencode-go/kimi-k2.5",label:"Kimi K2.5",provider:"OpenCode Go"},{id:"opencode-go/glm-5",label:"GLM 5",provider:"OpenCode Go"},{id:"github-copilot/gpt-4o",label:"GPT-4o (Copilot)",provider:"GitHub Copilot",recommended:!0},{id:"github-copilot/gpt-4.1",label:"GPT-4.1 (Copilot)",provider:"GitHub Copilot"},{id:"github-copilot/claude-haiku-4.5",label:"Claude Haiku 4.5 (Copilot)",provider:"GitHub Copilot"},{id:"github-copilot/gpt-5-mini",label:"GPT-5 Mini (Copilot)",provider:"GitHub Copilot"},{id:"openrouter/google/gemma-3-12b-it:free",label:"Gemma 3 12B (Free)",provider:"OpenRouter"},{id:"openrouter/anthropic/claude-3.5-haiku",label:"Claude 3.5 Haiku",provider:"OpenRouter"},{id:"openrouter/anthropic/claude-3.7-sonnet",label:"Claude 3.7 Sonnet",provider:"OpenRouter"},{id:"anthropic/claude-sonnet-4-20250514",label:"Claude Sonnet 4",provider:"Anthropic"},{id:"anthropic/claude-opus-4-20250514",label:"Claude Opus 4",provider:"Anthropic"},{id:"openai/gpt-4o",label:"GPT-4o",provider:"OpenAI"},{id:"openai/gpt-4-turbo",label:"GPT-4 Turbo",provider:"OpenAI"},{id:"google/gemini-2-5-pro",label:"Gemini 2.5 Pro",provider:"Google"},{id:"google/gemini-2-0-flash-exp",label:"Gemini 2.0 Flash",provider:"Google"},{id:"ollama/llama-3-1-8b",label:"Llama 3.1 8B",provider:"Ollama"},{id:"ollama/qwen2-5-coder",label:"Qwen 2.5 Coder",provider:"Ollama"}];function wg(e){if(!e)return"";let t=Date.now()-new Date(e).getTime(),a=Math.floor(t/6e4),r=Math.floor(t%6e4/1e3);return`${a}m ${r.toString().padStart(2,"0")}s`}function ri({value:e,onChange:t,disabled:a=!1,models:r=cl}){let[o,n]=Ee.default.useState(!1),[l,s]=Ee.default.useState(""),i=Ee.default.useRef(null),d=Ee.default.useRef(null),f=r.length>0?r:cl,m=f.find(c=>c.id===e),g=Ee.default.useMemo(()=>{if(!l)return f;let c=l.toLowerCase();return f.filter(v=>v.label.toLowerCase().includes(c)||v.provider.toLowerCase().includes(c)||v.id.toLowerCase().includes(c))},[l,f]),L=Ee.default.useMemo(()=>{let c={};for(let v of g)c[v.provider]||(c[v.provider]=[]),c[v.provider].push(v);return c},[g,f]),[x,I]=Ee.default.useState(null);function H(){a||(n(c=>!c),requestAnimationFrame(()=>{if(i.current){let c=i.current.getBoundingClientRect();I(c)}}))}function p(){n(!1),s(""),I(null)}Ee.default.useEffect(()=>{if(!o)return;function c(v){let w=v.target;i.current&&i.current.contains(w)||d.current&&d.current.contains(w)||p()}return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[o]),Ee.default.useEffect(()=>{if(!o)return;function c(v){v.key==="Escape"&&p()}return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[o]);let u=o&&x?(0,Qd.createPortal)((0,P.jsxs)("div",{ref:d,"data-model-picker-dropdown":!0,style:{position:"fixed",left:x.left,bottom:window.innerHeight-x.top+4,width:x.width,background:"var(--p-surface)",border:"1px solid var(--p-border)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",zIndex:1e5,maxHeight:320,overflowY:"auto",display:"flex",flexDirection:"column"},children:[(0,P.jsx)("div",{style:{padding:8,borderBottom:"1px solid var(--p-border)",flexShrink:0},children:(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 8px",background:"var(--p-bg-2)",borderRadius:6,border:"1px solid var(--p-border)"},children:[(0,P.jsx)(jr,{style:{width:12,height:12,color:"var(--p-text-g)",flexShrink:0}}),(0,P.jsx)("input",{type:"text",placeholder:"Filter models...",value:l,onChange:c=>s(c.target.value),autoFocus:!0,style:{flex:1,border:"none",background:"transparent",fontSize:12,color:"var(--p-text)",outline:"none"}})]})}),(0,P.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:4},children:[Object.entries(L).map(([c,v])=>(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{style:{padding:"6px 10px 4px",fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:c}),v.map(w=>(0,P.jsxs)("button",{type:"button",onClick:()=>{t(w.id),p()},style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:5,border:"none",background:e===w.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent",color:e===w.id?"var(--p-purple-300)":"var(--p-text-m)",fontSize:12,cursor:"pointer",textAlign:"left",transition:"background .1s"},onMouseEnter:C=>{C.currentTarget.style.background=e===w.id?"color-mix(in srgb, var(--p-purple) 15%, transparent)":"var(--p-hover)"},onMouseLeave:C=>{C.currentTarget.style.background=e===w.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent"},children:[(0,P.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:w.label}),w.recommended&&(0,P.jsx)("span",{style:{fontSize:8,fontWeight:600,padding:"1px 4px",borderRadius:3,background:"var(--p-purple)",color:"#fff",flexShrink:0},children:"Rec"})]},w.id))]},c)),g.length===0&&(0,P.jsxs)("div",{style:{padding:16,textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:[\'No models match "\',l,\'"\']})]})]}),document.body):null;return(0,P.jsxs)("div",{ref:i,style:{position:"relative"},children:[(0,P.jsxs)("button",{type:"button",onClick:H,disabled:a,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 12px",borderRadius:7,border:`1px solid ${o?"var(--p-purple-300)":"var(--p-border)"}`,background:"var(--p-bg-2)",color:"var(--p-text-m)",fontSize:12,cursor:a?"not-allowed":"pointer",transition:"all .12s",opacity:a?.6:1},onMouseEnter:c=>{a||(c.currentTarget.style.borderColor="var(--p-purple-300)")},onMouseLeave:c=>{a||(c.currentTarget.style.borderColor=o?"var(--p-purple-300)":"var(--p-border)")},children:[(0,P.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[(0,P.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(m==null?void 0:m.label)||"Select model"}),(m==null?void 0:m.recommended)&&(0,P.jsx)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 5px",borderRadius:3,background:"var(--p-purple)",color:"#fff",flexShrink:0},children:"Recommended"})]}),(0,P.jsx)(ya,{style:{width:14,height:14,color:"var(--p-text-g)",flexShrink:0,transition:"transform .15s",transform:o?"rotate(180deg)":void 0}})]}),u]})}function Yd({value:e,onChange:t,disabled:a=!1,agents:r}){var m,g,L;let[o,n]=Ee.default.useState(!1),l=Ee.default.useRef(null),s=Ee.default.useRef(null),i=r.find(x=>x.id===e);function d(){a||n(x=>!x)}function f(){n(!1)}return Ee.default.useEffect(()=>{if(!o)return;function x(I){let H=I.target;l.current&&l.current.contains(H)||s.current&&s.current.contains(H)||f()}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]),(0,P.jsxs)("div",{ref:l,style:{position:"relative"},children:[(0,P.jsxs)("button",{type:"button",onClick:d,disabled:a,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 12px",borderRadius:7,border:`1px solid ${o?"var(--p-purple-300)":"var(--p-border)"}`,background:"var(--p-bg-2)",color:i?"var(--p-text)":"var(--p-text-m)",fontSize:12,cursor:a?"not-allowed":"pointer",transition:"all .12s",opacity:a?.6:1},children:[(0,P.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[(0,P.jsx)(Kt,{style:{width:14,height:14,flexShrink:0,color:"var(--p-purple-300)"}}),(0,P.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(i==null?void 0:i.name)||"Select agent"}),i&&(0,P.jsx)("span",{style:{fontSize:9,fontWeight:500,padding:"1px 5px",borderRadius:3,background:"var(--p-border)",color:"var(--p-text-g)",flexShrink:0},children:i.scope})]}),(0,P.jsx)(ya,{style:{width:14,height:14,color:"var(--p-text-g)",flexShrink:0,transition:"transform .15s",transform:o?"rotate(180deg)":void 0}})]}),o&&(0,Qd.createPortal)((0,P.jsx)("div",{ref:s,"data-agent-picker-dropdown":!0,style:{position:"fixed",left:((m=l.current)==null?void 0:m.getBoundingClientRect().left)??0,bottom:window.innerHeight-(((g=l.current)==null?void 0:g.getBoundingClientRect().top)??0)+4,width:((L=l.current)==null?void 0:L.getBoundingClientRect().width)??200,background:"var(--p-surface)",border:"1px solid var(--p-border)",borderRadius:8,boxShadow:"var(--p-shadow-lg)",zIndex:1e5,maxHeight:240,overflowY:"auto",display:"flex",flexDirection:"column"},children:r.map(x=>(0,P.jsxs)("button",{type:"button",onClick:()=>{t(x.id),f()},style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderRadius:5,border:"none",background:e===x.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent",color:e===x.id?"var(--p-purple-300)":"var(--p-text-m)",fontSize:12,cursor:"pointer",textAlign:"left",transition:"background .1s"},onMouseEnter:I=>{I.currentTarget.style.background=e===x.id?"color-mix(in srgb, var(--p-purple) 15%, transparent)":"var(--p-hover)"},onMouseLeave:I=>{I.currentTarget.style.background=e===x.id?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"transparent"},children:[(0,P.jsx)(Kt,{style:{width:14,height:14,flexShrink:0,color:"var(--p-purple-300)"}}),(0,P.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.name}),(0,P.jsx)("span",{style:{fontSize:9,fontWeight:500,padding:"1px 4px",borderRadius:3,background:"var(--p-border)",color:"var(--p-text-g)",flexShrink:0},children:x.scope})]},x.id))}),document.body)]})}function ey({status:e}){let t={idle:"var(--p-text-g)",queued:"var(--p-amber)",running:"var(--p-blue)",done:"var(--p-green)",failed:"var(--p-red)"},a={idle:"Idle",queued:"Queued",running:"Running",done:"Completed",failed:"Failed"},[r,o]=Ee.default.useState(!0);return Ee.default.useEffect(()=>{if(e!=="running")return;let n=setInterval(()=>o(l=>!l),800);return()=>{clearInterval(n),o(!0)}},[e]),(0,P.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,color:t[e]},children:[(0,P.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:t[e],opacity:e==="running"?r?1:.3:1,transition:"opacity 0.3s ease"}}),a[e]]})}function ty(e){var a;let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let r=JSON.parse(t);if(r.type==="text"&&typeof r.part=="object"&&r.part){let o=r.part,n=typeof o.text=="string"?o.text:"";return n?(0,P.jsx)("span",{style:{color:"#e2e8f0"},children:n}):null}if(r.type==="tool_use"&&typeof r.part=="object"&&r.part){let o=r.part;if(o.type==="tool"){let n=typeof o.tool=="string"?o.tool:"tool",l=typeof o.state=="object"&&o.state?o.state:{},s=typeof l.input=="object"&&l.input?l.input:{},i=l.output??((a=l.metadata)==null?void 0:a.output),d=l.error,f=typeof l.status=="string"?l.status:"";return(0,P.jsxs)("div",{style:{color:"#94a3b8"},children:[(0,P.jsxs)("div",{children:[(0,P.jsxs)("span",{style:{color:"#60a5fa"},children:["\\u2192 ",n]}),typeof s.description=="string"&&s.description&&(0,P.jsxs)("span",{children:[": ",s.description]}),typeof s.command=="string"&&s.command&&!s.description&&(0,P.jsxs)("span",{children:[": ",s.command]}),typeof s.filePath=="string"&&s.filePath&&(0,P.jsxs)("span",{children:[": ",s.filePath]}),typeof s.url=="string"&&s.url&&(0,P.jsxs)("span",{children:[": ",s.url]})]}),d!==void 0&&(0,P.jsx)("div",{style:{marginLeft:12,color:"#ef4444",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:9},children:String(d).slice(0,2e3)}),i!==void 0&&d===void 0&&(0,P.jsx)("div",{style:{marginLeft:12,color:f==="error"?"#ef4444":"#22c55e",whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:9},children:String(i).slice(0,2e3)})]})}}if(r.type==="step_start"||r.type==="step_finish")return null;if(r.type==="error"){let o=typeof r.message=="string"?r.message:JSON.stringify(r);return(0,P.jsxs)("span",{style:{color:"#ef4444"},children:["Error: ",o]})}return(0,P.jsxs)("span",{style:{color:"#64748b",fontSize:9},children:["[",String(r.type),"]"]})}catch{}return t.startsWith("opencode run")?(0,P.jsxs)("span",{style:{color:"#64748b",fontSize:9},children:["$ ",t.split(`\n`)[0]]}):t.startsWith("\\u2713")||t.startsWith("\\u2717")||t.startsWith("\\u25B6")?(0,P.jsx)("span",{children:t}):(0,P.jsx)("span",{style:{color:"#94a3b8"},children:t})}function ay({logs:e,status:t}){let a=Ee.default.useRef(null),r=e.join(""),o=Ee.default.useMemo(()=>r.split(`\n`).filter(n=>n.trim().length>0),[r]);return Ee.default.useEffect(()=>{a.current&&t==="running"&&(a.current.scrollTop=a.current.scrollHeight)},[o.length,t]),(0,P.jsxs)("div",{ref:a,style:{background:"#0a0c10",border:"1px solid var(--p-border)",borderRadius:7,padding:"10px 12px",fontFamily:"\'SF Mono\', \'Fira Code\', monospace",fontSize:10,lineHeight:1.65,color:"#a3e635",maxHeight:200,overflowY:"auto"},children:[o.map((n,l)=>{let s=ty(n);return s===null?null:(0,P.jsx)("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s},l)}).filter(Boolean),t==="running"&&(0,P.jsx)("span",{style:{color:"#a3e635"},children:"\\u258C"})]})}function Zd({task:e,run:t,onRun:a,onStop:r,onDequeue:o,models:n,defaultModel:l,defaultAgent:s,onModelChange:i,agents:d,onAgentChange:f,cliAvailable:m=!0}){var z,N,U;let g=n&&n.length>0?n:cl,[L,x]=Ee.default.useState(e.model??l??((z=g[0])==null?void 0:z.id)),[I,H]=Ee.default.useState(e.agent??s??((N=d==null?void 0:d[0])==null?void 0:N.id)??"");function p(_){x(_),i==null||i(_)}function u(_){H(_),f==null||f(_)}function c(){a(e.id,L,I||void 0)}Ee.default.useEffect(()=>{i==null||i(L)},[]),Ee.default.useEffect(()=>{I&&(f==null||f(I))},[]),Ee.default.useEffect(()=>{e.model&&e.model!==L&&x(e.model),e.agent&&e.agent!==I&&H(e.agent)},[e.model,e.agent]),Ee.default.useEffect(()=>{!I&&s&&H(s)},[s]);let[v,w]=Ee.default.useState("");Ee.default.useEffect(()=>{if((t==null?void 0:t.status)!=="running")return;let _=setInterval(()=>w(wg(t.startedAt)),1e3);return w(wg(t.startedAt)),()=>clearInterval(_)},[t==null?void 0:t.status,t==null?void 0:t.startedAt]);let C=(t==null?void 0:t.status)??"idle",y=(t==null?void 0:t.worktree)??`wt/task-${e.id.slice(0,8)}`,k=(t==null?void 0:t.branch)??`agent/task-${e.id.slice(0,8)}`;return(0,P.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,P.jsx)(ey,{status:C}),C==="running"&&v&&(0,P.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-g)",display:"inline-flex",alignItems:"center",gap:4},children:[(0,P.jsx)(cr,{style:{width:10,height:10}}),v]}),C==="queued"&&(0,P.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:"Waiting for current run to finish\\u2026"})]}),C==="idle"&&!m&&(0,P.jsxs)("div",{style:{borderRadius:8,padding:12,fontSize:12,lineHeight:1.6,background:"color-mix(in srgb, var(--p-red) 6%, transparent)",border:"1px solid color-mix(in srgb, var(--p-red) 25%, transparent)",color:"var(--p-red-300)"},children:[(0,P.jsx)("strong",{children:"Local CLI not connected."})," Agent runs require the local CLI server to be running. Start it with ",(0,P.jsx)("code",{style:{background:"rgba(0,0,0,0.3)",padding:"1px 5px",borderRadius:4},children:"vibeflow serve"})," and refresh this page."]}),C==="idle"&&m&&(0,P.jsxs)("div",{style:{borderRadius:8,padding:12,fontSize:12,lineHeight:1.6,background:"color-mix(in srgb, var(--p-purple) 6%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 25%, transparent)",color:"var(--p-purple-300)"},children:[(0,P.jsx)("strong",{children:"Ready to run."})," The agent will create an isolated worktree, read the task description, and implement a solution. When done, you\'ll review the diff and merge."]}),C==="queued"&&(0,P.jsxs)("div",{style:{borderRadius:8,padding:12,fontSize:12,lineHeight:1.6,background:"color-mix(in srgb, var(--p-amber) 6%, transparent)",border:"1px solid color-mix(in srgb, var(--p-amber) 25%, transparent)",color:"var(--p-amber-300)"},children:[(0,P.jsx)("strong",{children:"\\u23F3 Queued"})," \\u2014 another task is currently running. This task will start automatically when the queue is free."]}),(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:6},children:"Model"}),(0,P.jsx)(ri,{value:L,onChange:p,disabled:C==="running"||C==="queued",models:g})]}),d&&d.length>0&&(0,P.jsxs)("div",{children:[(0,P.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:6},children:"Agent"}),(0,P.jsx)(Yd,{value:I,onChange:u,disabled:C==="running"||C==="queued",agents:d})]}),(0,P.jsxs)("div",{style:{border:"1px solid var(--p-border)",borderRadius:8,padding:10,background:"var(--p-bg-2)",display:"flex",flexDirection:"column",gap:6},children:[(0,P.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Worktree"}),(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--p-text-m)"},children:[(0,P.jsx)(Qn,{style:{width:10,height:10,color:"var(--p-text-g)",flexShrink:0}}),(0,P.jsx)("span",{style:{fontFamily:"monospace",fontSize:10},children:y})]}),(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--p-text-m)"},children:[(0,P.jsx)(Yn,{style:{width:10,height:10,color:"var(--p-text-g)",flexShrink:0}}),(0,P.jsx)("span",{style:{fontFamily:"monospace",fontSize:10},children:k})]})]}),t&&t.logs.length>0&&(0,P.jsxs)("div",{children:[(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6},children:[(0,P.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--p-text-g)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Live Output"}),C==="running"&&(0,P.jsxs)("span",{style:{fontSize:10,color:"var(--p-blue-300)",display:"flex",alignItems:"center",gap:4},children:[(0,P.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--p-blue)",animation:"pulse 1s ease-in-out infinite"}}),"Streaming..."]})]}),(0,P.jsx)(ay,{logs:t.logs,status:C})]}),e.agent&&!t&&(((U=e.commits)==null?void 0:U.length)??0)>0&&(0,P.jsxs)("div",{style:{fontSize:11,color:"var(--p-text-g)"},children:["Last agent: ",(0,P.jsx)("span",{style:{color:"var(--p-purple-300)"},children:e.agent}),e.model&&(0,P.jsxs)(P.Fragment,{children:[" \\xB7 model ",(0,P.jsx)("span",{style:{color:"var(--p-purple-300)"},children:e.model})]})]}),t&&(t.status==="done"||t.status==="failed")&&(0,P.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:10,display:"flex",flexWrap:"wrap",gap:"10px 16px",fontSize:10,color:"var(--p-text-g)"},children:[t.durationMs!=null&&(0,P.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,P.jsx)(cr,{style:{width:10,height:10}}),ry(t.durationMs)]}),t.totalTokens!=null&&t.totalTokens>0&&(0,P.jsxs)("span",{title:`${t.inputTokens??0} input \\xB7 ${t.outputTokens??0} output${t.reasoningTokens?` \\xB7 ${t.reasoningTokens} reasoning`:""}`,children:[oy(t.totalTokens)," tokens"]}),t.cost!=null&&t.cost>0&&(0,P.jsxs)("span",{style:{color:"var(--p-green)"},children:["$",t.cost.toFixed(4)]})]})]})}function ry(e){let t=Math.floor(e/6e4),a=Math.floor(e%6e4/1e3);return t>0?`${t}m ${a.toString().padStart(2,"0")}s`:`${a}s`}function oy(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:`${e}`}var A=F(j(),1),ny="vibeflow-paste-hint-dismissed";function ly({storageKey:e=ny}){let[t,a]=Z.default.useState(()=>{try{return!localStorage.getItem(e)}catch{return!0}});if(!t)return null;function r(){try{localStorage.setItem(e,"1")}catch{}a(!1)}return(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",margin:"0 0 6px",borderRadius:6,background:"rgba(37,99,235,0.08)",border:"1px solid rgba(37,99,235,0.18)",fontSize:11,color:"var(--p-blue-300)",flexShrink:0},children:[(0,A.jsxs)("span",{style:{flex:1,lineHeight:1.4},children:["\\u{1F4A1} ",(0,A.jsx)("strong",{children:"Tip:"})," Paste screenshots or files anywhere in this panel \\u2014 they attach automatically."]}),(0,A.jsx)("button",{onClick:r,title:"Dismiss",style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",padding:2,color:"var(--p-blue-300)",opacity:.7,display:"flex",alignItems:"center"},onMouseEnter:o=>{o.currentTarget.style.opacity="1"},onMouseLeave:o=>{o.currentTarget.style.opacity="0.7"},children:(0,A.jsx)(Xe,{style:{width:12,height:12}})})]})}var sy=[{id:"backlog",label:"backlog"},{id:"todo",label:"todo"},{id:"in-progress",label:"in-progress"},{id:"review",label:"review"},{id:"done",label:"done"}],iy=5*1024*1024;function Jd(e,t=.8){return new Promise((a,r)=>{let o=new Image,n=URL.createObjectURL(e);o.onload=()=>{let l=document.createElement("canvas");l.width=o.naturalWidth,l.height=o.naturalHeight;let s=l.getContext("2d");if(!s){URL.revokeObjectURL(n),r(new Error("canvas unavailable"));return}s.drawImage(o,0,0),URL.revokeObjectURL(n),l.toBlob(i=>{i?a(i):r(new Error("canvas.toBlob failed"))},"image/jpeg",t)},o.onerror=()=>{URL.revokeObjectURL(n),r(new Error("image load failed"))},o.src=n})}function ef({open:e,task:t,tab:a,addColumnId:r="todo",gitUserName:o="You",githubUrl:n,baseUrl:l,isResizing:s,api:i,onClose:d,onSave:f,onCreate:m,onDelete:g,onPatch:L,onFilePreview:x,onActivityChange:I,externalLocalChanges:H=[],showLockIndicator:p=!0,lockedByUser:u,onGoBack:c,navBackLabel:v,commentVersion:w,allTasks:C=[],agentRun:y,onRunAgent:k,onStopAgent:z,onDequeueAgent:N,models:U,defaultModel:_,perTypeModels:re,defaultModelBug:ce,defaultModelResearch:Se,defaultModelTask:J,agents:be,defaultAgent:Te,experimentalAgents:ve,cliBaseUrl:W,createBranch:D}){let b=!t,B=t?nl(t.type):nl("Task"),te=Z.default.useRef(null),[Ie,Be]=Z.default.useState([]),We=Z.default.useRef(!1),oe=Z.default.useRef(""),Pe=Z.default.useRef(""),Je=Z.default.useMemo(()=>{let S=new Set;for(let V of C)for(let ee of V.tags??[])S.add(ee);return[...S].sort()},[C]),[Me,Ce]=Z.default.useState(a),[Ke,ye]=Z.default.useState(""),[De,at]=Z.default.useState(""),[Ot,zt]=Z.default.useState(r),[Yt,Pt]=Z.default.useState("Task"),[Na,Ua]=Z.default.useState(""),[ml,ao]=Z.default.useState(!1),[si,jo]=Z.default.useState(!1),[Xo,Ia]=Z.default.useState(!1),[St,Zt]=Z.default.useState(""),[gl,Sr]=Z.default.useState(!1),Ca=Z.default.useRef(null),hl=U&&U.length>0?U[0].id:"",Ir=Z.default.useMemo(()=>{if(re&&(t!=null&&t.type)){if(t.type==="Bug"&&ce)return ce;if(t.type==="Research"&&Se)return Se;if(t.type==="Task"&&J)return J}return _??hl},[re,t==null?void 0:t.type,_,ce,Se,J,hl]),[ro,oo]=Z.default.useState((t==null?void 0:t.model)??Ir),[Cr,ca]=Z.default.useState((t==null?void 0:t.agent)??Te??"");Z.default.useEffect(()=>{!ro&&Ir&&oo(Ir)},[Ir,ro]),Z.default.useEffect(()=>{!Cr&&Te&&ca(Te)},[Te,Cr]);let ii=Z.default.useCallback(S=>{oo(S),t&&S!==t.model&&L(t.id,{model:S})},[t,L]),ui=Z.default.useCallback(S=>{ca(S),t&&S!==t.agent&&L(t.id,{agent:S})},[t,L]),[di,Ha]=Z.default.useState([]),[fi,xl]=Z.default.useState(!1),[ci,no]=Z.default.useState(null),[qa,lo]=Z.default.useState(""),[vl,yl]=Z.default.useState(!1),[so,Qo]=Z.default.useState([]),[Yo,h]=Z.default.useState(!1),[T,E]=Z.default.useState(null),[X,ue]=Z.default.useState(0),fe=Z.default.useRef(0),[O,ae]=Z.default.useState(0),[xe,le]=Z.default.useState(null),[me,R]=Z.default.useState([]),[Ue,Rt]=Z.default.useState([]),nt=Z.default.useRef(null),Nt=Z.default.useRef(()=>{}),wr=Z.default.useRef(""),kr=Z.default.useRef(!1);Z.default.useEffect(()=>{wr.current=qa},[qa]),Z.default.useEffect(()=>{kr.current=Xo},[Xo]),Z.default.useEffect(()=>{We.current=s??!1},[s]),Z.default.useEffect(()=>{e||I==null||I(null,"viewing")},[e]),Z.default.useEffect(()=>{if(!e||!t)return;Ke!==oe.current||De!==Pe.current?I==null||I(t.id,"locked"):I==null||I(t.id,"viewing")},[Ke,De,e,t==null?void 0:t.id]),Z.default.useEffect(()=>{if(!e)return;function S(V){var ee,Ae,we,Jt,ea,Il,io,Cl;if(!We.current&&!((Ae=(ee=V.target)==null?void 0:ee.closest)!=null&&Ae.call(ee,"[data-task-ref-suggest]"))&&!((Jt=(we=V.target)==null?void 0:we.closest)!=null&&Jt.call(we,".modal-backdrop"))&&!((Il=(ea=V.target)==null?void 0:ea.closest)!=null&&Il.call(ea,"[data-model-picker-dropdown]"))&&!((Cl=(io=V.target)==null?void 0:io.closest)!=null&&Cl.call(io,"[data-agent-picker-dropdown]"))&&te.current&&!te.current.contains(V.target)){if(kr.current)return;if(wr.current.trim().length>0){Nt.current(),Ia(!0);return}Nt.current(),d()}}return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[e,d]),Z.default.useEffect(()=>{if(!e)return;function S(V){if(V.key==="Escape"){if(kr.current){Ia(!1),V.stopPropagation();return}if(wr.current.trim().length>0){V.stopPropagation(),Nt.current(),Ia(!0);return}}}return document.addEventListener("keydown",S,{capture:!0}),()=>document.removeEventListener("keydown",S,{capture:!0})},[e]),Z.default.useEffect(()=>{if(e){if(Ce(a),ao(!!t),lo(""),Ha([]),Qo([]),ue(0),ae(0),R([]),Rt([]),oo((t==null?void 0:t.model)??Ir),ca((t==null?void 0:t.agent)??""),Zt((t==null?void 0:t.branchName)??""),Sr(!1),Ca.current=null,t){let S=(t.title??"").trim(),V=(t.description??"").trim();ye(S),at(V),zt(t.status),Pt(t.type??"Task"),Ua(t.priority??""),oe.current=S,Pe.current=V,I==null||I(t.id,"viewing")}else ye(""),at(""),zt(r),Pt("Task"),Ua("");t&&(br(t.id),_a(t.id)),setTimeout(()=>{var S;return(S=nt.current)==null?void 0:S.focus()},50)}},[e,t==null?void 0:t.id,a]),Z.default.useEffect(()=>{!e||!t||(Me==="comments"?(Zo(t.id),_a(t.id)):Me==="files"&&_a(t.id))},[Me,e,t==null?void 0:t.id]),Z.default.useEffect(()=>{if(!e||!t||Ke!==oe.current||De!==Pe.current)return;let V=(t.title??"").trim(),ee=(t.description??"").trim();(V!==oe.current||ee!==Pe.current)&&(ye(V),at(ee),oe.current=V,Pe.current=ee),t.status&&t.status!==Ot&&zt(t.status),t.type&&t.type!==Yt&&Pt(t.type),t.priority!==void 0&&t.priority!==Na&&Ua(t.priority??""),t.model&&t.model!==ro&&oo(t.model),t.agent&&t.agent!==Cr&&ca(t.agent);let Ae=t.branchName??"";Ae!==St&&Zt(Ae)},[t==null?void 0:t.title,t==null?void 0:t.description,t==null?void 0:t.status,t==null?void 0:t.type,t==null?void 0:t.priority,t==null?void 0:t.model,t==null?void 0:t.agent,t==null?void 0:t.branchName]),Z.default.useEffect(()=>{!e||!t||w===void 0||(Me==="comments"?Zo(t.id):br(t.id))},[w]);async function br(S){var V,ee;try{let[Ae,we]=await Promise.all([i.getComments(S),i.getFiles(S)]);ue(((V=Ae.comments)==null?void 0:V.length)??0),ae(((ee=we.files)==null?void 0:ee.length)??0)}catch{}}async function Zo(S){var ee;let V=++fe.current;xl(!0),no(null);try{let Ae=await i.getComments(S);if(fe.current!==V)return;Ha(Ae.comments??[]),ue(((ee=Ae.comments)==null?void 0:ee.length)??0)}catch{if(fe.current!==V)return;no("failed")}finally{fe.current===V&&xl(!1)}}async function _a(S){var V;h(!0),E(null);try{let ee=await i.getFiles(S);Qo(ee.files??[]),ae(((V=ee.files)==null?void 0:V.length)??0)}catch{E("failed")}finally{h(!1)}}async function lf(){var S;if(!Ke.trim()){(S=nt.current)==null||S.focus();return}if(!b&&qa.trim()&&await pi(),b){let V=await m({title:Ke.trim(),description:De.trim()||Ke.trim(),status:Ot,type:Yt,priority:Na||void 0,selector:"/",tags:Ue.length>0?Ue:void 0});if(V&&Ie.length>0){for(let ee of Ie)await i.uploadFile(V,ee).catch(()=>null);Be([])}d()}else Ll()}function Ll(){if(!t||b)return;let S=Ke.trim();if(!S)return;let V=oe.current,ee=Pe.current,Ae=S!==V,we=De.trim()!==ee;!Ae&&!we||(Ae&&Sl("title",V,S),we&&Sl("description",ee,De.trim()),L(t.id,{title:S,description:De.trim(),type:Yt,priority:Na||void 0}),oe.current=S,Pe.current=De.trim())}Nt.current=Ll;function Sl(S,V,ee){V!==ee&&R(Ae=>[...Ae,{field:S,from:V,to:ee,actor:o,timestamp:new Date().toISOString()}])}async function pi(){if(!(!t||!qa.trim())){yl(!0);try{await i.addComment(t.id,qa.trim()),lo(""),await Zo(t.id)}finally{yl(!1)}}}async function Bg(S,V){t&&(await i.updateComment(t.id,S.id,V),await Zo(t.id))}async function Og(S){t&&(await i.deleteComment(t.id,S.id),await Zo(t.id))}async function zg(S){if(!t)return;let V=t.id;le(null);for(let ee of Array.from(S.target.files??[])){if(!ee.type.startsWith("image/")&&ee.size>iy){le(`"${ee.name}" exceeds the 5 MB limit and was skipped.`);continue}let Ae;if(ee.type.startsWith("image/")){let we=await Jd(ee),Jt=ee.name.replace(/\\.(png|bmp|gif|webp|tiff?)$/i,".jpg");Ae=new File([we],Jt,{type:"image/jpeg"})}else Ae=ee;await i.uploadFile(V,Ae)}S.target.value="",await _a(V),br(V)}async function Ng(S){if(!t)return;le(null);let V=await Jd(S),Ae=`paste-${new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}.jpg`,we=new File([V],Ae,{type:"image/jpeg"});await i.uploadFile(t.id,we),await _a(t.id),br(t.id)}async function Ug(S){if(!t)return;let V=Array.from(S.items),ee=V.find(we=>we.type.startsWith("image/"));if(ee){let we=ee.getAsFile();we&&await Ng(we);return}let Ae=V.filter(we=>we.kind==="file"&&!we.type.startsWith("image/"));if(Ae.length>0){for(let we of Ae){let Jt=we.getAsFile();Jt&&await i.uploadFile(t.id,Jt)}await _a(t.id),br(t.id);return}}Z.default.useEffect(()=>{if(!e)return;function S(V){if(!V.clipboardData)return;let ee=V.target;if(!((ee.tagName==="TEXTAREA"||ee.tagName==="INPUT"||ee.isContentEditable)&&!Array.from(V.clipboardData.items).some(ea=>ea.kind==="file"))){if(V.preventDefault(),!t){let Jt=Array.from(V.clipboardData.items).find(ea=>ea.type.startsWith("image/"));if(Jt){let ea=Jt.getAsFile();ea&&(async()=>{let Il=await Jd(ea),io=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),Cl=new File([Il],`paste-${io}.jpg`,{type:"image/jpeg"});Be(Vg=>[...Vg,Cl])})()}return}Ug(V.clipboardData)}}return document.addEventListener("paste",S),()=>document.removeEventListener("paste",S)},[e,t==null?void 0:t.id]);async function sf(S){t&&(await i.deleteFile(t.id,S.name),await _a(t.id),br(t.id))}async function Hg(S){if(!t)return;await i.deleteFile(t.id,S);let V=(t.files??[]).filter(ee=>ee.name!==S);L(t.id,{files:V}),await _a(t.id),br(t.id)}function qg(S){if(gl&&S!=="review"&&(Sr(!1),Ca.current=null),zt(S),b||!t)return;if(D&&S==="review"&&!St.trim()){Ca.current={taskId:t.id,patch:{status:S}},Sr(!0);return}let V={status:S};St.trim()&&(V.branchName=St.trim()),L(t.id,V)}function uf(){if(!Ca.current||!t||!St.trim())return;let S={...Ca.current.patch,branchName:St.trim()};L(t.id,S),Sr(!1),Ca.current=null}function df(){Sr(!1),Ca.current=null,t&&zt(t.status)}let _g=S=>S!==Ot?"dp-status-btn":`dp-status-btn active-${S}`;function ff(){if(!kr.current){if(wr.current.trim().length>0){Nt.current(),Ia(!0);return}Nt.current(),d()}}let Wg=e&&t!=null&&(Ke!==oe.current||De!==Pe.current),$g=Z.default.useMemo(()=>{let S=[...H,...me].sort((ee,Ae)=>new Date(ee.timestamp).getTime()-new Date(Ae.timestamp).getTime()),V=[];for(let ee of S)V.some(we=>we.field===ee.field&&we.from.toLowerCase()===ee.from.toLowerCase()&&we.to.toLowerCase()===ee.to.toLowerCase()&&we.actor===ee.actor&&Math.abs(new Date(we.timestamp).getTime()-new Date(ee.timestamp).getTime())<=3e3)||V.push(ee);return V},[H,me]),Wa=!b&&!!u;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("aside",{id:"detail-panel",className:"open",ref:te,children:[Wa&&(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:"rgba(234,88,12,0.12)",border:"1px solid rgba(234,88,12,0.25)",borderRadius:6,margin:"8px 12px 0",fontSize:12,color:"#f97316",fontWeight:500},children:["\\u{1F512} Locked by ",(0,A.jsx)("strong",{children:u})," \\u2014 editing disabled until they finish."]}),(0,A.jsxs)("div",{className:"dp-header",children:[(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[c&&(0,A.jsx)("button",{id:"dp-back",onClick:c,title:v?`Back to: ${v}`:"Go back",style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"1px solid var(--p-border-t)",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s",fontSize:14,lineHeight:1},onMouseOver:S=>{S.currentTarget.style.background="var(--p-border)",S.currentTarget.style.color="var(--p-blue-300)",S.currentTarget.style.borderColor="var(--p-blue)"},onMouseOut:S=>{S.currentTarget.style.background="transparent",S.currentTarget.style.color="var(--p-text-g)",S.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u2190"}),(0,A.jsx)(ti,{id:"dp-type-picker",value:Yt,disabled:Wa,onChange:S=>{!b&&t&&S!==Yt&&Sl("type",Yt,S),Pt(S),!b&&t&&L(t.id,{type:S})}}),(0,A.jsx)("input",{id:"dp-title",ref:nt,className:"dp-input",type:"text",placeholder:"Task title\\u2026",value:Ke,readOnly:Wa,onChange:S=>ye(S.target.value),onKeyDown:S=>{S.key==="Escape"&&(S.stopPropagation(),ff()),S.key==="Enter"&&b&&lf()},style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",borderColor:"transparent",background:"transparent"},onFocus:S=>{S.currentTarget.style.borderColor="var(--p-blue)",S.currentTarget.style.background="var(--p-input)"},onBlur:S=>{S.currentTarget.style.borderColor="transparent",S.currentTarget.style.background="transparent",b||Ll()}}),!b&&Ke!==oe.current&&Ke.trim()!==""&&(0,A.jsx)("button",{type:"button",title:"Discard title changes",onMouseDown:S=>{S.preventDefault(),ye(oe.current)},style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:"1px solid var(--p-border-t)",background:"none",color:"var(--p-text-g)",cursor:"pointer",fontSize:13,lineHeight:1},onMouseEnter:S=>{S.currentTarget.style.color="var(--p-amber-300)",S.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:S=>{S.currentTarget.style.color="var(--p-text-g)",S.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9"}),(0,A.jsx)("button",{id:"dp-close",onClick:ff,style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s",pointerEvents:"auto"},onMouseOver:S=>{S.currentTarget.style.background="var(--p-border)",S.currentTarget.style.color="var(--p-text-m)"},onMouseOut:S=>{S.currentTarget.style.background="transparent",S.currentTarget.style.color="var(--p-text-g)"},children:(0,A.jsx)(Xe,{style:{width:14,height:14}})}),p&&Wg&&t&&(0,A.jsx)("span",{id:"dp-lock-indicator",title:`Locked by ${o} \\u2014 unsaved changes`,style:{display:"inline-flex",alignItems:"center",gap:3,flexShrink:0,borderRadius:999,padding:"2px 7px",fontSize:10,fontWeight:600,border:"1px solid rgba(244,114,182,0.35)",color:"#f9a8d4",background:"rgba(157,23,77,0.28)"},children:"\\u{1F512} Locked"})]}),(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",...Wa?{pointerEvents:"none",opacity:.6}:{}},children:[(0,A.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Status"}),sy.map(S=>(0,A.jsx)("button",{className:_g(S.id),"data-status":S.id,onClick:()=>qg(S.id),children:S.label},S.id))]}),gl&&!Wa&&(0,A.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:8,padding:"8px 10px",borderRadius:8,background:"rgba(139,92,246,0.08)",border:"1px solid rgba(139,92,246,0.2)",fontSize:12},children:[(0,A.jsx)("span",{style:{color:"var(--p-purple-300)",fontWeight:500,whiteSpace:"nowrap"},children:"Branch name:"}),(0,A.jsx)("input",{id:"dp-branch-name",type:"text",placeholder:"e.g. feat/add-hover-effect",value:St,onChange:S=>Zt(S.target.value),onKeyDown:S=>{S.key==="Enter"&&St.trim()&&uf(),S.key==="Escape"&&df()},autoFocus:!0,style:{flex:1,fontSize:12,padding:"4px 8px",borderRadius:6,border:"1px solid var(--p-border)",background:"var(--p-input)",color:"var(--p-text)",fontFamily:"monospace"}}),(0,A.jsx)("button",{onClick:uf,disabled:!St.trim(),style:{padding:"4px 12px",borderRadius:6,border:"1px solid var(--p-purple)",background:St.trim()?"var(--p-purple)":"var(--p-border)",color:"#fff",fontSize:11,fontWeight:600,cursor:St.trim()?"pointer":"not-allowed",transition:"background .12s"},children:"Apply & Review"}),(0,A.jsx)("button",{onClick:df,style:{padding:"4px 10px",borderRadius:6,border:"1px solid var(--p-border)",background:"transparent",color:"var(--p-text-g)",fontSize:11,cursor:"pointer"},children:"Cancel"})]})]}),!b&&(0,A.jsxs)("div",{className:"dp-tabs",id:"dp-tabs-row",children:[(0,A.jsx)("button",{className:`dp-tab${Me==="details"?" active":""}`,id:"dp-tab-details",onClick:()=>Ce("details"),children:"Details"}),(0,A.jsxs)("button",{className:`dp-tab${Me==="comments"?" active":""}`,id:"dp-tab-activity",onClick:()=>Ce("comments"),children:["Activity ",X>0&&(0,A.jsxs)("span",{id:"dp-activity-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",X,")"]})]}),(0,A.jsxs)("button",{className:`dp-tab${Me==="files"?" active":""}`,id:"dp-tab-files",onClick:()=>Ce("files"),children:["Files ",O>0&&(0,A.jsxs)("span",{id:"dp-file-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",O,")"]})]}),ve===!0&&(0,A.jsxs)("button",{className:`dp-tab${Me==="agent"?" active":""}`,id:"dp-tab-agent",onClick:()=>Ce("agent"),style:{color:Me==="agent"?"#c4b5fd":void 0,borderBottomColor:Me==="agent"?"#a78bfa":void 0},children:["\\u{1F916} Agent",y&&y.status!=="idle"&&(0,A.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:12,borderRadius:10,fontSize:9,fontWeight:700,background:"#a78bfa",color:"#fff",marginLeft:4},children:y.status==="running"?"\\u25CF":y.status==="queued"?"\\u23F3":"\\u2713"})]})]}),(0,A.jsxs)("div",{className:"dp-body",children:[!b&&(0,A.jsx)(ly,{}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-details-pane",style:{display:!t||Me==="details"?"":"none"},children:[(0,A.jsx)("div",{style:Wa?{pointerEvents:"none",opacity:.6,flexShrink:0}:{flexShrink:0},children:(0,A.jsx)(jd,{task:t,description:De,setDescription:at,showDescPreview:ml,setShowDescPreview:ao,priority:Na,setPriority:Ua,onDescriptionBlur:b?void 0:Ll,onDescriptionDiscard:b?void 0:()=>{at(Pe.current),ao(!0)},originalDescription:b?void 0:Pe.current,onPriorityChange:b?void 0:S=>{t&&(S!==Na&&Sl("priority",Na||"\\u2014",S||"\\u2014"),L(t.id,{priority:S||void 0}))},githubUrl:n,onFilePreview:x,onDeleteScreenshot:Hg,onPatch:L,liveFiles:so.length>0||Yo?so:void 0,allTags:Je,overrideTags:b?Ue:void 0,onTagsChange:b?Rt:void 0})}),!b&&t&&(0,A.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",flexShrink:0,marginTop:12,borderTop:"1px solid var(--p-border)",paddingTop:10},children:(0,A.jsx)(uy,{task:t})})]}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-activity-pane",style:{display:Me==="comments"&&!b?"":"none"},children:[(0,A.jsx)("div",{style:{borderBottom:"1px solid var(--p-border)",paddingBottom:8,flexShrink:0},children:(0,A.jsx)(Xd,{commentInput:qa,setCommentInput:lo,commentSubmitting:vl,onSubmit:()=>void pi(),baseRows:2})}),(0,A.jsx)(Wd,{comments:di,files:so,localChanges:$g,loading:fi,error:ci,gitUserName:o,taskAuthorName:t==null?void 0:t.authorName,baseUrl:l,taskId:t==null?void 0:t.id,taskCreatedAt:t==null?void 0:t.createdAt,taskUpdatedAt:t==null?void 0:t.updatedAt,onEdit:Bg,onDelete:Og,onDeleteFile:sf,onFilePreview:x})]}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-files-pane",style:{display:Me==="files"&&!b?"":"none"},children:[(0,A.jsx)($d,{files:so,loading:Yo,error:T,baseUrl:l,onPreview:S=>x(S.name,S.linkedPath?`${l}/api/tasks/${t==null?void 0:t.id}/files/${encodeURIComponent(S.name)}`:`${l}${S.url}`),onDelete:Wa?void 0:sf}),(0,A.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:8,flexShrink:0,display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",...Wa?{pointerEvents:"none",opacity:.5}:{}},children:[xe&&(0,A.jsx)("div",{style:{width:"100%",fontSize:11,color:"var(--p-red)",background:"rgba(255,80,80,0.08)",border:"1px solid rgba(255,80,80,0.2)",borderRadius:5,padding:"4px 8px"},children:xe}),(0,A.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer",padding:"6px 10px",background:"var(--p-card)",border:"1px solid var(--p-border)",borderRadius:8,color:"var(--p-text-m)",fontSize:12,transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-border-t)",S.currentTarget.style.color="var(--p-text)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border)",S.currentTarget.style.color="var(--p-text-m)"},children:[(0,A.jsx)(Wo,{style:{width:12,height:12}}),"Upload",(0,A.jsx)("input",{id:"dp-file-upload",type:"file",style:{display:"none"},multiple:!0,onChange:zg})]}),(0,A.jsx)("span",{style:{fontSize:11,color:"var(--p-border-t)",marginLeft:"auto"},children:"or paste image"})]})]}),ve===!0&&(0,A.jsx)("div",{className:"dp-pane",id:"dp-agent-pane",style:{display:Me==="agent"&&!b&&t?"":"none"},children:t&&(0,A.jsx)(Zd,{task:t,run:y,onRun:(S,V,ee)=>k==null?void 0:k(S,V,ee),onStop:z??(()=>{}),onDequeue:N??(()=>{}),models:U,defaultModel:_,defaultAgent:Te,onModelChange:ii,agents:be,onAgentChange:ui,cliAvailable:!!W})})]}),(0,A.jsxs)("div",{className:"dp-footer",children:[!b&&(0,A.jsx)("button",{id:"dp-delete",onClick:()=>jo(!0),style:{color:"var(--p-red)",background:"none",border:"1px solid var(--p-border-t)",borderRadius:7,padding:"5px 12px",fontSize:12,cursor:"pointer",fontFamily:"inherit",transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-red)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border-t)"},children:"Delete"}),(0,A.jsx)("div",{style:{flex:1}}),b?(0,A.jsxs)(A.Fragment,{children:[Ie.length>0&&(0,A.jsxs)("span",{style:{fontSize:11,color:"var(--p-blue-300)",marginRight:8,background:"rgba(37,99,235,0.1)",border:"1px solid rgba(37,99,235,0.25)",borderRadius:6,padding:"3px 8px"},children:["\\u{1F4CE} ",Ie.length," screenshot",Ie.length!==1?"s":""," will attach on save"]}),(0,A.jsx)("button",{id:"dp-cancel",onClick:d,style:{padding:"5px 14px",borderRadius:7,fontSize:12,fontWeight:500,cursor:"pointer",border:"1px solid var(--p-border-t)",background:"var(--p-border)",color:"var(--p-text-sub)",fontFamily:"inherit",transition:"all .15s"},onMouseOver:S=>{S.currentTarget.style.borderColor="var(--p-text-g)"},onMouseOut:S=>{S.currentTarget.style.borderColor="var(--p-border-t)"},children:"Cancel"}),(0,A.jsx)("button",{id:"dp-save",onClick:()=>void lf(),style:{padding:"5px 18px",borderRadius:7,fontSize:12,fontWeight:500,cursor:"pointer",border:"1px solid var(--p-blue-700)",background:"var(--p-blue)",color:"var(--p-white)",fontFamily:"inherit",transition:"background .15s"},onMouseOver:S=>{S.currentTarget.style.background="var(--p-blue-700)"},onMouseOut:S=>{S.currentTarget.style.background="var(--p-blue)"},children:"Add Task"})]}):ve===!0&&Me==="agent"&&t?(0,A.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",justifyContent:"flex-end",flex:1},children:[(!y||y.status==="idle")&&(0,A.jsxs)("button",{id:"dp-run-agent",disabled:!W,onClick:()=>k==null?void 0:k(t.id,ro,Cr||void 0),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-purple)",background:W?"var(--p-purple)":"var(--p-surface)",color:W?"#fff":"var(--p-text-g)",fontSize:12,fontWeight:600,cursor:W?"pointer":"not-allowed",transition:"background .12s"},onMouseEnter:S=>{W&&(S.currentTarget.style.background="#9333ea")},onMouseLeave:S=>{W&&(S.currentTarget.style.background="var(--p-purple)")},title:W?void 0:\'Local CLI server not connected. Run "vibeflow serve" and refresh.\',children:[(0,A.jsx)(Kr,{style:{width:12,height:12}}),"Run Agent"]}),(y==null?void 0:y.status)==="running"&&(0,A.jsxs)("button",{id:"dp-stop-agent",onClick:()=>z==null?void 0:z(t.id),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:12,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 25%, transparent)"},onMouseLeave:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 15%, transparent)"},children:[(0,A.jsx)(Qr,{style:{width:12,height:12}}),"Stop"]}),(y==null?void 0:y.status)==="queued"&&(0,A.jsxs)("button",{id:"dp-dequeue-agent",onClick:()=>N==null?void 0:N(t.id),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 14px",borderRadius:7,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:12,fontWeight:600,cursor:"pointer",transition:"background .12s"},onMouseEnter:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 25%, transparent)"},onMouseLeave:S=>{S.currentTarget.style.background="color-mix(in srgb, var(--p-red) 15%, transparent)"},children:[(0,A.jsx)(rl,{style:{width:12,height:12}}),"Dequeue"]})]}):(0,A.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)",padding:"5px 4px"},children:"Changes are saved automatically"})]}),(0,A.jsx)(Sa,{open:si,title:"Delete task?",message:`You are about to permanently delete "${(t==null?void 0:t.title)||"this task"}". This action cannot be undone.`,confirmLabel:"Delete task",onConfirm:()=>{jo(!1),g(t.id),d()},onCancel:()=>jo(!1)})]}),Xo&&(0,A.jsx)("div",{style:{position:"fixed",inset:0,zIndex:201,display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",background:"rgba(2,12,27,0.80)"},children:(0,A.jsxs)("div",{style:{background:"var(--p-surface)",border:"1px solid var(--p-border-s)",borderRadius:16,padding:"28px 32px",width:"100%",maxWidth:480,boxShadow:"var(--p-shadow-lg)",position:"relative"},children:[(0,A.jsx)("div",{style:{width:44,height:44,borderRadius:12,background:"rgba(139,92,246,0.12)",border:"1px solid rgba(139,92,246,0.25)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16},children:(0,A.jsx)(Wo,{style:{width:20,height:20,color:"var(--p-purple)"}})}),(0,A.jsx)("h2",{style:{margin:"0 0 8px",fontSize:17,fontWeight:700,color:"var(--p-text)"},children:"Send comment?"}),(0,A.jsx)("p",{style:{margin:"0 0 22px",fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:"You have an unsent comment. Do you want to send it before closing?"}),(0,A.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,A.jsx)("button",{onClick:()=>{Ia(!1),pi().then(()=>d())},style:{flex:1,padding:"9px 14px",borderRadius:8,background:"var(--p-purple)",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},children:"Send & Close"}),(0,A.jsx)("button",{type:"button",onClick:()=>{Ia(!1),lo(""),d()},style:{padding:"9px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer"},children:"Discard & Close"}),(0,A.jsx)("button",{type:"button",onClick:()=>Ia(!1),style:{padding:"9px 16px",borderRadius:8,background:"var(--p-hover)",border:"1px solid var(--p-border)",color:"var(--p-text-m)",fontSize:13,cursor:"pointer"},children:"Keep editing"})]})]})})]})}function uy({task:e}){let t=[];if(e.component&&t.push((0,A.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"color-mix(in srgb, var(--p-purple) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 36%, transparent)",borderRadius:100,fontSize:10,color:"var(--p-purple-300)",fontFamily:"monospace"},children:["\\u2B21 ",e.component]},"component")),e.file||e.selector&&e.selector!=="/"||e.cssSelector){let r=e.file??"";e.line!=null&&(r+=`:${e.line}`),e.col!=null&&(r+=`:${e.col}`);let o=e.cssSelector??(e.selector&&e.selector!=="/"?e.selector:""),n=r||o;if(n){let l=n.length>40?`\\u2026${n.slice(-40)}`:n,s=e.url?e.url.length>30?`\\u2026${e.url.slice(-30)}`:e.url:"";t.push((0,A.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:0,borderRadius:6,overflow:"hidden",border:"1px solid color-mix(in srgb, var(--p-blue) 15%, transparent)",fontSize:10,fontFamily:"monospace",whiteSpace:"nowrap"},children:[(0,A.jsx)("span",{title:[r,o].filter(Boolean).join(" \\xB7 "),style:{padding:"2px 6px",background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",color:"var(--p-blue-300)"},children:l}),s&&(0,A.jsx)("span",{title:e.url,style:{padding:"2px 6px",background:"color-mix(in srgb, var(--p-border) 72%, transparent)",color:"var(--p-text-g)",borderLeft:"1px solid color-mix(in srgb, var(--p-blue) 18%, transparent)"},children:s})]},"source"))}}else if(e.url){let r=e.url.length>40?`\\u2026${e.url.slice(-40)}`:e.url;t.push((0,A.jsx)("span",{className:"dp-source-pill",title:e.url,children:r},"url"))}return e.reportBack&&t.push((0,A.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 24%, transparent)",borderRadius:100,fontSize:10,color:"var(--p-purple-300)"},children:"\\u21A9 report back"},"rb")),(0,A.jsx)("div",{id:"dp-meta-row",style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:t})}var to=F(Oe(),1);var se=F(j(),1),dy=[{id:"all",label:"All",dot:""},{id:"todo",label:"Todo",dot:"var(--p-amber)"},{id:"in-progress",label:"In Progress",dot:"var(--p-blue)"},{id:"review",label:"Review",dot:"var(--p-purple)"}],fy={todo:{background:"color-mix(in srgb, var(--p-amber) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-amber) 38%, transparent)",color:"var(--p-amber-300)"},"in-progress":{background:"color-mix(in srgb, var(--p-blue) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 38%, transparent)",color:"var(--p-blue-200)"},review:{background:"color-mix(in srgb, var(--p-purple) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 38%, transparent)",color:"var(--p-purple-300)"},done:{background:"color-mix(in srgb, var(--p-green) 14%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 32%, transparent)",color:"var(--p-green-300)"},backlog:{background:"color-mix(in srgb, var(--p-text-g) 16%, transparent)",border:"1px solid color-mix(in srgb, var(--p-text-g) 32%, transparent)",color:"var(--p-text-m)"},all:{background:"color-mix(in srgb, var(--p-blue) 12%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 32%, transparent)",color:"var(--p-blue-200)"}};function tf({tasks:e,filter:t,onFilter:a,view:r="board",onViewChange:o,activityCounter:n}){let[l,s]=to.default.useState(!1),[i,d]=to.default.useState(!1),[f,m]=to.default.useState(!1),g=to.default.useMemo(()=>[...new Set(e.map(y=>y.type).filter(Boolean))].sort(),[e]),L=to.default.useMemo(()=>[...new Set(e.map(y=>y.author).filter(Boolean))].sort(),[e]),x=to.default.useMemo(()=>{let y=new Set;for(let k of e)for(let z of k.tags??[])y.add(z);return[...y].sort()},[e]);function I(y){return e.filter(k=>k.status===y).length}function H(y){a({...t,status:y}),s(!1),d(!1),m(!1)}function p(y){a({...t,type:y}),s(!1)}function u(y){a({...t,user:y}),d(!1)}function c(y){let k=t.tags??[],z=k.includes(y)?k.filter(N=>N!==y):[...k,y];a({...t,tags:z})}function v(y){y.stopPropagation();let k=y.currentTarget.dataset.status;k&&H(k)}let w={display:"flex",alignItems:"center",gap:5,padding:"3px 10px",borderRadius:6,fontSize:11,cursor:"pointer",border:"1px solid transparent",background:"transparent",color:"var(--p-text-f)",transition:"all .12s",fontFamily:"inherit",fontWeight:500},C={...w,background:"var(--p-card)",border:"1px solid var(--p-border)",color:"var(--p-text-f)",padding:"3px 10px",position:"relative"};return(0,se.jsxs)("div",{"data-proto-id":"filter-bar",style:{display:"flex",alignItems:"center",gap:6,padding:"7px 16px",background:"var(--p-surface)",borderBottom:"1px solid var(--p-border)",flexShrink:0},onClick:()=>{s(!1),d(!1),m(!1)},children:[(0,se.jsx)("div",{style:{display:"flex",alignItems:"center",gap:2},children:dy.map(y=>{let k=t.status===y.id,z=y.id!=="all"?I(y.id):null,N=k?fy[y.id]:{};return(0,se.jsxs)("button",{"data-status":y.id,style:{...w,...N},onMouseOver:U=>{k||(U.currentTarget.style.background="var(--p-hover)",U.currentTarget.style.color="var(--p-text-m)")},onMouseOut:U=>{k||(U.currentTarget.style.background="transparent",U.currentTarget.style.color="var(--p-text-f)")},onClick:v,children:[y.dot&&(0,se.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:y.dot,flexShrink:0,display:"inline-block"}}),y.label,z!=null&&(0,se.jsx)("span",{style:{color:k?"inherit":"var(--p-border-t)",fontSize:10,opacity:.8},children:z})]},y.id)})}),(0,se.jsx)("div",{style:{flex:1}}),n,t.user&&(0,se.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 24%, transparent)",fontSize:10,color:"var(--p-purple-300)"},children:[t.user,(0,se.jsx)("button",{onClick:()=>u(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-purple-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,se.jsx)(Xe,{style:{width:10,height:10}})})]}),t.type&&(0,se.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:"color-mix(in srgb, var(--p-blue) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-blue) 24%, transparent)",fontSize:10,color:"var(--p-cyan-300)"},children:[t.type,(0,se.jsx)("button",{onClick:()=>p(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-cyan-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,se.jsx)(Xe,{style:{width:10,height:10}})})]}),(t.tags??[]).map(y=>{let{bg:k,text:z,border:N}=ua(y);return(0,se.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:k,border:`1px solid ${N}`,fontSize:10,color:z,fontWeight:600},children:[y,(0,se.jsx)("button",{onClick:()=>c(y),style:{display:"flex",background:"none",border:"none",color:z,cursor:"pointer",padding:0,lineHeight:1},children:(0,se.jsx)(Xe,{style:{width:10,height:10}})})]},y)}),(0,se.jsxs)("div",{style:{position:"relative"},children:[(0,se.jsxs)("button",{style:{...C,color:(t.tags??[]).length?"var(--p-green-300)":"var(--p-text-f)",borderColor:(t.tags??[]).length?"color-mix(in srgb, var(--p-green) 36%, transparent)":"var(--p-border)",opacity:x.length?1:.55},onClick:y=>{y.stopPropagation(),x.length&&(d(!1),s(!1),m(k=>!k))},children:[(0,se.jsx)(_o,{style:{width:12,height:12}}),"Tags",(t.tags??[]).length>0&&(0,se.jsx)("span",{style:{fontSize:9,background:"color-mix(in srgb, var(--p-green) 20%, transparent)",color:"var(--p-green-300)",borderRadius:100,padding:"0 4px"},children:(t.tags??[]).length}),(0,se.jsx)(ya,{style:{width:12,height:12}})]}),f&&x.length>0&&(0,se.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:160,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(t.tags??[]).length>0&&(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>a({...t,tags:[]}),children:"Clear tag filters"}),x.map(y=>{let{bg:k,text:z,border:N}=ua(y),U=(t.tags??[]).includes(y);return(0,se.jsxs)("button",{style:{width:"100%",textAlign:"left",padding:"6px 12px",fontSize:11,color:"var(--p-text-m)",background:U?"var(--p-hover)":"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:6},onMouseEnter:_=>{_.currentTarget.style.background="var(--p-hover)"},onMouseLeave:_=>{_.currentTarget.style.background=U?"var(--p-hover)":"none"},onClick:()=>c(y),children:[(0,se.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:z,border:`1px solid ${N}`,flexShrink:0}}),(0,se.jsx)("span",{style:{flex:1},children:y}),U&&(0,se.jsx)("span",{style:{color:z,fontSize:12,lineHeight:1},children:"\\u2713"})]},y)})]})]}),(0,se.jsxs)("div",{style:{position:"relative"},children:[(0,se.jsxs)("button",{style:{...C,color:t.user?"var(--p-purple-300)":"var(--p-text-f)",borderColor:t.user?"color-mix(in srgb, var(--p-purple) 36%, transparent)":"var(--p-border)",opacity:L.length?1:.55},onClick:y=>{y.stopPropagation(),L.length&&(s(!1),d(k=>!k))},children:[(0,se.jsx)(ol,{style:{width:12,height:12}}),"User",(0,se.jsx)(ya,{style:{width:12,height:12}})]}),i&&L.length>0&&(0,se.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:160,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>u(null),children:"All users"}),L.map(y=>(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.user===y?"var(--p-purple-300)":"var(--p-text-m)",background:t.user===y?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:k=>{t.user!==y&&(k.currentTarget.style.background="var(--p-hover)")},onMouseOut:k=>{t.user!==y&&(k.currentTarget.style.background="none")},onClick:()=>u(y),children:y},y))]})]}),(0,se.jsxs)("div",{style:{position:"relative"},children:[(0,se.jsxs)("button",{style:{...C,color:t.type?"var(--p-cyan-300)":"var(--p-text-f)",borderColor:t.type?"color-mix(in srgb, var(--p-blue) 36%, transparent)":"var(--p-border)",opacity:g.length?1:.55},onClick:y=>{y.stopPropagation(),g.length&&s(k=>!k)},children:[(0,se.jsx)(_o,{style:{width:12,height:12}}),"Type",(0,se.jsx)(ya,{style:{width:12,height:12}})]}),l&&g.length>0&&(0,se.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 4px)",right:0,minWidth:140,background:"var(--p-card)",border:"1px solid var(--p-border-s)",borderRadius:8,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",zIndex:50,overflow:"hidden"},onClick:y=>y.stopPropagation(),children:[(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:"var(--p-text-f)",background:"none",border:"none",cursor:"pointer",borderBottom:"1px solid var(--p-border)"},onClick:()=>p(null),children:"All types"}),g.map(y=>(0,se.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.type===y?"var(--p-cyan-300)":"var(--p-text-m)",background:t.type===y?"color-mix(in srgb, var(--p-blue) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:k=>{t.type!==y&&(k.currentTarget.style.background="var(--p-hover)")},onMouseOut:k=>{t.type!==y&&(k.currentTarget.style.background="none")},onClick:()=>p(y),children:y},y))]})]}),(0,se.jsxs)("div",{style:{display:"flex",alignItems:"center",background:"var(--p-card)",border:"1px solid var(--p-border)",borderRadius:8,padding:2,gap:0},children:[(0,se.jsx)("button",{title:"Board view",style:{padding:"4px 7px",borderRadius:5,background:r==="board"?"var(--p-surface)":"none",color:r==="board"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:y=>{y.stopPropagation(),o==null||o("board")},children:(0,se.jsx)(Zn,{style:{width:13,height:13}})}),(0,se.jsx)("button",{title:"List view",style:{padding:"4px 7px",borderRadius:5,background:r==="list"?"var(--p-surface)":"none",color:r==="list"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:y=>{y.stopPropagation(),o==null||o("list")},children:(0,se.jsx)(Jn,{style:{width:13,height:13}})})]})]})}var Lt=F(Oe(),1);var $=F(j(),1),cy=[{id:"board",label:"Board",icon:(0,$.jsx)(pr,{className:"w-3.5 h-3.5"})},{id:"enforcement",label:"Enforcement",icon:(0,$.jsx)(al,{className:"w-3.5 h-3.5"})},{id:"agent",label:"Agent",icon:(0,$.jsx)(Kt,{className:"w-3.5 h-3.5"})}];function rf({open:e,visibleCols:t,settings:a,onClose:r,onSave:o,models:n,agents:l}){var W,D;let s=n&&n.length>0?n:cl,[i,d]=Lt.default.useState("board"),[f,m]=Lt.default.useState({}),[g,L]=Lt.default.useState(a.autoCommit??!1),[x,I]=Lt.default.useState(a.autoComment??!1),[H,p]=Lt.default.useState(a.autoPush??!1),[u,c]=Lt.default.useState(a.createBranch??!1),[v,w]=Lt.default.useState(a.defaultModel??""),[C,y]=Lt.default.useState(a.defaultAgent??"build"),[k,z]=Lt.default.useState(a.perTypeModels??!1),[N,U]=Lt.default.useState(a.defaultModelBug??""),[_,re]=Lt.default.useState(a.defaultModelResearch??""),[ce,Se]=Lt.default.useState(a.defaultModelTask??""),[J,be]=Lt.default.useState(a.experimentalAgents??!1);Lt.default.useEffect(()=>{if(!e)return;let b={};gr.forEach(B=>{b[B.id]=t.includes(B.id)}),m(b),L(a.autoCommit??!1),I(a.autoComment??!1),p(a.autoPush??!1),c(a.createBranch??!1),w(a.defaultModel??""),y(a.defaultAgent??"build"),z(a.perTypeModels??!1),U(a.defaultModelBug??""),re(a.defaultModelResearch??""),Se(a.defaultModelTask??""),be(a.experimentalAgents??!1),d("board")},[e,t,a]);function Te(){let b=gr.filter(B=>f[B.id]).map(B=>B.id);o(b,{autoCommit:g,autoComment:x,autoPush:H,createBranch:u,defaultModel:v,defaultAgent:C,perTypeModels:k,defaultModelBug:N,defaultModelResearch:_,defaultModelTask:ce,experimentalAgents:J}),r()}function ve(b){m(B=>({...B,[b]:!B[b]}))}return(0,$.jsxs)(Jr,{open:e,onClose:r,id:"settings-modal",width:"min(460px, 95vw)",icon:(0,$.jsx)(Xr,{style:{width:14,height:14,color:"var(--p-text-g)"}}),title:"Settings",headerActions:(0,$.jsx)("button",{id:"settings-close",onClick:r,style:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer",transition:"background .12s,color .12s"},onMouseOver:b=>{b.currentTarget.style.background="var(--p-surface)",b.currentTarget.style.color="var(--p-text-m)"},onMouseOut:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.color="var(--p-text-g)"},children:(0,$.jsx)(Xe,{style:{width:14,height:14}})}),footer:(0,$.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,$.jsx)("button",{id:"settings-cancel",onClick:r,className:"dp-status-btn",style:{padding:"5px 14px",fontSize:12},children:"Cancel"}),(0,$.jsx)("button",{id:"settings-apply",onClick:Te,style:{padding:"5px 14px",fontSize:12,fontWeight:500,borderRadius:6,border:"1px solid color-mix(in srgb, var(--p-purple) 55%, transparent)",background:"color-mix(in srgb, var(--p-purple) 18%, transparent)",color:"var(--p-purple-300)",cursor:"pointer",transition:"background .12s"},onMouseOver:b=>{b.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 28%, transparent)"},onMouseOut:b=>{b.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 18%, transparent)"},children:"Apply"})]}),children:[(0,$.jsx)("div",{className:"dp-tabs",children:cy.map(b=>(0,$.jsxs)("button",{onClick:()=>d(b.id),className:`dp-tab${i===b.id?" active":""}`,style:{display:"flex",alignItems:"center",gap:6},children:[b.icon,b.label]},b.id))}),i==="board"&&(0,$.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:10},children:[(0,$.jsx)("div",{className:"dp-meta-label",children:"Visible Columns"}),gr.map(b=>(0,$.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none"},children:[(0,$.jsx)("input",{id:`settings-col-${b.id}`,type:"checkbox",checked:f[b.id]??!0,onChange:()=>ve(b.id),style:{width:14,height:14,accentColor:b.color,cursor:"pointer"}}),(0,$.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:b.color,flexShrink:0}}),(0,$.jsx)("span",{style:{fontSize:13,color:"var(--p-text-m)"},children:b.label})]},b.id))]}),i==="enforcement"&&(0,$.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:16},children:[(0,$.jsx)(oi,{id:"settings-auto-comment",label:"Require comment on review",description:"CLI enforces an implementation report when setting task status to review.",value:x,onChange:I}),(0,$.jsx)("div",{style:{height:1,background:"var(--p-border)",marginTop:-4,marginBottom:-4}}),(0,$.jsx)(oi,{id:"settings-create-branch",label:"Require branch per task",description:"CLI enforces a dedicated branch name when setting task status to review.",value:u,onChange:c}),(0,$.jsx)(oi,{id:"settings-auto-commit",label:"Auto-commit on review",description:"CLI automatically commits staged changes when setting task status to review.",value:g,onChange:L}),(0,$.jsx)(oi,{id:"settings-auto-push",label:"Auto-push after commit",description:`CLI pushes after auto-commit. Requires \'Auto-commit\' to be ON.${g?"":" (Enable Auto-commit first)"}`,value:H&&g,onChange:b=>p(b&&g)})]}),i==="agent"&&(0,$.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:14},children:[(0,$.jsxs)("div",{children:[(0,$.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none",marginBottom:4},children:[(0,$.jsx)("input",{id:"settings-experimental-agents",type:"checkbox",checked:J,onChange:()=>be(!J),style:{width:14,height:14,accentColor:"var(--p-purple)",cursor:"pointer"}}),(0,$.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text-m)"},children:"Enable agent features (experimental)"})]}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginLeft:24},children:"Agent runs, queue, and model selection are experimental and may change."})]}),!J&&(0,$.jsx)("div",{style:{padding:16,borderRadius:8,background:"var(--p-bg-2)",border:"1px dashed var(--p-border)",textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:"Agent features are disabled. Toggle above to enable."}),J&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",style:{marginBottom:6},children:"Default Model"}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:"This model will be pre-selected when running the agent on a task."}),(0,$.jsx)(ri,{value:v,onChange:b=>w(b===v?"":b),models:s})]}),v&&(0,$.jsxs)("div",{style:{padding:10,borderRadius:7,background:"color-mix(in srgb, var(--p-green) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-green) 30%, transparent)",fontSize:11,color:"var(--p-green-300)"},children:["\\u2713 Default model set to: ",(0,$.jsx)("strong",{children:(W=s.find(b=>b.id===v))==null?void 0:W.label})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",style:{marginBottom:6},children:"Default Agent"}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:"This agent will be used when running agent on a task without a specific agent set."}),(0,$.jsx)(Yd,{value:C,onChange:b=>y(b),agents:l??[]})]}),C&&(0,$.jsxs)("div",{style:{padding:10,borderRadius:7,background:"color-mix(in srgb, var(--p-purple) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--p-purple) 30%, transparent)",fontSize:11,color:"var(--p-purple-300)"},children:["\\u2713 Default agent set to: ",(0,$.jsx)("strong",{children:((D=l==null?void 0:l.find(b=>b.id===C))==null?void 0:D.name)??C})]}),(0,$.jsx)("div",{style:{height:1,background:"var(--p-border)",margin:"4px 0"}}),(0,$.jsxs)("div",{children:[(0,$.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none",marginBottom:4},children:[(0,$.jsx)("input",{id:"settings-per-type-models",type:"checkbox",checked:k,onChange:()=>z(!k),style:{width:14,height:14,accentColor:"var(--p-purple)",cursor:"pointer"}}),(0,$.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text-m)"},children:"Use different models per task type"})]}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginLeft:24},children:"Override the default model for specific task types."})]}),k&&(0,$.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12,paddingLeft:24},children:[(0,$.jsx)(af,{id:"dp-type-model-picker-bug",label:"Bug",color:"var(--p-red)",value:N,onChange:b=>U(b===N?"":b),models:s}),(0,$.jsx)(af,{id:"dp-type-model-picker-research",label:"Research",color:"var(--p-blue)",value:_,onChange:b=>re(b===_?"":b),models:s}),(0,$.jsx)(af,{id:"dp-type-model-picker-task",label:"Task",color:"var(--p-green)",value:ce,onChange:b=>Se(b===ce?"":b),models:s})]})]})]})]})}function oi({id:e,label:t,description:a,value:r,onChange:o}){return(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:t}),(0,$.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:a}),(0,$.jsxs)("div",{id:e,style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer"},onClick:()=>o(!r),children:[(0,$.jsxs)("div",{style:{position:"relative",width:36,height:20,flexShrink:0},children:[(0,$.jsx)("div",{style:{width:36,height:20,borderRadius:10,background:r?"var(--p-purple)":"var(--p-card)",border:`1px solid ${r?"var(--p-purple-300)":"var(--p-border)"}`,transition:"all .15s"}}),(0,$.jsx)("div",{style:{position:"absolute",top:3,left:r?18:3,width:14,height:14,borderRadius:"50%",background:r?"var(--p-purple-300)":"var(--p-text-muted)",transition:"all .15s"}})]}),(0,$.jsx)("span",{style:{fontSize:12,color:"var(--p-text-g)"},children:r?"On":"Off"})]})]})}function af({id:e,label:t,color:a,value:r,onChange:o,models:n}){let l=n.find(s=>s.id===r);return(0,$.jsxs)("div",{id:e,children:[(0,$.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[(0,$.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:a,flexShrink:0}}),(0,$.jsx)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-text-m)"},children:t})]}),(0,$.jsx)(ri,{value:r,onChange:o,models:n}),l&&(0,$.jsxs)("div",{style:{fontSize:10,color:"var(--p-text-g)",marginTop:4,paddingLeft:4},children:["\\u2192 ",l.label]})]})}var li=F(Oe(),1);var Fe=F(j(),1);function kg(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function ni(e){return/\\.md$/i.test(e)}function of({open:e,name:t,url:a,onClose:r}){let[o,n]=li.default.useState(null),[l,s]=li.default.useState(!1);return li.default.useEffect(()=>{!e||!a||(ni(t)?(s(!0),n(null),fetch(a).then(i=>i.text()).then(i=>{n(i),s(!1)}).catch(()=>{n("Error loading file."),s(!1)})):n(null))},[e,t,a]),(0,Fe.jsx)(Jr,{open:e,onClose:r,id:"file-preview-modal",width:"min(1100px, 95vw)",maxHeight:"88vh",boxStyle:{display:"flex",flexDirection:"column"},icon:(0,Fe.jsx)(qo,{className:"w-4 h-4 text-slate-400"}),title:t,headerActions:(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsx)("a",{href:a,download:t,className:"text-slate-400 hover:text-slate-200 transition-colors p-1.5 rounded-md hover:bg-slate-700/60",title:"Download",children:(0,Fe.jsx)($r,{className:"w-4 h-4"})}),(0,Fe.jsx)("button",{id:"file-preview-close",onClick:r,className:"text-slate-400 hover:text-slate-200 transition-colors p-1.5 rounded-md hover:bg-slate-700/60",title:"Close",children:(0,Fe.jsx)(Xe,{className:"w-4 h-4"})})]}),footer:(0,Fe.jsxs)(Fe.Fragment,{children:[(0,Fe.jsxs)("a",{href:a,download:t,className:"flex items-center gap-1.5 border border-slate-700 hover:bg-slate-800 text-slate-300 text-sm px-3 py-1.5 rounded-lg transition-colors",children:[(0,Fe.jsx)($r,{className:"w-3.5 h-3.5"}),"Download"]}),(0,Fe.jsx)("button",{id:"file-preview-close-footer",onClick:r,className:"border border-slate-700 hover:bg-slate-800 text-slate-300 text-sm px-4 py-1.5 rounded-lg transition-colors",children:"Close"})]}),children:(0,Fe.jsxs)("div",{className:"flex-1 overflow-auto",style:{minHeight:0,padding:"16px 20px"},children:[kg(t)&&(0,Fe.jsx)("div",{style:{borderRadius:8,overflow:"hidden",border:"1px solid var(--p-border)",background:"var(--p-card)",display:"inline-block",width:"100%"},children:(0,Fe.jsx)("img",{src:a,alt:t,style:{maxWidth:"100%",display:"block",margin:"0 auto",objectFit:"contain"}})}),ni(t)&&l&&(0,Fe.jsx)("p",{className:"text-xs text-slate-500 py-4",children:"Loading\\u2026"}),ni(t)&&!l&&o!==null&&(0,Fe.jsx)("div",{id:"file-preview-md",style:{background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:"10px 14px",fontSize:13,color:"var(--p-text-sub)",lineHeight:1.65},children:(0,Fe.jsx)(vr,{markdown:o})}),!kg(t)&&!ni(t)&&(0,Fe.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-slate-500",children:[(0,Fe.jsx)(qo,{className:"w-10 h-10 opacity-40"}),(0,Fe.jsx)("p",{className:"text-sm",children:"Preview not available for this file type."}),(0,Fe.jsxs)("a",{href:a,download:t,className:"flex items-center gap-1.5 text-violet-400 hover:text-violet-300 hover:underline text-sm transition-colors",children:[(0,Fe.jsx)($r,{className:"w-3.5 h-3.5"}),"Download file"]})]})]})})}var pl=F(Oe(),1);var ke=F(j(),1);function py(e){if(!e)return"";let t=Date.now()-new Date(e).getTime(),a=Math.floor(t/6e4),r=Math.floor(t%6e4/1e3);return`${a}m ${r.toString().padStart(2,"0")}s`}var bg={running:"var(--p-blue)",queued:"var(--p-amber)",done:"var(--p-green)",failed:"var(--p-red)"},my={running:"Running",queued:"Queued",done:"Completed",failed:"Failed"};function nf({open:e,runs:t,onStop:a,onOpenTask:r,onClose:o}){let n=pl.default.useRef(null),[l,s]=pl.default.useState({});if(pl.default.useEffect(()=>{if(!e)return;let f=setInterval(()=>{let m={};for(let g of t)g.status==="running"&&g.startedAt&&(m[g.taskId]=py(g.startedAt));s(m)},1e3);return()=>clearInterval(f)},[e,t]),pl.default.useEffect(()=>{if(!e)return;function f(m){n.current&&!n.current.contains(m.target)&&o()}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[e,o]),!e)return null;let i=t.filter(f=>f.status==="running"||f.status==="queued"),d=t.filter(f=>f.status==="done"||f.status==="failed");return(0,ke.jsxs)("div",{ref:n,id:"agent-queue-panel",style:{position:"fixed",top:0,right:0,bottom:0,width:"min(420px, 90vw)",background:"var(--p-surface)",borderLeft:"1px solid var(--p-border)",zIndex:40,display:"flex",flexDirection:"column",boxShadow:"var(--p-shadow-lg)"},children:[(0,ke.jsxs)("div",{style:{padding:"14px 16px",borderBottom:"1px solid var(--p-border)",display:"flex",alignItems:"center",gap:10},children:[(0,ke.jsx)(Kt,{style:{width:16,height:16,color:"var(--p-purple-300)"}}),(0,ke.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1},children:"Agent Queue"}),(0,ke.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-g)",background:"var(--p-bg-2)",padding:"2px 8px",borderRadius:10},children:[i.length," active \\xB7 ",d.length," completed"]}),(0,ke.jsx)("button",{id:"agent-queue-close",onClick:o,style:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--p-text-g)",cursor:"pointer"},onMouseEnter:f=>{f.currentTarget.style.background="var(--p-surface)",f.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color="var(--p-text-g)"},children:(0,ke.jsx)(Xe,{style:{width:14,height:14}})})]}),(0,ke.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:12,display:"flex",flexDirection:"column",gap:8},children:[t.length===0&&(0,ke.jsx)("div",{style:{padding:24,textAlign:"center",fontSize:12,color:"var(--p-text-g)"},children:"No agent runs yet. Open a task and click the Agent tab to start."}),t.map(f=>(0,ke.jsxs)("div",{style:{padding:"10px 12px",borderRadius:8,border:`1px solid ${f.status==="running"?"color-mix(in srgb, var(--p-blue) 30%, transparent)":"var(--p-border)"}`,background:f.status==="running"?"color-mix(in srgb, var(--p-blue) 6%, transparent)":"var(--p-bg-2)",cursor:"pointer",transition:"background .12s"},onClick:()=>r(f.taskId),onMouseEnter:m=>{m.currentTarget.style.background=f.status==="running"?"color-mix(in srgb, var(--p-blue) 10%, transparent)":"var(--p-hover)"},onMouseLeave:m=>{m.currentTarget.style.background=f.status==="running"?"color-mix(in srgb, var(--p-blue) 6%, transparent)":"var(--p-bg-2)"},children:[(0,ke.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[f.status==="running"&&(0,ke.jsx)("span",{className:"spinner",style:{width:12,height:12,borderWidth:1.5}}),f.status==="queued"&&(0,ke.jsx)("span",{style:{color:"var(--p-amber)",fontSize:12},children:"\\u23F3"}),f.status==="done"&&(0,ke.jsx)("span",{style:{color:"var(--p-green)",fontSize:12},children:"\\u2713"}),f.status==="failed"&&(0,ke.jsx)("span",{style:{color:"var(--p-red)",fontSize:12},children:"\\u2717"}),(0,ke.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--p-text)",flex:1},children:f.taskTitle}),(0,ke.jsx)("span",{style:{fontSize:10,fontWeight:500,color:bg[f.status]??"var(--p-text-g)",padding:"1px 6px",borderRadius:4,background:`${bg[f.status]??"var(--p-text-g)"}15`},children:my[f.status]??f.status})]}),(0,ke.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:10,color:"var(--p-text-g)"},children:[f.model&&(0,ke.jsxs)("span",{children:["Model: ",f.model]}),f.status==="running"&&l[f.taskId]&&(0,ke.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:3},children:[(0,ke.jsx)(cr,{style:{width:9,height:9}}),l[f.taskId]]})]}),f.logs.length>0&&(0,ke.jsx)("div",{style:{marginTop:8,padding:"6px 8px",background:"#0a0c10",borderRadius:6,fontFamily:"\'SF Mono\', \'Fira Code\', monospace",fontSize:9,lineHeight:1.5,color:"#a3e635",maxHeight:80,overflowY:"auto"},children:f.logs.slice(-3).map((m,g)=>(0,ke.jsx)("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:m.startsWith("$")?(0,ke.jsx)("span",{style:{color:"var(--p-text-g)"},children:m}):m.startsWith("\\u2713")?(0,ke.jsx)("span",{style:{color:"var(--p-green)"},children:m}):m.startsWith("\\u25B6")||m.startsWith("\\u2192")?(0,ke.jsx)("span",{style:{color:"var(--p-blue-300)"},children:m}):m.startsWith("\\u2717")||m.startsWith("Error")?(0,ke.jsx)("span",{style:{color:"var(--p-red)"},children:m}):m},g))}),f.status==="running"&&(0,ke.jsxs)("button",{onClick:m=>{m.stopPropagation(),a(f.taskId)},style:{marginTop:8,display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:5,border:"1px solid var(--p-red)",background:"color-mix(in srgb, var(--p-red) 15%, transparent)",color:"var(--p-red)",fontSize:10,fontWeight:600,cursor:"pointer"},children:[(0,ke.jsx)(Qr,{style:{width:8,height:8}}),"Stop"]})]},f.taskId))]})]})}var Lr=window.location.origin,fa=`${Lr}/api/tasks`,ut={async getTasks(){return(await fetch(`${fa}?_=${Date.now()}`,{cache:"no-store"})).json()},async createTask(e){return(await fetch(fa,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()},async updateTask(e,t){return(await fetch(`${fa}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()},async deleteTask(e){await fetch(`${fa}/${e}`,{method:"DELETE"})},async getComments(e){return(await fetch(`${fa}/${e}/comments`)).json()},async addComment(e,t){await fetch(`${fa}/${e}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:"user",text:t,source:"web"})})},async updateComment(e,t,a){await fetch(`${fa}/${e}/comments/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})})},async deleteComment(e,t){await fetch(`${fa}/${e}/comments/${t}`,{method:"DELETE"})},async getFiles(e){return(await fetch(`${fa}/${e}/files`)).json()},async uploadFile(e,t){let a=await t.arrayBuffer();await fetch(`${fa}/${e}/files/${encodeURIComponent(t.name)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:a})},async deleteFile(e,t){await fetch(`${fa}/${e}/files/${encodeURIComponent(t)}`,{method:"DELETE"})},async getProject(){return(await fetch(`${Lr}/api/project`)).json()},async getCopilotStatus(){return(await fetch(`${Lr}/api/copilot/status`)).json()},async copilotLogin(){return(await fetch(`${Lr}/api/copilot/login`,{method:"POST"})).json().catch(()=>({}))},async getSettings(){return(await fetch(`${Lr}/api/settings`,{cache:"no-store"})).json()},async saveSettings(e){await fetch(`${Lr}/api/settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},wsUrl(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`},async getModels(){var a;let t=await(await fetch(`${Lr}/trpc/models`,{cache:"no-store"})).json();return((a=t==null?void 0:t.result)==null?void 0:a.data)??{models:[],error:"Invalid response"}},async getAgents(){return{agents:(await(await fetch(`${Lr}/api/agent/agents`,{cache:"no-store"})).json()).agents??[],error:null}}};var ne=F(j(),1),gy=window.__PORT__??3700,hy=window.__SAAS_MODE__??!1,Tg=window.__BOARD_URL__??"",xy=window.__BOARD_NAME__??"",Mg=window.__IS_ADMIN__??!1;function vy({onClose:e}){let t=window.location.origin,[a,r]=ie.default.useState("idle"),[o,n]=ie.default.useState(!0),[l,s]=ie.default.useState(null),[i,d]=ie.default.useState("");async function f(){r("pushing"),d("");try{let g=await fetch(`${t}/api/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepLocalFiles:o})}),L=await g.json();if(!g.ok){d(L.error??"Push failed"),r("error");return}s({imported:L.imported??0,skipped:L.skipped}),r("done")}catch(g){d(g instanceof Error?g.message:"Network error"),r("error")}}let m=a==="pushing";return(0,ne.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(5, 8, 18, 0.72)",backdropFilter:"blur(10px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20,fontFamily:"Inter, system-ui, -apple-system, sans-serif"},children:(0,ne.jsxs)("div",{style:{background:"#101827",border:"1px solid rgba(255,255,255,0.07)",borderRadius:24,maxWidth:380,width:"100%",boxShadow:"0 0 0 1px rgba(59,130,246,0.07), 0 40px 80px rgba(0,0,0,0.75)",overflow:"hidden",position:"relative"},children:[(0,ne.jsx)("div",{style:{position:"absolute",top:0,left:"20%",right:"20%",height:1,background:"linear-gradient(90deg, transparent, rgba(59,130,246,0.5), transparent)"}}),(0,ne.jsxs)("div",{style:{padding:"36px 36px 20px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,ne.jsx)("div",{style:{position:"relative",width:52,height:52,marginBottom:22},children:(0,ne.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,ne.jsx)("rect",{width:"18",height:"18",rx:"4",fill:"#2563eb"}),(0,ne.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"white",opacity:"0.7"}),(0,ne.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"white"}),(0,ne.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"white",opacity:"0.7"}),(0,ne.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"white",opacity:"0.85"})]})}),(0,ne.jsx)("h1",{style:{fontSize:18,fontWeight:700,color:"#f1f5f9",letterSpacing:"-0.3px",margin:"0 0 7px"},children:"Online Mode Active"}),(0,ne.jsxs)("p",{style:{fontSize:12,color:"rgba(255,255,255,0.36)",lineHeight:1.5,margin:0},children:["Connected to"," ",(0,ne.jsx)("strong",{style:{color:"rgba(255,255,255,0.55)",fontWeight:500},children:xy||"Vibeflow SaaS"})]})]}),a==="done"&&l&&(0,ne.jsxs)("div",{style:{margin:"0 28px 0",padding:"10px 14px",borderRadius:9,fontSize:12,display:"flex",alignItems:"center",gap:9,background:"rgba(16,185,129,0.08)",border:"1px solid rgba(16,185,129,0.18)",color:"#34d399"},children:[(0,ne.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",children:(0,ne.jsx)("path",{d:"M13 5L6.5 11.5 3 8",stroke:"#34d399",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),l.imported," task",l.imported!==1?"s":""," pushed to board",l.skipped!=null&&l.skipped>0?` \\xB7 ${l.skipped} already existed`:""]}),a==="error"&&i&&(0,ne.jsx)("div",{style:{margin:"0 28px 0",padding:"10px 14px",borderRadius:9,fontSize:12,display:"flex",alignItems:"center",gap:9,background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.18)",color:"#f87171"},children:i}),(0,ne.jsxs)("div",{style:{padding:"20px 24px 28px",display:"flex",flexDirection:"column",gap:8},children:[Tg&&(0,ne.jsx)("a",{href:Tg,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,padding:14,background:"#2563eb",border:"none",borderRadius:12,color:"#fff",fontSize:14,fontWeight:600,cursor:"pointer",textDecoration:"none",letterSpacing:"-0.1px",transition:"background 0.15s, transform 0.1s"},onMouseEnter:g=>{g.currentTarget.style.background="#3b82f6",g.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:g=>{g.currentTarget.style.background="#2563eb",g.currentTarget.style.transform="none"},children:"Open Web App \\u2192"}),a!=="done"&&(0,ne.jsx)("button",{onClick:()=>void f(),disabled:m,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,padding:12,background:"transparent",border:"1px solid rgba(255,255,255,0.08)",borderRadius:12,color:m?"rgba(255,255,255,0.25)":"rgba(255,255,255,0.4)",fontSize:13,fontWeight:500,cursor:m?"not-allowed":"pointer",transition:"border-color 0.15s, color 0.15s, background 0.15s"},onMouseEnter:g=>{m||(g.currentTarget.style.borderColor="rgba(255,255,255,0.15)",g.currentTarget.style.color="rgba(255,255,255,0.65)",g.currentTarget.style.background="rgba(255,255,255,0.03)")},onMouseLeave:g=>{m||(g.currentTarget.style.borderColor="rgba(255,255,255,0.08)",g.currentTarget.style.color="rgba(255,255,255,0.4)",g.currentTarget.style.background="transparent")},children:m?"\\u23F3 Pushing\\u2026":"\\u2191 Push local tasks"})]}),(0,ne.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px 20px"},children:[(0,ne.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:7,cursor:"pointer"},children:[(0,ne.jsx)("input",{type:"checkbox",checked:o,onChange:g=>n(g.target.checked),style:{accentColor:"#2563eb",width:13,height:13,cursor:"pointer"}}),(0,ne.jsx)("span",{style:{fontSize:11.5,color:"rgba(255,255,255,0.28)"},children:"Keep local files"})]}),Mg&&e&&(0,ne.jsx)("button",{onClick:e,style:{fontSize:11,color:"rgba(255,255,255,0.2)",background:"none",border:"none",cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2,transition:"color 0.15s"},onMouseEnter:g=>{g.currentTarget.style.color="rgba(255,255,255,0.45)"},onMouseLeave:g=>{g.currentTarget.style.color="rgba(255,255,255,0.2)"},children:"Dismiss (admin)"})]})]})})}var Pg={backlog:"Backlog",todo:"Todo","in-progress":"In Progress",review:"Review",done:"Done"};function yy(e,t,a){let r=a?e.filter(s=>{var i,d;return((i=s.title)==null?void 0:i.toLowerCase().includes(a))||((d=s.description)==null?void 0:d.toLowerCase().includes(a))}):e;if(a)return`${r.length} of ${e.length} tasks`;let o=r.filter(s=>s.status!=="done").length,n=r.filter(s=>s.status==="in-progress").length,l=r.filter(s=>s.status==="review").length;return`${o} open \\xB7 ${n} in-progress \\xB7 ${l} in review`}function Ag(){var Qo,Yo;let[e,t]=ie.default.useState([]),[a,r]=ie.default.useState(!0),[o,n]=ie.default.useState(!1),[l,s]=ie.default.useState({open:!1,task:null,tab:"details"}),[i,d]=ie.default.useState("board"),[f,m]=ie.default.useState(!1),[g,L]=ie.default.useState({open:!1,name:"",url:""}),[x,I]=ie.default.useState(420),[H,p]=ie.default.useState(!1),[u,c]=ie.default.useState(""),[v,w]=ie.default.useState(gr.map(h=>h.id)),[C,y]=ie.default.useState({status:"all",component:null,type:null,user:null,tags:[]}),[k,z]=ie.default.useState("Proto Board"),[N,U]=ie.default.useState(!1),[_,re]=ie.default.useState(!1),[ce,Se]=ie.default.useState("You"),[J,be]=ie.default.useState(null),[Te,ve]=ie.default.useState(""),[W,D]=ie.default.useState({}),[b,B]=ie.default.useState([]),[te,Ie]=ie.default.useState([]),Be=ie.default.useRef(null),We=ie.default.useRef(null),oe=ie.default.useRef(null),[Pe,Je]=ie.default.useState([]),Me=ie.default.useRef(!1),Ce=ie.default.useRef([]),[Ke,ye]=ie.default.useState([]),[De,at]=ie.default.useState([]),[Ot,zt]=ie.default.useState(!1),[Yt,Pt]=ie.default.useState(new Set),[Na,Ua]=ie.default.useState(!1);function ml(h,T,E){let X=Ce.current.find(O=>O.id===h);if(!X)return;X.status!=="in-progress"&&ca(h,{status:"in-progress"});let ue=E||X.agent||W.defaultAgent||"build",fe=`opencode run --model ${T} --agent ${ue} --dangerously-skip-permissions --format json -- ...`;at(O=>{if(O.some(le=>le.taskId===h&&(le.status==="running"||le.status==="queued")))return O;let ae=O.some(le=>le.status==="running"),xe={taskId:h,taskTitle:X.title,status:ae?"queued":"running",model:T,worktree:`wt/task-${h.slice(0,8)}`,branch:`agent/task-${h.slice(0,8)}`,startedAt:ae?void 0:new Date().toISOString(),logs:ae?["\\u23F3 Queued \\u2014 waiting for current run to finish"]:["\\u25B6 Starting agent run\\u2026",`$ ${fe}`]};return[...O,xe]}),fetch(`${no}/api/agent/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:h,model:T,agent:ue})}).then(async O=>{if(!O.ok){let ae=await O.json().catch(()=>({error:"Failed to start agent"}));at(xe=>xe.map(le=>le.taskId===h?{...le,status:"failed",logs:[...le.logs,`\\u2717 ${ae.error??"Failed to start agent"}`]}:le))}}).catch(O=>{at(ae=>ae.map(xe=>xe.taskId===h?{...xe,status:"failed",logs:[...xe.logs,`\\u2717 Network error: ${O.message}`]}:xe))})}function ao(h){fetch(`${no}/api/agent/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:h})}).catch(()=>{}),at(T=>{let E=T.some(ue=>ue.taskId===h&&ue.status==="running"),X=T.map(ue=>ue.taskId===h&&ue.status==="running"?{...ue,status:"failed",logs:[...ue.logs,"\\u2717 Stopped by user"]}:ue);if(E){let ue=X.find(fe=>fe.status==="queued");if(ue)return X.map(fe=>fe.taskId===ue.taskId?{...fe,status:"running",startedAt:new Date().toISOString(),logs:[...fe.logs,"\\u25B6 Starting agent run\\u2026"]}:fe)}return X})}function si(h){at(T=>T.filter(E=>E.taskId!==h))}function jo(h){Pt(T=>{let E=new Set(T);return E.has(h)?E.delete(h):E.add(h),E})}function Xo(h){zt(!0),Pt(new Set([h]))}function Ia(h){for(let T of h){let E=Ce.current.find(ue=>ue.id===T),X=(E==null?void 0:E.model)??W.defaultModel??"claude-sonnet-4-5";ml(T,X)}zt(!1),Pt(new Set)}ie.default.useEffect(()=>(Zt(),Sr(),hl(),Ir(),Ca(),ro(),oo(),Cr(),()=>{var h;We.current&&clearTimeout(We.current),(h=Be.current)==null||h.close()}),[]),ie.default.useEffect(()=>{document.body.setAttribute("data-theme","dark")},[]),ie.default.useEffect(()=>{function h(){let X=window.location.hash.match(/^#task-([a-f0-9]{30})$/i);if(!X){oe.current=null;return}let ue=X[1].toLowerCase();if(oe.current===ue)return;let fe=e.find(O=>O.id.toLowerCase()===ue);fe&&(oe.current=ue,Me.current?s(O=>({...O,open:!0,task:fe,tab:"details"})):s(O=>(O.task&&O.task.id!==fe.id&&Je(ae=>[...ae,O.task]),{...O,open:!0,task:fe,tab:"details"})),Me.current=!1)}function T(){}h();let E=()=>{oe.current=null,h()};return window.addEventListener("hashchange",E),window.addEventListener("vibeflow-task-ref-click",T),()=>{window.removeEventListener("hashchange",E),window.removeEventListener("vibeflow-task-ref-click",T)}},[e]),ie.default.useEffect(()=>{if(!l.open||!l.task)return;let h=e.find(X=>X.id===l.task.id);if(!h)return;let T=l.task;Object.keys(h).some(X=>h[X]!==T[X])&&s(X=>({...X,task:h}))},[e,l.open,(Qo=l.task)==null?void 0:Qo.id]),ie.default.useEffect(()=>{function h(T){var ue,fe,O;let E=(ue=T.target)==null?void 0:ue.tagName,X=E==="INPUT"||E==="TEXTAREA"||((fe=T.target)==null?void 0:fe.isContentEditable);if(T.key==="Escape"){if(Ot){zt(!1),Pt(new Set);return}if(g.open){L(ae=>({...ae,open:!1}));return}if(l.open){s(ae=>({...ae,open:!1}));return}if(f){m(!1);return}}if(!X&&((T.key==="?"||T.key==="/"&&T.shiftKey)&&((O=document.getElementById("header-shortcuts-hint"))==null||O.click()),T.altKey&&!T.ctrlKey&&!T.metaKey&&(T.key==="n"||T.key==="N")&&(T.preventDefault(),Ha(null,"details")),T.altKey&&!T.ctrlKey&&!T.metaKey&&(T.key==="f"||T.key==="F"))){T.preventDefault();let ae=document.getElementById("global-search");ae==null||ae.focus(),ae==null||ae.select()}}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[g.open,l.open,f,Ot]);function St(h,T,E,X,ue){let fe=new Date().toISOString(),O=Pg[T]??T,ae=Pg[E]??E,xe=Date.now()-3e3;ye(le=>le.some(R=>R.taskId===h&&R.to===ae&&new Date(R.timestamp).getTime()>xe)?le:[...le,{taskId:h,field:"status",from:O,to:ae,actor:X,timestamp:fe,source:ue}].slice(-500))}async function Zt(){try{let h=await ut.getTasks();Ce.current=h.tasks??[],t(h.tasks??[])}catch{}finally{r(!1)}}let gl=ie.default.useCallback((h,T,E)=>{let X=String(h.id??"");if(!X)return;let ue=h.created??h.createdAt,fe=h.updated?String(h.updated):void 0,O=Array.isArray(h.comments)?h.comments.filter(me=>!me.deleted).length:void 0,ae=Array.isArray(h.files)?h.files.length:void 0,xe=h.status?String(h.status):void 0,le=Ce.current.find(me=>me.id===X);xe&&le&&le.status!==xe&&St(X,le.status,xe,T??"Someone",E),t(me=>{let R=me.find(nt=>nt.id===X),Ue={id:X,title:h.title?String(h.title):(R==null?void 0:R.title)??"Untitled",description:h.description!=null?String(h.description):(R==null?void 0:R.description)??"",status:xe??(R==null?void 0:R.status)??"todo",type:h.type?String(h.type):R==null?void 0:R.type,priority:h.priority?String(h.priority):R==null?void 0:R.priority,agent:h.agent?String(h.agent):R==null?void 0:R.agent,model:h.model?String(h.model):R==null?void 0:R.model,selector:h.selector?String(h.selector):R==null?void 0:R.selector,cssSelector:h.cssSelector?String(h.cssSelector):R==null?void 0:R.cssSelector,file:h.file?String(h.file):R==null?void 0:R.file,line:typeof h.line=="number"?h.line:R==null?void 0:R.line,col:typeof h.col=="number"?h.col:R==null?void 0:R.col,component:h.component?String(h.component):R==null?void 0:R.component,url:h.url?String(h.url):R==null?void 0:R.url,reportBack:h.reportBack===!0||(R==null?void 0:R.reportBack)===!0,commit:h.commit?String(h.commit):R==null?void 0:R.commit,commits:Array.isArray(h.commits)?h.commits:R==null?void 0:R.commits,commentCount:O??(R==null?void 0:R.commentCount),fileCount:ae??(R==null?void 0:R.fileCount),createdAt:ue?String(ue):(R==null?void 0:R.createdAt)??new Date().toISOString(),updatedAt:fe??(R==null?void 0:R.updatedAt),author:h.author?String(h.author):R==null?void 0:R.author,tags:Array.isArray(h.tags)?h.tags:R==null?void 0:R.tags,sortKey:h.sortKey?String(h.sortKey):R==null?void 0:R.sortKey},Rt=me.filter(nt=>nt.id!==X);return Rt.push(Ue),Rt.sort((nt,Nt)=>{let wr=new Date(nt.updatedAt??nt.createdAt??"").getTime(),kr=new Date(Nt.updatedAt??Nt.createdAt??"").getTime();return wr===kr?nt.id.localeCompare(Nt.id):kr-wr}),Ce.current=Rt,Rt})},[]);async function Sr(){try{let h=await ut.getProject();h.name&&z(h.name),h.gitUserName&&Se(h.gitUserName)}catch{}}async function Ca(){try{let h=await fetch("/api/github-url").then(T=>T.json());be(h.githubUrl??null)}catch{}}async function hl(){var h;try{let E=await ut.getSettings();E.experimentalAgents===void 0&&(E.experimentalAgents=!0),D(E),(h=E.visibleCols)!=null&&h.length&&w(E.visibleCols),E.viewMode&&d(E.viewMode),E.panelWidth&&E.panelWidth>=280&&E.panelWidth<=900&&I(E.panelWidth)}catch{}}async function Ir(){try{let h=await ut.getCopilotStatus();h!=null&&h.authenticated&&(h!=null&&h.username)?ve(`Copilot: ${h.username}`):ve("Copilot: not logged in")}catch{}}async function ro(){try{if(ut.getModels){let h=await ut.getModels();h.models&&h.models.length>0&&B(h.models)}}catch{}}async function oo(){try{if(ut.getAgents){let h=await ut.getAgents();h.agents&&h.agents.length>0&&Ie(h.agents)}}catch{}}function Cr(){let T=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,E=new WebSocket(T);Be.current=E,E.addEventListener("open",()=>{U(!0),re(!0),Zt()}),E.addEventListener("close",()=>{U(!1),We.current=setTimeout(Cr,1500)}),E.addEventListener("message",ue=>{var fe;try{let O=JSON.parse(ue.data);if(O.type==="tasks-updated"||(fe=O.type)!=null&&fe.startsWith("task:")){Zt();return}if(O.type==="task-changed"&&O.task){let ae=O.task,xe=typeof ae.alteredBy=="string"?ae.alteredBy:typeof ae.author=="string"?ae.author:"Someone",le=O.source==="cli"?"cli":void 0;gl(ae,xe,le);return}if(O.type==="task-deleted"&&O.taskId){let ae=String(O.taskId);t(xe=>{let le=xe.filter(me=>me.id!==ae);return Ce.current=le,le})}if(O.type==="agent-run-started"){at(ae=>{if(ae.find(Ue=>Ue.taskId===O.taskId&&(Ue.status==="running"||Ue.status==="queued")))return ae;let le=Ce.current.find(Ue=>Ue.id===O.taskId),me=ae.some(Ue=>Ue.status==="running"),R={taskId:O.taskId,taskTitle:(le==null?void 0:le.title)??O.taskId.slice(0,8),status:me?"queued":"running",model:O.model,worktree:`wt/task-${O.taskId.slice(0,8)}`,branch:`agent/task-${O.taskId.slice(0,8)}`,startedAt:me?void 0:new Date().toISOString(),logs:[O.command??"\\u25B6 Starting agent run\\u2026"]};return[...ae,R]});return}if(O.type==="agent-run-log"){at(ae=>ae.map(xe=>{if(xe.taskId!==O.taskId)return xe;let le={...xe,logs:[...xe.logs,O.log]};for(let me of O.log.split(`\n`)){let R=me.trim();if(!(!R||!R.startsWith("{")))try{let Ue=JSON.parse(R);if(Ue.type==="step_finish"&&typeof Ue.part=="object"&&Ue.part){let Rt=Ue.part,nt=Rt.tokens,Nt=typeof Rt.cost=="number"?Rt.cost:0;nt&&(le.inputTokens=(le.inputTokens??0)+(nt.input??0),le.outputTokens=(le.outputTokens??0)+(nt.output??0),le.totalTokens=(le.totalTokens??0)+(nt.total??0),le.reasoningTokens=(le.reasoningTokens??0)+(nt.reasoning??0),le.cost=(le.cost??0)+Nt)}}catch{}}return le}));return}if(O.type==="agent-run-finished"){at(ae=>{let xe=ae.map(me=>me.taskId===O.taskId?{...me,status:O.success?"done":"failed",completedAt:new Date().toISOString(),logs:[...me.logs,O.success?"\\u2713 Agent run completed":`\\u2717 Agent run failed (exit ${O.exitCode})`],inputTokens:typeof O.inputTokens=="number"?O.inputTokens:me.inputTokens,outputTokens:typeof O.outputTokens=="number"?O.outputTokens:me.outputTokens,totalTokens:typeof O.totalTokens=="number"?O.totalTokens:me.totalTokens,reasoningTokens:typeof O.reasoningTokens=="number"?O.reasoningTokens:me.reasoningTokens,cost:typeof O.cost=="number"?O.cost:me.cost,durationMs:me.startedAt?Date.now()-new Date(me.startedAt).getTime():void 0}:me);if(!xe.find(me=>me.status==="running")){let me=xe.find(R=>R.status==="queued");if(me)return xe.map(R=>R.taskId===me.taskId?{...R,status:"running",startedAt:new Date().toISOString(),logs:[...R.logs,"\\u25B6 Starting agent run\\u2026"]}:R)}return xe});return}}catch{}});let X=setInterval(()=>{E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"ping"}))},2e4);E.addEventListener("close",()=>clearInterval(X))}async function ca(h,T){let E=Ce.current.find(X=>X.id===h);t(X=>{let ue=X.map(fe=>fe.id===h?{...fe,...T}:fe);return Ce.current=ue,ue}),T.status&&(E!=null&&E.status)&&T.status!==E.status&&St(h,E.status,T.status,ce);try{let X=await ut.updateTask(h,T);X.task&&t(ue=>{let fe=ue.map(O=>O.id===h?X.task:O);return Ce.current=fe,fe})}catch{Zt()}}async function ii(h,T,E,X,ue){let fe=Ce.current.filter(le=>le.status===T).sort(Wr),O=Od(fe,h,E,X),ae=ue??O.newSortKey,xe=O.normalizationPatches;t(le=>{let me=new Map;for(let{id:Ue,sortKey:Rt}of xe)me.set(Ue,{sortKey:Rt});me.set(h,{status:T,sortKey:ae});let R=le.map(Ue=>me.has(Ue.id)?{...Ue,...me.get(Ue.id)}:Ue);return Ce.current=R,R}),await ut.updateTask(h,{status:T,sortKey:ae}).catch(()=>{Zt()})}async function ui(h){t(T=>{let E=T.filter(X=>X.id!==h);return Ce.current=E,E});try{await ut.deleteTask(h)}catch{Zt()}}async function di(h){var T;try{let E=await ut.createTask(h);return await Zt(),(T=E==null?void 0:E.task)==null?void 0:T.id}catch{}}function Ha(h,T="details",E){Je([]),s({open:!0,task:h,tab:T,addColumnId:E})}function fi(){Je(h=>{if(h.length===0)return h;let T=h[h.length-1],E=h.slice(0,-1);return Me.current=!0,oe.current=null,window.location.hash=`#task-${T.id}`,s(X=>({...X,open:!0,task:T,tab:"details"})),E})}function xl(h,T){if(/\\.html?$/i.test(h)){window.open(T,"_blank","noopener,noreferrer");return}L({open:!0,name:h,url:T})}let ci=yy(e,v,u.toLowerCase()),no=window.location.origin,qa=ie.default.useMemo(()=>{let h=new Set;return e.forEach(T=>(T.tags??[]).forEach(E=>h.add(E))),Array.from(h).sort()},[e]),lo=ie.default.useMemo(()=>{var T;let h=(T=l.task)==null?void 0:T.id;return h?Ke.filter(E=>E.taskId===h).map(({field:E,from:X,to:ue,actor:fe,timestamp:O,source:ae})=>({field:E,from:X,to:ue,actor:fe,timestamp:O,source:ae})):[]},[(Yo=l.task)==null?void 0:Yo.id,Ke]),vl=ie.default.useMemo(()=>{let h=e;return C.status!=="all"&&(h=h.filter(T=>T.status===C.status)),C.component&&(h=h.filter(T=>T.component===C.component)),C.type&&(h=h.filter(T=>T.type===C.type)),C.user&&(h=h.filter(T=>T.author===C.user)),C.tags&&C.tags.length>0&&(h=h.filter(T=>C.tags.every(E=>(T.tags??[]).includes(E)))),h},[e,C]),yl=ie.default.useMemo(()=>new Map(De.map(h=>[h.taskId,h.status])),[De]),so=_&&!N;return(0,ne.jsxs)(ne.Fragment,{children:[hy&&!o&&(0,ne.jsx)(vy,{onClose:Mg?()=>n(!0):void 0}),(0,ne.jsx)(_d,{projectName:k,missingProjectIconStyle:"vibeflow",wsConnected:N,port:gy,searchQuery:u,filterTags:C.tags,allTags:qa,onToggleTag:h=>{let T=C.tags??[],E=T.includes(h)?T.filter(X=>X!==h):[...T,h];y(X=>({...X,tags:E}))},premiumUsage:Te,isLoading:a,taskSummary:ci,onSearchChange:c,onSettings:()=>m(!0),agentRuns:De,selectMode:Ot,selectedCount:Yt.size,agentQueueCount:De.filter(h=>h.status==="running"||h.status==="queued").length,onOpenAgentQueue:()=>Ua(!0),experimentalAgents:W.experimentalAgents}),(0,ne.jsx)(tf,{tasks:e,filter:C,view:i,onFilter:y,onViewChange:h=>{d(h),ut.saveSettings({...W,viewMode:h}),D(T=>({...T,viewMode:h}))}}),(0,ne.jsxs)("div",{className:"flex flex-1 overflow-hidden",style:{minHeight:0,position:"relative"},children:[i==="list"?(0,ne.jsx)(qd,{tasks:vl,searchQuery:u,isLoading:a,onOpenPanel:(h,T)=>Ha(h,T),onAddTask:h=>Ha(null,"details",h),onDrop:(h,T)=>ca(h,{status:T}),experimentalAgents:W.experimentalAgents}):(0,ne.jsx)(Ud,{tasks:vl,visibleCols:v,searchQuery:u,isLoading:a,onOpenPanel:(h,T,E)=>Ha(h,T,E),onDrop:(h,T)=>ca(h,{status:T}),onReorder:ii,selectMode:Ot,selectedTaskIds:Yt,onToggleSelect:jo,onEnterSelectMode:Xo,agentStatuses:W.experimentalAgents===!0?yl:void 0,onRunSelectedAgents:W.experimentalAgents===!0?Ia:void 0,onExitSelectMode:()=>{zt(!1),Pt(new Set)},experimentalAgents:W.experimentalAgents}),l.open&&(0,ne.jsxs)("div",{id:"detail-panel-container",style:{width:x,zIndex:H?30:10},className:H?"resizing":"",children:[(0,ne.jsx)("div",{id:"detail-panel-resize-handle",onMouseDown:h=>{h.preventDefault(),p(!0),document.body.classList.add("vibeflow-resizing-panel");let T=h.clientX,E=x,X=fe=>{let O=E-(fe.clientX-T);I(Math.max(360,Math.min(860,O)))},ue=fe=>{p(!1),document.body.classList.remove("vibeflow-resizing-panel");let O=Math.max(360,Math.min(860,E-(fe.clientX-T)));ut.saveSettings({...W,panelWidth:O}),D(ae=>({...ae,panelWidth:O})),window.removeEventListener("mousemove",X),window.removeEventListener("mouseup",ue)};window.addEventListener("mousemove",X),window.addEventListener("mouseup",ue)}}),(0,ne.jsx)(ef,{open:l.open,task:l.task,tab:l.tab,showLockIndicator:!1,addColumnId:l.addColumnId,gitUserName:ce,githubUrl:J,baseUrl:no,isResizing:H,api:ut,onClose:()=>{Je([]),s(h=>({...h,open:!1}))},onSave:async h=>{l.task&&await ca(l.task.id,h),s(T=>({...T,open:!1}))},onCreate:async h=>{let T=await di(h);return s(E=>({...E,open:!1})),T},onDelete:async h=>{await ui(h),s(T=>({...T,open:!1}))},onPatch:ca,onFilePreview:xl,onGoBack:Pe.length>0?fi:void 0,navBackLabel:Pe.length>0?Pe[Pe.length-1].title:void 0,externalLocalChanges:lo,allTasks:e,agentRun:De.find(h=>{var T;return h.taskId===((T=l.task)==null?void 0:T.id)}),onRunAgent:ml,onStopAgent:ao,onDequeueAgent:si,models:b,defaultModel:W.defaultModel,perTypeModels:W.perTypeModels,defaultModelBug:W.defaultModelBug,defaultModelResearch:W.defaultModelResearch,defaultModelTask:W.defaultModelTask,agents:te,defaultAgent:W.defaultAgent,experimentalAgents:W.experimentalAgents,createBranch:W.createBranch})]})]}),W.experimentalAgents===!0&&(0,ne.jsx)(nf,{open:Na,runs:De,onStop:ao,onOpenTask:h=>{let T=e.find(E=>E.id===h);T&&(Ha(T,"agent"),Ua(!1))},onClose:()=>Ua(!1)}),so&&(0,Rg.createPortal)((0,ne.jsx)("div",{id:"ws-lost-overlay",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:99999,background:"rgba(2, 6, 23, 0.88)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",padding:16,pointerEvents:"all",cursor:"not-allowed"},children:(0,ne.jsxs)("div",{style:{width:"min(420px, 92vw)",borderRadius:14,border:"1px solid var(--p-border-s)",background:"var(--p-card)",boxShadow:"0 16px 40px rgba(2,6,23,0.7)",padding:"20px 22px",display:"flex",flexDirection:"column",gap:10,cursor:"default",pointerEvents:"auto"},children:[(0,ne.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,ne.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"var(--p-text-m)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"spin 1.1s linear infinite",flexShrink:0},children:(0,ne.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),(0,ne.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--p-text)"},children:"Connection Lost"})]}),(0,ne.jsx)("div",{style:{fontSize:12,color:"var(--p-text-m)",lineHeight:1.6},children:"Real-time connection to the server was interrupted. Reconnecting in the background\\u2026"})]})}),document.body),(0,ne.jsx)(rf,{open:f,visibleCols:v,settings:W,models:b,agents:te,onClose:()=>m(!1),onSave:(h,T)=>{w(h);let E={...W,...T,visibleCols:h};D(E),ut.saveSettings(E)}}),(0,ne.jsx)(of,{open:g.open,name:g.name,url:g.url,onClose:()=>L(h=>({...h,open:!1}))})]})}var Fg=F(j(),1),Dg=document.getElementById("root");Dg&&(0,Eg.createRoot)(Dg).render((0,Fg.jsx)(Ag,{}));})();\n/*! Bundled license information:\n\nreact/cjs/react.production.min.js:\n (**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nscheduler/cjs/scheduler.production.min.js:\n (**\n * @license React\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nreact-dom/cjs/react-dom.production.min.js:\n (**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nreact/cjs/react-jsx-runtime.production.min.js:\n (**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *)\n\nlucide-react/dist/esm/shared/src/utils.js:\nlucide-react/dist/esm/defaultAttributes.js:\nlucide-react/dist/esm/Icon.js:\nlucide-react/dist/esm/createLucideIcon.js:\nlucide-react/dist/esm/icons/bot.js:\nlucide-react/dist/esm/icons/chevron-down.js:\nlucide-react/dist/esm/icons/chevron-right.js:\nlucide-react/dist/esm/icons/circle-check-big.js:\nlucide-react/dist/esm/icons/clock.js:\nlucide-react/dist/esm/icons/download.js:\nlucide-react/dist/esm/icons/eye.js:\nlucide-react/dist/esm/icons/file-text.js:\nlucide-react/dist/esm/icons/flag.js:\nlucide-react/dist/esm/icons/folder-tree.js:\nlucide-react/dist/esm/icons/git-branch.js:\nlucide-react/dist/esm/icons/layout-dashboard.js:\nlucide-react/dist/esm/icons/list.js:\nlucide-react/dist/esm/icons/lock.js:\nlucide-react/dist/esm/icons/message-circle.js:\nlucide-react/dist/esm/icons/panels-top-left.js:\nlucide-react/dist/esm/icons/paperclip.js:\nlucide-react/dist/esm/icons/play.js:\nlucide-react/dist/esm/icons/plus.js:\nlucide-react/dist/esm/icons/search.js:\nlucide-react/dist/esm/icons/settings.js:\nlucide-react/dist/esm/icons/shield-check.js:\nlucide-react/dist/esm/icons/square.js:\nlucide-react/dist/esm/icons/tag.js:\nlucide-react/dist/esm/icons/trash-2.js:\nlucide-react/dist/esm/icons/triangle-alert.js:\nlucide-react/dist/esm/icons/upload.js:\nlucide-react/dist/esm/icons/user.js:\nlucide-react/dist/esm/icons/x.js:\nlucide-react/dist/esm/lucide-react.js:\n (**\n * @license lucide-react v0.468.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n *)\n*/\n';var Jn=Xn(import.meta.url),Zn=Qn(Jn),er=[Ze(Zn,"kanban-template.html"),Ze(process.cwd(),"src","server","kanban-template.html"),Ze(process.cwd(),"dist","server","kanban-template.html")];function tr(t){let e=er.find(r=>Yn(r));if(!e)throw new Error("kanban-template.html not found in expected locations");return Gn(e,"utf8").replaceAll("__PORT__",String(t))}function nr(t){return t.saasMode?`window.__SAAS_MODE__ = true; window.__BOARD_URL__ = ${JSON.stringify(t.boardUrl??"")}; window.__BOARD_NAME__ = ${JSON.stringify(t.boardName??"")}; window.__IS_ADMIN__ = ${t.isAdmin?"true":"false"};`:""}var rr="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiByeD0iNCIgZmlsbD0iIzI1NjNlYiIvPjxyZWN0IHg9IjIuNSIgeT0iNSIgd2lkdGg9IjIiIGhlaWdodD0iOCIgcng9IjEiIGZpbGw9IndoaXRlIiBvcGFjaXR5PSIwLjciLz48cmVjdCB4PSI2LjUiIHk9IjIiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiByeD0iMSIgZmlsbD0id2hpdGUiLz48cmVjdCB4PSIxMC41IiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSI2IiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuNyIvPjxyZWN0IHg9IjE0LjUiIHk9IjQiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuODUiLz48L3N2Zz4=";function ar(t){return`<!DOCTYPE html>
1698
1698
  <html lang="en" class="dark">
1699
1699
  <head>
1700
1700
  <meta charset="UTF-8">
@@ -1702,21 +1702,21 @@ var PROTO_CONFIG = {
1702
1702
  <title>Vibeflow \u2014 Board</title>
1703
1703
  <link rel="icon" href="${rr}" type="image/svg+xml">
1704
1704
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
1705
- <style>${Et}</style>
1705
+ <style>${Tt}</style>
1706
1706
  </head>
1707
1707
  <body class="h-screen overflow-hidden flex flex-col" style="background:#020c1b;">
1708
1708
  <div id="root"></div>
1709
1709
  <script>window.__PORT__ = ${t.port}; ${nr(t)}</script>
1710
- <script>${Ze}</script>
1710
+ <script>${Je}</script>
1711
1711
  </body>
1712
- </html>`}function tt(t){let e=typeof t=="number"?{port:t}:t;return Ze?ar(e):tr(e.port)}import{readFileSync as Pt,writeFileSync as Za,mkdirSync as eo,existsSync as Rt}from"fs";import{join as Nt,basename as or}from"path";import{execSync as ir}from"child_process";var It={port:3700};function lr(t){return Nt(t,A,mt)}function ge(t){let e=lr(t);if(!Rt(e))return{...It};let r=Pt(e,"utf-8"),c=JSON.parse(r);return{...It,...c}}function Pe(t){let e=Nt(t,"package.json");if(Rt(e))try{let r=JSON.parse(Pt(e,"utf-8"));if(r.name)return r.name}catch{}return or(t)}function Lt(t){try{return ir("git branch --show-current",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}import{mkdirSync as sr,writeFileSync as cr}from"fs";import{dirname as ur}from"path";import{randomBytes as dr}from"crypto";function Mt(t){let e=t;return{...t,text:t.text||e.body||"",author:t.author??"agent"}}function ee(t,e){let r=Q(t,e);return((r?J(r):null)?.comments??[]).filter(d=>!d.deleted).map(Mt)}function zt(t){return yt(t)}function oe(t,e,r,c,d,i,o){c=zt(c);let l=Q(t,e),s=(l?J(l):null)?.comments??[],u={id:dr(8).toString("hex"),author:r,text:c,...d&&d.length>0?{files:d}:{},...i&&i!=="comment"?{type:i}:{},createdAt:new Date().toISOString(),source:o??"cli"},f=[...s,u];if(!$(t,e,{comments:f})){let y=vt(t,e,new Date().toISOString());sr(ur(y),{recursive:!0}),cr(y,JSON.stringify({id:e,comments:f},null,2),"utf-8")}return u}function Re(t,e,r,c){let d=Q(t,e),o=(d?J(d):null)?.comments??[],l=o.find(a=>a.id===r&&!a.deleted);return l?(l.text=zt(c),l.updatedAt=new Date().toISOString(),$(t,e,{comments:o}),Mt(l)):null}function Ne(t,e,r){let c=Q(t,e),i=(c?J(c):null)?.comments??[],o=i.findIndex(l=>l.id===r&&!l.deleted);return o===-1?!1:(i[o]={...i[o],deleted:!0,text:"[Comment deleted]",updatedAt:new Date().toISOString()},$(t,e,{comments:i}),!0)}import{execSync as Ot}from"child_process";import{existsSync as pr,readFileSync as fr,writeFileSync as fo,mkdirSync as go}from"fs";import{join as gr}from"path";var br="config.json";function mr(t){return gr(t,A,br)}function hr(t){let e=mr(t);if(!pr(e))return{};try{return JSON.parse(fr(e,"utf-8"))}catch{return{}}}function vr(t){return t.length<=8?"***":t.slice(0,6)+"..."+t.slice(-4)}function yr(){try{return Ot("gh auth token --hostname github.com",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}async function xr(t){try{let e=await fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${t}`,"User-Agent":"proto-studio-cli",Accept:"application/vnd.github+json"},signal:AbortSignal.timeout(5e3)});return e.ok?(await e.json()).login??null:null}catch{return null}}function kr(t){let e=process.env.GITHUB_TOKEN;if(e?.trim())return{token:e.trim(),source:"env"};let c=hr(t).copilotToken;if(typeof c=="string"&&c.trim())return{token:c.trim(),source:"config"};let d=yr();return d?{token:d,source:"gh-cli"}:null}async function Ce(t){let e=kr(t);if(!e)return{authenticated:!1,source:null,tokenHint:null,username:null};let r=await xr(e.token).catch(()=>null);return{authenticated:!0,source:e.source,tokenHint:vr(e.token),username:r}}function Le(){try{return Ot("gh --version",{encoding:"utf-8",timeout:3e3,stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}import{existsSync as nt,readFileSync as At,writeFileSync as $t,mkdirSync as Dt}from"fs";import{join as Me}from"path";import Ft from"os";var wr="settings.json";function Bt(){return Me(Ft.homedir(),".vibeflow","settings.json")}function Wt(t){return Me(t,A,wr)}function rt(){try{return JSON.parse(At(Bt(),"utf-8"))}catch{return{}}}function Ut(t){let e=Me(Ft.homedir(),".vibeflow");nt(e)||Dt(e,{recursive:!0}),$t(Bt(),JSON.stringify(t,null,2),"utf-8")}function B(t){let e=rt(),r=Wt(t);if(!nt(r))return e;try{let c=JSON.parse(At(r,"utf-8"));return{...e,...c}}catch{return e}}function Ht(t,e){let r=Me(t,A);nt(r)||Dt(r,{recursive:!0});let c=Wt(t),i={...B(t),...e};return $t(c,JSON.stringify(i,null,2),"utf-8"),i}import ze from"fs/promises";import Sr from"os";import at from"path";var Cr=at.join(Sr.homedir(),".vibeflow"),Oe=at.join(Cr,"token");async function W(){try{return(await ze.readFile(Oe,"utf8")).trim()||null}catch{return null}}async function qt(t){await ze.mkdir(at.dirname(Oe),{recursive:!0}),await ze.writeFile(Oe,t,{mode:384})}async function Vt(){try{await ze.unlink(Oe)}catch{}}import{initTRPC as _r,TRPCError as ot}from"@trpc/server";import{z as j}from"zod";var Yt=_r.context().create(),jr=Yt.router,U=Yt.procedure,Kt=j.enum(["backlog","todo","in-progress","review","done"]),it=j.object({id:j.string().min(1)}),Gt=jr({project:U.query(({ctx:t})=>({name:Pe(t.projectDir),projectDir:t.projectDir})),copilotStatus:U.query(async({ctx:t})=>await Le()?await Ce(t.projectDir):{authenticated:!1,reason:"gh CLI not found"}),tasks:U.query(({ctx:t})=>({tasks:Y(t.projectDir).map(c=>({...c,createdAt:c.created,commentCount:(c.comments??[]).length,fileCount:Ye(t.projectDir,c.id)}))})),searchTasks:U.input(j.object({query:j.string().min(1),limit:j.number().int().min(1).max(100).optional(),pageScope:j.string().optional()})).query(({ctx:t,input:e})=>{let r=Y(t.projectDir),c=Math.max(1,e.limit??10),d=e.query.toLowerCase();return{results:r.filter(o=>`${o.title} ${o.description??""} ${o.type??""} ${o.component??""}`.toLowerCase().includes(d)).slice(0,c).map(o=>({score:1,task:o,commentCount:(o.comments??[]).length,fileCount:Ye(t.projectDir,o.id)}))}}),createTask:U.input(j.object({title:j.string().min(1),selector:j.string().min(1),description:j.string().optional(),cssSelector:j.string().optional(),url:j.string().optional(),type:j.string().optional(),priority:j.string().optional(),file:j.string().optional(),line:j.number().int().positive().optional(),col:j.number().int().positive().optional(),component:j.string().optional(),status:Kt.optional(),agent:j.string().optional(),model:j.string().optional(),author:j.string().optional(),annotatedElementText:j.string().max(300).optional()})).mutation(({ctx:t,input:e})=>{let r=fe(t.projectDir,{title:e.title,description:e.description??"",selector:e.selector,cssSelector:e.cssSelector,url:e.url,status:e.status??"todo",screenshot:void 0,file:e.file,line:e.line,col:e.col,component:e.component,type:e.type,priority:e.priority,author:e.author??"Unknown",agent:e.agent,model:e.model,annotatedElementText:e.annotatedElementText});return t.broadcast({type:"tasks-updated"}),{success:!0,task:r}}),updateTask:U.input(j.object({id:j.string().min(1),updates:j.object({status:Kt.optional(),title:j.string().min(1).optional(),description:j.string().optional(),type:j.string().optional(),priority:j.string().optional(),reportBack:j.boolean().optional(),agent:j.string().optional(),model:j.string().optional()})})).mutation(({ctx:t,input:e})=>{let r=$(t.projectDir,e.id,e.updates);if(!r)throw new ot({code:"NOT_FOUND",message:"Task not found"});return t.broadcast({type:"tasks-updated"}),{success:!0,task:r}}),deleteTask:U.input(it).mutation(({ctx:t,input:e})=>{if(!Ee(t.projectDir,e.id))throw new ot({code:"NOT_FOUND",message:"Task not found"});return t.broadcast({type:"tasks-updated"}),{success:!0}}),comments:U.input(it).query(({ctx:t,input:e})=>({comments:ee(t.projectDir,e.id)})),addComment:U.input(j.object({taskId:j.string().min(1),text:j.string().min(1),author:j.enum(["user","agent"]).optional().default("user"),files:j.array(j.string()).optional(),source:j.enum(["cli","web"]).optional().default("web")})).mutation(({ctx:t,input:e})=>{let r=oe(t.projectDir,e.taskId,e.author,e.text.trim(),e.files,void 0,e.source);return t.broadcast({type:"tasks-updated"}),{success:!0,comment:r}}),updateComment:U.input(j.object({taskId:j.string().min(1),commentId:j.string().min(1),text:j.string().min(1)})).mutation(({ctx:t,input:e})=>{let r=Re(t.projectDir,e.taskId,e.commentId,e.text.trim());if(!r)throw new ot({code:"NOT_FOUND",message:"Comment not found"});return{success:!0,comment:r}}),deleteComment:U.input(j.object({taskId:j.string().min(1),commentId:j.string().min(1)})).mutation(({ctx:t,input:e})=>(Ne(t.projectDir,e.taskId,e.commentId),t.broadcast({type:"tasks-updated"}),{success:!0})),files:U.input(it).query(({ctx:t,input:e})=>({files:q(t.projectDir,e.id)})),models:U.query(async()=>{try{let{execSync:t}=await import("child_process");return{models:t("opencode models",{encoding:"utf-8",timeout:1e4,stdio:"pipe"}).split(`
1713
- `).map(d=>d.trim()).filter(d=>d.length>0&&!d.startsWith("#")).map(d=>{let i=d.split("/"),o=i[0]||"other",a=(i.slice(1).join("/")||d).replace(/-/g," ").replace(/(\d+\.\d+)/,"v$1").replace(/\b\w/g,s=>s.toUpperCase());return{id:d,label:a,provider:o}}),error:null}}catch(t){let e=t instanceof Error?t.message:"Unknown error";return{models:[],error:`OpenCode not found: ${e}`}}})});import{execSync as Qt}from"child_process";function lt(t){try{let e=Qt("git config user.name",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim(),r=Qt("git config user.email",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return{name:e||"Unknown",email:r||""}}catch{return{name:"Unknown",email:""}}}function Ae(t){return/^[a-f0-9]{30}$/.test(t)}function be(t,e){let r=t.headers.origin;return r&&!r.startsWith("http://localhost")?(e.status(403).json({error:"Forbidden"}),!1):!0}var zr=new Set(["https://app.vibeflow.tools"]);function Or(t){if(!t)return null;try{let e=new URL(t).origin;return zr.has(e)?e:null}catch{return null}}var si=Pr(import.meta.url);function un(){for(let t of Object.values(Lr()))for(let e of t??[])if(e.family==="IPv4"&&!e.internal)return e.address;return null}function dn(t,e){t.get("/api/pages",(r,c)=>{c.json({pages:e})})}var en=new Map;function tn(t){let r=en.get(t);if(r&&Date.now()-r.fetchedAt<3e5)return r.shas;try{let c=_e("git log --remotes --format=%H",{cwd:t,timeout:5e3}).toString().trim(),d=new Set(c?c.split(`
1714
- `):[]);return en.set(t,{shas:d,fetchedAt:Date.now()}),d}catch{return new Set}}function nn(t,e){return t?e.has(t):null}function pn(t,e,r){t.get("/api/project",(i,o)=>{o.json({name:Pe(e),projectDir:e,branch:Lt(e)})}),t.get("/api/tasks",(i,o)=>{let l=Y(e),a=tn(e),s=l.map(u=>{let f=u.commits?.length?u.commits[u.commits.length-1].sha:void 0;return{...u,createdAt:u.created,commentCount:(u.comments??[]).filter(k=>!k.deleted).length,fileCount:u.files?.length??0,commitPushed:nn(f,a)}});o.json({tasks:s})}),t.param("id",(i,o,l,a)=>{if(!Ae(a)){o.status(400).json({error:"Invalid task id"});return}l()}),t.get("/api/tasks/:id",(i,o)=>{let{id:l}=i.params,a=Q(e,l),s=a?J(a):null;if(!s){o.status(404).json({error:"Task not found"});return}let u=tn(e),f=s.commits?.length?s.commits[s.commits.length-1].sha:void 0;o.json({...s,commitPushed:nn(f,u)})}),t.post("/api/tasks",(i,o)=>{let{title:l,description:a,selector:s,cssSelector:u,url:f,type:k,priority:y,file:b,line:h,col:p,component:g,status:x,agent:m,model:S,screenshot:v,annotatedElementText:_,tags:C,sortKey:R}=i.body;if(!l||!s){o.status(400).json({error:"Missing required fields: title, selector"});return}let z=lt(e),P=fe(e,{title:l,description:a||"",selector:s,cssSelector:u||void 0,url:f||void 0,status:["backlog","todo","in-progress","review","done"].includes(x)?x:"todo",file:b||void 0,line:h!=null?Number(h):void 0,col:p!=null?Number(p):void 0,component:g||void 0,type:k||void 0,priority:y||void 0,author:z.name,agent:m||void 0,model:S||void 0,annotatedElementText:_?String(_).slice(0,300):void 0,tags:Array.isArray(C)?C.filter(T=>typeof T=="string"&&T.length>0):void 0,sortKey:R?String(R):void 0});if(v){let T=K(e,A,ke);Xt(T,{recursive:!0});let L=`${P.id}.png`;Jt(K(T,L),Buffer.from(v,"base64")),$(e,P.id,{screenshot:L}),P.screenshot=L}console.log(`[Vibeflow] Task created: "${P.title}" (${P.id})`),r({type:"tasks-updated"}),o.json({success:!0,task:P})}),t.patch("/api/tasks/:id",(i,o)=>{let{id:l}=i.params,a=i.body,s=["backlog","todo","in-progress","review","done"];if(a.status!==void 0&&!s.includes(a.status)){o.status(400).json({error:`Invalid status: ${a.status}`});return}let u=$(e,l,a);if(!u){o.status(404).json({error:"Task not found"});return}console.log(`[Vibeflow] Task updated: "${u.title}" (${u.id}) \u2192 status:${u.status}`),r({type:"task-changed",taskId:u.id,action:"update",task:u}),o.json({success:!0,task:u})}),t.delete("/api/tasks/:id",(i,o)=>{let{id:l}=i.params;if(!Ee(e,l)){o.status(404).json({error:"Task not found"});return}console.log(`[Vibeflow] Task deleted: ${l}`),r({type:"task-deleted",taskId:l}),o.json({success:!0})}),t.get("/api/tasks/:id/comments",(i,o)=>{let{id:l}=i.params,a=ee(e,l);o.json({comments:a})}),t.post("/api/tasks/:id/comments",(i,o)=>{let{id:l}=i.params,{author:a,text:s,files:u,source:f}=i.body;if(!s||!s.trim()){o.status(400).json({error:"Missing required field: text"});return}let k=a==="agent"?"agent":"user",y=f==="cli"?"cli":"web",b=oe(e,l,k,s.trim(),Array.isArray(u)?u:void 0,void 0,y);r({type:"tasks-updated"}),o.json({success:!0,comment:b})}),t.patch("/api/tasks/:id/comments/:commentId",(i,o)=>{let{id:l,commentId:a}=i.params,{text:s}=i.body;if(!s||!s.trim()){o.status(400).json({error:"Missing required field: text"});return}let u=Re(e,l,a,s.trim());if(!u){o.status(404).json({error:"Comment not found"});return}o.json({success:!0,comment:u})}),t.delete("/api/tasks/:id/comments/:commentId",(i,o)=>{let{id:l,commentId:a}=i.params;if(!Ne(e,l,a)){o.status(404).json({error:"Comment not found"});return}r({type:"tasks-updated"}),o.json({success:!0})}),t.get("/api/tasks/:id/files",(i,o)=>{let{id:l}=i.params,a=q(e,l);o.json({files:a})}),t.get("/api/tasks/:id/files/:filename",(i,o)=>{let{id:l,filename:a}=i.params,s=St(e,l,a);if(!s){o.status(404).json({error:"File not found"});return}o.sendFile(s)});let c=new Set([".png",".jpg",".jpeg",".gif",".webp",".pdf",".txt",".md",".json",".csv",".svg",".mp4",".mov",".zip"]);t.post("/api/tasks/:id/files/:filename",te.raw({type:"*/*",limit:"50mb"}),(i,o)=>{let{id:l,filename:a}=i.params;if(!a||a.includes("/")||a.includes("\\")){o.status(400).json({error:"Invalid filename"});return}let s=on(decodeURIComponent(a)).toLowerCase();if(!c.has(s)){o.status(415).json({error:"File type not allowed"});return}let u=i.body;if(!Buffer.isBuffer(u)||u.length===0){o.status(400).json({error:"Empty file body"});return}let f=kt(e,l,decodeURIComponent(a),u);r({type:"tasks-updated"}),o.json({success:!0,file:f})}),t.delete("/api/tasks/:id/files/:filename",(i,o)=>{let{id:l,filename:a}=i.params;if(!wt(e,l,a)){o.status(404).json({error:"File not found"});return}oe(e,l,"user",`\u{1F5D1}\uFE0F File removed: \`${a}\``,void 0,"system","web"),r({type:"tasks-updated"}),o.json({success:!0})});let d=K(e,A,ke);t.post("/api/tasks/:id/screenshot",te.json(),(i,o)=>{let{id:l}=i.params,{screenshot:a}=i.body;if(!Q(e,l)){o.status(404).json({error:"Task not found"});return}if(!a){o.status(400).json({error:"Missing screenshot"});return}Xt(d,{recursive:!0});let s=`${l}.png`;Jt(K(d,s),Buffer.from(a,"base64")),$(e,l,{screenshot:s}),r({type:"tasks-updated"}),o.json({success:!0,screenshot:s})}),t.delete("/api/tasks/:id/screenshot",(i,o)=>{let{id:l}=i.params;if(!Q(e,l)){o.status(404).json({error:"Task not found"});return}let a=`${l}.png`,s=K(d,a);ct(s)&&an(s),$(e,l,{screenshot:void 0}),r({type:"tasks-updated"}),o.json({success:!0})})}function fn(t,e,r){t.get("/api/user",(l,a)=>{a.json(lt(e))}),t.get("/api/settings",(l,a)=>{a.json(B(e))}),t.post("/api/settings",(l,a)=>{if(!be(l,a))return;let s=new Set(["visibleCols","viewMode","panelWidth","autoCommit","autoComment","autoPush","createBranch","defaultModel","defaultAgent","perTypeModels","defaultModelBug","defaultModelResearch","defaultModelTask","experimentalAgents"]),u=Object.fromEntries(Object.entries(l.body).filter(([k])=>s.has(k))),f=Ht(e,u);a.json({success:!0,settings:f})}),t.get("/api/push/workspaces",async(l,a)=>{let s=await W().catch(()=>null);if(!s){a.status(401).json({error:"Not logged in"});return}let u=process.env.VIBEFLOW_API_URL??"http://localhost:3000";try{let f=await fetch(`${u}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${s}`}});if(!f.ok){let y=(await f.json().catch(()=>({}))).error??`HTTP ${f.status} from ${u}`;console.error(`[Vibeflow] GET /api/push/workspaces failed: ${y}`),a.status(f.status).json({error:y});return}a.json(await f.json())}catch(f){let k=f instanceof Error?f.message:String(f);console.error(`[Vibeflow] GET /api/push/workspaces network error: ${k}`),a.status(502).json({error:`Network error contacting SaaS API: ${k}`})}}),t.post("/api/push",te.json(),async(l,a)=>{let{workspaceId:s,keepLocalFiles:u}=l.body,f=await W().catch(()=>null);if(!f){a.status(401).json({error:"Not logged in"});return}let k=Z(e);if(k.length===0){a.json({imported:0,message:"No local tasks found"});return}let y=process.env.VIBEFLOW_API_URL??"http://localhost:3000",b={tasks:k};try{let h=await fetch(`${y}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${f}`},body:JSON.stringify(b)});if(!h.ok){let g=await h.json().catch(()=>({}));a.status(h.status).json({error:g.error??"Import failed"});return}let p=await h.json();if(!u){for(let g of k)try{an(g.filePath)}catch{}r?.({type:"tasks-updated"})}a.json({imported:p.imported,skipped:p.skipped??0,workspaceId:p.workspaceId,boardId:p.boardId})}catch(h){let p=h instanceof Error?h.message:String(h);console.error(`[Vibeflow] POST /api/push network error: ${p}`),a.status(502).json({error:`Network error contacting SaaS API: ${p}`})}}),t.get("/api/copilot/status",(l,a)=>{Ce(e).then(s=>a.json(s)).catch(s=>{console.error(`[Vibeflow] GET /api/copilot/status error: ${s instanceof Error?s.message:String(s)}`),a.json({authenticated:!1,source:null,tokenHint:null,username:null})})}),t.post("/api/copilot/login",async(l,a)=>{if(be(l,a))try{let s=await Ce(e);if(s.authenticated){a.json({launched:!1,alreadyAuthenticated:!0,username:s.username??null});return}if(!Le()){a.status(400).json({launched:!1,error:"GitHub CLI is not installed. Install gh and authenticate with 'gh auth login'."});return}Zt("gh",["auth","login","--web","--hostname","github.com","--git-protocol","https","--scopes","read:user,copilot"],{cwd:e,detached:!0,stdio:"ignore"}).unref(),a.json({launched:!0})}catch(s){let u=s instanceof Error?s.message:String(s);console.error(`[Vibeflow] POST /api/copilot/login error: ${u}`),a.status(500).json({launched:!1,error:u})}});let c=null;t.get("/api/agent-status",(l,a)=>{a.json(c??{message:"",active:!1,updatedAt:null})}),t.post("/api/agent-status",(l,a)=>{if(!be(l,a))return;let{message:s,active:u}=l.body;c={message:(s??"").slice(0,200),active:u!==!1,updatedAt:new Date().toISOString()},r?.({type:"agent-status",...c}),a.json({ok:!0})}),t.delete("/api/agent-status",(l,a)=>{be(l,a)&&(c=null,r?.({type:"agent-status",message:"",active:!1,updatedAt:null}),a.json({ok:!0}))});let d=new Map,i=new Map;function o(l,a){try{let s=JSON.parse(a);if(s.type==="step_finish"&&typeof s.part=="object"&&s.part){let u=s.part,f=u.tokens,k=typeof u.cost=="number"?u.cost:0;if(f){let y=i.get(l)??{inputTokens:0,outputTokens:0,totalTokens:0,reasoningTokens:0,cost:0};i.set(l,{inputTokens:y.inputTokens+(f.input??0),outputTokens:y.outputTokens+(f.output??0),totalTokens:y.totalTokens+(f.total??0),reasoningTokens:y.reasoningTokens+(f.reasoning??0),cost:y.cost+k})}}}catch{}}t.post("/api/agent/run",te.json(),async(l,a)=>{if(!be(l,a))return;let{taskId:s,model:u,agent:f}=l.body;if(!s){a.status(400).json({error:"taskId is required"});return}if(!Ae(s)){a.status(400).json({error:"Invalid task ID"});return}let k=Q(e,s);if(!k){a.status(404).json({error:"Task not found"});return}let y=J(k);if(!y){a.status(404).json({error:"Task not found"});return}let b=ee(e,s).filter(N=>!N.deleted),h=ge(e),p=q(e,s).map(N=>({...N,url:`http://localhost:${h.port}${N.url}`})),g=B(e),x=(y.type??"").toLowerCase()==="research",m=(y.type??"").toLowerCase()==="bug",S=Se(y,k,b,p,e),v=Ie({hasResearchTasks:x,hasBugTasks:m,autoCommit:g.autoCommit,autoPush:g.autoPush,autoComment:g.autoComment,createBranch:g.createBranch}),_=`${S}
1712
+ </html>`}function et(t){let e=typeof t=="number"?{port:t}:t;return Je?ar(e):tr(e.port)}import{readFileSync as It,writeFileSync as eo,mkdirSync as to,existsSync as Pt}from"fs";import{join as Rt,basename as or}from"path";import{execSync as ir}from"child_process";var Et={port:3700};function lr(t){return Rt(t,A,bt)}function ge(t){let e=lr(t);if(!Pt(e))return{...Et};let r=It(e,"utf-8"),c=JSON.parse(r);return{...Et,...c}}function Re(t){let e=Rt(t,"package.json");if(Pt(e))try{let r=JSON.parse(It(e,"utf-8"));if(r.name)return r.name}catch{}return or(t)}function Nt(t){try{return ir("git branch --show-current",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}import{mkdirSync as sr,writeFileSync as cr}from"fs";import{dirname as ur}from"path";import{randomBytes as dr}from"crypto";function Lt(t){let e=t;return{...t,text:t.text||e.body||"",author:t.author??"agent"}}function ee(t,e){let r=Q(t,e);return((r?X(r):null)?.comments??[]).filter(d=>!d.deleted).map(Lt)}function Mt(t){return vt(t)}function oe(t,e,r,c,d,i,o){c=Mt(c);let l=Q(t,e),s=(l?X(l):null)?.comments??[],u={id:dr(8).toString("hex"),author:r,text:c,...d&&d.length>0?{files:d}:{},...i&&i!=="comment"?{type:i}:{},createdAt:new Date().toISOString(),source:o??"cli"},f=[...s,u];if(!$(t,e,{comments:f})){let y=ht(t,e,new Date().toISOString());sr(ur(y),{recursive:!0}),cr(y,JSON.stringify({id:e,comments:f},null,2),"utf-8")}return u}function Ne(t,e,r,c){let d=Q(t,e),o=(d?X(d):null)?.comments??[],l=o.find(a=>a.id===r&&!a.deleted);return l?(l.text=Mt(c),l.updatedAt=new Date().toISOString(),$(t,e,{comments:o}),Lt(l)):null}function Le(t,e,r){let c=Q(t,e),i=(c?X(c):null)?.comments??[],o=i.findIndex(l=>l.id===r&&!l.deleted);return o===-1?!1:(i[o]={...i[o],deleted:!0,text:"[Comment deleted]",updatedAt:new Date().toISOString()},$(t,e,{comments:i}),!0)}import{execSync as zt}from"child_process";import{existsSync as pr,readFileSync as fr,writeFileSync as go,mkdirSync as bo}from"fs";import{join as gr}from"path";var br="config.json";function mr(t){return gr(t,A,br)}function hr(t){let e=mr(t);if(!pr(e))return{};try{return JSON.parse(fr(e,"utf-8"))}catch{return{}}}function vr(t){return t.length<=8?"***":t.slice(0,6)+"..."+t.slice(-4)}function yr(){try{return zt("gh auth token --hostname github.com",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}async function xr(t){try{let e=await fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${t}`,"User-Agent":"proto-studio-cli",Accept:"application/vnd.github+json"},signal:AbortSignal.timeout(5e3)});return e.ok?(await e.json()).login??null:null}catch{return null}}function kr(t){let e=process.env.GITHUB_TOKEN;if(e?.trim())return{token:e.trim(),source:"env"};let c=hr(t).copilotToken;if(typeof c=="string"&&c.trim())return{token:c.trim(),source:"config"};let d=yr();return d?{token:d,source:"gh-cli"}:null}async function Ce(t){let e=kr(t);if(!e)return{authenticated:!1,source:null,tokenHint:null,username:null};let r=await xr(e.token).catch(()=>null);return{authenticated:!0,source:e.source,tokenHint:vr(e.token),username:r}}function Me(){try{return zt("gh --version",{encoding:"utf-8",timeout:3e3,stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}import{existsSync as tt,readFileSync as Ot,writeFileSync as At,mkdirSync as $t}from"fs";import{join as ze}from"path";import Dt from"os";var wr="settings.json";function Ft(){return ze(Dt.homedir(),".vibeflow","settings.json")}function Bt(t){return ze(t,A,wr)}function nt(){try{return JSON.parse(Ot(Ft(),"utf-8"))}catch{return{}}}function Wt(t){let e=ze(Dt.homedir(),".vibeflow");tt(e)||$t(e,{recursive:!0}),At(Ft(),JSON.stringify(t,null,2),"utf-8")}function B(t){let e=nt(),r=Bt(t);if(!tt(r))return e;try{let c=JSON.parse(Ot(r,"utf-8"));return{...e,...c}}catch{return e}}function Ut(t,e){let r=ze(t,A);tt(r)||$t(r,{recursive:!0});let c=Bt(t),i={...B(t),...e};return At(c,JSON.stringify(i,null,2),"utf-8"),i}import Oe from"fs/promises";import Sr from"os";import rt from"path";var Cr=rt.join(Sr.homedir(),".vibeflow"),Ae=rt.join(Cr,"token");async function W(){try{return(await Oe.readFile(Ae,"utf8")).trim()||null}catch{return null}}async function Ht(t){await Oe.mkdir(rt.dirname(Ae),{recursive:!0}),await Oe.writeFile(Ae,t,{mode:384})}async function qt(){try{await Oe.unlink(Ae)}catch{}}import{initTRPC as _r,TRPCError as at}from"@trpc/server";import{z as j}from"zod";var Kt=_r.context().create(),jr=Kt.router,U=Kt.procedure,Vt=j.enum(["backlog","todo","in-progress","review","done"]),ot=j.object({id:j.string().min(1)}),Yt=jr({project:U.query(({ctx:t})=>({name:Re(t.projectDir),projectDir:t.projectDir})),copilotStatus:U.query(async({ctx:t})=>await Me()?await Ce(t.projectDir):{authenticated:!1,reason:"gh CLI not found"}),tasks:U.query(({ctx:t})=>({tasks:Y(t.projectDir).map(c=>({...c,createdAt:c.created,commentCount:(c.comments??[]).filter(d=>!d.deleted).length,fileCount:c.files?.length??0}))})),searchTasks:U.input(j.object({query:j.string().min(1),limit:j.number().int().min(1).max(100).optional()})).query(({ctx:t,input:e})=>{let r=Y(t.projectDir),c=Math.max(1,e.limit??10),d=e.query.toLowerCase();return{results:r.filter(o=>`${o.title} ${o.description??""} ${o.type??""} ${o.component??""}`.toLowerCase().includes(d)).slice(0,c).map(o=>({score:1,task:o,commentCount:(o.comments??[]).filter(l=>!l.deleted).length,fileCount:o.files?.length??0}))}}),createTask:U.input(j.object({title:j.string().min(1),selector:j.string().min(1),description:j.string().optional(),cssSelector:j.string().optional(),url:j.string().optional(),type:j.string().optional(),priority:j.string().optional(),file:j.string().optional(),line:j.number().int().positive().optional(),col:j.number().int().positive().optional(),component:j.string().optional(),status:Vt.optional(),agent:j.string().optional(),model:j.string().optional(),author:j.string().optional(),annotatedElementText:j.string().max(300).optional()})).mutation(({ctx:t,input:e})=>{let r=fe(t.projectDir,{title:e.title,description:e.description??"",selector:e.selector,cssSelector:e.cssSelector,url:e.url,status:e.status??"todo",screenshot:void 0,file:e.file,line:e.line,col:e.col,component:e.component,type:e.type,priority:e.priority,author:e.author??"Unknown",agent:e.agent,model:e.model,annotatedElementText:e.annotatedElementText});return t.broadcast({type:"tasks-updated"}),{success:!0,task:r}}),updateTask:U.input(j.object({id:j.string().min(1),updates:j.object({status:Vt.optional(),title:j.string().min(1).optional(),description:j.string().optional(),type:j.string().optional(),priority:j.string().optional(),reportBack:j.boolean().optional(),agent:j.string().optional(),model:j.string().optional(),tags:j.array(j.string().max(50)).max(20).optional(),sortKey:j.string().optional(),branchName:j.string().optional()})})).mutation(({ctx:t,input:e})=>{let r=$(t.projectDir,e.id,e.updates);if(!r)throw new at({code:"NOT_FOUND",message:"Task not found"});return t.broadcast({type:"tasks-updated"}),{success:!0,task:r}}),deleteTask:U.input(ot).mutation(({ctx:t,input:e})=>{if(!Ie(t.projectDir,e.id))throw new at({code:"NOT_FOUND",message:"Task not found"});return t.broadcast({type:"tasks-updated"}),{success:!0}}),comments:U.input(ot).query(({ctx:t,input:e})=>({comments:ee(t.projectDir,e.id)})),addComment:U.input(j.object({taskId:j.string().min(1),text:j.string().min(1),author:j.enum(["user","agent"]).optional().default("user"),files:j.array(j.string()).optional(),source:j.enum(["cli","web"]).optional().default("web")})).mutation(({ctx:t,input:e})=>{let r=oe(t.projectDir,e.taskId,e.author,e.text.trim(),e.files,void 0,e.source);return t.broadcast({type:"tasks-updated"}),{success:!0,comment:r}}),updateComment:U.input(j.object({taskId:j.string().min(1),commentId:j.string().min(1),text:j.string().min(1)})).mutation(({ctx:t,input:e})=>{let r=Ne(t.projectDir,e.taskId,e.commentId,e.text.trim());if(!r)throw new at({code:"NOT_FOUND",message:"Comment not found"});return{success:!0,comment:r}}),deleteComment:U.input(j.object({taskId:j.string().min(1),commentId:j.string().min(1)})).mutation(({ctx:t,input:e})=>(Le(t.projectDir,e.taskId,e.commentId),t.broadcast({type:"tasks-updated"}),{success:!0})),files:U.input(ot).query(({ctx:t,input:e})=>({files:q(t.projectDir,e.id)})),models:U.query(async()=>{try{let{execSync:t}=await import("child_process");return{models:t("opencode models",{encoding:"utf-8",timeout:1e4,stdio:"pipe"}).split(`
1713
+ `).map(d=>d.trim()).filter(d=>d.length>0&&!d.startsWith("#")).map(d=>{let i=d.split("/"),o=i[0]||"other",a=(i.slice(1).join("/")||d).replace(/-/g," ").replace(/(\d+\.\d+)/,"v$1").replace(/\b\w/g,s=>s.toUpperCase());return{id:d,label:a,provider:o}}),error:null}}catch(t){let e=t instanceof Error?t.message:"Unknown error";return{models:[],error:`OpenCode not found: ${e}`}}})});import{execSync as Gt}from"child_process";function it(t){try{let e=Gt("git config user.name",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim(),r=Gt("git config user.email",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return{name:e||"Unknown",email:r||""}}catch{return{name:"Unknown",email:""}}}function je(t){return/^[a-f0-9]{30}$/.test(t)}function Zt(t){return/^[A-Za-z0-9][A-Za-z0-9._\-/]{0,79}$/.test(t)}function be(t,e){let r=t.headers.origin;return r&&!r.startsWith("http://localhost")?(e.status(403).json({error:"Forbidden"}),!1):!0}var zr=["backlog","todo","in-progress","review","done"],Or=new Set(["https://app.vibeflow.tools"]);function Ar(t){if(!t)return null;try{let e=new URL(t).origin;return Or.has(e)?e:null}catch{return null}}var ci=Pr(import.meta.url);function un(){for(let t of Object.values(Lr()))for(let e of t??[])if(e.family==="IPv4"&&!e.internal)return e.address;return null}function dn(t,e){t.get("/api/pages",(r,c)=>{c.json({pages:e})})}var en=new Map;function tn(t){let r=en.get(t);if(r&&Date.now()-r.fetchedAt<3e5)return r.shas;try{let c=_e("git log --remotes --format=%H",{cwd:t,timeout:5e3}).toString().trim(),d=new Set(c?c.split(`
1714
+ `):[]);return en.set(t,{shas:d,fetchedAt:Date.now()}),d}catch{return new Set}}function nn(t,e){return t?e.has(t):null}function pn(t,e,r){t.get("/api/project",(i,o)=>{o.json({name:Re(e),projectDir:e,branch:Nt(e)})}),t.get("/api/tasks",(i,o)=>{let l=Y(e),a=tn(e),s=l.map(u=>{let f=u.commits?.length?u.commits[u.commits.length-1].sha:void 0;return{...u,createdAt:u.created,commentCount:(u.comments??[]).filter(k=>!k.deleted).length,fileCount:u.files?.length??0,commitPushed:nn(f,a)}});o.json({tasks:s})}),t.param("id",(i,o,l,a)=>{if(!je(a)){o.status(400).json({error:"Invalid task id"});return}l()}),t.get("/api/tasks/:id",(i,o)=>{let{id:l}=i.params,a=Q(e,l),s=a?X(a):null;if(!s){o.status(404).json({error:"Task not found"});return}let u=tn(e),f=s.commits?.length?s.commits[s.commits.length-1].sha:void 0;o.json({...s,commitPushed:nn(f,u)})}),t.post("/api/tasks",(i,o)=>{let{title:l,description:a,selector:s,cssSelector:u,url:f,type:k,priority:y,file:b,line:h,col:p,component:g,status:x,agent:m,model:S,screenshot:v,annotatedElementText:_,tags:C,sortKey:N}=i.body;if(!l||!s){o.status(400).json({error:"Missing required fields: title, selector"});return}let z=it(e),P=fe(e,{title:l,description:a||"",selector:s,cssSelector:u||void 0,url:f||void 0,status:zr.includes(x)?x:"todo",file:b||void 0,line:h!=null?Number(h):void 0,col:p!=null?Number(p):void 0,component:g||void 0,type:k||void 0,priority:y||void 0,author:z.name,agent:m||void 0,model:S||void 0,annotatedElementText:_?String(_).slice(0,300):void 0,tags:Array.isArray(C)?C.filter(R=>typeof R=="string"&&R.length>0):void 0,sortKey:N?String(N):void 0});if(v){let R=K(e,A,ke);Xt(R,{recursive:!0});let T=`${P.id}.png`;Qt(K(R,T),Buffer.from(v,"base64")),$(e,P.id,{screenshot:T}),P.screenshot=T}console.log(`[Vibeflow] Task created: "${P.title}" (${P.id})`),r({type:"tasks-updated"}),o.json({success:!0,task:P})}),t.patch("/api/tasks/:id",(i,o)=>{let{id:l}=i.params,a=i.body,s=["backlog","todo","in-progress","review","done"];if(a.status!==void 0&&!s.includes(a.status)){o.status(400).json({error:`Invalid status: ${a.status}`});return}let u=$(e,l,a);if(!u){o.status(404).json({error:"Task not found"});return}console.log(`[Vibeflow] Task updated: "${u.title}" (${u.id}) \u2192 status:${u.status}`),r({type:"task-changed",taskId:u.id,action:"update",task:u}),o.json({success:!0,task:u})}),t.delete("/api/tasks/:id",(i,o)=>{let{id:l}=i.params;if(!Ie(e,l)){o.status(404).json({error:"Task not found"});return}console.log(`[Vibeflow] Task deleted: ${l}`),r({type:"task-deleted",taskId:l}),o.json({success:!0})}),t.get("/api/tasks/:id/comments",(i,o)=>{let{id:l}=i.params,a=ee(e,l);o.json({comments:a})}),t.post("/api/tasks/:id/comments",(i,o)=>{let{id:l}=i.params,{author:a,text:s,files:u,source:f}=i.body;if(!s||!s.trim()){o.status(400).json({error:"Missing required field: text"});return}let k=a==="agent"?"agent":"user",y=f==="cli"?"cli":"web",b=oe(e,l,k,s.trim(),Array.isArray(u)?u:void 0,void 0,y);r({type:"tasks-updated"}),o.json({success:!0,comment:b})}),t.patch("/api/tasks/:id/comments/:commentId",(i,o)=>{let{id:l,commentId:a}=i.params,{text:s}=i.body;if(!s||!s.trim()){o.status(400).json({error:"Missing required field: text"});return}let u=Ne(e,l,a,s.trim());if(!u){o.status(404).json({error:"Comment not found"});return}o.json({success:!0,comment:u})}),t.delete("/api/tasks/:id/comments/:commentId",(i,o)=>{let{id:l,commentId:a}=i.params;if(!Le(e,l,a)){o.status(404).json({error:"Comment not found"});return}r({type:"tasks-updated"}),o.json({success:!0})}),t.get("/api/tasks/:id/files",(i,o)=>{let{id:l}=i.params,a=q(e,l);o.json({files:a})}),t.get("/api/tasks/:id/files/:filename",(i,o)=>{let{id:l,filename:a}=i.params,s=wt(e,l,a);if(!s){o.status(404).json({error:"File not found"});return}o.sendFile(s)});let c=new Set([".png",".jpg",".jpeg",".gif",".webp",".pdf",".txt",".md",".json",".csv",".svg",".mp4",".mov",".zip"]);t.post("/api/tasks/:id/files/:filename",te.raw({type:"*/*",limit:"50mb"}),(i,o)=>{let{id:l,filename:a}=i.params;if(!a||a.includes("/")||a.includes("\\")){o.status(400).json({error:"Invalid filename"});return}let s=on(decodeURIComponent(a)).toLowerCase();if(!c.has(s)){o.status(415).json({error:"File type not allowed"});return}let u=i.body;if(!Buffer.isBuffer(u)||u.length===0){o.status(400).json({error:"Empty file body"});return}let f=xt(e,l,decodeURIComponent(a),u);r({type:"tasks-updated"}),o.json({success:!0,file:f})}),t.delete("/api/tasks/:id/files/:filename",(i,o)=>{let{id:l,filename:a}=i.params;if(!kt(e,l,a)){o.status(404).json({error:"File not found"});return}oe(e,l,"user",`\u{1F5D1}\uFE0F File removed: \`${a}\``,void 0,"system","web"),r({type:"tasks-updated"}),o.json({success:!0})});let d=K(e,A,ke);t.post("/api/tasks/:id/screenshot",te.json(),(i,o)=>{let{id:l}=i.params,{screenshot:a}=i.body;if(!Q(e,l)){o.status(404).json({error:"Task not found"});return}if(!a){o.status(400).json({error:"Missing screenshot"});return}Xt(d,{recursive:!0});let s=`${l}.png`;Qt(K(d,s),Buffer.from(a,"base64")),$(e,l,{screenshot:s}),r({type:"tasks-updated"}),o.json({success:!0,screenshot:s})}),t.delete("/api/tasks/:id/screenshot",(i,o)=>{let{id:l}=i.params;if(!Q(e,l)){o.status(404).json({error:"Task not found"});return}let a=`${l}.png`,s=K(d,a);st(s)&&an(s),$(e,l,{screenshot:void 0}),r({type:"tasks-updated"}),o.json({success:!0})})}function fn(t,e,r){t.get("/api/user",(l,a)=>{a.json(it(e))}),t.get("/api/settings",(l,a)=>{a.json(B(e))}),t.post("/api/settings",(l,a)=>{if(!be(l,a))return;let s=new Set(["visibleCols","viewMode","panelWidth","autoCommit","autoComment","autoPush","createBranch","defaultModel","defaultAgent","perTypeModels","defaultModelBug","defaultModelResearch","defaultModelTask","experimentalAgents"]),u=Object.fromEntries(Object.entries(l.body).filter(([k])=>s.has(k))),f=Ut(e,u);a.json({success:!0,settings:f})}),t.get("/api/push/workspaces",async(l,a)=>{let s=await W().catch(()=>null);if(!s){a.status(401).json({error:"Not logged in"});return}let u=process.env.VIBEFLOW_API_URL??"http://localhost:3000";try{let f=await fetch(`${u}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${s}`}});if(!f.ok){let y=(await f.json().catch(()=>({}))).error??`HTTP ${f.status} from ${u}`;console.error(`[Vibeflow] GET /api/push/workspaces failed: ${y}`),a.status(f.status).json({error:y});return}a.json(await f.json())}catch(f){let k=f instanceof Error?f.message:String(f);console.error(`[Vibeflow] GET /api/push/workspaces network error: ${k}`),a.status(502).json({error:`Network error contacting SaaS API: ${k}`})}}),t.post("/api/push",te.json(),async(l,a)=>{let{workspaceId:s,keepLocalFiles:u}=l.body,f=await W().catch(()=>null);if(!f){a.status(401).json({error:"Not logged in"});return}let k=Z(e);if(k.length===0){a.json({imported:0,message:"No local tasks found"});return}let y=process.env.VIBEFLOW_API_URL??"http://localhost:3000",b={tasks:k};try{let h=await fetch(`${y}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${f}`},body:JSON.stringify(b)});if(!h.ok){let g=await h.json().catch(()=>({}));a.status(h.status).json({error:g.error??"Import failed"});return}let p=await h.json();if(!u){for(let g of k)try{an(g.filePath)}catch{}r?.({type:"tasks-updated"})}a.json({imported:p.imported,skipped:p.skipped??0,workspaceId:p.workspaceId,boardId:p.boardId})}catch(h){let p=h instanceof Error?h.message:String(h);console.error(`[Vibeflow] POST /api/push network error: ${p}`),a.status(502).json({error:`Network error contacting SaaS API: ${p}`})}}),t.get("/api/copilot/status",(l,a)=>{Ce(e).then(s=>a.json(s)).catch(s=>{console.error(`[Vibeflow] GET /api/copilot/status error: ${s instanceof Error?s.message:String(s)}`),a.json({authenticated:!1,source:null,tokenHint:null,username:null})})}),t.post("/api/copilot/login",async(l,a)=>{if(be(l,a))try{let s=await Ce(e);if(s.authenticated){a.json({launched:!1,alreadyAuthenticated:!0,username:s.username??null});return}if(!Me()){a.status(400).json({launched:!1,error:"GitHub CLI is not installed. Install gh and authenticate with 'gh auth login'."});return}Jt("gh",["auth","login","--web","--hostname","github.com","--git-protocol","https","--scopes","read:user,copilot"],{cwd:e,detached:!0,stdio:"ignore"}).unref(),a.json({launched:!0})}catch(s){let u=s instanceof Error?s.message:String(s);console.error(`[Vibeflow] POST /api/copilot/login error: ${u}`),a.status(500).json({launched:!1,error:u})}});let c=null;t.get("/api/agent-status",(l,a)=>{a.json(c??{message:"",active:!1,updatedAt:null})}),t.post("/api/agent-status",(l,a)=>{if(!be(l,a))return;let{message:s,active:u}=l.body;c={message:(s??"").slice(0,200),active:u!==!1,updatedAt:new Date().toISOString()},r?.({type:"agent-status",...c}),a.json({ok:!0})}),t.delete("/api/agent-status",(l,a)=>{be(l,a)&&(c=null,r?.({type:"agent-status",message:"",active:!1,updatedAt:null}),a.json({ok:!0}))});let d=new Map,i=new Map;function o(l,a){try{let s=JSON.parse(a);if(s.type==="step_finish"&&typeof s.part=="object"&&s.part){let u=s.part,f=u.tokens,k=typeof u.cost=="number"?u.cost:0;if(f){let y=i.get(l)??{inputTokens:0,outputTokens:0,totalTokens:0,reasoningTokens:0,cost:0};i.set(l,{inputTokens:y.inputTokens+(f.input??0),outputTokens:y.outputTokens+(f.output??0),totalTokens:y.totalTokens+(f.total??0),reasoningTokens:y.reasoningTokens+(f.reasoning??0),cost:y.cost+k})}}}catch{}}t.post("/api/agent/run",te.json(),async(l,a)=>{if(!be(l,a))return;let{taskId:s,model:u,agent:f}=l.body;if(!s){a.status(400).json({error:"taskId is required"});return}if(!je(s)){a.status(400).json({error:"Invalid task ID"});return}if(u&&!Zt(u)){a.status(400).json({error:"Invalid model"});return}if(f&&!Zt(f)){a.status(400).json({error:"Invalid agent"});return}let k=Q(e,s);if(!k){a.status(404).json({error:"Task not found"});return}let y=X(k);if(!y){a.status(404).json({error:"Task not found"});return}let b=ee(e,s).filter(P=>!P.deleted),h=ge(e),p=q(e,s).map(P=>({...P,url:`http://localhost:${h.port}${P.url}`})),g=B(e),x=(y.type??"").toLowerCase()==="research",m=(y.type??"").toLowerCase()==="bug",S=Se(y,k,b,p,e),v=Pe({hasResearchTasks:x,hasBugTasks:m,autoCommit:g.autoCommit,autoPush:g.autoPush,autoComment:g.autoComment,createBranch:g.createBranch}),_=`${S}
1715
1715
 
1716
- ${v}`;try{_e("which opencode",{timeout:5e3,stdio:"pipe"})}catch{a.status(500).json({error:"opencode is not installed. Install it to run agents."});return}if(d.has(s)){a.status(409).json({error:"Agent already running for this task"});return}let C=["run","--dangerously-skip-permissions","--format","json","--",_];u&&C.splice(2,0,"--model",u),f&&C.splice(2,0,"--agent",f),r?.({type:"agent-run-started",taskId:s,model:u,agent:f,command:`opencode ${C.join(" ")}`});let R=Zt("opencode",C,{cwd:e,env:{...process.env,FORCE_COLOR:"0"}});d.set(s,R),i.set(s,{inputTokens:0,outputTokens:0,totalTokens:0,reasoningTokens:0,cost:0});let z="";R.stdout?.on("data",N=>{let P=N.toString();z+=P;for(let T of P.split(`
1717
- `))T.trim()&&o(s,T.trim());r?.({type:"agent-run-log",taskId:s,log:P})}),R.stderr?.on("data",N=>{let P=N.toString();z+=P,r?.({type:"agent-run-log",taskId:s,log:P})}),R.on("close",N=>{d.delete(s);let P=i.get(s);i.delete(s),r?.({type:"agent-run-finished",taskId:s,exitCode:N,success:N===0,...P??{}})}),R.on("error",N=>{d.delete(s);let P=i.get(s);i.delete(s),r?.({type:"agent-run-finished",taskId:s,exitCode:1,success:!1,error:N.message,...P??{}})}),a.json({ok:!0,taskId:s,command:`opencode ${C.join(" ")}`})}),t.post("/api/agent/stop",te.json(),(l,a)=>{if(!be(l,a))return;let{taskId:s}=l.body;if(!s){a.status(400).json({error:"taskId is required"});return}let u=d.get(s);if(!u){a.status(404).json({error:"No active agent run for this task"});return}u.kill("SIGINT"),a.json({ok:!0,taskId:s})}),t.get("/api/agent/agents",(l,a)=>{try{let u=_e("opencode agent list",{cwd:e,timeout:1e4,env:{...process.env,FORCE_COLOR:"0"},stdio:"pipe"}).toString().split(`
1716
+ ${v}`;try{_e("which opencode",{timeout:5e3,stdio:"pipe"})}catch{a.status(500).json({error:"opencode is not installed. Install it to run agents."});return}if(d.has(s)){a.status(409).json({error:"Agent already running for this task"});return}let C=["run","--dangerously-skip-permissions","--format","json","--",_];u&&C.splice(2,0,"--model",u),f&&C.splice(2,0,"--agent",f),r?.({type:"agent-run-started",taskId:s,model:u,agent:f,command:`opencode ${C.join(" ")}`});let N=Jt("opencode",C,{cwd:e,env:{...process.env,FORCE_COLOR:"0"}});d.set(s,N),i.set(s,{inputTokens:0,outputTokens:0,totalTokens:0,reasoningTokens:0,cost:0});let z="";N.stdout?.on("data",P=>{let R=P.toString();z+=R;for(let T of R.split(`
1717
+ `))T.trim()&&o(s,T.trim());r?.({type:"agent-run-log",taskId:s,log:R})}),N.stderr?.on("data",P=>{let R=P.toString();z+=R,r?.({type:"agent-run-log",taskId:s,log:R})}),N.on("close",P=>{d.delete(s);let R=i.get(s);i.delete(s),r?.({type:"agent-run-finished",taskId:s,exitCode:P,success:P===0,...R??{}})}),N.on("error",P=>{d.delete(s);let R=i.get(s);i.delete(s),r?.({type:"agent-run-finished",taskId:s,exitCode:1,success:!1,error:P.message,...R??{}})}),a.json({ok:!0,taskId:s,command:`opencode ${C.join(" ")}`})}),t.post("/api/agent/stop",te.json(),(l,a)=>{if(!be(l,a))return;let{taskId:s}=l.body;if(!s){a.status(400).json({error:"taskId is required"});return}if(!je(s)){a.status(400).json({error:"Invalid task ID"});return}let u=d.get(s);if(!u){a.status(404).json({error:"No active agent run for this task"});return}u.kill("SIGINT"),a.json({ok:!0,taskId:s})}),t.get("/api/agent/agents",(l,a)=>{try{let u=_e("opencode agent list",{cwd:e,timeout:1e4,env:{...process.env,FORCE_COLOR:"0"},stdio:"pipe"}).toString().split(`
1718
1718
  `).map(f=>f.trim()).filter(f=>/^[A-Za-z][A-Za-z0-9_-]+ \(/.test(f)).map(f=>{let k=f.match(/^([A-Za-z][A-Za-z0-9_-]+)\s+\((.+)\)$/);return k?{id:k[1],name:k[1],scope:k[2]}:null}).filter(Boolean);a.json({agents:u})}catch{a.json({agents:[]})}}),t.get("/api/agent/models",async(l,a)=>{try{let s=_e("opencode models",{cwd:e,timeout:15e3,env:{...process.env,FORCE_COLOR:"0"},stdio:"pipe"}).toString(),u=[];for(let f of s.split(`
1719
- `)){let y=f.trim().match(/^([a-z0-9-]+)\/([a-z0-9._-]+)\s+(.+)$/i);y&&u.push({id:`${y[1]}/${y[2]}`,label:y[3].trim(),provider:y[1]})}a.json({models:u})}catch{a.json({models:[]})}}),t.get("/api/github-url",(l,a)=>{try{let s=_e("git remote get-url origin",{cwd:e,timeout:3e3}).toString().trim(),u=s.match(/^git@github\.com:(.+?)(?:\.git)?$/);if(u){a.json({githubUrl:`https://github.com/${u[1]}`});return}let f=s.match(/^(https?:\/\/github\.com\/[^/]+\/[^/]+?)(?:\.git)?$/);if(f){a.json({githubUrl:f[1]});return}}catch{}a.json({githubUrl:null})})}function gn(t,e){let r=process.env.VIBEFLOW_ADMIN_EMAIL??"",c=process.env.VIBEFLOW_API_URL??"http://localhost:3000";t.get("/kanban",async(d,i)=>{let o=await W().catch(()=>null);if(!o){i.type("html").send(tt({port:e}));return}let l=await V().catch(()=>null),a=!1;if(r)try{let u=await fetch(`${c}/api/cli/profile`,{headers:{Authorization:`Bearer ${o}`}}).catch(()=>null);u?.ok&&(a=(await u.json()).email===r)}catch{}let s={port:e,saasMode:!0,boardUrl:l?.url??`${c}/kanban`,boardName:l?.name,isAdmin:a};i.type("html").send(tt(s))})}var Ar=`*{box-sizing:border-box;margin:0;padding:0}
1719
+ `)){let y=f.trim().match(/^([a-z0-9-]+)\/([a-z0-9._-]+)\s+(.+)$/i);y&&u.push({id:`${y[1]}/${y[2]}`,label:y[3].trim(),provider:y[1]})}a.json({models:u})}catch{a.json({models:[]})}}),t.get("/api/github-url",(l,a)=>{try{let s=_e("git remote get-url origin",{cwd:e,timeout:3e3}).toString().trim(),u=s.match(/^git@github\.com:(.+?)(?:\.git)?$/);if(u){a.json({githubUrl:`https://github.com/${u[1]}`});return}let f=s.match(/^(https?:\/\/github\.com\/[^/]+\/[^/]+?)(?:\.git)?$/);if(f){a.json({githubUrl:f[1]});return}}catch{}a.json({githubUrl:null})})}function gn(t,e){let r=process.env.VIBEFLOW_ADMIN_EMAIL??"",c=process.env.VIBEFLOW_API_URL??"http://localhost:3000";t.get("/kanban",async(d,i)=>{let o=await W().catch(()=>null);if(!o){i.type("html").send(et({port:e}));return}let l=await V().catch(()=>null),a=!1;if(r)try{let u=await fetch(`${c}/api/cli/profile`,{headers:{Authorization:`Bearer ${o}`}}).catch(()=>null);u?.ok&&(a=(await u.json()).email===r)}catch{}let s={port:e,saasMode:!0,boardUrl:l?.url??`${c}/kanban`,boardName:l?.name,isAdmin:a};i.type("html").send(et(s))})}var $r=`*{box-sizing:border-box;margin:0;padding:0}
1720
1720
  body{font-family:system-ui,sans-serif;background:#0f172a;color:#e2e8f0;padding:32px;max-width:700px;margin:0 auto}
1721
1721
  h1{font-size:22px;font-weight:700;color:#f1f5f9;margin-bottom:6px}
1722
1722
  h2{font-size:14px;font-weight:600;color:#94a3b8;margin:24px 0 8px;text-transform:uppercase;letter-spacing:.06em}
@@ -1729,9 +1729,9 @@ code{font-family:monospace;font-size:12px;color:#a5b4fc;word-break:break-all}
1729
1729
  .badge{display:inline-block;padding:2px 8px;background:rgba(59,130,246,.15);border:1px solid rgba(59,130,246,.3);border-radius:10px;font-size:11px;color:#60a5fa;margin-left:6px}
1730
1730
  .badge.green{background:rgba(34,197,94,.15);border-color:rgba(34,197,94,.3);color:#4ade80}
1731
1731
  pre{background:#050d1a;border:1px solid #1e293b;border-radius:6px;padding:12px;overflow-x:auto;font-family:monospace;font-size:12px;color:#a5b4fc;margin-top:8px}
1732
- .note{font-size:11px;color:#64748b;margin-top:8px;padding:8px 10px;background:#0a0f1e;border-radius:6px;border-left:3px solid #334155}`;function st(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}var $r="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Crect width='32' height='32' rx='7' fill='%232563eb'/%3E%3Crect x='7' y='13' width='3.5' height='10' rx='1.5' fill='white' opacity='.75'/%3E%3Crect x='12.25' y='8.5' width='3.5' height='15' rx='1.5' fill='white'/%3E%3Crect x='17.5' y='14.5' width='3.5' height='8' rx='1.5' fill='white' opacity='.75'/%3E%3Crect x='22.5' y='11' width='2.5' height='11' rx='1.25' fill='white' opacity='.85'/%3E%3C/svg%3E";function rn(t,e){return`<!DOCTYPE html>
1732
+ .note{font-size:11px;color:#64748b;margin-top:8px;padding:8px 10px;background:#0a0f1e;border-radius:6px;border-left:3px solid #334155}`;function lt(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Dr="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Crect width='32' height='32' rx='7' fill='%232563eb'/%3E%3Crect x='7' y='13' width='3.5' height='10' rx='1.5' fill='white' opacity='.75'/%3E%3Crect x='12.25' y='8.5' width='3.5' height='15' rx='1.5' fill='white'/%3E%3Crect x='17.5' y='14.5' width='3.5' height='8' rx='1.5' fill='white' opacity='.75'/%3E%3Crect x='22.5' y='11' width='2.5' height='11' rx='1.25' fill='white' opacity='.85'/%3E%3C/svg%3E";function rn(t,e){return`<!DOCTYPE html>
1733
1733
  <html lang="en">
1734
- <head><meta charset="UTF-8"><title>Vibeflow \u2014 Inject Overlay</title><link rel="icon" type="image/svg+xml" href="${$r}"><style>${Ar}</style></head>
1734
+ <head><meta charset="UTF-8"><title>Vibeflow \u2014 Inject Overlay</title><link rel="icon" type="image/svg+xml" href="${Dr}"><style>${$r}</style></head>
1735
1735
  <body>
1736
1736
  <h1>Vibeflow \u2014 Inject Overlay</h1>
1737
1737
  <p style="margin-top:6px">${t}</p>
@@ -1742,36 +1742,36 @@ ${e.join(`
1742
1742
  <a class="bookmarklet" href="${k}"><svg class='bookmarklet-icon' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='7' y='13' width='3.5' height='10' rx='1.5' fill='white' opacity='.75'/><rect x='12.25' y='8.5' width='3.5' height='15' rx='1.5' fill='white'/><rect x='17.5' y='14.5' width='3.5' height='8' rx='1.5' fill='white' opacity='.75'/><rect x='22.5' y='11' width='2.5' height='11' rx='1.25' fill='white' opacity='.85'/></svg>Vibeflow annotate</a>
1743
1743
  <div class="note">\u2705 Works on pages with strict Content-Security-Policy (uses fetch + eval instead of &lt;script src&gt;).<br>\u26A0\uFE0F Do not click the link here \u2014 drag it to your bookmarks bar first, then use it on your target page.</div></div>`,`<h2>Option 2 \u2014 Browser console <span class="badge green">CSP-safe</span></h2>
1744
1744
  <div class="card"><p>Open browser DevTools console on your target page and paste:</p>
1745
- <pre>${st(y)}</pre>
1745
+ <pre>${lt(y)}</pre>
1746
1746
  <div class="note">\u2705 Works on most pages \u2014 uses fetch + eval which respects <code>connect-src https:</code> and <code>unsafe-eval</code>.</div></div>`,`<h2>Option 3 \u2014 Script tag</h2>
1747
1747
  <div class="card"><p>Add this tag to your HTML (before <code>&lt;/body&gt;</code>):</p>
1748
- <pre>${st(b)}</pre>
1748
+ <pre>${lt(b)}</pre>
1749
1749
  <div class="note">Requires your CSP to allow loading scripts from <code>${c}</code>. Suitable when you control the page's HTML.</div></div>`]))});return}let i=`http://localhost:${e}/vibeflow-overlay.js`,o=d?` data-board-id="${d}"`:"",l=`<script src="${i}" data-vibeflow-overlay${o}></script>`,a=d?`s.setAttribute('data-board-id','${d}');`:"",s=`javascript:(function(){if(document.getElementById('vibeflow-studio-root')){alert('Vibeflow overlay is already active on this page.');}else{var s=document.createElement('script');s.src='${i}';s.setAttribute('data-vibeflow-overlay','');${a}document.head.appendChild(s);}})()`;t.get("/inject",(u,f)=>{f.type("html").send(rn("Add the Vibeflow overlay to any page without modifying source code.",[`<h2>Option 1 \u2014 Bookmarklet <span class="badge">recommended</span></h2>
1750
1750
  <div class="card"><p>Drag this link to your bookmarks bar, then click it on any page to activate the overlay:</p>
1751
1751
  <a class="bookmarklet" href="${s}"><svg class='bookmarklet-icon' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'><rect x='7' y='13' width='3.5' height='10' rx='1.5' fill='white' opacity='.75'/><rect x='12.25' y='8.5' width='3.5' height='15' rx='1.5' fill='white'/><rect x='17.5' y='14.5' width='3.5' height='8' rx='1.5' fill='white' opacity='.75'/><rect x='22.5' y='11' width='2.5' height='11' rx='1.25' fill='white' opacity='.85'/></svg>Vibeflow annotate</a>
1752
1752
  <div class="note">\u26A0\uFE0F Do not click the link here \u2014 drag it to your bookmarks bar first, then use it on your target page.</div></div>`,`<h2>Option 2 \u2014 Script tag</h2>
1753
1753
  <div class="card"><p>Add this tag to your HTML (before <code>&lt;/body&gt;</code>):</p>
1754
- <pre>${st(l)}</pre>
1754
+ <pre>${lt(l)}</pre>
1755
1755
  <div class="note">Requires the proto server to be running at port ${e}. Works without the Chrome extension.</div></div>`,`<h2>Option 3 \u2014 Browser console</h2>
1756
1756
  <div class="card"><p>Open browser DevTools console and paste:</p>
1757
- <pre>var s=document.createElement('script');s.src='${i}';s.setAttribute('data-vibeflow-overlay','');${d?`s.setAttribute('data-board-id','${d}');`:""}document.head.appendChild(s);</pre></div>`,'<div class="note" style="margin-top:20px">\u2699\uFE0F <strong>CSP note:</strong> If your app sets a strict Content-Security-Policy, use the Chrome extension instead \u2014 it bypasses CSP by injecting in the main world.</div>']))})}function mn(t,e,r){t.use("/trpc",Mr({router:Gt,createContext:()=>({projectDir:e,broadcast:r})}))}function hn(t){t.use((e,r,c,d)=>{console.error("[Vibeflow] Unhandled error:",e.message),c.status(500).json({error:"Internal server error"})})}function vn(t){t.use((e,r,c)=>{if(r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, POST, PATCH, DELETE, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){r.status(204).end();return}c()})}function yn(t){t.disable("x-powered-by"),t.use((e,r,c)=>{r.setHeader("Content-Security-Policy",["default-src 'self'","script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://cdn.tailwindcss.com https://unpkg.com","style-src 'self' 'unsafe-inline' https://fonts.googleapis.com","font-src 'self' https://fonts.gstatic.com","img-src 'self' data: blob:","connect-src 'self' ws://localhost:* ws://127.0.0.1:* wss://localhost:* wss://127.0.0.1:*","frame-ancestors 'none'","object-src 'none'","base-uri 'self'","form-action 'self'","worker-src 'self' blob:"].join("; ")),r.setHeader("Permissions-Policy","camera=(), microphone=(), geolocation=()"),r.setHeader("X-Content-Type-Options","nosniff"),r.setHeader("X-Frame-Options","DENY"),r.setHeader("Referrer-Policy","strict-origin-when-cross-origin"),r.setHeader("Cross-Origin-Embedder-Policy","unsafe-none"),r.setHeader("Cross-Origin-Opener-Policy","same-origin"),c()})}async function Dr(t,e){let r=e._testToken!==void 0?e._testToken:await W().catch(()=>null),c=e._testWorkspace!==void 0?e._testWorkspace:r?await V().catch(()=>null):null,d=!!(r&&c),i=te();vn(i),yn(i),i.use(te.json({limit:"10mb"}));let o=ln(i),l=new sn({server:o}),a=f=>{let k=JSON.stringify(f);for(let y of l.clients)y.readyState===cn.OPEN&&y.send(k)};l.on("connection",f=>{f.on("message",k=>{try{JSON.parse(k.toString()).type==="ping"&&f.send(JSON.stringify({type:"pong"}))}catch{}})});let s=Or(c?.url)??process.env.VIBEFLOW_API_URL??"http://localhost:3000";if(d){i.use(["/api/tasks","/api/push","/trpc"],(k,y)=>{y.status(503).json({error:"Online mode active \u2014 local task API is disabled. All task operations go through the SaaS backend."})});let f=Tt(s);i.get("/vibeflow-overlay.js",(k,y)=>{y.type("application/javascript").send(f)})}else{we(t);let f=Xe(e.port);i.get("/vibeflow-overlay.js",(y,b)=>{b.type("application/javascript").send(f)});let k=K(t,A,ke);i.get("/screenshots/:filename",(y,b)=>{let{filename:h}=y.params,p=X(h,".png");if(!Ae(p)){b.status(400).end();return}let g=K(k,`${p}.png`);if(!ct(g)){b.status(404).end();return}b.sendFile(g)}),dn(i,[]),pn(i,t,a),mn(i,t,a),fn(i,t,a)}gn(i,e.port),bn(i,e.port,d?c?.id:void 0,d?s:void 0);let u=d?null:Qe(K(t,A,xe),{onChanged:f=>{let k=J(f);a(k?{type:"task-changed",taskId:k.id,action:"update",task:k,source:"cli"}:{type:"tasks-updated"})},onDeleted:f=>{let k=X(f,".json");a({type:"task-deleted",taskId:k})}});return hn(i),new Promise((f,k)=>{let y=e.host??"localhost";o.listen(e.port,y,()=>{let h=`http://${y==="0.0.0.0"?un()??"localhost":y}:${e.port}`,p=y==="0.0.0.0"?`http://localhost:${e.port}`:null,g=w.dim(" "+"\u2500".repeat(62));console.log(),console.log(w.green(" \u2713 Vibeflow running")+w.dim(" \xB7 ")+w.cyan(h)),p&&console.log(w.dim(" Local: ")+w.cyan(p)),console.log(g),d?(console.log(w.dim(" Mode: ")+w.green("\u25CF Online")+w.dim(" \u2014 connected to Vibeflow SaaS")),console.log(w.dim(" Board: ")+w.white(c.name??"your board")),console.log(w.dim(" Web: ")+w.cyan(c.url)),console.log(g),console.log(w.dim(" Overlay script: ")+w.cyan(`${h}/vibeflow-overlay.js`)),console.log(),console.log(w.dim(" \u250C\u2500 Add to your HTML ")+w.dim("\u2500".repeat(43)+"\u2510")),console.log(w.dim(" \u2502 ")+w.yellow(`<script src="${h}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)+w.dim(" \u2502")),console.log(w.dim(" \u2502 ")+w.dim("Or drag the bookmarklet: ")+w.cyan(`${h}/inject`)+w.dim(" \u2502")),console.log(w.dim(" \u2514"+"\u2500".repeat(63)+"\u2518"))):(console.log(w.dim(" Mode: ")+w.yellow("\u25CE Local")+w.dim(" \u2014 no account needed")),console.log(g),console.log(w.bold.white(" BOARDS & APIS")),console.log(w.dim(" Kanban board ")+w.cyan(`${h}/kanban`)),console.log(w.dim(" Task API ")+w.cyan(`${h}/api/tasks`)),console.log(g),console.log(w.bold.white(" INTEGRATE INTO YOUR APP")+w.dim(` (full guide: ${h}/inject)`)),console.log(w.dim(" 1. Add this script tag to your HTML:")),console.log(w.dim(" ")+w.yellow(`<script src="${h}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)),console.log(w.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(w.dim(" 3. Click anything to annotate it.")),console.log(g),console.log(w.dim(" Bookmarklet \u2014 no code changes needed:")),console.log(w.dim(" Visit and drag the bookmarklet from ")+w.cyan(`${h}/inject`)+w.dim(" to your bookmarks bar."))),console.log(),e.noCtrlCHint||(console.log(w.dim(" Press Ctrl+C to stop")),console.log()),f({url:h,close:async()=>{u&&await u.close(),l.close(),await new Promise(x=>o.close(()=>x()))}})}),o.on("error",k)})}async function ut(t,e){if(!t)return Dr(e.projectDir??process.cwd(),e);if(t.startsWith("http://")||t.startsWith("https://"))throw new Error(`Proxy mode is no longer supported.
1757
+ <pre>var s=document.createElement('script');s.src='${i}';s.setAttribute('data-vibeflow-overlay','');${d?`s.setAttribute('data-board-id','${d}');`:""}document.head.appendChild(s);</pre></div>`,'<div class="note" style="margin-top:20px">\u2699\uFE0F <strong>CSP note:</strong> If your app sets a strict Content-Security-Policy, use the Chrome extension instead \u2014 it bypasses CSP by injecting in the main world.</div>']))})}function mn(t,e,r){t.use("/trpc",Mr({router:Yt,createContext:()=>({projectDir:e,broadcast:r})}))}function hn(t){t.use((e,r,c,d)=>{console.error("[Vibeflow] Unhandled error:",e.message),c.status(500).json({error:"Internal server error"})})}function vn(t){t.use((e,r,c)=>{if(r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, POST, PATCH, DELETE, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){r.status(204).end();return}c()})}function yn(t){t.disable("x-powered-by"),t.use((e,r,c)=>{r.setHeader("Content-Security-Policy",["default-src 'self'","script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://cdn.tailwindcss.com https://unpkg.com","style-src 'self' 'unsafe-inline' https://fonts.googleapis.com","font-src 'self' https://fonts.gstatic.com","img-src 'self' data: blob:","connect-src 'self' ws://localhost:* ws://127.0.0.1:* wss://localhost:* wss://127.0.0.1:*","frame-ancestors 'none'","object-src 'none'","base-uri 'self'","form-action 'self'","worker-src 'self' blob:"].join("; ")),r.setHeader("Permissions-Policy","camera=(), microphone=(), geolocation=()"),r.setHeader("X-Content-Type-Options","nosniff"),r.setHeader("X-Frame-Options","DENY"),r.setHeader("Referrer-Policy","strict-origin-when-cross-origin"),r.setHeader("Cross-Origin-Embedder-Policy","unsafe-none"),r.setHeader("Cross-Origin-Opener-Policy","same-origin"),c()})}async function Fr(t,e){let r=e._testToken!==void 0?e._testToken:await W().catch(()=>null),c=e._testWorkspace!==void 0?e._testWorkspace:r?await V().catch(()=>null):null,d=!!(r&&c),i=te();vn(i),yn(i),i.use(te.json({limit:"10mb"}));let o=ln(i),l=new sn({server:o}),a=f=>{let k=JSON.stringify(f);for(let y of l.clients)y.readyState===cn.OPEN&&y.send(k)};l.on("connection",f=>{f.on("message",k=>{try{JSON.parse(k.toString()).type==="ping"&&f.send(JSON.stringify({type:"pong"}))}catch{}})});let s=Ar(c?.url)??process.env.VIBEFLOW_API_URL??"http://localhost:3000";if(d){i.use(["/api/tasks","/api/push","/trpc"],(k,y)=>{y.status(503).json({error:"Online mode active \u2014 local task API is disabled. All task operations go through the SaaS backend."})});let f=jt(s);i.get("/vibeflow-overlay.js",(k,y)=>{y.type("application/javascript").send(f)})}else{we(t);let f=Xe(e.port);i.get("/vibeflow-overlay.js",(y,b)=>{b.type("application/javascript").send(f)});let k=K(t,A,ke);i.get("/screenshots/:filename",(y,b)=>{let{filename:h}=y.params,p=J(h,".png");if(!je(p)){b.status(400).end();return}let g=K(k,`${p}.png`);if(!st(g)){b.status(404).end();return}b.sendFile(g)}),dn(i,[]),pn(i,t,a),mn(i,t,a),fn(i,t,a)}gn(i,e.port),bn(i,e.port,d?c?.id:void 0,d?s:void 0);let u=d?null:Ge(K(t,A,xe),{onChanged:f=>{let k=X(f);a(k?{type:"task-changed",taskId:k.id,action:"update",task:k,source:"cli"}:{type:"tasks-updated"})},onDeleted:f=>{let k=J(f,".json");a({type:"task-deleted",taskId:k})}});return hn(i),new Promise((f,k)=>{let y=e.host??"localhost";o.listen(e.port,y,()=>{let h=`http://${y==="0.0.0.0"?un()??"localhost":y}:${e.port}`,p=y==="0.0.0.0"?`http://localhost:${e.port}`:null,g=w.dim(" "+"\u2500".repeat(62));console.log(),console.log(w.green(" \u2713 Vibeflow running")+w.dim(" \xB7 ")+w.cyan(h)),p&&console.log(w.dim(" Local: ")+w.cyan(p)),console.log(g),d?(console.log(w.dim(" Mode: ")+w.green("\u25CF Online")+w.dim(" \u2014 connected to Vibeflow SaaS")),console.log(w.dim(" Board: ")+w.white(c.name??"your board")),console.log(w.dim(" Web: ")+w.cyan(c.url)),console.log(g),console.log(w.dim(" Overlay script: ")+w.cyan(`${h}/vibeflow-overlay.js`)),console.log(),console.log(w.dim(" \u250C\u2500 Add to your HTML ")+w.dim("\u2500".repeat(43)+"\u2510")),console.log(w.dim(" \u2502 ")+w.yellow(`<script src="${h}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)+w.dim(" \u2502")),console.log(w.dim(" \u2502 ")+w.dim("Or drag the bookmarklet: ")+w.cyan(`${h}/inject`)+w.dim(" \u2502")),console.log(w.dim(" \u2514"+"\u2500".repeat(63)+"\u2518"))):(console.log(w.dim(" Mode: ")+w.yellow("\u25CE Local")+w.dim(" \u2014 no account needed")),console.log(g),console.log(w.bold.white(" BOARDS & APIS")),console.log(w.dim(" Kanban board ")+w.cyan(`${h}/kanban`)),console.log(w.dim(" Task API ")+w.cyan(`${h}/api/tasks`)),console.log(g),console.log(w.bold.white(" INTEGRATE INTO YOUR APP")+w.dim(` (full guide: ${h}/inject)`)),console.log(w.dim(" 1. Add this script tag to your HTML:")),console.log(w.dim(" ")+w.yellow(`<script src="${h}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)),console.log(w.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(w.dim(" 3. Click anything to annotate it.")),console.log(g),console.log(w.dim(" Bookmarklet \u2014 no code changes needed:")),console.log(w.dim(" Visit and drag the bookmarklet from ")+w.cyan(`${h}/inject`)+w.dim(" to your bookmarks bar."))),console.log(),e.noCtrlCHint||(console.log(w.dim(" Press Ctrl+C to stop")),console.log()),f({url:h,close:async()=>{u&&await u.close(),l.close(),await new Promise(x=>o.close(()=>x()))}})}),o.on("error",k)})}async function ct(t,e){if(!t)return Fr(e.projectDir??process.cwd(),e);if(t.startsWith("http://")||t.startsWith("https://"))throw new Error(`Proxy mode is no longer supported.
1758
1758
  To annotate an existing app, run: proto serve (API-only mode)
1759
- Then install the Chrome extension and navigate to your app.`);let r=Rr(t),d=Ir(r).isDirectory(),i=d?Er(r).filter(g=>on(g)===".html").map(g=>K(r,g)):[r];if(i.length===0)throw new Error("No HTML files found at "+t);let o=d?r:Nr(r);we(o);let l=te();vn(l),yn(l),l.use(te.json({limit:"10mb"}));let a=ln(l),s=new sn({server:a}),u=g=>{let x=JSON.stringify(g);for(let m of s.clients)m.readyState===cn.OPEN&&m.send(x)};s.on("connection",g=>{g.on("message",x=>{try{JSON.parse(x.toString()).type==="ping"&&g.send(JSON.stringify({type:"pong"}))}catch{}})});let f=e.noOverlay?null:Xe(e.port);f&&l.get("/vibeflow-overlay.js",(g,x)=>{x.type("application/javascript").send(f)});let k=K(o,A,ke);l.get("/screenshots/:filename",(g,x)=>{let{filename:m}=g.params,S=X(m,".png");if(!Ae(S)){x.status(400).end();return}let v=K(k,`${S}.png`);if(!ct(v)){x.status(404).end();return}x.sendFile(v)}),d&&l.get("/",(g,x)=>{let m=i.map(S=>{let v=X(S);return`<li><a href="/${v}">${v}</a></li>`}).join(`
1759
+ Then install the Chrome extension and navigate to your app.`);let r=Rr(t),d=Ir(r).isDirectory(),i=d?Er(r).filter(g=>on(g)===".html").map(g=>K(r,g)):[r];if(i.length===0)throw new Error("No HTML files found at "+t);let o=d?r:Nr(r);we(o);let l=te();vn(l),yn(l),l.use(te.json({limit:"10mb"}));let a=ln(l),s=new sn({server:a}),u=g=>{let x=JSON.stringify(g);for(let m of s.clients)m.readyState===cn.OPEN&&m.send(x)};s.on("connection",g=>{g.on("message",x=>{try{JSON.parse(x.toString()).type==="ping"&&g.send(JSON.stringify({type:"pong"}))}catch{}})});let f=e.noOverlay?null:Xe(e.port);f&&l.get("/vibeflow-overlay.js",(g,x)=>{x.type("application/javascript").send(f)});let k=K(o,A,ke);l.get("/screenshots/:filename",(g,x)=>{let{filename:m}=g.params,S=J(m,".png");if(!je(S)){x.status(400).end();return}let v=K(k,`${S}.png`);if(!st(v)){x.status(404).end();return}x.sendFile(v)}),d&&l.get("/",(g,x)=>{let m=i.map(S=>{let v=J(S);return`<li><a href="/${v}">${v}</a></li>`}).join(`
1760
1760
  `);x.send(`<!DOCTYPE html><html><head><title>Vibeflow Studio</title>
1761
1761
  <style>body{font-family:system-ui;max-width:600px;margin:40px auto;padding:0 20px}
1762
1762
  a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}
1763
1763
  li{margin:8px 0}</style></head>
1764
1764
  <body><h1>Vibeflow Studio</h1>
1765
1765
  <p>Select a prototype to review:</p>
1766
- <ul>${m}</ul></body></html>`)});for(let g of i){let x=d?`/${X(g)}`:"/";l.get(x,(m,S)=>{let v=Tr(g,"utf-8"),_=f?jt(v,f):v;S.type("html").send(_)})}let y=i.map(g=>`/${X(g)}`);dn(l,d?y:[]),pn(l,o,u),mn(l,o,u),fn(l,o,u),gn(l,e.port),bn(l,e.port);let b=null;b=Ge(r,{onChange:g=>{let x=X(g);console.log(w.dim(` File changed: ${x}`)),u({type:"reload",file:x})}});let h=K(o,A,xe),p=Qe(h,{onChanged:g=>{let x=J(g);u(x?{type:"task-changed",taskId:x.id,action:"update",task:x,source:"cli"}:{type:"tasks-updated"})},onDeleted:g=>{let x=X(g,".json");u({type:"task-deleted",taskId:x})}});return hn(l),new Promise((g,x)=>{let m=e.host??"localhost";a.listen(e.port,m,()=>{let v=`http://${m==="0.0.0.0"?un()??"localhost":m}:${e.port}`,_=m==="0.0.0.0"?`http://localhost:${e.port}`:null,C=w.dim(" "+"\u2500".repeat(62));console.log(),console.log(w.green(" \u2713 Vibeflow running")+w.dim(" \xB7 ")+w.cyan(v)),_&&console.log(w.dim(" Local: ")+w.cyan(_)),console.log(C);for(let R of i){let z=d?`/${X(R)}`:"/";console.log(w.dim(" File: ")+w.cyan(`${v}${z}`)+w.dim(` (${X(R)})`))}console.log(w.dim(" Kanban board: ")+w.cyan(`${v}/kanban`)),console.log(w.dim(" Task API: ")+w.cyan(`${v}/api/tasks`)),console.log(C),console.log(w.bold.white(" INTEGRATE INTO YOUR APP")+w.dim(` (full guide: ${v}/inject)`)),console.log(w.dim(" 1. Add this script tag to your HTML:")),console.log(w.dim(" ")+w.yellow(`<script src="${v}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)),console.log(w.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(w.dim(" 3. Click anything to annotate it.")),console.log(),console.log(w.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then(R=>R.default(v)).catch(()=>{}),g({url:v,close:async()=>{b&&await b.close(),await p.close(),s.close(),await new Promise(R=>a.close(()=>R()))}})}),a.on("error",x)})}async function ie(){return await W()?"saas":"local"}import M from"chalk";import Fr from"open";import xn from"readline";import Br from"@inquirer/select";import{existsSync as Wr,readdirSync as kn,readFileSync as Ur}from"fs";import{join as dt,resolve as Hr}from"path";var qr="https://app.vibeflow.tools",Vr=300*1e3;function wn(){return process.env.VIBEFLOW_API_URL??qr}async function Kr(t){return new Promise(e=>setTimeout(e,t))}async function Yr(t){return t.length===1?(console.log(M.dim(` Using board: ${t[0].icon??""} ${t[0].name}`)),t[0]):await Br({message:"Select a board to use:",choices:t.map(r=>({name:`${r.icon??""} ${r.name}`,value:r}))})}async function Sn(t,e){try{let r=await fetch(`${t}/api/cli/settings`,{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)return;let c=await r.json();c.settings&&Object.keys(c.settings).length>0&&Ut({...c.settings,_settingsRefreshedAt:Date.now()})}catch{}}async function Cn(){try{let t=await W();if(!t)return;let r=rt()._settingsRefreshedAt??0;if(Date.now()-r<Vr)return;let c=wn();Sn(c,t)}catch{}}async function Gr(t,e){try{let[r,c]=await Promise.all([fetch(`${t}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${e}`}}),fetch(`${t}/api/cli/profile`,{headers:{Authorization:`Bearer ${e}`}})]);if(!r.ok)return;let d=await r.json();if(!d.workspaces?.length){console.log(M.yellow(" No boards found. Create a board in the web app first."));return}let i=c.ok?await c.json():null,o=await Yr(d.workspaces);await Ct({...o,email:i?.email??null}),console.log(M.green(` Board set: ${o.icon??""} ${o.name}`)),console.log(M.dim(` Open at: ${o.url}`))}catch{}}async function Qr(t,e,r,c){let d=dt(t,A,xe);if(!Wr(d))return;let i=[];try{for(let u of kn(d))if(!u.startsWith(".")){let f=dt(d,u);for(let k of kn(f).filter(y=>y.endsWith(".json")))i.push(dt(f,k))}}catch{return}if(i.length===0)return;let o=i.flatMap(u=>{try{return[JSON.parse(Ur(u,"utf-8"))]}catch{return[]}}),l=new Set;try{let u=await fetch(`${e}/api/cli/tasks?boardId=${c.id}`,{headers:{Authorization:`Bearer ${r}`}}).catch(()=>null);if(u?.ok){let f=await u.json();l=new Set((f.tasks??[]).flatMap(k=>[k.id,...k.cliId?[k.cliId]:[]]))}}catch{}let a=o.filter(u=>!l.has(u.id));if(a.length===0)return;console.log(),console.log(M.bold(` ${a.length} local task${a.length!==1?"s are":" is"} not yet synced to the board:`));let s=a.slice(0,10);for(let u of s){let f=u.status?M.dim(` [${u.status}]`):"";console.log(M.dim(` \u2022 ${u.title??u.id}${f}`))}return a.length>10&&console.log(M.dim(` \u2026 and ${a.length-10} more`)),new Promise(u=>{let f=xn.createInterface({input:process.stdin,output:process.stdout});f.question(M.cyan(`
1767
- Push them to your board now? [Y/n]: `),async k=>{if(f.close(),k.trim().toLowerCase()==="n"){console.log(M.dim(" Skipped. You can push later with: vibeflow push")),u();return}let y=xn.createInterface({input:process.stdin,output:process.stdout});y.question(M.cyan(" Delete local task files after push? [y/N]: "),async b=>{y.close();let h=b.trim().toLowerCase()!=="y";try{let p=await fetch(`${e}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({boardId:c.id,tasks:a,keepLocalFiles:h})}),g={};try{g=await p.json()}catch{}p.ok?(console.log(M.green(` \u2713 Pushed ${g.imported??0} task${(g.imported??0)!==1?"s":""} to ${c.name}`)),(g.skipped??0)>0&&console.log(M.dim(` (${g.skipped} already existed and were skipped)`))):console.log(M.red(` Push failed: ${g.error??`HTTP ${p.status}`}`))}catch(p){console.log(M.red(` Push failed: ${p instanceof Error?p.message:"Network error"}`))}u()})})})}async function $e(t=Hr(".")){let e=wn();console.log(M.cyan(" Initiating device login flow..."));let r=await fetch(`${e}/api/cli/auth/device-init`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!r.ok){console.error(M.red(` Failed to initiate login: ${r.status} ${r.statusText}`)),process.exitCode=1;return}let{deviceCode:c,userCode:d,verificationUrl:i,expiresIn:o}=await r.json();console.log(),console.log(M.bold(" Open this URL in your browser to authorize:")),console.log(M.underline(` ${i}`)),console.log();try{await Fr(i),console.log(M.dim(" (Browser opened automatically)"))}catch{}let l=Date.now()+o*1e3,a=3e3;for(;Date.now()<l;){await Kr(a);let s=await fetch(`${e}/api/cli/auth/device-poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:c})});if(!s.ok){console.error(M.red(" Poll request failed. Retrying..."));continue}let u=await s.json();if("token"in u){await qt(u.token),console.log(),console.log(M.green(" Logged in successfully. Now operating in SaaS mode.")),await Promise.all([Gr(e,u.token),Sn(e,u.token)]);let{readWorkspace:f}=await import("./workspace-KGOQ67YV.js"),k=await f();k&&await Qr(t,e,u.token,k);return}if("expired"in u){console.error(M.red(" Device code expired. Please try again.")),process.exitCode=1;return}process.stdout.write(M.dim("."))}console.error(M.red(`
1768
- Login timed out. Please try again.`)),process.exitCode=1}import Jr from"chalk";async function _n(){await Promise.all([Vt(),_t()]),console.log(Jr.green(" Logged out. Now operating in local mode."))}import D from"chalk";import{unlinkSync as Xr,readFileSync as Zr,existsSync as ea}from"fs";import{resolve as ta,join as na}from"path";var ra="https://app.vibeflow.tools";function aa(){return process.env.VIBEFLOW_API_URL??ra}function oa(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function jn(t,e,r=24){let c=Math.round(t/e*r);return`[${"\u2588".repeat(c)+"\u2591".repeat(r-c)}]`}async function ia(t,e,r,c){let d=[];for(let{localId:y,remoteId:b}of c){let h=q(r,y);for(let p of h){let g=p.linkedPath??na(xt(r,y),p.name);ea(g)&&d.push({remoteId:b,name:p.name,filePath:g,size:p.size})}}if(d.length===0)return{uploaded:0,failed:0,failedFiles:[]};let i=d.length,o=d.reduce((y,b)=>y+b.size,0);console.log(D.cyan(`
1769
- Uploading ${i} file(s) (${oa(o)})...`));let l=0,a=0,s=0,u=Date.now(),f=[];for(let y of d){let b=Math.round(l/i*100),h=jn(l,i),p=(Date.now()-u)/1e3,g=s/Math.max(p,.01),x=o-s,m=g>0?Math.ceil(x/g):0,S=m>60?`${Math.ceil(m/60)}m`:`${m}s`;process.stdout.write(`\r ${h} ${b}% ${y.name.slice(0,28)} ETA: ${S} `);try{let v=Zr(y.filePath),_=await fetch(`${t}/api/tasks/${encodeURIComponent(y.remoteId)}/files`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/octet-stream","x-filename":encodeURIComponent(y.name)},body:v});_.ok?(l++,s+=y.size):(a++,f.push({name:y.name,reason:`HTTP ${_.status}`}))}catch(v){a++,f.push({name:y.name,reason:v instanceof Error?v.message:String(v)})}}let k=jn(i,i);return process.stdout.write(`\r ${k} 100% Done${" ".repeat(40)}
1770
- `),{uploaded:l,failed:a,failedFiles:f}}async function Tn(t,e){let r=ta(t),c=await W();if(!c&&(console.log(D.yellow(" Not logged in. Starting login flow...")),await $e(),c=await W(),!c)){console.error(D.red(" Login failed. Please run `vibeflow login` and try again.")),process.exitCode=1;return}let d=Z(r);if(d.length===0){console.log(D.dim(" No local tasks found. Nothing to push."));return}console.log(D.cyan(` Found ${d.length} local task(s). Pushing to SaaS...`));let i=aa(),o=e.workspace;if(!o){let p=await V();p&&(o=p.id,console.log(D.dim(` Using board: ${p.icon??""} ${p.name}`)))}let l={tasks:d};o&&(l.workspaceId=o);let a;try{let p=await fetch(`${i}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c}`},body:JSON.stringify(l)});if(!p.ok){let g=await p.json().catch(()=>({}));console.error(D.red(` Import failed: ${p.status} ${g.error??p.statusText}`)),process.exitCode=1;return}a=await p.json()}catch(p){let g=p instanceof Error?p.message:String(p);console.error(D.red(` Network error: ${g}`)),process.exitCode=1;return}console.log(D.green(` \u2713 Pushed ${a.imported} task(s) to SaaS`)),a.skipped&&a.skipped>0&&console.log(D.dim(` Skipped ${a.skipped} already-imported task(s).`));let s=(await V())?.name??a.workspaceId;console.log(D.dim(` Board: ${s}`));let u=a.idMap??{},f=d.filter(p=>p.id&&u[p.id]).map(p=>({localId:p.id,remoteId:u[p.id]})),{uploaded:k,failed:y,failedFiles:b}=await ia(i,c,r,f);if(k>0&&console.log(D.green(` \u2713 Uploaded ${k} file(s) to storage`)),y>0){console.log(D.yellow(` \u26A0 ${y} file(s) failed to upload`));for(let p of b)console.log(D.dim(` - ${p.name}: ${p.reason}`))}if(e.keepLocalFiles){console.log(D.dim(" Local task files kept (--keep-local-files)."));return}let h=0;for(let p of d)try{Xr(p.filePath),h++}catch{}console.log(D.dim(` Deleted ${h} local task file(s).`))}var la="https://app.vibeflow.tools";function De(){return process.env.VIBEFLOW_API_URL??la}var sa={backlog:"backlog",todo:"todo","in-progress":"in_progress",review:"review",done:"done"},ca={backlog:"backlog",todo:"todo",in_progress:"in-progress",review:"review",done:"done",cancelled:"done"};function ne(t){return ca[t]??"todo"}function ua(t){return sa[t]??"todo"}async function Fe(){let t=await W();return t?{Authorization:`Bearer ${t}`}:null}async function me(t){let e=await Fe();if(!e)return null;let r=new URL(`${De()}/api/cli/tasks`);t&&r.searchParams.set("boardId",t);try{let c=await fetch(r.toString(),{headers:e});return c.ok?c.json():null}catch{return null}}async function En(t){let e=await me();return e?e.tasks.find(r=>r.id===t)??null:null}async function pt(t,e){let r=await Fe();if(!r)return null;let c={};e.status!==void 0&&(c.status=ua(e.status)),e.title!==void 0&&(c.title=e.title),e.description!==void 0&&(c.description=e.description),e.priority!==void 0&&(c.priority=e.priority),e.branchName!==void 0&&(c.branchName=e.branchName);try{let d=await fetch(`${De()}/api/cli/tasks/${encodeURIComponent(t)}`,{method:"PATCH",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify(c)});if(!d.ok)return null;let i=await d.json();return{task:i.task,warning:i.warning}}catch{return null}}async function In(t,e){let r=await Fe();if(!r)return null;try{let c=await fetch(`${De()}/api/cli/tasks/${encodeURIComponent(t)}/comments`,{method:"POST",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify({body:e})});return c.ok?(await c.json()).comment:null}catch{return null}}async function Pn(t){let e=await Fe();if(!e)return null;try{let r=await fetch(`${De()}/api/cli/tasks`,{method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t)});return r.ok?(await r.json()).task:null}catch{return null}}import{readFileSync as Hn,existsSync as qn,unlinkSync as Ca}from"fs";import{resolve as F,join as _a,basename as $n}from"path";import n from"chalk";import{createHash as da,randomUUID as pa}from"crypto";import{existsSync as fa,readFileSync as ga,writeFileSync as ba,mkdirSync as ma}from"fs";import{join as Rn}from"path";import Nn from"os";import{PostHog as ha}from"posthog-node";var va="phc_C9AUV3rnayLfVvxgHtvj6AXcwsd8FKWUfJ9262zWsCvM",ya="https://eu.i.posthog.com";function Ln(){return Rn(process.env.HOME??Nn.homedir(),".vibeflow")}function Mn(){return Rn(Ln(),"config.json")}function Be(){try{return JSON.parse(ga(Mn(),"utf-8"))}catch{return{}}}function zn(t){let e=Ln();fa(e)||ma(e,{recursive:!0});let r=Be();ba(Mn(),JSON.stringify({...r,...t},null,2),"utf-8")}function On(){return process.env.VIBEFLOW_TELEMETRY==="0"?!1:Be().disabled!==!0}function ft(t){zn({disabled:!t})}function An(){let t=On(),e=Be();return{enabled:t,anonymousId:e.anonymousId??null}}function xa(){let t=Be();if(t.anonymousId)return t.anonymousId;let e=pa();return zn({anonymousId:e}),e}function ka(){let t=Nn.userInfo().username;return da("sha256").update(t).digest("hex").slice(0,16)}var je=null;function wa(){return On()?(je||(je=new ha(va,{host:ya,flushAt:1,flushInterval:0})),je):null}function le(t,e){let r=wa();if(!r)return;let c=xa();r.capture({distinctId:c,event:t,properties:{...e,$user_id:ka()}})}async function se(){if(je)try{await je.shutdown()}catch{}}function ja(t,e){let r=s=>s.replace(/[^0-9.]/g,"").split(".").map(Number),[c=0,d=0,i=0]=r(t),[o=0,l=0,a=0]=r(e);return c!==o?c>o:d!==l?d>l:i>a}function Ta(){let t="0.9.0";if(!t)return;let e="@vibeflow-tools/cli";import("https").then(({default:r})=>{let c=r.get(`https://registry.npmjs.org/${encodeURIComponent(e)}/latest`,{timeout:5e3},d=>{let i="";d.on("data",o=>{i+=o.toString()}),d.on("end",()=>{try{let{version:o}=JSON.parse(i);o&&ja(o,t)&&(console.log(),console.log(n.bgYellow.black.bold(` \u2191 Update available: ${t} \u2192 ${o} `)),console.log(n.dim(" Run: ")+n.cyan(`npm install -g ${e}@${o}`)+n.dim(" to update")),console.log())}catch{}})});c.on("error",()=>{}),c.on("timeout",()=>{c.destroy()})}).catch(()=>{})}Cn();var ue={backlog:n.gray,todo:n.yellow,"in-progress":n.blue,review:n.magenta,done:n.green},Ea=new Set(["Task","Bug","Research"]),We=["backlog","todo","in-progress","review","done"],ce=(t,e)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();function Dn(t){let e=r=>t.filter(c=>c.status===r).length;return` Total: ${t.length} | Backlog: ${e("backlog")} | Todo: ${e("todo")} | In Progress: ${e("in-progress")} | Review: ${e("review")} | Done: ${e("done")}`}function Ia(t){if(t){for(let e of Ea)if(e.toLowerCase()===t.toLowerCase())return e}}function ae(t){let e=(t??"Medium").trim().toLowerCase();return e==="critical"?0:e==="high"?1:e==="low"?3:2}var Fn=["in-progress","review","todo","backlog","done"];function Ue(t){let e=Fn.indexOf(t);return e===-1?Fn.length:e}function Bn(t){try{return qe("git",["push"],{cwd:t,stdio:"inherit"}),{ok:!0}}catch{try{let e=gt("git rev-parse --abbrev-ref HEAD",{cwd:t}).toString().trim();return qe("git",["push","--set-upstream","origin",e],{cwd:t,stdio:"inherit"}),{ok:!0}}catch(e){return{ok:!1,error:(e instanceof Error?e.message:String(e)).slice(0,220)}}}}function he(t){let e=Ie(t);for(let r of e.split(`
1771
- `))r.startsWith("Agent instructions")?console.log(n.bold(r)):r.startsWith(" \u26A0")?console.log(n.yellow(r)):r.startsWith(" CRITICAL:")?console.log(n.red(r)):console.log(n.dim(r))}var Wn=["Task","Bug","Feature","Enhancement","Research"],Un=t=>t.trim().toLowerCase();function ve(t,e){let r=Un(e);return r?Un(t??"")===r:!0}function Pa(t){return[...new Set(t.map(e=>e.author?.trim()).filter(e=>!!e))].sort((e,r)=>e.localeCompare(r))}function He(t){return Wn.map(e=>e.toLowerCase()).includes(t.toLowerCase())?!0:(console.log(n.red(`\u2717 Invalid type filter: "${t}"`)),console.log(n.yellow(` Available types: ${Wn.join(" | ")}`)),console.log(n.dim(" Type filter is exact (example: --type Bug)")),process.exitCode=1,!1)}function Te(t,e){let r=Pa(e);return r.length===0?(console.log(n.red("\u2717 Cannot filter by user: no task authors are available on this board.")),process.exitCode=1,!1):r.some(c=>ve(c,t))?!0:(console.log(n.red(`\u2717 User not found: "${t}"`)),console.log(n.yellow(` Available users: ${r.join(" | ")}`)),console.log(n.dim(" User filter is exact email match (case-insensitive).")),process.exitCode=1,!1)}function Ra(t,e,r,c,d){let i=ue[t.status]??n.white;if(console.log(` ${n.dim(`${r+1}.`)} ${i(`[${e.status}]`)} ${e.title}`),console.log(n.dim(` id: ${e.id}`)),console.log(n.dim(` file: ${t.filePath}`)),e.file&&console.log(n.dim(` source: ${e.file}${e.line!=null?`:${e.line}`:""}${e.col!=null?`:${e.col}`:""}`)),e.component&&console.log(n.dim(` component: ${e.component}`)),console.log(n.dim(` selector: ${e.selector}`)),t.cssSelector&&console.log(n.dim(` css: ${t.cssSelector}`)),e.url&&console.log(n.dim(` url: ${e.url}`)),t.screenshot&&console.log(n.dim(` screenshot: http://localhost:${c}/screenshots/${t.screenshot}`)),t.commits&&t.commits.length>0)if(t.commits.length===1)console.log(n.dim(` commit: ${t.commits[0].sha}`));else{console.log(n.dim(` commits (${t.commits.length}):`));for(let o of t.commits)console.log(n.dim(` ${o.sha.slice(0,8)} ${o.timestamp} ${o.message.slice(0,60)}`))}if(t.branchName&&console.log(n.dim(` branch: ${t.branchName}`)),console.log(n.dim(` created: ${e.created}`)),e.type&&console.log(n.dim(` type: ${e.type}`)),e.priority&&console.log(n.dim(` priority: ${e.priority}`)),e.description){console.log(n.dim(" description:"));for(let o of e.description.split(`
1766
+ <ul>${m}</ul></body></html>`)});for(let g of i){let x=d?`/${J(g)}`:"/";l.get(x,(m,S)=>{let v=Tr(g,"utf-8"),_=f?_t(v,f):v;S.type("html").send(_)})}let y=i.map(g=>`/${J(g)}`);dn(l,d?y:[]),pn(l,o,u),mn(l,o,u),fn(l,o,u),gn(l,e.port),bn(l,e.port);let b=null;b=Ye(r,{onChange:g=>{let x=J(g);console.log(w.dim(` File changed: ${x}`)),u({type:"reload",file:x})}});let h=K(o,A,xe),p=Ge(h,{onChanged:g=>{let x=X(g);u(x?{type:"task-changed",taskId:x.id,action:"update",task:x,source:"cli"}:{type:"tasks-updated"})},onDeleted:g=>{let x=J(g,".json");u({type:"task-deleted",taskId:x})}});return hn(l),new Promise((g,x)=>{let m=e.host??"localhost";a.listen(e.port,m,()=>{let v=`http://${m==="0.0.0.0"?un()??"localhost":m}:${e.port}`,_=m==="0.0.0.0"?`http://localhost:${e.port}`:null,C=w.dim(" "+"\u2500".repeat(62));console.log(),console.log(w.green(" \u2713 Vibeflow running")+w.dim(" \xB7 ")+w.cyan(v)),_&&console.log(w.dim(" Local: ")+w.cyan(_)),console.log(C);for(let N of i){let z=d?`/${J(N)}`:"/";console.log(w.dim(" File: ")+w.cyan(`${v}${z}`)+w.dim(` (${J(N)})`))}console.log(w.dim(" Kanban board: ")+w.cyan(`${v}/kanban`)),console.log(w.dim(" Task API: ")+w.cyan(`${v}/api/tasks`)),console.log(C),console.log(w.bold.white(" INTEGRATE INTO YOUR APP")+w.dim(` (full guide: ${v}/inject)`)),console.log(w.dim(" 1. Add this script tag to your HTML:")),console.log(w.dim(" ")+w.yellow(`<script src="${v}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)),console.log(w.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(w.dim(" 3. Click anything to annotate it.")),console.log(),console.log(w.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then(N=>N.default(v)).catch(()=>{}),g({url:v,close:async()=>{b&&await b.close(),await p.close(),s.close(),await new Promise(N=>a.close(()=>N()))}})}),a.on("error",x)})}async function ie(){return await W()?"saas":"local"}import L from"chalk";import Br from"open";import xn from"readline";import Wr from"@inquirer/select";import{existsSync as Ur,readdirSync as kn,readFileSync as Hr}from"fs";import{join as ut,resolve as qr}from"path";var Vr="https://app.vibeflow.tools",Kr=300*1e3;function wn(){return process.env.VIBEFLOW_API_URL??Vr}async function Yr(t){return new Promise(e=>setTimeout(e,t))}async function Gr(t){return t.length===1?(console.log(L.dim(` Using board: ${t[0].icon??""} ${t[0].name}`)),t[0]):await Wr({message:"Select a board to use:",choices:t.map(r=>({name:`${r.icon??""} ${r.name}`,value:r}))})}async function Sn(t,e){try{let r=await fetch(`${t}/api/cli/settings`,{headers:{Authorization:`Bearer ${e}`}});if(!r.ok)return;let c=await r.json();c.settings&&Object.keys(c.settings).length>0&&Wt({...c.settings,_settingsRefreshedAt:Date.now()})}catch{}}async function Cn(){try{let t=await W();if(!t)return;let r=nt()._settingsRefreshedAt??0;if(Date.now()-r<Kr)return;let c=wn();Sn(c,t)}catch{}}async function Qr(t,e){try{let[r,c]=await Promise.all([fetch(`${t}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${e}`}}),fetch(`${t}/api/cli/profile`,{headers:{Authorization:`Bearer ${e}`}})]);if(!r.ok)return;let d=await r.json();if(!d.workspaces?.length){console.log(L.yellow(" No boards found. Create a board in the web app first."));return}let i=c.ok?await c.json():null,o=await Gr(d.workspaces);await St({...o,email:i?.email??null}),console.log(L.green(` Board set: ${o.icon??""} ${o.name}`)),console.log(L.dim(` Open at: ${o.url}`))}catch{}}async function Xr(t,e,r,c){let d=ut(t,A,xe);if(!Ur(d))return;let i=[];try{for(let u of kn(d))if(!u.startsWith(".")){let f=ut(d,u);for(let k of kn(f).filter(y=>y.endsWith(".json")))i.push(ut(f,k))}}catch{return}if(i.length===0)return;let o=i.flatMap(u=>{try{return[JSON.parse(Hr(u,"utf-8"))]}catch{return[]}}),l=new Set;try{let u=await fetch(`${e}/api/cli/tasks?boardId=${c.id}`,{headers:{Authorization:`Bearer ${r}`}}).catch(()=>null);if(u?.ok){let f=await u.json();l=new Set((f.tasks??[]).flatMap(k=>[k.id,...k.cliId?[k.cliId]:[]]))}}catch{}let a=o.filter(u=>!l.has(u.id));if(a.length===0)return;console.log(),console.log(L.bold(` ${a.length} local task${a.length!==1?"s are":" is"} not yet synced to the board:`));let s=a.slice(0,10);for(let u of s){let f=u.status?L.dim(` [${u.status}]`):"";console.log(L.dim(` \u2022 ${u.title??u.id}${f}`))}return a.length>10&&console.log(L.dim(` \u2026 and ${a.length-10} more`)),new Promise(u=>{let f=xn.createInterface({input:process.stdin,output:process.stdout});f.question(L.cyan(`
1767
+ Push them to your board now? [Y/n]: `),async k=>{if(f.close(),k.trim().toLowerCase()==="n"){console.log(L.dim(" Skipped. You can push later with: vibeflow push")),u();return}let y=xn.createInterface({input:process.stdin,output:process.stdout});y.question(L.cyan(" Delete local task files after push? [y/N]: "),async b=>{y.close();let h=b.trim().toLowerCase()!=="y";try{let p=await fetch(`${e}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({boardId:c.id,tasks:a,keepLocalFiles:h})}),g={};try{g=await p.json()}catch{}p.ok?(console.log(L.green(` \u2713 Pushed ${g.imported??0} task${(g.imported??0)!==1?"s":""} to ${c.name}`)),(g.skipped??0)>0&&console.log(L.dim(` (${g.skipped} already existed and were skipped)`))):console.log(L.red(` Push failed: ${g.error??`HTTP ${p.status}`}`))}catch(p){console.log(L.red(` Push failed: ${p instanceof Error?p.message:"Network error"}`))}u()})})})}async function $e(t=qr(".")){let e=wn();console.log(L.cyan(" Initiating device login flow..."));let r=await fetch(`${e}/api/cli/auth/device-init`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!r.ok){console.error(L.red(` Failed to initiate login: ${r.status} ${r.statusText}`)),process.exitCode=1;return}let{deviceCode:c,userCode:d,verificationUrl:i,expiresIn:o}=await r.json();console.log(),console.log(L.bold(" Open this URL in your browser to authorize:")),console.log(L.underline(` ${i}`)),console.log();try{await Br(i),console.log(L.dim(" (Browser opened automatically)"))}catch{}let l=Date.now()+o*1e3,a=3e3;for(;Date.now()<l;){await Yr(a);let s=await fetch(`${e}/api/cli/auth/device-poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:c})});if(!s.ok){console.error(L.red(" Poll request failed. Retrying..."));continue}let u=await s.json();if("token"in u){await Ht(u.token),console.log(),console.log(L.green(" Logged in successfully. Now operating in SaaS mode.")),await Promise.all([Qr(e,u.token),Sn(e,u.token)]);let{readWorkspace:f}=await import("./workspace-KGOQ67YV.js"),k=await f();k&&await Xr(t,e,u.token,k);return}if("expired"in u){console.error(L.red(" Device code expired. Please try again.")),process.exitCode=1;return}process.stdout.write(L.dim("."))}console.error(L.red(`
1768
+ Login timed out. Please try again.`)),process.exitCode=1}import Jr from"chalk";async function _n(){await Promise.all([qt(),Ct()]),console.log(Jr.green(" Logged out. Now operating in local mode."))}import D from"chalk";import{unlinkSync as Zr,readFileSync as ea,existsSync as ta}from"fs";import{resolve as na,join as ra}from"path";var aa="https://app.vibeflow.tools";function oa(){return process.env.VIBEFLOW_API_URL??aa}function ia(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function jn(t,e,r=24){let c=Math.round(t/e*r);return`[${"\u2588".repeat(c)+"\u2591".repeat(r-c)}]`}async function la(t,e,r,c){let d=[];for(let{localId:y,remoteId:b}of c){let h=q(r,y);for(let p of h){let g=p.linkedPath??ra(yt(r,y),p.name);ta(g)&&d.push({remoteId:b,name:p.name,filePath:g,size:p.size})}}if(d.length===0)return{uploaded:0,failed:0,failedFiles:[]};let i=d.length,o=d.reduce((y,b)=>y+b.size,0);console.log(D.cyan(`
1769
+ Uploading ${i} file(s) (${ia(o)})...`));let l=0,a=0,s=0,u=Date.now(),f=[];for(let y of d){let b=Math.round(l/i*100),h=jn(l,i),p=(Date.now()-u)/1e3,g=s/Math.max(p,.01),x=o-s,m=g>0?Math.ceil(x/g):0,S=m>60?`${Math.ceil(m/60)}m`:`${m}s`;process.stdout.write(`\r ${h} ${b}% ${y.name.slice(0,28)} ETA: ${S} `);try{let v=ea(y.filePath),_=await fetch(`${t}/api/tasks/${encodeURIComponent(y.remoteId)}/files`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/octet-stream","x-filename":encodeURIComponent(y.name)},body:v});_.ok?(l++,s+=y.size):(a++,f.push({name:y.name,reason:`HTTP ${_.status}`}))}catch(v){a++,f.push({name:y.name,reason:v instanceof Error?v.message:String(v)})}}let k=jn(i,i);return process.stdout.write(`\r ${k} 100% Done${" ".repeat(40)}
1770
+ `),{uploaded:l,failed:a,failedFiles:f}}async function Tn(t,e){let r=na(t),c=await W();if(!c&&(console.log(D.yellow(" Not logged in. Starting login flow...")),await $e(),c=await W(),!c)){console.error(D.red(" Login failed. Please run `vibeflow login` and try again.")),process.exitCode=1;return}let d=Z(r);if(d.length===0){console.log(D.dim(" No local tasks found. Nothing to push."));return}console.log(D.cyan(` Found ${d.length} local task(s). Pushing to SaaS...`));let i=oa(),o=e.workspace;if(!o){let p=await V();p&&(o=p.id,console.log(D.dim(` Using board: ${p.icon??""} ${p.name}`)))}let l={tasks:d};o&&(l.workspaceId=o);let a;try{let p=await fetch(`${i}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c}`},body:JSON.stringify(l)});if(!p.ok){let g=await p.json().catch(()=>({}));console.error(D.red(` Import failed: ${p.status} ${g.error??p.statusText}`)),process.exitCode=1;return}a=await p.json()}catch(p){let g=p instanceof Error?p.message:String(p);console.error(D.red(` Network error: ${g}`)),process.exitCode=1;return}console.log(D.green(` \u2713 Pushed ${a.imported} task(s) to SaaS`)),a.skipped&&a.skipped>0&&console.log(D.dim(` Skipped ${a.skipped} already-imported task(s).`));let s=(await V())?.name??a.workspaceId;console.log(D.dim(` Board: ${s}`));let u=a.idMap??{},f=d.filter(p=>p.id&&u[p.id]).map(p=>({localId:p.id,remoteId:u[p.id]})),{uploaded:k,failed:y,failedFiles:b}=await la(i,c,r,f);if(k>0&&console.log(D.green(` \u2713 Uploaded ${k} file(s) to storage`)),y>0){console.log(D.yellow(` \u26A0 ${y} file(s) failed to upload`));for(let p of b)console.log(D.dim(` - ${p.name}: ${p.reason}`))}if(e.keepLocalFiles){console.log(D.dim(" Local task files kept (--keep-local-files)."));return}let h=0;for(let p of d)try{Zr(p.filePath),h++}catch{}console.log(D.dim(` Deleted ${h} local task file(s).`))}var sa="https://app.vibeflow.tools";function De(){return process.env.VIBEFLOW_API_URL??sa}var ca={backlog:"backlog",todo:"todo","in-progress":"in_progress",review:"review",done:"done"},ua={backlog:"backlog",todo:"todo",in_progress:"in-progress",review:"review",done:"done",cancelled:"done"};function ne(t){return ua[t]??"todo"}function da(t){return ca[t]??"todo"}async function Fe(){let t=await W();return t?{Authorization:`Bearer ${t}`}:null}async function me(t){let e=await Fe();if(!e)return null;let r=new URL(`${De()}/api/cli/tasks`);t&&r.searchParams.set("boardId",t);try{let c=await fetch(r.toString(),{headers:e});return c.ok?c.json():null}catch{return null}}async function En(t){let e=await me();return e?e.tasks.find(r=>r.id===t)??null:null}async function dt(t,e){let r=await Fe();if(!r)return null;let c={};e.status!==void 0&&(c.status=da(e.status)),e.title!==void 0&&(c.title=e.title),e.description!==void 0&&(c.description=e.description),e.priority!==void 0&&(c.priority=e.priority),e.branchName!==void 0&&(c.branchName=e.branchName);try{let d=await fetch(`${De()}/api/cli/tasks/${encodeURIComponent(t)}`,{method:"PATCH",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify(c)});if(!d.ok)return null;let i=await d.json();return{task:i.task,warning:i.warning}}catch{return null}}async function In(t,e){let r=await Fe();if(!r)return null;try{let c=await fetch(`${De()}/api/cli/tasks/${encodeURIComponent(t)}/comments`,{method:"POST",headers:{...r,"Content-Type":"application/json"},body:JSON.stringify({body:e})});return c.ok?(await c.json()).comment:null}catch{return null}}async function Pn(t){let e=await Fe();if(!e)return null;try{let r=await fetch(`${De()}/api/cli/tasks`,{method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t)});return r.ok?(await r.json()).task:null}catch{return null}}import{readFileSync as Hn,existsSync as qn,unlinkSync as _a}from"fs";import{resolve as F,join as ja,basename as $n}from"path";import n from"chalk";import{createHash as pa,randomUUID as fa}from"crypto";import{existsSync as ga,readFileSync as ba,writeFileSync as ma,mkdirSync as ha}from"fs";import{join as Rn}from"path";import Nn from"os";import{PostHog as va}from"posthog-node";var ya="phc_C9AUV3rnayLfVvxgHtvj6AXcwsd8FKWUfJ9262zWsCvM",xa="https://eu.i.posthog.com";function Ln(){return Rn(process.env.HOME??Nn.homedir(),".vibeflow")}function Mn(){return Rn(Ln(),"config.json")}function Be(){try{return JSON.parse(ba(Mn(),"utf-8"))}catch{return{}}}function zn(t){let e=Ln();ga(e)||ha(e,{recursive:!0});let r=Be();ma(Mn(),JSON.stringify({...r,...t},null,2),"utf-8")}function On(){return process.env.VIBEFLOW_TELEMETRY==="0"?!1:Be().disabled!==!0}function pt(t){zn({disabled:!t})}function An(){let t=On(),e=Be();return{enabled:t,anonymousId:e.anonymousId??null}}function ka(){let t=Be();if(t.anonymousId)return t.anonymousId;let e=fa();return zn({anonymousId:e}),e}function wa(){let t=Nn.userInfo().username;return pa("sha256").update(t).digest("hex").slice(0,16)}var Te=null;function Sa(){return On()?(Te||(Te=new va(ya,{host:xa,flushAt:1,flushInterval:0})),Te):null}function le(t,e){let r=Sa();if(!r)return;let c=ka();r.capture({distinctId:c,event:t,properties:{...e,$user_id:wa()}})}async function se(){if(Te)try{await Te.shutdown()}catch{}}function Ta(t,e){let r=s=>s.replace(/[^0-9.]/g,"").split(".").map(Number),[c=0,d=0,i=0]=r(t),[o=0,l=0,a=0]=r(e);return c!==o?c>o:d!==l?d>l:i>a}function Ea(){let t="0.9.1";if(!t)return;let e="@vibeflow-tools/cli";import("https").then(({default:r})=>{let c=r.get(`https://registry.npmjs.org/${encodeURIComponent(e)}/latest`,{timeout:5e3},d=>{let i="";d.on("data",o=>{i+=o.toString()}),d.on("end",()=>{try{let{version:o}=JSON.parse(i);o&&Ta(o,t)&&(console.log(),console.log(n.bgYellow.black.bold(` \u2191 Update available: ${t} \u2192 ${o} `)),console.log(n.dim(" Run: ")+n.cyan(`npm install -g ${e}@${o}`)+n.dim(" to update")),console.log())}catch{}})});c.on("error",()=>{}),c.on("timeout",()=>{c.destroy()})}).catch(()=>{})}Cn();var ue={backlog:n.gray,todo:n.yellow,"in-progress":n.blue,review:n.magenta,done:n.green},Ia=new Set(["Task","Bug","Research"]),We=["backlog","todo","in-progress","review","done"],ce=(t,e)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();function Dn(t){let e=r=>t.filter(c=>c.status===r).length;return` Total: ${t.length} | Backlog: ${e("backlog")} | Todo: ${e("todo")} | In Progress: ${e("in-progress")} | Review: ${e("review")} | Done: ${e("done")}`}function Pa(t){if(t){for(let e of Ia)if(e.toLowerCase()===t.toLowerCase())return e}}function ae(t){let e=(t??"Medium").trim().toLowerCase();return e==="critical"?0:e==="high"?1:e==="low"?3:2}var Fn=["in-progress","review","todo","backlog","done"];function Ue(t){let e=Fn.indexOf(t);return e===-1?Fn.length:e}function Bn(t){try{return qe("git",["push"],{cwd:t,stdio:"inherit"}),{ok:!0}}catch{try{let e=ft("git rev-parse --abbrev-ref HEAD",{cwd:t}).toString().trim();return qe("git",["push","--set-upstream","origin",e],{cwd:t,stdio:"inherit"}),{ok:!0}}catch(e){return{ok:!1,error:(e instanceof Error?e.message:String(e)).slice(0,220)}}}}function he(t){let e=Pe(t);for(let r of e.split(`
1771
+ `))r.startsWith("Agent instructions")?console.log(n.bold(r)):r.startsWith(" \u26A0")?console.log(n.yellow(r)):r.startsWith(" CRITICAL:")?console.log(n.red(r)):console.log(n.dim(r))}var Wn=["Task","Bug","Feature","Enhancement","Research"],Un=t=>t.trim().toLowerCase();function ve(t,e){let r=Un(e);return r?Un(t??"")===r:!0}function Ra(t){return[...new Set(t.map(e=>e.author?.trim()).filter(e=>!!e))].sort((e,r)=>e.localeCompare(r))}function He(t){return Wn.map(e=>e.toLowerCase()).includes(t.toLowerCase())?!0:(console.log(n.red(`\u2717 Invalid type filter: "${t}"`)),console.log(n.yellow(` Available types: ${Wn.join(" | ")}`)),console.log(n.dim(" Type filter is exact (example: --type Bug)")),process.exitCode=1,!1)}function Ee(t,e){let r=Ra(e);return r.length===0?(console.log(n.red("\u2717 Cannot filter by user: no task authors are available on this board.")),process.exitCode=1,!1):r.some(c=>ve(c,t))?!0:(console.log(n.red(`\u2717 User not found: "${t}"`)),console.log(n.yellow(` Available users: ${r.join(" | ")}`)),console.log(n.dim(" User filter is exact email match (case-insensitive).")),process.exitCode=1,!1)}function Na(t,e,r,c,d){let i=ue[t.status]??n.white;if(console.log(` ${n.dim(`${r+1}.`)} ${i(`[${e.status}]`)} ${e.title}`),console.log(n.dim(` id: ${e.id}`)),console.log(n.dim(` file: ${t.filePath}`)),e.file&&console.log(n.dim(` source: ${e.file}${e.line!=null?`:${e.line}`:""}${e.col!=null?`:${e.col}`:""}`)),e.component&&console.log(n.dim(` component: ${e.component}`)),console.log(n.dim(` selector: ${e.selector}`)),t.cssSelector&&console.log(n.dim(` css: ${t.cssSelector}`)),e.url&&console.log(n.dim(` url: ${e.url}`)),t.screenshot&&console.log(n.dim(` screenshot: http://localhost:${c}/screenshots/${t.screenshot}`)),t.commits&&t.commits.length>0)if(t.commits.length===1)console.log(n.dim(` commit: ${t.commits[0].sha}`));else{console.log(n.dim(` commits (${t.commits.length}):`));for(let o of t.commits)console.log(n.dim(` ${o.sha.slice(0,8)} ${o.timestamp} ${o.message.slice(0,60)}`))}if(t.branchName&&console.log(n.dim(` branch: ${t.branchName}`)),console.log(n.dim(` created: ${e.created}`)),e.type&&console.log(n.dim(` type: ${e.type}`)),e.priority&&console.log(n.dim(` priority: ${e.priority}`)),e.description){console.log(n.dim(" description:"));for(let o of e.description.split(`
1772
1772
  `))console.log(n.dim(` ${o}`))}if(e.structuredComments&&e.structuredComments.length>0){console.log(n.dim(` comments (${e.structuredComments.length}):`));for(let o of e.structuredComments){let l=o.updatedAt?` (edited ${o.updatedAt})`:"";console.log(n.dim(` [${o.author??"agent"}] ${o.createdAt}${l}`));for(let a of o.text.split(`
1773
- `))console.log(n.dim(` ${a}`))}}if(e.linkedFiles&&e.linkedFiles.length>0){console.log(n.dim(` linked files (${e.linkedFiles.length}):`));for(let o of e.linkedFiles){let l=o.linkedPath??_a(d,".vibeflow","files",t.id,o.name);if(console.log(n.dim(` - ${o.name} ${o.url}`)),/\.(md|txt)$/i.test(o.name)&&o.size<1e5&&qn(l))try{let a=Hn(l,"utf-8");console.log(n.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let s of a.split(`
1774
- `))console.log(n.dim(` \u2502 ${s}`));console.log(n.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}catch{}}}console.log()}var G=new Sa;G.name("vibeflow").description("Vibeflow \u2014 CLI tool for frontend prototyping with LLM assistance").version("0.9.0");G.addHelpText("after",`
1773
+ `))console.log(n.dim(` ${a}`))}}if(e.linkedFiles&&e.linkedFiles.length>0){console.log(n.dim(` linked files (${e.linkedFiles.length}):`));for(let o of e.linkedFiles){let l=o.linkedPath??ja(d,".vibeflow","files",t.id,o.name);if(console.log(n.dim(` - ${o.name} ${o.url}`)),/\.(md|txt)$/i.test(o.name)&&o.size<1e5&&qn(l))try{let a=Hn(l,"utf-8");console.log(n.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let s of a.split(`
1774
+ `))console.log(n.dim(` \u2502 ${s}`));console.log(n.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}catch{}}}console.log()}var G=new Ca;G.name("vibeflow").description("Vibeflow \u2014 CLI tool for frontend prototyping with LLM assistance").version("0.9.1");G.addHelpText("after",`
1775
1775
  ${"\u2500".repeat(60)}
1776
1776
  For coding agents \u2014 quick reference:
1777
1777
 
@@ -1803,14 +1803,14 @@ File attachments:
1803
1803
  <file binary body>
1804
1804
  List: GET /api/tasks/<id>/files
1805
1805
  Delete: DELETE /api/tasks/<id>/files/<filename>
1806
- `);G.command("serve").description("Serve HTML prototype(s) with live overlay, or start API-only task server for existing apps").argument("[target]","HTML file or directory of HTML files").option("-p, --port <port>","Port number","3700").option("--host <host>","Bind hostname (default: localhost; use 0.0.0.0 for LAN sharing)").option("--no-open","Do not open browser automatically").action(async(t,e)=>{le("command_run",{command:"serve"}),await se(),await ut(t,{port:parseInt(e.port,10),host:e.host,open:e.open})});G.command("kanban").description("Start the Vibeflow server and open the live Kanban board in the browser").argument("[dir]","Project root directory",".").option("-p, --port <port>","Port number","3700").option("--host <host>","Bind hostname (default: localhost; use 0.0.0.0 for LAN sharing)").option("--no-open","Do not open browser automatically").action(async(t,e)=>{le("command_run",{command:"kanban"}),await se();let r=parseInt(e.port,10),d=(await ut(void 0,{port:r,host:e.host,open:!1,projectDir:F(t),noCtrlCHint:!0})).url+"/kanban";console.log(),console.log(n.green(" \u2713 Kanban board ready")),console.log(n.dim(" ")+n.cyan(d)),console.log(),console.log(n.bold("Agent prompt:")),console.log(n.dim(" Get new tasks and implement them, once done check again for new ones:")),console.log(n.dim(" ")+n.green("npx @vibeflow-tools/cli tasks --next")),console.log(),console.log(n.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then(i=>i.default(d)).catch(()=>{console.log(n.dim(" Visit: ")+n.cyan(d))}),Ta()});G.command("tasks").description("List or edit tasks in the project").argument("[dir]","Project root directory",".").option("--status <status>","Filter by status (backlog, todo, in-progress, review, done)").option("--type <type>","Filter by type (Task, Bug, Feature, Enhancement, Research)").option("--user <user>","Filter by exact task author email (case-insensitive)").option("--edit [task-id]","Edit a task by ID (LLM-friendly). Omit task-id to see usage instructions.").option("--add","Create a task (requires --title)").option("--title <title>","New title for the task (use with --edit)").option("--set-status <status>","New status: backlog | todo | in-progress | review | done (use with --edit)").option("--description <text>","New description for the task (use with --edit)").option("--json","Output machine-readable JSON").option("--commit","Commit staged changes and link the commit SHA to a task (use with --task)").option("--task <task-id>","Task ID to link with the commit (use with --commit)").option("--message <msg>","Commit message (use with --commit; task ID is appended automatically)").option("--comment <text>","Implementation report comment (required when setting status to review)").option("--commit-message <msg>","Commit message for auto-commit on review (required when auto-commit setting is ON)").option("--get <task-id>","Get full details of a single task by ID (supports partial ID prefix)").option("--next","Pick the next available todo task, move it to in-progress, and output it ready to work on").option("--tag <tag>","Filter by tag (can be specified multiple times for AND matching)",(t,e)=>[...e,t],[]).option("--report-file <path>","Path to a local .md file to upload as the research report (use with --set-status review on Research tasks; file is uploaded and deleted locally)").option("--branch <name>","Git branch name for the task (required when createBranch setting is ON and setting status to review)").option("--limit <n>","Limit how many tasks are returned in list mode (default: 5; use 0 for unlimited)").action((t,e)=>{(async()=>{let r=e.add?"add":e.next?"next":e.edit?"edit":e.get?"get":"list";if(le("command_run",{command:"tasks",subcommand:r}),e.get){if(await ie()==="saas"){let T=await V(),L=await me(T?.id);if(!L){console.log(n.red("\u2717 Unable to reach the online backend.")),process.exitCode=1;return}let E=L.tasks.find(I=>I.id===e.get||I.id.startsWith(e.get));if(!E){console.log(n.red(`\u2717 Task not found: ${e.get}`)),process.exitCode=1;return}let O=ne(E.status);if(e.json){console.log(JSON.stringify({...E,status:O},null,2));return}let bt=ue[O]??n.white;if(console.log(` ${bt(`[${O}]`)} ${n.bold(E.title)}`),console.log(n.dim(` id: ${E.id}`)),console.log(n.dim(" selector: /")),E.type&&console.log(n.dim(` type: ${E.type}`)),E.priority&&console.log(n.dim(` priority: ${E.priority}`)),console.log(n.dim(` created: ${E.createdAt}`)),E.description){console.log(n.dim(" description:"));for(let I of E.description.split(`
1806
+ `);G.command("serve").description("Serve HTML prototype(s) with live overlay, or start API-only task server for existing apps").argument("[target]","HTML file or directory of HTML files").option("-p, --port <port>","Port number","3700").option("--host <host>","Bind hostname (default: localhost; use 0.0.0.0 for LAN sharing)").option("--no-open","Do not open browser automatically").action(async(t,e)=>{le("command_run",{command:"serve"}),await se(),await ct(t,{port:parseInt(e.port,10),host:e.host,open:e.open})});G.command("kanban").description("Start the Vibeflow server and open the live Kanban board in the browser").argument("[dir]","Project root directory",".").option("-p, --port <port>","Port number","3700").option("--host <host>","Bind hostname (default: localhost; use 0.0.0.0 for LAN sharing)").option("--no-open","Do not open browser automatically").action(async(t,e)=>{le("command_run",{command:"kanban"}),await se();let r=parseInt(e.port,10),d=(await ct(void 0,{port:r,host:e.host,open:!1,projectDir:F(t),noCtrlCHint:!0})).url+"/kanban";console.log(),console.log(n.green(" \u2713 Kanban board ready")),console.log(n.dim(" ")+n.cyan(d)),console.log(),console.log(n.bold("Agent prompt:")),console.log(n.dim(" Get new tasks and implement them, once done check again for new ones:")),console.log(n.dim(" ")+n.green("npx @vibeflow-tools/cli tasks --next")),console.log(),console.log(n.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then(i=>i.default(d)).catch(()=>{console.log(n.dim(" Visit: ")+n.cyan(d))}),Ea()});G.command("tasks").description("List or edit tasks in the project").argument("[dir]","Project root directory",".").option("--status <status>","Filter by status (backlog, todo, in-progress, review, done)").option("--type <type>","Filter by type (Task, Bug, Feature, Enhancement, Research)").option("--user <user>","Filter by exact task author email (case-insensitive)").option("--edit [task-id]","Edit a task by ID (LLM-friendly). Omit task-id to see usage instructions.").option("--add","Create a task (requires --title)").option("--title <title>","New title for the task (use with --edit)").option("--set-status <status>","New status: backlog | todo | in-progress | review | done (use with --edit)").option("--description <text>","New description for the task (use with --edit)").option("--json","Output machine-readable JSON").option("--commit","Commit staged changes and link the commit SHA to a task (use with --task)").option("--task <task-id>","Task ID to link with the commit (use with --commit)").option("--message <msg>","Commit message (use with --commit; task ID is appended automatically)").option("--comment <text>","Implementation report comment (required when setting status to review)").option("--commit-message <msg>","Commit message for auto-commit on review (required when auto-commit setting is ON)").option("--get <task-id>","Get full details of a single task by ID (supports partial ID prefix)").option("--next","Pick the next available todo task, move it to in-progress, and output it ready to work on").option("--tag <tag>","Filter by tag (can be specified multiple times for AND matching)",(t,e)=>[...e,t],[]).option("--report-file <path>","Path to a local .md file to upload as the research report (use with --set-status review on Research tasks; file is uploaded and deleted locally)").option("--branch <name>","Git branch name for the task (required when createBranch setting is ON and setting status to review)").option("--limit <n>","Limit how many tasks are returned in list mode (default: 5; use 0 for unlimited)").action((t,e)=>{(async()=>{let r=e.add?"add":e.next?"next":e.edit?"edit":e.get?"get":"list";if(le("command_run",{command:"tasks",subcommand:r}),e.get){if(await ie()==="saas"){let T=await V(),M=await me(T?.id);if(!M){console.log(n.red("\u2717 Unable to reach the online backend.")),process.exitCode=1;return}let E=M.tasks.find(I=>I.id===e.get||I.id.startsWith(e.get));if(!E){console.log(n.red(`\u2717 Task not found: ${e.get}`)),process.exitCode=1;return}let O=ne(E.status);if(e.json){console.log(JSON.stringify({...E,status:O},null,2));return}let gt=ue[O]??n.white;if(console.log(` ${gt(`[${O}]`)} ${n.bold(E.title)}`),console.log(n.dim(` id: ${E.id}`)),console.log(n.dim(" selector: /")),E.type&&console.log(n.dim(` type: ${E.type}`)),E.priority&&console.log(n.dim(` priority: ${E.priority}`)),console.log(n.dim(` created: ${E.createdAt}`)),E.description){console.log(n.dim(" description:"));for(let I of E.description.split(`
1807
1807
  `))console.log(n.dim(` ${I}`))}E.annotatedElementText&&console.log(n.dim(` element text: ${E.annotatedElementText}`)),E.branchName&&console.log(n.dim(` branch: ${E.branchName}`));let re=[...E.comments??[]].sort(ce);if(re.length>0){console.log(n.dim(` comments (${re.length}):`));for(let I of re){console.log(n.dim(` [${I.author??"agent"}] ${I.createdAt}`));for(let H of I.body.split(`
1808
1808
  `))console.log(n.dim(` ${H}`))}}if(E.files&&E.files.length>0){console.log(n.dim(` linked files (${E.files.length}):`));for(let I of E.files){let H=I.url??`${process.env.VIBEFLOW_API_URL??"https://app.vibeflow.tools"}/api/tasks/${E.id}/files/${encodeURIComponent(I.name)}`;if(console.log(n.dim(` - ${I.name} ${H}`)),I.content){console.log(n.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let pe of I.content.split(`
1809
- `))console.log(n.dim(` \u2502 ${pe}`));console.log(n.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}let de=B(F(t)),Ve=(E.type??"").toLowerCase()==="research",ye=(E.type??"").toLowerCase()==="bug";he({hasResearchTasks:Ve,hasBugTasks:ye,autoCommit:de.autoCommit,autoPush:de.autoPush,autoComment:de.autoComment,createBranch:de.createBranch});return}let h=F(t),p=ge(h),x=Z(h).find(T=>T.id===e.get||T.id.startsWith(e.get));if(!x){console.log(n.red(`\u2717 Task not found: ${e.get}`)),console.log(n.dim(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}let m=ee(h,x.id).sort(ce),S=q(h,x.id).map(T=>({...T,url:`http://localhost:${p.port}${T.url}`})),v=Ke(x,m,S);if(e.json){console.log(JSON.stringify({...x,comments:m,files:S},null,2));return}let _=ue[x.status]??n.white,R=Se(x,x.filePath,m,S,h).split(`
1810
- `);if(R.length>0){let T=R[0],L=T.match(/^\[(\w+)\]\s+(.+)$/);console.log(L?` ${_(`[${L[1]}]`)} ${n.bold(L[2])}`:n.dim(T));for(let E=1;E<R.length;E++)console.log(n.dim(R[E]))}let z=B(h),N=(x.type??"").toLowerCase()==="research",P=(x.type??"").toLowerCase()==="bug";he({hasResearchTasks:N,hasBugTasks:P,autoCommit:z.autoCommit,autoPush:z.autoPush,autoComment:z.autoComment,createBranch:z.createBranch});return}if(e.next){if(await ie()==="saas"){let T=await V(),L=await me(T?.id);if(!L){console.log(n.red("\u2717 Unable to reach the online backend.")),process.exitCode=1;return}if(e.type&&!He(e.type))return;let E=L.tasks.map(I=>({...I,status:ne(I.status)})).filter(I=>I.status==="todo");if(e.type&&(E=E.filter(I=>(I.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Te(e.user,E))return;if(e.user&&(E=E.filter(I=>ve(I.author,e.user))),e.tag&&e.tag.length>0&&(E=E.filter(I=>e.tag.every(H=>(I.tags??[]).includes(H)))),E=E.sort((I,H)=>{let pe=ae(I.priority??void 0)-ae(H.priority??void 0);return pe!==0?pe:ce(I,H)}),E.length===0){let I=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),H=I.length>0?` matching ${I.join(" ")}`:"";console.log(n.dim(`No todo tasks found${H}. Nothing to work on.`));return}let O=E[0];if(!await pt(O.id,{status:"in-progress"})){console.log(n.red(`\u2717 Failed to move task to in-progress: ${O.id}`)),process.exitCode=1;return}if(e.json){console.log(JSON.stringify({...O,status:"in-progress"},null,2));return}let re=B(F(t)),de=(O.type??"").toLowerCase()==="research",Ve=(O.type??"").toLowerCase()==="bug";if(he({hasResearchTasks:de,hasBugTasks:Ve,autoCommit:re.autoCommit,autoPush:re.autoPush,autoComment:re.autoComment,createBranch:re.createBranch}),console.log(n.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log(),console.log(` ${n.blue("[in-progress]")} ${n.bold(O.title)}`),console.log(n.dim(` id: ${O.id}`)),O.type&&console.log(n.dim(` type: ${O.type}`)),O.priority&&console.log(n.dim(` priority: ${O.priority}`)),console.log(n.dim(` created: ${O.createdAt}`)),O.description){console.log(n.dim(" description:"));for(let I of O.description.split(`
1809
+ `))console.log(n.dim(` \u2502 ${pe}`));console.log(n.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}let de=B(F(t)),Ve=(E.type??"").toLowerCase()==="research",ye=(E.type??"").toLowerCase()==="bug";he({hasResearchTasks:Ve,hasBugTasks:ye,autoCommit:de.autoCommit,autoPush:de.autoPush,autoComment:de.autoComment,createBranch:de.createBranch});return}let h=F(t),p=ge(h),x=Z(h).find(T=>T.id===e.get||T.id.startsWith(e.get));if(!x){console.log(n.red(`\u2717 Task not found: ${e.get}`)),console.log(n.dim(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}let m=ee(h,x.id).sort(ce),S=q(h,x.id).map(T=>({...T,url:`http://localhost:${p.port}${T.url}`})),v=Ke(x,m,S);if(e.json){console.log(JSON.stringify({...x,comments:m,files:S},null,2));return}let _=ue[x.status]??n.white,N=Se(x,x.filePath,m,S,h).split(`
1810
+ `);if(N.length>0){let T=N[0],M=T.match(/^\[(\w+)\]\s+(.+)$/);console.log(M?` ${_(`[${M[1]}]`)} ${n.bold(M[2])}`:n.dim(T));for(let E=1;E<N.length;E++)console.log(n.dim(N[E]))}let z=B(h),P=(x.type??"").toLowerCase()==="research",R=(x.type??"").toLowerCase()==="bug";he({hasResearchTasks:P,hasBugTasks:R,autoCommit:z.autoCommit,autoPush:z.autoPush,autoComment:z.autoComment,createBranch:z.createBranch});return}if(e.next){if(await ie()==="saas"){let T=await V(),M=await me(T?.id);if(!M){console.log(n.red("\u2717 Unable to reach the online backend.")),process.exitCode=1;return}if(e.type&&!He(e.type))return;let E=M.tasks.map(I=>({...I,status:ne(I.status)})).filter(I=>I.status==="todo");if(e.type&&(E=E.filter(I=>(I.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Ee(e.user,E))return;if(e.user&&(E=E.filter(I=>ve(I.author,e.user))),e.tag&&e.tag.length>0&&(E=E.filter(I=>e.tag.every(H=>(I.tags??[]).includes(H)))),E=E.sort((I,H)=>{let pe=ae(I.priority??void 0)-ae(H.priority??void 0);return pe!==0?pe:ce(I,H)}),E.length===0){let I=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),H=I.length>0?` matching ${I.join(" ")}`:"";console.log(n.dim(`No todo tasks found${H}. Nothing to work on.`));return}let O=E[0];if(!await dt(O.id,{status:"in-progress"})){console.log(n.red(`\u2717 Failed to move task to in-progress: ${O.id}`)),process.exitCode=1;return}if(e.json){console.log(JSON.stringify({...O,status:"in-progress"},null,2));return}let re=B(F(t)),de=(O.type??"").toLowerCase()==="research",Ve=(O.type??"").toLowerCase()==="bug";if(he({hasResearchTasks:de,hasBugTasks:Ve,autoCommit:re.autoCommit,autoPush:re.autoPush,autoComment:re.autoComment,createBranch:re.createBranch}),console.log(n.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log(),console.log(` ${n.blue("[in-progress]")} ${n.bold(O.title)}`),console.log(n.dim(` id: ${O.id}`)),O.type&&console.log(n.dim(` type: ${O.type}`)),O.priority&&console.log(n.dim(` priority: ${O.priority}`)),console.log(n.dim(` created: ${O.createdAt}`)),O.description){console.log(n.dim(" description:"));for(let I of O.description.split(`
1811
1811
  `))console.log(n.dim(` ${I}`))}let ye=[...O.comments??[]].sort(ce);if(ye.length>0){console.log(n.dim(` comments (${ye.length}):`));for(let I of ye){let H=I.authorId?`user:${I.authorId.slice(0,8)}`:"agent";console.log(n.dim(` [${H}] ${I.createdAt}`));for(let pe of I.body.split(`
1812
- `))console.log(n.dim(` ${pe}`))}}console.log(),console.log(n.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done."));return}let h=F(t),p=Z(h);if(e.type&&!He(e.type))return;let g=p.filter(T=>T.status==="todo");if(e.type&&(g=g.filter(T=>(T.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Te(e.user,g))return;if(e.user&&(g=g.filter(T=>ve(T.author,e.user))),e.tag&&e.tag.length>0&&(g=g.filter(T=>e.tag.every(L=>(T.tags??[]).includes(L)))),g=g.sort((T,L)=>{let E=ae(T.priority)-ae(L.priority);return E!==0?E:new Date(T.created).getTime()-new Date(L.created).getTime()}),g.length===0){let T=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),L=T.length>0?` matching ${T.join(" ")}`:"";console.log(n.dim(`No todo tasks found${L}. Nothing to work on.`));return}let x=g[0],m=$(h,x.id,{status:"in-progress"});if(!m){console.log(n.red(`\u2717 Failed to update task: ${x.id}`)),process.exitCode=1;return}if(e.json){console.log(JSON.stringify({...m,filePath:x.filePath},null,2));return}let S=B(h),v=(m.type??"").toLowerCase()==="research",_=(m.type??"").toLowerCase()==="bug";he({hasResearchTasks:v,hasBugTasks:_,autoCommit:S.autoCommit,autoPush:S.autoPush,autoComment:S.autoComment,createBranch:S.createBranch});let C=ge(h),R=ee(h,m.id).sort(ce),z=q(h,m.id).map(T=>({...T,url:`http://localhost:${C.port}${T.url}`})),N=Se(m,x.filePath,R,z,h);console.log(n.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log();let P=N.split(`
1813
- `);if(P.length>0){let T=P[0].match(/^\[(\w+)\]\s+(.+)$/);console.log(T?` ${n.blue(`[${T[1]}]`)} ${n.bold(T[2])}`:n.dim(P[0]));for(let L=1;L<P.length;L++)console.log(n.dim(P[L]))}console.log(),console.log(n.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done."));return}if(e.add){if(!e.title?.trim()){console.log(n.red("\u2717 --title is required with --add")),console.log(n.dim(' Example: vibeflow tasks --add --title "Fix CTA spacing" --description "Button overflows on mobile"')),process.exitCode=1;return}if(await ie()==="saas"){let m=await V(),v=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",_=ht(),C=await Pn({id:_,title:e.title.trim(),description:e.description?.trim(),status:v,boardId:m?.id});if(!C){console.log(n.red("\u2717 Failed to create task in online board.")),console.log(n.yellow(" Check your connection or run 'vibeflow login'.")),process.exitCode=1;return}e.json?console.log(JSON.stringify(C,null,2)):(console.log(n.green(`\u2713 Task created: ${C.title}`)),console.log(n.dim(` id: ${C.id} | status: ${ne(C.status)}`)));return}let h=F(t);we(h);let g=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",x=fe(h,{title:e.title.trim(),description:e.description?.trim()??"",status:g,selector:"/"});e.json?console.log(JSON.stringify(x,null,2)):(console.log(n.green(`\u2713 Task created: ${x.title}`)),console.log(n.dim(` id: ${x.id} | status: ${x.status}`)));return}if(e.commit){if(!e.task){console.log(n.red("\u2717 --task <task-id> is required with --commit")),console.log(n.dim(' Example: vibeflow tasks --commit --task abc12345 --message "fix button alignment"')),process.exitCode=1;return}let b=F(t),p=Y(b).find(m=>m.id===e.task||m.id.startsWith(e.task));if(!p){console.log(n.red(`\u2717 Task not found: ${e.task}`)),console.log(n.dim(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}let g=e.message?.trim()||p.title;(p.type??"").toLowerCase()==="research"&&(console.log(n.yellow("\u26A0 WARNING: This is a Research task. Research tasks must NOT produce code changes.")),console.log(n.yellow(" Only commit research report files (.md). Do not commit code changes.")),console.log());let x=`${g} [proto:${p.id}]`;try{qe("git",["commit","-m",x],{cwd:b,stdio:"inherit"});let m=gt("git rev-parse HEAD",{cwd:b}).toString().trim(),S={sha:m,message:g,timestamp:new Date().toISOString()},v=p.commits??[];if($(b,p.id,{commits:[...v,S]}),console.log(n.green(`\u2713 Committed and linked to task: ${p.title}`)),console.log(n.dim(` commit: ${m}`)),console.log(n.dim(` proto: ${p.id}`)),B(b).autoPush){console.log(n.dim(" auto-push: pushing commit to remote..."));let C=Bn(b);C.ok?console.log(n.green("\u2713 Auto-push complete")):(console.log(n.yellow("\u26A0 Auto-push failed. Commit is local; run 'git push' manually.")),C.error&&console.log(n.dim(` reason: ${C.error}`)))}}catch{console.log(n.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=1}return}if(e.edit!==void 0){let b=typeof e.edit=="string"?e.edit:void 0,h=e.title||e.setStatus||e.description;if(!b||!h){if(e.type&&!He(e.type))return;let m=Y(t);if(e.status&&(m=m.filter(S=>S.status===e.status)),e.type&&(m=m.filter(S=>(S.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Te(e.user,m))return;if(e.user&&(m=m.filter(S=>ve(S.author,e.user))),e.tag&&e.tag.length>0&&(m=m.filter(S=>e.tag.every(v=>(S.tags??[]).includes(v)))),console.log(n.bold("vibeflow tasks --edit \u2014 LLM Usage Instructions")),console.log(),console.log("Edit a task:"),console.log(n.cyan(' vibeflow tasks [dir] --edit <task-id> [--title "new title"] [--set-status backlog|todo|in-progress|review|done] [--description "new description"]')),console.log(),console.log("Examples:"),console.log(n.dim(" vibeflow tasks --edit abc12345 --set-status done")),console.log(n.dim(" vibeflow tasks --edit abc12345 --set-status in-progress")),console.log(n.dim(' vibeflow tasks --edit abc12345 --title "Updated title" --description "More detail"')),console.log(),m.length===0)console.log(n.dim("No tasks found."));else{console.log("Available tasks:");for(let S of m){let v=ue[S.status]??n.white;console.log(` ${v(`[${S.status}]`)} ${n.bold(S.id)} \u2014 ${S.title}`)}}return}if(e.setStatus==="done"&&(console.log(n.yellow('\u26A0 WARNING: Agents should NEVER set a task status to "done".')),console.log(n.yellow(" Only humans should mark tasks as done after reviewing.")),console.log(n.dim(" If you are an agent, use --set-status review instead.")),console.log()),e.setStatus&&!We.includes(e.setStatus)){console.log(n.red(`\u2717 Invalid status: "${e.setStatus}"`)),console.log(n.yellow(` Valid statuses: ${We.join(" | ")}`)),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status in-progress`)),process.exitCode=1;return}if(e.setStatus==="review"&&!e.comment?.trim()){console.log(n.red("\u2717 --comment is required when setting status to review")),console.log(n.dim(" Provide a concise implementation report explaining:")),console.log(n.dim(" \xB7 what was changed and why")),console.log(n.dim(" \xB7 key decisions and trade-offs")),console.log(n.dim(" \xB7 anything future agents should know")),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status review --comment "Implemented X by doing Y. Key decision: Z."`)),process.exitCode=1;return}let p=await ie();if(e.setStatus==="review"){let m=F(t),S=B(m);if(S.autoComment&&!e.comment?.trim()){console.log(n.red("\u2717 --comment is required (auto-comment setting is ON)")),console.log(n.dim(" Provide: what changed, why, key decisions, anything future agents should know.")),console.log(n.dim(" Plain text for short notes; Markdown for multi-section reports.")),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status review --comment "Implemented X by doing Y."`)),process.exitCode=1;return}if(S.autoCommit&&!e.commitMessage?.trim()){console.log(n.red("\u2717 --commit-message is required (auto-commit setting is ON)")),console.log(n.dim(" Stage your changes first, then provide a one-line commit summary.")),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status review --commit-message "fix: add hover effect" --comment "..."`)),process.exitCode=1;return}if(S.createBranch&&!e.branch?.trim()){console.log(n.red("\u2717 --branch is required (create-branch setting is ON)")),console.log(n.dim(" Provide the git branch name created for this task.")),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status review --branch feat/add-hover-effect --comment "..."`)),process.exitCode=1;return}}if(p==="saas"){let m={};if(e.setStatus&&(m.status=e.setStatus),e.title&&(m.title=e.title),e.description&&(m.description=e.description),e.branch&&(m.branchName=e.branch),e.setStatus==="in-progress"){let v=await En(b);if(v&&ne(v.status)==="in-progress"){let _=v.author??"another user";console.log(n.yellow(`\u26A0 Task is already in-progress (last updated by: ${_})`)),console.log(n.yellow(" Another agent or user may be working on this task.")),console.log(n.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}let S=await pt(b,m);if(!S){console.log(n.red(`\u2717 Failed to update task: ${b}`)),console.log(n.yellow(" Ensure you are connected and the task ID exists in the online board.")),process.exitCode=1;return}S.warning&&console.log(n.yellow(`\u26A0 Server warning: ${S.warning}`)),e.setStatus==="review"&&e.comment?.trim()&&await In(b,e.comment.trim())&&console.log(n.dim(" comment: added")),console.log(n.green(`\u2713 Task updated: ${S.task.title}`)),console.log(n.dim(` id: ${S.task.id} | status: ${ne(S.task.status)}`));return}let g={};if(e.title&&(g.title=e.title),e.setStatus&&(g.status=e.setStatus),e.description&&(g.description=e.description),e.branch&&(g.branchName=e.branch),e.setStatus==="in-progress"){let m=F(t),v=Y(m).find(_=>_.id===b||_.id.startsWith(b));if(v&&((v.type??"").toLowerCase()==="research"&&(console.log(n.yellow("\u26A0 WARNING: This is a Research task. Policy: do NOT implement code.")),console.log(n.yellow(" Research only \u2014 attach a .md report file, leave a summary comment, mark as review.")),console.log()),v.status==="in-progress")){let _=v.updated?new Date(v.updated).toLocaleString():"unknown",C=v.author??"another user";console.log(n.yellow(`\u26A0 Task is already in-progress (author: ${C}, last updated: ${_})`)),console.log(n.yellow(" Another agent or user may be working on this task.")),console.log(n.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}if(e.setStatus==="review"){let m=F(t),v=Y(m).find(_=>_.id===b||_.id.startsWith(b));if(v&&(v.type??"").toLowerCase()==="research"){if(e.reportFile){let _=F(e.reportFile);if(!qn(_)){console.log(n.red(`\u2717 Report file not found: ${_}`)),process.exitCode=1;return}if(!/\.md$/i.test(_)){console.log(n.red("\u2717 Report file must be a Markdown (.md) file")),process.exitCode=1;return}let C=Hn(_),{saveFile:R}=await import("./files-EMHJKBV3.js");R(m,v.id,$n(_),C),Ca(_),console.log(n.green(`\u2713 Report uploaded: ${$n(_)} (local file removed)`))}else if(!q(m,v.id).some(R=>/\.md$/i.test(R.name))){console.log(n.red("\u2717 Cannot mark Research task as review: no .md report file attached.")),console.log(n.dim(" Provide a research report:")),console.log(n.dim(` vibeflow tasks --edit ${b} --set-status review --report-file ./my-research.md --comment "..."`)),process.exitCode=1;return}}}let x=$(t,b,g);if(!x){console.log(n.red(`\u2717 Task not found: ${b}`)),console.log(n.yellow(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}if(e.setStatus==="review"&&e.comment?.trim()&&(oe(F(t),b,"agent",e.comment.trim()),console.log(n.dim(" comment: added"))),console.log(n.green(`\u2713 Task updated: ${x.title}`)),console.log(n.dim(` id: ${x.id} | status: ${x.status}`)),e.setStatus==="review"){let m=F(t),S=B(m);if(S.autoCommit&&e.commitMessage?.trim()){let _=Y(m).find(C=>C.id===b||C.id.startsWith(b));if(_){let C=`${e.commitMessage.trim()} [proto:${_.id}]`;try{qe("git",["commit","-m",C],{cwd:m,stdio:"inherit"});let R=gt("git rev-parse HEAD",{cwd:m}).toString().trim(),z={sha:R,message:e.commitMessage.trim(),timestamp:new Date().toISOString()},N=_.commits??[];if($(m,_.id,{commits:[...N,z]}),console.log(n.green(`\u2713 Committed: ${C}`)),console.log(n.dim(` sha: ${R}`)),S.autoPush){console.log(n.dim(" pushing..."));let P=Bn(m);P.ok?console.log(n.green("\u2713 Pushed")):(console.log(n.yellow("\u26A0 Push failed. Run 'git push' manually.")),P.error&&console.log(n.dim(` reason: ${P.error}`)))}}catch{console.log(n.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=1}}}}return}if(e.status&&!We.includes(e.status)){console.log(n.red(`\u2717 Invalid status filter: "${e.status}"`)),console.log(n.yellow(` Valid statuses: ${We.join(" | ")}`)),console.log(n.dim(" Example: vibeflow tasks --status todo")),process.exitCode=1;return}if(e.type&&!He(e.type))return;if(await ie()==="saas"){let b=await V(),h=await me(b?.id);if(!h){console.log(n.red("\u2717 Unable to reach the online backend.")),console.log(n.yellow(" Check your connection or run 'vibeflow login' if your session expired.")),process.exitCode=1;return}let p=h.tasks.map(v=>({...v,status:ne(v.status)}));if(e.status&&(p=p.filter(v=>v.status===e.status)),e.type&&(p=p.filter(v=>(v.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Te(e.user,p))return;e.user&&(p=p.filter(v=>ve(v.author,e.user))),e.tag&&e.tag.length>0&&(p=p.filter(v=>e.tag.every(_=>(v.tags??[]).includes(_))));let g=e.limit!==void 0?parseInt(e.limit,10):5;if(!isNaN(g)&&g>0&&(p=p.slice(0,g)),e.json){console.log(JSON.stringify(p,null,2));return}let x=p.some(v=>(v.type??"").toLowerCase()==="research"),m=p.some(v=>(v.type??"").toLowerCase()==="bug"),S=B(F(t));if(he({hasResearchTasks:x,hasBugTasks:m,autoCommit:S.autoCommit,autoPush:S.autoPush,autoComment:S.autoComment,createBranch:S.createBranch}),p.length===0)console.log(n.dim("No tasks found."));else{p=p.sort((_,C)=>{let R=Ue(_.status)-Ue(C.status);if(R!==0)return R;let z=ae(_.priority??void 0)-ae(C.priority??void 0);return z!==0?z:new Date(C.updatedAt).getTime()-new Date(_.updatedAt).getTime()});for(let[_,C]of p.entries()){let R=ue[C.status]??n.white,z=Ia(C.type);if(console.log(` ${n.dim(`${_+1}.`)} ${R(`[${C.status}]`)} ${C.title}`),console.log(n.dim(` id: ${C.id}`)),console.log(n.dim(" selector: /")),z&&console.log(n.dim(` type: ${z}`)),C.priority&&console.log(n.dim(` priority: ${C.priority}`)),console.log(n.dim(` created: ${C.createdAt}`)),C.description){console.log(n.dim(" description:"));for(let N of C.description.split(`
1814
- `))console.log(n.dim(` ${N}`))}if(C.comments&&C.comments.length>0){let N=[...C.comments].sort(ce);console.log(n.dim(` comments (${N.length}):`));for(let P of N){let T=P.authorId?`user:${P.authorId.slice(0,8)}`:"agent";console.log(n.dim(` [${T}] ${P.createdAt}`));for(let L of P.body.split(`
1815
- `))console.log(n.dim(` ${L}`))}}if(C.files&&C.files.length>0){console.log(n.dim(` linked files (${C.files.length}):`));for(let N of C.files){let P=N.url??`${process.env.VIBEFLOW_API_URL??"https://app.vibeflow.tools"}/api/tasks/${C.id}/files/${encodeURIComponent(N.name)}`;if(console.log(n.dim(` - ${N.name} ${P}`)),N.content){console.log(n.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let T of N.content.split(`
1816
- `))console.log(n.dim(` \u2502 ${T}`));console.log(n.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}console.log()}let v=h.tasks.map(_=>({..._,status:ne(_.status)}));console.log(n.dim(Dn(v)))}return}let d=Z(t);if(e.user&&!Te(e.user,d))return;let i=e.status?d.filter(b=>b.status===e.status):d;e.type&&(i=i.filter(b=>(b.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&(i=i.filter(b=>ve(b.author,e.user))),e.tag&&e.tag.length>0&&(i=i.filter(b=>e.tag.every(h=>(b.tags??[]).includes(h))));let o=e.limit!==void 0?parseInt(e.limit,10):5;if(e.json){console.log(JSON.stringify(i,null,2));return}i=i.sort((b,h)=>{let p=Ue(b.status)-Ue(h.status);if(p!==0)return p;let g=ae(b.priority)-ae(h.priority);if(g!==0)return g;let x=new Date(b.updated??b.created).getTime(),m=new Date(h.updated??h.created).getTime();return x!==m?m-x:b.id.localeCompare(h.id)});let l=i.length;if(!isNaN(o)&&o>0&&(i=i.slice(0,o)),i.length===0){console.log(n.dim("No tasks found."));return}let a=F(t),s=i.some(b=>(b.type??"").toLowerCase()==="research"),u=i.some(b=>(b.type??"").toLowerCase()==="bug"),f=B(a);he({hasResearchTasks:s,hasBugTasks:u,autoCommit:f.autoCommit,autoPush:f.autoPush,autoComment:f.autoComment,createBranch:f.createBranch});let k=ge(a);for(let[b,h]of i.entries()){let p=ee(a,h.id).sort(ce),g=q(a,h.id).map(m=>({...m,url:`http://localhost:${k.port}${m.url}`})),x=Ke(h,p,g);Ra(h,x,b,k.port,a)}let y=!isNaN(o)&&o>0&&l>o?n.yellow(` (showing ${o} of ${l} matching \u2014 use --limit 0 for all)`):"";console.log(n.dim(Dn(d))+y),await se()})()});G.command("login",{hidden:!0}).description("Authenticate CLI against the Vibeflow SaaS backend (device flow)").action(async()=>{le("command_run",{command:"login"}),await se(),await $e()});G.command("logout",{hidden:!0}).description("Remove stored auth token and switch to local mode").action(async()=>{le("command_run",{command:"logout"}),await se(),await _n()});G.command("status",{hidden:!0}).description("Show login status, connection info, and task statistics").action(async()=>{if(await ie()==="local"){console.log(n.yellow("\u25CF Not logged in")+n.dim(" (local mode)")),console.log(n.dim(" Run ")+n.cyan("vibeflow login")+n.dim(" to connect to the Vibeflow cloud.")),console.log();let i=F("."),o=Z(i);if(o.length>0){let l=o.reduce((a,s)=>(a[s.status]=(a[s.status]??0)+1,a),{});console.log(n.bold(" Local task statistics:"));for(let[a,s]of Object.entries(l)){let u=ue[a]??n.white;console.log(` ${u(a.padEnd(12))} ${s}`)}console.log(n.dim(` ${"total".padEnd(12)} ${o.length}`))}else console.log(n.dim(" No local tasks found."));return}let e=await V();console.log(n.green("\u25CF Online")+n.dim(" (SaaS mode)")),e&&(console.log(n.dim(` Board: ${e.icon?e.icon+" ":""}${e.name}`)),e.email&&console.log(n.dim(` Email: ${e.email}`)),console.log(n.dim(" URL: ")+n.cyan(e.url))),console.log();let r=await me(e?.id);if(!r){console.log(n.yellow(" \u26A0 Could not reach SaaS backend. Check your connection."));return}let c=r.tasks.map(i=>({...i,status:ne(i.status)}));if(c.length===0){console.log(n.dim(" No tasks found."));return}let d=c.reduce((i,o)=>(i[o.status]=(i[o.status]??0)+1,i),{});console.log(n.bold(" Task statistics:"));for(let[i,o]of Object.entries(d)){let l=ue[i]??n.white;console.log(` ${l(i.padEnd(12))} ${o}`)}console.log(n.dim(` ${"total".padEnd(12)} ${c.length}`))});G.command("push",{hidden:!0}).description("Push all local tasks to the Vibeflow SaaS app and delete them locally").argument("[dir]","Project root directory",".").option("--workspace <id>","Target workspace ID (defaults to your first workspace)").option("--keep-local-files","Keep local task files after pushing (do not delete them)").action(async(t,e)=>{le("command_run",{command:"push"}),await Tn(t,e),await se()});G.command("telemetry").description("Manage CLI usage telemetry (opt-out at any time)").option("--enable","Enable usage telemetry (default)").option("--disable","Disable usage telemetry").option("--status","Show current telemetry status").action(async t=>{if(t.disable){ft(!1),console.log(n.yellow("Telemetry disabled. No usage data will be collected.")),console.log(n.dim("Run `vibeflow telemetry --enable` to re-enable at any time."));return}if(t.enable){ft(!0),console.log(n.green("Telemetry enabled. Thank you for helping improve Vibeflow!"));return}let{enabled:e,anonymousId:r}=An(),c=process.env.VIBEFLOW_TELEMETRY==="0";console.log(n.bold("Telemetry status:")),console.log(` Enabled: ${e?n.green("yes"):n.yellow("no")}`),c&&console.log(n.dim(" (disabled via VIBEFLOW_TELEMETRY=0 environment variable)")),r&&console.log(n.dim(` Anonymous ID: ${r}`)),console.log(),console.log(n.dim(" vibeflow telemetry --disable Opt out of usage tracking")),console.log(n.dim(" vibeflow telemetry --enable Opt back in")),console.log(n.dim(" No PII is ever collected. User identity is hashed."))});G.parse();
1812
+ `))console.log(n.dim(` ${pe}`))}}console.log(),console.log(n.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done."));return}let h=F(t),p=Z(h);if(e.type&&!He(e.type))return;let g=p.filter(T=>T.status==="todo");if(e.type&&(g=g.filter(T=>(T.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Ee(e.user,g))return;if(e.user&&(g=g.filter(T=>ve(T.author,e.user))),e.tag&&e.tag.length>0&&(g=g.filter(T=>e.tag.every(M=>(T.tags??[]).includes(M)))),g=g.sort((T,M)=>{let E=ae(T.priority)-ae(M.priority);return E!==0?E:new Date(T.created).getTime()-new Date(M.created).getTime()}),g.length===0){let T=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),M=T.length>0?` matching ${T.join(" ")}`:"";console.log(n.dim(`No todo tasks found${M}. Nothing to work on.`));return}let x=g[0],m=$(h,x.id,{status:"in-progress"});if(!m){console.log(n.red(`\u2717 Failed to update task: ${x.id}`)),process.exitCode=1;return}if(e.json){console.log(JSON.stringify({...m,filePath:x.filePath},null,2));return}let S=B(h),v=(m.type??"").toLowerCase()==="research",_=(m.type??"").toLowerCase()==="bug";he({hasResearchTasks:v,hasBugTasks:_,autoCommit:S.autoCommit,autoPush:S.autoPush,autoComment:S.autoComment,createBranch:S.createBranch});let C=ge(h),N=ee(h,m.id).sort(ce),z=q(h,m.id).map(T=>({...T,url:`http://localhost:${C.port}${T.url}`})),P=Se(m,x.filePath,N,z,h);console.log(n.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log();let R=P.split(`
1813
+ `);if(R.length>0){let T=R[0].match(/^\[(\w+)\]\s+(.+)$/);console.log(T?` ${n.blue(`[${T[1]}]`)} ${n.bold(T[2])}`:n.dim(R[0]));for(let M=1;M<R.length;M++)console.log(n.dim(R[M]))}console.log(),console.log(n.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done."));return}if(e.add){if(!e.title?.trim()){console.log(n.red("\u2717 --title is required with --add")),console.log(n.dim(' Example: vibeflow tasks --add --title "Fix CTA spacing" --description "Button overflows on mobile"')),process.exitCode=1;return}if(await ie()==="saas"){let m=await V(),v=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",_=mt(),C=await Pn({id:_,title:e.title.trim(),description:e.description?.trim(),status:v,boardId:m?.id});if(!C){console.log(n.red("\u2717 Failed to create task in online board.")),console.log(n.yellow(" Check your connection or run 'vibeflow login'.")),process.exitCode=1;return}e.json?console.log(JSON.stringify(C,null,2)):(console.log(n.green(`\u2713 Task created: ${C.title}`)),console.log(n.dim(` id: ${C.id} | status: ${ne(C.status)}`)));return}let h=F(t);we(h);let g=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",x=fe(h,{title:e.title.trim(),description:e.description?.trim()??"",status:g,selector:"/"});e.json?console.log(JSON.stringify(x,null,2)):(console.log(n.green(`\u2713 Task created: ${x.title}`)),console.log(n.dim(` id: ${x.id} | status: ${x.status}`)));return}if(e.commit){if(!e.task){console.log(n.red("\u2717 --task <task-id> is required with --commit")),console.log(n.dim(' Example: vibeflow tasks --commit --task abc12345 --message "fix button alignment"')),process.exitCode=1;return}let b=F(t),p=Y(b).find(m=>m.id===e.task||m.id.startsWith(e.task));if(!p){console.log(n.red(`\u2717 Task not found: ${e.task}`)),console.log(n.dim(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}let g=e.message?.trim()||p.title;(p.type??"").toLowerCase()==="research"&&(console.log(n.yellow("\u26A0 WARNING: This is a Research task. Research tasks must NOT produce code changes.")),console.log(n.yellow(" Only commit research report files (.md). Do not commit code changes.")),console.log());let x=`${g} [proto:${p.id}]`;try{qe("git",["commit","-m",x],{cwd:b,stdio:"inherit"});let m=ft("git rev-parse HEAD",{cwd:b}).toString().trim(),S={sha:m,message:g,timestamp:new Date().toISOString()},v=p.commits??[];if($(b,p.id,{commits:[...v,S]}),console.log(n.green(`\u2713 Committed and linked to task: ${p.title}`)),console.log(n.dim(` commit: ${m}`)),console.log(n.dim(` proto: ${p.id}`)),B(b).autoPush){console.log(n.dim(" auto-push: pushing commit to remote..."));let C=Bn(b);C.ok?console.log(n.green("\u2713 Auto-push complete")):(console.log(n.yellow("\u26A0 Auto-push failed. Commit is local; run 'git push' manually.")),C.error&&console.log(n.dim(` reason: ${C.error}`)))}}catch{console.log(n.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=1}return}if(e.edit!==void 0){let b=typeof e.edit=="string"?e.edit:void 0,h=e.title||e.setStatus||e.description;if(!b||!h){if(e.type&&!He(e.type))return;let m=Y(t);if(e.status&&(m=m.filter(S=>S.status===e.status)),e.type&&(m=m.filter(S=>(S.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Ee(e.user,m))return;if(e.user&&(m=m.filter(S=>ve(S.author,e.user))),e.tag&&e.tag.length>0&&(m=m.filter(S=>e.tag.every(v=>(S.tags??[]).includes(v)))),console.log(n.bold("vibeflow tasks --edit \u2014 LLM Usage Instructions")),console.log(),console.log("Edit a task:"),console.log(n.cyan(' vibeflow tasks [dir] --edit <task-id> [--title "new title"] [--set-status backlog|todo|in-progress|review|done] [--description "new description"]')),console.log(),console.log("Examples:"),console.log(n.dim(" vibeflow tasks --edit abc12345 --set-status done")),console.log(n.dim(" vibeflow tasks --edit abc12345 --set-status in-progress")),console.log(n.dim(' vibeflow tasks --edit abc12345 --title "Updated title" --description "More detail"')),console.log(),m.length===0)console.log(n.dim("No tasks found."));else{console.log("Available tasks:");for(let S of m){let v=ue[S.status]??n.white;console.log(` ${v(`[${S.status}]`)} ${n.bold(S.id)} \u2014 ${S.title}`)}}return}if(e.setStatus==="done"&&(console.log(n.yellow('\u26A0 WARNING: Agents should NEVER set a task status to "done".')),console.log(n.yellow(" Only humans should mark tasks as done after reviewing.")),console.log(n.dim(" If you are an agent, use --set-status review instead.")),console.log()),e.setStatus&&!We.includes(e.setStatus)){console.log(n.red(`\u2717 Invalid status: "${e.setStatus}"`)),console.log(n.yellow(` Valid statuses: ${We.join(" | ")}`)),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status in-progress`)),process.exitCode=1;return}if(e.setStatus==="review"&&!e.comment?.trim()){console.log(n.red("\u2717 --comment is required when setting status to review")),console.log(n.dim(" Provide a concise implementation report explaining:")),console.log(n.dim(" \xB7 what was changed and why")),console.log(n.dim(" \xB7 key decisions and trade-offs")),console.log(n.dim(" \xB7 anything future agents should know")),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status review --comment "Implemented X by doing Y. Key decision: Z."`)),process.exitCode=1;return}let p=await ie();if(e.setStatus==="review"){let m=F(t),S=B(m);if(S.autoComment&&!e.comment?.trim()){console.log(n.red("\u2717 --comment is required (auto-comment setting is ON)")),console.log(n.dim(" Provide: what changed, why, key decisions, anything future agents should know.")),console.log(n.dim(" Plain text for short notes; Markdown for multi-section reports.")),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status review --comment "Implemented X by doing Y."`)),process.exitCode=1;return}if(S.autoCommit&&!e.commitMessage?.trim()){console.log(n.red("\u2717 --commit-message is required (auto-commit setting is ON)")),console.log(n.dim(" Stage your changes first, then provide a one-line commit summary.")),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status review --commit-message "fix: add hover effect" --comment "..."`)),process.exitCode=1;return}if(S.createBranch&&!e.branch?.trim()){console.log(n.red("\u2717 --branch is required (create-branch setting is ON)")),console.log(n.dim(" Provide the git branch name created for this task.")),console.log(n.dim(` Example: vibeflow tasks --edit ${b} --set-status review --branch feat/add-hover-effect --comment "..."`)),process.exitCode=1;return}}if(p==="saas"){let m={};if(e.setStatus&&(m.status=e.setStatus),e.title&&(m.title=e.title),e.description&&(m.description=e.description),e.branch&&(m.branchName=e.branch),e.setStatus==="in-progress"){let v=await En(b);if(v&&ne(v.status)==="in-progress"){let _=v.author??"another user";console.log(n.yellow(`\u26A0 Task is already in-progress (last updated by: ${_})`)),console.log(n.yellow(" Another agent or user may be working on this task.")),console.log(n.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}let S=await dt(b,m);if(!S){console.log(n.red(`\u2717 Failed to update task: ${b}`)),console.log(n.yellow(" Ensure you are connected and the task ID exists in the online board.")),process.exitCode=1;return}S.warning&&console.log(n.yellow(`\u26A0 Server warning: ${S.warning}`)),e.setStatus==="review"&&e.comment?.trim()&&await In(b,e.comment.trim())&&console.log(n.dim(" comment: added")),console.log(n.green(`\u2713 Task updated: ${S.task.title}`)),console.log(n.dim(` id: ${S.task.id} | status: ${ne(S.task.status)}`));return}let g={};if(e.title&&(g.title=e.title),e.setStatus&&(g.status=e.setStatus),e.description&&(g.description=e.description),e.branch&&(g.branchName=e.branch),e.setStatus==="in-progress"){let m=F(t),v=Y(m).find(_=>_.id===b||_.id.startsWith(b));if(v&&((v.type??"").toLowerCase()==="research"&&(console.log(n.yellow("\u26A0 WARNING: This is a Research task. Policy: do NOT implement code.")),console.log(n.yellow(" Research only \u2014 attach a .md report file, leave a summary comment, mark as review.")),console.log()),v.status==="in-progress")){let _=v.updated?new Date(v.updated).toLocaleString():"unknown",C=v.author??"another user";console.log(n.yellow(`\u26A0 Task is already in-progress (author: ${C}, last updated: ${_})`)),console.log(n.yellow(" Another agent or user may be working on this task.")),console.log(n.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}if(e.setStatus==="review"){let m=F(t),v=Y(m).find(_=>_.id===b||_.id.startsWith(b));if(v&&(v.type??"").toLowerCase()==="research"){if(e.reportFile){let _=F(e.reportFile);if(!qn(_)){console.log(n.red(`\u2717 Report file not found: ${_}`)),process.exitCode=1;return}if(!/\.md$/i.test(_)){console.log(n.red("\u2717 Report file must be a Markdown (.md) file")),process.exitCode=1;return}let C=Hn(_),{saveFile:N}=await import("./files-EMHJKBV3.js");N(m,v.id,$n(_),C),_a(_),console.log(n.green(`\u2713 Report uploaded: ${$n(_)} (local file removed)`))}else if(!q(m,v.id).some(N=>/\.md$/i.test(N.name))){console.log(n.red("\u2717 Cannot mark Research task as review: no .md report file attached.")),console.log(n.dim(" Provide a research report:")),console.log(n.dim(` vibeflow tasks --edit ${b} --set-status review --report-file ./my-research.md --comment "..."`)),process.exitCode=1;return}}}let x=$(t,b,g);if(!x){console.log(n.red(`\u2717 Task not found: ${b}`)),console.log(n.yellow(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=1;return}if(e.setStatus==="review"&&e.comment?.trim()&&(oe(F(t),b,"agent",e.comment.trim()),console.log(n.dim(" comment: added"))),console.log(n.green(`\u2713 Task updated: ${x.title}`)),console.log(n.dim(` id: ${x.id} | status: ${x.status}`)),e.setStatus==="review"){let m=F(t),S=B(m);if(S.autoCommit&&e.commitMessage?.trim()){let _=Y(m).find(C=>C.id===b||C.id.startsWith(b));if(_){let C=`${e.commitMessage.trim()} [proto:${_.id}]`;try{qe("git",["commit","-m",C],{cwd:m,stdio:"inherit"});let N=ft("git rev-parse HEAD",{cwd:m}).toString().trim(),z={sha:N,message:e.commitMessage.trim(),timestamp:new Date().toISOString()},P=_.commits??[];if($(m,_.id,{commits:[...P,z]}),console.log(n.green(`\u2713 Committed: ${C}`)),console.log(n.dim(` sha: ${N}`)),S.autoPush){console.log(n.dim(" pushing..."));let R=Bn(m);R.ok?console.log(n.green("\u2713 Pushed")):(console.log(n.yellow("\u26A0 Push failed. Run 'git push' manually.")),R.error&&console.log(n.dim(` reason: ${R.error}`)))}}catch{console.log(n.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=1}}}}return}if(e.status&&!We.includes(e.status)){console.log(n.red(`\u2717 Invalid status filter: "${e.status}"`)),console.log(n.yellow(` Valid statuses: ${We.join(" | ")}`)),console.log(n.dim(" Example: vibeflow tasks --status todo")),process.exitCode=1;return}if(e.type&&!He(e.type))return;if(await ie()==="saas"){let b=await V(),h=await me(b?.id);if(!h){console.log(n.red("\u2717 Unable to reach the online backend.")),console.log(n.yellow(" Check your connection or run 'vibeflow login' if your session expired.")),process.exitCode=1;return}let p=h.tasks.map(v=>({...v,status:ne(v.status)}));if(e.status&&(p=p.filter(v=>v.status===e.status)),e.type&&(p=p.filter(v=>(v.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Ee(e.user,p))return;e.user&&(p=p.filter(v=>ve(v.author,e.user))),e.tag&&e.tag.length>0&&(p=p.filter(v=>e.tag.every(_=>(v.tags??[]).includes(_))));let g=e.limit!==void 0?parseInt(e.limit,10):5;if(!isNaN(g)&&g>0&&(p=p.slice(0,g)),e.json){console.log(JSON.stringify(p,null,2));return}let x=p.some(v=>(v.type??"").toLowerCase()==="research"),m=p.some(v=>(v.type??"").toLowerCase()==="bug"),S=B(F(t));if(he({hasResearchTasks:x,hasBugTasks:m,autoCommit:S.autoCommit,autoPush:S.autoPush,autoComment:S.autoComment,createBranch:S.createBranch}),p.length===0)console.log(n.dim("No tasks found."));else{p=p.sort((_,C)=>{let N=Ue(_.status)-Ue(C.status);if(N!==0)return N;let z=ae(_.priority??void 0)-ae(C.priority??void 0);return z!==0?z:new Date(C.updatedAt).getTime()-new Date(_.updatedAt).getTime()});for(let[_,C]of p.entries()){let N=ue[C.status]??n.white,z=Pa(C.type);if(console.log(` ${n.dim(`${_+1}.`)} ${N(`[${C.status}]`)} ${C.title}`),console.log(n.dim(` id: ${C.id}`)),console.log(n.dim(" selector: /")),z&&console.log(n.dim(` type: ${z}`)),C.priority&&console.log(n.dim(` priority: ${C.priority}`)),console.log(n.dim(` created: ${C.createdAt}`)),C.description){console.log(n.dim(" description:"));for(let P of C.description.split(`
1814
+ `))console.log(n.dim(` ${P}`))}if(C.comments&&C.comments.length>0){let P=[...C.comments].sort(ce);console.log(n.dim(` comments (${P.length}):`));for(let R of P){let T=R.authorId?`user:${R.authorId.slice(0,8)}`:"agent";console.log(n.dim(` [${T}] ${R.createdAt}`));for(let M of R.body.split(`
1815
+ `))console.log(n.dim(` ${M}`))}}if(C.files&&C.files.length>0){console.log(n.dim(` linked files (${C.files.length}):`));for(let P of C.files){let R=P.url??`${process.env.VIBEFLOW_API_URL??"https://app.vibeflow.tools"}/api/tasks/${C.id}/files/${encodeURIComponent(P.name)}`;if(console.log(n.dim(` - ${P.name} ${R}`)),P.content){console.log(n.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let T of P.content.split(`
1816
+ `))console.log(n.dim(` \u2502 ${T}`));console.log(n.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}console.log()}let v=h.tasks.map(_=>({..._,status:ne(_.status)}));console.log(n.dim(Dn(v)))}return}let d=Z(t);if(e.user&&!Ee(e.user,d))return;let i=e.status?d.filter(b=>b.status===e.status):d;e.type&&(i=i.filter(b=>(b.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&(i=i.filter(b=>ve(b.author,e.user))),e.tag&&e.tag.length>0&&(i=i.filter(b=>e.tag.every(h=>(b.tags??[]).includes(h))));let o=e.limit!==void 0?parseInt(e.limit,10):5;if(e.json){console.log(JSON.stringify(i,null,2));return}i=i.sort((b,h)=>{let p=Ue(b.status)-Ue(h.status);if(p!==0)return p;let g=ae(b.priority)-ae(h.priority);if(g!==0)return g;let x=new Date(b.updated??b.created).getTime(),m=new Date(h.updated??h.created).getTime();return x!==m?m-x:b.id.localeCompare(h.id)});let l=i.length;if(!isNaN(o)&&o>0&&(i=i.slice(0,o)),i.length===0){console.log(n.dim("No tasks found."));return}let a=F(t),s=i.some(b=>(b.type??"").toLowerCase()==="research"),u=i.some(b=>(b.type??"").toLowerCase()==="bug"),f=B(a);he({hasResearchTasks:s,hasBugTasks:u,autoCommit:f.autoCommit,autoPush:f.autoPush,autoComment:f.autoComment,createBranch:f.createBranch});let k=ge(a);for(let[b,h]of i.entries()){let p=ee(a,h.id).sort(ce),g=q(a,h.id).map(m=>({...m,url:`http://localhost:${k.port}${m.url}`})),x=Ke(h,p,g);Na(h,x,b,k.port,a)}let y=!isNaN(o)&&o>0&&l>o?n.yellow(` (showing ${o} of ${l} matching \u2014 use --limit 0 for all)`):"";console.log(n.dim(Dn(d))+y),await se()})()});G.command("login",{hidden:!0}).description("Authenticate CLI against the Vibeflow SaaS backend (device flow)").action(async()=>{le("command_run",{command:"login"}),await se(),await $e()});G.command("logout",{hidden:!0}).description("Remove stored auth token and switch to local mode").action(async()=>{le("command_run",{command:"logout"}),await se(),await _n()});G.command("status",{hidden:!0}).description("Show login status, connection info, and task statistics").action(async()=>{if(await ie()==="local"){console.log(n.yellow("\u25CF Not logged in")+n.dim(" (local mode)")),console.log(n.dim(" Run ")+n.cyan("vibeflow login")+n.dim(" to connect to the Vibeflow cloud.")),console.log();let i=F("."),o=Z(i);if(o.length>0){let l=o.reduce((a,s)=>(a[s.status]=(a[s.status]??0)+1,a),{});console.log(n.bold(" Local task statistics:"));for(let[a,s]of Object.entries(l)){let u=ue[a]??n.white;console.log(` ${u(a.padEnd(12))} ${s}`)}console.log(n.dim(` ${"total".padEnd(12)} ${o.length}`))}else console.log(n.dim(" No local tasks found."));return}let e=await V();console.log(n.green("\u25CF Online")+n.dim(" (SaaS mode)")),e&&(console.log(n.dim(` Board: ${e.icon?e.icon+" ":""}${e.name}`)),e.email&&console.log(n.dim(` Email: ${e.email}`)),console.log(n.dim(" URL: ")+n.cyan(e.url))),console.log();let r=await me(e?.id);if(!r){console.log(n.yellow(" \u26A0 Could not reach SaaS backend. Check your connection."));return}let c=r.tasks.map(i=>({...i,status:ne(i.status)}));if(c.length===0){console.log(n.dim(" No tasks found."));return}let d=c.reduce((i,o)=>(i[o.status]=(i[o.status]??0)+1,i),{});console.log(n.bold(" Task statistics:"));for(let[i,o]of Object.entries(d)){let l=ue[i]??n.white;console.log(` ${l(i.padEnd(12))} ${o}`)}console.log(n.dim(` ${"total".padEnd(12)} ${c.length}`))});G.command("push",{hidden:!0}).description("Push all local tasks to the Vibeflow SaaS app and delete them locally").argument("[dir]","Project root directory",".").option("--workspace <id>","Target workspace ID (defaults to your first workspace)").option("--keep-local-files","Keep local task files after pushing (do not delete them)").action(async(t,e)=>{le("command_run",{command:"push"}),await Tn(t,e),await se()});G.command("telemetry").description("Manage CLI usage telemetry (opt-out at any time)").option("--enable","Enable usage telemetry (default)").option("--disable","Disable usage telemetry").option("--status","Show current telemetry status").action(async t=>{if(t.disable){pt(!1),console.log(n.yellow("Telemetry disabled. No usage data will be collected.")),console.log(n.dim("Run `vibeflow telemetry --enable` to re-enable at any time."));return}if(t.enable){pt(!0),console.log(n.green("Telemetry enabled. Thank you for helping improve Vibeflow!"));return}let{enabled:e,anonymousId:r}=An(),c=process.env.VIBEFLOW_TELEMETRY==="0";console.log(n.bold("Telemetry status:")),console.log(` Enabled: ${e?n.green("yes"):n.yellow("no")}`),c&&console.log(n.dim(" (disabled via VIBEFLOW_TELEMETRY=0 environment variable)")),r&&console.log(n.dim(` Anonymous ID: ${r}`)),console.log(),console.log(n.dim(" vibeflow telemetry --disable Opt out of usage tracking")),console.log(n.dim(" vibeflow telemetry --enable Opt back in")),console.log(n.dim(" No PII is ever collected. User identity is hashed."))});G.parse();