@vibeflow-tools/cli 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/chunk-22ZK3AD6.js +6 -0
  3. package/dist/chunk-2CI62NHU.js +8 -0
  4. package/dist/chunk-2FTOVVDE.js +10 -0
  5. package/dist/chunk-2HKRXAUP.js +10 -0
  6. package/dist/chunk-32Z32W7T.js +2 -0
  7. package/dist/chunk-3V7HLRIS.js +6 -0
  8. package/dist/chunk-4KWRHSXU.js +10 -0
  9. package/dist/chunk-ACDVAO4P.js +6 -0
  10. package/dist/chunk-BBIA4IIO.js +2 -0
  11. package/dist/chunk-BOPGIKZN.js +8 -0
  12. package/dist/chunk-BUQI2W5H.js +2 -0
  13. package/dist/chunk-BZDBSBRV.js +2 -0
  14. package/dist/chunk-CKNX42Z3.js +10 -0
  15. package/dist/chunk-CQ524DVH.js +2 -0
  16. package/dist/chunk-EAYTSVCN.js +2 -0
  17. package/dist/chunk-EDJNSJXJ.js +10 -0
  18. package/dist/chunk-EZX6HYC3.js +8 -0
  19. package/dist/chunk-FYRJDWDC.js +2 -0
  20. package/dist/chunk-GN436FFO.js +10 -0
  21. package/dist/chunk-GQQIUROY.js +2 -0
  22. package/dist/chunk-GTZDS3U3.js +6 -0
  23. package/dist/chunk-ICO6AZHJ.js +10 -0
  24. package/dist/chunk-IJ67OEKX.js +2 -0
  25. package/dist/chunk-ILUMCOF2.js +2 -0
  26. package/dist/chunk-JAWQQLJC.js +8 -0
  27. package/dist/chunk-JQTURVVN.js +2 -0
  28. package/dist/chunk-KZZ4ADHY.js +6 -0
  29. package/dist/chunk-L6EJ7QTO.js +6 -0
  30. package/dist/chunk-LYJHU4LP.js +10 -0
  31. package/dist/chunk-N5PXJMOU.js +6 -0
  32. package/dist/chunk-NHVKGOSV.js +10 -0
  33. package/dist/chunk-O4LGEPMQ.js +8 -0
  34. package/dist/chunk-P63ZVL36.js +2 -0
  35. package/dist/chunk-PFOVGF7M.js +10 -0
  36. package/dist/chunk-PGGJRQCO.js +2 -0
  37. package/dist/chunk-PN5C7EHL.js +8 -0
  38. package/dist/chunk-PWP474PZ.js +2 -0
  39. package/dist/chunk-Q7MEW67Z.js +8 -0
  40. package/dist/chunk-QJMBWTAZ.js +8 -0
  41. package/dist/chunk-R5NQALFI.js +2 -0
  42. package/dist/chunk-RBBUTBE3.js +6 -0
  43. package/dist/chunk-RRQ5P63N.js +2 -0
  44. package/dist/chunk-SQPWTIQO.js +2 -0
  45. package/dist/chunk-TTWEWSD3.js +6 -0
  46. package/dist/chunk-WARORREB.js +2 -0
  47. package/dist/chunk-WHXU37AT.js +10 -0
  48. package/dist/chunk-WKEMBLJR.js +2 -0
  49. package/dist/chunk-WVRMKUU5.js +6 -0
  50. package/dist/chunk-WZ2QQDYW.js +2 -0
  51. package/dist/chunk-X3VLCXWS.js +6 -0
  52. package/dist/chunk-X4CQRMD4.js +6 -0
  53. package/dist/chunk-X4RGF6JJ.js +2 -0
  54. package/dist/chunk-XHZXHACL.js +2 -0
  55. package/dist/chunk-XJ35INCK.js +10 -0
  56. package/dist/chunk-YMBPKWZ4.js +2 -0
  57. package/dist/chunk-ZHA4Y2KB.js +8 -0
  58. package/dist/cli/chunk-22ZK3AD6.js +6 -0
  59. package/dist/cli/chunk-2CI62NHU.js +8 -0
  60. package/dist/cli/chunk-2FTOVVDE.js +10 -0
  61. package/dist/cli/chunk-2HKRXAUP.js +10 -0
  62. package/dist/cli/chunk-32Z32W7T.js +2 -0
  63. package/dist/cli/chunk-3V7HLRIS.js +6 -0
  64. package/dist/cli/chunk-4KWRHSXU.js +10 -0
  65. package/dist/cli/chunk-ACDVAO4P.js +6 -0
  66. package/dist/cli/chunk-BBIA4IIO.js +2 -0
  67. package/dist/cli/chunk-BOPGIKZN.js +8 -0
  68. package/dist/cli/chunk-BUQI2W5H.js +2 -0
  69. package/dist/cli/chunk-BZDBSBRV.js +2 -0
  70. package/dist/cli/chunk-CKNX42Z3.js +10 -0
  71. package/dist/cli/chunk-CQ524DVH.js +2 -0
  72. package/dist/cli/chunk-EAYTSVCN.js +2 -0
  73. package/dist/cli/chunk-EDJNSJXJ.js +10 -0
  74. package/dist/cli/chunk-EZX6HYC3.js +8 -0
  75. package/dist/cli/chunk-FYRJDWDC.js +2 -0
  76. package/dist/cli/chunk-GN436FFO.js +10 -0
  77. package/dist/cli/chunk-GQQIUROY.js +2 -0
  78. package/dist/cli/chunk-GTZDS3U3.js +6 -0
  79. package/dist/cli/chunk-ICO6AZHJ.js +10 -0
  80. package/dist/cli/chunk-IJ67OEKX.js +2 -0
  81. package/dist/cli/chunk-ILUMCOF2.js +2 -0
  82. package/dist/cli/chunk-JAWQQLJC.js +8 -0
  83. package/dist/cli/chunk-JQTURVVN.js +2 -0
  84. package/dist/cli/chunk-KZZ4ADHY.js +6 -0
  85. package/dist/cli/chunk-L6EJ7QTO.js +6 -0
  86. package/dist/cli/chunk-LYJHU4LP.js +10 -0
  87. package/dist/cli/chunk-N5PXJMOU.js +6 -0
  88. package/dist/cli/chunk-NHVKGOSV.js +10 -0
  89. package/dist/cli/chunk-O4LGEPMQ.js +8 -0
  90. package/dist/cli/chunk-P63ZVL36.js +2 -0
  91. package/dist/cli/chunk-PFOVGF7M.js +10 -0
  92. package/dist/cli/chunk-PGGJRQCO.js +2 -0
  93. package/dist/cli/chunk-PN5C7EHL.js +8 -0
  94. package/dist/cli/chunk-PWP474PZ.js +2 -0
  95. package/dist/cli/chunk-Q7MEW67Z.js +8 -0
  96. package/dist/cli/chunk-QJMBWTAZ.js +8 -0
  97. package/dist/cli/chunk-R5NQALFI.js +2 -0
  98. package/dist/cli/chunk-RBBUTBE3.js +6 -0
  99. package/dist/cli/chunk-RRQ5P63N.js +2 -0
  100. package/dist/cli/chunk-SQPWTIQO.js +2 -0
  101. package/dist/cli/chunk-TTWEWSD3.js +6 -0
  102. package/dist/cli/chunk-WARORREB.js +2 -0
  103. package/dist/cli/chunk-WHXU37AT.js +10 -0
  104. package/dist/cli/chunk-WKEMBLJR.js +2 -0
  105. package/dist/cli/chunk-WVRMKUU5.js +6 -0
  106. package/dist/cli/chunk-WZ2QQDYW.js +2 -0
  107. package/dist/cli/chunk-X3VLCXWS.js +6 -0
  108. package/dist/cli/chunk-X4CQRMD4.js +6 -0
  109. package/dist/cli/chunk-X4RGF6JJ.js +2 -0
  110. package/dist/cli/chunk-XHZXHACL.js +2 -0
  111. package/dist/cli/chunk-XJ35INCK.js +10 -0
  112. package/dist/cli/chunk-YMBPKWZ4.js +2 -0
  113. package/dist/cli/chunk-ZHA4Y2KB.js +8 -0
  114. package/dist/cli/comments-5LRGOYLT.js +2 -0
  115. package/dist/cli/comments-D3SKM2F4.js +2 -0
  116. package/dist/cli/comments-GGE2X2EE.js +2 -0
  117. package/dist/cli/comments-GZ6HQMHL.js +2 -0
  118. package/dist/cli/comments-LHSMBKJ3.js +2 -0
  119. package/dist/cli/comments-M5HDNHXR.js +2 -0
  120. package/dist/cli/comments-MJP5KLEE.js +2 -0
  121. package/dist/cli/comments-TQHWMRB4.js +2 -0
  122. package/dist/cli/comments-VSWJW47E.js +2 -0
  123. package/dist/cli/files-3GGL6AHA.js +2 -0
  124. package/dist/cli/files-4M7AX2IR.js +2 -0
  125. package/dist/cli/files-7GFBKISD.js +2 -0
  126. package/dist/cli/files-7H73XU4Z.js +2 -0
  127. package/dist/cli/files-FL23FKMK.js +2 -0
  128. package/dist/cli/files-GQPP5SSP.js +2 -0
  129. package/dist/cli/files-QO35EIJI.js +2 -0
  130. package/dist/cli/files-R6BRCQQX.js +2 -0
  131. package/dist/cli/files-WH4W5IPG.js +2 -0
  132. package/dist/cli/files-XKVCQQMI.js +2 -0
  133. package/dist/cli/git-NH6PGXOM.js +2 -0
  134. package/dist/cli/index.js +63 -71
  135. package/dist/cli/push-25YMX4RZ.js +2 -0
  136. package/dist/cli/push-26JSGYHL.js +2 -0
  137. package/dist/cli/push-5NNA77B2.js +2 -0
  138. package/dist/cli/push-7M34G4OW.js +2 -0
  139. package/dist/cli/push-AARMGHSL.js +2 -0
  140. package/dist/cli/push-EVBLKP53.js +2 -0
  141. package/dist/cli/push-HG6EPV6P.js +2 -0
  142. package/dist/cli/push-RFYHMZBR.js +2 -0
  143. package/dist/cli/push-RQJQM7U7.js +2 -0
  144. package/dist/cli/push-S4G36KHW.js +2 -0
  145. package/dist/cli/push-S5XSREE5.js +2 -0
  146. package/dist/cli/push-SWN2KN2R.js +2 -0
  147. package/dist/cli/review-gate-QR2E4REN.js +2 -0
  148. package/dist/cli/settings-KKHPB344.js +2 -0
  149. package/dist/cli/settings-PYRZJJ4H.js +2 -0
  150. package/dist/cli/tasks-3HXDHCPS.js +2 -0
  151. package/dist/cli/tasks-5X5AAK2N.js +2 -0
  152. package/dist/cli/tasks-MUL5SYJQ.js +2 -0
  153. package/dist/cli/tasks-N3AEGAEB.js +2 -0
  154. package/dist/cli/tasks-NSLXFEXZ.js +2 -0
  155. package/dist/cli/tasks-OJTUAWAN.js +2 -0
  156. package/dist/cli/tasks-SV7ZVS7W.js +2 -0
  157. package/dist/cli/tasks-VCU3JVNJ.js +2 -0
  158. package/dist/cli/verify-44MRXSPT.js +2 -0
  159. package/dist/cli/verify-AXMQ27UT.js +2 -0
  160. package/dist/cli/verify-BJ62CQI3.js +2 -0
  161. package/dist/cli/verify-DEG2BZOB.js +2 -0
  162. package/dist/cli/verify-DGL7A4WD.js +2 -0
  163. package/dist/cli/verify-GP427VCE.js +2 -0
  164. package/dist/cli/verify-QUCASFYP.js +2 -0
  165. package/dist/cli/verify-RY7B6C2P.js +2 -0
  166. package/dist/cli/verify-TTAW3GG6.js +2 -0
  167. package/dist/cli/verify-VLVCMBBW.js +2 -0
  168. package/dist/cli/verify-XL7JI7LN.js +2 -0
  169. package/dist/cli/verify-ZOAIUNRD.js +2 -0
  170. package/dist/cli/workspace-AJAVENKA.js +2 -0
  171. package/dist/client/kanban-browser.js +13 -12
  172. package/dist/client/overlay-browser.js +4 -4
  173. package/dist/files-3GGL6AHA.js +2 -0
  174. package/dist/files-4M7AX2IR.js +2 -0
  175. package/dist/files-7GFBKISD.js +2 -0
  176. package/dist/files-7H73XU4Z.js +2 -0
  177. package/dist/files-FL23FKMK.js +2 -0
  178. package/dist/files-GQPP5SSP.js +2 -0
  179. package/dist/files-QO35EIJI.js +2 -0
  180. package/dist/files-R6BRCQQX.js +2 -0
  181. package/dist/files-WH4W5IPG.js +2 -0
  182. package/dist/files-XKVCQQMI.js +2 -0
  183. package/dist/index.js +63 -71
  184. package/dist/workspace-AJAVENKA.js +2 -0
  185. package/package.json +2 -1
package/dist/cli/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import{a as U,b as Ce,c as ze,d as Ht,e as gt,f as Ee,g as Wt,h as V,i as Vt,j as Ne,k as ee,l as re,m as ae,n as B,o as Ve,p as qt,q as Me,r as Kt,s as Y,u as te,v as G,w as Yt,x as Pe}from"./chunk-TCTUG3QV.js";import{a as oe,b as Gt,c as Qt}from"./chunk-KJ5LYG6A.js";import{Command as bi}from"commander";import{execSync as Ut,execFileSync as ft}from"child_process";import{readFileSync as Va,readdirSync as qa,statSync as Ka,existsSync as Pt,writeFileSync as Nn,mkdirSync as Pn,unlinkSync as zn}from"fs";import{join as le,resolve as Ya,basename as fe,extname as Mn,dirname as Ga}from"path";import{createServer as Dn}from"http";import{spawn as Qa,execSync as Fn}from"child_process";import{networkInterfaces as Xa}from"os";import ge from"express";import{WebSocketServer as Bn,WebSocket as Un}from"ws";import S from"chalk";import{createExpressMiddleware as Ja}from"@trpc/server/adapters/express";import*as Zr from"cheerio";import{readdirSync as Ti,statSync as ji}from"fs";import{join as Ni,extname as Pi}from"path";function Xt(t,e){let n=`<script data-vibeflow-overlay>${e}</script>`,i=t.lastIndexOf("</body>");return i!==-1?t.slice(0,i)+n+`
3
- `+t.slice(i):t+`
4
- `+n}import{watch as ea}from"chokidar";function mt(t,e){let n=ea(t,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});return n.on("change",i=>{e.onChange(i)}),e.onAdd&&n.on("add",e.onAdd),e.onUnlink&&n.on("unlink",e.onUnlink),n}function De(t,e){return mt(t,{onChange:e.onChanged,onAdd:e.onChanged,onUnlink:e.onDeleted})}var bt=`"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"),Ia=Symbol.for("react.offscreen"),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\`
2
+ import{a as ue,b as zt,c as Dt,d as $t,g as Ft}from"./chunk-TTWEWSD3.js";import{a as de,c as Mt}from"./chunk-KJ5LYG6A.js";import{c as Y,d as jt}from"./chunk-YMBPKWZ4.js";import{a as Lt,b as Te,c as Ve,d as Ot,g as At}from"./chunk-PFOVGF7M.js";import{a as A}from"./chunk-BZDBSBRV.js";import{d as Be,e as It,g as Rt,j as ee,k as He,l as Nt,m as Pt,n as Ce}from"./chunk-BBIA4IIO.js";import{a as oe,c as ye,d as Ue,e as We}from"./chunk-WKEMBLJR.js";import{c as rt,e as he,g as q,k as _e,l as ve,m as K,n as ce,o as V,p as Fe,q as Ct,r as Tt,s as Oe,t as Et}from"./chunk-Q7MEW67Z.js";import{a as J,b as be,d as Z,e as Pe,g as Le}from"./chunk-XHZXHACL.js";import{Command as ho}from"commander";import{execSync as jr,execFileSync as St}from"child_process";import{readFileSync as ma,readdirSync as ba,statSync as ha,existsSync as mt,writeFileSync as En,mkdirSync as jn,unlinkSync as On}from"fs";import{join as G,resolve as va,basename as se,extname as ya,dirname as xa}from"path";import{createServer as ka}from"http";import{execSync as An}from"child_process";import{networkInterfaces as wa}from"os";import me from"express";import{WebSocketServer as Sa,WebSocket as _a}from"ws";import f from"chalk";import{createExpressMiddleware as Ca}from"@trpc/server/adapters/express";import{StreamableHTTPServerTransport as Br}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{McpServer as Pr}from"@modelcontextprotocol/sdk/server/mcp.js";import{execSync as Bt}from"child_process";function ie(t){try{let e=Bt("git config user.name",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim(),n=Bt("git config user.email",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return{name:e||"Unknown",email:n||""}}catch{return{name:"Unknown",email:""}}}import{z as v}from"zod";var Ut=v.object({status:v.enum(J).optional(),type:v.enum(["Task","Bug","Feature","Enhancement","Research"]).optional(),user:v.string().optional(),tag:v.array(v.string()).optional(),limit:v.number().min(0).default(5),fields:v.array(v.string()).optional()}),Wt=v.object({id:v.string().min(1),fields:v.array(v.string()).optional()}),Vt=v.object({title:v.string().min(1),description:v.string().optional(),status:v.enum(J).default("todo"),type:v.enum(["Task","Bug","Feature","Enhancement","Research"]).default("Task"),priority:v.enum(["Critical","High","Medium","Low"]).default("Medium"),tags:v.array(v.string()).optional(),url:v.string().optional(),selector:v.string().default("/"),cssSelector:v.string().optional()}),qt=v.object({id:v.string().min(1),status:v.enum(J).optional(),title:v.string().min(1).optional(),description:v.string().optional(),branch:v.string().optional(),comment:v.string().optional(),commitMessage:v.string().optional(),skipVerify:v.boolean().default(!1),dryRun:v.boolean().default(!1)}),Kt=v.object({type:v.enum(["Task","Bug","Feature","Enhancement","Research"]).optional(),user:v.string().optional(),tag:v.array(v.string()).optional(),dryRun:v.boolean().default(!1)}),Yt=v.object({id:v.string().min(1),text:v.string().min(1),author:v.enum(["agent","user"]).default("agent")}),Gt=v.object({id:v.string().min(1),filename:v.string().min(1),contentB64:v.string().min(1)}),Qt=v.object({id:v.string().optional(),ids:v.array(v.string()).optional(),format:v.enum(["markdown","json"]).default("markdown")}),Xt=v.object({id:v.string().min(1),url:v.string().url().optional(),timeoutMs:v.number().min(1e3).max(3e5).default(6e4)}),Jt=v.object({workspace:v.string().optional(),keepLocalFiles:v.boolean().default(!0),dryRun:v.boolean().default(!1)});async function Zt(t,e){try{let{listTasks:n}=await import("./tasks-5X5AAK2N.js"),l=n(t.projectDir);e.status&&(l=l.filter(o=>o.status===e.status)),e.type&&(l=l.filter(o=>o.type===e.type)),e.user&&(l=l.filter(o=>o.author===e.user)),e.tag&&e.tag.length>0&&(l=l.filter(o=>o.tags&&e.tag.every(i=>o.tags.includes(i))));let a=l.length;if(e.limit>0&&(l=l.slice(0,e.limit)),e.fields&&e.fields.length>0){let o=new Set(e.fields);l=l.map(i=>{let s={};for(let c of Object.keys(i))o.has(c)&&(s[c]=i[c]);return s})}return{ok:!0,data:{tasks:l,total:a}}}catch(n){return{ok:!1,error:{code:"LIST_TASKS_ERROR",message:n instanceof Error?n.message:"Failed to list tasks"}}}}async function en(t,e){try{let{findTaskFilePath:n,readTaskFile:l}=await import("./tasks-5X5AAK2N.js"),a=n(t.projectDir,e.id);if(!a)return{ok:!1,error:{code:"TASK_NOT_FOUND",message:`Task not found: ${e.id}`,suggestion:"Check the task ID and try again"}};let o=l(a);if(!o)return{ok:!1,error:{code:"TASK_READ_ERROR",message:`Failed to read task: ${e.id}`}};if(e.fields&&e.fields.length>0){let i=new Set(e.fields),s={};for(let c of Object.keys(o))i.has(c)&&(s[c]=o[c]);return{ok:!0,data:s}}return{ok:!0,data:o}}catch(n){return{ok:!1,error:{code:"GET_TASK_ERROR",message:n instanceof Error?n.message:"Failed to get task"}}}}async function tn(t,e){try{if(t.dryRun)return{ok:!0,data:{id:"dry-run",title:e.title,description:e.description??"",status:e.status,selector:e.selector,created:new Date().toISOString()},steps:["Dry run: task would be created"]};let{createTask:n}=await import("./tasks-5X5AAK2N.js");return{ok:!0,data:n(t.projectDir,{title:e.title,description:e.description??"",status:e.status,type:e.type,priority:e.priority,tags:e.tags,url:e.url,selector:e.selector,cssSelector:e.cssSelector})}}catch(n){return{ok:!1,error:{code:"CREATE_TASK_ERROR",message:n instanceof Error?n.message:"Failed to create task"}}}}async function nn(t,e){try{let{findTaskFilePath:n,readTaskFile:l}=await import("./tasks-5X5AAK2N.js"),a=n(t.projectDir,e.id),o=a?l(a):null;if(!o)return{ok:!1,error:{code:"TASK_NOT_FOUND",message:`Task not found: ${e.id}`}};if(e.status==="review"){let{loadSettings:g}=await import("./settings-PYRZJJ4H.js"),{checkReviewTransition:p}=await import("./review-gate-QR2E4REN.js"),w=g(t.projectDir),_=p(t.projectDir,e.id,{comment:e.comment,commitMessage:e.commitMessage,skipVerify:e.skipVerify},{projectDir:t.projectDir,settings:w});if(!_.ok)return{ok:!1,error:{code:_.code,message:_.message,suggestion:_.suggestion}}}if(t.dryRun)return{ok:!0,data:o,steps:["Dry run: task would be updated"]};let{updateTask:i}=await import("./tasks-5X5AAK2N.js"),s={};e.status&&(s.status=e.status),e.title&&(s.title=e.title),e.description!==void 0&&(s.description=e.description),e.branch&&(s.branchName=e.branch),e.status==="in-progress"&&(s.verified=!1);let c=i(t.projectDir,e.id,s);if(!c)return{ok:!1,error:{code:"TASK_NOT_FOUND",message:`Task not found: ${e.id}`}};if(e.comment){let{addComment:g}=await import("./comments-TQHWMRB4.js");g(t.projectDir,e.id,"agent",e.comment)}let u=[];if(e.status==="review"&&e.commitMessage){let{loadSettings:g}=await import("./settings-PYRZJJ4H.js"),{commitTaskChanges:p}=await import("./git-NH6PGXOM.js");if(g(t.projectDir).autoCommit){let _=p(t.projectDir,c.id,e.commitMessage);_.ok?u.push(`Committed: ${_.sha}`):u.push(`Commit failed: ${_.error}`)}}return{ok:!0,data:c,steps:u.length>0?u:void 0}}catch(n){return{ok:!1,error:{code:"UPDATE_TASK_ERROR",message:n instanceof Error?n.message:"Failed to update task"}}}}async function rn(t,e){try{if(t.dryRun){let{listTasks:l}=await import("./tasks-5X5AAK2N.js"),a=l(t.projectDir);return a=a.filter(o=>o.status==="todo"),e.type&&(a=a.filter(o=>o.type===e.type)),e.tag&&e.tag.length>0&&(a=a.filter(o=>o.tags&&e.tag.every(i=>o.tags.includes(i)))),a.length===0?{ok:!1,error:{code:"NO_TASKS_AVAILABLE",message:"No tasks available to claim"}}:{ok:!0,data:a[0],steps:["Dry run: task would be claimed"]}}let n=(await import("./tasks-5X5AAK2N.js")).claimNextTaskAtomic(t.projectDir,{type:e.type,user:e.user,tag:e.tag,author:t.userId});return n?{ok:!0,data:n}:{ok:!1,error:{code:"NO_TASKS_AVAILABLE",message:"No tasks available to claim"}}}catch(n){return{ok:!1,error:{code:"CLAIM_TASK_ERROR",message:n instanceof Error?n.message:"Failed to claim task"}}}}async function an(t,e){try{let{addComment:n}=await import("./comments-TQHWMRB4.js");return{ok:!0,data:await n(t.projectDir,e.id,e.author,e.text)}}catch(n){return{ok:!1,error:{code:"ADD_COMMENT_ERROR",message:n instanceof Error?n.message:"Failed to add comment"}}}}async function on(t,e){try{let{saveFile:n,validateFilename:l}=await import("./files-R6BRCQQX.js"),a=Buffer.from(e.contentB64,"base64"),o=l(e.filename,a.length);return o.valid?{ok:!0,data:n(t.projectDir,e.id,e.filename,a)}:{ok:!1,error:{code:o.errorCode,message:o.errorMessage}}}catch(n){return{ok:!1,error:{code:"ATTACH_FILE_ERROR",message:n instanceof Error?n.message:"Failed to attach file"}}}}async function ln(t,e){try{let{listTasks:n,renderTaskForAgent:l,findTaskFilePath:a,readTaskFile:o}=await import("./tasks-5X5AAK2N.js"),{listComments:i}=await import("./comments-TQHWMRB4.js"),{listFiles:s}=await import("./files-R6BRCQQX.js");if(e.id){let g=a(t.projectDir,e.id);if(!g)return{ok:!1,error:{code:"TASK_NOT_FOUND",message:`Task not found: ${e.id}`}};let p=o(g);if(!p)return{ok:!1,error:{code:"TASK_READ_ERROR",message:`Failed to read task: ${e.id}`}};let w=i(t.projectDir,e.id),_=s(t.projectDir,e.id);return{ok:!0,data:l(p,g,w,_,t.projectDir)}}if(e.ids&&e.ids.length>0){let g=[];for(let p of e.ids){let w=a(t.projectDir,p);if(!w)continue;let _=o(w);if(!_)continue;let z=i(t.projectDir,p),$=s(t.projectDir,p);g.push(l(_,w,z,$,t.projectDir))}return{ok:!0,data:g.join(`
3
+
4
+ `)}}let c=n(t.projectDir),u=[];for(let g of c){let p=a(t.projectDir,g.id);if(!p)continue;let w=i(t.projectDir,g.id),_=s(t.projectDir,g.id);u.push(l(g,p,w,_,t.projectDir))}return{ok:!0,data:u.join(`
5
+
6
+ `)}}catch(n){return{ok:!1,error:{code:"EXPORT_PROMPT_ERROR",message:n instanceof Error?n.message:"Failed to export prompt"}}}}var Ht=Promise.resolve();function Nr(t){let e=Ht.then(t,t);return Ht=e.catch(()=>{}),e}async function sn(t,e){return Nr(async()=>{let{verifyTask:n,addVerifySystemComment:l}=await import("./verify-ZOAIUNRD.js"),a=e.timeoutMs??6e4,o=new AbortController,i=setTimeout(()=>o.abort(),a);i.unref?.();try{let s=await n(t.projectDir,e.id,{url:e.url,signal:o.signal});return await l(t.projectDir,e.id,s),{ok:!0,data:s}}catch(s){let c=s instanceof Error&&"code"in s?s:null;if(c)return{ok:!1,error:{code:c.code,message:c.message,suggestion:c.suggestion}};let u=s instanceof Error?s.message:String(s);return u==="VERIFY_TIMEOUT"||o.signal.aborted?{ok:!1,error:{code:"VERIFY_TIMEOUT",message:`Verification timed out after ${e.timeoutMs}ms`,suggestion:"Increase timeoutMs or check that the app is running."}}:{ok:!1,error:{code:"VERIFY_TASK_ERROR",message:u}}}finally{clearTimeout(i)}})}async function cn(t,e){try{let{push:n}=await import("./push-5NNA77B2.js");return{ok:!0,data:await n(t.projectDir,{workspace:e.workspace,keepLocalFiles:e.keepLocalFiles,dryRun:e.dryRun})}}catch(n){return{ok:!1,error:{code:"PUSH_TASKS_ERROR",message:n instanceof Error?n.message:"Failed to push tasks"}}}}var un=[{name:"list_tasks",title:"List tasks",description:"List tasks with optional filters. Returns task list with configurable fields.",cliRef:{command:"tasks",flags:["--status","--type","--user","--tag","--limit","--fields"]},category:"task-read",annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},input:Ut.shape,run:(t,e)=>Zt(t,e)},{name:"get_task",title:"Get task",description:"Get a single task by ID with full details including comments and files.",cliRef:{command:"tasks",flags:["--get"]},category:"task-read",annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},input:Wt.shape,run:(t,e)=>en(t,e)},{name:"create_task",title:"Create task",description:"Create a new task with title, description, and metadata.",cliRef:{command:"tasks",flags:["--add","--title","--description","--type","--priority","--tag"]},category:"task-write",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},input:Vt.shape,run:(t,e)=>tn(t,e)},{name:"update_task",title:"Update task",description:"Update an existing task. Supports status changes, title/description updates, and adding comments.",cliRef:{command:"tasks",flags:["--edit","--set-status","--title","--description","--branch","--comment","--commit-message","--skip-verify"]},category:"task-mutate",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},input:qt.shape,run:(t,e)=>nn(t,e)},{name:"claim_next_task",title:"Claim next task",description:"Claim the highest-priority todo task and set it to in-progress.",cliRef:{command:"tasks",flags:["--next","--type","--tag"]},category:"task-mutate",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},input:Kt.shape,run:(t,e)=>rn(t,e)},{name:"add_comment",title:"Add comment",description:"Add a comment to a task.",cliRef:{command:"tasks",flags:["--comment"]},category:"task-write",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},input:Yt.shape,run:(t,e)=>an(t,e)},{name:"attach_file",title:"Attach file",description:"Attach a file to a task (content as base64).",cliRef:{command:"tasks",flags:["--report-file"]},category:"task-write",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},input:Gt.shape,run:(t,e)=>on(t,e)},{name:"export_prompt",title:"Export prompt",description:"Export task(s) as formatted prompt for LLM consumption.",cliRef:{command:"tasks",flags:["--get","--json"]},category:"task-read",annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},input:Qt.shape,run:(t,e)=>ln(t,e)},{name:"verify_task",title:"Verify task",description:"Run visual verification on a task. Captures baseline and compares.",cliRef:{command:"verify",flags:["--json","--url"]},category:"task-mutate",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},input:Xt.shape,run:(t,e)=>sn(t,e)},{name:"push_tasks",title:"Push tasks",description:"Push local tasks to the SaaS server.",cliRef:{command:"push",flags:["--workspace","--keep-local-files"]},category:"admin",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1},input:Jt.shape,run:(t,e)=>cn(t,e)}];function dn(t,e="local"){let n=new Pr({name:"vibeflow",version:"0.1.0"}),l={projectDir:t,mode:e,userId:ie(t).name};for(let a of un)n.tool(a.name,a.description,a.input,async o=>{let i=await a.run(l,o);return Lr(i)});return n}function Lr(t){return t.ok?{content:[{type:"text",text:JSON.stringify(t.data,null,2)}]}:{content:[{type:"text",text:JSON.stringify({error:t.error?.code??"UNKNOWN_ERROR",message:t.error?.message??"An unknown error occurred",suggestion:t.error?.suggestion},null,2)}]}}import{existsSync as Or,readFileSync as Ar}from"fs";import{join as zr}from"path";import{homedir as Mr}from"os";import{createHash as pn,timingSafeEqual as Dr}from"crypto";function $r(){try{let t=zr(Mr(),".vibeflow","auth.json");if(!Or(t))return null;let e=Ar(t,"utf-8");return JSON.parse(e).token??null}catch{return null}}function Fr(t,e){let n=pn("sha256").update(t).digest(),l=pn("sha256").update(e).digest();return Dr(n,l)}function fn(t,e,n){let l=t.ip??t.socket.remoteAddress??"",a=l==="127.0.0.1"||l==="::1"||l==="::ffff:127.0.0.1",o=$r();if(!o){if(a){n();return}e.status(401).json({error:"Unauthorized",message:"MCP requires authentication for non-loopback connections"});return}let i=t.headers.authorization;if(!i?.startsWith("Bearer ")){e.status(401).json({error:"Unauthorized",message:"Missing or invalid Authorization header"});return}let s=i.slice(7);if(!Fr(s,o)){e.status(403).json({error:"Forbidden",message:"Invalid authentication token"});return}n()}import Hr from"crypto";var le=new Map,Ur=1800*1e3,Ee=null;function Wr(){let t=Date.now();for(let[e,n]of le)t-n.lastSeen>Ur&&(n.transport.close().catch(()=>{}),le.delete(e))}function Vr(){Ee||(Ee=setInterval(Wr,300*1e3),Ee.unref())}function gn(t){let e=le.get(t);e&&(e.lastSeen=Date.now())}function mn(t,e,n="local"){Vr(),t.use("/api/mcp",(l,a,o)=>{if(a.setHeader("Access-Control-Allow-Origin","http://localhost:3700"),a.setHeader("Access-Control-Allow-Methods","GET, POST, DELETE, OPTIONS"),a.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, mcp-session-id"),l.method==="OPTIONS"){a.status(204).end();return}o()}),t.use("/api/mcp",fn),t.all("/api/mcp",async(l,a)=>{try{let o=l.headers["mcp-session-id"];if(l.method==="POST")if(o){let i=le.get(o);if(!i){a.status(404).json({error:"Session not found"});return}gn(o),await i.transport.handleRequest(l,a,l.body)}else{let i=dn(e,n),s=new Br({sessionIdGenerator:()=>Hr.randomUUID(),enableJsonResponse:!0});await i.connect(s),await s.handleRequest(l,a,l.body);let c=s.sessionId;if(!c){a.status(500).json({error:"Failed to create session"});return}let u=Date.now();le.set(c,{server:i,transport:s,createdAt:u,lastSeen:u})}else if(l.method==="GET"){if(!o){a.status(400).json({error:"Session ID required for GET"});return}let i=le.get(o);if(!i){a.status(404).json({error:"Session not found"});return}gn(o),await i.transport.handleRequest(l,a,l.body)}else if(l.method==="DELETE"){if(!o){a.status(400).json({error:"Session ID required for DELETE"});return}let i=le.get(o);i&&(await i.transport.close(),le.delete(o)),a.status(200).json({ok:!0})}}catch(o){console.error("[MCP] Request error:",o),a.headersSent||a.status(500).json({error:"Internal server error",message:o instanceof Error?o.message:"Unknown error"})}})}function at(){Ee&&(clearInterval(Ee),Ee=null);for(let[,t]of le)t.transport.close().catch(()=>{});le.clear()}import*as qr from"cheerio";import{readdirSync as Qo,statSync as Xo}from"fs";import{join as Zo,extname as ei}from"path";function bn(t,e){let n=`<script data-vibeflow-overlay>${e}</script>`,l=t.lastIndexOf("</body>");return l!==-1?t.slice(0,l)+n+`
7
+ `+t.slice(l):t+`
8
+ `+n}import{watch as Kr}from"chokidar";function ot(t,e){let n=Kr(t,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:50}});return n.on("change",l=>{e.onChange(l)}),e.onAdd&&n.on("add",e.onAdd),e.onUnlink&&n.on("unlink",e.onUnlink),n}function Ae(t,e){return ot(t,{onChange:e.onChanged,onAdd:e.onChanged,onUnlink:e.onDeleted})}var it=`"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"),Ia=Symbol.for("react.offscreen"),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
9
  \`+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
10
  \`),f=d.stack.split(\`
7
11
  \`),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=\`
@@ -1595,19 +1599,19 @@ Error generating stack: \`+f.message+\`
1595
1599
  outline: 2px solid #f59e0b !important;
1596
1600
  outline-offset: 2px !important;
1597
1601
  background-color: rgba(245, 158, 11, 0.08) !important;
1598
- }\`;function setupShadowDom(){let host=document.createElement("div");host.id="vibeflow-studio-root",host.style.pointerEvents="none",document.body.appendChild(host);let root=host.attachShadow({mode:"open"}),styleEl=document.createElement("style");styleEl.textContent=OVERLAY_CSS,root.appendChild(styleEl);let hostStyle=document.createElement("style");return hostStyle.textContent=HOST_PAGE_CSS,document.head.appendChild(hostStyle),{host,root}}function loadPrefs(){try{let p=JSON.parse(localStorage.getItem(PREFS_KEY)??"{}");state.indicatorsVisible=p.indicatorsVisible===!0,state.sidebarShowDone=p.sidebarShowDone!==!1,state.showAllPages=p.showAllPages===!0,state.theme="dark",applyOverlayTheme(state.theme)}catch{}}function applyOverlayTheme(theme){state.theme=theme,state.host&&state.host.setAttribute("data-theme",theme)}function startAnnotationHover(host){document.addEventListener("mouseover",e=>onAnnotateMouseOver(e,host),!0),document.addEventListener("mouseout",onAnnotateMouseOut,!0)}function stopAnnotationHover(host){if(document.removeEventListener("mouseover",e=>onAnnotateMouseOver(e,host),!0),document.removeEventListener("mouseout",onAnnotateMouseOut,!0),state.hoverTarget){try{state.hoverTarget.classList.remove("vibeflow-hover-highlight")}catch{}state.hoverTarget=null}}function onAnnotateMouseOver(e,host){let t=e.target;if(!(!t||t===document.documentElement||t===document.body)&&e.composedPath().indexOf(host)===-1&&state.hoverTarget!==t){if(state.hoverTarget)try{state.hoverTarget.classList.remove("vibeflow-hover-highlight")}catch{}state.hoverTarget=t;try{t.classList.add("vibeflow-hover-highlight")}catch{}}}function onAnnotateMouseOut(e){let t=e.target;if(t===state.hoverTarget){try{t.classList.remove("vibeflow-hover-highlight")}catch{}state.hoverTarget=null}}function setAnnotateHighlight(element){if(clearAnnotateHighlight(),!!element){state.annotateHighlightTarget=element;try{element.classList.add("vibeflow-annotate-highlight")}catch{}}}function clearAnnotateHighlight(){if(state.annotateHighlightTarget){try{state.annotateHighlightTarget.classList.remove("vibeflow-annotate-highlight")}catch{}state.annotateHighlightTarget=null}}function el(tag,props,...children){let node=document.createElement(tag);if(props)for(let key of Object.keys(props))key==="className"?node.className=props[key]:key==="placeholder"?node.placeholder=props[key]:key==="type"?node.type=props[key]:key==="value"?node.value=props[key]:node.setAttribute(key,props[key]);for(let child of children)child!=null&&node.appendChild(typeof child=="string"?document.createTextNode(child):child);return node}var healthPollTimer=null;function connectWS(){if(PROTO_CONFIG.wsUrl){state.reconnectTimer&&(clearTimeout(state.reconnectTimer),state.reconnectTimer=null);try{state.ws=new WebSocket(PROTO_CONFIG.wsUrl)}catch{scheduleReconnect();return}state.ws.onopen=()=>{state.reconnectAttempt=0,state.pingInterval&&clearInterval(state.pingInterval),state.pingInterval=setInterval(()=>{var _a;((_a=state.ws)==null?void 0:_a.readyState)===WebSocket.OPEN&&state.ws.send(JSON.stringify({type:"ping"}))},PING_INTERVAL)},state.ws.onmessage=e=>{var _a,_b,_c,_d;let msg;try{msg=JSON.parse(e.data)}catch{return}msg.type!=="pong"&&(msg.type==="reload"&&location.reload(),msg.type==="tasks-updated"&&((_b=(_a=state).onTasksUpdatedMessage)==null||_b.call(_a)),(msg.type==="task-changed"||msg.type==="task-deleted")&&((_d=(_c=state).onTasksUpdatedMessage)==null||_d.call(_c)))},state.ws.onclose=()=>{state.pingInterval&&(clearInterval(state.pingInterval),state.pingInterval=null),scheduleReconnect()},state.ws.onerror=()=>{var _a;(_a=state.ws)==null||_a.close()},stopHealthPoll(),healthPollTimer=setInterval(checkHealth,HEALTH_POLL_INTERVAL)}}function scheduleReconnect(){let delay=Math.min(RECONNECT_BASE*2**state.reconnectAttempt,RECONNECT_MAX);state.reconnectAttempt++,state.reconnectTimer=setTimeout(connectWS,delay)}function stopHealthPoll(){healthPollTimer&&(clearInterval(healthPollTimer),healthPollTimer=null)}function checkHealth(){if(!PROTO_CONFIG.wsUrl||state.ws&&state.ws.readyState===WebSocket.OPEN)return;let healthUrl=PROTO_CONFIG.wsUrl.replace("ws://","http://").replace("wss://","https://").replace("/ws","/api/health");fetch(healthUrl,{signal:AbortSignal.timeout(3e3)}).then(r=>{r.ok||(stopHealthPoll(),scheduleReconnect())}).catch(()=>{stopHealthPoll(),scheduleReconnect()})}function setupWsVisibilityReconnect(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(!state.ws||state.ws.readyState!==WebSocket.OPEN)&&(state.reconnectAttempt=0,connectWS())})}function fetchTasks(){let url=PROTO_CONFIG.boardId?\`\${PROTO_CONFIG.apiUrl}?boardId=\${encodeURIComponent(PROTO_CONFIG.boardId)}\`:PROTO_CONFIG.apiUrl,headers={};PROTO_CONFIG.overlayApiKey&&(headers["X-Overlay-Api-Key"]=PROTO_CONFIG.overlayApiKey),fetch(url,Object.keys(headers).length>0?{headers}:void 0).then(r=>r.json()).then(d=>{var _a,_b;state.tasks=d.tasks??[],(_b=(_a=state).onTasksFetched)==null||_b.call(_a,state.tasks)}).catch(()=>{})}function submitTask(selector,cssSelector,title,description,status,source,type,annotatedElementText){let apiUrl=PROTO_CONFIG.apiUrl,allowedOrigin=location.origin,fetchUrl=apiUrl;try{let parsed=new URL(apiUrl);if(parsed.protocol!=="http:"&&parsed.protocol!=="https:")throw new Error(" blocked protocol");fetchUrl=parsed.href}catch{fetchUrl=new URL(apiUrl,allowedOrigin).href}return fetch(fetchUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title,description,selector,cssSelector:cssSelector||null,url:location.pathname,status:status||void 0,file:(source==null?void 0:source.file)??null,line:(source==null?void 0:source.line)??null,col:(source==null?void 0:source.col)??null,component:(source==null?void 0:source.component)??null,type:type||null,annotatedElementText:annotatedElementText||null,...PROTO_CONFIG.boardId?{boardId:PROTO_CONFIG.boardId}:{}})}).then(r=>r.json()).then(d=>{var _a,_b;return d.success&&fetchTasks(),{success:d.success===!0,taskId:(_a=d.task)==null?void 0:_a.id,taskAuthor:(_b=d.task)==null?void 0:_b.author}}).catch(err=>(console.error("[Vibeflow Studio]",err),{success:!1}))}var PAGES_URL=PROTO_CONFIG.pagesUrl;function fetchPages(){PAGES_URL&&fetch(PAGES_URL).then(r=>r.json()).then(d=>{state.pages=d.pages??[],renderPageSwitcher()}).catch(()=>{})}function renderPageSwitcher(){if(state.pageSwitcher&&(state.pageSwitcher.remove(),state.pageSwitcher=null),!state.root||state.pages.length<2)return;let currentPath=location.pathname,switcher=el("div",{className:"vibeflow-page-switcher"});switcher.appendChild(el("span",{className:"page-switcher-label"},"Pages:"));for(let page of state.pages){let tab=el("a",{className:"page-tab"+(page===currentPath||currentPath==="/"&&page==="/index.html"?" active":""),href:page},page.replace(/^\\//,"").replace(/\\.html$/,""));switcher.appendChild(tab)}state.root.appendChild(switcher),state.pageSwitcher=switcher}var STABLE_DATA_ATTRS=["data-testid","data-test","data-cy","data-test-id","data-id"];function buildCssSelector(element){let parts=[],node=element,depth=0;for(;node&&node!==document.body&&depth<6;){let semId=getSemanticId(node);if(semId){parts.unshift(\`#\${semId}\`);break}let anchorAttr=null,anchorName=null;for(let attr of STABLE_DATA_ATTRS){let val=node.getAttribute(attr);if(val){anchorAttr=attr,anchorName=val;break}}if(anchorAttr&&anchorName){parts.unshift(\`[\${anchorAttr}="\${anchorName}"]\`);break}let segment=node.tagName.toLowerCase(),stableClasses=Array.from(node.classList).filter(c=>!/^[0-9a-f]{5,}/.test(c)&&!c.startsWith("vibeflow-")).slice(0,2);stableClasses.length>0&&(segment+=\`.\${stableClasses.join(".")}\`);let parent=node.parentElement;if(parent){let parentChildren=Array.from(parent.children);parentChildren.filter(c=>c.tagName===node.tagName).length>1&&(segment+=\`:nth-child(\${parentChildren.indexOf(node)+1})\`)}parts.unshift(segment),node=node.parentElement,depth++}return parts.join(" > ")}function resolveTestId(el2){let attrs=STABLE_DATA_ATTRS,node=el2;for(;node&&node!==document.body;){for(let attr of attrs){let val=node.getAttribute(attr);if(val)return{attr,value:val}}let id=node.getAttribute("id");if(id&&isSemanticId(id))return{attr:"id",value:id};node=node.parentElement}return null}function isSemanticId(id){return!/^[0-9a-f-]{8,}$/i.test(id)&&!/^\\d+$/.test(id)}function getSemanticId(el2){let id=el2.getAttribute("id");return id&&isSemanticId(id)?id:null}function parseComponentFromReactStack(stack){let SKIP=/^(react-stack|jsxDEV|renderWith|Object\\.|_callee)/i;for(let line of stack.split(\`
1602
+ }\`;function setupShadowDom(){let host=document.createElement("div");host.id="vibeflow-studio-root",host.style.pointerEvents="none",document.body.appendChild(host);let root=host.attachShadow({mode:"open"}),styleEl=document.createElement("style");styleEl.textContent=OVERLAY_CSS,root.appendChild(styleEl);let hostStyle=document.createElement("style");return hostStyle.textContent=HOST_PAGE_CSS,document.head.appendChild(hostStyle),{host,root}}function loadPrefs(){try{let p=JSON.parse(localStorage.getItem(PREFS_KEY)??"{}");state.indicatorsVisible=p.indicatorsVisible===!0,state.sidebarShowDone=p.sidebarShowDone!==!1,state.showAllPages=p.showAllPages===!0,state.theme="dark",applyOverlayTheme(state.theme)}catch{}}function applyOverlayTheme(theme){state.theme=theme,state.host&&state.host.setAttribute("data-theme",theme)}function startAnnotationHover(host){document.addEventListener("mouseover",e=>onAnnotateMouseOver(e,host),!0),document.addEventListener("mouseout",onAnnotateMouseOut,!0)}function stopAnnotationHover(host){if(document.removeEventListener("mouseover",e=>onAnnotateMouseOver(e,host),!0),document.removeEventListener("mouseout",onAnnotateMouseOut,!0),state.hoverTarget){try{state.hoverTarget.classList.remove("vibeflow-hover-highlight")}catch{}state.hoverTarget=null}}function onAnnotateMouseOver(e,host){let t=e.target;if(!(!t||t===document.documentElement||t===document.body)&&e.composedPath().indexOf(host)===-1&&state.hoverTarget!==t){if(state.hoverTarget)try{state.hoverTarget.classList.remove("vibeflow-hover-highlight")}catch{}state.hoverTarget=t;try{t.classList.add("vibeflow-hover-highlight")}catch{}}}function onAnnotateMouseOut(e){let t=e.target;if(t===state.hoverTarget){try{t.classList.remove("vibeflow-hover-highlight")}catch{}state.hoverTarget=null}}function setAnnotateHighlight(element){if(clearAnnotateHighlight(),!!element){state.annotateHighlightTarget=element;try{element.classList.add("vibeflow-annotate-highlight")}catch{}}}function clearAnnotateHighlight(){if(state.annotateHighlightTarget){try{state.annotateHighlightTarget.classList.remove("vibeflow-annotate-highlight")}catch{}state.annotateHighlightTarget=null}}function el(tag,props,...children){let node=document.createElement(tag);if(props)for(let key of Object.keys(props))key==="className"?node.className=props[key]:key==="placeholder"?node.placeholder=props[key]:key==="type"?node.type=props[key]:key==="value"?node.value=props[key]:node.setAttribute(key,props[key]);for(let child of children)child!=null&&node.appendChild(typeof child=="string"?document.createTextNode(child):child);return node}var healthPollTimer=null;function connectWS(){if(PROTO_CONFIG.wsUrl){state.reconnectTimer&&(clearTimeout(state.reconnectTimer),state.reconnectTimer=null);try{state.ws=new WebSocket(PROTO_CONFIG.wsUrl)}catch{scheduleReconnect();return}state.ws.onopen=()=>{state.reconnectAttempt=0,state.pingInterval&&clearInterval(state.pingInterval),state.pingInterval=setInterval(()=>{var _a;((_a=state.ws)==null?void 0:_a.readyState)===WebSocket.OPEN&&state.ws.send(JSON.stringify({type:"ping"}))},PING_INTERVAL)},state.ws.onmessage=e=>{var _a,_b,_c,_d;let msg;try{msg=JSON.parse(e.data)}catch{return}msg.type!=="pong"&&(msg.type==="reload"&&location.reload(),msg.type==="tasks-updated"&&((_b=(_a=state).onTasksUpdatedMessage)==null||_b.call(_a)),(msg.type==="task-changed"||msg.type==="task-deleted")&&((_d=(_c=state).onTasksUpdatedMessage)==null||_d.call(_c)))},state.ws.onclose=()=>{state.pingInterval&&(clearInterval(state.pingInterval),state.pingInterval=null),scheduleReconnect()},state.ws.onerror=()=>{var _a;(_a=state.ws)==null||_a.close()},stopHealthPoll(),healthPollTimer=setInterval(checkHealth,HEALTH_POLL_INTERVAL)}}function scheduleReconnect(){let delay=Math.min(RECONNECT_BASE*2**state.reconnectAttempt,RECONNECT_MAX);state.reconnectAttempt++,state.reconnectTimer=setTimeout(connectWS,delay)}function stopHealthPoll(){healthPollTimer&&(clearInterval(healthPollTimer),healthPollTimer=null)}function checkHealth(){if(!PROTO_CONFIG.wsUrl||state.ws&&state.ws.readyState===WebSocket.OPEN)return;let healthUrl=PROTO_CONFIG.wsUrl.replace("ws://","http://").replace("wss://","https://").replace("/ws","/api/health");fetch(healthUrl,{signal:AbortSignal.timeout(3e3)}).then(r=>{r.ok||(stopHealthPoll(),scheduleReconnect())}).catch(()=>{stopHealthPoll(),scheduleReconnect()})}function setupWsVisibilityReconnect(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&(!state.ws||state.ws.readyState!==WebSocket.OPEN)&&(state.reconnectAttempt=0,connectWS())})}function fetchTasks(){let url=PROTO_CONFIG.boardId?\`\${PROTO_CONFIG.apiUrl}?boardId=\${encodeURIComponent(PROTO_CONFIG.boardId)}\`:PROTO_CONFIG.apiUrl,headers={};PROTO_CONFIG.overlayApiKey&&(headers["X-Overlay-Api-Key"]=PROTO_CONFIG.overlayApiKey),fetch(url,Object.keys(headers).length>0?{headers}:void 0).then(r=>r.json()).then(d=>{var _a,_b;state.tasks=d.tasks??[],(_b=(_a=state).onTasksFetched)==null||_b.call(_a,state.tasks)}).catch(()=>{})}function buildTaskPayload(args){var _a,_b,_c,_d,_e,_f;let tags=Array.isArray((_a=args.advanced)==null?void 0:_a.tags)&&args.advanced.tags.length>0?args.advanced.tags:void 0;return{title:args.title,description:args.description,selector:args.selector,cssSelector:args.cssSelector||null,url:typeof location<"u"?location.pathname:void 0,status:args.status||void 0,file:((_b=args.source)==null?void 0:_b.file)??null,line:((_c=args.source)==null?void 0:_c.line)??null,col:((_d=args.source)==null?void 0:_d.col)??null,component:((_e=args.source)==null?void 0:_e.component)??null,type:args.type||null,annotatedElementText:args.annotatedElementText||null,priority:((_f=args.advanced)==null?void 0:_f.priority)||void 0,tags,...args.boardId?{boardId:args.boardId}:{}}}function submitTask(selector,cssSelector,title,description,status,source,type,annotatedElementText,advanced){let apiUrl=PROTO_CONFIG.apiUrl,allowedOrigin=location.origin,fetchUrl=apiUrl;try{let parsed=new URL(apiUrl);if(parsed.protocol!=="http:"&&parsed.protocol!=="https:")throw new Error(" blocked protocol");fetchUrl=parsed.href}catch{fetchUrl=new URL(apiUrl,allowedOrigin).href}return fetch(fetchUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(buildTaskPayload({selector,cssSelector,title,description,status,source,type,annotatedElementText,advanced,boardId:PROTO_CONFIG.boardId}))}).then(r=>r.json()).then(d=>{var _a,_b;return d.success&&fetchTasks(),{success:d.success===!0,taskId:(_a=d.task)==null?void 0:_a.id,taskAuthor:(_b=d.task)==null?void 0:_b.author}}).catch(err=>(console.error("[Vibeflow Studio]",err),{success:!1}))}var PAGES_URL=PROTO_CONFIG.pagesUrl;function fetchPages(){PAGES_URL&&fetch(PAGES_URL).then(r=>r.json()).then(d=>{state.pages=d.pages??[],renderPageSwitcher()}).catch(()=>{})}function renderPageSwitcher(){if(state.pageSwitcher&&(state.pageSwitcher.remove(),state.pageSwitcher=null),!state.root||state.pages.length<2)return;let currentPath=location.pathname,switcher=el("div",{className:"vibeflow-page-switcher"});switcher.appendChild(el("span",{className:"page-switcher-label"},"Pages:"));for(let page of state.pages){let tab=el("a",{className:"page-tab"+(page===currentPath||currentPath==="/"&&page==="/index.html"?" active":""),href:page},page.replace(/^\\//,"").replace(/\\.html$/,""));switcher.appendChild(tab)}state.root.appendChild(switcher),state.pageSwitcher=switcher}var STABLE_DATA_ATTRS=["data-testid","data-test","data-cy","data-test-id","data-id"];function buildCssSelector(element){let parts=[],node=element,depth=0;for(;node&&node!==document.body&&depth<6;){let semId=getSemanticId(node);if(semId){parts.unshift(\`#\${semId}\`);break}let anchorAttr=null,anchorName=null;for(let attr of STABLE_DATA_ATTRS){let val=node.getAttribute(attr);if(val){anchorAttr=attr,anchorName=val;break}}if(anchorAttr&&anchorName){parts.unshift(\`[\${anchorAttr}="\${anchorName}"]\`);break}let segment=node.tagName.toLowerCase(),stableClasses=Array.from(node.classList).filter(c=>!/^[0-9a-f]{5,}/.test(c)&&!c.startsWith("vibeflow-")).slice(0,2);stableClasses.length>0&&(segment+=\`.\${stableClasses.join(".")}\`);let parent=node.parentElement;if(parent){let parentChildren=Array.from(parent.children);parentChildren.filter(c=>c.tagName===node.tagName).length>1&&(segment+=\`:nth-child(\${parentChildren.indexOf(node)+1})\`)}parts.unshift(segment),node=node.parentElement,depth++}return parts.join(" > ")}function resolveTestId(el2){let attrs=STABLE_DATA_ATTRS,node=el2;for(;node&&node!==document.body;){for(let attr of attrs){let val=node.getAttribute(attr);if(val)return{attr,value:val}}let id=node.getAttribute("id");if(id&&isSemanticId(id))return{attr:"id",value:id};node=node.parentElement}return null}function isSemanticId(id){return!/^[0-9a-f-]{8,}$/i.test(id)&&!/^\\d+$/.test(id)}function getSemanticId(el2){let id=el2.getAttribute("id");return id&&isSemanticId(id)?id:null}function parseComponentFromReactStack(stack){let SKIP=/^(react-stack|jsxDEV|renderWith|Object\\.|_callee)/i;for(let line of stack.split(\`
1599
1603
  \`)){let m=line.match(/^\\s*at\\s+([A-Z][A-Za-z0-9._$]*)\\s+\\(/);if(m&&!SKIP.test(m[1]))return m[1]}return null}function parseFunctionFromReactStack(stack){let SKIP=/^(react-stack|jsxDEV|renderWith|Object\\.|_callee)/i;for(let line of stack.split(\`
1600
1604
  \`)){let m=line.match(/^\\s*at\\s+([A-Za-z_$][A-Za-z0-9._$]*)\\s+\\(/);if(m&&!SKIP.test(m[1]))return m[1]}return null}function getReactSource(el2){var _a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_p,_q,_r,_s;let fiberKey=Object.keys(el2).find(k=>k.startsWith("__reactFiber")||k.startsWith("__reactInternalInstance"));if(!fiberKey)return null;let fiber=el2[fiberKey],result={},nearestComponent,parentComponent,depth=0;for(;fiber&&depth<20;){if(fiber._debugSource&&!result.file&&(result.file=fiber._debugSource.fileName,result.line=fiber._debugSource.lineNumber,result.col=fiber._debugSource.columnNumber),!result.component){let ownerName=((_b=(_a=fiber._debugOwner)==null?void 0:_a.type)==null?void 0:_b.displayName)??((_d=(_c=fiber._debugOwner)==null?void 0:_c.type)==null?void 0:_d.name);ownerName&&!nearestComponent&&(nearestComponent=ownerName);let ownerParentName=((_h=(_g=(_f=(_e=fiber._debugOwner)==null?void 0:_e.return)==null?void 0:_f._debugOwner)==null?void 0:_g.type)==null?void 0:_h.displayName)??((_l=(_k=(_j=(_i=fiber._debugOwner)==null?void 0:_i.return)==null?void 0:_j._debugOwner)==null?void 0:_k.type)==null?void 0:_l.name)??((_o=(_n=(_m=fiber._debugOwner)==null?void 0:_m._debugOwner)==null?void 0:_n.type)==null?void 0:_o.displayName)??((_r=(_q=(_p=fiber._debugOwner)==null?void 0:_p._debugOwner)==null?void 0:_q.type)==null?void 0:_r.name);ownerParentName&&ownerParentName!==ownerName&&!parentComponent&&(parentComponent=ownerParentName)}if(!result.component){let stack=(_s=fiber._debugStack)==null?void 0:_s.stack;if(stack){let name=parseComponentFromReactStack(stack);name&&!nearestComponent&&(nearestComponent=name);let functionName=parseFunctionFromReactStack(stack);functionName&&(result.functionName=functionName)}}if((result.file||result.component)&&depth>0)break;fiber=fiber.return,depth++}return nearestComponent&&(result.component=parentComponent?\`\${parentComponent} > \${nearestComponent}\`:nearestComponent),result.file!=null||result.component!=null?result:null}function getVue3Source(el2){var _a,_b,_c;let node=el2;for(;node;){let instance=node.__vueParentComponent;if(instance)return{file:((_a=instance.type)==null?void 0:_a.__file)??void 0,component:((_b=instance.type)==null?void 0:_b.name)??((_c=instance.type)==null?void 0:_c.__name)??void 0};node=node.parentElement}return null}function getVue2Source(el2){var _a,_b;let node=el2;for(;node;){let vm=node.__vue__;if(vm)return{file:((_a=vm.$options)==null?void 0:_a.__file)??void 0,component:((_b=vm.$options)==null?void 0:_b.name)??void 0};node=node.parentElement}return null}function getAngularSource(el2){var _a;let ng=window.ng;if(!ng)return null;let node=el2;for(;node;){try{let component=ng.getComponent(node);if(component)return{component:((_a=component.constructor)==null?void 0:_a.name)??void 0}}catch{}node=node.parentElement}return null}function getPreactSource(el2){var _a,_b,_c,_d;let e=el2,children=((_a=e.__P)==null?void 0:_a.__k)??[],GENERIC_NAMES=new Set(["Object","VNode","VNode2"]);for(let vnode of children){if(!vnode||typeof vnode!="object")continue;let v=vnode,typeNameRaw2=(_b=v==null?void 0:v.type)==null?void 0:_b.name,ctorNameRaw=(_c=v==null?void 0:v.constructor)==null?void 0:_c.name,ctorName=ctorNameRaw&&!GENERIC_NAMES.has(ctorNameRaw)?ctorNameRaw:void 0,name=typeNameRaw2??ctorName??void 0;if(name)return{component:name}}let attrNode=e.__preactattr__;if(!attrNode)return null;let typeNameRaw=(_d=attrNode==null?void 0:attrNode.type)==null?void 0:_d.name;return typeNameRaw?{component:typeNameRaw}:null}function resolveFrameworkSource(el2){return getReactSource(el2)??getVue3Source(el2)??getVue2Source(el2)??getAngularSource(el2)??getPreactSource(el2)}function buildSourcePointer(element){let cssSelector=buildCssSelector(element),pointer={selector:cssSelector,display:cssSelector},tier1=resolveFrameworkSource(element);tier1&&(tier1.file!=null&&(pointer.file=tier1.file),tier1.line!=null&&(pointer.line=tier1.line),tier1.col!=null&&(pointer.col=tier1.col),tier1.component!=null&&(pointer.component=tier1.component),tier1.functionName!=null&&(pointer.functionName=tier1.functionName));let protoId=element.getAttribute("data-vibeflow-id");if(protoId)return pointer.selector=\`[data-vibeflow-id="\${protoId}"]\`,pointer.display=protoId,pointer;let testIdResult=resolveTestId(element);if(testIdResult&&(pointer.test_id=testIdResult.value),pointer.file){let fileName=pointer.file.replace(/\\\\/g,"/").split("/").pop()??pointer.file;pointer.selector=pointer.line==null?pointer.file:\`\${pointer.file}:\${pointer.line}\`,pointer.display=pointer.line==null?fileName:\`\${fileName}:\${pointer.line}\`}else pointer.component?(pointer.selector=pointer.component,pointer.display=pointer.component):pointer.functionName?(pointer.selector=pointer.functionName,pointer.display=pointer.functionName):testIdResult&&(pointer.selector=testIdResult.attr==="id"?\`#\${testIdResult.value}\`:\`[\${testIdResult.attr}="\${testIdResult.value}"]\`,pointer.display=\`\${testIdResult.attr}:\${testIdResult.value}\`);return pointer}var VLQ_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",VLQ_TABLE={};for(let i=0;i<VLQ_CHARS.length;i++)VLQ_TABLE[VLQ_CHARS.charCodeAt(i)]=i;function vlqDecodeInt(s,pos){let result=0,shift=0,byte=0;do byte=VLQ_TABLE[s.charCodeAt(pos++)]??0,result|=(byte&31)<<shift,shift+=5;while(byte&32);return[result&1?-(result>>1):result>>1,pos]}function vlqDecodeSegment(seg){let out=[],pos=0;for(;pos<seg.length;){let[n,next]=vlqDecodeInt(seg,pos);out.push(n),pos=next}return out}function findFlatMapping(map,genLine,genCol){if(!map.mappings||!map.sources)return null;let lines=map.mappings.split(";"),srcIdx=0,srcLine=0,srcCol=0,best=null;for(let i=0;i<lines.length;i++){let genColAcc=0;for(let seg of lines[i].split(",")){if(!seg)continue;let d=vlqDecodeSegment(seg);if(!(d.length<1)&&(genColAcc+=d[0],d.length>=4&&(srcIdx+=d[1],srcLine+=d[2],srcCol+=d[3],i===genLine&&genColAcc<=genCol&&(best={source:map.sources[srcIdx]??"",line:srcLine+1,col:srcCol+1}),i===genLine&&genColAcc>genCol)))break}if(i>genLine)break}return best}function resolveInMap(map,genLine,genCol){if(map.sections){let best=null;for(let s of map.sections)(s.offset.line<genLine||s.offset.line===genLine&&s.offset.column<=genCol)&&(best=s);if(!best)return null;let relLine=genLine-best.offset.line,relCol=relLine===0?genCol-best.offset.column:genCol;return resolveInMap(best.map,relLine,relCol)}return findFlatMapping(map,genLine,genCol)}var smCache=new Map;function fetchSourceMap(chunkUrl){let p=smCache.get(chunkUrl);return p||(p=fetch(\`\${chunkUrl}.map\`).then(r=>r.ok?r.json():null).catch(()=>null),smCache.set(chunkUrl,p)),p}var SKIP_FRAME_RE=/node_modules|_next\\/dist|react-stack-top-frame|jsxDEV|react_stack_bottom_frame|fakeJSXCallSite|initializeElement/;function parseUserFrame(stack){for(let line of stack.split(\`
1601
1605
  \`)){let m=line.match(/at [^(]+ \\((https?:\\/\\/[^)]+):(\\d+):(\\d+)\\)/);if(!m)continue;let[,url,lineStr,colStr]=m;if(!SKIP_FRAME_RE.test(url))return{chunkUrl:url,line:parseInt(lineStr,10),col:parseInt(colStr,10)}}return null}function getDebugStackStr(el2){var _a;let fiberKey=Object.keys(el2).find(k=>k.startsWith("__reactFiber")||k.startsWith("__reactInternalInstance"));if(!fiberKey)return null;let fiber=el2[fiberKey];return((_a=fiber==null?void 0:fiber._debugStack)==null?void 0:_a.stack)??null}function cleanSourcePath(raw){return raw.replace(/\\?.*$/,"").replace(/^https?:\\/\\/[^/]+\\/@fs/,"").replace(/^https?:\\/\\/[^/]+/,"").replace(/^file:\\/\\/\\/app\\//,"").replace(/^file:\\/\\/\\//,"").replace(/\\[project\\]\\//g,"").replace(/%28/g,"(").replace(/%29/g,")").replace(/%20/g," ")}var DIRECT_SRC_EXT_RE=/\\.m?[tj]sx?(\\?[^)]*)?$/,BUNDLE_CHUNK_RE=/chunk[-_.][0-9a-f]{6,}|\\.chunk\\.[0-9a-f]|webpack|_next\\/(?:static\\/chunks|dist)|rollup/i;function isDirectSourceUrl(url){return!(!url||!DIRECT_SRC_EXT_RE.test(url)||BUNDLE_CHUNK_RE.test(url)||SKIP_FRAME_RE.test(url))}function captureV8CallSites(err){if(typeof Error.captureStackTrace!="function")return null;let prev=Error.prepareStackTrace,captured=null;try{Error.prepareStackTrace=(_,sites)=>(captured=sites,sites.map(s=>\` at \${s.getFunctionName()??"<anonymous>"} (\${s.getFileName()}:\${s.getLineNumber()}:\${s.getColumnNumber()})\`).join(\`
1602
1606
  \`)),err.stack}finally{Error.prepareStackTrace=prev}return captured}function getDebugStackError(el2){let fiberKey=Object.keys(el2).find(k=>k.startsWith("__reactFiber")||k.startsWith("__reactInternalInstance"));if(!fiberKey)return null;let fiber=el2[fiberKey],ds=fiber==null?void 0:fiber._debugStack;return ds instanceof Error?ds:null}function resolveDirectSourceFromStack(el2){var _a,_b,_c,_d;let stackErr=getDebugStackError(el2);if(!stackErr)return null;let callSites=captureV8CallSites(stackErr);if(callSites)for(let site of callSites){let fileName=((_a=site.getFileName)==null?void 0:_a.call(site))??null;if(!(!fileName||SKIP_FRAME_RE.test(fileName))&&isDirectSourceUrl(fileName))return{file:cleanSourcePath(fileName),line:((_b=site.getLineNumber)==null?void 0:_b.call(site))??1,col:((_c=site.getColumnNumber)==null?void 0:_c.call(site))??1,fnName:((_d=site.getFunctionName)==null?void 0:_d.call(site))??void 0}}let stack=typeof stackErr.stack=="string"?stackErr.stack:null;if(!stack)return null;for(let raw of stack.split(\`
1603
1607
  \`)){let m=raw.match(/^\\s*at [^(]+ \\(([^)]+):(\\d+):(\\d+)\\)$/)??raw.match(/^\\s*at ((?:https?|file):\\/\\/[^:]+):(\\d+):(\\d+)$/);if(!m)continue;let[,url,lineStr,colStr]=m;if(isDirectSourceUrl(url)&&!SKIP_FRAME_RE.test(url))return{file:cleanSourcePath(url),line:parseInt(lineStr,10),col:parseInt(colStr,10)}}return null}async function resolveSourceFromStack(el2){let stack=getDebugStackStr(el2);if(!stack)return null;let frame=parseUserFrame(stack);if(!frame)return null;let map=await fetchSourceMap(frame.chunkUrl);if(!map)return null;let mapped=resolveInMap(map,frame.line-1,frame.col-1);return mapped?{file:cleanSourcePath(mapped.source),line:mapped.line,col:mapped.col}:null}async function buildSourcePointerAsync(element){let pointer=buildSourcePointer(element);if(pointer.file)return pointer;let direct=resolveDirectSourceFromStack(element);if(direct){pointer.file=direct.file,pointer.line=direct.line,pointer.col=direct.col;let fileName2=direct.file.replace(/\\\\/g,"/").split("/").pop()??direct.file;return pointer.selector=\`\${direct.file}:\${direct.line}\`,pointer.display=\`\${fileName2}:\${direct.line}\`,pointer}let resolved=await resolveSourceFromStack(element);if(!resolved)return pointer;pointer.file=resolved.file,pointer.line=resolved.line,pointer.col=resolved.col;let fileName=resolved.file.replace(/\\\\/g,"/").split("/").pop()??resolved.file;return pointer.selector=\`\${resolved.file}:\${resolved.line}\`,pointer.display=\`\${fileName}:\${resolved.line}\`,pointer}var import_react23=__toESM(require_react(),1);var import_jsx_runtime=__toESM(require_jsx_runtime(),1);var import_react3=__toESM(require_react(),1);var import_react2=__toESM(require_react());var toKebabCase=string=>string.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mergeClasses=(...classes)=>classes.filter((className,index,array)=>!!className&&className.trim()!==""&&array.indexOf(className)===index).join(" ").trim();var import_react=__toESM(require_react());var defaultAttributes={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 Icon=(0,import_react.forwardRef)(({color="currentColor",size=24,strokeWidth=2,absoluteStrokeWidth,className="",children,iconNode,...rest},ref)=>(0,import_react.createElement)("svg",{ref,...defaultAttributes,width:size,height:size,stroke:color,strokeWidth:absoluteStrokeWidth?Number(strokeWidth)*24/Number(size):strokeWidth,className:mergeClasses("lucide",className),...rest},[...iconNode.map(([tag,attrs])=>(0,import_react.createElement)(tag,attrs)),...Array.isArray(children)?children:[children]]));var createLucideIcon=(iconName,iconNode)=>{let Component=(0,import_react2.forwardRef)(({className,...props},ref)=>(0,import_react2.createElement)(Icon,{ref,iconNode,className:mergeClasses(\`lucide-\${toKebabCase(iconName)}\`,className),...props}));return Component.displayName=\`\${iconName}\`,Component};var CircleCheckBig=createLucideIcon("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 Eye=createLucideIcon("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 Lock=createLucideIcon("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 MessageCircle=createLucideIcon("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var Paperclip=createLucideIcon("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 import_jsx_runtime2=__toESM(require_jsx_runtime(),1),TYPE_BADGE_STYLES={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 TypeBadge({type,style}){let effectiveType=typeof type=="string"&&type.trim()&&type!=="[object Object]"&&TYPE_BADGE_STYLES[type]?type:"Task",colors=TYPE_BADGE_STYLES[effectiveType];return(0,import_jsx_runtime2.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:colors.background,color:colors.color,border:\`1px solid \${colors.border}\`,lineHeight:"1.5",...style},children:effectiveType})}var import_jsx_runtime3=__toESM(require_jsx_runtime(),1),PRIORITY_BADGE_STYLES={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 PriorityBadge({priority,style}){if(!priority||!PRIORITY_BADGE_STYLES[priority])return null;let colors=PRIORITY_BADGE_STYLES[priority];return(0,import_jsx_runtime3.jsx)("span",{style:{fontSize:9,fontWeight:700,letterSpacing:"0.04em",padding:"1px 5px",borderRadius:3,flexShrink:0,textTransform:"uppercase",background:colors.background,color:colors.color,border:\`1px solid \${colors.border}\`,lineHeight:"1.5",...style},children:priority})}var import_jsx_runtime4=__toESM(require_jsx_runtime(),1);var import_jsx_runtime5=__toESM(require_jsx_runtime(),1);var import_react6=__toESM(require_react(),1);var import_react4=__toESM(require_react(),1);var TASK_TYPES=[{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."}],TASK_TYPE_VALUES=TASK_TYPES.map(t=>t.value),TASK_TYPE_ICONS=Object.fromEntries(TASK_TYPES.map(t=>[t.value,t.icon])),TASK_TYPE_CSS=Object.fromEntries(TASK_TYPES.map(t=>[t.value,t.css])),TASK_TYPE_COLORS={Task:"#94a3b8",Bug:"#ef4444",Research:"#a855f7"};function getTaskTypeIcon(type){return TASK_TYPE_ICONS[type??"Task"]??"\\u2611"}function getTaskTypeColor(type){return TASK_TYPE_COLORS[type??"Task"]??TASK_TYPE_COLORS.Task}var import_jsx_runtime6=__toESM(require_jsx_runtime(),1);function TypePicker({id,value,onChange,disabled}){let[open,setOpen]=import_react4.default.useState(!1),rootRef=import_react4.default.useRef(null),current=TASK_TYPES.find(t=>t.value===value)??TASK_TYPES[0];return import_react4.default.useEffect(()=>{let handler=e=>{var _a;(_a=rootRef.current)!=null&&_a.contains(e.target)||setOpen(!1)};return document.addEventListener("click",handler),()=>document.removeEventListener("click",handler)},[]),(0,import_jsx_runtime6.jsxs)("div",{id,ref:rootRef,style:{position:"relative",display:"inline-block"},children:[(0,import_jsx_runtime6.jsxs)("button",{type:"button",title:current==null?void 0:current.tooltip,onClick:e=>{e.preventDefault(),disabled||setOpen(o=>!o)},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,import_jsx_runtime6.jsx)("span",{style:{fontSize:13},children:current==null?void 0:current.icon}),(0,import_jsx_runtime6.jsx)("span",{children:current==null?void 0:current.label})]}),open&&(0,import_jsx_runtime6.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:TASK_TYPES.map(t=>(0,import_jsx_runtime6.jsxs)("button",{type:"button",title:t.tooltip,onClick:()=>{onChange(t.value),setOpen(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",border:"none",background:t.value===value?"var(--p-hover, rgba(255,255,255,0.06))":"transparent",color:t.value===value?"var(--p-text, #fff)":"var(--p-text-f, rgba(255,255,255,0.55))",fontSize:12,cursor:"pointer",textAlign:"left"},children:[(0,import_jsx_runtime6.jsx)("span",{style:{fontSize:14,lineHeight:1},children:t.icon}),(0,import_jsx_runtime6.jsx)("span",{children:t.label})]},t.value))})]})}var import_react5=__toESM(require_react(),1);function splitTableCells(row){return row.trim().replace(/^\\|/,"").replace(/\\|$/,"").split("|").map(cell=>cell.trim())}function isTableDivider(line){return/^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(line)}function renderTables(markdown){let lines=markdown.split(\`
1604
1608
  \`),out=[],i=0;for(;i<lines.length;){let headerLine=lines[i]??"",dividerLine=lines[i+1]??"";if(headerLine.includes("|")&&isTableDivider(dividerLine)){let headerCells=splitTableCells(headerLine),bodyRows=[];for(i+=2;i<lines.length&&lines[i].includes("|")&&lines[i].trim()!=="";)bodyRows.push(splitTableCells(lines[i])),i+=1;let headHtml=\`<tr>\${headerCells.map(cell=>\`<th style="text-align:left;padding:7px 10px;border:1px solid #334155;color:#e2e8f0;background:#0f172a;">\${cell}</th>\`).join("")}</tr>\`,bodyHtml=bodyRows.map(row=>\`<tr>\${row.map(cell=>\`<td style="padding:7px 10px;border:1px solid #334155;color:#cbd5e1;vertical-align:top;">\${cell}</td>\`).join("")}</tr>\`).join("");out.push(\`<div style="overflow-x:auto;margin:0.65em 0;"><table style="border-collapse:collapse;min-width:360px;width:100%;font-size:12px;"><thead>\${headHtml}</thead><tbody>\${bodyHtml}</tbody></table></div>\`);continue}out.push(lines[i]),i+=1}return out.join(\`
1605
- \`)}function renderMarkdown(md){if(!md)return'<span style="color:#475569;font-style:italic;">No description yet</span>';let escaped=md.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return renderTables(escaped).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,m=>\`<ul style="padding-left:1.5em;margin:0.4em 0;list-style-type:disc;">\${m}</ul>\`).replace(/^(?!<[a-z]|$).+$/gm,line=>\`<p style="margin:0.5em 0;">\${line}</p>\`)}var import_jsx_runtime7=__toESM(require_jsx_runtime(),1);function MarkdownPreview({markdown,className,style}){let rootRef=import_react5.default.useRef(null),cacheRef=import_react5.default.useRef({}),[hoverPreview,setHoverPreview]=import_react5.default.useState(null);return import_react5.default.useEffect(()=>{let root=rootRef.current;if(!root)return;function clearPreview(){setHoverPreview(null)}async function handleOver(ev){let target=ev.target,link=target==null?void 0:target.closest("a[data-task-ref]");if(!link){clearPreview();return}ev.preventDefault();let id=link.getAttribute("data-task-ref");if(!id)return;let rect=link.getBoundingClientRect(),cached=cacheRef.current[id];if(cached){setHoverPreview({id,title:cached.title,status:cached.status,x:rect.left,y:rect.bottom+6});return}try{let data=await(await fetch(\`/api/tasks/\${id}\`)).json(),info={title:data.title??\`Task \${id}\`,status:data.status??"unknown"};cacheRef.current[id]=info,setHoverPreview({id,title:info.title,status:info.status,x:rect.left,y:rect.bottom+6})}catch{setHoverPreview({id,title:\`Task \${id}\`,status:"unknown",x:rect.left,y:rect.bottom+6})}}function handleRefClick(ev){var _a,_b;let link=(_b=(_a=ev.target)==null?void 0:_a.closest)==null?void 0:_b.call(_a,"a[data-task-ref]");if(!link)return;let refId=link.getAttribute("data-task-ref");refId&&window.dispatchEvent(new CustomEvent("vibeflow-task-ref-click",{detail:{refId}}))}return root.addEventListener("mouseover",handleOver),root.addEventListener("mouseleave",clearPreview),root.addEventListener("click",handleRefClick),()=>{root.removeEventListener("mouseover",handleOver),root.removeEventListener("mouseleave",clearPreview),root.removeEventListener("click",handleRefClick)}},[]),(0,import_jsx_runtime7.jsxs)("div",{style:{position:"relative"},children:[(0,import_jsx_runtime7.jsx)("div",{ref:rootRef,className,style,dangerouslySetInnerHTML:{__html:renderMarkdown(markdown)}}),hoverPreview&&(0,import_jsx_runtime7.jsxs)("div",{style:{position:"fixed",left:hoverPreview.x,top:hoverPreview.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,import_jsx_runtime7.jsxs)("div",{style:{color:"#60a5fa",fontFamily:"Menlo,monospace",marginBottom:3},children:["#",hoverPreview.id]}),(0,import_jsx_runtime7.jsx)("div",{style:{fontWeight:600,marginBottom:3},children:hoverPreview.title}),(0,import_jsx_runtime7.jsxs)("div",{style:{color:"#94a3b8"},children:["status: ",hoverPreview.status]})]})]})}var import_jsx_runtime8=__toESM(require_jsx_runtime(),1);var import_jsx_runtime9=__toESM(require_jsx_runtime(),1);var LS_SEEN_KEY="proto-comments-seen";function isNewComments(taskId,count){try{let raw=localStorage.getItem(LS_SEEN_KEY),seen=raw?JSON.parse(raw):{};return count>(seen[taskId]??0)}catch{return!1}}var KEY_DIGITS=16;var MAX_INT=BigInt("9".repeat(KEY_DIGITS));var import_react8=__toESM(require_react(),1);var import_react7=__toESM(require_react(),1),import_react_dom=__toESM(require_react_dom(),1);var TAG_PALETTE=[{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 hashTagName(name){let hash=0;for(let i=0;i<name.length;i++)hash=hash*31+name.charCodeAt(i)>>>0;return hash%TAG_PALETTE.length}function getTagColors(name){return TAG_PALETTE[hashTagName(name)]}var import_jsx_runtime10=__toESM(require_jsx_runtime(),1);function TagPills({tags,onRemove,size="sm"}){if(!tags.length)return null;let padding=size==="xs"?"1px 6px":"2px 7px",fontSize=size==="xs"?9:10;return(0,import_jsx_runtime10.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3,alignItems:"center"},children:tags.map(tag=>{let{bg,text,border}=getTagColors(tag);return(0,import_jsx_runtime10.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding,borderRadius:100,background:bg,border:\`1px solid \${border}\`,color:text,fontSize,fontWeight:600,whiteSpace:"nowrap"},children:[tag,onRemove&&(0,import_jsx_runtime10.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),onRemove(tag)},style:{display:"flex",background:"none",border:"none",color:text,cursor:"pointer",padding:0,lineHeight:1,opacity:.7},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"},children:"\\xD7"})]},tag)})})}var import_jsx_runtime11=__toESM(require_jsx_runtime(),1);function isImageFileName(name){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(name)}function withHexAlpha(hexColor,alpha){if(!/^#[0-9a-fA-F]{6}$/.test(hexColor))return;let normalized=Math.max(0,Math.min(1,alpha)),alphaHex=Math.round(normalized*255).toString(16).padStart(2,"0");return\`\${hexColor}\${alphaHex}\`}function resolveTaskCardBorderColor(statusColor,priority){return withHexAlpha(statusColor,priority==="Critical"?.36:priority==="High"?.3:.24)??"color-mix(in srgb, var(--p-text-g) 40%, transparent)"}function resolveTaskCardBgColor(typeColor){return withHexAlpha(typeColor,.1)??"transparent"}var DONE_ARTICLE_STYLE={padding:"7px 8px",gap:4,opacity:1,userSelect:"none"},DONE_INNER_ROW_STYLE={display:"flex",alignItems:"center",gap:5},DONE_CHECK_ICON_STYLE={width:12,height:12,color:"color-mix(in srgb, var(--p-green) 55%, transparent)",flexShrink:0},DONE_TITLE_STYLE={fontSize:11.5,fontWeight:600,color:"var(--p-text-m)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},VERIFIED_BADGE_STYLE={fontSize:9,fontWeight:700,color:"#22c55e",background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.3)",borderRadius:4,padding:"1px 5px",marginLeft:6,flexShrink:0,letterSpacing:.5},CARD_TITLE_ROW_STYLE={display:"flex",alignItems:"center",gap:5,minWidth:0},SPINNER_SHRINK_STYLE={flexShrink:0},CARD_TITLE_TEXT_STYLE={fontSize:11.5,fontWeight:600,color:"var(--p-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},DESC_THUMB_ROW_STYLE={display:"flex",alignItems:"flex-start",gap:8},DESC_TEXT_STYLE={fontSize:10,color:"var(--p-text-g)",lineHeight:"1.45",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,flex:1,minWidth:0},THUMB_WRAPPER_STYLE={position:"relative",flexShrink:0},THUMB_IMG_STYLE={width:52,height:34,borderRadius:6,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 90%, transparent)",display:"block",cursor:"pointer"},CARD_FOOTER_STYLE={display:"flex",alignItems:"center",gap:2,marginTop:1},SPACER_STYLE={flex:1},TaskCard=import_react7.default.memo(function({task,col,liveActivity,onOpen,onDragStart}){var _a;let isInProgress=col.id==="in-progress",isDone=col.id==="done",[showThumbPreview,setShowThumbPreview]=import_react7.default.useState(!1),[thumbRect,setThumbRect]=import_react7.default.useState(null),thumbRef=import_react7.default.useRef(null),commentCount=task.commentCount??0,fileCount=task.fileCount??0,hasNewComments=commentCount>0&&isNewComments(task.id,commentCount),cardBorderColor=resolveTaskCardBorderColor(col.color,task.priority),typeColor=getTaskTypeColor(task.type),cardBgColor=resolveTaskCardBgColor(typeColor),firstImage=(_a=task.files)==null?void 0:_a.find(f=>isImageFileName(f.name)),thumbnailUrl=firstImage?\`/api/tasks/\${task.id}/files/\${encodeURIComponent(firstImage.name)}\`:null;function handleDragStart(e){onDragStart(e,task.id),e.currentTarget.classList.add("dragging")}function handleDragEnd(e){e.currentTarget.classList.remove("dragging")}function handleClick(){onOpen(task)}return isDone?(0,import_jsx_runtime11.jsx)("article",{className:"task-card",draggable:!0,"data-task-id":task.id,style:{...DONE_ARTICLE_STYLE},onDragStart:handleDragStart,onDragEnd:handleDragEnd,onClick:handleClick,children:(0,import_jsx_runtime11.jsxs)("div",{style:DONE_INNER_ROW_STYLE,children:[(0,import_jsx_runtime11.jsx)(CircleCheckBig,{style:DONE_CHECK_ICON_STYLE}),(0,import_jsx_runtime11.jsx)("span",{style:DONE_TITLE_STYLE,children:task.title}),task.verified&&(0,import_jsx_runtime11.jsx)("span",{style:VERIFIED_BADGE_STYLE,children:"\\u2713 VERIFIED"})]})}):(0,import_jsx_runtime11.jsxs)("article",{className:\`task-card\${liveActivity?" task-live-edit":""}\`,draggable:!0,"data-task-id":task.id,style:{padding:"7px 8px",gap:4,userSelect:"none",background:liveActivity?"rgba(59,130,246,0.08)":cardBgColor,border:liveActivity?"1px solid rgba(59,130,246,0.5)":cardBorderColor?\`1px solid \${cardBorderColor}\`:void 0,...liveActivity?{boxShadow:"0 0 0 2px rgba(59,130,246,0.14)"}:{}},onDragStart:handleDragStart,onDragEnd:handleDragEnd,onClick:handleClick,children:[(0,import_jsx_runtime11.jsxs)("div",{style:CARD_TITLE_ROW_STYLE,children:[isInProgress&&(0,import_jsx_runtime11.jsx)("span",{className:"spinner",style:SPINNER_SHRINK_STYLE}),(0,import_jsx_runtime11.jsx)("span",{style:CARD_TITLE_TEXT_STYLE,children:task.title})]}),(task.description||thumbnailUrl)&&(0,import_jsx_runtime11.jsxs)("div",{style:DESC_THUMB_ROW_STYLE,children:[task.description&&(0,import_jsx_runtime11.jsx)("div",{style:DESC_TEXT_STYLE,children:task.description}),thumbnailUrl&&(0,import_jsx_runtime11.jsxs)("div",{style:THUMB_WRAPPER_STYLE,onMouseEnter:()=>{if(thumbRef.current){let r=thumbRef.current.getBoundingClientRect();setThumbRect({top:r.top,right:r.right})}setShowThumbPreview(!0)},onMouseLeave:()=>{setShowThumbPreview(!1),setThumbRect(null)},children:[(0,import_jsx_runtime11.jsx)("img",{ref:thumbRef,src:thumbnailUrl,alt:"Task screenshot","data-role":"task-thumb",style:THUMB_IMG_STYLE}),showThumbPreview&&thumbRect&&import_react_dom.default.createPortal((0,import_jsx_runtime11.jsx)("img",{src:thumbnailUrl,alt:"Task screenshot enlarged preview","data-role":"task-thumb-preview",style:{position:"fixed",right:window.innerWidth-thumbRect.right,bottom:window.innerHeight-thumbRect.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,import_jsx_runtime11.jsxs)("div",{className:"flex items-center",style:CARD_FOOTER_STYLE,children:[(0,import_jsx_runtime11.jsx)(TypeBadge,{type:task.type}),task.priority&&(0,import_jsx_runtime11.jsx)(PriorityBadge,{priority:task.priority}),isInProgress&&task.assigneeName&&(0,import_jsx_runtime11.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:task.assigneeName}),task.tags&&task.tags.length>0&&(0,import_jsx_runtime11.jsx)(TagPills,{tags:task.tags,size:"xs"}),(0,import_jsx_runtime11.jsx)("div",{style:SPACER_STYLE}),liveActivity&&(0,import_jsx_runtime11.jsx)(LiveActivityBadge,{activity:liveActivity}),(0,import_jsx_runtime11.jsx)(CardIconButton,{icon:(0,import_jsx_runtime11.jsx)(MessageCircle,{style:{width:9,height:9}}),label:commentCount>0?String(commentCount):"",color:hasNewComments?"var(--p-purple)":commentCount>0?"var(--p-text-m)":"var(--p-border-t)",hoverColor:hasNewComments?"var(--p-purple-300)":"var(--p-text)",title:commentCount>0?\`\${commentCount} comment(s)\`:"Add comment",badge:hasNewComments,badgeColor:"var(--p-purple)",onClick:e=>{e.stopPropagation(),onOpen(task,"comments")}}),(0,import_jsx_runtime11.jsx)(CardIconButton,{icon:(0,import_jsx_runtime11.jsx)(Paperclip,{style:{width:9,height:9}}),label:fileCount>0?String(fileCount):"",color:fileCount>0?"var(--p-blue-300)":"var(--p-border-t)",hoverColor:fileCount>0?"var(--p-cyan-300)":"var(--p-text-sub)",title:fileCount>0?\`\${fileCount} file(s) attached\`:"Files",onClick:e=>{e.stopPropagation(),onOpen(task,"files")}})]})]})});function CardIconButton({icon,label,color,hoverColor,title,badge,badgeColor,onClick}){let[hovered,setHovered]=import_react7.default.useState(!1);return(0,import_jsx_runtime11.jsxs)("button",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 3px",borderRadius:3,border:"none",background:hovered?"color-mix(in srgb, var(--p-text-m) 10%, transparent)":"transparent",cursor:"pointer",fontSize:9,color:hovered?hoverColor:color,transition:"color .1s, background .1s"},title,onMouseEnter:()=>setHovered(!0),onMouseLeave:()=>setHovered(!1),onClick,children:[icon,label&&(0,import_jsx_runtime11.jsx)("span",{children:label}),badge&&(0,import_jsx_runtime11.jsx)("span",{style:{width:4,height:4,background:badgeColor??color,borderRadius:"50%",flexShrink:0}})]})}function LiveActivityBadge({activity}){let isLocked=activity.state==="locked"||activity.state==="editing",icon=isLocked?(0,import_jsx_runtime11.jsx)(Lock,{style:{width:8,height:8}}):(0,import_jsx_runtime11.jsx)(Eye,{style:{width:8,height:8}}),label=isLocked?\`Locked by \${activity.user}\`:\`\${activity.user} viewing\`;return(0,import_jsx_runtime11.jsxs)("span",{style:isLocked?{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:label,"data-testid":"live-activity-badge",children:[icon,(0,import_jsx_runtime11.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:"1 1 0"},children:activity.user})]})}var import_jsx_runtime12=__toESM(require_jsx_runtime(),1);var import_react9=__toESM(require_react(),1);var import_jsx_runtime13=__toESM(require_jsx_runtime(),1);var import_react10=__toESM(require_react(),1);var import_jsx_runtime14=__toESM(require_jsx_runtime(),1);var import_jsx_runtime15=__toESM(require_jsx_runtime(),1);var import_react19=__toESM(require_react(),1);var import_react14=__toESM(require_react(),1);var import_react11=__toESM(require_react(),1),import_jsx_runtime16=__toESM(require_jsx_runtime(),1),AutoExpandTextarea=import_react11.default.forwardRef(function({value,onChange,baseRows=4,maxRows,style,...rest},forwardedRef){let localRef=import_react11.default.useRef(null),resolvedMaxRows=maxRows??baseRows*2,resize=import_react11.default.useCallback(()=>{let el2=localRef.current;if(!el2)return;el2.style.height="auto";let computed=window.getComputedStyle(el2),lineHeight=Number.parseFloat(computed.lineHeight||"0")||18,verticalPadding=Number.parseFloat(computed.paddingTop||"0")+Number.parseFloat(computed.paddingBottom||"0"),border=Number.parseFloat(computed.borderTopWidth||"0")+Number.parseFloat(computed.borderBottomWidth||"0"),minHeight=baseRows*lineHeight+verticalPadding+border,maxHeight=resolvedMaxRows*lineHeight+verticalPadding+border,target=Math.max(minHeight,Math.min(el2.scrollHeight,maxHeight));el2.style.height=\`\${target}px\`,el2.style.overflowY=el2.scrollHeight>maxHeight?"auto":"hidden"},[baseRows,resolvedMaxRows]);return import_react11.default.useLayoutEffect(()=>{resize()},[value,resize]),(0,import_jsx_runtime16.jsx)("textarea",{...rest,ref:el2=>{localRef.current=el2,typeof forwardedRef=="function"?forwardedRef(el2):forwardedRef&&(forwardedRef.current=el2)},rows:baseRows,value,onChange:e=>onChange(e.target.value),style:{...style,resize:"none"}})});var import_react13=__toESM(require_react(),1);var import_react12=__toESM(require_react(),1),import_react_dom2=__toESM(require_react_dom(),1),import_jsx_runtime17=__toESM(require_jsx_runtime(),1);var import_jsx_runtime18=__toESM(require_jsx_runtime(),1);var import_jsx_runtime19=__toESM(require_jsx_runtime(),1);var import_jsx_runtime20=__toESM(require_jsx_runtime(),1);var import_react15=__toESM(require_react(),1);var import_jsx_runtime21=__toESM(require_jsx_runtime(),1);var import_react18=__toESM(require_react(),1);var import_react16=__toESM(require_react(),1),import_react_dom3=__toESM(require_react_dom(),1);var import_jsx_runtime22=__toESM(require_jsx_runtime(),1);var import_react17=__toESM(require_react(),1);var import_jsx_runtime23=__toESM(require_jsx_runtime(),1);var import_jsx_runtime24=__toESM(require_jsx_runtime(),1);var import_jsx_runtime25=__toESM(require_jsx_runtime(),1);var import_jsx_runtime26=__toESM(require_jsx_runtime(),1);var MAX_UPLOAD_BYTES=5*1024*1024;var import_react20=__toESM(require_react(),1);var import_jsx_runtime27=__toESM(require_jsx_runtime(),1);var import_react21=__toESM(require_react(),1);var import_jsx_runtime28=__toESM(require_jsx_runtime(),1);var import_react22=__toESM(require_react(),1);var import_jsx_runtime29=__toESM(require_jsx_runtime(),1);var IGNORED_PATTERNS=[/Error evaluating Node\\.js code/i,/nextjs-portal/i],buffer=[],recording=!1;function addEntry(level,args){let message=args.map(a=>{if(typeof a=="string")return a;if(a instanceof Error)return a.message;try{return JSON.stringify(a)}catch{return String(a)}}).join(" ").slice(0,500);!message||IGNORED_PATTERNS.some(pattern=>pattern.test(message))||(buffer.push({level,message,timestamp:new Date().toISOString()}),buffer.length>50&&buffer.splice(0,buffer.length-50))}function startRecording(){if(recording)return;recording=!0;let origError=console.error.bind(console);console.error=(...args)=>{addEntry("error",args),origError(...args)};let origWarn=console.warn.bind(console);console.warn=(...args)=>{addEntry("warn",args),origWarn(...args)},window.addEventListener("error",e=>{let loc=e.filename?\` (\${e.filename.split("/").pop()}:\${e.lineno})\`:"";addEntry("error",[\`\${e.message}\${loc}\`])}),window.addEventListener("unhandledrejection",e=>{let msg=e.reason instanceof Error?e.reason.message:String(e.reason??"Unhandled promise rejection");addEntry("error",[\`Unhandled rejection: \${msg}\`])})}function getRecordedLogs(){if(buffer.length===0)return"";let lines=buffer.map(e=>{let icon=e.level==="error"?"\\u{1F534}":"\\u{1F7E1}",time=e.timestamp.slice(11,19);return\`- \${icon} \\\`\${time}\\\` \${e.message}\`});return\`
1609
+ \`)}function renderMarkdown(md){if(!md)return'<span style="color:#475569;font-style:italic;">No description yet</span>';let escaped=md.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return renderTables(escaped).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,m=>\`<ul style="padding-left:1.5em;margin:0.4em 0;list-style-type:disc;">\${m}</ul>\`).replace(/^(?!<[a-z]|$).+$/gm,line=>\`<p style="margin:0.5em 0;">\${line}</p>\`)}var import_jsx_runtime7=__toESM(require_jsx_runtime(),1);function MarkdownPreview({markdown,className,style}){let rootRef=import_react5.default.useRef(null),cacheRef=import_react5.default.useRef({}),[hoverPreview,setHoverPreview]=import_react5.default.useState(null);return import_react5.default.useEffect(()=>{let root=rootRef.current;if(!root)return;function clearPreview(){setHoverPreview(null)}async function handleOver(ev){let target=ev.target,link=target==null?void 0:target.closest("a[data-task-ref]");if(!link){clearPreview();return}ev.preventDefault();let id=link.getAttribute("data-task-ref");if(!id)return;let rect=link.getBoundingClientRect(),cached=cacheRef.current[id];if(cached){setHoverPreview({id,title:cached.title,status:cached.status,x:rect.left,y:rect.bottom+6});return}try{let data=await(await fetch(\`/api/tasks/\${id}\`)).json(),info={title:data.title??\`Task \${id}\`,status:data.status??"unknown"};cacheRef.current[id]=info,setHoverPreview({id,title:info.title,status:info.status,x:rect.left,y:rect.bottom+6})}catch{setHoverPreview({id,title:\`Task \${id}\`,status:"unknown",x:rect.left,y:rect.bottom+6})}}function handleRefClick(ev){var _a,_b;let link=(_b=(_a=ev.target)==null?void 0:_a.closest)==null?void 0:_b.call(_a,"a[data-task-ref]");if(!link)return;let refId=link.getAttribute("data-task-ref");refId&&window.dispatchEvent(new CustomEvent("vibeflow-task-ref-click",{detail:{refId}}))}return root.addEventListener("mouseover",handleOver),root.addEventListener("mouseleave",clearPreview),root.addEventListener("click",handleRefClick),()=>{root.removeEventListener("mouseover",handleOver),root.removeEventListener("mouseleave",clearPreview),root.removeEventListener("click",handleRefClick)}},[]),(0,import_jsx_runtime7.jsxs)("div",{style:{position:"relative"},children:[(0,import_jsx_runtime7.jsx)("div",{ref:rootRef,className,style,dangerouslySetInnerHTML:{__html:renderMarkdown(markdown)}}),hoverPreview&&(0,import_jsx_runtime7.jsxs)("div",{style:{position:"fixed",left:hoverPreview.x,top:hoverPreview.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,import_jsx_runtime7.jsxs)("div",{style:{color:"#60a5fa",fontFamily:"Menlo,monospace",marginBottom:3},children:["#",hoverPreview.id]}),(0,import_jsx_runtime7.jsx)("div",{style:{fontWeight:600,marginBottom:3},children:hoverPreview.title}),(0,import_jsx_runtime7.jsxs)("div",{style:{color:"#94a3b8"},children:["status: ",hoverPreview.status]})]})]})}var import_jsx_runtime8=__toESM(require_jsx_runtime(),1);var import_jsx_runtime9=__toESM(require_jsx_runtime(),1);var LS_SEEN_KEY="proto-comments-seen";function isNewComments(taskId,count){try{let raw=localStorage.getItem(LS_SEEN_KEY),seen=raw?JSON.parse(raw):{};return count>(seen[taskId]??0)}catch{return!1}}var KEY_DIGITS=16;var MAX_INT=BigInt("9".repeat(KEY_DIGITS));var import_react8=__toESM(require_react(),1);var import_react7=__toESM(require_react(),1),import_react_dom=__toESM(require_react_dom(),1);var TAG_PALETTE=[{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 hashTagName(name){let hash=0;for(let i=0;i<name.length;i++)hash=hash*31+name.charCodeAt(i)>>>0;return hash%TAG_PALETTE.length}function getTagColors(name){return TAG_PALETTE[hashTagName(name)]}var import_jsx_runtime10=__toESM(require_jsx_runtime(),1);function TagPills({tags,onRemove,size="sm"}){if(!tags.length)return null;let padding=size==="xs"?"1px 6px":"2px 7px",fontSize=size==="xs"?9:10;return(0,import_jsx_runtime10.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3,alignItems:"center"},children:tags.map(tag=>{let{bg,text,border}=getTagColors(tag);return(0,import_jsx_runtime10.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding,borderRadius:100,background:bg,border:\`1px solid \${border}\`,color:text,fontSize,fontWeight:600,whiteSpace:"nowrap"},children:[tag,onRemove&&(0,import_jsx_runtime10.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),onRemove(tag)},style:{display:"flex",background:"none",border:"none",color:text,cursor:"pointer",padding:0,lineHeight:1,opacity:.7},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"},children:"\\xD7"})]},tag)})})}var import_jsx_runtime11=__toESM(require_jsx_runtime(),1);function isImageFileName(name){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(name)}function withHexAlpha(hexColor,alpha){if(!/^#[0-9a-fA-F]{6}$/.test(hexColor))return;let normalized=Math.max(0,Math.min(1,alpha)),alphaHex=Math.round(normalized*255).toString(16).padStart(2,"0");return\`\${hexColor}\${alphaHex}\`}function resolveTaskCardBorderColor(statusColor,priority){return withHexAlpha(statusColor,priority==="Critical"?.36:priority==="High"?.3:.24)??"color-mix(in srgb, var(--p-text-g) 40%, transparent)"}function resolveTaskCardBgColor(typeColor){return withHexAlpha(typeColor,.1)??"transparent"}var DONE_ARTICLE_STYLE={padding:"7px 8px",gap:4,opacity:1,userSelect:"none"},DONE_INNER_ROW_STYLE={display:"flex",alignItems:"center",gap:5},DONE_CHECK_ICON_STYLE={width:12,height:12,color:"color-mix(in srgb, var(--p-green) 55%, transparent)",flexShrink:0},DONE_TITLE_STYLE={fontSize:11.5,fontWeight:600,color:"var(--p-text-m)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},VERIFIED_BADGE_STYLE={fontSize:9,fontWeight:700,color:"#22c55e",background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.3)",borderRadius:4,padding:"1px 5px",marginLeft:6,flexShrink:0,letterSpacing:.5},CARD_TITLE_ROW_STYLE={display:"flex",alignItems:"center",gap:5,minWidth:0},SPINNER_SHRINK_STYLE={flexShrink:0},CARD_TITLE_TEXT_STYLE={fontSize:11.5,fontWeight:600,color:"var(--p-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},DESC_THUMB_ROW_STYLE={display:"flex",alignItems:"flex-start",gap:8},DESC_TEXT_STYLE={fontSize:10,color:"var(--p-text-g)",lineHeight:"1.45",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,flex:1,minWidth:0},THUMB_WRAPPER_STYLE={position:"relative",flexShrink:0},THUMB_IMG_STYLE={width:52,height:34,borderRadius:6,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 90%, transparent)",display:"block",cursor:"pointer"},CARD_FOOTER_STYLE={display:"flex",alignItems:"center",gap:2,marginTop:1},SPACER_STYLE={flex:1},TaskCard=import_react7.default.memo(function({task,col,liveActivity,compact,onOpen,onDragStart}){var _a;let isInProgress=col.id==="in-progress",isDone=col.id==="done",[showThumbPreview,setShowThumbPreview]=import_react7.default.useState(!1),[thumbRect,setThumbRect]=import_react7.default.useState(null),thumbRef=import_react7.default.useRef(null),commentCount=task.commentCount??0,fileCount=task.fileCount??0,hasNewComments=commentCount>0&&isNewComments(task.id,commentCount),cardBorderColor=resolveTaskCardBorderColor(col.color,task.priority),typeColor=getTaskTypeColor(task.type),cardBgColor=resolveTaskCardBgColor(typeColor),firstImage=(_a=task.files)==null?void 0:_a.find(f=>isImageFileName(f.name)),thumbnailUrl=firstImage?\`/api/tasks/\${task.id}/files/\${encodeURIComponent(firstImage.name)}\`:null;function handleDragStart(e){onDragStart(e,task.id),e.currentTarget.classList.add("dragging")}function handleDragEnd(e){e.currentTarget.classList.remove("dragging")}function handleClick(){onOpen(task)}if(compact||isDone){let dotClass=col.id==="in-progress"?"sd-inprogress":\`sd-\${col.id}\`;return(0,import_jsx_runtime11.jsx)("article",{className:"task-card",draggable:!0,"data-task-id":task.id,"data-compact":compact?"true":void 0,style:{...DONE_ARTICLE_STYLE},onDragStart:handleDragStart,onDragEnd:handleDragEnd,onClick:handleClick,children:(0,import_jsx_runtime11.jsxs)("div",{style:DONE_INNER_ROW_STYLE,children:[isDone?(0,import_jsx_runtime11.jsx)(CircleCheckBig,{style:DONE_CHECK_ICON_STYLE}):(0,import_jsx_runtime11.jsx)("span",{className:dotClass,style:{flexShrink:0}}),(0,import_jsx_runtime11.jsx)("span",{style:{...DONE_TITLE_STYLE,...isDone?{}:{color:"var(--p-text)"}},children:task.title}),!compact&&!isDone&&task.tags&&task.tags.length>0&&(0,import_jsx_runtime11.jsx)(TagPills,{tags:task.tags,size:"xs"}),!compact&&!isDone&&(commentCount>0||fileCount>0)&&(0,import_jsx_runtime11.jsxs)("span",{style:{fontSize:9,color:"var(--p-text-m)",flexShrink:0},children:[commentCount>0&&\`\\u{1F4AC}\${commentCount}\`,commentCount>0&&fileCount>0&&" ",fileCount>0&&\`\\u{1F4CE}\${fileCount}\`]}),isDone&&task.verified&&(0,import_jsx_runtime11.jsx)("span",{style:VERIFIED_BADGE_STYLE,children:"\\u2713 VERIFIED"})]})})}return(0,import_jsx_runtime11.jsxs)("article",{className:\`task-card\${liveActivity?" task-live-edit":""}\`,draggable:!0,"data-task-id":task.id,style:{padding:"7px 8px",gap:4,userSelect:"none",background:liveActivity?"rgba(59,130,246,0.08)":cardBgColor,border:liveActivity?"1px solid rgba(59,130,246,0.5)":cardBorderColor?\`1px solid \${cardBorderColor}\`:void 0,...liveActivity?{boxShadow:"0 0 0 2px rgba(59,130,246,0.14)"}:{}},onDragStart:handleDragStart,onDragEnd:handleDragEnd,onClick:handleClick,children:[(0,import_jsx_runtime11.jsxs)("div",{style:CARD_TITLE_ROW_STYLE,children:[isInProgress&&(0,import_jsx_runtime11.jsx)("span",{className:"spinner",style:SPINNER_SHRINK_STYLE}),(0,import_jsx_runtime11.jsx)("span",{style:CARD_TITLE_TEXT_STYLE,children:task.title})]}),(task.description||thumbnailUrl)&&(0,import_jsx_runtime11.jsxs)("div",{style:DESC_THUMB_ROW_STYLE,children:[task.description&&(0,import_jsx_runtime11.jsx)("div",{style:DESC_TEXT_STYLE,children:task.description}),thumbnailUrl&&(0,import_jsx_runtime11.jsxs)("div",{style:THUMB_WRAPPER_STYLE,onMouseEnter:()=>{if(thumbRef.current){let r=thumbRef.current.getBoundingClientRect();setThumbRect({top:r.top,right:r.right})}setShowThumbPreview(!0)},onMouseLeave:()=>{setShowThumbPreview(!1),setThumbRect(null)},children:[(0,import_jsx_runtime11.jsx)("img",{ref:thumbRef,src:thumbnailUrl,alt:"Task screenshot","data-role":"task-thumb",style:THUMB_IMG_STYLE}),showThumbPreview&&thumbRect&&import_react_dom.default.createPortal((0,import_jsx_runtime11.jsx)("img",{src:thumbnailUrl,alt:"Task screenshot enlarged preview","data-role":"task-thumb-preview",style:{position:"fixed",right:window.innerWidth-thumbRect.right,bottom:window.innerHeight-thumbRect.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,import_jsx_runtime11.jsxs)("div",{className:"flex items-center",style:CARD_FOOTER_STYLE,children:[(0,import_jsx_runtime11.jsx)(TypeBadge,{type:task.type}),task.priority&&(0,import_jsx_runtime11.jsx)(PriorityBadge,{priority:task.priority}),isInProgress&&task.assigneeName&&(0,import_jsx_runtime11.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:task.assigneeName}),task.tags&&task.tags.length>0&&(0,import_jsx_runtime11.jsx)(TagPills,{tags:task.tags,size:"xs"}),(0,import_jsx_runtime11.jsx)("div",{style:SPACER_STYLE}),liveActivity&&(0,import_jsx_runtime11.jsx)(LiveActivityBadge,{activity:liveActivity}),(0,import_jsx_runtime11.jsx)(CardIconButton,{icon:(0,import_jsx_runtime11.jsx)(MessageCircle,{style:{width:9,height:9}}),label:commentCount>0?String(commentCount):"",color:hasNewComments?"var(--p-purple)":commentCount>0?"var(--p-text-m)":"var(--p-border-t)",hoverColor:hasNewComments?"var(--p-purple-300)":"var(--p-text)",title:commentCount>0?\`\${commentCount} comment(s)\`:"Add comment",badge:hasNewComments,badgeColor:"var(--p-purple)",onClick:e=>{e.stopPropagation(),onOpen(task,"comments")}}),(0,import_jsx_runtime11.jsx)(CardIconButton,{icon:(0,import_jsx_runtime11.jsx)(Paperclip,{style:{width:9,height:9}}),label:fileCount>0?String(fileCount):"",color:fileCount>0?"var(--p-blue-300)":"var(--p-border-t)",hoverColor:fileCount>0?"var(--p-cyan-300)":"var(--p-text-sub)",title:fileCount>0?\`\${fileCount} file(s) attached\`:"Files",onClick:e=>{e.stopPropagation(),onOpen(task,"files")}})]})]})});function CardIconButton({icon,label,color,hoverColor,title,badge,badgeColor,onClick}){let[hovered,setHovered]=import_react7.default.useState(!1);return(0,import_jsx_runtime11.jsxs)("button",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 3px",borderRadius:3,border:"none",background:hovered?"color-mix(in srgb, var(--p-text-m) 10%, transparent)":"transparent",cursor:"pointer",fontSize:9,color:hovered?hoverColor:color,transition:"color .1s, background .1s"},title,onMouseEnter:()=>setHovered(!0),onMouseLeave:()=>setHovered(!1),onClick,children:[icon,label&&(0,import_jsx_runtime11.jsx)("span",{children:label}),badge&&(0,import_jsx_runtime11.jsx)("span",{style:{width:4,height:4,background:badgeColor??color,borderRadius:"50%",flexShrink:0}})]})}function LiveActivityBadge({activity}){let isLocked=activity.state==="locked"||activity.state==="editing",icon=isLocked?(0,import_jsx_runtime11.jsx)(Lock,{style:{width:8,height:8}}):(0,import_jsx_runtime11.jsx)(Eye,{style:{width:8,height:8}}),label=isLocked?\`Locked by \${activity.user}\`:\`\${activity.user} viewing\`;return(0,import_jsx_runtime11.jsxs)("span",{style:isLocked?{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:label,"data-testid":"live-activity-badge",children:[icon,(0,import_jsx_runtime11.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:"1 1 0"},children:activity.user})]})}var import_jsx_runtime12=__toESM(require_jsx_runtime(),1);var import_react9=__toESM(require_react(),1);var import_jsx_runtime13=__toESM(require_jsx_runtime(),1);var import_react10=__toESM(require_react(),1);var import_jsx_runtime14=__toESM(require_jsx_runtime(),1);var import_jsx_runtime15=__toESM(require_jsx_runtime(),1);var import_react19=__toESM(require_react(),1);var import_react14=__toESM(require_react(),1);var import_react11=__toESM(require_react(),1),import_jsx_runtime16=__toESM(require_jsx_runtime(),1),AutoExpandTextarea=import_react11.default.forwardRef(function({value,onChange,baseRows=4,maxRows,style,...rest},forwardedRef){let localRef=import_react11.default.useRef(null),resolvedMaxRows=maxRows??baseRows*2,resize=import_react11.default.useCallback(()=>{let el2=localRef.current;if(!el2)return;el2.style.height="auto";let computed=window.getComputedStyle(el2),lineHeight=Number.parseFloat(computed.lineHeight||"0")||18,verticalPadding=Number.parseFloat(computed.paddingTop||"0")+Number.parseFloat(computed.paddingBottom||"0"),border=Number.parseFloat(computed.borderTopWidth||"0")+Number.parseFloat(computed.borderBottomWidth||"0"),minHeight=baseRows*lineHeight+verticalPadding+border,maxHeight=resolvedMaxRows*lineHeight+verticalPadding+border,target=Math.max(minHeight,Math.min(el2.scrollHeight,maxHeight));el2.style.height=\`\${target}px\`,el2.style.overflowY=el2.scrollHeight>maxHeight?"auto":"hidden"},[baseRows,resolvedMaxRows]);return import_react11.default.useLayoutEffect(()=>{resize()},[value,resize]),(0,import_jsx_runtime16.jsx)("textarea",{...rest,ref:el2=>{localRef.current=el2,typeof forwardedRef=="function"?forwardedRef(el2):forwardedRef&&(forwardedRef.current=el2)},rows:baseRows,value,onChange:e=>onChange(e.target.value),style:{...style,resize:"none"}})});var import_react13=__toESM(require_react(),1);var import_react12=__toESM(require_react(),1),import_react_dom2=__toESM(require_react_dom(),1),import_jsx_runtime17=__toESM(require_jsx_runtime(),1);var import_jsx_runtime18=__toESM(require_jsx_runtime(),1);var import_jsx_runtime19=__toESM(require_jsx_runtime(),1);var import_jsx_runtime20=__toESM(require_jsx_runtime(),1);var import_react15=__toESM(require_react(),1);var import_jsx_runtime21=__toESM(require_jsx_runtime(),1);var import_react18=__toESM(require_react(),1);var import_react16=__toESM(require_react(),1),import_react_dom3=__toESM(require_react_dom(),1);var import_jsx_runtime22=__toESM(require_jsx_runtime(),1);var import_react17=__toESM(require_react(),1);var import_jsx_runtime23=__toESM(require_jsx_runtime(),1);var import_jsx_runtime24=__toESM(require_jsx_runtime(),1);var import_jsx_runtime25=__toESM(require_jsx_runtime(),1);var import_jsx_runtime26=__toESM(require_jsx_runtime(),1);var MAX_UPLOAD_BYTES=5*1024*1024;var import_react20=__toESM(require_react(),1);var import_jsx_runtime27=__toESM(require_jsx_runtime(),1);var import_react21=__toESM(require_react(),1);var import_jsx_runtime28=__toESM(require_jsx_runtime(),1);var import_react22=__toESM(require_react(),1);var import_jsx_runtime29=__toESM(require_jsx_runtime(),1);var IGNORED_PATTERNS=[/Error evaluating Node\\.js code/i,/nextjs-portal/i],buffer=[],recording=!1;function addEntry(level,args){let message=args.map(a=>{if(typeof a=="string")return a;if(a instanceof Error)return a.message;try{return JSON.stringify(a)}catch{return String(a)}}).join(" ").slice(0,500);!message||IGNORED_PATTERNS.some(pattern=>pattern.test(message))||(buffer.push({level,message,timestamp:new Date().toISOString()}),buffer.length>50&&buffer.splice(0,buffer.length-50))}function startRecording(){if(recording)return;recording=!0;let origError=console.error.bind(console);console.error=(...args)=>{addEntry("error",args),origError(...args)};let origWarn=console.warn.bind(console);console.warn=(...args)=>{addEntry("warn",args),origWarn(...args)},window.addEventListener("error",e=>{let loc=e.filename?\` (\${e.filename.split("/").pop()}:\${e.lineno})\`:"";addEntry("error",[\`\${e.message}\${loc}\`])}),window.addEventListener("unhandledrejection",e=>{let msg=e.reason instanceof Error?e.reason.message:String(e.reason??"Unhandled promise rejection");addEntry("error",[\`Unhandled rejection: \${msg}\`])})}function getRecordedLogs(){if(buffer.length===0)return"";let lines=buffer.map(e=>{let icon=e.level==="error"?"\\u{1F534}":"\\u{1F7E1}",time=e.timestamp.slice(11,19);return\`- \${icon} \\\`\${time}\\\` \${e.message}\`});return\`
1606
1610
 
1607
1611
  ---
1608
1612
  **Console logs** (\${buffer.length} entr\${buffer.length===1?"y":"ies"})
1609
1613
  \${lines.join(\`
1610
- \`)}\`}function clampTriggerPos(pos,viewport){let x=Math.max(8,Math.min(viewport.width-64,pos.x)),y=Math.max(8,Math.min(viewport.height-64,pos.y));return{x,y}}function parseCookies(){let cookies=[];if(!document.cookie)return cookies;for(let pair of document.cookie.split(";")){let trimmed=pair.trim();if(!trimmed)continue;let eqIdx=trimmed.indexOf("=");if(eqIdx===-1)continue;let name=trimmed.slice(0,eqIdx).trim(),value=trimmed.slice(eqIdx+1).trim();cookies.push({name,value,domain:location.hostname,path:"/",expires:-1,httpOnly:!1,secure:location.protocol==="https:",sameSite:"Lax"})}return cookies}function captureAuthState(){let localStorageData={};try{for(let i=0;i<localStorage.length;i++){let key=localStorage.key(i);key&&(localStorageData[key]=localStorage.getItem(key)??"")}}catch{}let sessionStorageData={};try{for(let i=0;i<sessionStorage.length;i++){let key=sessionStorage.key(i);key&&(sessionStorageData[key]=sessionStorage.getItem(key)??"")}}catch{}return{cookies:parseCookies(),localStorage:localStorageData,sessionStorage:sessionStorageData}}var AUTH_TTL_MS=1440*60*1e3;async function sendBaselineToServer(taskId,baseline){try{let cfg=PROTO_CONFIG,apiUrl=\`/api/tasks/\${taskId}/baseline\`;cfg!=null&&cfg.apiUrl&&(apiUrl=\`\${cfg.apiUrl.replace(/\\/api\\/(overlay\\/)?tasks$/,"")}/api/tasks/\${taskId}/baseline\`),cfg!=null&&cfg.boardId&&(apiUrl+=\`?boardId=\${encodeURIComponent(cfg.boardId)}\`);let headers={"Content-Type":"application/json"};cfg!=null&&cfg.overlayApiKey&&(headers["X-Overlay-Api-Key"]=cfg.overlayApiKey),await fetch(apiUrl,{method:"POST",headers,body:JSON.stringify({baseline})})}catch(err){console.error("[Vibeflow] Failed to store baseline:",err)}}async function sendPageBaselineToServer(taskId,page){try{let cfg=PROTO_CONFIG,apiUrl=\`/api/tasks/\${taskId}/baseline-page\`;cfg!=null&&cfg.apiUrl&&(apiUrl=\`\${cfg.apiUrl.replace(/\\/api\\/(overlay\\/)?tasks$/,"")}/api/tasks/\${taskId}/baseline-page\`),cfg!=null&&cfg.boardId&&(apiUrl+=\`?boardId=\${encodeURIComponent(cfg.boardId)}\`);let headers={"Content-Type":"application/json"};cfg!=null&&cfg.overlayApiKey&&(headers["X-Overlay-Api-Key"]=cfg.overlayApiKey),await fetch(apiUrl,{method:"POST",headers,body:JSON.stringify({page})})}catch(err){console.error("[Vibeflow] Failed to store page baseline:",err)}}async function captureAndStoreAuthState(taskId,taskAuthor){let authState=captureAuthState();try{let cfg=PROTO_CONFIG,apiUrl=\`/api/tasks/\${taskId}/auth-state\`;cfg!=null&&cfg.apiUrl&&(apiUrl=\`\${cfg.apiUrl.replace(/\\/api\\/(overlay\\/)?tasks$/,"")}/api/tasks/\${taskId}/auth-state\`),cfg!=null&&cfg.boardId&&(apiUrl+=\`?boardId=\${encodeURIComponent(cfg.boardId)}\`);let headers={"Content-Type":"application/json"};cfg!=null&&cfg.overlayApiKey&&(headers["X-Overlay-Api-Key"]=cfg.overlayApiKey),await fetch(apiUrl,{method:"POST",headers,body:JSON.stringify({authState,taskAuthor})})}catch(err){console.error("[Vibeflow] Failed to store auth state:",err)}}var RELEVANT_STYLES=["display","visibility","opacity","position","overflow","overflow-x","overflow-y","width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-width","border-style","border-color","border-radius","background-color","background-image","color","font-size","font-weight","font-style","font-family","line-height","letter-spacing","text-align","text-decoration","text-overflow","white-space","flex-direction","flex-wrap","flex","justify-content","align-items","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","z-index","box-shadow","transform","transition","cursor","user-select","pointer-events","top","left","right","bottom"];function buildKey(el2){let path=[],current=el2;for(;current&&current!==document.documentElement;){let parentEl=current.parentElement;if(!parentEl)break;let index=Array.from(parentEl.children).indexOf(current);path.unshift(index),current=parentEl}return path.join("/")}function buildDisplaySelector(el2){let tag=el2.tagName.toLowerCase(),taskId=el2.getAttribute("data-task-id");if(taskId)return\`\${tag}.task-card[data-task-id=\${taskId}]\`;let status=el2.getAttribute("data-status");if(status&&el2.classList.contains("column-scroll"))return\`\${tag}.column-scroll[data-status=\${status}]\`;let colId=el2.getAttribute("data-column-id");if(colId)return\`\${tag}[data-column-id=\${colId}]\`;let classes=Array.from(el2.classList).slice(0,2),selector=tag;classes.length&&(selector+="."+classes.join("."));let parent=el2.parentElement;if(parent){let siblings=Array.from(parent.children).filter(c=>c.tagName===el2.tagName);if(siblings.length>1){let idx=siblings.indexOf(el2)+1;selector+=\`:nth-of-type(\${idx})\`}}return selector}function filterStyles(el2,styles=RELEVANT_STYLES){let computed=window.getComputedStyle(el2),result={};for(let prop of styles)result[prop]=computed.getPropertyValue(prop);return result}function normalizeText(text,limit=200){return text.replace(/\\s+/g," ").trim().slice(0,limit)}function childSignature(children){let counts=new Map;for(let child of children){let tag=child.tagName.toLowerCase(),classes=Array.from(child.classList).slice(0,2).join("."),key=classes?\`\${tag}.\${classes}\`:tag;counts.set(key,(counts.get(key)||0)+1)}return Array.from(counts.entries()).map(([key,count])=>\`\${key} \\xD7\${count}\`).slice(0,10)}function getXPath(el2){let parts=[],node=el2;for(;node&&node!==document.documentElement;){let index=1,sibling=node.previousElementSibling;for(;sibling;)sibling.tagName===node.tagName&&index++,sibling=sibling.previousElementSibling;let tag=node.tagName.toLowerCase();parts.unshift(\`\${tag}[\${index}]\`),node=node.parentElement}return"/"+parts.join("/")}function getParentSnippet(el2){let parent=el2.parentElement;if(!parent||parent===document.body)return;let html=parent.outerHTML;return html.length<=500?html:html.slice(0,500)+"\\u2026"}function getBrowserString(){return navigator.userAgent}function capturePositionContext(el2){let rect=el2.getBoundingClientRect(),zIndex="auto",position="static",parentZIndex,current=el2;for(;current&&current!==document.documentElement;){let style=window.getComputedStyle(current),pos=style.position,z=style.zIndex;if(pos!=="static"||z!=="auto"){if(current===el2)position=pos,zIndex=z;else if(parentZIndex===void 0){parentZIndex=z;break}}if(pos!=="static")break;current=current.parentElement}return{boundingBox:{x:rect.x,y:rect.y,width:rect.width,height:rect.height},scrollPosition:{x:window.scrollX,y:window.scrollY},viewport:{width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio},stackingContext:{zIndex,position,parentZIndex}}}function captureComputedStyles(el2){let style=window.getComputedStyle(el2),result={};for(let prop of RELEVANT_STYLES)result[prop]=style.getPropertyValue(prop);return result}function captureDomSnapshot(el2,cssSelector,consoleErrors=[]){return{outerHTML:el2.outerHTML,computedStyles:captureComputedStyles(el2),selector:cssSelector,xpath:getXPath(el2),position:capturePositionContext(el2),parentSnippet:getParentSnippet(el2),browser:getBrowserString(),consoleErrors,capturedAt:new Date().toISOString()}}function capturePageSnapshot(maxElements=1e3){let elements={},count=0,truncated=!1,walker=document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode(node){if(count>=maxElements)return NodeFilter.FILTER_REJECT;let el2=node;return el2.classList.length>0||el2.hasAttribute("data-task-id")||el2.hasAttribute("data-status")||el2.hasAttribute("data-column-id")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),queue=[],n;for(;n=walker.nextNode();)queue.push(n);for(let el2 of queue){if(count>=maxElements){truncated=!0;break}let key=buildKey(el2),children=Array.from(el2.children),dataAttrs={};for(let a of Array.from(el2.attributes))a.name.startsWith("data-")&&(dataAttrs[a.name.slice(5)]=a.value);let position={x:0,y:0,width:0,height:0};try{let r=el2.getBoundingClientRect();position={x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)}}catch{}elements[key]={key,selector:buildDisplaySelector(el2),tag:el2.tagName.toLowerCase(),classes:Array.from(el2.classList),dataAttrs,parentKey:el2.parentElement?buildKey(el2.parentElement):"",childCount:children.length,childSignature:childSignature(children),text:normalizeText(el2.textContent??""),position,baseline:filterStyles(el2,RELEVANT_STYLES),after:filterStyles(el2,RELEVANT_STYLES)},count++}return{version:1,capturedAt:new Date().toISOString(),truncated,elements}}var import_jsx_runtime30=__toESM(require_jsx_runtime(),1),_externalShowAddModal=null,_externalFlashTrigger=null,_externalSetTriggerVisible=null,_externalHideTrigger=null,_externalDisableOverlay=null;function showOverlayTrigger(){_externalSetTriggerVisible==null||_externalSetTriggerVisible()}function hideOverlayTrigger(){_externalHideTrigger==null||_externalHideTrigger()}function disableVibeflowOverlay(){_externalDisableOverlay==null||_externalDisableOverlay()}var TRIGGER_HIDDEN_KEY="vibeflow-trigger-hidden";function hasPrototypingApi(){return typeof window<"u"&&"__vf_prototyping"in window}function openPrototypingPanel(){let api=window.__vf_prototyping;api==null||api.openPanel()}function flashFavicon(durationMs=2200){let head=document.head,existing=head.querySelector('link[rel*="icon"]'),originalHref=(existing==null?void 0:existing.href)??"";existing&&existing.remove();let link=document.createElement("link");link.rel="icon",link.type="image/svg+xml";let animatedSvg='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" fill="none"><rect width="18" height="18" rx="4" fill="#2563eb"/><rect x="2.5" y="5" width="2" height="8" rx="1" fill="white" opacity=".7"><animate attributeName="height" values="3;13;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0s"/><animate attributeName="y" values="7.5;2.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0s"/></rect><rect x="6.5" y="2" width="2" height="14" rx="1" fill="white"><animate attributeName="height" values="3;15;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.15s"/><animate attributeName="y" values="7.5;1.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.15s"/></rect><rect x="10.5" y="6" width="2" height="6" rx="1" fill="white" opacity=".7"><animate attributeName="height" values="3;12;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.3s"/><animate attributeName="y" values="7.5;3;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.3s"/></rect><rect x="14.5" y="4" width="2" height="10" rx="1" fill="white" opacity=".85"><animate attributeName="height" values="3;13;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.45s"/><animate attributeName="y" values="7.5;2.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.45s"/></rect></svg>';link.href=\`data:image/svg+xml,\${encodeURIComponent(animatedSvg)}\`,head.appendChild(link),window.setTimeout(()=>{if(link.remove(),originalHref){let restore=document.createElement("link");restore.rel="icon",restore.type="image/svg+xml",restore.href=originalHref,head.appendChild(restore)}},durationMs)}function flashOverlayTrigger(){_externalFlashTrigger==null||_externalFlashTrigger()}function CornerTrigger({onClick,flashing,onHide,onDisable}){let svgIcon=(0,import_jsx_runtime30.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[(0,import_jsx_runtime30.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"currentColor",opacity:"0.7"}),(0,import_jsx_runtime30.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"currentColor"}),(0,import_jsx_runtime30.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"currentColor",opacity:"0.7"}),(0,import_jsx_runtime30.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"currentColor",opacity:"0.85"})]}),[pos,setPos]=import_react23.default.useState(()=>{try{let saved=localStorage.getItem("vibeflow-trigger-pos");if(saved){let parsed=JSON.parse(saved);if(typeof parsed.x=="number"&&isFinite(parsed.x)&&typeof parsed.y=="number"&&isFinite(parsed.y))return clampTriggerPos(parsed,{width:window.innerWidth,height:window.innerHeight})}}catch{}return null}),[isDragging,setIsDragging]=import_react23.default.useState(!1),[isHolding,setIsHolding]=import_react23.default.useState(!1),dragOrigin=import_react23.default.useRef(null),holdTimer=import_react23.default.useRef(null),didDrag=import_react23.default.useRef(!1),isRightClick=import_react23.default.useRef(!1),buttonRef=import_react23.default.useRef(null),posRef=import_react23.default.useRef(null);posRef.current=pos;let[ctxMenu,setCtxMenu]=import_react23.default.useState(null);import_react23.default.useEffect(()=>{if(pos)try{localStorage.setItem("vibeflow-trigger-pos",JSON.stringify(pos))}catch{}},[pos]),import_react23.default.useEffect(()=>{if(!ctxMenu)return;function onDocClick(){setCtxMenu(null)}return document.addEventListener("click",onDocClick,{once:!0}),()=>document.removeEventListener("click",onDocClick)},[ctxMenu]);function getInitialPos(el2){let rect=el2.getBoundingClientRect();return{x:rect.left,y:rect.top}}function onPointerDown(e){let target=e.currentTarget,pointerId=e.pointerId,clientX=e.clientX,clientY=e.clientY;didDrag.current=!1,isRightClick.current=e.button===2,!isRightClick.current&&(holdTimer.current=window.setTimeout(()=>{setIsHolding(!0);let startPos=posRef.current??getInitialPos(target);dragOrigin.current={mouseX:clientX,mouseY:clientY,posX:startPos.x,posY:startPos.y},target.setPointerCapture(pointerId)},300))}function onPointerMove(e){if(!dragOrigin.current)return;let dx=e.clientX-dragOrigin.current.mouseX,dy=e.clientY-dragOrigin.current.mouseY;!isDragging&&(Math.abs(dx)>3||Math.abs(dy)>3)&&setIsDragging(!0),didDrag.current=!0;let bw=window.innerWidth,bh=window.innerHeight,x=Math.max(8,Math.min(bw-64,dragOrigin.current.posX+dx)),y=Math.max(8,Math.min(bh-64,dragOrigin.current.posY+dy));setPos({x,y})}function onPointerUp(_e){holdTimer.current!==null&&(window.clearTimeout(holdTimer.current),holdTimer.current=null);let wasDragged=didDrag.current,wasRight=isRightClick.current;dragOrigin.current=null,setIsDragging(!1),setIsHolding(!1),didDrag.current=!1,isRightClick.current=!1,!wasDragged&&!wasRight&&onClick()}function onPointerCancel(){holdTimer.current!==null&&(window.clearTimeout(holdTimer.current),holdTimer.current=null),dragOrigin.current=null,setIsDragging(!1),setIsHolding(!1),didDrag.current=!1}let posStyle=pos===null?{}:{position:"fixed",left:pos.x,top:pos.y,bottom:"auto",right:"auto"},className=["vibeflow-corner-trigger",flashing?"saved-flash":"",isHolding?"trigger-holding":"",isDragging?"trigger-dragging":""].filter(Boolean).join(" "),title=isDragging?"Drag to reposition":isHolding?"Drag to reposition \\xB7 Release to open":"Open Kanban board \\xB7 Hold to drag";function onContextMenu(e){e.preventDefault(),e.stopPropagation();let MENU_W=120,ITEM_H=28,PAD=8,itemCount=2+(hasPrototypingApi()?1:0),MENU_H=ITEM_H*itemCount,x=Math.min(e.clientX,window.innerWidth-MENU_W-PAD),y=Math.min(e.clientY,window.innerHeight-MENU_H-PAD);setCtxMenu({x:Math.max(PAD,x),y:Math.max(PAD,y)})}return(0,import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment,{children:[(0,import_jsx_runtime30.jsx)("button",{ref:buttonRef,className,title,style:posStyle,onPointerDown,onPointerMove,onPointerUp,onPointerCancel,onContextMenu,"data-vibeflow-ignore":"true",children:svgIcon}),ctxMenu&&(0,import_jsx_runtime30.jsxs)("div",{className:"vibeflow-trigger-ctx-menu",style:{position:"fixed",left:ctxMenu.x,top:ctxMenu.y},onClick:e=>e.stopPropagation(),children:[hasPrototypingApi()&&(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:()=>{setCtxMenu(null),openPrototypingPanel()},children:"Prototyping"}),(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:()=>{setCtxMenu(null),onHide()},children:"Hide Vibeflow"}),(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:()=>{setCtxMenu(null),onDisable()},children:"Disable Vibeflow"})]})]})}var STATUS_OPTIONS=["backlog","todo","in-progress","review","done"],STATUS_ACTIVE={backlog:{background:"rgba(100,116,139,0.2)",borderColor:"rgba(100,116,139,0.5)",color:"#94a3b8"},todo:{background:"rgba(245,158,11,0.15)",borderColor:"rgba(245,158,11,0.4)",color:"#fcd34d"},"in-progress":{background:"rgba(59,130,246,0.15)",borderColor:"rgba(59,130,246,0.4)",color:"#93c5fd"},review:{background:"rgba(139,92,246,0.15)",borderColor:"rgba(139,92,246,0.4)",color:"#c4b5fd"},done:{background:"rgba(52,211,153,0.12)",borderColor:"rgba(52,211,153,0.4)",color:"#6ee7b7"}};function OverlayAddModal({opts,onClose,onSubmit}){let[title,setTitle]=import_react23.default.useState(opts.initialTitle??""),[description,setDescription]=import_react23.default.useState(opts.initialDescription??""),[status,setStatus]=import_react23.default.useState("todo"),[type,setType]=import_react23.default.useState("Task"),[showPreview,setShowPreview]=import_react23.default.useState(!1),[titleError,setTitleError]=import_react23.default.useState(!1),titleRef=import_react23.default.useRef(null),[dragPos,setDragPos]=import_react23.default.useState(null),[isDragging,setIsDragging]=import_react23.default.useState(!1),dragOrigin=import_react23.default.useRef(null);function onHeaderPointerDown(e){if(e.target.closest("button, input, select, textarea, a"))return;e.currentTarget.setPointerCapture(e.pointerId);let startX=(dragPos==null?void 0:dragPos.x)??window.innerWidth/2-270,startY=(dragPos==null?void 0:dragPos.y)??window.innerHeight/2-200;dragOrigin.current={mouseX:e.clientX,mouseY:e.clientY,posX:startX,posY:startY},setIsDragging(!0)}function onHeaderPointerMove(e){if(!dragOrigin.current)return;let dx=e.clientX-dragOrigin.current.mouseX,dy=e.clientY-dragOrigin.current.mouseY;setDragPos({x:dragOrigin.current.posX+dx,y:dragOrigin.current.posY+dy})}function onHeaderPointerUp(){dragOrigin.current=null,setIsDragging(!1)}import_react23.default.useEffect(()=>{setTimeout(()=>{var _a;return(_a=titleRef.current)==null?void 0:_a.focus()},50)},[]);function handleBackdropClick(e){e.target===e.currentTarget&&onClose()}function handleKeyDown(e){e.key==="Escape"&&onClose(),(e.ctrlKey||e.metaKey)&&e.key==="Enter"&&handleSave()}async function handleSave(){var _a;let t=title.trim();if(!t){setTitleError(!0),(_a=titleRef.current)==null||_a.focus();return}setTitleError(!1);let desc=description.trim()||t;if(type==="Bug"){let logs=getRecordedLogs();logs&&(desc+=logs)}let result=await onSubmit(opts.selector??location.pathname,opts.cssSelector??location.pathname,t,desc,status,type,{file:opts.file,line:opts.line,col:opts.col,component:opts.component});if(result.success&&result.taskId){let baselineSelector=opts.cssSelector??opts.selector,targetEl=baselineSelector?document.querySelector(baselineSelector):null;if(targetEl&&baselineSelector)try{let snapshot=captureDomSnapshot(targetEl,baselineSelector);sendBaselineToServer(result.taskId,snapshot)}catch(err){console.error("[Vibeflow] Failed to capture baseline:",err)}captureAndStoreAuthState(result.taskId,result.taskAuthor??"unknown")}onClose()}let statusBtnBase={padding:"2px 8px",borderRadius:4,fontSize:11,cursor:"pointer",border:"1px solid var(--vibeflow-border-strong)",background:"transparent",color:"var(--vibeflow-text-muted)",fontFamily:"inherit",fontWeight:500,transition:"all .12s"},modalStyle=dragPos===null?{}:{position:"fixed",left:dragPos.x,top:dragPos.y,margin:0};return(0,import_jsx_runtime30.jsx)("div",{className:"vibeflow-modal-backdrop",onClick:handleBackdropClick,onKeyDown:handleKeyDown,children:(0,import_jsx_runtime30.jsxs)("div",{className:"vibeflow-modal overlay-add-modal",role:"dialog","aria-modal":"true",style:modalStyle,children:[(0,import_jsx_runtime30.jsxs)("div",{className:"modal-header overlay-modal-header",style:{cursor:isDragging?"grabbing":"grab",userSelect:"none"},onPointerDown:onHeaderPointerDown,onPointerMove:onHeaderPointerMove,onPointerUp:onHeaderPointerUp,children:[(0,import_jsx_runtime30.jsx)("span",{title:"Drag to move",style:{display:"flex",alignItems:"center",color:"var(--vibeflow-text-muted)",opacity:.5,flexShrink:0,pointerEvents:"none"},children:(0,import_jsx_runtime30.jsxs)("svg",{width:"12",height:"16",viewBox:"0 0 12 16",fill:"currentColor","aria-hidden":"true",children:[(0,import_jsx_runtime30.jsx)("circle",{cx:"3",cy:"3",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"9",cy:"3",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"3",cy:"8",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"9",cy:"8",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"3",cy:"13",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"9",cy:"13",r:"1.5"})]})}),(0,import_jsx_runtime30.jsx)(TypePicker,{value:type,onChange:setType}),(0,import_jsx_runtime30.jsx)("input",{ref:titleRef,type:"text",placeholder:"Task title\\u2026",value:title,onChange:e=>{setTitle(e.target.value),titleError&&e.target.value.trim()&&setTitleError(!1)},style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",border:\`1px solid \${titleError?"rgba(239,68,68,0.7)":"transparent"}\`,borderRadius:6,background:titleError?"rgba(239,68,68,0.07)":"transparent",color:"var(--vibeflow-text-primary)",fontFamily:"inherit",outline:"none",cursor:"text"},onFocus:e=>{titleError||(e.currentTarget.style.borderColor="var(--vibeflow-accent-strong)",e.currentTarget.style.background="var(--vibeflow-surface-elevated)")},onBlur:e=>{titleError||(e.currentTarget.style.borderColor="transparent",e.currentTarget.style.background="transparent")},onKeyDown:e=>{e.key==="Enter"&&handleSave(),e.key==="Escape"&&onClose()}}),titleError&&(0,import_jsx_runtime30.jsx)("span",{style:{fontSize:11,color:"rgba(239,68,68,0.9)",flexShrink:0,whiteSpace:"nowrap"},children:"Title is required"}),(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:onClose,style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--vibeflow-text-muted)",cursor:"pointer"},onMouseOver:e=>{e.currentTarget.style.background="var(--vibeflow-surface-hover)",e.currentTarget.style.color="var(--vibeflow-text-secondary)"},onMouseOut:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.color="var(--vibeflow-text-muted)"},"aria-label":"Close",children:"\\u2715"})]}),(0,import_jsx_runtime30.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",borderBottom:"1px solid var(--vibeflow-border-strong)"},children:[(0,import_jsx_runtime30.jsx)("span",{style:{fontSize:10,color:"var(--vibeflow-text-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},children:"Status"}),STATUS_OPTIONS.map(s=>(0,import_jsx_runtime30.jsx)("button",{type:"button",style:{...statusBtnBase,...s===status?STATUS_ACTIVE[s]:{}},onClick:()=>setStatus(s),onMouseOver:e=>{s!==status&&(e.currentTarget.style.background="var(--vibeflow-surface-hover)",e.currentTarget.style.color="var(--vibeflow-text-secondary)")},onMouseOut:e=>{s!==status&&(e.currentTarget.style.background="transparent",e.currentTarget.style.color="var(--vibeflow-text-muted)")},children:s},s))]}),(opts.file||opts.component)&&(0,import_jsx_runtime30.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 16px",background:"var(--vibeflow-surface-elevated)",borderBottom:"1px solid var(--vibeflow-border-subtle)",fontSize:11,color:"var(--vibeflow-text-muted)"},children:[opts.file&&(0,import_jsx_runtime30.jsxs)("a",{href:\`vscode://file\${opts.file}\${opts.line==null?"":\`:\${opts.line}\`}\`,target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"var(--vibeflow-accent-soft)",border:"1px solid var(--vibeflow-accent-border)",color:"var(--vibeflow-accent-strong)",textDecoration:"none",fontSize:11},children:["\\u{1F5CE} ",opts.file.split("/").slice(-2).join("/"),opts.line==null?"":\`:\${opts.line}\`]}),opts.component&&(0,import_jsx_runtime30.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"rgba(139,92,246,0.08)",border:"1px solid rgba(139,92,246,0.25)",color:"#8b5cf6",fontSize:11},children:["\\u2B21 ",opts.component]})]}),(0,import_jsx_runtime30.jsxs)("div",{className:"modal-tabs",children:[(0,import_jsx_runtime30.jsx)("div",{className:\`modal-tab\${showPreview?"":" active"}\`,onClick:()=>setShowPreview(!1),children:"Edit"}),(0,import_jsx_runtime30.jsx)("div",{className:\`modal-tab\${showPreview?" active":""}\`,onClick:()=>setShowPreview(!0),children:"Preview"})]}),(0,import_jsx_runtime30.jsx)("div",{className:"modal-body",children:showPreview?(0,import_jsx_runtime30.jsx)(MarkdownPreview,{markdown:description,className:"modal-preview-pane"}):(0,import_jsx_runtime30.jsx)("div",{className:"modal-editor-pane",children:(0,import_jsx_runtime30.jsx)(AutoExpandTextarea,{className:"dp-textarea",placeholder:"Description (markdown supported)\\u2026",value:description,onChange:setDescription,baseRows:5,maxRows:14})})}),type==="Bug"&&(0,import_jsx_runtime30.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 16px",background:"rgba(239,68,68,0.06)",borderTop:"1px solid rgba(239,68,68,0.18)",fontSize:11,color:"rgba(239,68,68,0.75)"},children:[(0,import_jsx_runtime30.jsx)("span",{children:"\\u{1F534}"}),(0,import_jsx_runtime30.jsx)("span",{children:"Console errors & warnings will be attached to this report"})]}),(0,import_jsx_runtime30.jsxs)("div",{className:"modal-footer",children:[(0,import_jsx_runtime30.jsxs)("div",{className:"modal-footer-left",children:[(0,import_jsx_runtime30.jsx)("button",{type:"button",className:"btn-primary",onClick:handleSave,disabled:!title.trim(),style:{opacity:title.trim()?1:.45,cursor:title.trim()?"pointer":"not-allowed"},children:"Add Task"}),(0,import_jsx_runtime30.jsx)("button",{type:"button",className:"btn-ghost",onClick:onClose,children:"Cancel"})]}),(0,import_jsx_runtime30.jsx)("div",{className:"modal-footer-center",children:(0,import_jsx_runtime30.jsx)("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--vibeflow-text-muted)",cursor:"pointer",userSelect:"none"}})})]})]})})}function OverlayApp({onOpenKanban,onSubmitTask}){let[addModalOpts,setAddModalOpts]=import_react23.default.useState(null),[triggerFlashing,setTriggerFlashing]=import_react23.default.useState(!1),[isHidden,setIsHidden]=import_react23.default.useState(()=>{try{return localStorage.getItem(TRIGGER_HIDDEN_KEY)==="1"}catch{return!1}});import_react23.default.useEffect(()=>(_externalShowAddModal=opts=>setAddModalOpts(opts),_externalFlashTrigger=()=>{setTriggerFlashing(!0),window.setTimeout(()=>setTriggerFlashing(!1),1500),flashFavicon()},_externalSetTriggerVisible=()=>{try{localStorage.removeItem(TRIGGER_HIDDEN_KEY)}catch{}setIsHidden(!1)},_externalHideTrigger=()=>{try{localStorage.setItem(TRIGGER_HIDDEN_KEY,"1")}catch{}setIsHidden(!0)},_externalDisableOverlay=()=>{state.disabled=!0,state.host&&(state.host.remove(),state.host=null)},()=>{_externalShowAddModal=null,_externalFlashTrigger=null,_externalSetTriggerVisible=null,_externalHideTrigger=null,_externalDisableOverlay=null}),[]);let isKanbanPage=typeof document<"u"&&document.body.hasAttribute("data-vibeflow-cli-kanban");return(0,import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment,{children:[!isKanbanPage&&!isHidden&&(0,import_jsx_runtime30.jsx)(CornerTrigger,{onClick:onOpenKanban,flashing:triggerFlashing,onHide:()=>{try{localStorage.setItem(TRIGGER_HIDDEN_KEY,"1")}catch{}setIsHidden(!0)},onDisable:()=>{state.disabled=!0,state.host&&(state.host.remove(),state.host=null)}}),addModalOpts!==null&&(0,import_jsx_runtime30.jsx)(OverlayAddModal,{opts:addModalOpts,onClose:()=>setAddModalOpts(null),onSubmit:async(selector,cssSelector,title,description,status,type,meta)=>{let result=await onSubmitTask(selector,cssSelector,title,description,status,type,meta);return setAddModalOpts(null),result}})]})}function buildTypePickerEl(initialType="Task"){let selectedType=initialType,detailed=TASK_TYPES,currentInfo=()=>detailed.find(t=>t.value===selectedType)??detailed[0],container=el("div",{className:"type-picker"}),trigger=el("button",{className:"type-picker-trigger",type:"button"}),dropdown=el("div",{className:"type-picker-dropdown"}),refresh=()=>{let info=currentInfo();trigger.title=(info==null?void 0:info.tooltip)??"",trigger.replaceChildren(el("span",{className:"type-picker-icon"},(info==null?void 0:info.icon)??""),el("span",{className:"type-picker-label"},(info==null?void 0:info.label)??"")),dropdown.replaceChildren();for(let t of detailed){let opt=el("button",{className:t.value===selectedType?"type-picker-option type-picker-option--active":"type-picker-option",type:"button",title:t.tooltip},el("span",{className:"type-picker-icon"},t.icon),el("span",{className:"type-picker-label"},t.label));opt.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),selectedType=t.value,refresh(),dropdown.classList.remove("open")}),dropdown.appendChild(opt)}};return trigger.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),dropdown.classList.toggle("open")}),refresh(),container.append(trigger,dropdown),{el:container,getValue:()=>selectedType,setValue:v=>{selectedType=v,refresh()}}}function renderMarkdown2(md){return md?md.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/[*][*](.+?)[*][*]/g,"<strong>$1</strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/[*](.+?)[*]/g,"<em>$1</em>").replace(/_([^_]+?)_/g,"<em>$1</em>").replace(/\`(.+?)\`/g,"<code>$1</code>").replace(/^[-*] (.+)$/gm,"<li>$1</li>").replace(/^---$/gm,"<hr>").replace(/(<li>[\\s\\S]*?<\\/li>\\n?)+/g,m=>\`<ul>\${m}</ul>\`).replace(/^(?!<[a-z]|$).+$/gm,line=>\`<p>\${line}</p>\`):'<span class="modal-preview-empty">No description yet</span>'}function showEditModal(task){if(!state.root)return;state.editModal&&(state.editModal.remove(),state.editModal=null);let titleInput=el("input",{type:"text",placeholder:"Task title..."});titleInput.value=task.title??"";let statusSelect=el("select");for(let s of["backlog","todo","in-progress","review","done"]){let opt=el("option",{value:s},s);s===task.status&&(opt.selected=!0),statusSelect.appendChild(opt)}let typePicker=buildTypePickerEl(task.type??"Task"),header=el("div",{className:"modal-header"},titleInput,typePicker.el,statusSelect),tabEdit=el("div",{className:"modal-tab active"},"Edit"),tabPreview=el("div",{className:"modal-tab"},"Preview"),tabs=el("div",{className:"modal-tabs"},tabEdit,tabPreview),textarea=el("textarea",{placeholder:"Description (markdown supported)..."});textarea.value=task.description??"";let editorPane=el("div",{className:"modal-editor-pane"},textarea),previewPane=el("div",{className:"modal-preview-pane"});previewPane.style.display="none";let refreshPreview=()=>{previewPane.innerHTML=renderMarkdown2(textarea.value)},body=el("div",{className:"modal-body"},editorPane,previewPane);tabEdit.addEventListener("click",()=>{tabEdit.classList.add("active"),tabPreview.classList.remove("active"),editorPane.style.display="",previewPane.style.display="none"}),tabPreview.addEventListener("click",event=>{event.isTrusted&&(tabPreview.classList.add("active"),tabEdit.classList.remove("active"),editorPane.style.display="none",previewPane.style.display="",refreshPreview())});let btnSave=el("button",{className:"btn-primary"},"Save"),btnCancel=el("button",{className:"btn-ghost"},"Cancel"),footerLeft=el("div",{className:"modal-footer-left"},btnSave,btnCancel),footerRight=el("div",{className:"modal-footer-right"}),footerCenter=buildSourceRow({file:task.file,line:task.line,col:task.col,component:task.component}),footer=el("div",{className:"modal-footer"},footerLeft,footerCenter,footerRight),modal=el("div",{className:"vibeflow-modal"},header,tabs,body,footer),backdrop=el("div",{className:"vibeflow-modal-backdrop"},modal);state.editModal=backdrop,state.root.appendChild(backdrop),titleInput.focus(),backdrop.addEventListener("click",e=>{e.target===backdrop&&(backdrop.remove(),state.editModal=null)}),btnSave.addEventListener("click",()=>{let newTitle=titleInput.value.trim();if(!newTitle)return;let url=PROTO_CONFIG.boardId?\`\${PROTO_CONFIG.apiUrl}/\${task.id}?boardId=\${encodeURIComponent(PROTO_CONFIG.boardId)}\`:\`\${PROTO_CONFIG.apiUrl}/\${task.id}\`;fetch(url,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:newTitle,status:statusSelect.value,type:typePicker.getValue(),description:textarea.value.trim()})}).then(r=>r.json()).then(d=>{d.success&&fetchTasksAndRender()}).catch(err=>console.error("[Vibeflow Studio]",err)),backdrop.remove(),state.editModal=null}),btnCancel.addEventListener("click",()=>{backdrop.remove(),state.editModal=null}),document.addEventListener("keydown",function onModalKey(e){if(!state.editModal){document.removeEventListener("keydown",onModalKey);return}e.key==="Escape"&&(backdrop.remove(),state.editModal=null,document.removeEventListener("keydown",onModalKey)),(e.ctrlKey||e.metaKey)&&e.key==="Enter"&&(btnSave.click(),document.removeEventListener("keydown",onModalKey))})}function fetchTasksAndRender(){fetchTasks()}function buildSourceRow(src){let row=el("div",{className:"modal-source-row"});if(!src.file&&!src.component)return row;let label="";src.file?(label=src.file.replace(/\\\\/g,"/").split("/").slice(-2).join("/"),src.line!=null&&(label+=\`:\${src.line}\`),src.col!=null&&(label+=\`:\${src.col}\`)):src.component&&(label=\`\\u2B21 \${src.component}\`),src.component&&src.file&&(label+=\` \\xB7 \\u2B21 \${src.component}\`);let sourceEl=el("span",{className:"modal-source-label",title:src.file??""},label);if(src.file&&src.line!=null){let link=el("a",{className:"modal-source-link",title:"Open in editor",href:\`vscode://file\${src.file}:\${src.line}\`,target:"_blank"},"\\u2197");row.append(sourceEl,link)}else row.append(sourceEl);return row}function showInspectModal(element,pointer){if(!state.root)return;state.editModal&&(state.editModal.remove(),state.editModal=null);let cssSelector=buildCssSelector(element),tag=element.tagName.toLowerCase(),elId=element.getAttribute("id"),classes=Array.from(element.classList).filter(c=>!c.startsWith("vibeflow-")),dataAttrs=Array.from(element.attributes).filter(a=>a.name.startsWith("data-")&&!a.name.startsWith("data-proto")).map(a=>({name:a.name,value:a.value})),heading=el("div",{className:"inspect-heading"},el("span",{className:"inspect-tag"},\`<\${tag}>\`),el("span",{className:"inspect-title"},"Element Inspector")),closeBtn=el("button",{className:"inspect-close"},"\\u2715");function makeRow(label,value,copyable=!0){let row=el("div",{className:"inspect-row"}),lbl=el("span",{className:"inspect-row-label"},label),val=el("code",{className:"inspect-row-value"},value||"\\u2014");if(row.append(lbl,val),copyable&&value){let btn=el("button",{className:"inspect-copy-btn",title:"Copy"},"\\u2398");btn.addEventListener("click",()=>{var _a;(_a=navigator.clipboard)==null||_a.writeText(value).catch(()=>{}),btn.textContent="\\u2713",setTimeout(()=>{btn.textContent="\\u2398"},1200)}),row.appendChild(btn)}return row}let rows=el("div",{className:"inspect-rows"});if(rows.appendChild(makeRow("Selector",pointer.selector)),cssSelector!==pointer.selector&&rows.appendChild(makeRow("CSS selector",cssSelector)),pointer.test_id&&rows.appendChild(makeRow("Test ID",pointer.test_id)),elId&&rows.appendChild(makeRow("id",elId)),classes.length>0&&rows.appendChild(makeRow("Classes",classes.join(" "))),pointer.file){let fileLine=pointer.file+(pointer.line!=null?\`:\${pointer.line}\`:"")+(pointer.col!=null?\`:\${pointer.col}\`:""),srcRow=makeRow("Source file",fileLine);if(pointer.line!=null){let openLink=el("a",{className:"inspect-copy-btn",title:"Open in VS Code",href:\`vscode://file\${pointer.file}:\${pointer.line}\`,target:"_blank"},"\\u2197");srcRow.appendChild(openLink)}rows.appendChild(srcRow)}pointer.component&&rows.appendChild(makeRow("Component",pointer.component));for(let attr of dataAttrs)rows.appendChild(makeRow(attr.name,attr.value));let copyAllBtn=el("button",{className:"inspect-copy-all-btn"},"\\u2398 Copy all");copyAllBtn.addEventListener("click",()=>{var _a;let lines=[];pointer.file&&lines.push(\`Source: \${pointer.file}\${pointer.line!=null?\`:\${pointer.line}\`:""}\${pointer.col!=null?\`:\${pointer.col}\`:""}\`),pointer.component&&lines.push(\`Component: \${pointer.component}\`),pointer.test_id&&lines.push(\`TestID: \${pointer.test_id}\`),lines.push(\`Selector: \${pointer.selector}\`),cssSelector!==pointer.selector&&lines.push(\`CSS selector: \${cssSelector}\`),elId&&lines.push(\`id: \${elId}\`),classes.length>0&&lines.push(\`Classes: \${classes.join(" ")}\`),(_a=navigator.clipboard)==null||_a.writeText(lines.join(\`
1614
+ \`)}\`}function clampTriggerPos(pos,viewport){let x=Math.max(8,Math.min(viewport.width-64,pos.x)),y=Math.max(8,Math.min(viewport.height-64,pos.y));return{x,y}}function parseCookies(){let cookies=[];if(!document.cookie)return cookies;for(let pair of document.cookie.split(";")){let trimmed=pair.trim();if(!trimmed)continue;let eqIdx=trimmed.indexOf("=");if(eqIdx===-1)continue;let name=trimmed.slice(0,eqIdx).trim(),value=trimmed.slice(eqIdx+1).trim();cookies.push({name,value,domain:location.hostname,path:"/",expires:-1,httpOnly:!1,secure:location.protocol==="https:",sameSite:"Lax"})}return cookies}function captureAuthState(){let localStorageData={};try{for(let i=0;i<localStorage.length;i++){let key=localStorage.key(i);key&&(localStorageData[key]=localStorage.getItem(key)??"")}}catch{}let sessionStorageData={};try{for(let i=0;i<sessionStorage.length;i++){let key=sessionStorage.key(i);key&&(sessionStorageData[key]=sessionStorage.getItem(key)??"")}}catch{}return{cookies:parseCookies(),localStorage:localStorageData,sessionStorage:sessionStorageData}}var AUTH_TTL_MS=1440*60*1e3;async function sendBaselineToServer(taskId,baseline){try{let cfg=PROTO_CONFIG,apiUrl=\`/api/tasks/\${taskId}/baseline\`;cfg!=null&&cfg.apiUrl&&(apiUrl=\`\${cfg.apiUrl.replace(/\\/api\\/(overlay\\/)?tasks$/,"")}/api/tasks/\${taskId}/baseline\`),cfg!=null&&cfg.boardId&&(apiUrl+=\`?boardId=\${encodeURIComponent(cfg.boardId)}\`);let headers={"Content-Type":"application/json"};cfg!=null&&cfg.overlayApiKey&&(headers["X-Overlay-Api-Key"]=cfg.overlayApiKey),await fetch(apiUrl,{method:"POST",headers,body:JSON.stringify({baseline})})}catch(err){console.error("[Vibeflow] Failed to store baseline:",err)}}async function sendPageBaselineToServer(taskId,page){try{let cfg=PROTO_CONFIG,apiUrl=\`/api/tasks/\${taskId}/baseline-page\`;cfg!=null&&cfg.apiUrl&&(apiUrl=\`\${cfg.apiUrl.replace(/\\/api\\/(overlay\\/)?tasks$/,"")}/api/tasks/\${taskId}/baseline-page\`),cfg!=null&&cfg.boardId&&(apiUrl+=\`?boardId=\${encodeURIComponent(cfg.boardId)}\`);let headers={"Content-Type":"application/json"};cfg!=null&&cfg.overlayApiKey&&(headers["X-Overlay-Api-Key"]=cfg.overlayApiKey),await fetch(apiUrl,{method:"POST",headers,body:JSON.stringify({page})})}catch(err){console.error("[Vibeflow] Failed to store page baseline:",err)}}async function captureAndStoreAuthState(taskId,taskAuthor){let authState=captureAuthState();try{let cfg=PROTO_CONFIG,apiUrl=\`/api/tasks/\${taskId}/auth-state\`;cfg!=null&&cfg.apiUrl&&(apiUrl=\`\${cfg.apiUrl.replace(/\\/api\\/(overlay\\/)?tasks$/,"")}/api/tasks/\${taskId}/auth-state\`),cfg!=null&&cfg.boardId&&(apiUrl+=\`?boardId=\${encodeURIComponent(cfg.boardId)}\`);let headers={"Content-Type":"application/json"};cfg!=null&&cfg.overlayApiKey&&(headers["X-Overlay-Api-Key"]=cfg.overlayApiKey),await fetch(apiUrl,{method:"POST",headers,body:JSON.stringify({authState,taskAuthor})})}catch(err){console.error("[Vibeflow] Failed to store auth state:",err)}}var RELEVANT_STYLES=["display","visibility","opacity","position","overflow","overflow-x","overflow-y","width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-width","border-style","border-color","border-radius","background-color","background-image","color","font-size","font-weight","font-style","font-family","line-height","letter-spacing","text-align","text-decoration","text-overflow","white-space","flex-direction","flex-wrap","flex","justify-content","align-items","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","z-index","box-shadow","transform","transition","cursor","user-select","pointer-events","top","left","right","bottom"];function buildKey(el2){let path=[],current=el2;for(;current&&current!==document.documentElement;){let parentEl=current.parentElement;if(!parentEl)break;let index=Array.from(parentEl.children).indexOf(current);path.unshift(index),current=parentEl}return path.join("/")}function buildDisplaySelector(el2){let tag=el2.tagName.toLowerCase(),taskId=el2.getAttribute("data-task-id");if(taskId)return\`\${tag}.task-card[data-task-id=\${taskId}]\`;let status=el2.getAttribute("data-status");if(status&&el2.classList.contains("column-scroll"))return\`\${tag}.column-scroll[data-status=\${status}]\`;let colId=el2.getAttribute("data-column-id");if(colId)return\`\${tag}[data-column-id=\${colId}]\`;let classes=Array.from(el2.classList).slice(0,2),selector=tag;classes.length&&(selector+="."+classes.join("."));let parent=el2.parentElement;if(parent){let siblings=Array.from(parent.children).filter(c=>c.tagName===el2.tagName);if(siblings.length>1){let idx=siblings.indexOf(el2)+1;selector+=\`:nth-of-type(\${idx})\`}}return selector}function filterStyles(el2,styles=RELEVANT_STYLES){let computed=window.getComputedStyle(el2),result={};for(let prop of styles)result[prop]=computed.getPropertyValue(prop);return result}function normalizeText(text,limit=200){return text.replace(/\\s+/g," ").trim().slice(0,limit)}function childSignature(children){let counts=new Map;for(let child of children){let tag=child.tagName.toLowerCase(),classes=Array.from(child.classList).slice(0,2).join("."),key=classes?\`\${tag}.\${classes}\`:tag;counts.set(key,(counts.get(key)||0)+1)}return Array.from(counts.entries()).map(([key,count])=>\`\${key} \\xD7\${count}\`).slice(0,10)}function getXPath(el2){let parts=[],node=el2;for(;node&&node!==document.documentElement;){let index=1,sibling=node.previousElementSibling;for(;sibling;)sibling.tagName===node.tagName&&index++,sibling=sibling.previousElementSibling;let tag=node.tagName.toLowerCase();parts.unshift(\`\${tag}[\${index}]\`),node=node.parentElement}return"/"+parts.join("/")}function getParentSnippet(el2){let parent=el2.parentElement;if(!parent||parent===document.body)return;let html=parent.outerHTML;return html.length<=500?html:html.slice(0,500)+"\\u2026"}function getBrowserString(){return navigator.userAgent}function capturePositionContext(el2){let rect=el2.getBoundingClientRect(),zIndex="auto",position="static",parentZIndex,current=el2;for(;current&&current!==document.documentElement;){let style=window.getComputedStyle(current),pos=style.position,z=style.zIndex;if(pos!=="static"||z!=="auto"){if(current===el2)position=pos,zIndex=z;else if(parentZIndex===void 0){parentZIndex=z;break}}if(pos!=="static")break;current=current.parentElement}return{boundingBox:{x:rect.x,y:rect.y,width:rect.width,height:rect.height},scrollPosition:{x:window.scrollX,y:window.scrollY},viewport:{width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio},stackingContext:{zIndex,position,parentZIndex}}}function captureComputedStyles(el2){let style=window.getComputedStyle(el2),result={};for(let prop of RELEVANT_STYLES)result[prop]=style.getPropertyValue(prop);return result}function captureDomSnapshot(el2,cssSelector,consoleErrors=[]){return{outerHTML:el2.outerHTML,computedStyles:captureComputedStyles(el2),selector:cssSelector,xpath:getXPath(el2),position:capturePositionContext(el2),parentSnippet:getParentSnippet(el2),browser:getBrowserString(),consoleErrors,capturedAt:new Date().toISOString()}}function capturePageSnapshot(maxElements=1e3){let elements={},count=0,truncated=!1,walker=document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode(node){if(count>=maxElements)return NodeFilter.FILTER_REJECT;let el2=node;return el2.classList.length>0||el2.hasAttribute("data-task-id")||el2.hasAttribute("data-status")||el2.hasAttribute("data-column-id")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),queue=[],n;for(;n=walker.nextNode();)queue.push(n);for(let el2 of queue){if(count>=maxElements){truncated=!0;break}let key=buildKey(el2),children=Array.from(el2.children),dataAttrs={};for(let a of Array.from(el2.attributes))a.name.startsWith("data-")&&(dataAttrs[a.name.slice(5)]=a.value);let position={x:0,y:0,width:0,height:0};try{let r=el2.getBoundingClientRect();position={x:Math.round(r.x),y:Math.round(r.y),width:Math.round(r.width),height:Math.round(r.height)}}catch{}elements[key]={key,selector:buildDisplaySelector(el2),tag:el2.tagName.toLowerCase(),classes:Array.from(el2.classList),dataAttrs,parentKey:el2.parentElement?buildKey(el2.parentElement):"",childCount:children.length,childSignature:childSignature(children),text:normalizeText(el2.textContent??""),position,baseline:filterStyles(el2,RELEVANT_STYLES),after:filterStyles(el2,RELEVANT_STYLES)},count++}return{version:1,capturedAt:new Date().toISOString(),truncated,elements}}var import_jsx_runtime30=__toESM(require_jsx_runtime(),1),_externalShowAddModal=null,_externalFlashTrigger=null,_externalSetTriggerVisible=null,_externalHideTrigger=null,_externalDisableOverlay=null;function showOverlayTrigger(){_externalSetTriggerVisible==null||_externalSetTriggerVisible()}function hideOverlayTrigger(){_externalHideTrigger==null||_externalHideTrigger()}function disableVibeflowOverlay(){_externalDisableOverlay==null||_externalDisableOverlay()}var TRIGGER_HIDDEN_KEY="vibeflow-trigger-hidden";function hasPrototypingApi(){return typeof window<"u"&&"__vf_prototyping"in window}function openPrototypingPanel(){let api=window.__vf_prototyping;api==null||api.openPanel()}function flashFavicon(durationMs=2200){let head=document.head,existing=head.querySelector('link[rel*="icon"]'),originalHref=(existing==null?void 0:existing.href)??"";existing&&existing.remove();let link=document.createElement("link");link.rel="icon",link.type="image/svg+xml";let animatedSvg='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" fill="none"><rect width="18" height="18" rx="4" fill="#2563eb"/><rect x="2.5" y="5" width="2" height="8" rx="1" fill="white" opacity=".7"><animate attributeName="height" values="3;13;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0s"/><animate attributeName="y" values="7.5;2.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0s"/></rect><rect x="6.5" y="2" width="2" height="14" rx="1" fill="white"><animate attributeName="height" values="3;15;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.15s"/><animate attributeName="y" values="7.5;1.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.15s"/></rect><rect x="10.5" y="6" width="2" height="6" rx="1" fill="white" opacity=".7"><animate attributeName="height" values="3;12;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.3s"/><animate attributeName="y" values="7.5;3;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.3s"/></rect><rect x="14.5" y="4" width="2" height="10" rx="1" fill="white" opacity=".85"><animate attributeName="height" values="3;13;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.45s"/><animate attributeName="y" values="7.5;2.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.45s"/></rect></svg>';link.href=\`data:image/svg+xml,\${encodeURIComponent(animatedSvg)}\`,head.appendChild(link),window.setTimeout(()=>{if(link.remove(),originalHref){let restore=document.createElement("link");restore.rel="icon",restore.type="image/svg+xml",restore.href=originalHref,head.appendChild(restore)}},durationMs)}function flashOverlayTrigger(){_externalFlashTrigger==null||_externalFlashTrigger()}function CornerTrigger({onClick,flashing,onHide,onDisable}){let svgIcon=(0,import_jsx_runtime30.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[(0,import_jsx_runtime30.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"currentColor",opacity:"0.7"}),(0,import_jsx_runtime30.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"currentColor"}),(0,import_jsx_runtime30.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"currentColor",opacity:"0.7"}),(0,import_jsx_runtime30.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"currentColor",opacity:"0.85"})]}),[pos,setPos]=import_react23.default.useState(()=>{try{let saved=localStorage.getItem("vibeflow-trigger-pos");if(saved){let parsed=JSON.parse(saved);if(typeof parsed.x=="number"&&isFinite(parsed.x)&&typeof parsed.y=="number"&&isFinite(parsed.y))return clampTriggerPos(parsed,{width:window.innerWidth,height:window.innerHeight})}}catch{}return null}),[isDragging,setIsDragging]=import_react23.default.useState(!1),[isHolding,setIsHolding]=import_react23.default.useState(!1),dragOrigin=import_react23.default.useRef(null),holdTimer=import_react23.default.useRef(null),didDrag=import_react23.default.useRef(!1),isRightClick=import_react23.default.useRef(!1),buttonRef=import_react23.default.useRef(null),posRef=import_react23.default.useRef(null);posRef.current=pos;let[ctxMenu,setCtxMenu]=import_react23.default.useState(null);import_react23.default.useEffect(()=>{if(pos)try{localStorage.setItem("vibeflow-trigger-pos",JSON.stringify(pos))}catch{}},[pos]),import_react23.default.useEffect(()=>{if(!ctxMenu)return;function onDocClick(){setCtxMenu(null)}return document.addEventListener("click",onDocClick,{once:!0}),()=>document.removeEventListener("click",onDocClick)},[ctxMenu]);function getInitialPos(el2){let rect=el2.getBoundingClientRect();return{x:rect.left,y:rect.top}}function onPointerDown(e){let target=e.currentTarget,pointerId=e.pointerId,clientX=e.clientX,clientY=e.clientY;didDrag.current=!1,isRightClick.current=e.button===2,!isRightClick.current&&(holdTimer.current=window.setTimeout(()=>{setIsHolding(!0);let startPos=posRef.current??getInitialPos(target);dragOrigin.current={mouseX:clientX,mouseY:clientY,posX:startPos.x,posY:startPos.y},target.setPointerCapture(pointerId)},300))}function onPointerMove(e){if(!dragOrigin.current)return;let dx=e.clientX-dragOrigin.current.mouseX,dy=e.clientY-dragOrigin.current.mouseY;!isDragging&&(Math.abs(dx)>3||Math.abs(dy)>3)&&setIsDragging(!0),didDrag.current=!0;let bw=window.innerWidth,bh=window.innerHeight,x=Math.max(8,Math.min(bw-64,dragOrigin.current.posX+dx)),y=Math.max(8,Math.min(bh-64,dragOrigin.current.posY+dy));setPos({x,y})}function onPointerUp(_e){holdTimer.current!==null&&(window.clearTimeout(holdTimer.current),holdTimer.current=null);let wasDragged=didDrag.current,wasRight=isRightClick.current;dragOrigin.current=null,setIsDragging(!1),setIsHolding(!1),didDrag.current=!1,isRightClick.current=!1,!wasDragged&&!wasRight&&onClick()}function onPointerCancel(){holdTimer.current!==null&&(window.clearTimeout(holdTimer.current),holdTimer.current=null),dragOrigin.current=null,setIsDragging(!1),setIsHolding(!1),didDrag.current=!1}let posStyle=pos===null?{}:{position:"fixed",left:pos.x,top:pos.y,bottom:"auto",right:"auto"},className=["vibeflow-corner-trigger",flashing?"saved-flash":"",isHolding?"trigger-holding":"",isDragging?"trigger-dragging":""].filter(Boolean).join(" "),title=isDragging?"Drag to reposition":isHolding?"Drag to reposition \\xB7 Release to open":"Open Kanban board \\xB7 Hold to drag";function onContextMenu(e){e.preventDefault(),e.stopPropagation();let MENU_W=120,ITEM_H=28,PAD=8,itemCount=2+(hasPrototypingApi()?1:0),MENU_H=ITEM_H*itemCount,x=Math.min(e.clientX,window.innerWidth-MENU_W-PAD),y=Math.min(e.clientY,window.innerHeight-MENU_H-PAD);setCtxMenu({x:Math.max(PAD,x),y:Math.max(PAD,y)})}return(0,import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment,{children:[(0,import_jsx_runtime30.jsx)("button",{ref:buttonRef,className,title,style:posStyle,onPointerDown,onPointerMove,onPointerUp,onPointerCancel,onContextMenu,"data-vibeflow-ignore":"true",children:svgIcon}),ctxMenu&&(0,import_jsx_runtime30.jsxs)("div",{className:"vibeflow-trigger-ctx-menu",style:{position:"fixed",left:ctxMenu.x,top:ctxMenu.y},onClick:e=>e.stopPropagation(),children:[hasPrototypingApi()&&(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:()=>{setCtxMenu(null),openPrototypingPanel()},children:"Prototyping"}),(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:()=>{setCtxMenu(null),onHide()},children:"Hide Vibeflow"}),(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:()=>{setCtxMenu(null),onDisable()},children:"Disable Vibeflow"})]})]})}var STATUS_OPTIONS=["backlog","todo","in-progress","review","done"],STATUS_ACTIVE={backlog:{background:"rgba(100,116,139,0.2)",borderColor:"rgba(100,116,139,0.5)",color:"#94a3b8"},todo:{background:"rgba(245,158,11,0.15)",borderColor:"rgba(245,158,11,0.4)",color:"#fcd34d"},"in-progress":{background:"rgba(59,130,246,0.15)",borderColor:"rgba(59,130,246,0.4)",color:"#93c5fd"},review:{background:"rgba(139,92,246,0.15)",borderColor:"rgba(139,92,246,0.4)",color:"#c4b5fd"},done:{background:"rgba(52,211,153,0.12)",borderColor:"rgba(52,211,153,0.4)",color:"#6ee7b7"}},PRIORITY_ACTIVE={Critical:{background:"rgba(239,68,68,0.15)",borderColor:"rgba(239,68,68,0.4)",color:"#fca5a5"},High:{background:"rgba(245,158,11,0.15)",borderColor:"rgba(245,158,11,0.4)",color:"#fcd34d"},Medium:{background:"rgba(100,116,139,0.2)",borderColor:"rgba(100,116,139,0.5)",color:"#94a3b8"},Low:{background:"transparent",borderColor:"var(--vibeflow-border-strong)",color:"var(--vibeflow-text-muted)"}};function OverlayAddModal({opts,onClose,onSubmit}){let[title,setTitle]=import_react23.default.useState(opts.initialTitle??""),[description,setDescription]=import_react23.default.useState(opts.initialDescription??""),[status,setStatus]=import_react23.default.useState("todo"),[showAdvanced,setShowAdvanced]=import_react23.default.useState(!1),[tags,setTags]=import_react23.default.useState([]),[tagDraft,setTagDraft]=import_react23.default.useState(""),[priority,setPriority]=import_react23.default.useState("");function commitTagDraft(){let parts=tagDraft.split(/[,\\n]/).map(p=>p.trim()).filter(p=>p.length>0);parts.length&&setTags(prev=>[...prev,...parts.filter(p=>!prev.includes(p))]),setTagDraft("")}let[type,setType]=import_react23.default.useState("Task"),[showPreview,setShowPreview]=import_react23.default.useState(!1),[titleError,setTitleError]=import_react23.default.useState(!1),titleRef=import_react23.default.useRef(null),[dragPos,setDragPos]=import_react23.default.useState(null),[isDragging,setIsDragging]=import_react23.default.useState(!1),dragOrigin=import_react23.default.useRef(null);function onHeaderPointerDown(e){if(e.target.closest("button, input, select, textarea, a"))return;e.currentTarget.setPointerCapture(e.pointerId);let startX=(dragPos==null?void 0:dragPos.x)??window.innerWidth/2-270,startY=(dragPos==null?void 0:dragPos.y)??window.innerHeight/2-200;dragOrigin.current={mouseX:e.clientX,mouseY:e.clientY,posX:startX,posY:startY},setIsDragging(!0)}function onHeaderPointerMove(e){if(!dragOrigin.current)return;let dx=e.clientX-dragOrigin.current.mouseX,dy=e.clientY-dragOrigin.current.mouseY;setDragPos({x:dragOrigin.current.posX+dx,y:dragOrigin.current.posY+dy})}function onHeaderPointerUp(){dragOrigin.current=null,setIsDragging(!1)}import_react23.default.useEffect(()=>{setTimeout(()=>{var _a;return(_a=titleRef.current)==null?void 0:_a.focus()},50)},[]);function handleBackdropClick(e){e.target===e.currentTarget&&onClose()}function handleKeyDown(e){e.key==="Escape"&&onClose(),(e.ctrlKey||e.metaKey)&&e.key==="Enter"&&handleSave()}async function handleSave(){var _a;let t=title.trim();if(!t){setTitleError(!0),(_a=titleRef.current)==null||_a.focus();return}setTitleError(!1);let desc=description.trim()||t;if(type==="Bug"){let logs=getRecordedLogs();logs&&(desc+=logs)}let result=await onSubmit(opts.selector??location.pathname,opts.cssSelector??location.pathname,t,desc,status,type,{file:opts.file,line:opts.line,col:opts.col,component:opts.component},{tags,priority:priority||void 0});if(result.success&&result.taskId){let baselineSelector=opts.cssSelector??opts.selector,targetEl=baselineSelector?document.querySelector(baselineSelector):null;if(targetEl&&baselineSelector)try{let snapshot=captureDomSnapshot(targetEl,baselineSelector);sendBaselineToServer(result.taskId,snapshot)}catch(err){console.error("[Vibeflow] Failed to capture baseline:",err)}captureAndStoreAuthState(result.taskId,result.taskAuthor??"unknown")}onClose()}let statusBtnBase={padding:"2px 8px",borderRadius:4,fontSize:11,cursor:"pointer",border:"1px solid var(--vibeflow-border-strong)",background:"transparent",color:"var(--vibeflow-text-muted)",fontFamily:"inherit",fontWeight:500,transition:"all .12s"},modalStyle=dragPos===null?{}:{position:"fixed",left:dragPos.x,top:dragPos.y,margin:0};return(0,import_jsx_runtime30.jsx)("div",{className:"vibeflow-modal-backdrop",onClick:handleBackdropClick,onKeyDown:handleKeyDown,children:(0,import_jsx_runtime30.jsxs)("div",{className:"vibeflow-modal overlay-add-modal",role:"dialog","aria-modal":"true",style:modalStyle,children:[(0,import_jsx_runtime30.jsxs)("div",{className:"modal-header overlay-modal-header",style:{cursor:isDragging?"grabbing":"grab",userSelect:"none"},onPointerDown:onHeaderPointerDown,onPointerMove:onHeaderPointerMove,onPointerUp:onHeaderPointerUp,children:[(0,import_jsx_runtime30.jsx)("span",{title:"Drag to move",style:{display:"flex",alignItems:"center",color:"var(--vibeflow-text-muted)",opacity:.5,flexShrink:0,pointerEvents:"none"},children:(0,import_jsx_runtime30.jsxs)("svg",{width:"12",height:"16",viewBox:"0 0 12 16",fill:"currentColor","aria-hidden":"true",children:[(0,import_jsx_runtime30.jsx)("circle",{cx:"3",cy:"3",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"9",cy:"3",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"3",cy:"8",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"9",cy:"8",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"3",cy:"13",r:"1.5"}),(0,import_jsx_runtime30.jsx)("circle",{cx:"9",cy:"13",r:"1.5"})]})}),(0,import_jsx_runtime30.jsx)(TypePicker,{value:type,onChange:setType}),(0,import_jsx_runtime30.jsx)("input",{ref:titleRef,type:"text",placeholder:"Task title\\u2026",value:title,onChange:e=>{setTitle(e.target.value),titleError&&e.target.value.trim()&&setTitleError(!1)},style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",border:\`1px solid \${titleError?"rgba(239,68,68,0.7)":"transparent"}\`,borderRadius:6,background:titleError?"rgba(239,68,68,0.07)":"transparent",color:"var(--vibeflow-text-primary)",fontFamily:"inherit",outline:"none",cursor:"text"},onFocus:e=>{titleError||(e.currentTarget.style.borderColor="var(--vibeflow-accent-strong)",e.currentTarget.style.background="var(--vibeflow-surface-elevated)")},onBlur:e=>{titleError||(e.currentTarget.style.borderColor="transparent",e.currentTarget.style.background="transparent")},onKeyDown:e=>{e.key==="Enter"&&handleSave(),e.key==="Escape"&&onClose()}}),titleError&&(0,import_jsx_runtime30.jsx)("span",{style:{fontSize:11,color:"rgba(239,68,68,0.9)",flexShrink:0,whiteSpace:"nowrap"},children:"Title is required"}),(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:onClose,style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--vibeflow-text-muted)",cursor:"pointer"},onMouseOver:e=>{e.currentTarget.style.background="var(--vibeflow-surface-hover)",e.currentTarget.style.color="var(--vibeflow-text-secondary)"},onMouseOut:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.color="var(--vibeflow-text-muted)"},"aria-label":"Close",children:"\\u2715"})]}),(0,import_jsx_runtime30.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",borderBottom:"1px solid var(--vibeflow-border-strong)"},children:[(0,import_jsx_runtime30.jsx)("span",{style:{fontSize:10,color:"var(--vibeflow-text-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},children:"Status"}),STATUS_OPTIONS.map(s=>(0,import_jsx_runtime30.jsx)("button",{type:"button",style:{...statusBtnBase,...s===status?STATUS_ACTIVE[s]:{}},onClick:()=>setStatus(s),onMouseOver:e=>{s!==status&&(e.currentTarget.style.background="var(--vibeflow-surface-hover)",e.currentTarget.style.color="var(--vibeflow-text-secondary)")},onMouseOut:e=>{s!==status&&(e.currentTarget.style.background="transparent",e.currentTarget.style.color="var(--vibeflow-text-muted)")},children:s},s))]}),(opts.file||opts.component)&&(0,import_jsx_runtime30.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 16px",background:"var(--vibeflow-surface-elevated)",borderBottom:"1px solid var(--vibeflow-border-subtle)",fontSize:11,color:"var(--vibeflow-text-muted)"},children:[opts.file&&(0,import_jsx_runtime30.jsxs)("a",{href:\`vscode://file\${opts.file}\${opts.line==null?"":\`:\${opts.line}\`}\`,target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"var(--vibeflow-accent-soft)",border:"1px solid var(--vibeflow-accent-border)",color:"var(--vibeflow-accent-strong)",textDecoration:"none",fontSize:11},children:["\\u{1F5CE} ",opts.file.split("/").slice(-2).join("/"),opts.line==null?"":\`:\${opts.line}\`]}),opts.component&&(0,import_jsx_runtime30.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"rgba(139,92,246,0.08)",border:"1px solid rgba(139,92,246,0.25)",color:"#8b5cf6",fontSize:11},children:["\\u2B21 ",opts.component]})]}),(0,import_jsx_runtime30.jsxs)("div",{className:"modal-tabs",children:[(0,import_jsx_runtime30.jsx)("div",{className:\`modal-tab\${showPreview?"":" active"}\`,onClick:()=>setShowPreview(!1),children:"Edit"}),(0,import_jsx_runtime30.jsx)("div",{className:\`modal-tab\${showPreview?" active":""}\`,onClick:()=>setShowPreview(!0),children:"Preview"})]}),(0,import_jsx_runtime30.jsx)("div",{className:"modal-body",children:showPreview?(0,import_jsx_runtime30.jsx)(MarkdownPreview,{markdown:description,className:"modal-preview-pane"}):(0,import_jsx_runtime30.jsx)("div",{className:"modal-editor-pane",children:(0,import_jsx_runtime30.jsx)(AutoExpandTextarea,{className:"dp-textarea",placeholder:"Description (markdown supported)\\u2026",value:description,onChange:setDescription,baseRows:5,maxRows:14})})}),type==="Bug"&&(0,import_jsx_runtime30.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 16px",background:"rgba(239,68,68,0.06)",borderTop:"1px solid rgba(239,68,68,0.18)",fontSize:11,color:"rgba(239,68,68,0.75)"},children:[(0,import_jsx_runtime30.jsx)("span",{children:"\\u{1F534}"}),(0,import_jsx_runtime30.jsx)("span",{children:"Console errors & warnings will be attached to this report"})]}),(0,import_jsx_runtime30.jsxs)("div",{style:{borderTop:"1px solid var(--vibeflow-border-subtle)"},children:[(0,import_jsx_runtime30.jsxs)("button",{type:"button",onClick:()=>setShowAdvanced(v=>!v),style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 16px",background:"transparent",border:"none",cursor:"pointer",fontSize:11,fontWeight:600,color:"var(--vibeflow-text-muted)",fontFamily:"inherit"},children:[(0,import_jsx_runtime30.jsx)("span",{style:{display:"inline-block",fontSize:9,transition:"transform .12s",transform:showAdvanced?"rotate(90deg)":"none"},children:"\\u25B6"}),"Advanced"]}),showAdvanced&&(0,import_jsx_runtime30.jsxs)("div",{style:{padding:"2px 16px 10px",display:"flex",flexDirection:"column",gap:8},children:[(0,import_jsx_runtime30.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,import_jsx_runtime30.jsx)("span",{style:{fontSize:10,color:"var(--vibeflow-text-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},children:"Tags"}),tags.map(tag=>(0,import_jsx_runtime30.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"1px 4px 1px 8px",borderRadius:100,background:"rgba(59,130,246,0.12)",border:"1px solid rgba(59,130,246,0.3)",fontSize:10,color:"#93c5fd",fontWeight:600},children:[tag,(0,import_jsx_runtime30.jsx)("button",{type:"button",onClick:()=>setTags(prev=>prev.filter(x=>x!==tag)),style:{display:"flex",background:"none",border:"none",color:"#93c5fd",cursor:"pointer",padding:0,lineHeight:1},children:"\\u2715"})]},tag)),(0,import_jsx_runtime30.jsx)("input",{value:tagDraft,onChange:e=>setTagDraft(e.target.value),onKeyDown:e=>{(e.key==="Enter"||e.key===",")&&(e.preventDefault(),commitTagDraft())},onBlur:commitTagDraft,placeholder:"Add tag\\u2026",style:{flex:"1 1 90px",minWidth:90,background:"transparent",border:"1px dashed var(--vibeflow-border-strong)",borderRadius:4,padding:"2px 6px",fontSize:11,color:"var(--vibeflow-text-secondary)",fontFamily:"inherit",outline:"none"}})]}),(0,import_jsx_runtime30.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,import_jsx_runtime30.jsx)("span",{style:{fontSize:10,color:"var(--vibeflow-text-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},children:"Priority"}),["Critical","High","Medium","Low"].map(p=>(0,import_jsx_runtime30.jsx)("button",{type:"button",style:{...statusBtnBase,...p===priority?PRIORITY_ACTIVE[p]:{}},onClick:()=>setPriority(prev=>prev===p?"":p),children:p},p))]})]})]}),(0,import_jsx_runtime30.jsxs)("div",{className:"modal-footer",children:[(0,import_jsx_runtime30.jsxs)("div",{className:"modal-footer-left",children:[(0,import_jsx_runtime30.jsx)("button",{type:"button",className:"btn-primary",onClick:handleSave,disabled:!title.trim(),style:{opacity:title.trim()?1:.45,cursor:title.trim()?"pointer":"not-allowed"},children:"Add Task"}),(0,import_jsx_runtime30.jsx)("button",{type:"button",className:"btn-ghost",onClick:onClose,children:"Cancel"})]}),(0,import_jsx_runtime30.jsx)("div",{className:"modal-footer-center",children:(0,import_jsx_runtime30.jsx)("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--vibeflow-text-muted)",cursor:"pointer",userSelect:"none"}})})]})]})})}function OverlayApp({onOpenKanban,onSubmitTask}){let[addModalOpts,setAddModalOpts]=import_react23.default.useState(null),[triggerFlashing,setTriggerFlashing]=import_react23.default.useState(!1),[isHidden,setIsHidden]=import_react23.default.useState(()=>{try{return localStorage.getItem(TRIGGER_HIDDEN_KEY)==="1"}catch{return!1}});import_react23.default.useEffect(()=>(_externalShowAddModal=opts=>setAddModalOpts(opts),_externalFlashTrigger=()=>{setTriggerFlashing(!0),window.setTimeout(()=>setTriggerFlashing(!1),1500),flashFavicon()},_externalSetTriggerVisible=()=>{try{localStorage.removeItem(TRIGGER_HIDDEN_KEY)}catch{}setIsHidden(!1)},_externalHideTrigger=()=>{try{localStorage.setItem(TRIGGER_HIDDEN_KEY,"1")}catch{}setIsHidden(!0)},_externalDisableOverlay=()=>{state.disabled=!0,state.host&&(state.host.remove(),state.host=null)},()=>{_externalShowAddModal=null,_externalFlashTrigger=null,_externalSetTriggerVisible=null,_externalHideTrigger=null,_externalDisableOverlay=null}),[]);let isKanbanPage=typeof document<"u"&&document.body.hasAttribute("data-vibeflow-cli-kanban");return(0,import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment,{children:[!isKanbanPage&&!isHidden&&(0,import_jsx_runtime30.jsx)(CornerTrigger,{onClick:onOpenKanban,flashing:triggerFlashing,onHide:()=>{try{localStorage.setItem(TRIGGER_HIDDEN_KEY,"1")}catch{}setIsHidden(!0)},onDisable:()=>{state.disabled=!0,state.host&&(state.host.remove(),state.host=null)}}),addModalOpts!==null&&(0,import_jsx_runtime30.jsx)(OverlayAddModal,{opts:addModalOpts,onClose:()=>setAddModalOpts(null),onSubmit:async(selector,cssSelector,title,description,status,type,meta,advanced)=>{let result=await onSubmitTask(selector,cssSelector,title,description,status,type,meta,advanced);return setAddModalOpts(null),result}})]})}function buildTypePickerEl(initialType="Task"){let selectedType=initialType,detailed=TASK_TYPES,currentInfo=()=>detailed.find(t=>t.value===selectedType)??detailed[0],container=el("div",{className:"type-picker"}),trigger=el("button",{className:"type-picker-trigger",type:"button"}),dropdown=el("div",{className:"type-picker-dropdown"}),refresh=()=>{let info=currentInfo();trigger.title=(info==null?void 0:info.tooltip)??"",trigger.replaceChildren(el("span",{className:"type-picker-icon"},(info==null?void 0:info.icon)??""),el("span",{className:"type-picker-label"},(info==null?void 0:info.label)??"")),dropdown.replaceChildren();for(let t of detailed){let opt=el("button",{className:t.value===selectedType?"type-picker-option type-picker-option--active":"type-picker-option",type:"button",title:t.tooltip},el("span",{className:"type-picker-icon"},t.icon),el("span",{className:"type-picker-label"},t.label));opt.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),selectedType=t.value,refresh(),dropdown.classList.remove("open")}),dropdown.appendChild(opt)}};return trigger.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),dropdown.classList.toggle("open")}),refresh(),container.append(trigger,dropdown),{el:container,getValue:()=>selectedType,setValue:v=>{selectedType=v,refresh()}}}function renderMarkdown2(md){return md?md.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/[*][*](.+?)[*][*]/g,"<strong>$1</strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/[*](.+?)[*]/g,"<em>$1</em>").replace(/_([^_]+?)_/g,"<em>$1</em>").replace(/\`(.+?)\`/g,"<code>$1</code>").replace(/^[-*] (.+)$/gm,"<li>$1</li>").replace(/^---$/gm,"<hr>").replace(/(<li>[\\s\\S]*?<\\/li>\\n?)+/g,m=>\`<ul>\${m}</ul>\`).replace(/^(?!<[a-z]|$).+$/gm,line=>\`<p>\${line}</p>\`):'<span class="modal-preview-empty">No description yet</span>'}function showEditModal(task){if(!state.root)return;state.editModal&&(state.editModal.remove(),state.editModal=null);let titleInput=el("input",{type:"text",placeholder:"Task title..."});titleInput.value=task.title??"";let statusSelect=el("select");for(let s of["backlog","todo","in-progress","review","done"]){let opt=el("option",{value:s},s);s===task.status&&(opt.selected=!0),statusSelect.appendChild(opt)}let typePicker=buildTypePickerEl(task.type??"Task"),header=el("div",{className:"modal-header"},titleInput,typePicker.el,statusSelect),tabEdit=el("div",{className:"modal-tab active"},"Edit"),tabPreview=el("div",{className:"modal-tab"},"Preview"),tabs=el("div",{className:"modal-tabs"},tabEdit,tabPreview),textarea=el("textarea",{placeholder:"Description (markdown supported)..."});textarea.value=task.description??"";let editorPane=el("div",{className:"modal-editor-pane"},textarea),previewPane=el("div",{className:"modal-preview-pane"});previewPane.style.display="none";let refreshPreview=()=>{previewPane.innerHTML=renderMarkdown2(textarea.value)},body=el("div",{className:"modal-body"},editorPane,previewPane);tabEdit.addEventListener("click",()=>{tabEdit.classList.add("active"),tabPreview.classList.remove("active"),editorPane.style.display="",previewPane.style.display="none"}),tabPreview.addEventListener("click",event=>{event.isTrusted&&(tabPreview.classList.add("active"),tabEdit.classList.remove("active"),editorPane.style.display="none",previewPane.style.display="",refreshPreview())});let btnSave=el("button",{className:"btn-primary"},"Save"),btnCancel=el("button",{className:"btn-ghost"},"Cancel"),footerLeft=el("div",{className:"modal-footer-left"},btnSave,btnCancel),footerRight=el("div",{className:"modal-footer-right"}),footerCenter=buildSourceRow({file:task.file,line:task.line,col:task.col,component:task.component}),footer=el("div",{className:"modal-footer"},footerLeft,footerCenter,footerRight),modal=el("div",{className:"vibeflow-modal"},header,tabs,body,footer),backdrop=el("div",{className:"vibeflow-modal-backdrop"},modal);state.editModal=backdrop,state.root.appendChild(backdrop),titleInput.focus(),backdrop.addEventListener("click",e=>{e.target===backdrop&&(backdrop.remove(),state.editModal=null)}),btnSave.addEventListener("click",()=>{let newTitle=titleInput.value.trim();if(!newTitle)return;let url=PROTO_CONFIG.boardId?\`\${PROTO_CONFIG.apiUrl}/\${task.id}?boardId=\${encodeURIComponent(PROTO_CONFIG.boardId)}\`:\`\${PROTO_CONFIG.apiUrl}/\${task.id}\`;fetch(url,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:newTitle,status:statusSelect.value,type:typePicker.getValue(),description:textarea.value.trim()})}).then(r=>r.json()).then(d=>{d.success&&fetchTasksAndRender()}).catch(err=>console.error("[Vibeflow Studio]",err)),backdrop.remove(),state.editModal=null}),btnCancel.addEventListener("click",()=>{backdrop.remove(),state.editModal=null}),document.addEventListener("keydown",function onModalKey(e){if(!state.editModal){document.removeEventListener("keydown",onModalKey);return}e.key==="Escape"&&(backdrop.remove(),state.editModal=null,document.removeEventListener("keydown",onModalKey)),(e.ctrlKey||e.metaKey)&&e.key==="Enter"&&(btnSave.click(),document.removeEventListener("keydown",onModalKey))})}function fetchTasksAndRender(){fetchTasks()}function buildSourceRow(src){let row=el("div",{className:"modal-source-row"});if(!src.file&&!src.component)return row;let label="";src.file?(label=src.file.replace(/\\\\/g,"/").split("/").slice(-2).join("/"),src.line!=null&&(label+=\`:\${src.line}\`),src.col!=null&&(label+=\`:\${src.col}\`)):src.component&&(label=\`\\u2B21 \${src.component}\`),src.component&&src.file&&(label+=\` \\xB7 \\u2B21 \${src.component}\`);let sourceEl=el("span",{className:"modal-source-label",title:src.file??""},label);if(src.file&&src.line!=null){let link=el("a",{className:"modal-source-link",title:"Open in editor",href:\`vscode://file\${src.file}:\${src.line}\`,target:"_blank"},"\\u2197");row.append(sourceEl,link)}else row.append(sourceEl);return row}function showInspectModal(element,pointer){if(!state.root)return;state.editModal&&(state.editModal.remove(),state.editModal=null);let cssSelector=buildCssSelector(element),tag=element.tagName.toLowerCase(),elId=element.getAttribute("id"),classes=Array.from(element.classList).filter(c=>!c.startsWith("vibeflow-")),dataAttrs=Array.from(element.attributes).filter(a=>a.name.startsWith("data-")&&!a.name.startsWith("data-proto")).map(a=>({name:a.name,value:a.value})),heading=el("div",{className:"inspect-heading"},el("span",{className:"inspect-tag"},\`<\${tag}>\`),el("span",{className:"inspect-title"},"Element Inspector")),closeBtn=el("button",{className:"inspect-close"},"\\u2715");function makeRow(label,value,copyable=!0){let row=el("div",{className:"inspect-row"}),lbl=el("span",{className:"inspect-row-label"},label),val=el("code",{className:"inspect-row-value"},value||"\\u2014");if(row.append(lbl,val),copyable&&value){let btn=el("button",{className:"inspect-copy-btn",title:"Copy"},"\\u2398");btn.addEventListener("click",()=>{var _a;(_a=navigator.clipboard)==null||_a.writeText(value).catch(()=>{}),btn.textContent="\\u2713",setTimeout(()=>{btn.textContent="\\u2398"},1200)}),row.appendChild(btn)}return row}let rows=el("div",{className:"inspect-rows"});if(rows.appendChild(makeRow("Selector",pointer.selector)),cssSelector!==pointer.selector&&rows.appendChild(makeRow("CSS selector",cssSelector)),pointer.test_id&&rows.appendChild(makeRow("Test ID",pointer.test_id)),elId&&rows.appendChild(makeRow("id",elId)),classes.length>0&&rows.appendChild(makeRow("Classes",classes.join(" "))),pointer.file){let fileLine=pointer.file+(pointer.line!=null?\`:\${pointer.line}\`:"")+(pointer.col!=null?\`:\${pointer.col}\`:""),srcRow=makeRow("Source file",fileLine);if(pointer.line!=null){let openLink=el("a",{className:"inspect-copy-btn",title:"Open in VS Code",href:\`vscode://file\${pointer.file}:\${pointer.line}\`,target:"_blank"},"\\u2197");srcRow.appendChild(openLink)}rows.appendChild(srcRow)}pointer.component&&rows.appendChild(makeRow("Component",pointer.component));for(let attr of dataAttrs)rows.appendChild(makeRow(attr.name,attr.value));let copyAllBtn=el("button",{className:"inspect-copy-all-btn"},"\\u2398 Copy all");copyAllBtn.addEventListener("click",()=>{var _a;let lines=[];pointer.file&&lines.push(\`Source: \${pointer.file}\${pointer.line!=null?\`:\${pointer.line}\`:""}\${pointer.col!=null?\`:\${pointer.col}\`:""}\`),pointer.component&&lines.push(\`Component: \${pointer.component}\`),pointer.test_id&&lines.push(\`TestID: \${pointer.test_id}\`),lines.push(\`Selector: \${pointer.selector}\`),cssSelector!==pointer.selector&&lines.push(\`CSS selector: \${cssSelector}\`),elId&&lines.push(\`id: \${elId}\`),classes.length>0&&lines.push(\`Classes: \${classes.join(" ")}\`),(_a=navigator.clipboard)==null||_a.writeText(lines.join(\`
1611
1615
  \`)).catch(()=>{}),copyAllBtn.textContent="\\u2713 Copied!",setTimeout(()=>{copyAllBtn.textContent="\\u2398 Copy all"},1500)});let box=el("div",{className:"vibeflow-inspect-modal"},el("div",{className:"inspect-header"},heading,closeBtn),rows,el("div",{className:"inspect-footer"},copyAllBtn)),backdrop=el("div",{className:"vibeflow-modal-backdrop"},box);state.editModal=backdrop,state.root.appendChild(backdrop),closeBtn.addEventListener("click",()=>{backdrop.remove(),state.editModal=null}),backdrop.addEventListener("click",e=>{e.target===backdrop&&(backdrop.remove(),state.editModal=null)}),document.addEventListener("keydown",function onInspectKey(e){if(!state.editModal){document.removeEventListener("keydown",onInspectKey);return}e.key==="Escape"&&(backdrop.remove(),state.editModal=null,document.removeEventListener("keydown",onInspectKey))})}function getTaskTypeTooltip(type){var _a;return((_a=TASK_TYPES.find(t=>t.value===(type??"Task")))==null?void 0:_a.tooltip)??""}function buildOverlayTaskCard(task,options){let{currentPath,onOpen,onDone,onDelete,showSelector=!0,showDescription=!0,showActions=!1}=options,statusBadge=el("span",{className:\`status-badge status-\${task.status.replace(" ","-")}\`},task.status),effectiveType=task.type??"Task",typeBadge=el("span",{className:\`type-badge type-badge-\${effectiveType.toLowerCase()}\`,title:getTaskTypeTooltip(effectiveType)},effectiveType),header=el("div",{className:"task-card-header"},statusBadge,typeBadge);task.status==="in-progress"&&header.appendChild(el("span",{className:"task-spinner"})),task.url&&task.url!==currentPath&&header.appendChild(el("span",{className:"task-url-badge"},task.url));let icon=getTaskTypeIcon(task.type),card=el("div",{className:task.status==="in-progress"?"task-card in-progress":"task-card"},el("span",{className:"task-watermark",title:\`Type: \${task.type??"Task"}\`},icon),header,el("div",{className:"task-title"},task.title??"Untitled"));if(showSelector&&card.appendChild(el("div",{className:"task-selector"},task.selector)),showDescription&&task.description&&card.appendChild(el("div",{className:"task-description"},task.description)),card.addEventListener("click",e=>{var _a,_b;(_b=(_a=e.target).closest)!=null&&_b.call(_a,".task-actions")||onOpen(task)}),showActions){let actions=el("div",{className:"task-actions"});if(task.status!=="done"&&onDone){let doneBtn=el("button",{className:"done-btn"},"\\u2713 Done");doneBtn.addEventListener("click",e=>{e.stopPropagation(),onDone(task)}),actions.appendChild(doneBtn)}if(onDelete){let deleteBtn=el("button",{className:"delete-btn"},"\\u2715");deleteBtn.addEventListener("click",e=>{e.stopPropagation(),onDelete(task)}),actions.appendChild(deleteBtn)}card.appendChild(actions)}return card}function renderIndicators(){if(!state.indicatorContainer||(state.indicatorContainer.replaceChildren(),forceHideTooltip(),!state.indicatorsVisible||state.tasks.length===0))return;let currentPath=location.pathname,pageTasks=state.tasks.filter(t=>!t.url||t.url===currentPath);if(pageTasks.length===0)return;let bySelector={};for(let t of pageTasks){let domSel=t.cssSelector||t.selector;bySelector[domSel]||(bySelector[domSel]=[]),bySelector[domSel].push(t)}let vpW=window.innerWidth||document.documentElement.clientWidth,vpH=window.innerHeight||document.documentElement.clientHeight;for(let sel of Object.keys(bySelector)){let group=bySelector[sel],targetEl;try{targetEl=document.querySelector(sel)}catch{continue}if(!targetEl)continue;let rect=targetEl.getBoundingClientRect();if(rect.width===0&&rect.height===0||rect.bottom<0||rect.top>vpH||rect.right<0||rect.left>vpW)continue;let activeTasks=group.filter(t=>t.status!=="done"),allDone=activeTasks.length===0;if(allDone&&!state.sidebarShowDone)continue;let indicator=el("div",{className:"vibeflow-task-indicator"+(allDone?" all-done":"")});indicator.textContent=allDone?"\\u2713":String(activeTasks.length),indicator.style.left=\`\${rect.right-10}px\`,indicator.style.top=\`\${rect.top-10}px\`;let grp=group,capturedAllDone=allDone;indicator.addEventListener("mouseenter",()=>{state.tooltipPinned||showIndicatorTooltip(indicator,grp)}),indicator.addEventListener("mouseleave",e=>{if(state.tooltipPinned)return;let rel=e.relatedTarget;state.activeTooltip&&rel&&(rel===state.activeTooltip||state.activeTooltip.contains(rel))||hideIndicatorTooltip()}),indicator.addEventListener("click",e=>{e.stopPropagation(),grp.length===1?(forceHideTooltip(),showEditModal(grp[0])):(forceHideTooltip(),showIndicatorTooltip(indicator,grp),state.tooltipPinned=!0)}),state.indicatorContainer.appendChild(indicator)}}function scheduleRenderIndicators(){state.indicatorRafId||(state.indicatorRafId=requestAnimationFrame(()=>{state.indicatorRafId=null,renderIndicators()}))}function hideIndicatorTooltip(){state.tooltipPinned||state.activeTooltip&&(state.activeTooltip.remove(),state.activeTooltip=null)}function forceHideTooltip(){state.tooltipPinned=!1,state.activeTooltip&&(state.activeTooltip.remove(),state.activeTooltip=null)}function showIndicatorTooltip(indicator,group){if(!state.root)return;hideIndicatorTooltip();let tooltip=el("div",{className:"vibeflow-task-tooltip"}),closeBtn=el("button",{className:"tooltip-close-btn"},"\\u2715");closeBtn.addEventListener("click",e=>{e.stopPropagation(),forceHideTooltip()}),tooltip.appendChild(closeBtn);for(let task of group){let card=buildOverlayTaskCard(task,{currentPath:location.pathname,showSelector:!1,showDescription:!0,showActions:!1,onOpen:capturedTask=>{forceHideTooltip(),showEditModal(capturedTask)}});tooltip.appendChild(card)}let iRect=indicator.getBoundingClientRect();tooltip.style.left=\`\${Math.min(iRect.right+6,window.innerWidth-330)}px\`,tooltip.style.top=\`\${Math.max(4,Math.min(iRect.top-8,window.innerHeight-420))}px\`,tooltip.addEventListener("mouseleave",hideIndicatorTooltip),state.root.appendChild(tooltip),state.activeTooltip=tooltip}function setupIndicatorScrollRefresh(){window.addEventListener("scroll",scheduleRenderIndicators,!0),window.addEventListener("resize",scheduleRenderIndicators)}function setupInteractionDebounce(host){let interactionDebounce=null;function onUserInteraction(e){e.composedPath().indexOf(host)===-1&&(interactionDebounce&&clearTimeout(interactionDebounce),interactionDebounce=setTimeout(()=>{interactionDebounce=null,renderIndicators()},150))}document.addEventListener("click",onUserInteraction,!0),document.addEventListener("keyup",onUserInteraction,!0)}function setupClickOutsideTooltipClose(host){document.addEventListener("click",e=>{!state.tooltipPinned||!state.activeTooltip||(e.composedPath?e.composedPath():[e.target]).includes(host)||forceHideTooltip()},!0)}function detectReactQuality(root=document){let sampleElements=Array.from(root.querySelectorAll("*")).slice(0,50),hasReact=!1,hasDebugSource=!1,hasDebugOwner=!1;for(let elem of sampleElements){for(let key of Object.keys(elem)){if(!key.startsWith("__reactFiber$")&&!key.startsWith("__reactInternalInstance"))continue;hasReact=!0;let fiber=elem[key];if(fiber!=null&&fiber._debugSource){hasDebugSource=!0;break}if(fiber!=null&&fiber._debugStack){hasDebugSource=!0;break}fiber!=null&&fiber._debugOwner&&(hasDebugOwner=!0)}if(hasDebugSource)break}return hasReact?hasDebugSource?"full":hasDebugOwner?"partial":"none":"not-react"}var SHOWN_KEY="vibeflow-react-quality-shown";function hasShownQualityModal(){try{return!!localStorage.getItem(SHOWN_KEY)}catch{return!1}}function markQualityModalShown(){try{localStorage.setItem(SHOWN_KEY,"1")}catch{}}function showReactQualityModal(quality){if(!state.root)return;closeReactQualityModal(),markQualityModalShown();let levelCards=[{icon:"\\u{1F7E2}",label:"Full context",color:"#4ade80",desc:"React dev mode + source maps. Component name + source file + line.",active:quality==="full"},{icon:"\\u{1F7E1}",label:"Partial",color:"#fbbf24",desc:"React dev mode, but no debug stack found. Component name only.",active:quality==="partial"},{icon:"\\u{1F534}",label:"No context",color:"#f87171",desc:"Production build. DOM selectors only \\u2014 no component or source info.",active:quality==="none"}].map(lv=>{let card=el("div",{className:"rq-level"+(lv.active?" rq-level--active":"")});return card.appendChild(el("div",{className:"rq-level-icon"},lv.icon)),card.appendChild(Object.assign(el("div",{className:"rq-level-label"},lv.label),{style:\`color:\${lv.color}\`})),card.appendChild(el("div",{className:"rq-level-desc"},lv.desc)),card}),levelRow=el("div",{className:"rq-levels"},...levelCards),heading=el("div",{className:"rq-heading"},{full:"You have full context",partial:"You have partial context",none:"No React context available","not-react":"React not detected"}[quality]??"React context"),features=buildFeatureRows(quality),header=el("div",{className:"rq-header"},heading,levelRow),body=el("div",{className:"rq-body"},...features),closeBtn=el("button",{className:"rq-close",title:"Close","aria-label":"Close"},"\\u2715"),btnContinue=el("button",{className:"rq-btn rq-btn-secondary"},"Continue annotating"),footer=el("div",{className:"rq-footer"},btnContinue),modal=el("div",{className:"vibeflow-rq-modal",id:"vibeflow-rq-modal"},closeBtn,header,body,footer),overlay=el("div",{className:"vibeflow-rq-overlay",id:"vibeflow-rq-overlay"},modal);function close(){overlay.remove()}closeBtn.addEventListener("click",close),btnContinue.addEventListener("click",close),overlay.addEventListener("click",e=>{e.target===overlay&&close()}),state.root.appendChild(overlay)}function closeReactQualityModal(){var _a,_b;(_b=(_a=state.root)==null?void 0:_a.querySelector("#vibeflow-rq-overlay"))==null||_b.remove()}function featureRow(icon,text,detail){let row=el("div",{className:"rq-feature"});row.appendChild(el("span",{className:"rq-feature-icon"},icon));let textEl=el("div",{className:"rq-feature-text"});return textEl.appendChild(el("strong",null,text)),textEl.appendChild(el("span",null," \\u2014 "+detail)),row.appendChild(textEl),row}function codeBlock(code){let pre=el("pre",{className:"rq-codeblock"});return pre.appendChild(el("code",null,code)),pre}function sectionTitle(title){return el("div",{className:"rq-section-title"},title)}function buildFeatureRows(quality){let rows=[];return rows.push(sectionTitle("What is captured now")),rows.push(featureRow("\\u2705","CSS selector","always available \\u2014 stable element targeting")),quality==="full"?(rows.push(featureRow("\\u2705","Component name","from React fiber (_debugOwner)")),rows.push(featureRow("\\u2705","Source file + line","resolved via source maps (React 18.3+ _debugStack or legacy _debugSource)")),rows.push(el("div",{className:"rq-note rq-note--success"},"You have the best possible context. Your agent receives component name, source file, and line number for each annotation.")),rows):(quality==="partial"&&(rows.push(featureRow("\\u2705","Component name","from React fiber (_debugOwner)")),rows.push(featureRow("\\u274C","Source file + line","no debug stack found on React fibers")),rows.push(sectionTitle("How to get source file + line")),rows.push(el("div",{className:"rq-note rq-note--amber"},"Source file resolution requires React dev mode with debug stacks (_debugStack / _debugSource) and source maps served by your bundler. Both are enabled by default when running in development mode.")),rows.push(codeBlock(\`# Next.js
1612
1616
  next dev (or: npm run dev)
1613
1617
 
@@ -1618,7 +1622,7 @@ npm run dev (NODE_ENV=development)
1618
1622
  next dev (or: npm run dev)
1619
1623
 
1620
1624
  # 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?element.getBoundingClientRect().left:x,posY=y===void 0?element.getBoundingClientRect().bottom+8:y;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).then(result=>{if(result.taskId)try{let snapshot=captureDomSnapshot(element,cssSelector);sendBaselineToServer(result.taskId,snapshot);try{let pageSnapshot=capturePageSnapshot();sendPageBaselineToServer(result.taskId,pageSnapshot)}catch(err){console.error("[Vibeflow] Failed to capture page baseline:",err)}}catch(err){console.error("[Vibeflow] Failed to capture baseline:",err)}}),(_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_react24=__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_react24.default.createElement(OverlayApp,{onOpenKanban:()=>{if(PROTO_CONFIG.boardId)try{let origin=new URL(PROTO_CONFIG.apiUrl).origin;window.open(\`\${origin}/kanban?board=\${encodeURIComponent(PROTO_CONFIG.boardId)}\`,"_blank","noopener")}catch{}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();})();
1625
+ 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?element.getBoundingClientRect().left:x,posY=y===void 0?element.getBoundingClientRect().bottom+8:y;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).then(result=>{if(result.taskId)try{let snapshot=captureDomSnapshot(element,cssSelector);sendBaselineToServer(result.taskId,snapshot);try{let pageSnapshot=capturePageSnapshot();sendPageBaselineToServer(result.taskId,pageSnapshot)}catch(err){console.error("[Vibeflow] Failed to capture page baseline:",err)}}catch(err){console.error("[Vibeflow] Failed to capture baseline:",err)}}),(_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_react24=__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_react24.default.createElement(OverlayApp,{onOpenKanban:()=>{if(PROTO_CONFIG.boardId)try{let origin=new URL(PROTO_CONFIG.apiUrl).origin;window.open(\`\${origin}/kanban?board=\${encodeURIComponent(PROTO_CONFIG.boardId)}\`,"_blank","noopener")}catch{}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,advanced)=>submitTask(selector,cssSelector,title,description,status,meta,type,void 0,advanced)})),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
1626
  /*! Bundled license information:
1623
1627
 
1624
1628
  react/cjs/react.production.min.js:
@@ -1682,7 +1686,7 @@ lucide-react/dist/esm/lucide-react.js:
1682
1686
  * See the LICENSE file in the root directory of this source tree.
1683
1687
  *)
1684
1688
  */
1685
- `;function ht(t){return`
1689
+ `;function lt(t){return`
1686
1690
  var _vfScriptSrc = document.currentScript && document.currentScript.src;
1687
1691
  var _vfOrigin = _vfScriptSrc ? new URL(_vfScriptSrc).origin : ('http://' + window.location.host);
1688
1692
  var PROTO_CONFIG = {
@@ -1692,29 +1696,29 @@ var PROTO_CONFIG = {
1692
1696
  pagesUrl: _vfOrigin + '/api/pages',
1693
1697
  screenshotsUrl: _vfOrigin + '/screenshots/'
1694
1698
  };
1695
- `+bt}function Jt(t){return`var PROTO_CONFIG = ${JSON.stringify({port:0,wsUrl:"",apiUrl:`${t}/api/overlay/tasks`,pagesUrl:"",screenshotsUrl:""})};
1696
- `+bt}import{existsSync as ta,readFileSync as na}from"fs";import{dirname as ra,join as yt}from"path";import{fileURLToPath as aa}from"url";var Zt=`*,: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}.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-red-400{--tw-text-opacity:1;color:rgb(248 113 113/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}.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)}.blur,.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;display:flex;flex-direction:column;gap:5px;padding-bottom:8px}.column-scroll[data-status=done]{overflow-y:hidden}.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;display:flex;flex-direction:column;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;display:flex;flex-direction:column}.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 vt='"use strict";(()=>{var yg=Object.create;var Rd=Object.defineProperty;var Lg=Object.getOwnPropertyDescriptor;var Sg=Object.getOwnPropertyNames;var Ig=Object.getPrototypeOf,Cg=Object.prototype.hasOwnProperty;var sa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var wg=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Sg(t))!Cg.call(e,o)&&o!==a&&Rd(e,o,{get:()=>t[o],enumerable:!(r=Lg(t,o))||r.enumerable});return e};var M=(e,t,a)=>(a=e!=null?yg(Ig(e)):{},wg(t||!e||!e.__esModule?Rd(a,"default",{value:e,enumerable:!0}):a,e));var _d=sa(le=>{"use strict";var ko=Symbol.for("react.element"),kg=Symbol.for("react.portal"),bg=Symbol.for("react.fragment"),Pg=Symbol.for("react.strict_mode"),Tg=Symbol.for("react.profiler"),Rg=Symbol.for("react.provider"),Mg=Symbol.for("react.context"),Ag=Symbol.for("react.forward_ref"),Dg=Symbol.for("react.suspense"),Eg=Symbol.for("react.memo"),Fg=Symbol.for("react.lazy"),Md=Symbol.iterator;function Bg(e){return e===null||typeof e!="object"?null:(e=Md&&e[Md]||e["@@iterator"],typeof e=="function"?e:null)}var Ed={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fd=Object.assign,Bd={};function Dr(e,t,a){this.props=e,this.context=t,this.refs=Bd,this.updater=a||Ed}Dr.prototype.isReactComponent={};Dr.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")};Dr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Od(){}Od.prototype=Dr.prototype;function Ns(e,t,a){this.props=e,this.context=t,this.refs=Bd,this.updater=a||Ed}var Us=Ns.prototype=new Od;Us.constructor=Ns;Fd(Us,Dr.prototype);Us.isPureReactComponent=!0;var Ad=Array.isArray,zd=Object.prototype.hasOwnProperty,Hs={current:null},Nd={key:!0,ref:!0,__self:!0,__source:!0};function Ud(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)zd.call(t,r)&&!Nd.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=a;else if(1<s){for(var u=Array(s),d=0;d<s;d++)u[d]=arguments[d+2];o.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return{$$typeof:ko,type:e,key:n,ref:l,props:o,_owner:Hs.current}}function Og(e,t){return{$$typeof:ko,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _s(e){return typeof e=="object"&&e!==null&&e.$$typeof===ko}function zg(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Dd=/\\/+/g;function zs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?zg(""+e.key):t.toString(36)}function jn(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 ko:case kg:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+zs(l,0):r,Ad(o)?(a="",e!=null&&(a=e.replace(Dd,"$&/")+"/"),jn(o,t,a,"",function(d){return d})):o!=null&&(_s(o)&&(o=Og(o,a+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(Dd,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",Ad(e))for(var s=0;s<e.length;s++){n=e[s];var u=r+zs(n,s);l+=jn(n,t,a,u,o)}else if(u=Bg(e),typeof u=="function")for(e=u.call(e),s=0;!(n=e.next()).done;)n=n.value,u=r+zs(n,s++),l+=jn(n,t,a,u,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 Gn(e,t,a){if(e==null)return e;var r=[],o=0;return jn(e,r,"","",function(n){return t.call(a,n,o++)}),r}function Ng(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 Qe={current:null},Xn={transition:null},Ug={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:Xn,ReactCurrentOwner:Hs};function Hd(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:Gn,forEach:function(e,t,a){Gn(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Gn(e,function(){t++}),t},toArray:function(e){return Gn(e,function(t){return t})||[]},only:function(e){if(!_s(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=Dr;le.Fragment=bg;le.Profiler=Tg;le.PureComponent=Ns;le.StrictMode=Pg;le.Suspense=Dg;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ug;le.act=Hd;le.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=Fd({},e.props),o=e.key,n=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,l=Hs.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(u in t)zd.call(t,u)&&!Nd.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&s!==void 0?s[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=a;else if(1<u){s=Array(u);for(var d=0;d<u;d++)s[d]=arguments[d+2];r.children=s}return{$$typeof:ko,type:e.type,key:o,ref:n,props:r,_owner:l}};le.createContext=function(e){return e={$$typeof:Mg,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Rg,_context:e},e.Consumer=e};le.createElement=Ud;le.createFactory=function(e){var t=Ud.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:Ag,render:e}};le.isValidElement=_s;le.lazy=function(e){return{$$typeof:Fg,_payload:{_status:-1,_result:e},_init:Ng}};le.memo=function(e,t){return{$$typeof:Eg,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=Xn.transition;Xn.transition={};try{e()}finally{Xn.transition=t}};le.unstable_act=Hd;le.useCallback=function(e,t){return Qe.current.useCallback(e,t)};le.useContext=function(e){return Qe.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};le.useEffect=function(e,t){return Qe.current.useEffect(e,t)};le.useId=function(){return Qe.current.useId()};le.useImperativeHandle=function(e,t,a){return Qe.current.useImperativeHandle(e,t,a)};le.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return Qe.current.useMemo(e,t)};le.useReducer=function(e,t,a){return Qe.current.useReducer(e,t,a)};le.useRef=function(e){return Qe.current.useRef(e)};le.useState=function(e){return Qe.current.useState(e)};le.useSyncExternalStore=function(e,t,a){return Qe.current.useSyncExternalStore(e,t,a)};le.useTransition=function(){return Qe.current.useTransition()};le.version="18.3.1"});var Se=sa((Zv,qd)=>{"use strict";qd.exports=_d()});var Jd=sa(ye=>{"use strict";function Vs(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Qn(o,t))e[r]=t,e[a]=o,a=r;else break e}}function Ft(e){return e.length===0?null:e[0]}function Jn(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],u=l+1,d=e[u];if(0>Qn(s,a))u<o&&0>Qn(d,s)?(e[r]=d,e[u]=a,r=u):(e[r]=s,e[l]=a,r=l);else if(u<o&&0>Qn(d,a))e[r]=d,e[u]=a,r=u;else break e}}return t}function Qn(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Wd=performance,ye.unstable_now=function(){return Wd.now()}):(qs=Date,$d=qs.now(),ye.unstable_now=function(){return qs.now()-$d});var Wd,qs,$d,Kt=[],Ia=[],Hg=1,Lt=null,Ve=3,Zn=!1,Ja=!1,Po=!1,Gd=typeof setTimeout=="function"?setTimeout:null,jd=typeof clearTimeout=="function"?clearTimeout:null,Vd=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ks(e){for(var t=Ft(Ia);t!==null;){if(t.callback===null)Jn(Ia);else if(t.startTime<=e)Jn(Ia),t.sortIndex=t.expirationTime,Vs(Kt,t);else break;t=Ft(Ia)}}function Gs(e){if(Po=!1,Ks(e),!Ja)if(Ft(Kt)!==null)Ja=!0,Xs(js);else{var t=Ft(Ia);t!==null&&Qs(Gs,t.startTime-e)}}function js(e,t){Ja=!1,Po&&(Po=!1,jd(To),To=-1),Zn=!0;var a=Ve;try{for(Ks(t),Lt=Ft(Kt);Lt!==null&&(!(Lt.expirationTime>t)||e&&!Yd());){var r=Lt.callback;if(typeof r=="function"){Lt.callback=null,Ve=Lt.priorityLevel;var o=r(Lt.expirationTime<=t);t=ye.unstable_now(),typeof o=="function"?Lt.callback=o:Lt===Ft(Kt)&&Jn(Kt),Ks(t)}else Jn(Kt);Lt=Ft(Kt)}if(Lt!==null)var n=!0;else{var l=Ft(Ia);l!==null&&Qs(Gs,l.startTime-t),n=!1}return n}finally{Lt=null,Ve=a,Zn=!1}}var el=!1,Yn=null,To=-1,Xd=5,Qd=-1;function Yd(){return!(ye.unstable_now()-Qd<Xd)}function Ws(){if(Yn!==null){var e=ye.unstable_now();Qd=e;var t=!0;try{t=Yn(!0,e)}finally{t?bo():(el=!1,Yn=null)}}else el=!1}var bo;typeof Vd=="function"?bo=function(){Vd(Ws)}:typeof MessageChannel<"u"?($s=new MessageChannel,Kd=$s.port2,$s.port1.onmessage=Ws,bo=function(){Kd.postMessage(null)}):bo=function(){Gd(Ws,0)};var $s,Kd;function Xs(e){Yn=e,el||(el=!0,bo())}function Qs(e,t){To=Gd(function(){e(ye.unstable_now())},t)}ye.unstable_IdlePriority=5;ye.unstable_ImmediatePriority=1;ye.unstable_LowPriority=4;ye.unstable_NormalPriority=3;ye.unstable_Profiling=null;ye.unstable_UserBlockingPriority=2;ye.unstable_cancelCallback=function(e){e.callback=null};ye.unstable_continueExecution=function(){Ja||Zn||(Ja=!0,Xs(js))};ye.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"):Xd=0<e?Math.floor(1e3/e):5};ye.unstable_getCurrentPriorityLevel=function(){return Ve};ye.unstable_getFirstCallbackNode=function(){return Ft(Kt)};ye.unstable_next=function(e){switch(Ve){case 1:case 2:case 3:var t=3;break;default:t=Ve}var a=Ve;Ve=t;try{return e()}finally{Ve=a}};ye.unstable_pauseExecution=function(){};ye.unstable_requestPaint=function(){};ye.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=Ve;Ve=e;try{return t()}finally{Ve=a}};ye.unstable_scheduleCallback=function(e,t,a){var r=ye.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:Hg++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Vs(Ia,e),Ft(Kt)===null&&e===Ft(Ia)&&(Po?(jd(To),To=-1):Po=!0,Qs(Gs,a-r))):(e.sortIndex=o,Vs(Kt,e),Ja||Zn||(Ja=!0,Xs(js))),e};ye.unstable_shouldYield=Yd;ye.unstable_wrapCallback=function(e){var t=Ve;return function(){var a=Ve;Ve=t;try{return e.apply(this,arguments)}finally{Ve=a}}}});var ef=sa((ty,Zd)=>{"use strict";Zd.exports=Jd()});var nm=sa(gt=>{"use strict";var _g=Se(),pt=ef();function T(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 uc=new Set,Qo={};function fr(e,t){Zr(e,t),Zr(e+"Capture",t)}function Zr(e,t){for(Qo[e]=t,e=0;e<t.length;e++)uc.add(t[e])}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yu=Object.prototype.hasOwnProperty,qg=/^[: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]*$/,tf={},af={};function Wg(e){return yu.call(af,e)?!0:yu.call(tf,e)?!1:qg.test(e)?af[e]=!0:(tf[e]=!0,!1)}function $g(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 Vg(e,t,a,r){if(t===null||typeof t>"u"||$g(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 Ze(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 $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new Ze(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){$e[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var fi=/[\\-:]([a-z])/g;function ci(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(fi,ci);$e[t]=new Ze(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(fi,ci);$e[t]=new Ze(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(fi,ci);$e[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function pi(e,t,a,r){var o=$e.hasOwnProperty(t)?$e[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Vg(t,a,o,r)&&(a=null),r||o===null?Wg(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 xa=_g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,tl=Symbol.for("react.element"),Br=Symbol.for("react.portal"),Or=Symbol.for("react.fragment"),mi=Symbol.for("react.strict_mode"),Lu=Symbol.for("react.profiler"),ic=Symbol.for("react.provider"),dc=Symbol.for("react.context"),gi=Symbol.for("react.forward_ref"),Su=Symbol.for("react.suspense"),Iu=Symbol.for("react.suspense_list"),hi=Symbol.for("react.memo"),wa=Symbol.for("react.lazy"),fc=Symbol.for("react.offscreen"),rf=Symbol.iterator;function Ro(e){return e===null||typeof e!="object"?null:(e=rf&&e[rf]||e["@@iterator"],typeof e=="function"?e:null)}var Pe=Object.assign,Ys;function zo(e){if(Ys===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\\n( *(at )?)/);Ys=t&&t[1]||""}return`\n`+Ys+e}var Js=!1;function Zs(e,t){if(!e||Js)return"";Js=!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 u=`\n`+o[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=s);break}}}finally{Js=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?zo(e):""}function Kg(e){switch(e.tag){case 5:return zo(e.type);case 16:return zo("Lazy");case 13:return zo("Suspense");case 19:return zo("SuspenseList");case 0:case 2:case 15:return e=Zs(e.type,!1),e;case 11:return e=Zs(e.type.render,!1),e;case 1:return e=Zs(e.type,!0),e;default:return""}}function Cu(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 Or:return"Fragment";case Br:return"Portal";case Lu:return"Profiler";case mi:return"StrictMode";case Su:return"Suspense";case Iu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case dc:return(e.displayName||"Context")+".Consumer";case ic:return(e._context.displayName||"Context")+".Provider";case gi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hi:return t=e.displayName||null,t!==null?t:Cu(e.type)||"Memo";case wa:t=e._payload,e=e._init;try{return Cu(e(t))}catch{}}return null}function Gg(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 Cu(t);case 8:return t===mi?"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 Na(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jg(e){var t=cc(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 al(e){e._valueTracker||(e._valueTracker=jg(e))}function pc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=cc(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Ml(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 wu(e,t){var a=t.checked;return Pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function of(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Na(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 mc(e,t){t=t.checked,t!=null&&pi(e,"checked",t,!1)}function ku(e,t){mc(e,t);var a=Na(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")?bu(e,t.type,a):t.hasOwnProperty("defaultValue")&&bu(e,t.type,Na(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nf(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 bu(e,t,a){(t!=="number"||Ml(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var No=Array.isArray;function Gr(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=""+Na(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 Pu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(T(91));return Pe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function lf(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(T(92));if(No(a)){if(1<a.length)throw Error(T(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Na(a)}}function gc(e,t){var a=Na(t.value),r=Na(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 sf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function hc(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 Tu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?hc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var rl,xc=(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(rl=rl||document.createElement("div"),rl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=rl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yo(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var _o={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},Xg=["Webkit","ms","Moz","O"];Object.keys(_o).forEach(function(e){Xg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_o[t]=_o[e]})});function vc(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||_o.hasOwnProperty(e)&&_o[e]?(""+t).trim():t+"px"}function yc(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=vc(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var Qg=Pe({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 Ru(e,t){if(t){if(Qg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(T(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(T(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(T(61))}if(t.style!=null&&typeof t.style!="object")throw Error(T(62))}}function Mu(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 Au=null;function xi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Du=null,jr=null,Xr=null;function uf(e){if(e=hn(e)){if(typeof Du!="function")throw Error(T(280));var t=e.stateNode;t&&(t=os(t),Du(e.stateNode,e.type,t))}}function Lc(e){jr?Xr?Xr.push(e):Xr=[e]:jr=e}function Sc(){if(jr){var e=jr,t=Xr;if(Xr=jr=null,uf(e),t)for(e=0;e<t.length;e++)uf(t[e])}}function Ic(e,t){return e(t)}function Cc(){}var eu=!1;function wc(e,t,a){if(eu)return e(t,a);eu=!0;try{return Ic(e,t,a)}finally{eu=!1,(jr!==null||Xr!==null)&&(Cc(),Sc())}}function Jo(e,t){var a=e.stateNode;if(a===null)return null;var r=os(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(T(231,t,typeof a));return a}var Eu=!1;if(pa)try{Er={},Object.defineProperty(Er,"passive",{get:function(){Eu=!0}}),window.addEventListener("test",Er,Er),window.removeEventListener("test",Er,Er)}catch{Eu=!1}var Er;function Yg(e,t,a,r,o,n,l,s,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(a,d)}catch(m){this.onError(m)}}var qo=!1,Al=null,Dl=!1,Fu=null,Jg={onError:function(e){qo=!0,Al=e}};function Zg(e,t,a,r,o,n,l,s,u){qo=!1,Al=null,Yg.apply(Jg,arguments)}function eh(e,t,a,r,o,n,l,s,u){if(Zg.apply(this,arguments),qo){if(qo){var d=Al;qo=!1,Al=null}else throw Error(T(198));Dl||(Dl=!0,Fu=d)}}function cr(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 kc(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 df(e){if(cr(e)!==e)throw Error(T(188))}function th(e){var t=e.alternate;if(!t){if(t=cr(e),t===null)throw Error(T(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 df(o),e;if(n===r)return df(o),t;n=n.sibling}throw Error(T(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(T(189))}}if(a.alternate!==r)throw Error(T(190))}if(a.tag!==3)throw Error(T(188));return a.stateNode.current===a?e:t}function bc(e){return e=th(e),e!==null?Pc(e):null}function Pc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Pc(e);if(t!==null)return t;e=e.sibling}return null}var Tc=pt.unstable_scheduleCallback,ff=pt.unstable_cancelCallback,ah=pt.unstable_shouldYield,rh=pt.unstable_requestPaint,Ae=pt.unstable_now,oh=pt.unstable_getCurrentPriorityLevel,vi=pt.unstable_ImmediatePriority,Rc=pt.unstable_UserBlockingPriority,El=pt.unstable_NormalPriority,nh=pt.unstable_LowPriority,Mc=pt.unstable_IdlePriority,es=null,Qt=null;function lh(e){if(Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(es,e,void 0,(e.current.flags&128)===128)}catch{}}var Ut=Math.clz32?Math.clz32:ih,sh=Math.log,uh=Math.LN2;function ih(e){return e>>>=0,e===0?32:31-(sh(e)/uh|0)|0}var ol=64,nl=4194304;function Uo(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 Fl(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=Uo(s):(n&=l,n!==0&&(r=Uo(n)))}else l=a&~o,l!==0?r=Uo(l):n!==0&&(r=Uo(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-Ut(t),o=1<<a,r|=e[a],t&=~o;return r}function dh(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 fh(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var l=31-Ut(n),s=1<<l,u=o[l];u===-1?((s&a)===0||(s&r)!==0)&&(o[l]=dh(s,t)):u<=t&&(e.expiredLanes|=s),n&=~s}}function Bu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ac(){var e=ol;return ol<<=1,(ol&4194240)===0&&(ol=64),e}function tu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function mn(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ut(t),e[t]=a}function ch(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-Ut(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function yi(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Ut(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var xe=0;function Dc(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ec,Li,Fc,Bc,Oc,Ou=!1,ll=[],Ma=null,Aa=null,Da=null,Zo=new Map,en=new Map,ba=[],ph="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 cf(e,t){switch(e){case"focusin":case"focusout":Ma=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":Zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":en.delete(t.pointerId)}}function Mo(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=hn(t),t!==null&&Li(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function mh(e,t,a,r,o){switch(t){case"focusin":return Ma=Mo(Ma,e,t,a,r,o),!0;case"dragenter":return Aa=Mo(Aa,e,t,a,r,o),!0;case"mouseover":return Da=Mo(Da,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return Zo.set(n,Mo(Zo.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,en.set(n,Mo(en.get(n)||null,e,t,a,r,o)),!0}return!1}function zc(e){var t=tr(e.target);if(t!==null){var a=cr(t);if(a!==null){if(t=a.tag,t===13){if(t=kc(a),t!==null){e.blockedOn=t,Oc(e.priority,function(){Fc(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 Ll(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=zu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Au=r,a.target.dispatchEvent(r),Au=null}else return t=hn(a),t!==null&&Li(t),e.blockedOn=a,!1;t.shift()}return!0}function pf(e,t,a){Ll(e)&&a.delete(t)}function gh(){Ou=!1,Ma!==null&&Ll(Ma)&&(Ma=null),Aa!==null&&Ll(Aa)&&(Aa=null),Da!==null&&Ll(Da)&&(Da=null),Zo.forEach(pf),en.forEach(pf)}function Ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Ou||(Ou=!0,pt.unstable_scheduleCallback(pt.unstable_NormalPriority,gh)))}function tn(e){function t(o){return Ao(o,e)}if(0<ll.length){Ao(ll[0],e);for(var a=1;a<ll.length;a++){var r=ll[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Ma!==null&&Ao(Ma,e),Aa!==null&&Ao(Aa,e),Da!==null&&Ao(Da,e),Zo.forEach(t),en.forEach(t),a=0;a<ba.length;a++)r=ba[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<ba.length&&(a=ba[0],a.blockedOn===null);)zc(a),a.blockedOn===null&&ba.shift()}var Qr=xa.ReactCurrentBatchConfig,Bl=!0;function hh(e,t,a,r){var o=xe,n=Qr.transition;Qr.transition=null;try{xe=1,Si(e,t,a,r)}finally{xe=o,Qr.transition=n}}function xh(e,t,a,r){var o=xe,n=Qr.transition;Qr.transition=null;try{xe=4,Si(e,t,a,r)}finally{xe=o,Qr.transition=n}}function Si(e,t,a,r){if(Bl){var o=zu(e,t,a,r);if(o===null)uu(e,t,r,Ol,a),cf(e,r);else if(mh(o,e,t,a,r))r.stopPropagation();else if(cf(e,r),t&4&&-1<ph.indexOf(e)){for(;o!==null;){var n=hn(o);if(n!==null&&Ec(n),n=zu(e,t,a,r),n===null&&uu(e,t,r,Ol,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else uu(e,t,r,null,a)}}var Ol=null;function zu(e,t,a,r){if(Ol=null,e=xi(r),e=tr(e),e!==null)if(t=cr(e),t===null)e=null;else if(a=t.tag,a===13){if(e=kc(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 Ol=e,null}function Nc(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(oh()){case vi:return 1;case Rc:return 4;case El:case nh:return 16;case Mc:return 536870912;default:return 16}default:return 16}}var Ta=null,Ii=null,Sl=null;function Uc(){if(Sl)return Sl;var e,t=Ii,a=t.length,r,o="value"in Ta?Ta.value:Ta.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 Sl=o.slice(e,1<r?1-r:void 0)}function Il(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 sl(){return!0}function mf(){return!1}function mt(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)?sl:mf,this.isPropagationStopped=mf,this}return Pe(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=sl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=sl)},persist:function(){},isPersistent:sl}),t}var lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ci=mt(lo),gn=Pe({},lo,{view:0,detail:0}),vh=mt(gn),au,ru,Do,ts=Pe({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wi,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!==Do&&(Do&&e.type==="mousemove"?(au=e.screenX-Do.screenX,ru=e.screenY-Do.screenY):ru=au=0,Do=e),au)},movementY:function(e){return"movementY"in e?e.movementY:ru}}),gf=mt(ts),yh=Pe({},ts,{dataTransfer:0}),Lh=mt(yh),Sh=Pe({},gn,{relatedTarget:0}),ou=mt(Sh),Ih=Pe({},lo,{animationName:0,elapsedTime:0,pseudoElement:0}),Ch=mt(Ih),wh=Pe({},lo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kh=mt(wh),bh=Pe({},lo,{data:0}),hf=mt(bh),Ph={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Th={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"},Rh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rh[e])?!!t[e]:!1}function wi(){return Mh}var Ah=Pe({},gn,{key:function(e){if(e.key){var t=Ph[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Il(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Th[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wi,charCode:function(e){return e.type==="keypress"?Il(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Il(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dh=mt(Ah),Eh=Pe({},ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xf=mt(Eh),Fh=Pe({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wi}),Bh=mt(Fh),Oh=Pe({},lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),zh=mt(Oh),Nh=Pe({},ts,{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}),Uh=mt(Nh),Hh=[9,13,27,32],ki=pa&&"CompositionEvent"in window,Wo=null;pa&&"documentMode"in document&&(Wo=document.documentMode);var _h=pa&&"TextEvent"in window&&!Wo,Hc=pa&&(!ki||Wo&&8<Wo&&11>=Wo),vf=" ",yf=!1;function _c(e,t){switch(e){case"keyup":return Hh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function qh(e,t){switch(e){case"compositionend":return qc(t);case"keypress":return t.which!==32?null:(yf=!0,vf);case"textInput":return e=t.data,e===vf&&yf?null:e;default:return null}}function Wh(e,t){if(zr)return e==="compositionend"||!ki&&_c(e,t)?(e=Uc(),Sl=Ii=Ta=null,zr=!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 Hc&&t.locale!=="ko"?null:t.data;default:return null}}var $h={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 Lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$h[e.type]:t==="textarea"}function Wc(e,t,a,r){Lc(r),t=zl(t,"onChange"),0<t.length&&(a=new Ci("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var $o=null,an=null;function Vh(e){ep(e,0)}function as(e){var t=Hr(e);if(pc(t))return e}function Kh(e,t){if(e==="change")return t}var $c=!1;pa&&(pa?(il="oninput"in document,il||(nu=document.createElement("div"),nu.setAttribute("oninput","return;"),il=typeof nu.oninput=="function"),ul=il):ul=!1,$c=ul&&(!document.documentMode||9<document.documentMode));var ul,il,nu;function Sf(){$o&&($o.detachEvent("onpropertychange",Vc),an=$o=null)}function Vc(e){if(e.propertyName==="value"&&as(an)){var t=[];Wc(t,an,e,xi(e)),wc(Vh,t)}}function Gh(e,t,a){e==="focusin"?(Sf(),$o=t,an=a,$o.attachEvent("onpropertychange",Vc)):e==="focusout"&&Sf()}function jh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return as(an)}function Xh(e,t){if(e==="click")return as(t)}function Qh(e,t){if(e==="input"||e==="change")return as(t)}function Yh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _t=typeof Object.is=="function"?Object.is:Yh;function rn(e,t){if(_t(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(!yu.call(t,o)||!_t(e[o],t[o]))return!1}return!0}function If(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cf(e,t){var a=If(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=If(a)}}function Kc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gc(){for(var e=window,t=Ml();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Ml(e.document)}return t}function bi(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 Jh(e){var t=Gc(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&Kc(a.ownerDocument.documentElement,a)){if(r!==null&&bi(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=Cf(a,n);var l=Cf(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 Zh=pa&&"documentMode"in document&&11>=document.documentMode,Nr=null,Nu=null,Vo=null,Uu=!1;function wf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Uu||Nr==null||Nr!==Ml(r)||(r=Nr,"selectionStart"in r&&bi(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}),Vo&&rn(Vo,r)||(Vo=r,r=zl(Nu,"onSelect"),0<r.length&&(t=new Ci("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Nr)))}function dl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Ur={animationend:dl("Animation","AnimationEnd"),animationiteration:dl("Animation","AnimationIteration"),animationstart:dl("Animation","AnimationStart"),transitionend:dl("Transition","TransitionEnd")},lu={},jc={};pa&&(jc=document.createElement("div").style,"AnimationEvent"in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),"TransitionEvent"in window||delete Ur.transitionend.transition);function rs(e){if(lu[e])return lu[e];if(!Ur[e])return e;var t=Ur[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in jc)return lu[e]=t[a];return e}var Xc=rs("animationend"),Qc=rs("animationiteration"),Yc=rs("animationstart"),Jc=rs("transitionend"),Zc=new Map,kf="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 Ha(e,t){Zc.set(e,t),fr(t,[e])}for(fl=0;fl<kf.length;fl++)cl=kf[fl],bf=cl.toLowerCase(),Pf=cl[0].toUpperCase()+cl.slice(1),Ha(bf,"on"+Pf);var cl,bf,Pf,fl;Ha(Xc,"onAnimationEnd");Ha(Qc,"onAnimationIteration");Ha(Yc,"onAnimationStart");Ha("dblclick","onDoubleClick");Ha("focusin","onFocus");Ha("focusout","onBlur");Ha(Jc,"onTransitionEnd");Zr("onMouseEnter",["mouseout","mouseover"]);Zr("onMouseLeave",["mouseout","mouseover"]);Zr("onPointerEnter",["pointerout","pointerover"]);Zr("onPointerLeave",["pointerout","pointerover"]);fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fr("onBeforeInput",["compositionend","keypress","textInput","paste"]);fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ho="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(" "),ex=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ho));function Tf(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,eh(r,t,void 0,e),e.currentTarget=null}function ep(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],u=s.instance,d=s.currentTarget;if(s=s.listener,u!==n&&o.isPropagationStopped())break e;Tf(o,s,d),n=u}else for(l=0;l<r.length;l++){if(s=r[l],u=s.instance,d=s.currentTarget,s=s.listener,u!==n&&o.isPropagationStopped())break e;Tf(o,s,d),n=u}}}if(Dl)throw e=Fu,Dl=!1,Fu=null,e}function Ie(e,t){var a=t[$u];a===void 0&&(a=t[$u]=new Set);var r=e+"__bubble";a.has(r)||(tp(t,e,2,!1),a.add(r))}function su(e,t,a){var r=0;t&&(r|=4),tp(a,e,r,t)}var pl="_reactListening"+Math.random().toString(36).slice(2);function on(e){if(!e[pl]){e[pl]=!0,uc.forEach(function(a){a!=="selectionchange"&&(ex.has(a)||su(a,!1,e),su(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pl]||(t[pl]=!0,su("selectionchange",!1,t))}}function tp(e,t,a,r){switch(Nc(t)){case 1:var o=hh;break;case 4:o=xh;break;default:o=Si}a=o.bind(null,t,a,e),o=void 0,!Eu||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 uu(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 u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;l=l.return}for(;s!==null;){if(l=tr(s),l===null)return;if(u=l.tag,u===5||u===6){r=n=l;continue e}s=s.parentNode}}r=r.return}wc(function(){var d=n,m=xi(a),g=[];e:{var p=Zc.get(e);if(p!==void 0){var v=Ci,y=e;switch(e){case"keypress":if(Il(a)===0)break e;case"keydown":case"keyup":v=Dh;break;case"focusin":y="focus",v=ou;break;case"focusout":y="blur",v=ou;break;case"beforeblur":case"afterblur":v=ou;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":v=gf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=Lh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=Bh;break;case Xc:case Qc:case Yc:v=Ch;break;case Jc:v=zh;break;case"scroll":v=vh;break;case"wheel":v=Uh;break;case"copy":case"cut":case"paste":v=kh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=xf}var C=(t&4)!==0,O=!C&&e==="scroll",c=C?p!==null?p+"Capture":null:p;C=[];for(var i=d,f;i!==null;){f=i;var L=f.stateNode;if(f.tag===5&&L!==null&&(f=L,c!==null&&(L=Jo(i,c),L!=null&&C.push(nn(i,L,f)))),O)break;i=i.return}0<C.length&&(p=new v(p,y,null,a,m),g.push({event:p,listeners:C}))}}if((t&7)===0){e:{if(p=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",p&&a!==Au&&(y=a.relatedTarget||a.fromElement)&&(tr(y)||y[ma]))break e;if((v||p)&&(p=m.window===m?m:(p=m.ownerDocument)?p.defaultView||p.parentWindow:window,v?(y=a.relatedTarget||a.toElement,v=d,y=y?tr(y):null,y!==null&&(O=cr(y),y!==O||y.tag!==5&&y.tag!==6)&&(y=null)):(v=null,y=d),v!==y)){if(C=gf,L="onMouseLeave",c="onMouseEnter",i="mouse",(e==="pointerout"||e==="pointerover")&&(C=xf,L="onPointerLeave",c="onPointerEnter",i="pointer"),O=v==null?p:Hr(v),f=y==null?p:Hr(y),p=new C(L,i+"leave",v,a,m),p.target=O,p.relatedTarget=f,L=null,tr(m)===d&&(C=new C(c,i+"enter",y,a,m),C.target=f,C.relatedTarget=O,L=C),O=L,v&&y)t:{for(C=v,c=y,i=0,f=C;f;f=Fr(f))i++;for(f=0,L=c;L;L=Fr(L))f++;for(;0<i-f;)C=Fr(C),i--;for(;0<f-i;)c=Fr(c),f--;for(;i--;){if(C===c||c!==null&&C===c.alternate)break t;C=Fr(C),c=Fr(c)}C=null}else C=null;v!==null&&Rf(g,p,v,C,!1),y!==null&&O!==null&&Rf(g,O,y,C,!0)}}e:{if(p=d?Hr(d):window,v=p.nodeName&&p.nodeName.toLowerCase(),v==="select"||v==="input"&&p.type==="file")var w=Kh;else if(Lf(p))if($c)w=Qh;else{w=jh;var b=Gh}else(v=p.nodeName)&&v.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=Xh);if(w&&(w=w(e,d))){Wc(g,w,a,m);break e}b&&b(e,p,d),e==="focusout"&&(b=p._wrapperState)&&b.controlled&&p.type==="number"&&bu(p,"number",p.value)}switch(b=d?Hr(d):window,e){case"focusin":(Lf(b)||b.contentEditable==="true")&&(Nr=b,Nu=d,Vo=null);break;case"focusout":Vo=Nu=Nr=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,wf(g,a,m);break;case"selectionchange":if(Zh)break;case"keydown":case"keyup":wf(g,a,m)}var S;if(ki)e:{switch(e){case"compositionstart":var h="onCompositionStart";break e;case"compositionend":h="onCompositionEnd";break e;case"compositionupdate":h="onCompositionUpdate";break e}h=void 0}else zr?_c(e,a)&&(h="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(h="onCompositionStart");h&&(Hc&&a.locale!=="ko"&&(zr||h!=="onCompositionStart"?h==="onCompositionEnd"&&zr&&(S=Uc()):(Ta=m,Ii="value"in Ta?Ta.value:Ta.textContent,zr=!0)),b=zl(d,h),0<b.length&&(h=new hf(h,e,null,a,m),g.push({event:h,listeners:b}),S?h.data=S:(S=qc(a),S!==null&&(h.data=S)))),(S=_h?qh(e,a):Wh(e,a))&&(d=zl(d,"onBeforeInput"),0<d.length&&(m=new hf("onBeforeInput","beforeinput",null,a,m),g.push({event:m,listeners:d}),m.data=S))}ep(g,t)})}function nn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function zl(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=Jo(e,a),n!=null&&r.unshift(nn(e,n,o)),n=Jo(e,t),n!=null&&r.push(nn(e,n,o))),e=e.return}return r}function Fr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Rf(e,t,a,r,o){for(var n=t._reactName,l=[];a!==null&&a!==r;){var s=a,u=s.alternate,d=s.stateNode;if(u!==null&&u===r)break;s.tag===5&&d!==null&&(s=d,o?(u=Jo(a,n),u!=null&&l.unshift(nn(a,u,s))):o||(u=Jo(a,n),u!=null&&l.push(nn(a,u,s)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var tx=/\\r\\n?/g,ax=/\\u0000|\\uFFFD/g;function Mf(e){return(typeof e=="string"?e:""+e).replace(tx,`\n`).replace(ax,"")}function ml(e,t,a){if(t=Mf(t),Mf(e)!==t&&a)throw Error(T(425))}function Nl(){}var Hu=null,_u=null;function qu(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 Wu=typeof setTimeout=="function"?setTimeout:void 0,rx=typeof clearTimeout=="function"?clearTimeout:void 0,Af=typeof Promise=="function"?Promise:void 0,ox=typeof queueMicrotask=="function"?queueMicrotask:typeof Af<"u"?function(e){return Af.resolve(null).then(e).catch(nx)}:Wu;function nx(e){setTimeout(function(){throw e})}function iu(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),tn(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);tn(t)}function Ea(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 Df(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 so=Math.random().toString(36).slice(2),Xt="__reactFiber$"+so,ln="__reactProps$"+so,ma="__reactContainer$"+so,$u="__reactEvents$"+so,lx="__reactListeners$"+so,sx="__reactHandles$"+so;function tr(e){var t=e[Xt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ma]||a[Xt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Df(e);e!==null;){if(a=e[Xt])return a;e=Df(e)}return t}e=a,a=e.parentNode}return null}function hn(e){return e=e[Xt]||e[ma],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Hr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(T(33))}function os(e){return e[ln]||null}var Vu=[],_r=-1;function _a(e){return{current:e}}function Ce(e){0>_r||(e.current=Vu[_r],Vu[_r]=null,_r--)}function Le(e,t){_r++,Vu[_r]=e.current,e.current=t}var Ua={},Xe=_a(Ua),lt=_a(!1),lr=Ua;function eo(e,t){var a=e.type.contextTypes;if(!a)return Ua;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 st(e){return e=e.childContextTypes,e!=null}function Ul(){Ce(lt),Ce(Xe)}function Ef(e,t,a){if(Xe.current!==Ua)throw Error(T(168));Le(Xe,t),Le(lt,a)}function ap(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(T(108,Gg(e)||"Unknown",o));return Pe({},a,r)}function Hl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ua,lr=Xe.current,Le(Xe,e),Le(lt,lt.current),!0}function Ff(e,t,a){var r=e.stateNode;if(!r)throw Error(T(169));a?(e=ap(e,t,lr),r.__reactInternalMemoizedMergedChildContext=e,Ce(lt),Ce(Xe),Le(Xe,e)):Ce(lt),Le(lt,a)}var ia=null,ns=!1,du=!1;function rp(e){ia===null?ia=[e]:ia.push(e)}function ux(e){ns=!0,rp(e)}function qa(){if(!du&&ia!==null){du=!0;var e=0,t=xe;try{var a=ia;for(xe=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}ia=null,ns=!1}catch(o){throw ia!==null&&(ia=ia.slice(e+1)),Tc(vi,qa),o}finally{xe=t,du=!1}}return null}var qr=[],Wr=0,_l=null,ql=0,St=[],It=0,sr=null,da=1,fa="";function Za(e,t){qr[Wr++]=ql,qr[Wr++]=_l,_l=e,ql=t}function op(e,t,a){St[It++]=da,St[It++]=fa,St[It++]=sr,sr=e;var r=da;e=fa;var o=32-Ut(r)-1;r&=~(1<<o),a+=1;var n=32-Ut(t)+o;if(30<n){var l=o-o%5;n=(r&(1<<l)-1).toString(32),r>>=l,o-=l,da=1<<32-Ut(t)+o|a<<o|r,fa=n+e}else da=1<<n|a<<o|r,fa=e}function Pi(e){e.return!==null&&(Za(e,1),op(e,1,0))}function Ti(e){for(;e===_l;)_l=qr[--Wr],qr[Wr]=null,ql=qr[--Wr],qr[Wr]=null;for(;e===sr;)sr=St[--It],St[It]=null,fa=St[--It],St[It]=null,da=St[--It],St[It]=null}var ct=null,ft=null,we=!1,Nt=null;function np(e,t){var a=Ct(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 Bf(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,ct=e,ft=Ea(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ft=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=sr!==null?{id:da,overflow:fa}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=Ct(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,ct=e,ft=null,!0):!1;default:return!1}}function Ku(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gu(e){if(we){var t=ft;if(t){var a=t;if(!Bf(e,t)){if(Ku(e))throw Error(T(418));t=Ea(a.nextSibling);var r=ct;t&&Bf(e,t)?np(r,a):(e.flags=e.flags&-4097|2,we=!1,ct=e)}}else{if(Ku(e))throw Error(T(418));e.flags=e.flags&-4097|2,we=!1,ct=e}}}function Of(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function gl(e){if(e!==ct)return!1;if(!we)return Of(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qu(e.type,e.memoizedProps)),t&&(t=ft)){if(Ku(e))throw lp(),Error(T(418));for(;t;)np(e,t),t=Ea(t.nextSibling)}if(Of(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(T(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){ft=Ea(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}ft=null}}else ft=ct?Ea(e.stateNode.nextSibling):null;return!0}function lp(){for(var e=ft;e;)e=Ea(e.nextSibling)}function to(){ft=ct=null,we=!1}function Ri(e){Nt===null?Nt=[e]:Nt.push(e)}var ix=xa.ReactCurrentBatchConfig;function Eo(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(T(309));var r=a.stateNode}if(!r)throw Error(T(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(T(284));if(!a._owner)throw Error(T(290,e))}return e}function hl(e,t){throw e=Object.prototype.toString.call(t),Error(T(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function zf(e){var t=e._init;return t(e._payload)}function sp(e){function t(c,i){if(e){var f=c.deletions;f===null?(c.deletions=[i],c.flags|=16):f.push(i)}}function a(c,i){if(!e)return null;for(;i!==null;)t(c,i),i=i.sibling;return null}function r(c,i){for(c=new Map;i!==null;)i.key!==null?c.set(i.key,i):c.set(i.index,i),i=i.sibling;return c}function o(c,i){return c=za(c,i),c.index=0,c.sibling=null,c}function n(c,i,f){return c.index=f,e?(f=c.alternate,f!==null?(f=f.index,f<i?(c.flags|=2,i):f):(c.flags|=2,i)):(c.flags|=1048576,i)}function l(c){return e&&c.alternate===null&&(c.flags|=2),c}function s(c,i,f,L){return i===null||i.tag!==6?(i=xu(f,c.mode,L),i.return=c,i):(i=o(i,f),i.return=c,i)}function u(c,i,f,L){var w=f.type;return w===Or?m(c,i,f.props.children,L,f.key):i!==null&&(i.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===wa&&zf(w)===i.type)?(L=o(i,f.props),L.ref=Eo(c,i,f),L.return=c,L):(L=Rl(f.type,f.key,f.props,null,c.mode,L),L.ref=Eo(c,i,f),L.return=c,L)}function d(c,i,f,L){return i===null||i.tag!==4||i.stateNode.containerInfo!==f.containerInfo||i.stateNode.implementation!==f.implementation?(i=vu(f,c.mode,L),i.return=c,i):(i=o(i,f.children||[]),i.return=c,i)}function m(c,i,f,L,w){return i===null||i.tag!==7?(i=nr(f,c.mode,L,w),i.return=c,i):(i=o(i,f),i.return=c,i)}function g(c,i,f){if(typeof i=="string"&&i!==""||typeof i=="number")return i=xu(""+i,c.mode,f),i.return=c,i;if(typeof i=="object"&&i!==null){switch(i.$$typeof){case tl:return f=Rl(i.type,i.key,i.props,null,c.mode,f),f.ref=Eo(c,null,i),f.return=c,f;case Br:return i=vu(i,c.mode,f),i.return=c,i;case wa:var L=i._init;return g(c,L(i._payload),f)}if(No(i)||Ro(i))return i=nr(i,c.mode,f,null),i.return=c,i;hl(c,i)}return null}function p(c,i,f,L){var w=i!==null?i.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return w!==null?null:s(c,i,""+f,L);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case tl:return f.key===w?u(c,i,f,L):null;case Br:return f.key===w?d(c,i,f,L):null;case wa:return w=f._init,p(c,i,w(f._payload),L)}if(No(f)||Ro(f))return w!==null?null:m(c,i,f,L,null);hl(c,f)}return null}function v(c,i,f,L,w){if(typeof L=="string"&&L!==""||typeof L=="number")return c=c.get(f)||null,s(i,c,""+L,w);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case tl:return c=c.get(L.key===null?f:L.key)||null,u(i,c,L,w);case Br:return c=c.get(L.key===null?f:L.key)||null,d(i,c,L,w);case wa:var b=L._init;return v(c,i,f,b(L._payload),w)}if(No(L)||Ro(L))return c=c.get(f)||null,m(i,c,L,w,null);hl(i,L)}return null}function y(c,i,f,L){for(var w=null,b=null,S=i,h=i=0,P=null;S!==null&&h<f.length;h++){S.index>h?(P=S,S=null):P=S.sibling;var B=p(c,S,f[h],L);if(B===null){S===null&&(S=P);break}e&&S&&B.alternate===null&&t(c,S),i=n(B,i,h),b===null?w=B:b.sibling=B,b=B,S=P}if(h===f.length)return a(c,S),we&&Za(c,h),w;if(S===null){for(;h<f.length;h++)S=g(c,f[h],L),S!==null&&(i=n(S,i,h),b===null?w=S:b.sibling=S,b=S);return we&&Za(c,h),w}for(S=r(c,S);h<f.length;h++)P=v(S,c,h,f[h],L),P!==null&&(e&&P.alternate!==null&&S.delete(P.key===null?h:P.key),i=n(P,i,h),b===null?w=P:b.sibling=P,b=P);return e&&S.forEach(function(R){return t(c,R)}),we&&Za(c,h),w}function C(c,i,f,L){var w=Ro(f);if(typeof w!="function")throw Error(T(150));if(f=w.call(f),f==null)throw Error(T(151));for(var b=w=null,S=i,h=i=0,P=null,B=f.next();S!==null&&!B.done;h++,B=f.next()){S.index>h?(P=S,S=null):P=S.sibling;var R=p(c,S,B.value,L);if(R===null){S===null&&(S=P);break}e&&S&&R.alternate===null&&t(c,S),i=n(R,i,h),b===null?w=R:b.sibling=R,b=R,S=P}if(B.done)return a(c,S),we&&Za(c,h),w;if(S===null){for(;!B.done;h++,B=f.next())B=g(c,B.value,L),B!==null&&(i=n(B,i,h),b===null?w=B:b.sibling=B,b=B);return we&&Za(c,h),w}for(S=r(c,S);!B.done;h++,B=f.next())B=v(S,c,h,B.value,L),B!==null&&(e&&B.alternate!==null&&S.delete(B.key===null?h:B.key),i=n(B,i,h),b===null?w=B:b.sibling=B,b=B);return e&&S.forEach(function(H){return t(c,H)}),we&&Za(c,h),w}function O(c,i,f,L){if(typeof f=="object"&&f!==null&&f.type===Or&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case tl:e:{for(var w=f.key,b=i;b!==null;){if(b.key===w){if(w=f.type,w===Or){if(b.tag===7){a(c,b.sibling),i=o(b,f.props.children),i.return=c,c=i;break e}}else if(b.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===wa&&zf(w)===b.type){a(c,b.sibling),i=o(b,f.props),i.ref=Eo(c,b,f),i.return=c,c=i;break e}a(c,b);break}else t(c,b);b=b.sibling}f.type===Or?(i=nr(f.props.children,c.mode,L,f.key),i.return=c,c=i):(L=Rl(f.type,f.key,f.props,null,c.mode,L),L.ref=Eo(c,i,f),L.return=c,c=L)}return l(c);case Br:e:{for(b=f.key;i!==null;){if(i.key===b)if(i.tag===4&&i.stateNode.containerInfo===f.containerInfo&&i.stateNode.implementation===f.implementation){a(c,i.sibling),i=o(i,f.children||[]),i.return=c,c=i;break e}else{a(c,i);break}else t(c,i);i=i.sibling}i=vu(f,c.mode,L),i.return=c,c=i}return l(c);case wa:return b=f._init,O(c,i,b(f._payload),L)}if(No(f))return y(c,i,f,L);if(Ro(f))return C(c,i,f,L);hl(c,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,i!==null&&i.tag===6?(a(c,i.sibling),i=o(i,f),i.return=c,c=i):(a(c,i),i=xu(f,c.mode,L),i.return=c,c=i),l(c)):a(c,i)}return O}var ao=sp(!0),up=sp(!1),Wl=_a(null),$l=null,$r=null,Mi=null;function Ai(){Mi=$r=$l=null}function Di(e){var t=Wl.current;Ce(Wl),e._currentValue=t}function ju(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 Yr(e,t){$l=e,Mi=$r=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(nt=!0),e.firstContext=null)}function kt(e){var t=e._currentValue;if(Mi!==e)if(e={context:e,memoizedValue:t,next:null},$r===null){if($l===null)throw Error(T(308));$r=e,$l.dependencies={lanes:0,firstContext:e}}else $r=$r.next=e;return t}var ar=null;function Ei(e){ar===null?ar=[e]:ar.push(e)}function ip(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,Ei(t)):(a.next=o.next,o.next=a),t.interleaved=a,ga(e,r)}function ga(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 Fi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dp(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 ca(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(de&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ga(e,a)}return o=r.interleaved,o===null?(t.next=t,Ei(r)):(t.next=o.next,o.next=t),r.interleaved=t,ga(e,a)}function Cl(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,yi(e,a)}}function Nf(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 Vl(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 u=s,d=u.next;u.next=null,l===null?n=d:l.next=d,l=u;var m=e.alternate;m!==null&&(m=m.updateQueue,s=m.lastBaseUpdate,s!==l&&(s===null?m.firstBaseUpdate=d:s.next=d,m.lastBaseUpdate=u))}if(n!==null){var g=o.baseState;l=0,m=d=u=null,s=n;do{var p=s.lane,v=s.eventTime;if((r&p)===p){m!==null&&(m=m.next={eventTime:v,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=e,C=s;switch(p=t,v=a,C.tag){case 1:if(y=C.payload,typeof y=="function"){g=y.call(v,g,p);break e}g=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=C.payload,p=typeof y=="function"?y.call(v,g,p):y,p==null)break e;g=Pe({},g,p);break e;case 2:ka=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[s]:p.push(s))}else v={eventTime:v,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},m===null?(d=m=v,u=g):m=m.next=v,l|=p;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;p=s,s=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(m===null&&(u=g),o.baseState=u,o.firstBaseUpdate=d,o.lastBaseUpdate=m,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);ir|=l,e.lanes=l,e.memoizedState=g}}function Uf(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(T(191,o));o.call(r)}}}var xn={},Yt=_a(xn),sn=_a(xn),un=_a(xn);function rr(e){if(e===xn)throw Error(T(174));return e}function Bi(e,t){switch(Le(un,t),Le(sn,e),Le(Yt,xn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tu(t,e)}Ce(Yt),Le(Yt,t)}function ro(){Ce(Yt),Ce(sn),Ce(un)}function fp(e){rr(un.current);var t=rr(Yt.current),a=Tu(t,e.type);t!==a&&(Le(sn,e),Le(Yt,a))}function Oi(e){sn.current===e&&(Ce(Yt),Ce(sn))}var ke=_a(0);function Kl(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 fu=[];function zi(){for(var e=0;e<fu.length;e++)fu[e]._workInProgressVersionPrimary=null;fu.length=0}var wl=xa.ReactCurrentDispatcher,cu=xa.ReactCurrentBatchConfig,ur=0,be=null,Fe=null,ze=null,Gl=!1,Ko=!1,dn=0,dx=0;function Ke(){throw Error(T(321))}function Ni(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!_t(e[a],t[a]))return!1;return!0}function Ui(e,t,a,r,o,n){if(ur=n,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,wl.current=e===null||e.memoizedState===null?mx:gx,e=a(r,o),Ko){n=0;do{if(Ko=!1,dn=0,25<=n)throw Error(T(301));n+=1,ze=Fe=null,t.updateQueue=null,wl.current=hx,e=a(r,o)}while(Ko)}if(wl.current=jl,t=Fe!==null&&Fe.next!==null,ur=0,ze=Fe=be=null,Gl=!1,t)throw Error(T(300));return e}function Hi(){var e=dn!==0;return dn=0,e}function jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?be.memoizedState=ze=e:ze=ze.next=e,ze}function bt(){if(Fe===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=ze===null?be.memoizedState:ze.next;if(t!==null)ze=t,Fe=e;else{if(e===null)throw Error(T(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},ze===null?be.memoizedState=ze=e:ze=ze.next=e}return ze}function fn(e,t){return typeof t=="function"?t(e):t}function pu(e){var t=bt(),a=t.queue;if(a===null)throw Error(T(311));a.lastRenderedReducer=e;var r=Fe,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,u=null,d=n;do{var m=d.lane;if((ur&m)===m)u!==null&&(u=u.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 g={lane:m,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(s=u=g,l=r):u=u.next=g,be.lanes|=m,ir|=m}d=d.next}while(d!==null&&d!==n);u===null?l=r:u.next=s,_t(r,t.memoizedState)||(nt=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,be.lanes|=n,ir|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function mu(e){var t=bt(),a=t.queue;if(a===null)throw Error(T(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);_t(n,t.memoizedState)||(nt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function cp(){}function pp(e,t){var a=be,r=bt(),o=t(),n=!_t(r.memoizedState,o);if(n&&(r.memoizedState=o,nt=!0),r=r.queue,_i(hp.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||ze!==null&&ze.memoizedState.tag&1){if(a.flags|=2048,cn(9,gp.bind(null,a,r,o,t),void 0,null),Ne===null)throw Error(T(349));(ur&30)!==0||mp(a,t,o)}return o}function mp(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function gp(e,t,a,r){t.value=a,t.getSnapshot=r,xp(t)&&vp(e)}function hp(e,t,a){return a(function(){xp(t)&&vp(e)})}function xp(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!_t(e,a)}catch{return!0}}function vp(e){var t=ga(e,1);t!==null&&Ht(t,e,1,-1)}function Hf(e){var t=jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:e},t.queue=e,e=e.dispatch=px.bind(null,be,e),[t.memoizedState,e]}function cn(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.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 yp(){return bt().memoizedState}function kl(e,t,a,r){var o=jt();be.flags|=e,o.memoizedState=cn(1|t,a,void 0,r===void 0?null:r)}function ls(e,t,a,r){var o=bt();r=r===void 0?null:r;var n=void 0;if(Fe!==null){var l=Fe.memoizedState;if(n=l.destroy,r!==null&&Ni(r,l.deps)){o.memoizedState=cn(t,a,n,r);return}}be.flags|=e,o.memoizedState=cn(1|t,a,n,r)}function _f(e,t){return kl(8390656,8,e,t)}function _i(e,t){return ls(2048,8,e,t)}function Lp(e,t){return ls(4,2,e,t)}function Sp(e,t){return ls(4,4,e,t)}function Ip(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 Cp(e,t,a){return a=a!=null?a.concat([e]):null,ls(4,4,Ip.bind(null,t,e),a)}function qi(){}function wp(e,t){var a=bt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Ni(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function kp(e,t){var a=bt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Ni(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function bp(e,t,a){return(ur&21)===0?(e.baseState&&(e.baseState=!1,nt=!0),e.memoizedState=a):(_t(a,t)||(a=Ac(),be.lanes|=a,ir|=a,e.baseState=!0),t)}function fx(e,t){var a=xe;xe=a!==0&&4>a?a:4,e(!0);var r=cu.transition;cu.transition={};try{e(!1),t()}finally{xe=a,cu.transition=r}}function Pp(){return bt().memoizedState}function cx(e,t,a){var r=Oa(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},Tp(e))Rp(t,a);else if(a=ip(e,t,a,r),a!==null){var o=Je();Ht(a,e,r,o),Mp(a,t,r)}}function px(e,t,a){var r=Oa(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(Tp(e))Rp(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,_t(s,l)){var u=t.interleaved;u===null?(o.next=o,Ei(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}a=ip(e,t,o,r),a!==null&&(o=Je(),Ht(a,e,r,o),Mp(a,t,r))}}function Tp(e){var t=e.alternate;return e===be||t!==null&&t===be}function Rp(e,t){Ko=Gl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Mp(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,yi(e,a)}}var jl={readContext:kt,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useInsertionEffect:Ke,useLayoutEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useMutableSource:Ke,useSyncExternalStore:Ke,useId:Ke,unstable_isNewReconciler:!1},mx={readContext:kt,useCallback:function(e,t){return jt().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:_f,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,kl(4194308,4,Ip.bind(null,t,e),a)},useLayoutEffect:function(e,t){return kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return kl(4,2,e,t)},useMemo:function(e,t){var a=jt();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=jt();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=cx.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=jt();return e={current:e},t.memoizedState=e},useState:Hf,useDebugValue:qi,useDeferredValue:function(e){return jt().memoizedState=e},useTransition:function(){var e=Hf(!1),t=e[0];return e=fx.bind(null,e[1]),jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=be,o=jt();if(we){if(a===void 0)throw Error(T(407));a=a()}else{if(a=t(),Ne===null)throw Error(T(349));(ur&30)!==0||mp(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,_f(hp.bind(null,r,n,e),[e]),r.flags|=2048,cn(9,gp.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=jt(),t=Ne.identifierPrefix;if(we){var a=fa,r=da;a=(r&~(1<<32-Ut(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=dn++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=dx++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},gx={readContext:kt,useCallback:wp,useContext:kt,useEffect:_i,useImperativeHandle:Cp,useInsertionEffect:Lp,useLayoutEffect:Sp,useMemo:kp,useReducer:pu,useRef:yp,useState:function(){return pu(fn)},useDebugValue:qi,useDeferredValue:function(e){var t=bt();return bp(t,Fe.memoizedState,e)},useTransition:function(){var e=pu(fn)[0],t=bt().memoizedState;return[e,t]},useMutableSource:cp,useSyncExternalStore:pp,useId:Pp,unstable_isNewReconciler:!1},hx={readContext:kt,useCallback:wp,useContext:kt,useEffect:_i,useImperativeHandle:Cp,useInsertionEffect:Lp,useLayoutEffect:Sp,useMemo:kp,useReducer:mu,useRef:yp,useState:function(){return mu(fn)},useDebugValue:qi,useDeferredValue:function(e){var t=bt();return Fe===null?t.memoizedState=e:bp(t,Fe.memoizedState,e)},useTransition:function(){var e=mu(fn)[0],t=bt().memoizedState;return[e,t]},useMutableSource:cp,useSyncExternalStore:pp,useId:Pp,unstable_isNewReconciler:!1};function Ot(e,t){if(e&&e.defaultProps){t=Pe({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Xu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Pe({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ss={isMounted:function(e){return(e=e._reactInternals)?cr(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Je(),o=Oa(e),n=ca(r,o);n.payload=t,a!=null&&(n.callback=a),t=Fa(e,n,o),t!==null&&(Ht(t,e,o,r),Cl(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Je(),o=Oa(e),n=ca(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Fa(e,n,o),t!==null&&(Ht(t,e,o,r),Cl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Je(),r=Oa(e),o=ca(a,r);o.tag=2,t!=null&&(o.callback=t),t=Fa(e,o,r),t!==null&&(Ht(t,e,r,a),Cl(t,e,r))}};function qf(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?!rn(a,r)||!rn(o,n):!0}function Ap(e,t,a){var r=!1,o=Ua,n=t.contextType;return typeof n=="object"&&n!==null?n=kt(n):(o=st(t)?lr:Xe.current,r=t.contextTypes,n=(r=r!=null)?eo(e,o):Ua),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ss,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Wf(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&&ss.enqueueReplaceState(t,t.state,null)}function Qu(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},Fi(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=kt(n):(n=st(t)?lr:Xe.current,o.context=eo(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Xu(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&&ss.enqueueReplaceState(o,o.state,null),Vl(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+=Kg(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 gu(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Yu(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var xx=typeof WeakMap=="function"?WeakMap:Map;function Dp(e,t,a){a=ca(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Ql||(Ql=!0,si=r),Yu(e,t)},a}function Ep(e,t,a){a=ca(-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(){Yu(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Yu(e,t),typeof r!="function"&&(Ba===null?Ba=new Set([this]):Ba.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),a}function $f(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new xx;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=Ax.bind(null,e,t,a),t.then(e,e))}function Vf(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 Kf(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=ca(-1,1),t.tag=2,Fa(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var vx=xa.ReactCurrentOwner,nt=!1;function Ye(e,t,a,r){t.child=e===null?up(t,null,a,r):ao(t,e.child,a,r)}function Gf(e,t,a,r,o){a=a.render;var n=t.ref;return Yr(t,o),r=Ui(e,t,a,r,n,o),a=Hi(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ha(e,t,o)):(we&&a&&Pi(t),t.flags|=1,Ye(e,t,r,o),t.child)}function jf(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Qi(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,Fp(e,t,n,r,o)):(e=Rl(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:rn,a(l,r)&&e.ref===t.ref)return ha(e,t,o)}return t.flags|=1,e=za(n,r),e.ref=t.ref,e.return=t,t.child=e}function Fp(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(rn(n,r)&&e.ref===t.ref)if(nt=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(nt=!0);else return t.lanes=e.lanes,ha(e,t,o)}return Ju(e,t,a,r,o)}function Bp(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},Le(Kr,dt),dt|=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,Le(Kr,dt),dt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,Le(Kr,dt),dt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,Le(Kr,dt),dt|=r;return Ye(e,t,o,a),t.child}function Op(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Ju(e,t,a,r,o){var n=st(a)?lr:Xe.current;return n=eo(t,n),Yr(t,o),a=Ui(e,t,a,r,n,o),r=Hi(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ha(e,t,o)):(we&&r&&Pi(t),t.flags|=1,Ye(e,t,a,o),t.child)}function Xf(e,t,a,r,o){if(st(a)){var n=!0;Hl(t)}else n=!1;if(Yr(t,o),t.stateNode===null)bl(e,t),Ap(t,a,r),Qu(t,a,r,o),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var u=l.context,d=a.contextType;typeof d=="object"&&d!==null?d=kt(d):(d=st(a)?lr:Xe.current,d=eo(t,d));var m=a.getDerivedStateFromProps,g=typeof m=="function"||typeof l.getSnapshotBeforeUpdate=="function";g||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||u!==d)&&Wf(t,l,r,d),ka=!1;var p=t.memoizedState;l.state=p,Vl(t,r,l,o),u=t.memoizedState,s!==r||p!==u||lt.current||ka?(typeof m=="function"&&(Xu(t,a,m,r),u=t.memoizedState),(s=ka||qf(t,a,s,r,p,u,d))?(g||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=u),l.props=r,l.state=u,l.context=d,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,dp(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:Ot(t.type,s),l.props=d,g=t.pendingProps,p=l.context,u=a.contextType,typeof u=="object"&&u!==null?u=kt(u):(u=st(a)?lr:Xe.current,u=eo(t,u));var v=a.getDerivedStateFromProps;(m=typeof v=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==g||p!==u)&&Wf(t,l,r,u),ka=!1,p=t.memoizedState,l.state=p,Vl(t,r,l,o);var y=t.memoizedState;s!==g||p!==y||lt.current||ka?(typeof v=="function"&&(Xu(t,a,v,r),y=t.memoizedState),(d=ka||qf(t,a,d,r,p,y,u)||!1)?(m||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,y,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,y,u)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),l.props=r,l.state=y,l.context=u,r=d):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Zu(e,t,a,r,n,o)}function Zu(e,t,a,r,o,n){Op(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&Ff(t,a,!1),ha(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=ao(t,e.child,null,n),t.child=ao(t,null,s,n)):Ye(e,t,s,n),t.memoizedState=r.state,o&&Ff(t,a,!0),t.child}function zp(e){var t=e.stateNode;t.pendingContext?Ef(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ef(e,t.context,!1),Bi(e,t.containerInfo)}function Qf(e,t,a,r,o){return to(),Ri(o),t.flags|=256,Ye(e,t,a,r),t.child}var ei={dehydrated:null,treeContext:null,retryLane:0};function ti(e){return{baseLanes:e,cachePool:null,transitions:null}}function Np(e,t,a){var r=t.pendingProps,o=ke.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),Le(ke,o&1),e===null)return Gu(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=ds(l,r,0,null),e=nr(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=ti(a),t.memoizedState=ei,e):Wi(t,l));if(o=e.memoizedState,o!==null&&(s=o.dehydrated,s!==null))return yx(e,t,l,r,s,o,a);if(n){n=r.fallback,l=t.mode,o=e.child,s=o.sibling;var u={mode:"hidden",children:r.children};return(l&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=za(o,u),r.subtreeFlags=o.subtreeFlags&14680064),s!==null?n=za(s,n):(n=nr(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?ti(a):{baseLanes:l.baseLanes|a,cachePool:null,transitions:l.transitions},n.memoizedState=l,n.childLanes=e.childLanes&~a,t.memoizedState=ei,r}return n=e.child,e=n.sibling,r=za(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 Wi(e,t){return t=ds({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xl(e,t,a,r){return r!==null&&Ri(r),ao(t,e.child,null,a),e=Wi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yx(e,t,a,r,o,n,l){if(a)return t.flags&256?(t.flags&=-257,r=gu(Error(T(422))),xl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=ds({mode:"visible",children:r.children},o,0,null),n=nr(n,o,l,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&ao(t,e.child,null,l),t.child.memoizedState=ti(l),t.memoizedState=ei,n);if((t.mode&1)===0)return xl(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var s=r.dgst;return r=s,n=Error(T(419)),r=gu(n,r,void 0),xl(e,t,l,r)}if(s=(l&e.childLanes)!==0,nt||s){if(r=Ne,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,ga(e,o),Ht(r,e,o,-1))}return Xi(),r=gu(Error(T(421))),xl(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Dx.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,ft=Ea(o.nextSibling),ct=t,we=!0,Nt=null,e!==null&&(St[It++]=da,St[It++]=fa,St[It++]=sr,da=e.id,fa=e.overflow,sr=t),t=Wi(t,r.children),t.flags|=4096,t)}function Yf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ju(e.return,t,a)}function hu(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 Up(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(Ye(e,t,r.children,a),r=ke.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&&Yf(e,a,t);else if(e.tag===19)Yf(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(Le(ke,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&&Kl(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),hu(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&&Kl(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}hu(t,!0,a,null,n);break;case"together":hu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function bl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ha(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ir|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(T(153));if(t.child!==null){for(e=t.child,a=za(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=za(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Lx(e,t,a){switch(t.tag){case 3:zp(t),to();break;case 5:fp(t);break;case 1:st(t.type)&&Hl(t);break;case 4:Bi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Le(Wl,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Le(ke,ke.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?Np(e,t,a):(Le(ke,ke.current&1),e=ha(e,t,a),e!==null?e.sibling:null);Le(ke,ke.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Up(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Le(ke,ke.current),r)break;return null;case 22:case 23:return t.lanes=0,Bp(e,t,a)}return ha(e,t,a)}var Hp,ai,_p,qp;Hp=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}};ai=function(){};_p=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,rr(Yt.current);var n=null;switch(a){case"input":o=wu(e,o),r=wu(e,r),n=[];break;case"select":o=Pe({},o,{value:void 0}),r=Pe({},r,{value:void 0}),n=[];break;case"textarea":o=Pu(e,o),r=Pu(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Nl)}Ru(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"&&(Qo.hasOwnProperty(d)?n||(n=[]):(n=n||[]).push(d,null));for(d in r){var u=r[d];if(s=o!=null?o[d]:void 0,r.hasOwnProperty(d)&&u!==s&&(u!=null||s!=null))if(d==="style")if(s){for(l in s)!s.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(a||(a={}),a[l]="");for(l in u)u.hasOwnProperty(l)&&s[l]!==u[l]&&(a||(a={}),a[l]=u[l])}else a||(n||(n=[]),n.push(d,a)),a=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,s=s?s.__html:void 0,u!=null&&s!==u&&(n=n||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(n=n||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Qo.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&Ie("scroll",e),n||s===u||(n=[])):(n=n||[]).push(d,u))}a&&(n=n||[]).push("style",a);var d=n;(t.updateQueue=d)&&(t.flags|=4)}};qp=function(e,t,a,r){a!==r&&(t.flags|=4)};function Fo(e,t){if(!we)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 Ge(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 Sx(e,t,a){var r=t.pendingProps;switch(Ti(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return st(t.type)&&Ul(),Ge(t),null;case 3:return r=t.stateNode,ro(),Ce(lt),Ce(Xe),zi(),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,Nt!==null&&(di(Nt),Nt=null))),ai(e,t),Ge(t),null;case 5:Oi(t);var o=rr(un.current);if(a=t.type,e!==null&&t.stateNode!=null)_p(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(T(166));return Ge(t),null}if(e=rr(Yt.current),gl(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Xt]=t,r[ln]=n,e=(t.mode&1)!==0,a){case"dialog":Ie("cancel",r),Ie("close",r);break;case"iframe":case"object":case"embed":Ie("load",r);break;case"video":case"audio":for(o=0;o<Ho.length;o++)Ie(Ho[o],r);break;case"source":Ie("error",r);break;case"img":case"image":case"link":Ie("error",r),Ie("load",r);break;case"details":Ie("toggle",r);break;case"input":of(r,n),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",r);break;case"textarea":lf(r,n),Ie("invalid",r)}Ru(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&&ml(r.textContent,s,e),o=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(n.suppressHydrationWarning!==!0&&ml(r.textContent,s,e),o=["children",""+s]):Qo.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&Ie("scroll",r)}switch(a){case"input":al(r),nf(r,n,!0);break;case"textarea":al(r),sf(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Nl)}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=hc(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[Xt]=t,e[ln]=r,Hp(e,t,!1,!1),t.stateNode=e;e:{switch(l=Mu(a,r),a){case"dialog":Ie("cancel",e),Ie("close",e),o=r;break;case"iframe":case"object":case"embed":Ie("load",e),o=r;break;case"video":case"audio":for(o=0;o<Ho.length;o++)Ie(Ho[o],e);o=r;break;case"source":Ie("error",e),o=r;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=r;break;case"details":Ie("toggle",e),o=r;break;case"input":of(e,r),o=wu(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Pe({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":lf(e,r),o=Pu(e,r),Ie("invalid",e);break;default:o=r}Ru(a,o),s=o;for(n in s)if(s.hasOwnProperty(n)){var u=s[n];n==="style"?yc(e,u):n==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&xc(e,u)):n==="children"?typeof u=="string"?(a!=="textarea"||u!=="")&&Yo(e,u):typeof u=="number"&&Yo(e,""+u):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Qo.hasOwnProperty(n)?u!=null&&n==="onScroll"&&Ie("scroll",e):u!=null&&pi(e,n,u,l))}switch(a){case"input":al(e),nf(e,r,!1);break;case"textarea":al(e),sf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Na(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Gr(e,!!r.multiple,n,!1):r.defaultValue!=null&&Gr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Nl)}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 Ge(t),null;case 6:if(e&&t.stateNode!=null)qp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(T(166));if(a=rr(un.current),rr(Yt.current),gl(t)){if(r=t.stateNode,a=t.memoizedProps,r[Xt]=t,(n=r.nodeValue!==a)&&(e=ct,e!==null))switch(e.tag){case 3:ml(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ml(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Xt]=t,t.stateNode=r}return Ge(t),null;case 13:if(Ce(ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&ft!==null&&(t.mode&1)!==0&&(t.flags&128)===0)lp(),to(),t.flags|=98560,n=!1;else if(n=gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(T(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(T(317));n[Xt]=t}else to(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),n=!1}else Nt!==null&&(di(Nt),Nt=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||(ke.current&1)!==0?Be===0&&(Be=3):Xi())),t.updateQueue!==null&&(t.flags|=4),Ge(t),null);case 4:return ro(),ai(e,t),e===null&&on(t.stateNode.containerInfo),Ge(t),null;case 10:return Di(t.type._context),Ge(t),null;case 17:return st(t.type)&&Ul(),Ge(t),null;case 19:if(Ce(ke),n=t.memoizedState,n===null)return Ge(t),null;if(r=(t.flags&128)!==0,l=n.rendering,l===null)if(r)Fo(n,!1);else{if(Be!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(l=Kl(e),l!==null){for(t.flags|=128,Fo(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 Le(ke,ke.current&1|2),t.child}e=e.sibling}n.tail!==null&&Ae()>no&&(t.flags|=128,r=!0,Fo(n,!1),t.lanes=4194304)}else{if(!r)if(e=Kl(l),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Fo(n,!0),n.tail===null&&n.tailMode==="hidden"&&!l.alternate&&!we)return Ge(t),null}else 2*Ae()-n.renderingStartTime>no&&a!==1073741824&&(t.flags|=128,r=!0,Fo(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=Ae(),t.sibling=null,a=ke.current,Le(ke,r?a&1|2:a&1),t):(Ge(t),null);case 22:case 23:return ji(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(dt&1073741824)!==0&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(T(156,t.tag))}function Ix(e,t){switch(Ti(t),t.tag){case 1:return st(t.type)&&Ul(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ro(),Ce(lt),Ce(Xe),zi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Oi(t),null;case 13:if(Ce(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));to()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(ke),null;case 4:return ro(),null;case 10:return Di(t.type._context),null;case 22:case 23:return ji(),null;case 24:return null;default:return null}}var vl=!1,je=!1,Cx=typeof WeakSet=="function"?WeakSet:Set,z=null;function Vr(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Re(e,t,r)}else a.current=null}function ri(e,t,a){try{a()}catch(r){Re(e,t,r)}}var Jf=!1;function wx(e,t){if(Hu=Bl,e=Gc(),bi(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,u=-1,d=0,m=0,g=e,p=null;t:for(;;){for(var v;g!==a||o!==0&&g.nodeType!==3||(s=l+o),g!==n||r!==0&&g.nodeType!==3||(u=l+r),g.nodeType===3&&(l+=g.nodeValue.length),(v=g.firstChild)!==null;)p=g,g=v;for(;;){if(g===e)break t;if(p===a&&++d===o&&(s=l),p===n&&++m===r&&(u=l),(v=g.nextSibling)!==null)break;g=p,p=g.parentNode}g=v}a=s===-1||u===-1?null:{start:s,end:u}}else a=null}a=a||{start:0,end:0}}else a=null;for(_u={focusedElem:e,selectionRange:a},Bl=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var y=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var C=y.memoizedProps,O=y.memoizedState,c=t.stateNode,i=c.getSnapshotBeforeUpdate(t.elementType===t.type?C:Ot(t.type,C),O);c.__reactInternalSnapshotBeforeUpdate=i}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(T(163))}}catch(L){Re(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return y=Jf,Jf=!1,y}function Go(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&&ri(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 oi(e){var t=e.ref;if(t!==null){var a=e.stateNode;e.tag,e=a,typeof t=="function"?t(e):t.current=e}}function Wp(e){var t=e.alternate;t!==null&&(e.alternate=null,Wp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xt],delete t[ln],delete t[$u],delete t[lx],delete t[sx])),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 $p(e){return e.tag===5||e.tag===3||e.tag===4}function Zf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$p(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 ni(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=Nl));else if(r!==4&&(e=e.child,e!==null))for(ni(e,t,a),e=e.sibling;e!==null;)ni(e,t,a),e=e.sibling}function li(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(li(e,t,a),e=e.sibling;e!==null;)li(e,t,a),e=e.sibling}var qe=null,zt=!1;function Ca(e,t,a){for(a=a.child;a!==null;)Vp(e,t,a),a=a.sibling}function Vp(e,t,a){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(es,a)}catch{}switch(a.tag){case 5:je||Vr(a,t);case 6:var r=qe,o=zt;qe=null,Ca(e,t,a),qe=r,zt=o,qe!==null&&(zt?(e=qe,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):qe.removeChild(a.stateNode));break;case 18:qe!==null&&(zt?(e=qe,a=a.stateNode,e.nodeType===8?iu(e.parentNode,a):e.nodeType===1&&iu(e,a),tn(e)):iu(qe,a.stateNode));break;case 4:r=qe,o=zt,qe=a.stateNode.containerInfo,zt=!0,Ca(e,t,a),qe=r,zt=o;break;case 0:case 11:case 14:case 15:if(!je&&(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)&&ri(a,t,l),o=o.next}while(o!==r)}Ca(e,t,a);break;case 1:if(!je&&(Vr(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(s){Re(a,t,s)}Ca(e,t,a);break;case 21:Ca(e,t,a);break;case 22:a.mode&1?(je=(r=je)||a.memoizedState!==null,Ca(e,t,a),je=r):Ca(e,t,a);break;default:Ca(e,t,a)}}function ec(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new Cx),t.forEach(function(r){var o=Ex.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function Bt(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:qe=s.stateNode,zt=!1;break e;case 3:qe=s.stateNode.containerInfo,zt=!0;break e;case 4:qe=s.stateNode.containerInfo,zt=!0;break e}s=s.return}if(qe===null)throw Error(T(160));Vp(n,l,o),qe=null,zt=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(d){Re(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Kp(t,e),t=t.sibling}function Kp(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Bt(t,e),Gt(e),r&4){try{Go(3,e,e.return),us(3,e)}catch(C){Re(e,e.return,C)}try{Go(5,e,e.return)}catch(C){Re(e,e.return,C)}}break;case 1:Bt(t,e),Gt(e),r&512&&a!==null&&Vr(a,a.return);break;case 5:if(Bt(t,e),Gt(e),r&512&&a!==null&&Vr(a,a.return),e.flags&32){var o=e.stateNode;try{Yo(o,"")}catch(C){Re(e,e.return,C)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,l=a!==null?a.memoizedProps:n,s=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{s==="input"&&n.type==="radio"&&n.name!=null&&mc(o,n),Mu(s,l);var d=Mu(s,n);for(l=0;l<u.length;l+=2){var m=u[l],g=u[l+1];m==="style"?yc(o,g):m==="dangerouslySetInnerHTML"?xc(o,g):m==="children"?Yo(o,g):pi(o,m,g,d)}switch(s){case"input":ku(o,n);break;case"textarea":gc(o,n);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var v=n.value;v!=null?Gr(o,!!n.multiple,v,!1):p!==!!n.multiple&&(n.defaultValue!=null?Gr(o,!!n.multiple,n.defaultValue,!0):Gr(o,!!n.multiple,n.multiple?[]:"",!1))}o[ln]=n}catch(C){Re(e,e.return,C)}}break;case 6:if(Bt(t,e),Gt(e),r&4){if(e.stateNode===null)throw Error(T(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(C){Re(e,e.return,C)}}break;case 3:if(Bt(t,e),Gt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{tn(t.containerInfo)}catch(C){Re(e,e.return,C)}break;case 4:Bt(t,e),Gt(e);break;case 13:Bt(t,e),Gt(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(Ki=Ae())),r&4&&ec(e);break;case 22:if(m=a!==null&&a.memoizedState!==null,e.mode&1?(je=(d=je)||m,Bt(t,e),je=d):Bt(t,e),Gt(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!m&&(e.mode&1)!==0)for(z=e,m=e.child;m!==null;){for(g=z=m;z!==null;){switch(p=z,v=p.child,p.tag){case 0:case 11:case 14:case 15:Go(4,p,p.return);break;case 1:Vr(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,a=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(C){Re(r,a,C)}}break;case 5:Vr(p,p.return);break;case 22:if(p.memoizedState!==null){ac(g);continue}}v!==null?(v.return=p,z=v):ac(g)}m=m.sibling}e:for(m=null,g=e;;){if(g.tag===5){if(m===null){m=g;try{o=g.stateNode,d?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(s=g.stateNode,u=g.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,s.style.display=vc("display",l))}catch(C){Re(e,e.return,C)}}}else if(g.tag===6){if(m===null)try{g.stateNode.nodeValue=d?"":g.memoizedProps}catch(C){Re(e,e.return,C)}}else if((g.tag!==22&&g.tag!==23||g.memoizedState===null||g===e)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===e)break e;for(;g.sibling===null;){if(g.return===null||g.return===e)break e;m===g&&(m=null),g=g.return}m===g&&(m=null),g.sibling.return=g.return,g=g.sibling}}break;case 19:Bt(t,e),Gt(e),r&4&&ec(e);break;case 21:break;default:Bt(t,e),Gt(e)}}function Gt(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if($p(a)){var r=a;break e}a=a.return}throw Error(T(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Yo(o,""),r.flags&=-33);var n=Zf(e);li(e,n,o);break;case 3:case 4:var l=r.stateNode.containerInfo,s=Zf(e);ni(e,s,l);break;default:throw Error(T(161))}}catch(u){Re(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kx(e,t,a){z=e,Gp(e,t,a)}function Gp(e,t,a){for(var r=(e.mode&1)!==0;z!==null;){var o=z,n=o.child;if(o.tag===22&&r){var l=o.memoizedState!==null||vl;if(!l){var s=o.alternate,u=s!==null&&s.memoizedState!==null||je;s=vl;var d=je;if(vl=l,(je=u)&&!d)for(z=o;z!==null;)l=z,u=l.child,l.tag===22&&l.memoizedState!==null?rc(o):u!==null?(u.return=l,z=u):rc(o);for(;n!==null;)z=n,Gp(n,t,a),n=n.sibling;z=o,vl=s,je=d}tc(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,z=n):tc(e,t,a)}}function tc(e){for(;z!==null;){var t=z;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:je||us(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!je)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:Ot(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&Uf(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}Uf(t,l,a)}break;case 5:var s=t.stateNode;if(a===null&&t.flags&4){a=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&a.focus();break;case"img":u.src&&(a.src=u.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 m=d.memoizedState;if(m!==null){var g=m.dehydrated;g!==null&&tn(g)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(T(163))}je||t.flags&512&&oi(t)}catch(p){Re(t,t.return,p)}}if(t===e){z=null;break}if(a=t.sibling,a!==null){a.return=t.return,z=a;break}z=t.return}}function ac(e){for(;z!==null;){var t=z;if(t===e){z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,z=a;break}z=t.return}}function rc(e){for(;z!==null;){var t=z;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{us(4,t)}catch(u){Re(t,a,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Re(t,o,u)}}var n=t.return;try{oi(t)}catch(u){Re(t,n,u)}break;case 5:var l=t.return;try{oi(t)}catch(u){Re(t,l,u)}}}catch(u){Re(t,t.return,u)}if(t===e){z=null;break}var s=t.sibling;if(s!==null){s.return=t.return,z=s;break}z=t.return}}var bx=Math.ceil,Xl=xa.ReactCurrentDispatcher,$i=xa.ReactCurrentOwner,wt=xa.ReactCurrentBatchConfig,de=0,Ne=null,De=null,We=0,dt=0,Kr=_a(0),Be=0,pn=null,ir=0,is=0,Vi=0,jo=null,ot=null,Ki=0,no=1/0,ua=null,Ql=!1,si=null,Ba=null,yl=!1,Ra=null,Yl=0,Xo=0,ui=null,Pl=-1,Tl=0;function Je(){return(de&6)!==0?Ae():Pl!==-1?Pl:Pl=Ae()}function Oa(e){return(e.mode&1)===0?1:(de&2)!==0&&We!==0?We&-We:ix.transition!==null?(Tl===0&&(Tl=Ac()),Tl):(e=xe,e!==0||(e=window.event,e=e===void 0?16:Nc(e.type)),e)}function Ht(e,t,a,r){if(50<Xo)throw Xo=0,ui=null,Error(T(185));mn(e,a,r),((de&2)===0||e!==Ne)&&(e===Ne&&((de&2)===0&&(is|=a),Be===4&&Pa(e,We)),ut(e,r),a===1&&de===0&&(t.mode&1)===0&&(no=Ae()+500,ns&&qa()))}function ut(e,t){var a=e.callbackNode;fh(e,t);var r=Fl(e,e===Ne?We:0);if(r===0)a!==null&&ff(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&ff(a),t===1)e.tag===0?ux(oc.bind(null,e)):rp(oc.bind(null,e)),ox(function(){(de&6)===0&&qa()}),a=null;else{switch(Dc(r)){case 1:a=vi;break;case 4:a=Rc;break;case 16:a=El;break;case 536870912:a=Mc;break;default:a=El}a=tm(a,jp.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function jp(e,t){if(Pl=-1,Tl=0,(de&6)!==0)throw Error(T(327));var a=e.callbackNode;if(Jr()&&e.callbackNode!==a)return null;var r=Fl(e,e===Ne?We:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Jl(e,r);else{t=r;var o=de;de|=2;var n=Qp();(Ne!==e||We!==t)&&(ua=null,no=Ae()+500,or(e,t));do try{Rx();break}catch(s){Xp(e,s)}while(!0);Ai(),Xl.current=n,de=o,De!==null?t=0:(Ne=null,We=0,t=Be)}if(t!==0){if(t===2&&(o=Bu(e),o!==0&&(r=o,t=ii(e,o))),t===1)throw a=pn,or(e,0),Pa(e,r),ut(e,Ae()),a;if(t===6)Pa(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Px(o)&&(t=Jl(e,r),t===2&&(n=Bu(e),n!==0&&(r=n,t=ii(e,n))),t===1))throw a=pn,or(e,0),Pa(e,r),ut(e,Ae()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(T(345));case 2:er(e,ot,ua);break;case 3:if(Pa(e,r),(r&130023424)===r&&(t=Ki+500-Ae(),10<t)){if(Fl(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Je(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Wu(er.bind(null,e,ot,ua),t);break}er(e,ot,ua);break;case 4:if(Pa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-Ut(r);n=1<<l,l=t[l],l>o&&(o=l),r&=~n}if(r=o,r=Ae()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bx(r/1960))-r,10<r){e.timeoutHandle=Wu(er.bind(null,e,ot,ua),r);break}er(e,ot,ua);break;case 5:er(e,ot,ua);break;default:throw Error(T(329))}}}return ut(e,Ae()),e.callbackNode===a?jp.bind(null,e):null}function ii(e,t){var a=jo;return e.current.memoizedState.isDehydrated&&(or(e,t).flags|=256),e=Jl(e,t),e!==2&&(t=ot,ot=a,t!==null&&di(t)),e}function di(e){ot===null?ot=e:ot.push.apply(ot,e)}function Px(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(!_t(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 Pa(e,t){for(t&=~Vi,t&=~is,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Ut(t),r=1<<a;e[a]=-1,t&=~r}}function oc(e){if((de&6)!==0)throw Error(T(327));Jr();var t=Fl(e,0);if((t&1)===0)return ut(e,Ae()),null;var a=Jl(e,t);if(e.tag!==0&&a===2){var r=Bu(e);r!==0&&(t=r,a=ii(e,r))}if(a===1)throw a=pn,or(e,0),Pa(e,t),ut(e,Ae()),a;if(a===6)throw Error(T(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,ot,ua),ut(e,Ae()),null}function Gi(e,t){var a=de;de|=1;try{return e(t)}finally{de=a,de===0&&(no=Ae()+500,ns&&qa())}}function dr(e){Ra!==null&&Ra.tag===0&&(de&6)===0&&Jr();var t=de;de|=1;var a=wt.transition,r=xe;try{if(wt.transition=null,xe=1,e)return e()}finally{xe=r,wt.transition=a,de=t,(de&6)===0&&qa()}}function ji(){dt=Kr.current,Ce(Kr)}function or(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,rx(a)),De!==null)for(a=De.return;a!==null;){var r=a;switch(Ti(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ul();break;case 3:ro(),Ce(lt),Ce(Xe),zi();break;case 5:Oi(r);break;case 4:ro();break;case 13:Ce(ke);break;case 19:Ce(ke);break;case 10:Di(r.type._context);break;case 22:case 23:ji()}a=a.return}if(Ne=e,De=e=za(e.current,null),We=dt=t,Be=0,pn=null,Vi=is=ir=0,ot=jo=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 Xp(e,t){do{var a=De;try{if(Ai(),wl.current=jl,Gl){for(var r=be.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Gl=!1}if(ur=0,ze=Fe=be=null,Ko=!1,dn=0,$i.current=null,a===null||a.return===null){Be=1,pn=t,De=null;break}e:{var n=e,l=a.return,s=a,u=t;if(t=We,s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,m=s,g=m.tag;if((m.mode&1)===0&&(g===0||g===11||g===15)){var p=m.alternate;p?(m.updateQueue=p.updateQueue,m.memoizedState=p.memoizedState,m.lanes=p.lanes):(m.updateQueue=null,m.memoizedState=null)}var v=Vf(l);if(v!==null){v.flags&=-257,Kf(v,l,s,n,t),v.mode&1&&$f(n,d,t),t=v,u=d;var y=t.updateQueue;if(y===null){var C=new Set;C.add(u),t.updateQueue=C}else y.add(u);break e}else{if((t&1)===0){$f(n,d,t),Xi();break e}u=Error(T(426))}}else if(we&&s.mode&1){var O=Vf(l);if(O!==null){(O.flags&65536)===0&&(O.flags|=256),Kf(O,l,s,n,t),Ri(oo(u,s));break e}}n=u=oo(u,s),Be!==4&&(Be=2),jo===null?jo=[n]:jo.push(n),n=l;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var c=Dp(n,u,t);Nf(n,c);break e;case 1:s=u;var i=n.type,f=n.stateNode;if((n.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ba===null||!Ba.has(f)))){n.flags|=65536,t&=-t,n.lanes|=t;var L=Ep(n,s,t);Nf(n,L);break e}}n=n.return}while(n!==null)}Jp(a)}catch(w){t=w,De===a&&a!==null&&(De=a=a.return);continue}break}while(!0)}function Qp(){var e=Xl.current;return Xl.current=jl,e===null?jl:e}function Xi(){(Be===0||Be===3||Be===2)&&(Be=4),Ne===null||(ir&268435455)===0&&(is&268435455)===0||Pa(Ne,We)}function Jl(e,t){var a=de;de|=2;var r=Qp();(Ne!==e||We!==t)&&(ua=null,or(e,t));do try{Tx();break}catch(o){Xp(e,o)}while(!0);if(Ai(),de=a,Xl.current=r,De!==null)throw Error(T(261));return Ne=null,We=0,Be}function Tx(){for(;De!==null;)Yp(De)}function Rx(){for(;De!==null&&!ah();)Yp(De)}function Yp(e){var t=em(e.alternate,e,dt);e.memoizedProps=e.pendingProps,t===null?Jp(e):De=t,$i.current=null}function Jp(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=Sx(a,t,dt),a!==null){De=a;return}}else{if(a=Ix(a,t),a!==null){a.flags&=32767,De=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Be=6,De=null;return}}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Be===0&&(Be=5)}function er(e,t,a){var r=xe,o=wt.transition;try{wt.transition=null,xe=1,Mx(e,t,a,r)}finally{wt.transition=o,xe=r}return null}function Mx(e,t,a,r){do Jr();while(Ra!==null);if((de&6)!==0)throw Error(T(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(T(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(ch(e,n),e===Ne&&(De=Ne=null,We=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||yl||(yl=!0,tm(El,function(){return Jr(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=wt.transition,wt.transition=null;var l=xe;xe=1;var s=de;de|=4,$i.current=null,wx(e,a),Kp(a,e),Jh(_u),Bl=!!Hu,_u=Hu=null,e.current=a,kx(a,e,o),rh(),de=s,xe=l,wt.transition=n}else e.current=a;if(yl&&(yl=!1,Ra=e,Yl=o),n=e.pendingLanes,n===0&&(Ba=null),lh(a.stateNode,r),ut(e,Ae()),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(Ql)throw Ql=!1,e=si,si=null,e;return(Yl&1)!==0&&e.tag!==0&&Jr(),n=e.pendingLanes,(n&1)!==0?e===ui?Xo++:(Xo=0,ui=e):Xo=0,qa(),null}function Jr(){if(Ra!==null){var e=Dc(Yl),t=wt.transition,a=xe;try{if(wt.transition=null,xe=16>e?16:e,Ra===null)var r=!1;else{if(e=Ra,Ra=null,Yl=0,(de&6)!==0)throw Error(T(331));var o=de;for(de|=4,z=e.current;z!==null;){var n=z,l=n.child;if((z.flags&16)!==0){var s=n.deletions;if(s!==null){for(var u=0;u<s.length;u++){var d=s[u];for(z=d;z!==null;){var m=z;switch(m.tag){case 0:case 11:case 15:Go(8,m,n)}var g=m.child;if(g!==null)g.return=m,z=g;else for(;z!==null;){m=z;var p=m.sibling,v=m.return;if(Wp(m),m===d){z=null;break}if(p!==null){p.return=v,z=p;break}z=v}}}var y=n.alternate;if(y!==null){var C=y.child;if(C!==null){y.child=null;do{var O=C.sibling;C.sibling=null,C=O}while(C!==null)}}z=n}}if((n.subtreeFlags&2064)!==0&&l!==null)l.return=n,z=l;else e:for(;z!==null;){if(n=z,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:Go(9,n,n.return)}var c=n.sibling;if(c!==null){c.return=n.return,z=c;break e}z=n.return}}var i=e.current;for(z=i;z!==null;){l=z;var f=l.child;if((l.subtreeFlags&2064)!==0&&f!==null)f.return=l,z=f;else e:for(l=i;z!==null;){if(s=z,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:us(9,s)}}catch(w){Re(s,s.return,w)}if(s===l){z=null;break e}var L=s.sibling;if(L!==null){L.return=s.return,z=L;break e}z=s.return}}if(de=o,qa(),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(es,e)}catch{}r=!0}return r}finally{xe=a,wt.transition=t}}return!1}function nc(e,t,a){t=oo(a,t),t=Dp(e,t,1),e=Fa(e,t,1),t=Je(),e!==null&&(mn(e,1,t),ut(e,t))}function Re(e,t,a){if(e.tag===3)nc(e,e,a);else for(;t!==null;){if(t.tag===3){nc(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ba===null||!Ba.has(r))){e=oo(a,e),e=Ep(t,e,1),t=Fa(t,e,1),e=Je(),t!==null&&(mn(t,1,e),ut(t,e));break}}t=t.return}}function Ax(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=Je(),e.pingedLanes|=e.suspendedLanes&a,Ne===e&&(We&a)===a&&(Be===4||Be===3&&(We&130023424)===We&&500>Ae()-Ki?or(e,0):Vi|=a),ut(e,t)}function Zp(e,t){t===0&&((e.mode&1)===0?t=1:(t=nl,nl<<=1,(nl&130023424)===0&&(nl=4194304)));var a=Je();e=ga(e,t),e!==null&&(mn(e,t,a),ut(e,a))}function Dx(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Zp(e,a)}function Ex(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(T(314))}r!==null&&r.delete(t),Zp(e,a)}var em;em=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||lt.current)nt=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return nt=!1,Lx(e,t,a);nt=(e.flags&131072)!==0}else nt=!1,we&&(t.flags&1048576)!==0&&op(t,ql,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;bl(e,t),e=t.pendingProps;var o=eo(t,Xe.current);Yr(t,a),o=Ui(null,t,r,e,o,a);var n=Hi();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,st(r)?(n=!0,Hl(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Fi(t),o.updater=ss,t.stateNode=o,o._reactInternals=t,Qu(t,r,e,a),t=Zu(null,t,r,!0,n,a)):(t.tag=0,we&&n&&Pi(t),Ye(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(bl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Bx(r),e=Ot(r,e),o){case 0:t=Ju(null,t,r,e,a);break e;case 1:t=Xf(null,t,r,e,a);break e;case 11:t=Gf(null,t,r,e,a);break e;case 14:t=jf(null,t,r,Ot(r.type,e),a);break e}throw Error(T(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ot(r,o),Ju(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ot(r,o),Xf(e,t,r,o,a);case 3:e:{if(zp(t),e===null)throw Error(T(387));r=t.pendingProps,n=t.memoizedState,o=n.element,dp(e,t),Vl(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(T(423)),t),t=Qf(e,t,r,a,o);break e}else if(r!==o){o=oo(Error(T(424)),t),t=Qf(e,t,r,a,o);break e}else for(ft=Ea(t.stateNode.containerInfo.firstChild),ct=t,we=!0,Nt=null,a=up(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(to(),r===o){t=ha(e,t,a);break e}Ye(e,t,r,a)}t=t.child}return t;case 5:return fp(t),e===null&&Gu(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,l=o.children,qu(r,o)?l=null:n!==null&&qu(r,n)&&(t.flags|=32),Op(e,t),Ye(e,t,l,a),t.child;case 6:return e===null&&Gu(t),null;case 13:return Np(e,t,a);case 4:return Bi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,a):Ye(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ot(r,o),Gf(e,t,r,o,a);case 7:return Ye(e,t,t.pendingProps,a),t.child;case 8:return Ye(e,t,t.pendingProps.children,a),t.child;case 12:return Ye(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,Le(Wl,r._currentValue),r._currentValue=l,n!==null)if(_t(n.value,l)){if(n.children===o.children&&!lt.current){t=ha(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 u=s.firstContext;u!==null;){if(u.context===r){if(n.tag===1){u=ca(-1,a&-a),u.tag=2;var d=n.updateQueue;if(d!==null){d=d.shared;var m=d.pending;m===null?u.next=u:(u.next=m.next,m.next=u),d.pending=u}}n.lanes|=a,u=n.alternate,u!==null&&(u.lanes|=a),ju(n.return,a,t),s.lanes|=a;break}u=u.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(T(341));l.lanes|=a,s=l.alternate,s!==null&&(s.lanes|=a),ju(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}Ye(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Yr(t,a),o=kt(o),r=r(o),t.flags|=1,Ye(e,t,r,a),t.child;case 14:return r=t.type,o=Ot(r,t.pendingProps),o=Ot(r.type,o),jf(e,t,r,o,a);case 15:return Fp(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ot(r,o),bl(e,t),t.tag=1,st(r)?(e=!0,Hl(t)):e=!1,Yr(t,a),Ap(t,r,o),Qu(t,r,o,a),Zu(null,t,r,!0,e,a);case 19:return Up(e,t,a);case 22:return Bp(e,t,a)}throw Error(T(156,t.tag))};function tm(e,t){return Tc(e,t)}function Fx(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 Ct(e,t,a,r){return new Fx(e,t,a,r)}function Qi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bx(e){if(typeof e=="function")return Qi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gi)return 11;if(e===hi)return 14}return 2}function za(e,t){var a=e.alternate;return a===null?(a=Ct(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 Rl(e,t,a,r,o,n){var l=2;if(r=e,typeof e=="function")Qi(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Or:return nr(a.children,o,n,t);case mi:l=8,o|=8;break;case Lu:return e=Ct(12,a,t,o|2),e.elementType=Lu,e.lanes=n,e;case Su:return e=Ct(13,a,t,o),e.elementType=Su,e.lanes=n,e;case Iu:return e=Ct(19,a,t,o),e.elementType=Iu,e.lanes=n,e;case fc:return ds(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ic:l=10;break e;case dc:l=9;break e;case gi:l=11;break e;case hi:l=14;break e;case wa:l=16,r=null;break e}throw Error(T(130,e==null?e:typeof e,""))}return t=Ct(l,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function nr(e,t,a,r){return e=Ct(7,e,r,t),e.lanes=a,e}function ds(e,t,a,r){return e=Ct(22,e,r,t),e.elementType=fc,e.lanes=a,e.stateNode={isHidden:!1},e}function xu(e,t,a){return e=Ct(6,e,null,t),e.lanes=a,e}function vu(e,t,a){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ox(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=tu(0),this.expirationTimes=tu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Yi(e,t,a,r,o,n,l,s,u){return e=new Ox(e,t,a,s,u),t===1?(t=1,n===!0&&(t|=8)):t=0,n=Ct(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fi(n),e}function zx(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Br,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function am(e){if(!e)return Ua;e=e._reactInternals;e:{if(cr(e)!==e||e.tag!==1)throw Error(T(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(st(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(T(171))}if(e.tag===1){var a=e.type;if(st(a))return ap(e,a,t)}return t}function rm(e,t,a,r,o,n,l,s,u){return e=Yi(a,r,!0,e,o,n,l,s,u),e.context=am(null),a=e.current,r=Je(),o=Oa(a),n=ca(r,o),n.callback=t??null,Fa(a,n,o),e.current.lanes=o,mn(e,o,r),ut(e,r),e}function fs(e,t,a,r){var o=t.current,n=Je(),l=Oa(o);return a=am(a),t.context===null?t.context=a:t.pendingContext=a,t=ca(n,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Fa(o,t,l),e!==null&&(Ht(e,o,l,n),Cl(e,o,l)),l}function Zl(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function lc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ji(e,t){lc(e,t),(e=e.alternate)&&lc(e,t)}function Nx(){return null}var om=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zi(e){this._internalRoot=e}cs.prototype.render=Zi.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(T(409));fs(e,t,null,null)};cs.prototype.unmount=Zi.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dr(function(){fs(null,e,null,null)}),t[ma]=null}};function cs(e){this._internalRoot=e}cs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bc();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ba.length&&t!==0&&t<ba[a].priority;a++);ba.splice(a,0,e),a===0&&zc(e)}};function ed(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ps(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function sc(){}function Ux(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var d=Zl(l);n.call(d)}}var l=rm(t,r,e,0,null,!1,!1,"",sc);return e._reactRootContainer=l,e[ma]=l.current,on(e.nodeType===8?e.parentNode:e),dr(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var s=r;r=function(){var d=Zl(u);s.call(d)}}var u=Yi(e,0,!1,null,null,!1,!1,"",sc);return e._reactRootContainer=u,e[ma]=u.current,on(e.nodeType===8?e.parentNode:e),dr(function(){fs(t,u,a,r)}),u}function ms(e,t,a,r,o){var n=a._reactRootContainer;if(n){var l=n;if(typeof o=="function"){var s=o;o=function(){var u=Zl(l);s.call(u)}}fs(t,l,e,o)}else l=Ux(a,t,e,o,r);return Zl(l)}Ec=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=Uo(t.pendingLanes);a!==0&&(yi(t,a|1),ut(t,Ae()),(de&6)===0&&(no=Ae()+500,qa()))}break;case 13:dr(function(){var r=ga(e,1);if(r!==null){var o=Je();Ht(r,e,1,o)}}),Ji(e,1)}};Li=function(e){if(e.tag===13){var t=ga(e,134217728);if(t!==null){var a=Je();Ht(t,e,134217728,a)}Ji(e,134217728)}};Fc=function(e){if(e.tag===13){var t=Oa(e),a=ga(e,t);if(a!==null){var r=Je();Ht(a,e,t,r)}Ji(e,t)}};Bc=function(){return xe};Oc=function(e,t){var a=xe;try{return xe=e,t()}finally{xe=a}};Du=function(e,t,a){switch(t){case"input":if(ku(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=os(r);if(!o)throw Error(T(90));pc(r),ku(r,o)}}}break;case"textarea":gc(e,a);break;case"select":t=a.value,t!=null&&Gr(e,!!a.multiple,t,!1)}};Ic=Gi;Cc=dr;var Hx={usingClientEntryPoint:!1,Events:[hn,Hr,os,Lc,Sc,Gi]},Bo={findFiberByHostInstance:tr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_x={bundleType:Bo.bundleType,version:Bo.version,rendererPackageName:Bo.rendererPackageName,rendererConfig:Bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=bc(e),e===null?null:e.stateNode},findFiberByHostInstance:Bo.findFiberByHostInstance||Nx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Oo=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Oo.isDisabled&&Oo.supportsFiber))try{es=Oo.inject(_x),Qt=Oo}catch{}var Oo;gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hx;gt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ed(t))throw Error(T(200));return zx(e,t,null,a)};gt.createRoot=function(e,t){if(!ed(e))throw Error(T(299));var a=!1,r="",o=om;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Yi(e,1,!1,null,null,a,!1,r,o),e[ma]=t.current,on(e.nodeType===8?e.parentNode:e),new Zi(t)};gt.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(T(188)):(e=Object.keys(e).join(","),Error(T(268,e)));return e=bc(t),e=e===null?null:e.stateNode,e};gt.flushSync=function(e){return dr(e)};gt.hydrate=function(e,t,a){if(!ps(t))throw Error(T(200));return ms(null,e,t,!0,a)};gt.hydrateRoot=function(e,t,a){if(!ed(e))throw Error(T(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",l=om;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(l=a.onRecoverableError)),t=rm(t,null,e,1,a??null,o,!1,n,l),e[ma]=t.current,on(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 cs(t)};gt.render=function(e,t,a){if(!ps(t))throw Error(T(200));return ms(null,e,t,!1,a)};gt.unmountComponentAtNode=function(e){if(!ps(e))throw Error(T(40));return e._reactRootContainer?(dr(function(){ms(null,null,e,!1,function(){e._reactRootContainer=null,e[ma]=null})}),!0):!1};gt.unstable_batchedUpdates=Gi;gt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!ps(a))throw Error(T(200));if(e==null||e._reactInternals===void 0)throw Error(T(38));return ms(e,t,a,!1,r)};gt.version="18.3.1-next-f1338f8080-20240426"});var uo=sa((ry,sm)=>{"use strict";function lm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lm)}catch(e){console.error(e)}}lm(),sm.exports=nm()});var im=sa(td=>{"use strict";var um=uo();td.createRoot=um.createRoot,td.hydrateRoot=um.hydrateRoot;var oy});var gm=sa(Ss=>{"use strict";var Vx=Se(),Kx=Symbol.for("react.element"),Gx=Symbol.for("react.fragment"),jx=Object.prototype.hasOwnProperty,Xx=Vx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Qx={key:!0,ref:!0,__self:!0,__source:!0};function mm(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)jx.call(t,r)&&!Qx.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:Kx,type:e,key:n,ref:l,props:o,_owner:Xx.current}}Ss.Fragment=Gx;Ss.jsx=mm;Ss.jsxs=mm});var W=sa((AL,hm)=>{"use strict";hm.exports=gm()});var og=M(im(),1);var te=M(Se(),1),eg=M(uo(),1);function dm(e){return e.trim().replace(/^\\|/,"").replace(/\\|$/,"").split("|").map(a=>a.trim())}function qx(e){return/^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(e)}function Wx(e){let t=e.split(`\n`),a=[],r=0;for(;r<t.length;){let o=t[r]??"",n=t[r+1]??"";if(o.includes("|")&&qx(n)){let l=dm(o),s=[];for(r+=2;r<t.length&&t[r].includes("|")&&t[r].trim()!=="";)s.push(dm(t[r])),r+=1;let u=`<tr>${l.map(m=>`<th style="text-align:left;padding:7px 10px;border:1px solid #334155;color:#e2e8f0;background:#0f172a;">${m}</th>`).join("")}</tr>`,d=s.map(m=>`<tr>${m.map(g=>`<td style="padding:7px 10px;border:1px solid #334155;color:#cbd5e1;vertical-align:top;">${g}</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>${u}</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 Wx(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 $x="proto-comments-seen";function ad(e,t){try{let a=localStorage.getItem($x),r=a?JSON.parse(a):{};return t>(r[e]??0)}catch{return!1}}function rd(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function it(e){try{return new Date(e).toLocaleString()}catch{return e}}var od=16,io=1000000n,vs=BigInt("9".repeat(od));function Pt(e){return(e<0n?0n:e>vs?vs:e).toString().padStart(od,"0")}function hs(e){let t=e.split(".")[0];return/^\\d+$/.test(t)?BigInt(t):vs}function xs(e){let t=e.indexOf(".");return t>=0?e.slice(t+1):null}function pr(e,t){if(t===null){if(e===null)return Pt(io);let l=hs(e);if(l<vs-io)return Pt(l+io);let s=xs(e)??"0".repeat(od);return Pt(l)+"."+pr(s,null)}if(e===null){let l=hs(t),s=xs(t);return l>io?Pt(l-io):s!==null?Pt(l)+"."+pr(null,s):l>0n?Pt(l/2n):Pt(0n)+".0"}let a=hs(e),r=hs(t),o=xs(e),n=xs(t);return r>a+1n?Pt((a+r)/2n):r===a+1n?Pt(a)+"."+pr(o,null):o===null&&n===null?Pt(a)+"."+Pt(io):Pt(a)+"."+pr(o,n)}function vn(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 nd(e,t,a,r){let o=new Map,n=null;for(let g of e)g.sortKey&&g.sortKey!=="n"&&(o.set(g.id,g.sortKey),n=g.sortKey);let l=[],s=e.filter(g=>!g.sortKey||g.sortKey==="n");if(s.length>0){let g=n;for(let p of s){let v=pr(g,null);o.set(p.id,v),g=v,p.id!==t&&l.push({id:p.id,sortKey:v})}}let u=a?o.get(a)??null:null,d=r?o.get(r)??null:null;return{newSortKey:pr(u,d),normalizationPatches:l}}var Jt=M(Se(),1);var Ls=M(Se());var fm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ys=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var yn=M(Se());var cm={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 pm=(0,yn.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:l,...s},u)=>(0,yn.createElement)("svg",{ref:u,...cm,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:ys("lucide",o),...s},[...l.map(([d,m])=>(0,yn.createElement)(d,m)),...Array.isArray(n)?n:[n]]));var ee=(e,t)=>{let a=(0,Ls.forwardRef)(({className:r,...o},n)=>(0,Ls.createElement)(pm,{ref:n,iconNode:t,className:ys(`lucide-${fm(e)}`,r),...o}));return a.displayName=`${e}`,a};var mr=ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var Ln=ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var Wa=ee("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 gr=ee("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 Sn=ee("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 fo=ee("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 In=ee("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 Cn=ee("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 wn=ee("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 kn=ee("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 hr=ee("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var $a=ee("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 xr=ee("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 bn=ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Pn=ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var vr=ee("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 Tn=ee("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 co=ee("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 Va=ee("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 po=ee("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 Rn=ee("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 Ue=ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var mo=M(Se(),1),Pm=M(uo(),1);var ym=M(W(),1),xm={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 vm({type:e,style:t}){let a=typeof e=="string"&&e.trim()&&e!=="[object Object]"&&xm[e]?e:"Task",r=xm[a];return(0,ym.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 Im=M(W(),1),Lm={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 Sm({priority:e,style:t}){if(!e||!Lm[e])return null;let a=Lm[e];return(0,Im.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."}],FL=yr.map(e=>e.value),wm=Object.fromEntries(yr.map(e=>[e.value,e.icon])),BL=Object.fromEntries(yr.map(e=>[e.value,e.css])),Cm={Task:"#94a3b8",Bug:"#ef4444",Research:"#a855f7"};function Mn(e){return Cm[e??"Task"]??Cm.Task}var km=[{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 Yx(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)>>>0;return t%km.length}function qt(e){return km[Yx(e)]}var An=M(W(),1);function Dn({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,An.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3,alignItems:"center"},children:e.map(n=>{let{bg:l,text:s,border:u}=qt(n);return(0,An.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding:r,borderRadius:100,background:l,border:`1px solid ${u}`,color:s,fontSize:o,fontWeight:600,whiteSpace:"nowrap"},children:[n,t&&(0,An.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 se=M(W(),1);function Jx(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function Tm(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 Rm(e,t){return Tm(e,t==="Critical"?.36:t==="High"?.3:.24)??"color-mix(in srgb, var(--p-text-g) 40%, transparent)"}function Zx(e){return Tm(e,.1)??"transparent"}var ev={padding:"7px 8px",gap:4,opacity:1,userSelect:"none"},tv={display:"flex",alignItems:"center",gap:5},av={width:12,height:12,color:"color-mix(in srgb, var(--p-green) 55%, transparent)",flexShrink:0},rv={fontSize:11.5,fontWeight:600,color:"var(--p-text-m)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},ov={fontSize:9,fontWeight:700,color:"#22c55e",background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.3)",borderRadius:4,padding:"1px 5px",marginLeft:6,flexShrink:0,letterSpacing:.5},nv={display:"flex",alignItems:"center",gap:5,minWidth:0},lv={flexShrink:0},sv={fontSize:11.5,fontWeight:600,color:"var(--p-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},uv={display:"flex",alignItems:"flex-start",gap:8},iv={fontSize:10,color:"var(--p-text-g)",lineHeight:"1.45",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,flex:1,minWidth:0},dv={position:"relative",flexShrink:0},fv={width:52,height:34,borderRadius:6,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 90%, transparent)",display:"block",cursor:"pointer"},cv={display:"flex",alignItems:"center",gap:2,marginTop:1},pv={flex:1},ld=mo.default.memo(function({task:t,col:a,liveActivity:r,onOpen:o,onDragStart:n}){var h;let l=a.id==="in-progress",s=a.id==="done",[u,d]=mo.default.useState(!1),[m,g]=mo.default.useState(null),p=mo.default.useRef(null),v=t.commentCount??0,y=t.fileCount??0,C=v>0&&ad(t.id,v),O=Rm(a.color,t.priority),c=Mn(t.type),i=Zx(c),f=(h=t.files)==null?void 0:h.find(P=>Jx(P.name)),L=f?`/api/tasks/${t.id}/files/${encodeURIComponent(f.name)}`:null;function w(P){n(P,t.id),P.currentTarget.classList.add("dragging")}function b(P){P.currentTarget.classList.remove("dragging")}function S(){o(t)}return s?(0,se.jsx)("article",{className:"task-card",draggable:!0,"data-task-id":t.id,style:{...ev},onDragStart:w,onDragEnd:b,onClick:S,children:(0,se.jsxs)("div",{style:tv,children:[(0,se.jsx)(Wa,{style:av}),(0,se.jsx)("span",{style:rv,children:t.title}),t.verified&&(0,se.jsx)("span",{style:ov,children:"\\u2713 VERIFIED"})]})}):(0,se.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)":i,border:r?"1px solid rgba(59,130,246,0.5)":O?`1px solid ${O}`:void 0,...r?{boxShadow:"0 0 0 2px rgba(59,130,246,0.14)"}:{}},onDragStart:w,onDragEnd:b,onClick:S,children:[(0,se.jsxs)("div",{style:nv,children:[l&&(0,se.jsx)("span",{className:"spinner",style:lv}),(0,se.jsx)("span",{style:sv,children:t.title})]}),(t.description||L)&&(0,se.jsxs)("div",{style:uv,children:[t.description&&(0,se.jsx)("div",{style:iv,children:t.description}),L&&(0,se.jsxs)("div",{style:dv,onMouseEnter:()=>{if(p.current){let P=p.current.getBoundingClientRect();g({top:P.top,right:P.right})}d(!0)},onMouseLeave:()=>{d(!1),g(null)},children:[(0,se.jsx)("img",{ref:p,src:L,alt:"Task screenshot","data-role":"task-thumb",style:fv}),u&&m&&Pm.default.createPortal((0,se.jsx)("img",{src:L,alt:"Task screenshot enlarged preview","data-role":"task-thumb-preview",style:{position:"fixed",right:window.innerWidth-m.right,bottom:window.innerHeight-m.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,se.jsxs)("div",{className:"flex items-center",style:cv,children:[(0,se.jsx)(vm,{type:t.type}),t.priority&&(0,se.jsx)(Sm,{priority:t.priority}),l&&t.assigneeName&&(0,se.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,se.jsx)(Dn,{tags:t.tags,size:"xs"}),(0,se.jsx)("div",{style:pv}),r&&(0,se.jsx)(sd,{activity:r}),(0,se.jsx)(bm,{icon:(0,se.jsx)(hr,{style:{width:9,height:9}}),label:v>0?String(v):"",color:C?"var(--p-purple)":v>0?"var(--p-text-m)":"var(--p-border-t)",hoverColor:C?"var(--p-purple-300)":"var(--p-text)",title:v>0?`${v} comment(s)`:"Add comment",badge:C,badgeColor:"var(--p-purple)",onClick:P=>{P.stopPropagation(),o(t,"comments")}}),(0,se.jsx)(bm,{icon:(0,se.jsx)(xr,{style:{width:9,height:9}}),label:y>0?String(y):"",color:y>0?"var(--p-blue-300)":"var(--p-border-t)",hoverColor:y>0?"var(--p-cyan-300)":"var(--p-text-sub)",title:y>0?`${y} file(s) attached`:"Files",onClick:P=>{P.stopPropagation(),o(t,"files")}})]})]})});function bm({icon:e,label:t,color:a,hoverColor:r,title:o,badge:n,badgeColor:l,onClick:s}){let[u,d]=mo.default.useState(!1);return(0,se.jsxs)("button",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 3px",borderRadius:3,border:"none",background:u?"color-mix(in srgb, var(--p-text-m) 10%, transparent)":"transparent",cursor:"pointer",fontSize:9,color:u?r:a,transition:"color .1s, background .1s"},title:o,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:s,children:[e,t&&(0,se.jsx)("span",{children:t}),n&&(0,se.jsx)("span",{style:{width:4,height:4,background:l??a,borderRadius:"50%",flexShrink:0}})]})}function sd({activity:e}){let t=e.state==="locked"||e.state==="editing",a=t?(0,se.jsx)(kn,{style:{width:8,height:8}}):(0,se.jsx)(Sn,{style:{width:8,height:8}}),r=t?`Locked by ${e.user}`:`${e.user} viewing`;return(0,se.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,se.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:"1 1 0"},children:e.user})]})}var ge=M(W(),1),Ka=[{id:"backlog",label:"Backlog",color:"var(--p-text-f)",accent:"color-mix(in srgb, var(--p-text-g) 25%, transparent)"},{id:"todo",label:"Todo",color:"var(--p-amber)",accent:"color-mix(in srgb, var(--p-amber) 18%, transparent)"},{id:"in-progress",label:"In Progress",color:"var(--p-blue)",accent:"color-mix(in srgb, var(--p-blue) 18%, transparent)",glow:!0},{id:"review",label:"Review",color:"var(--p-purple)",accent:"color-mix(in srgb, var(--p-purple) 18%, transparent)"},{id:"done",label:"Done",color:"var(--p-green)",accent:"color-mix(in srgb, var(--p-green) 18%, transparent)"}];var mv=3;function gv(){return(0,ge.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,ge.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"75%",marginBottom:8}}),(0,ge.jsx)("div",{style:{height:10,borderRadius:4,background:"var(--p-border-s)",width:"50%",marginBottom:8}}),(0,ge.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,ge.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:48}}),(0,ge.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}){let u=Jt.default.useRef(null),d=Jt.default.useRef(null),[,m]=Jt.default.useState(null),[g,p]=Jt.default.useState(null),[v,y]=Jt.default.useState(null),C=Jt.default.useRef(null),O=Jt.default.useRef(null),c=a?e.filter(h=>(h.title??"").toLowerCase().includes(a.toLowerCase())||(h.description??"").toLowerCase().includes(a.toLowerCase())):e,i=Ka.filter(h=>t.includes(h.id));Jt.default.useEffect(()=>{let h=u.current,P=d.current;if(!h||!P)return;function B(){if(!h||!P)return;let re=h.scrollWidth>h.clientWidth?h.clientWidth/h.scrollWidth:1,J=Math.max(40,h.clientWidth*re);P.style.width=`${J}px`;let Z=h.scrollWidth-h.clientWidth,ie=h.clientWidth-J;P.style.left=`${Z>0?h.scrollLeft/Z*ie:0}px`,P.style.opacity=re<1?"1":"0"}h.addEventListener("scroll",B);let R=new ResizeObserver(B);R.observe(h),B();let H=!1,$=0,Y=0;function ue(re){H=!0,$=re.clientX,Y=h.scrollLeft,P.classList.add("dragging"),document.addEventListener("mousemove",X),document.addEventListener("mouseup",N)}function X(re){if(!H||!h||!P)return;let J=h.scrollWidth>h.clientWidth?h.scrollWidth/h.clientWidth:1;h.scrollLeft=Y+(re.clientX-$)*J}function N(){H=!1,P==null||P.classList.remove("dragging"),document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",N)}return P.addEventListener("mousedown",ue),()=>{h.removeEventListener("scroll",B),R.disconnect(),P.removeEventListener("mousedown",ue)}},[i.length]);function f(h,P){C.current=P,m(P),h.dataTransfer.effectAllowed="move"}function L(h,P){h.preventDefault(),p(P)}function w(h,P){h.preventDefault(),h.stopPropagation();let B=h.currentTarget.getBoundingClientRect(),R=h.clientY<B.top+B.height/2?"before":"after",H={taskId:P,position:R};O.current=H,y($=>($==null?void 0:$.taskId)===P&&$.position===R?$:H)}function b(h,P,B){h.preventDefault(),p(null);let R=O.current;O.current=null,y(null);let H=C.current;if(C.current=null,m(null),!!H)if(s&&R){let $=B.findIndex(X=>X.id===R.taskId),Y=null,ue=null;R.position==="before"?(ue=R.taskId,Y=$>0?B[$-1].id:null):(Y=R.taskId,ue=$<B.length-1?B[$+1].id:null),s(H,P,Y,ue)}else l(H,P)}function S(){C.current=null,m(null),p(null),O.current=null,y(null)}return(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)("main",{id:"kanban-board",ref:u,className:"flex-1 flex overflow-x-auto overflow-y-hidden",style:{padding:"16px 20px",gap:16},onDragEnd:S,children:i.map(h=>{let P=r?[]:c.filter(R=>R.status===h.id).sort(vn),B=h.id==="done"?[...P].reverse():P;return(0,ge.jsx)(hv,{col:h,tasks:B,isLoading:r,liveActivities:o,isDragOver:g===h.id&&!v,onDragOver:R=>L(R,h.id),onDrop:R=>b(R,h.id,P),onDragLeave:R=>{let H=R.relatedTarget;H&&R.currentTarget.contains(H)||(p(null),O.current=null,y(null))},onStatusChange:(R,H)=>l(R,H),onAddTask:()=>n(null,"details",h.id),onOpenTask:n,onDragStart:f,onCardDragOver:w,cardDropTarget:v},h.id)})}),(0,ge.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,ge.jsx)("div",{id:"kanban-scroll-thumb",ref:d,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:h=>{h.currentTarget.style.background="var(--p-text-g)"},onMouseLeave:h=>{h.currentTarget.classList.contains("dragging")||(h.currentTarget.style.background="var(--p-border-t)")}})})]})}function hv({col:e,tasks:t,isLoading:a,liveActivities:r,isDragOver:o,onDragOver:n,onDrop:l,onDragLeave:s,onStatusChange:u,onAddTask:d,onOpenTask:m,onDragStart:g,onCardDragOver:p,cardDropTarget:v}){let[y,C]=Jt.default.useState(!1),O=e.id==="in-progress"?"sd-inprogress":`sd-${e.id}`,c=10,i=e.id==="done",f=i&&t.length>c?t.length-c:0,L=i?t.slice(0,c):t;return(0,ge.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,ge.jsxs)("div",{className:"column-header",style:{background:e.accent,borderColor:`color-mix(in srgb, ${e.color} 30%, transparent)`},children:[(0,ge.jsx)("div",{className:`status-dot ${O}`}),(0,ge.jsxs)("span",{style:{fontSize:12,fontWeight:600,color:e.id==="done"?`${e.color}b3`:e.color},children:[e.label,a?"":` \\xB7 ${t.length}`]}),(0,ge.jsx)("span",{style:{marginLeft:"auto"}}),(0,ge.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:y?e.color:"var(--p-text-g)",cursor:"pointer",transition:"color .15s",padding:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),onClick:d,children:(0,ge.jsx)(bn,{style:{width:14,height:14}})})]}),(0,ge.jsx)("div",{className:"column-scroll","data-status":e.id,children:a?Array.from({length:mv}).map((w,b)=>(0,ge.jsx)(gv,{},b)):t.length===0?(0,ge.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,ge.jsxs)(ge.Fragment,{children:[L.map(w=>(0,ge.jsxs)("div",{style:{position:"relative"},onDragOver:b=>p(b,w.id),children:[(v==null?void 0:v.taskId)===w.id&&v.position==="before"&&(0,ge.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}}),(0,ge.jsx)(ld,{task:w,col:e,liveActivity:r==null?void 0:r.get(w.id),onOpen:m,onDragStart:g}),(v==null?void 0:v.taskId)===w.id&&v.position==="after"&&(0,ge.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}})]},w.id)),f>0&&(0,ge.jsxs)("div",{style:{background:"var(--p-card)",border:"2px dashed var(--p-border-t)",borderRadius:10,padding:"11px 13px",fontSize:12,color:"var(--p-text-g)",textAlign:"center",lineHeight:1.4,opacity:.7},children:["+",f," older ",f===1?"task":"tasks"," not shown. Use search to find them."]})]})})]})}var Lr=M(Se(),1);var ne=M(W(),1),Mm={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)"}},xv=wm,Am={Critical:"var(--p-red)",High:"var(--p-amber-300)",Medium:"var(--p-text-m)",Low:"var(--p-text-f)"},id=["in-progress","review","todo","backlog","done"];function vv(){return(0,ne.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,ne.jsx)("div",{style:{width:14,height:14,borderRadius:3,background:"var(--p-border-s)"}}),(0,ne.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"60%"}}),(0,ne.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:44}}),(0,ne.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})}function dd({tasks:e,searchQuery:t,isLoading:a,liveActivities:r,onOpenPanel:o,onAddTask:n,onDrop:l}){let[s,u]=Lr.default.useState(null),[d,m]=Lr.default.useState(null),[g,p]=Lr.default.useState(null),[v,y]=Lr.default.useState({backlog:!1,todo:!1,"in-progress":!1,review:!1,done:!1}),C=t?e.filter(c=>(c.title??"").toLowerCase().includes(t.toLowerCase())||(c.description??"").toLowerCase().includes(t.toLowerCase())):e,O=Lr.default.useMemo(()=>{let c=new Map;for(let i of id)c.set(i,[]);for(let i of C)(c.get(i.status)??[]).push(i);return c},[C]);return(0,ne.jsxs)("div",{id:"kanban-list-view",style:{flex:1,overflowY:"auto",padding:"16px 24px",minHeight:0},children:[a?id.slice(0,3).map(c=>{let i=Mm[c];return(0,ne.jsxs)("div",{style:{marginBottom:24},children:[(0,ne.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,ne.jsx)("div",{style:{width:18,height:18,borderRadius:5,background:"var(--p-border-s)",animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,ne.jsx)("div",{style:{height:18,borderRadius:6,background:i.bg,border:`1px solid ${i.border}`,width:72,animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,ne.jsx)("div",{style:{height:14,borderRadius:4,background:"var(--p-border-s)",width:16,animation:"skeleton-pulse 1.5s ease-in-out infinite"}})]}),(0,ne.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:Array.from({length:3}).map((f,L)=>(0,ne.jsx)(vv,{},L))})]},c)}):id.map(c=>{let i=O.get(c)??[];if(i.length===0)return null;let f=Mm[c];return(0,ne.jsxs)("div",{style:{marginBottom:24},children:[(0,ne.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8,padding:"4px 6px",borderRadius:6,transition:"background .1s",background:d===c?f.bg:"transparent",outline:d===c?`1px dashed ${f.border}`:void 0},onDragOver:L=>{L.preventDefault(),m(c)},onDragLeave:()=>m(null),onDrop:L=>{L.preventDefault(),m(null),p(null),s&&l(s,c),u(null)},children:[(0,ne.jsx)("button",{type:"button",title:v[c]?"Expand":"Collapse",onClick:L=>{L.stopPropagation(),y(w=>({...w,[c]:!w[c]}))},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:v[c]?"+":"\\u2212"}),(0,ne.jsx)("span",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"2px 8px",borderRadius:6,background:f.bg,border:`1px solid ${f.border}`,color:f.text},children:c}),(0,ne.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:i.length}),(0,ne.jsx)("button",{type:"button",title:`Add task to ${c}`,onClick:L=>{L.stopPropagation(),n(c)},style:{marginLeft:"auto",width:22,height:22,borderRadius:7,border:`1px solid ${f.border}`,background:f.bg,color:f.text,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:600},children:"+"})]}),(0,ne.jsx)("div",{style:{display:v[c]?"none":"flex",flexDirection:"column",gap:2},children:i.map(L=>(0,ne.jsx)(yv,{task:L,liveActivity:r==null?void 0:r.get(L.id),onOpen:o,onDragStart:w=>u(w),dragOver:g===L.id,onDragOver:()=>p(L.id),onDragLeave:()=>p(w=>w===L.id?null:w),onDropToStatus:()=>{s&&l(s,L.status),u(null),p(null)}},L.id))})]},c)}),!a&&C.length===0&&(0,ne.jsx)("div",{style:{textAlign:"center",color:"var(--p-text-g)",fontSize:13,marginTop:60},children:"No tasks found"})]})}function yv({task:e,liveActivity:t,onOpen:a,onDragStart:r,dragOver:o,onDragOver:n,onDragLeave:l,onDropToStatus:s}){let[u,d]=Lr.default.useState(!1),m=xv[e.type??"Task"]??"\\u2611",g=e.commentCount??0,p=e.fileCount??0;return(0,ne.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)":u?"var(--p-hover)":"transparent",border:`1px solid ${o?"color-mix(in srgb, var(--p-blue) 40%, transparent)":u?"var(--p-border)":"transparent"}`,cursor:"grab",transition:"background .1s,border-color .1s",userSelect:"none"},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:()=>a(e),onDragStart:v=>{v.dataTransfer.effectAllowed="move",r(e.id),v.currentTarget.style.opacity="0.4"},onDragEnd:v=>{v.currentTarget.style.opacity="1"},onDragOver:v=>{v.preventDefault(),n()},onDragLeave:l,onDrop:v=>{v.preventDefault(),s()},children:[(0,ne.jsx)("span",{style:{fontSize:12,textAlign:"center",flexShrink:0},children:m}),(0,ne.jsxs)("div",{style:{minWidth:0},children:[(0,ne.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,ne.jsx)("span",{style:{fontSize:13,fontWeight:500,color:"var(--p-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),e.priority&&Am[e.priority]&&(0,ne.jsx)(In,{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:Am[e.priority]}}),e.component&&(0,ne.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,ne.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,ne.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:v=>{v.stopPropagation(),a(e,"comments")},children:[(0,ne.jsx)(hr,{className:"w-3 h-3"}),g>0&&(0,ne.jsx)("span",{children:g})]}),p>0&&(0,ne.jsxs)("button",{title:`${p} 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:v=>{v.stopPropagation(),a(e,"files")},children:[(0,ne.jsx)(xr,{className:"w-3 h-3"}),(0,ne.jsx)("span",{children:p})]}),t&&(0,ne.jsx)(sd,{activity:t})]})}var go=M(Se(),1);var Ga=M(W(),1);function Dm({size:e=32,style:t,className:a}){return(0,Ga.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,Ga.jsx)("rect",{width:"32",height:"32",rx:"7",fill:"#2563eb"}),(0,Ga.jsx)("rect",{x:"7",y:"13",width:"3.5",height:"10",rx:"1.5",fill:"white",opacity:"0.75"}),(0,Ga.jsx)("rect",{x:"12.25",y:"8.5",width:"3.5",height:"15",rx:"1.5",fill:"white"}),(0,Ga.jsx)("rect",{x:"17.5",y:"14.5",width:"3.5",height:"8",rx:"1.5",fill:"white",opacity:"0.75"}),(0,Ga.jsx)("rect",{x:"22.5",y:"11",width:"2.5",height:"11",rx:"1.25",fill:"white",opacity:"0.85"})]})}var Cs=M(W(),1);function Is({id:e,title:t,onClick:a,label:r,icon:o,variant:n="neutral"}){return(0,Cs.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,Cs.jsx)("span",{children:r})]})}var K=M(W(),1);function fd({projectName:e,projectIcon:t,missingProjectIconStyle:a="initial",wsConnected:r,port:o,searchQuery:n,premiumUsage:l,isLoading:s,filterTags:u,allTags:d,onToggleTag:m,backHref:g,backLabel:p,onSearchChange:v,onSettings:y,extraActions:C,taskSummary:O}){let[c,i]=go.default.useState(!1),[f,L]=go.default.useState(0),w=go.default.useRef(null),b=go.default.useRef(null),S=n.match(/(?:^|\\s)#(\\S*)$/),h=S?S[1]:null,P=u??[],B=(d??[]).filter(N=>!P.includes(N)),R=h!==null?B.filter(N=>N.toLowerCase().includes(h.toLowerCase())):[];go.default.useEffect(()=>{L(0)},[R.length]);function H(N){var J;let re=n.replace(/\\s*#\\S*$/,"");v(re),m==null||m(N),(J=w.current)==null||J.focus()}function $(N){if(N.key==="Backspace"&&n===""&&P.length>0){N.preventDefault(),m==null||m(P[P.length-1]);return}if(!(h===null||R.length===0)){if(N.key==="ArrowDown")N.preventDefault(),L(re=>Math.min(re+1,R.length-1));else if(N.key==="ArrowUp")N.preventDefault(),L(re=>Math.max(re-1,0));else if(N.key==="Enter")N.preventDefault(),R[f]&&H(R[f]);else if(N.key==="Escape"){let re=n.replace(/\\s*#\\S*$/,"");v(re)}}}let Y=(t??"").trim(),ue=e?e.charAt(0).toUpperCase()+e.slice(1):"Vibeflow Board",X=n||P.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:[g&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("a",{id:"header-back-link",href:g,className:"text-xs text-slate-400 hover:text-slate-200 transition-colors no-underline",style:{textDecoration:"none",fontWeight:500},children:p??"Back"}),(0,K.jsx)(Ln,{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",...Y?{fontSize:20}:void 0},children:Y||(a==="vibeflow"?(0,K.jsx)(Dm,{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:ue,children:ue.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:ue}),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:[O,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 N;return(N=w.current)==null?void 0:N.focus()},children:[(0,K.jsx)(Pn,{className:"w-3.5 h-3.5 text-slate-500 flex-shrink-0 mr-0.5"}),P.map(N=>{let{bg:re,text:J,border:Z}=qt(N);return(0,K.jsxs)("span",{style:{background:re,color:J,border:`1px solid ${Z}`,display:"inline-flex",alignItems:"center",gap:3,padding:"1px 7px",borderRadius:100,fontSize:11,fontWeight:500,whiteSpace:"nowrap"},children:[N,(0,K.jsx)("button",{onClick:ie=>{ie.stopPropagation(),m==null||m(N)},style:{background:"none",border:"none",cursor:"pointer",padding:0,lineHeight:1,color:"inherit",opacity:.7,display:"flex"},children:(0,K.jsx)(Ue,{style:{width:9,height:9}})})]},N)}),(0,K.jsx)("input",{ref:w,id:"global-search",type:"text",placeholder:P.length===0?"Search\\u2026 or type #tag":"#tag or search\\u2026",value:n,onChange:N=>v(N.target.value),onKeyDown:$,className:"flex-1 min-w-[100px] bg-transparent border-none outline-none text-xs text-slate-200 placeholder-slate-500",autoComplete:"off",spellCheck:!1}),X&&(0,K.jsx)("button",{id:"global-search-clear",onClick:()=>{v(""),P.forEach(N=>m==null?void 0:m(N))},className:"text-slate-500 hover:text-slate-300 transition-colors flex-shrink-0 flex",title:"Clear search and tag filters",children:(0,K.jsx)(Ue,{className:"w-3.5 h-3.5"})})]}),h!==null&&R.length>0&&(0,K.jsxs)("div",{ref:b,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"}),R.map((N,re)=>{let{bg:J,text:Z,border:ie}=qt(N);return(0,K.jsxs)("button",{onMouseDown:Oe=>{Oe.preventDefault(),H(N)},onMouseEnter:()=>L(re),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:8,padding:"7px 12px",background:re===f?"var(--p-hover)":"none",border:"none",cursor:"pointer"},children:[(0,K.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:Z,flexShrink:0}}),(0,K.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:N}),(0,K.jsx)("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:100,fontSize:10,background:J,color:Z,border:`1px solid ${ie}`},children:"tag"})]},N)}),(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:[C,(0,K.jsx)(Is,{id:"header-shortcuts-hint",title:"Click to see keyboard shortcuts",onClick:()=>i(!0),label:"? shortcuts"}),(0,K.jsx)(Is,{id:"btn-settings",title:"Settings",onClick:y,icon:(0,K.jsx)(vr,{className:"w-3.5 h-3.5"})})]}),c&&(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:()=>i(!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:N=>N.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:()=>i(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--p-text-f)",padding:2},children:(0,K.jsx)(Ue,{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(([N,re])=>(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:N}),(0,K.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:re})]},N))})]})})]})}var G=M(Se(),1);var ws=M(Se(),1);var Zt=M(W(),1);function ks({id:e,value:t,onChange:a,disabled:r}){let[o,n]=ws.default.useState(!1),l=ws.default.useRef(null),s=yr.find(u=>u.value===t)??yr[0];return ws.default.useEffect(()=>{let u=d=>{var m;(m=l.current)!=null&&m.contains(d.target)||n(!1)};return document.addEventListener("click",u),()=>document.removeEventListener("click",u)},[]),(0,Zt.jsxs)("div",{id:e,ref:l,style:{position:"relative",display:"inline-block"},children:[(0,Zt.jsxs)("button",{type:"button",title:s==null?void 0:s.tooltip,onClick:u=>{u.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,Zt.jsx)("span",{style:{fontSize:13},children:s==null?void 0:s.icon}),(0,Zt.jsx)("span",{children:s==null?void 0:s.label})]}),o&&(0,Zt.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(u=>(0,Zt.jsxs)("button",{type:"button",title:u.tooltip,onClick:()=>{a(u.value),n(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",border:"none",background:u.value===t?"var(--p-hover, rgba(255,255,255,0.06))":"transparent",color:u.value===t?"var(--p-text, #fff)":"var(--p-text-f, rgba(255,255,255,0.55))",fontSize:12,cursor:"pointer",textAlign:"left"},children:[(0,Zt.jsx)("span",{style:{fontSize:14,lineHeight:1},children:u.icon}),(0,Zt.jsx)("span",{children:u.label})]},u.value))})]})}var et=M(Se(),1);var En=M(Se(),1);var ja=M(W(),1);function ea({markdown:e,className:t,style:a}){let r=En.default.useRef(null),o=En.default.useRef({}),[n,l]=En.default.useState(null);return En.default.useEffect(()=>{let s=r.current;if(!s)return;function u(){l(null)}async function d(g){let p=g.target,v=p==null?void 0:p.closest("a[data-task-ref]");if(!v){u();return}g.preventDefault();let y=v.getAttribute("data-task-ref");if(!y)return;let C=v.getBoundingClientRect(),O=o.current[y];if(O){l({id:y,title:O.title,status:O.status,x:C.left,y:C.bottom+6});return}try{let i=await(await fetch(`/api/tasks/${y}`)).json(),f={title:i.title??`Task ${y}`,status:i.status??"unknown"};o.current[y]=f,l({id:y,title:f.title,status:f.status,x:C.left,y:C.bottom+6})}catch{l({id:y,title:`Task ${y}`,status:"unknown",x:C.left,y:C.bottom+6})}}function m(g){var y,C;let p=(C=(y=g.target)==null?void 0:y.closest)==null?void 0:C.call(y,"a[data-task-ref]");if(!p)return;let v=p.getAttribute("data-task-ref");v&&window.dispatchEvent(new CustomEvent("vibeflow-task-ref-click",{detail:{refId:v}}))}return s.addEventListener("mouseover",d),s.addEventListener("mouseleave",u),s.addEventListener("click",m),()=>{s.removeEventListener("mouseover",d),s.removeEventListener("mouseleave",u),s.removeEventListener("click",m)}},[]),(0,ja.jsxs)("div",{style:{position:"relative"},children:[(0,ja.jsx)("div",{ref:r,className:t,style:a,dangerouslySetInnerHTML:{__html:gs(e)}}),n&&(0,ja.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,ja.jsxs)("div",{style:{color:"#60a5fa",fontFamily:"Menlo,monospace",marginBottom:3},children:["#",n.id]}),(0,ja.jsx)("div",{style:{fontWeight:600,marginBottom:3},children:n.title}),(0,ja.jsxs)("div",{style:{color:"#94a3b8"},children:["status: ",n.status]})]})]})}var Fn=M(Se(),1),Em=M(W(),1),ho=Fn.default.forwardRef(function({value:t,onChange:a,baseRows:r=4,maxRows:o,style:n,...l},s){let u=Fn.default.useRef(null),d=o??r*2,m=Fn.default.useCallback(()=>{let g=u.current;if(!g)return;g.style.height="auto";let p=window.getComputedStyle(g),v=Number.parseFloat(p.lineHeight||"0")||18,y=Number.parseFloat(p.paddingTop||"0")+Number.parseFloat(p.paddingBottom||"0"),C=Number.parseFloat(p.borderTopWidth||"0")+Number.parseFloat(p.borderBottomWidth||"0"),O=r*v+y+C,c=d*v+y+C,i=Math.max(O,Math.min(g.scrollHeight,c));g.style.height=`${i}px`,g.style.overflowY=g.scrollHeight>c?"auto":"hidden"},[r,d]);return Fn.default.useLayoutEffect(()=>{m()},[t,m]),(0,Em.jsx)("textarea",{...l,ref:g=>{u.current=g,typeof s=="function"?s(g):s&&(s.current=g)},rows:r,value:t,onChange:g=>a(g.target.value),style:{...n,resize:"none"}})});var Om=M(Se(),1);var Fm=M(Se(),1),Bm=M(uo(),1),ta=M(W(),1);function va({open:e,onClose:t,icon:a,title:r,headerActions:o,width:n,maxHeight:l,id:s,children:u,footer:d,boxStyle:m,onKeyDown:g}){if(Fm.default.useEffect(()=>{if(!e)return;function y(C){C.key==="Escape"&&t(),g==null||g(C)}return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[e,t,g]),!e)return null;let p=!!(a||r||o),v=(0,ta.jsx)("div",{id:s,className:"modal-backdrop",onClick:y=>{y.target===y.currentTarget&&t()},onMouseDown:y=>y.stopPropagation(),children:(0,ta.jsxs)("div",{className:"modal-box",style:{width:n??"min(420px, 95vw)",maxHeight:l,...m},children:[p&&(0,ta.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--p-border)",flexShrink:0},children:[a&&(0,ta.jsx)("span",{style:{flexShrink:0,display:"flex",alignItems:"center"},children:a}),r&&(0,ta.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1,minWidth:0},children:r}),o&&(0,ta.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,marginLeft:"auto"},children:o})]}),(0,ta.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:u}),d&&(0,ta.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,Bm.createPortal)(v,document.body)}var Tt=M(W(),1);function aa({open:e,message:t,title:a="Confirm",confirmLabel:r="Delete",cancelLabel:o="Cancel",loading:n,error:l,onConfirm:s,onCancel:u}){let d=Om.default.useCallback(m=>{m.key==="Enter"&&s()},[s]);return(0,Tt.jsx)(va,{open:e,onClose:u,id:"confirm-modal",width:"min(380px, 95vw)",icon:(0,Tt.jsx)(Va,{style:{width:20,height:20,color:"#f87171"}}),title:a,onKeyDown:d,footer:(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)("button",{id:"confirm-modal-cancel",onClick:u,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,Tt.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,Tt.jsxs)("div",{style:{padding:"16px 18px"},children:[typeof t=="string"?(0,Tt.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:t}):t,l&&(0,Tt.jsx)("p",{style:{margin:"8px 0 0",fontSize:12,color:"var(--p-red)"},children:l})]})})}var Ee=M(W(),1);function zm(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 Lv(e){return/\\.(png|jpe?g|gif|webp|svg|html?)$/i.test(e.name)}function Sv(e){return/\\.html?$/i.test(e.name)}function bs({file:e,url:t,variant:a,onPreview:r,onDelete:o}){let n=Lv(e),l=Sv(e);function s(){r?r(e,t):window.open(t,"_blank")}return a==="compact"?(0,Ee.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,Ee.jsx)("span",{style:{fontSize:14,flexShrink:0},children:zm(e)}),(0,Ee.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Ee.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,Ee.jsx)("span",{className:"file-compact-ts",style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:e.createdAt?it(e.createdAt):"attached"}),(0,Ee.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,Ee.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,Ee.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:u=>u.stopPropagation(),children:"\\u2193"}),o&&(0,Ee.jsx)("button",{onClick:()=>{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,Ee.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,Ee.jsx)("span",{style:{fontSize:18,flexShrink:0},children:zm(e)}),(0,Ee.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ee.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,Ee.jsx)("p",{style:{fontSize:10,color:"var(--p-text-f)",margin:0},children:e.linkedPath?`linked: ${e.linkedPath}`:rd(e.size??0)})]}),(0,Ee.jsxs)("div",{className:"file-normal-actions",style:{display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s"},children:[n&&(0,Ee.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,Ee.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:u=>u.stopPropagation(),children:"\\u2193"}),o&&(0,Ee.jsx)("button",{onClick:()=>{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 F=M(W(),1);function Nm({source:e}){return e!=="cli"?null:(0,F.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 Iv(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 Cv(e,t){let a=[];for(let r of e){let o=Iv(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 cd({comments:e,files:t=[],localChanges:a=[],loading:r,error:o,gitUserName:n="You",taskAuthorName:l,baseUrl:s="",taskId:u,taskCreatedAt:d,taskUpdatedAt:m,onEdit:g,onDelete:p,onDeleteFile:v,onFilePreview:y}){let C=et.default.useRef(null),O=et.default.useRef(null),[c,i]=et.default.useState(null),[f,L]=et.default.useState(""),[w,b]=et.default.useState(null),[S,h]=et.default.useState(null),[P,B]=et.default.useState(()=>{try{return localStorage.getItem("vibeflow-show-updates")!=="false"}catch{return!0}}),R=et.default.useRef(r),H=et.default.useMemo(()=>{let X=[];d&&X.push({kind:"lifecycle",sortKey:d,label:"Task created",icon:"\\u2726",author:l??n}),m&&m!==d&&X.push({kind:"lifecycle",sortKey:m,label:"Task edited",icon:"\\u270E"});let N=e.map(Z=>({kind:"comment",sortKey:Z.createdAt,comment:Z})),re=t.map(Z=>{let ie=Z.url.startsWith("http")?Z.url:`${s}${Z.url}`;return{kind:"file",sortKey:Z.createdAt??"9999",file:Z,url:ie}}),J=a.map(Z=>({kind:"change",sortKey:Z.timestamp,field:Z.field,from:Z.from,to:Z.to,actor:Z.actor,source:Z.source}));return[...X,...N,...re,...J].sort((Z,ie)=>ie.sortKey.localeCompare(Z.sortKey))},[e,t,a,s,d,m]),$=et.default.useMemo(()=>H.filter(X=>X.kind==="lifecycle"||X.kind==="change").length,[H]),Y=et.default.useMemo(()=>P?H:H.filter(X=>X.kind==="comment"||X.kind==="file"),[H,P]),ue=et.default.useMemo(()=>Cv(Y,n),[Y,n]);return et.default.useEffect(()=>{let X=R.current&&!r;R.current=r,C.current&&X&&requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})},[r]),et.default.useEffect(()=>{c&&O.current&&(O.current.focus(),O.current.scrollIntoView({block:"nearest"}))},[c]),r?(0,F.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):o?(0,F.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):H.length===0?(0,F.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No activity yet."}):(0,F.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[$>0&&(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0 4px",flexShrink:0,borderBottom:"1px solid var(--p-border)",marginBottom:4},children:[(0,F.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",flex:1,letterSpacing:"0.04em"},children:P?"":`${$} system event${$!==1?"s":""} hidden`}),(0,F.jsx)("button",{id:"dp-toggle-updates",onClick:()=>B(X=>{let N=!X;try{localStorage.setItem("vibeflow-show-updates",String(N))}catch{}return N}),style:{all:"unset",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:5,color:P?"var(--p-text-m)":"var(--p-text-g)",transition:"color .12s, background .12s"},title:P?"Hide system events":`Show ${$} system event${$!==1?"s":""}`,onMouseEnter:X=>{X.currentTarget.style.color="var(--p-text)",X.currentTarget.style.background="var(--p-hover)"},onMouseLeave:X=>{X.currentTarget.style.color=P?"var(--p-text-m)":"var(--p-text-g)",X.currentTarget.style.background="transparent"},children:P?(0,F.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,F.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,F.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,F.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,F.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,F.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})})]}),(0,F.jsx)("div",{ref:C,style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:2,minHeight:0},children:ue.map((X,N)=>{let re=X.author!==null&&X.items.length>1,J=re,Z=X.author==="\\u{1F916} Agent";return(0,F.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[J&&(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 0 2px",marginTop:4},children:[(0,F.jsx)("span",{style:{fontSize:11,fontWeight:600,color:Z?"var(--p-purple)":"var(--p-blue-300)",flexShrink:0},children:X.author}),(0,F.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",flexShrink:0},children:`${it(X.oldestSortKey)} \\u2013 ${it(X.newestSortKey)}`}),(0,F.jsxs)("span",{style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:["(",X.items.length," activities)"]})]}),(0,F.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:re?4:8,paddingLeft:re?8:0,borderLeft:re?"1.5px solid var(--p-border)":"none",marginLeft:re?4:0},children:X.items.map((ie,Oe)=>wv(ie,Oe,N,re,n,c,f,O,i,L,g,b,v?h:null,y))})]},`group-${N}`)})}),(0,F.jsx)(aa,{open:w!==null,message:"Delete this comment? This action cannot be undone.",onConfirm:()=>{w&&p(w),b(null)},onCancel:()=>b(null)}),v&&(0,F.jsx)(aa,{open:S!==null,message:S?`Delete "${S.name}"? This action cannot be undone.`:"",onConfirm:()=>{S&&v(S),h(null)},onCancel:()=>h(null)})]})}function wv(e,t,a,r,o,n,l,s,u,d,m,g,p,v){if(e.kind==="lifecycle")return(0,F.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,F.jsx)("span",{style:{fontSize:11,color:"var(--p-purple)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:e.icon}),(0,F.jsx)("div",{style:{flex:1,minWidth:0},children:(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,F.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)",fontStyle:"italic"},children:e.label}),!r&&(0,F.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:it(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,b=e.to.length>28?e.to.slice(0,28)+"\\u2026":e.to,S=e.from.length>28||e.to.length>28;return(0,F.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,F.jsx)("span",{style:{fontSize:11,color:"var(--p-blue)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:"\\u270E"}),(0,F.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[!r&&(0,F.jsxs)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-blue-300)"},children:["\\u{1F464} ",e.actor]}),!r&&(0,F.jsx)(Nm,{source:e.source}),(0,F.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:["changed ",(0,F.jsx)("strong",{style:{color:"var(--p-text)"},children:e.field})]}),!r&&(0,F.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:it(e.sortKey)})]}),(0,F.jsxs)("div",{title:S?`${e.from} \\u2192 ${e.to}`:void 0,style:{marginTop:2,fontSize:11,color:"var(--p-text-g)",display:"flex",alignItems:"center",gap:4,cursor:S?"help":"default"},children:[(0,F.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,F.jsx)("span",{style:{color:"var(--p-text-g)"},children:"\\u2192"}),(0,F.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:b})]})]})]},`change-${e.sortKey}-${a}-${t}`)}if(e.kind==="file"){let{file:L,url:w}=e;return(0,F.jsx)(bs,{file:L,url:w,variant:"compact",onPreview:v?(b,S)=>v(b.name,S):void 0,onDelete:p?b=>(p(b),Promise.resolve()):void 0},`file-${L.name}-${a}-${t}`)}let y=e.comment,C=y.author==="agent",O=y.type==="system",c=y.deleted===!0,i=!!y.id&&!C&&!O&&!c&&y.isOwnComment!==!1,f=n===y.id;return O?(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"2px 0",fontSize:11,color:"var(--p-text-g)",fontStyle:"italic"},children:[(0,F.jsx)("span",{style:{opacity:.6},children:"\\u2B21"}),(0,F.jsx)("span",{children:y.text}),!r&&(0,F.jsx)("span",{style:{marginLeft:"auto",flexShrink:0,opacity:.6},children:it(y.createdAt)})]},y.id):(0,F.jsxs)("div",{className:"flex flex-col gap-1 group/comment",style:{paddingTop:r?2:4},children:[!r&&(0,F.jsxs)("div",{className:"flex items-center justify-between gap-1.5 text-xs mb-0.5",children:[(0,F.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,F.jsx)("span",{style:{color:c?"var(--p-text-g)":C?"var(--p-purple)":"var(--p-blue-300)"},children:C?"\\u{1F916} Agent":`\\u{1F464} ${y.authorName??o}`}),(0,F.jsx)(Nm,{source:y.source}),(0,F.jsxs)("span",{style:{color:"var(--p-text-g)"},children:[it(y.createdAt),!c&&y.updatedAt?" \\xB7 edited":"",c?" \\xB7 deleted":""]})]}),i&&(0,F.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,F.jsx)("button",{onClick:()=>{u(y.id),d(y.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,F.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,F.jsx)("button",{onClick:()=>g(y),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,F.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),r&&(0,F.jsxs)("div",{className:"flex items-center justify-between gap-1.5",style:{marginBottom:2},children:[(0,F.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-g)"},children:[it(y.createdAt),!c&&y.updatedAt?" \\xB7 edited":"",c?" \\xB7 deleted":""]}),i&&(0,F.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,F.jsx)("button",{onClick:()=>{u(y.id),d(y.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,F.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,F.jsx)("button",{onClick:()=>g(y),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,F.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),f?(0,F.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,F.jsx)(ho,{ref:s,value:l,onChange:d,baseRows:4,maxRows:12,onKeyDown:L=>{L.key==="Enter"&&(L.ctrlKey||L.metaKey)&&(L.preventDefault(),m(y,l).then(()=>u(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,F.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,F.jsx)("button",{onClick:()=>u(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,F.jsx)("button",{onClick:async()=>{await m(y,l),u(null)},style:{padding:"4px 10px",background:"var(--p-blue)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-white)",cursor:"pointer"},children:"Save"})]})]}):c?(0,F.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,F.jsx)(ea,{markdown:y.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}})]},y.id)}var Um=M(Se(),1);var Xa=M(W(),1);function pd({files:e,loading:t,error:a,baseUrl:r,onPreview:o,onDelete:n}){let[l,s]=Um.default.useState(null);return t?(0,Xa.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):a?(0,Xa.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):e.length===0?(0,Xa.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No files attached."}):(0,Xa.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.map(u=>{let d=u.url??`${r}/api/files/${encodeURIComponent(u.name)}`;return(0,Xa.jsx)(bs,{file:u,url:d,variant:"normal",onPreview:m=>o(m),onDelete:n?m=>(s(m),Promise.resolve()):void 0},u.name)}),n&&(0,Xa.jsx)(aa,{open:l!==null,message:l?`Delete "${l.name}"? This action cannot be undone.`:"",onConfirm:()=>{l&&n(l),s(null)},onCancel:()=>s(null)})]})}var hd=M(Se(),1);var xo=M(Se(),1),Hm=M(uo(),1);var Wt=M(W(),1);function Bn({value:e,onChange:t,previewValue:a,showPreview:r,setShowPreview:o,previewId:n,textareaId:l,placeholder:s,previewEmptyText:u,previewMinHeight:d=54,previewMaxHeight:m=220,baseRows:g=5,maxRows:p=12,autoFocus:v=!1,textareaRef:y,onKeyDown:C,afterTextarea:O,onBlur:c}){let i=xo.default.useRef(null),[f,L]=xo.default.useState([]),[w,b]=xo.default.useState(null),[S,h]=xo.default.useState(null);xo.default.useEffect(()=>{let R=!0;return fetch("/api/tasks").then(H=>H.json()).then(H=>{if(!R)return;let $=(H.tasks??[]).map(Y=>({id:String(Y.id??""),title:String(Y.title??"")})).filter(Y=>Y.id.length>0);L($)}).catch(()=>{}),()=>{R=!1}},[]);function P(R){let H=i.current;if(!H){b(null);return}let $=H.selectionStart??R.length,Y=R.slice(0,$),ue=-1;for(let J=Y.length-1;J>=0;J--){if(Y[J]!=="#")continue;let Z=J>0?Y[J-1]:"";if(Z&&!/\\s/.test(Z))continue;let ie=Y.slice(J+1);if(!ie.includes("#")){if(ie.length>80)return;ue=J;break}}if(ue===-1){b(null);return}let X=Y.slice(ue+1).trim().toLowerCase(),N=f.filter(J=>{if(!X)return!0;let Z=J.id.toLowerCase(),ie=J.title.toLowerCase();return Z.includes(X)||ie.includes(X)}).sort((J,Z)=>{let ie=J.id.toLowerCase().startsWith(X)?1:0,Oe=Z.id.toLowerCase().startsWith(X)?1:0;if(ie!==Oe)return Oe-ie;let Mt=J.title.toLowerCase().startsWith(X)?1:0,At=Z.title.toLowerCase().startsWith(X)?1:0;return Mt!==At?At-Mt:J.id.localeCompare(Z.id)}).slice(0,6);if(!N.length){b(null),h(null);return}let re=H.getBoundingClientRect();h({top:re.top,left:re.left,width:re.width}),b({queryStart:ue,queryEnd:$,items:N})}function B(R){let H=w;if(!H)return;let $=`${e.slice(0,H.queryStart)}#${R} ${e.slice(H.queryEnd)}`;t($),b(null),h(null),requestAnimationFrame(()=>{let Y=i.current;if(!Y)return;let ue=H.queryStart+R.length+2;Y.focus(),Y.setSelectionRange(ue,ue)})}return r?(0,Wt.jsx)("div",{id:n,onClick:R=>{R.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:m},children:(a??e).trim()?(0,Wt.jsx)(ea,{markdown:a??e}):(0,Wt.jsx)("span",{style:{color:"var(--p-border-t)"},children:u??s})}):(0,Wt.jsxs)("div",{style:{position:"relative"},children:[(0,Wt.jsx)(ho,{id:l,ref:R=>{i.current=R,y&&(y.current=R)},className:"dp-textarea",placeholder:s,value:e,onChange:R=>{t(R),P(R)},onFocus:()=>o(!1),onBlur:()=>{b(null),h(null),o(!0),c==null||c()},baseRows:g,maxRows:p,autoFocus:v,onKeyDown:R=>{R.key==="Escape"&&(b(null),h(null)),C==null||C(R)}}),w&&S&&(0,Hm.createPortal)((0,Wt.jsx)("div",{"data-task-ref-suggest":"true",style:{position:"fixed",left:S.left+8,width:S.width-16,top:S.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(R=>(0,Wt.jsxs)("button",{type:"button",onMouseDown:H=>{H.preventDefault(),B(R.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:H=>{H.currentTarget.style.background="var(--p-hover)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:[(0,Wt.jsxs)("span",{style:{fontFamily:"monospace",color:"var(--p-blue-300)"},children:["#",R.id]}),(0,Wt.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R.title})]},R.id))}),document.body),O]})}var Sr=M(Se(),1);var Rt=M(W(),1);function md({tags:e,allTags:t,onChange:a,disabled:r}){let[o,n]=Sr.default.useState(""),[l,s]=Sr.default.useState(!1),u=Sr.default.useRef(null),d=Sr.default.useRef(null),m=o.trim().toLowerCase(),g=Sr.default.useMemo(()=>t.filter(f=>!e.includes(f)&&f.toLowerCase().includes(m)).slice(0,8),[t,e,m]),p=m.length>0&&!t.some(i=>i.toLowerCase()===m)&&!e.some(i=>i.toLowerCase()===m),v=m.length>0&&t.some(i=>i.toLowerCase()===m)&&!e.some(i=>i.toLowerCase()===m);function y(i){var L;let f=i.trim();!f||e.includes(f)||(a([...e,f]),n(""),s(!1),(L=u.current)==null||L.focus())}function C(i){a(e.filter(f=>f!==i))}function O(i){if(i.key==="Enter")if(i.preventDefault(),p||v){let f=t.find(L=>L.toLowerCase()===m);y(f??o.trim())}else g.length>0&&y(g[0]);i.key==="Escape"&&(s(!1),n("")),i.key==="Backspace"&&!o&&e.length>0&&C(e[e.length-1])}Sr.default.useEffect(()=>{function i(f){d.current&&!d.current.contains(f.target)&&s(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);let c=l&&(g.length>0||p);return(0,Rt.jsxs)("div",{ref:d,style:{position:"relative"},children:[(0,Rt.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 i;r||(i=u.current)==null||i.focus()},children:[(0,Rt.jsx)(Dn,{tags:e,onRemove:r?void 0:C,size:"sm"}),!r&&(0,Rt.jsx)("input",{ref:u,type:"text",value:o,placeholder:e.length?"":"Add tags\\u2026",onChange:i=>{n(i.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:O,style:{background:"none",border:"none",outline:"none",fontSize:12,color:"var(--p-text)",minWidth:80,flex:1,padding:0,lineHeight:"1.4"}})]}),c&&(0,Rt.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:i=>i.preventDefault(),children:[g.map(i=>{let{bg:f,text:L,border:w}=qt(i);return(0,Rt.jsxs)("button",{type:"button",onClick:()=>y(i),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:b=>{b.currentTarget.style.background="var(--p-hover)"},onMouseLeave:b=>{b.currentTarget.style.background="none"},children:[(0,Rt.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:L,border:`1px solid ${w}`,flexShrink:0}}),i]},i)}),p&&(0,Rt.jsxs)("button",{type:"button",onClick:()=>y(o.trim()),style:{width:"100%",textAlign:"left",padding:"6px 10px",display:"flex",alignItems:"center",gap:6,background:"none",border:g.length>0?"1px solid var(--p-border)":"none",borderLeft:"none",borderRight:"none",borderBottom:"none",cursor:"pointer",fontSize:12,color:"var(--p-text-g)"},onMouseEnter:i=>{i.currentTarget.style.background="var(--p-hover)",i.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:i=>{i.currentTarget.style.background="none",i.currentTarget.style.color="var(--p-text-g)"},children:[(0,Rt.jsx)("span",{style:{fontSize:14,lineHeight:1},children:"+"}),\'Create "\',(0,Rt.jsx)("strong",{style:{color:"var(--p-text)"},children:o.trim()}),\'"\']})]})]})}var q=M(W(),1);function xd({task:e,description:t,setDescription:a,showDescPreview:r,setShowDescPreview:o,priority:n,setPriority:l,onDescriptionBlur:s,onDescriptionDiscard:u,originalDescription:d,onPriorityChange:m,githubUrl:g,onFilePreview:p,onPatch:v,onDeleteScreenshot:y,liveFiles:C,allTags:O=[],overrideTags:c,onTagsChange:i}){var H;let f=(e==null?void 0:e.files)??[],L=C?C.map($=>({name:$.name,linkedPath:$.linkedPath,addedAt:$.createdAt,url:$.url})):f,w=L==null?void 0:L.find($=>/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test($.name)),b=e&&w?w.url||`/api/tasks/${e.id}/files/${encodeURIComponent(w.name)}`:null,S=hd.default.useRef(null),[h,P]=hd.default.useState(null),{userPart:B,consolePart:R}=Pv(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)(Bn,{value:t,previewValue:R?B: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:S,afterTextarea:u&&d!==void 0&&t!==d?(0,q.jsx)("button",{type:"button",onMouseDown:$=>{$.preventDefault(),u()},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:$=>{$.currentTarget.style.color="var(--p-amber-300)",$.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:$=>{$.currentTarget.style.color="var(--p-text-g)",$.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9 Discard changes"}):void 0})]}),R&&(0,q.jsx)(Tv,{logs:R}),e&&w&&b&&(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:()=>p(w.name,b),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:b,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 ${it(w.addedAt)}`:"Screenshot attached"}),(0,q.jsx)("button",{onClick:()=>p(w.name,b),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:()=>P(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)(md,{tags:c??(e==null?void 0:e.tags)??[],allTags:O,disabled:!e&&!i,onChange:$=>{i?i($):e&&v(e.id,{tags:$})}})]}),(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:$=>{let Y=$.target.value;l(Y),m==null||m(Y)},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?it(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||((H=e.commits)==null?void 0:H.length))&&(0,q.jsx)(kv,{task:e,githubUrl:g}),e.branchName&&(0,q.jsx)(bv,{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)(aa,{open:h!==null,message:"Remove this screenshot? This action cannot be undone.",confirmLabel:"Remove",onConfirm:()=>{h&&y(h),P(null)},onCancel:()=>P(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 kv({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 bv({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 Pv(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 Tv({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 vo=M(W(),1);function vd({commentInput:e,setCommentInput:t,commentSubmitting:a,onSubmit:r,baseRows:o=4}){return(0,vo.jsx)("div",{id:"dp-comment-input-area",children:(0,vo.jsx)(Bn,{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,vo.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,vo.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,vo.jsx)("path",{d:"M2 8L14 2L10 8L14 14L2 8Z",fill:"currentColor"})})})})})}var A=M(W(),1),Rv="vibeflow-paste-hint-dismissed";function Mv({storageKey:e=Rv}){let[t,a]=G.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)(Ue,{style:{width:12,height:12}})})]})}var Av=[{id:"backlog",label:"backlog"},{id:"todo",label:"todo"},{id:"in-progress",label:"in-progress"},{id:"review",label:"review"},{id:"done",label:"done"}],Dv=5*1024*1024;function yd(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(u=>{u?a(u):r(new Error("canvas.toBlob failed"))},"image/jpeg",t)},o.onerror=()=>{URL.revokeObjectURL(n),r(new Error("image load failed"))},o.src=n})}function Ld({open:e,task:t,tab:a,addColumnId:r="todo",gitUserName:o="You",githubUrl:n,baseUrl:l,isResizing:s,api:u,onClose:d,onSave:m,onCreate:g,onDelete:p,onPatch:v,onFilePreview:y,onActivityChange:C,externalLocalChanges:O=[],showLockIndicator:c=!0,lockedByUser:i,onGoBack:f,navBackLabel:L,commentVersion:w,allTasks:b=[],createBranch:S}){let h=!t,P=t?Mn(t.type):Mn("Task"),B=G.default.useRef(null),[R,H]=G.default.useState([]),$=G.default.useRef(!1),Y=G.default.useRef(""),ue=G.default.useRef(""),X=G.default.useMemo(()=>{let I=new Set;for(let U of b)for(let V of U.tags??[])I.add(V);return[...I].sort()},[b]),[N,re]=G.default.useState(a),[J,Z]=G.default.useState(""),[ie,Oe]=G.default.useState(""),[Mt,At]=G.default.useState(r),[xt,Cr]=G.default.useState("Task"),[tt,Vt]=G.default.useState(""),[wr,ya]=G.default.useState(!1),[Io,at]=G.default.useState(!1),[kr,ra]=G.default.useState(!1),[rt,vt]=G.default.useState(""),[zn,Ya]=G.default.useState(!1),oa=G.default.useRef(null),[Ds,Nn]=G.default.useState([]),[Es,Un]=G.default.useState(!1),[Fs,Co]=G.default.useState(null),[Dt,br]=G.default.useState(""),[Bs,Hn]=G.default.useState(!1),[na,_n]=G.default.useState([]),[qn,Wn]=G.default.useState(!1),[Os,$n]=G.default.useState(null),[Vn,Pr]=G.default.useState(0),Tr=G.default.useRef(0),[wo,Rr]=G.default.useState(0),[x,k]=G.default.useState(null),[D,_]=G.default.useState([]),[pe,me]=G.default.useState([]),ae=G.default.useRef(null),oe=G.default.useRef(()=>{}),He=G.default.useRef(""),Me=G.default.useRef(!1);G.default.useEffect(()=>{He.current=Dt},[Dt]),G.default.useEffect(()=>{Me.current=kr},[kr]),G.default.useEffect(()=>{$.current=s??!1},[s]),G.default.useEffect(()=>{e||C==null||C(null,"viewing")},[e]),G.default.useEffect(()=>{if(!e||!t)return;J!==Y.current||ie!==ue.current?C==null||C(t.id,"locked"):C==null||C(t.id,"viewing")},[J,ie,e,t==null?void 0:t.id]),G.default.useEffect(()=>{if(!e)return;function I(U){var V,ve,he,Et;if(!$.current&&!((ve=(V=U.target)==null?void 0:V.closest)!=null&&ve.call(V,"[data-task-ref-suggest]"))&&!((Et=(he=U.target)==null?void 0:he.closest)!=null&&Et.call(he,".modal-backdrop"))&&B.current&&!B.current.contains(U.target)){if(Me.current)return;if(He.current.trim().length>0){oe.current(),ra(!0);return}oe.current(),d()}}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[e,d]),G.default.useEffect(()=>{if(!e)return;function I(U){if(U.key==="Escape"){if(Me.current){ra(!1),U.stopPropagation();return}if(He.current.trim().length>0){U.stopPropagation(),oe.current(),ra(!0);return}}}return document.addEventListener("keydown",I,{capture:!0}),()=>document.removeEventListener("keydown",I,{capture:!0})},[e]),G.default.useEffect(()=>{if(e){if(re(a),ya(!!t),br(""),Nn([]),_n([]),Pr(0),Rr(0),_([]),me([]),vt((t==null?void 0:t.branchName)??""),Ya(!1),oa.current=null,t){let I=(t.title??"").trim(),U=(t.description??"").trim();Z(I),Oe(U),At(t.status),Cr(t.type??"Task"),Vt(t.priority??""),Y.current=I,ue.current=U,C==null||C(t.id,"viewing")}else Z(""),Oe(""),At(r),Cr("Task"),Vt("");t&&(Te(t.id),_e(t.id)),setTimeout(()=>{var I;return(I=ae.current)==null?void 0:I.focus()},50)}},[e,t==null?void 0:t.id,a]),G.default.useEffect(()=>{!e||!t||(N==="comments"?(E(t.id),_e(t.id)):N==="files"&&_e(t.id))},[N,e,t==null?void 0:t.id]),G.default.useEffect(()=>{if(!e||!t||J!==Y.current||ie!==ue.current)return;let U=(t.title??"").trim(),V=(t.description??"").trim();(U!==Y.current||V!==ue.current)&&(Z(U),Oe(V),Y.current=U,ue.current=V),t.status&&t.status!==Mt&&At(t.status),t.type&&t.type!==xt&&Cr(t.type),t.priority!==void 0&&t.priority!==tt&&Vt(t.priority??"");let ve=t.branchName??"";ve!==rt&&vt(ve)},[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.branchName]),G.default.useEffect(()=>{!e||!t||w===void 0||(N==="comments"?E(t.id):Te(t.id))},[w]);async function Te(I){var U,V;try{let[ve,he]=await Promise.all([u.getComments(I),u.getFiles(I)]);Pr(((U=ve.comments)==null?void 0:U.length)??0),Rr(((V=he.files)==null?void 0:V.length)??0)}catch{}}async function E(I){var V;let U=++Tr.current;Un(!0),Co(null);try{let ve=await u.getComments(I);if(Tr.current!==U)return;Nn(ve.comments??[]),Pr(((V=ve.comments)==null?void 0:V.length)??0)}catch{if(Tr.current!==U)return;Co("failed")}finally{Tr.current===U&&Un(!1)}}async function _e(I){var U;Wn(!0),$n(null);try{let V=await u.getFiles(I);_n(V.files??[]),Rr(((U=V.files)==null?void 0:U.length)??0)}catch{$n("failed")}finally{Wn(!1)}}async function la(){var I;if(!J.trim()){(I=ae.current)==null||I.focus();return}if(!h&&Dt.trim()&&await Mr(),h){let U=await g({title:J.trim(),description:ie.trim()||J.trim(),status:Mt,type:xt,priority:tt||void 0,selector:"/",tags:pe.length>0?pe:void 0});if(U&&R.length>0){for(let V of R)await u.uploadFile(U,V).catch(()=>null);H([])}d()}else yt()}function yt(){if(!t||h)return;let I=J.trim();if(!I)return;let U=Y.current,V=ue.current,ve=I!==U,he=ie.trim()!==V;!ve&&!he||(ve&&La("title",U,I),he&&La("description",V,ie.trim()),v(t.id,{title:I,description:ie.trim(),type:xt,priority:tt||void 0}),Y.current=I,ue.current=ie.trim())}oe.current=yt;function La(I,U,V){U!==V&&_(ve=>[...ve,{field:I,from:U,to:V,actor:o,timestamp:new Date().toISOString()}])}async function Mr(){if(!(!t||!Dt.trim())){Hn(!0);try{await u.addComment(t.id,Dt.trim()),br(""),await E(t.id)}finally{Hn(!1)}}}async function Kn(I,U){t&&(await u.updateComment(t.id,I.id,U),await E(t.id))}async function lg(I){t&&(await u.deleteComment(t.id,I.id),await E(t.id))}async function sg(I){if(!t)return;let U=t.id;k(null);for(let V of Array.from(I.target.files??[])){if(!V.type.startsWith("image/")&&V.size>Dv){k(`"${V.name}" exceeds the 5 MB limit and was skipped.`);continue}let ve;if(V.type.startsWith("image/")){let he=await yd(V),Et=V.name.replace(/\\.(png|bmp|gif|webp|tiff?)$/i,".jpg");ve=new File([he],Et,{type:"image/jpeg"})}else ve=V;await u.uploadFile(U,ve)}I.target.value="",await _e(U),Te(U)}async function ug(I){if(!t)return;k(null);let U=await yd(I),ve=`paste-${new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}.jpg`,he=new File([U],ve,{type:"image/jpeg"});await u.uploadFile(t.id,he),await _e(t.id),Te(t.id)}async function ig(I){if(!t)return;let U=Array.from(I.items),V=U.find(he=>he.type.startsWith("image/"));if(V){let he=V.getAsFile();he&&await ug(he);return}let ve=U.filter(he=>he.kind==="file"&&!he.type.startsWith("image/"));if(ve.length>0){for(let he of ve){let Et=he.getAsFile();Et&&await u.uploadFile(t.id,Et)}await _e(t.id),Te(t.id);return}}G.default.useEffect(()=>{if(!e)return;function I(U){if(!U.clipboardData)return;let V=U.target;if(!((V.tagName==="TEXTAREA"||V.tagName==="INPUT"||V.isContentEditable)&&!Array.from(U.clipboardData.items).some(Ar=>Ar.kind==="file"))){if(U.preventDefault(),!t){let Et=Array.from(U.clipboardData.items).find(Ar=>Ar.type.startsWith("image/"));if(Et){let Ar=Et.getAsFile();Ar&&(async()=>{let gg=await yd(Ar),hg=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),xg=new File([gg],`paste-${hg}.jpg`,{type:"image/jpeg"});H(vg=>[...vg,xg])})()}return}ig(U.clipboardData)}}return document.addEventListener("paste",I),()=>document.removeEventListener("paste",I)},[e,t==null?void 0:t.id]);async function kd(I){t&&(await u.deleteFile(t.id,I.name),await _e(t.id),Te(t.id))}async function dg(I){if(!t)return;await u.deleteFile(t.id,I);let U=(t.files??[]).filter(V=>V.name!==I);v(t.id,{files:U}),await _e(t.id),Te(t.id)}function fg(I){if(zn&&I!=="review"&&(Ya(!1),oa.current=null),At(I),h||!t)return;if(S&&I==="review"&&!rt.trim()){oa.current={taskId:t.id,patch:{status:I}},Ya(!0);return}let U={status:I};rt.trim()&&(U.branchName=rt.trim()),v(t.id,U)}function bd(){if(!oa.current||!t||!rt.trim())return;let I={...oa.current.patch,branchName:rt.trim()};v(t.id,I),Ya(!1),oa.current=null}function Pd(){Ya(!1),oa.current=null,t&&At(t.status)}let cg=I=>I!==Mt?"dp-status-btn":`dp-status-btn active-${I}`;function Td(){if(!Me.current){if(He.current.trim().length>0){oe.current(),ra(!0);return}oe.current(),d()}}let pg=e&&t!=null&&(J!==Y.current||ie!==ue.current),mg=G.default.useMemo(()=>{let I=[...O,...D].sort((V,ve)=>new Date(V.timestamp).getTime()-new Date(ve.timestamp).getTime()),U=[];for(let V of I)U.some(he=>he.field===V.field&&he.from.toLowerCase()===V.from.toLowerCase()&&he.to.toLowerCase()===V.to.toLowerCase()&&he.actor===V.actor&&Math.abs(new Date(he.timestamp).getTime()-new Date(V.timestamp).getTime())<=3e3)||U.push(V);return U},[O,D]),Sa=!h&&!!i;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)("aside",{id:"detail-panel",className:"open",ref:B,children:[Sa&&(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:i})," \\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:[f&&(0,A.jsx)("button",{id:"dp-back",onClick:f,title:L?`Back to: ${L}`:"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:I=>{I.currentTarget.style.background="var(--p-border)",I.currentTarget.style.color="var(--p-blue-300)",I.currentTarget.style.borderColor="var(--p-blue)"},onMouseOut:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--p-text-g)",I.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u2190"}),(0,A.jsx)(ks,{id:"dp-type-picker",value:xt,disabled:Sa,onChange:I=>{!h&&t&&I!==xt&&La("type",xt,I),Cr(I),!h&&t&&v(t.id,{type:I})}}),(0,A.jsx)("input",{id:"dp-title",ref:ae,className:"dp-input",type:"text",placeholder:"Task title\\u2026",value:J,readOnly:Sa,onChange:I=>Z(I.target.value),onKeyDown:I=>{I.key==="Escape"&&(I.stopPropagation(),Td()),I.key==="Enter"&&h&&la()},style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",borderColor:"transparent",background:"transparent"},onFocus:I=>{I.currentTarget.style.borderColor="var(--p-blue)",I.currentTarget.style.background="var(--p-input)"},onBlur:I=>{I.currentTarget.style.borderColor="transparent",I.currentTarget.style.background="transparent",h||yt()}}),!h&&J!==Y.current&&J.trim()!==""&&(0,A.jsx)("button",{type:"button",title:"Discard title changes",onMouseDown:I=>{I.preventDefault(),Z(Y.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:I=>{I.currentTarget.style.color="var(--p-amber-300)",I.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:I=>{I.currentTarget.style.color="var(--p-text-g)",I.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9"}),(0,A.jsx)("button",{id:"dp-close",onClick:Td,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:I=>{I.currentTarget.style.background="var(--p-border)",I.currentTarget.style.color="var(--p-text-m)"},onMouseOut:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--p-text-g)"},children:(0,A.jsx)(Ue,{style:{width:14,height:14}})}),c&&pg&&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",...Sa?{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"}),Av.map(I=>(0,A.jsx)("button",{className:cg(I.id),"data-status":I.id,onClick:()=>fg(I.id),children:I.label},I.id))]}),zn&&!Sa&&(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:rt,onChange:I=>vt(I.target.value),onKeyDown:I=>{I.key==="Enter"&&rt.trim()&&bd(),I.key==="Escape"&&Pd()},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:bd,disabled:!rt.trim(),style:{padding:"4px 12px",borderRadius:6,border:"1px solid var(--p-purple)",background:rt.trim()?"var(--p-purple)":"var(--p-border)",color:"#fff",fontSize:11,fontWeight:600,cursor:rt.trim()?"pointer":"not-allowed",transition:"background .12s"},children:"Apply & Review"}),(0,A.jsx)("button",{onClick:Pd,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"})]})]}),!h&&(0,A.jsxs)("div",{className:"dp-tabs",id:"dp-tabs-row",children:[(0,A.jsx)("button",{className:`dp-tab${N==="details"?" active":""}`,id:"dp-tab-details",onClick:()=>re("details"),children:"Details"}),(0,A.jsxs)("button",{className:`dp-tab${N==="comments"?" active":""}`,id:"dp-tab-activity",onClick:()=>re("comments"),children:["Activity ",Vn>0&&(0,A.jsxs)("span",{id:"dp-activity-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",Vn,")"]})]}),(0,A.jsxs)("button",{className:`dp-tab${N==="files"?" active":""}`,id:"dp-tab-files",onClick:()=>re("files"),children:["Files ",wo>0&&(0,A.jsxs)("span",{id:"dp-file-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",wo,")"]})]})]}),(0,A.jsxs)("div",{className:"dp-body",children:[!h&&(0,A.jsx)(Mv,{}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-details-pane",style:{display:!t||N==="details"?"":"none"},children:[(0,A.jsx)("div",{style:Sa?{pointerEvents:"none",opacity:.6,flexShrink:0}:{flexShrink:0},children:(0,A.jsx)(xd,{task:t,description:ie,setDescription:Oe,showDescPreview:wr,setShowDescPreview:ya,priority:tt,setPriority:Vt,onDescriptionBlur:h?void 0:yt,onDescriptionDiscard:h?void 0:()=>{Oe(ue.current),ya(!0)},originalDescription:h?void 0:ue.current,onPriorityChange:h?void 0:I=>{t&&(I!==tt&&La("priority",tt||"\\u2014",I||"\\u2014"),v(t.id,{priority:I||void 0}))},githubUrl:n,onFilePreview:y,onDeleteScreenshot:dg,onPatch:v,liveFiles:na.length>0||qn?na:void 0,allTags:X,overrideTags:h?pe:void 0,onTagsChange:h?me:void 0})}),!h&&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)(Ev,{task:t})})]}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-activity-pane",style:{display:N==="comments"&&!h?"":"none"},children:[(0,A.jsx)("div",{style:{borderBottom:"1px solid var(--p-border)",paddingBottom:8,flexShrink:0},children:(0,A.jsx)(vd,{commentInput:Dt,setCommentInput:br,commentSubmitting:Bs,onSubmit:()=>{Mr()},baseRows:2})}),(0,A.jsx)(cd,{comments:Ds,files:na,localChanges:mg,loading:Es,error:Fs,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:Kn,onDelete:lg,onDeleteFile:kd,onFilePreview:y})]}),(0,A.jsxs)("div",{className:"dp-pane",id:"dp-files-pane",style:{display:N==="files"&&!h?"":"none"},children:[(0,A.jsx)(pd,{files:na,loading:qn,error:Os,baseUrl:l,onPreview:I=>y(I.name,I.linkedPath?`${l}/api/tasks/${t==null?void 0:t.id}/files/${encodeURIComponent(I.name)}`:`${l}${I.url}`),onDelete:Sa?void 0:kd}),(0,A.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:8,flexShrink:0,display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",...Sa?{pointerEvents:"none",opacity:.5}:{}},children:[x&&(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:x}),(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:I=>{I.currentTarget.style.borderColor="var(--p-border-t)",I.currentTarget.style.color="var(--p-text)"},onMouseOut:I=>{I.currentTarget.style.borderColor="var(--p-border)",I.currentTarget.style.color="var(--p-text-m)"},children:[(0,A.jsx)(po,{style:{width:12,height:12}}),"Upload",(0,A.jsx)("input",{id:"dp-file-upload",type:"file",style:{display:"none"},multiple:!0,onChange:sg})]}),(0,A.jsx)("span",{style:{fontSize:11,color:"var(--p-border-t)",marginLeft:"auto"},children:"or paste image"})]})]})]}),(0,A.jsxs)("div",{className:"dp-footer",children:[!h&&(0,A.jsx)("button",{id:"dp-delete",onClick:()=>at(!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:I=>{I.currentTarget.style.borderColor="var(--p-red)"},onMouseOut:I=>{I.currentTarget.style.borderColor="var(--p-border-t)"},children:"Delete"}),(0,A.jsx)("div",{style:{flex:1}}),h?(0,A.jsxs)(A.Fragment,{children:[R.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} ",R.length," screenshot",R.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:I=>{I.currentTarget.style.borderColor="var(--p-text-g)"},onMouseOut:I=>{I.currentTarget.style.borderColor="var(--p-border-t)"},children:"Cancel"}),(0,A.jsx)("button",{id:"dp-save",onClick:()=>{la()},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:I=>{I.currentTarget.style.background="var(--p-blue-700)"},onMouseOut:I=>{I.currentTarget.style.background="var(--p-blue)"},children:"Add Task"})]}):(0,A.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)",padding:"5px 4px"},children:"Changes are saved automatically"})]}),(0,A.jsx)(aa,{open:Io,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:()=>{at(!1),p(t.id),d()},onCancel:()=>at(!1)})]}),kr&&(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)(po,{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:()=>{ra(!1),Mr().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:()=>{ra(!1),br(""),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:()=>ra(!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 Ev({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 Ir=M(Se(),1);var Q=M(W(),1),Fv=[{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)"}],Bv={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 Sd({tasks:e,filter:t,onFilter:a,view:r="board",onViewChange:o,activityCounter:n}){let[l,s]=Ir.default.useState(!1),[u,d]=Ir.default.useState(!1),[m,g]=Ir.default.useState(!1),p=Ir.default.useMemo(()=>[...new Set(e.map(S=>S.type).filter(Boolean))].sort(),[e]),v=Ir.default.useMemo(()=>[...new Set(e.map(S=>S.author).filter(Boolean))].sort(),[e]),y=Ir.default.useMemo(()=>{let S=new Set;for(let h of e)for(let P of h.tags??[])S.add(P);return[...S].sort()},[e]);function C(S){return e.filter(h=>h.status===S).length}function O(S){a({...t,status:S}),s(!1),d(!1),g(!1)}function c(S){a({...t,type:S}),s(!1)}function i(S){a({...t,user:S}),d(!1)}function f(S){let h=t.tags??[],P=h.includes(S)?h.filter(B=>B!==S):[...h,S];a({...t,tags:P})}function L(S){S.stopPropagation();let h=S.currentTarget.dataset.status;h&&O(h)}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},b={...w,background:"var(--p-card)",border:"1px solid var(--p-border)",color:"var(--p-text-f)",padding:"3px 10px",position:"relative"};return(0,Q.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),g(!1)},children:[(0,Q.jsx)("div",{style:{display:"flex",alignItems:"center",gap:2},children:Fv.map(S=>{let h=t.status===S.id,P=S.id!=="all"?C(S.id):null,B=h?Bv[S.id]:{};return(0,Q.jsxs)("button",{"data-status":S.id,style:{...w,...B},onMouseOver:R=>{h||(R.currentTarget.style.background="var(--p-hover)",R.currentTarget.style.color="var(--p-text-m)")},onMouseOut:R=>{h||(R.currentTarget.style.background="transparent",R.currentTarget.style.color="var(--p-text-f)")},onClick:L,children:[S.dot&&(0,Q.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:S.dot,flexShrink:0,display:"inline-block"}}),S.label,P!=null&&(0,Q.jsx)("span",{style:{color:h?"inherit":"var(--p-border-t)",fontSize:10,opacity:.8},children:P})]},S.id)})}),(0,Q.jsx)("div",{style:{flex:1}}),n,t.user&&(0,Q.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,Q.jsx)("button",{onClick:()=>i(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-purple-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,Q.jsx)(Ue,{style:{width:10,height:10}})})]}),t.type&&(0,Q.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,Q.jsx)("button",{onClick:()=>c(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-cyan-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,Q.jsx)(Ue,{style:{width:10,height:10}})})]}),(t.tags??[]).map(S=>{let{bg:h,text:P,border:B}=qt(S);return(0,Q.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:h,border:`1px solid ${B}`,fontSize:10,color:P,fontWeight:600},children:[S,(0,Q.jsx)("button",{onClick:()=>f(S),style:{display:"flex",background:"none",border:"none",color:P,cursor:"pointer",padding:0,lineHeight:1},children:(0,Q.jsx)(Ue,{style:{width:10,height:10}})})]},S)}),(0,Q.jsxs)("div",{style:{position:"relative"},children:[(0,Q.jsxs)("button",{style:{...b,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:y.length?1:.55},onClick:S=>{S.stopPropagation(),y.length&&(d(!1),s(!1),g(h=>!h))},children:[(0,Q.jsx)(co,{style:{width:12,height:12}}),"Tags",(t.tags??[]).length>0&&(0,Q.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,Q.jsx)(mr,{style:{width:12,height:12}})]}),m&&y.length>0&&(0,Q.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:S=>S.stopPropagation(),children:[(t.tags??[]).length>0&&(0,Q.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"}),y.map(S=>{let{bg:h,text:P,border:B}=qt(S),R=(t.tags??[]).includes(S);return(0,Q.jsxs)("button",{style:{width:"100%",textAlign:"left",padding:"6px 12px",fontSize:11,color:"var(--p-text-m)",background:R?"var(--p-hover)":"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:6},onMouseEnter:H=>{H.currentTarget.style.background="var(--p-hover)"},onMouseLeave:H=>{H.currentTarget.style.background=R?"var(--p-hover)":"none"},onClick:()=>f(S),children:[(0,Q.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:P,border:`1px solid ${B}`,flexShrink:0}}),(0,Q.jsx)("span",{style:{flex:1},children:S}),R&&(0,Q.jsx)("span",{style:{color:P,fontSize:12,lineHeight:1},children:"\\u2713"})]},S)})]})]}),(0,Q.jsxs)("div",{style:{position:"relative"},children:[(0,Q.jsxs)("button",{style:{...b,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:v.length?1:.55},onClick:S=>{S.stopPropagation(),v.length&&(s(!1),d(h=>!h))},children:[(0,Q.jsx)(Rn,{style:{width:12,height:12}}),"User",(0,Q.jsx)(mr,{style:{width:12,height:12}})]}),u&&v.length>0&&(0,Q.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:S=>S.stopPropagation(),children:[(0,Q.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:()=>i(null),children:"All users"}),v.map(S=>(0,Q.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.user===S?"var(--p-purple-300)":"var(--p-text-m)",background:t.user===S?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:h=>{t.user!==S&&(h.currentTarget.style.background="var(--p-hover)")},onMouseOut:h=>{t.user!==S&&(h.currentTarget.style.background="none")},onClick:()=>i(S),children:S},S))]})]}),(0,Q.jsxs)("div",{style:{position:"relative"},children:[(0,Q.jsxs)("button",{style:{...b,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:p.length?1:.55},onClick:S=>{S.stopPropagation(),p.length&&s(h=>!h)},children:[(0,Q.jsx)(co,{style:{width:12,height:12}}),"Type",(0,Q.jsx)(mr,{style:{width:12,height:12}})]}),l&&p.length>0&&(0,Q.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:S=>S.stopPropagation(),children:[(0,Q.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:()=>c(null),children:"All types"}),p.map(S=>(0,Q.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.type===S?"var(--p-cyan-300)":"var(--p-text-m)",background:t.type===S?"color-mix(in srgb, var(--p-blue) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:h=>{t.type!==S&&(h.currentTarget.style.background="var(--p-hover)")},onMouseOut:h=>{t.type!==S&&(h.currentTarget.style.background="none")},onClick:()=>c(S),children:S},S))]})]}),(0,Q.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,Q.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:S=>{S.stopPropagation(),o==null||o("board")},children:(0,Q.jsx)(Cn,{style:{width:13,height:13}})}),(0,Q.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:S=>{S.stopPropagation(),o==null||o("list")},children:(0,Q.jsx)(wn,{style:{width:13,height:13}})})]})]})}var Qa=M(Se(),1);var fe=M(W(),1),Ov=[{id:"board",label:"Board",icon:(0,fe.jsx)($a,{className:"w-3.5 h-3.5"})},{id:"enforcement",label:"Enforcement",icon:(0,fe.jsx)(Tn,{className:"w-3.5 h-3.5"})}];function Id({open:e,visibleCols:t,settings:a,onClose:r,onSave:o}){let[n,l]=Qa.default.useState("board"),[s,u]=Qa.default.useState({}),[d,m]=Qa.default.useState(a.autoCommit??!1),[g,p]=Qa.default.useState(a.autoComment??!1),[v,y]=Qa.default.useState(a.autoPush??!1),[C,O]=Qa.default.useState(a.createBranch??!1);Qa.default.useEffect(()=>{if(!e)return;let f={};Ka.forEach(L=>{f[L.id]=t.includes(L.id)}),u(f),m(a.autoCommit??!1),p(a.autoComment??!1),y(a.autoPush??!1),O(a.createBranch??!1),l("board")},[e,t,a]);function c(){let f=Ka.filter(L=>s[L.id]).map(L=>L.id);o(f,{autoCommit:d,autoComment:g,autoPush:v,createBranch:C}),r()}function i(f){u(L=>({...L,[f]:!L[f]}))}return(0,fe.jsxs)(va,{open:e,onClose:r,id:"settings-modal",width:"min(460px, 95vw)",icon:(0,fe.jsx)(vr,{style:{width:14,height:14,color:"var(--p-text-g)"}}),title:"Settings",headerActions:(0,fe.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:f=>{f.currentTarget.style.background="var(--p-surface)",f.currentTarget.style.color="var(--p-text-m)"},onMouseOut:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color="var(--p-text-g)"},children:(0,fe.jsx)(Ue,{style:{width:14,height:14}})}),footer:(0,fe.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,fe.jsx)("button",{id:"settings-cancel",onClick:r,className:"dp-status-btn",style:{padding:"5px 14px",fontSize:12},children:"Cancel"}),(0,fe.jsx)("button",{id:"settings-apply",onClick:c,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:f=>{f.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 28%, transparent)"},onMouseOut:f=>{f.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 18%, transparent)"},children:"Apply"})]}),children:[(0,fe.jsx)("div",{className:"dp-tabs",children:Ov.map(f=>(0,fe.jsxs)("button",{onClick:()=>l(f.id),className:`dp-tab${n===f.id?" active":""}`,style:{display:"flex",alignItems:"center",gap:6},children:[f.icon,f.label]},f.id))}),n==="board"&&(0,fe.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:10},children:[(0,fe.jsx)("div",{className:"dp-meta-label",children:"Visible Columns"}),Ka.map(f=>(0,fe.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none"},children:[(0,fe.jsx)("input",{id:`settings-col-${f.id}`,type:"checkbox",checked:s[f.id]??!0,onChange:()=>i(f.id),style:{width:14,height:14,accentColor:f.color,cursor:"pointer"}}),(0,fe.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:f.color,flexShrink:0}}),(0,fe.jsx)("span",{style:{fontSize:13,color:"var(--p-text-m)"},children:f.label})]},f.id))]}),n==="enforcement"&&(0,fe.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:16},children:[(0,fe.jsx)(Ps,{id:"settings-auto-comment",label:"Require comment on review",description:"CLI enforces an implementation report when setting task status to review.",value:g,onChange:p}),(0,fe.jsx)("div",{style:{height:1,background:"var(--p-border)",marginTop:-4,marginBottom:-4}}),(0,fe.jsx)(Ps,{id:"settings-create-branch",label:"Require branch per task",description:"CLI enforces a dedicated branch name when setting task status to review.",value:C,onChange:O}),(0,fe.jsx)(Ps,{id:"settings-auto-commit",label:"Auto-commit on review",description:"CLI automatically commits staged changes when setting task status to review.",value:d,onChange:m}),(0,fe.jsx)(Ps,{id:"settings-auto-push",label:"Auto-push after commit",description:`CLI pushes after auto-commit. Requires \'Auto-commit\' to be ON.${d?"":" (Enable Auto-commit first)"}`,value:v&&d,onChange:f=>y(f&&d)})]})]})}function Ps({id:e,label:t,description:a,value:r,onChange:o}){return(0,fe.jsxs)("div",{children:[(0,fe.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:t}),(0,fe.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:a}),(0,fe.jsxs)("div",{id:e,style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer"},onClick:()=>o(!r),children:[(0,fe.jsxs)("div",{style:{position:"relative",width:36,height:20,flexShrink:0},children:[(0,fe.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,fe.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,fe.jsx)("span",{style:{fontSize:12,color:"var(--p-text-g)"},children:r?"On":"Off"})]})]})}var yo=M(Se(),1);var ce=M(W(),1);function _m(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function Ts(e){return/\\.md$/i.test(e)}function On(e){return/\\.json$/i.test(e)}function zv(e){let t=[],a=0;for(;a<e.length;){let r=e.slice(a).match(/^(\\s+)/);if(r){t.push({type:"punct",value:r[1]}),a+=r[1].length;continue}let o=e.slice(a).match(/^([{}[\\]:,])/);if(o){t.push({type:"punct",value:o[1]}),a+=1;continue}let n=e.slice(a).match(/^"([^"\\\\]|\\\\.)*"/);if(n){let d=n[0],m=e[a+d.length]===":",p=d.slice(1,-1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");t.push({type:m?"key":"string",value:p}),a+=d.length;continue}let l=e.slice(a).match(/^(-?\\d+(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)/);if(l){t.push({type:"number",value:l[1]}),a+=l[1].length;continue}let s=e.slice(a).match(/^(true|false)/);if(s){t.push({type:"bool",value:s[1]}),a+=s[1].length;continue}let u=e.slice(a).match(/^(null)/);if(u){t.push({type:"null",value:u[1]}),a+=1;continue}t.push({type:"punct",value:e[a]}),a++}return t}var Nv={key:{color:"#c084fc"},string:{color:"#86efac"},number:{color:"#67e8f9"},bool:{color:"#fb923c"},null:{color:"#f87171"},punct:{color:"inherit"}};function Uv({tokens:e}){return(0,ce.jsx)("div",{children:e.map((t,a)=>(0,ce.jsx)("span",{style:Nv[t.type],children:t.value},a))})}function Cd({open:e,name:t,url:a,onClose:r}){let[o,n]=yo.default.useState(null),[l,s]=yo.default.useState(null),[u,d]=yo.default.useState(!1),[m,g]=yo.default.useState(!1);return yo.default.useEffect(()=>{!e||!a||(d(!1),Ts(t)?(g(!0),n(null),fetch(a).then(p=>p.text()).then(p=>{n(p),g(!1)}).catch(()=>{n("Error loading file."),g(!1)})):On(t)?(g(!0),s(null),fetch(a).then(p=>p.text()).then(p=>{try{let v=JSON.parse(p),C=JSON.stringify(v,null,2).split(`\n`).map(zv);s(C)}catch{d(!0)}g(!1)}).catch(()=>{d(!0),g(!1)})):(n(null),s(null)))},[e,t,a]),(0,ce.jsx)(va,{open:e,onClose:r,id:"file-preview-modal",width:"min(1100px, 95vw)",maxHeight:"88vh",boxStyle:{display:"flex",flexDirection:"column"},icon:(0,ce.jsx)(fo,{className:"w-4 h-4 text-slate-400"}),title:t,headerActions:(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.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,ce.jsx)(gr,{className:"w-4 h-4"})}),(0,ce.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,ce.jsx)(Ue,{className:"w-4 h-4"})})]}),footer:(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.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,ce.jsx)(gr,{className:"w-3.5 h-3.5"}),"Download"]}),(0,ce.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,ce.jsxs)("div",{className:"flex-1 overflow-auto",style:{minHeight:0,padding:"16px 20px"},children:[_m(t)&&(0,ce.jsx)("div",{style:{borderRadius:8,overflow:"hidden",border:"1px solid var(--p-border)",background:"var(--p-card)",display:"inline-block",width:"100%"},children:(0,ce.jsx)("img",{src:a,alt:t,style:{maxWidth:"100%",display:"block",margin:"0 auto",objectFit:"contain"}})}),Ts(t)&&m&&(0,ce.jsx)("p",{className:"text-xs text-slate-500 py-4",children:"Loading\\u2026"}),Ts(t)&&!m&&o!==null&&(0,ce.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,ce.jsx)(ea,{markdown:o})}),On(t)&&m&&(0,ce.jsx)("p",{className:"text-xs text-slate-500 py-4",children:"Loading\\u2026"}),On(t)&&!m&&u&&(0,ce.jsx)("p",{className:"text-xs text-red-400 py-4",children:"Error loading or parsing JSON file."}),On(t)&&!m&&l!==null&&(0,ce.jsx)("pre",{id:"file-preview-json",style:{background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:"12px 16px",fontSize:12,lineHeight:1.6,overflow:"auto",maxHeight:"70vh",margin:0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:l.map((p,v)=>(0,ce.jsx)(Uv,{tokens:p},v))}),!_m(t)&&!Ts(t)&&!On(t)&&(0,ce.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-slate-500",children:[(0,ce.jsx)(fo,{className:"w-10 h-10 opacity-40"}),(0,ce.jsx)("p",{className:"text-sm",children:"Preview not available for this file type."}),(0,ce.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,ce.jsx)(gr,{className:"w-3.5 h-3.5"}),"Download file"]})]})]})})}var Lo=window.location.origin,$t=`${Lo}/api/tasks`,ht={async getTasks(){return(await fetch(`${$t}?_=${Date.now()}`,{cache:"no-store"})).json()},async createTask(e){return(await fetch($t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()},async updateTask(e,t){return(await fetch(`${$t}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()},async deleteTask(e){await fetch(`${$t}/${e}`,{method:"DELETE"})},async getComments(e){return(await fetch(`${$t}/${e}/comments`)).json()},async addComment(e,t){await fetch(`${$t}/${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(`${$t}/${e}/comments/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})})},async deleteComment(e,t){await fetch(`${$t}/${e}/comments/${t}`,{method:"DELETE"})},async getFiles(e){return(await fetch(`${$t}/${e}/files`)).json()},async uploadFile(e,t){let a=await t.arrayBuffer();await fetch(`${$t}/${e}/files/${encodeURIComponent(t.name)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:a})},async deleteFile(e,t){await fetch(`${$t}/${e}/files/${encodeURIComponent(t)}`,{method:"DELETE"})},async getProject(){return(await fetch(`${Lo}/api/project`)).json()},async getCopilotStatus(){return(await fetch(`${Lo}/api/copilot/status`)).json()},async copilotLogin(){return(await fetch(`${Lo}/api/copilot/login`,{method:"POST"})).json().catch(()=>({}))},async getSettings(){return(await fetch(`${Lo}/api/settings`,{cache:"no-store"})).json()},async saveSettings(e){await fetch(`${Lo}/api/settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},wsUrl(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`}};var qm=["display","visibility","opacity","position","overflow","overflow-x","overflow-y","width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-width","border-style","border-color","border-radius","background-color","background-image","color","font-size","font-weight","font-style","font-family","line-height","letter-spacing","text-align","text-decoration","text-overflow","white-space","flex-direction","flex-wrap","flex","justify-content","align-items","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","z-index","box-shadow","transform","transition","cursor","user-select","pointer-events","top","left","right","bottom"];function Hv(e){let t=[],a=e;for(;a&&a!==document.documentElement;){let r=1,o=a.previousElementSibling;for(;o;)o.tagName===a.tagName&&r++,o=o.previousElementSibling;let n=a.tagName.toLowerCase();t.unshift(`${n}[${r}]`),a=a.parentElement}return"/"+t.join("/")}function _v(e){let t=e.parentElement;if(!t||t===document.body)return;let a=t.outerHTML;return a.length<=500?a:a.slice(0,500)+"\\u2026"}function qv(){return navigator.userAgent}function Wv(e){let t=e.getBoundingClientRect(),a="auto",r="static",o,n=e;for(;n&&n!==document.documentElement;){let l=window.getComputedStyle(n),s=l.position,u=l.zIndex;if(s!=="static"||u!=="auto"){if(n===e)r=s,a=u;else if(o===void 0){o=u;break}}if(s!=="static")break;n=n.parentElement}return{boundingBox:{x:t.x,y:t.y,width:t.width,height:t.height},scrollPosition:{x:window.scrollX,y:window.scrollY},viewport:{width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio},stackingContext:{zIndex:a,position:r,parentZIndex:o}}}function $v(e){let t=window.getComputedStyle(e),a={};for(let r of qm)a[r]=t.getPropertyValue(r);return a}function Wm(e,t,a=[]){return{outerHTML:e.outerHTML,computedStyles:$v(e),selector:t,xpath:Hv(e),position:Wv(e),parentSnippet:_v(e),browser:qv(),consoleErrors:a,capturedAt:new Date().toISOString()}}async function $m(e,t){if(!(!t||t==="/"||t==="body"||t==="html"))try{let a=document.querySelector(t);if(!a){console.warn(`[Vibeflow] Cannot capture baseline: element not found for selector "${t}"`);return}let r=Wm(a,t),o=`/api/tasks/${e}/baseline`;await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseline:r})})}catch(a){console.error("[Vibeflow] Failed to store baseline:",a)}}var As=M(Se(),1);var Vm="vibeflow-last-seen-version";function Vv(e,t){let a=d=>d.replace(/[^0-9.]/g,"").split(".").map(Number),[r=0,o=0,n=0]=a(e),[l=0,s=0,u=0]=a(t);return r!==l?r>l:o!==s?o>s:n>u}function Km(e,t){return!t||!e?!1:Vv(t,e)}function Gm(){try{return localStorage.getItem(Vm)}catch{return null}}function Rs(e){try{localStorage.setItem(Vm,e)}catch{}}function jm(e,t){return e.find(r=>r.version===t)??e[0]??null}function wd(e){return e?`## ${e.version}\n\n${e.markdown}`:""}function Xm(e){return e.map(t=>wd(t)).join(`\n\n`)}async function Ms(){try{let e=await fetch(`${window.location.origin}/api/changelog?_=${Date.now()}`,{cache:"no-store"});if(!e.ok)return[];let t=await e.json();return Array.isArray(t.sections)?t.sections:[]}catch{return[]}}var So=M(W(),1);function Qm({open:e,sections:t,version:a,startMode:r,onClose:o}){let[n,l]=As.default.useState(r);As.default.useEffect(()=>{e&&l(r)},[e,r]);let s=As.default.useMemo(()=>jm(t,a),[t,a]),u=n==="full"?Xm(t):wd(s);return(0,So.jsx)(va,{open:e,onClose:o,id:"whats-new-modal",width:"min(680px, 95vw)",maxHeight:"80vh",title:n==="full"?"Changelog":"What\'s new in Vibeflow",headerActions:(0,So.jsx)("button",{id:"whats-new-toggle",onClick:()=>l(d=>d==="full"?"whatsnew":"full"),style:{fontSize:12,color:"#60a5fa",background:"transparent",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:n==="full"?"What\'s new":"View full changelog"}),footer:(0,So.jsx)("button",{id:"whats-new-close",onClick:o,style:{padding:"7px 16px",borderRadius:8,background:"#2563eb",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:n==="full"?"Close":"Got it"}),children:(0,So.jsx)("div",{style:{padding:"14px 18px",overflowY:"auto",flex:1,minHeight:0,fontSize:13,color:"var(--p-text-f)"},children:(0,So.jsx)(ea,{markdown:u})})})}var j=M(W(),1),Kv=window.__PORT__??3700,Gv=window.__SAAS_MODE__??!1,Ym=window.__BOARD_URL__??"",jv=window.__BOARD_NAME__??"",tg=window.__IS_ADMIN__??!1,Jm=window.__CLI_VERSION__??"";function Xv({onClose:e}){let t=window.location.origin,[a,r]=te.default.useState("idle"),[o,n]=te.default.useState(!0),[l,s]=te.default.useState(null),[u,d]=te.default.useState("");async function m(){r("pushing"),d("");try{let p=await fetch(`${t}/api/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepLocalFiles:o})}),v=await p.json();if(!p.ok){d(v.error??"Push failed"),r("error");return}s({imported:v.imported??0,skipped:v.skipped}),r("done")}catch(p){d(p instanceof Error?p.message:"Network error"),r("error")}}let g=a==="pushing";return(0,j.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,j.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,j.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,j.jsxs)("div",{style:{padding:"36px 36px 20px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,j.jsx)("div",{style:{position:"relative",width:52,height:52,marginBottom:22},children:(0,j.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,j.jsx)("rect",{width:"18",height:"18",rx:"4",fill:"#2563eb"}),(0,j.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"white",opacity:"0.7"}),(0,j.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"white"}),(0,j.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"white",opacity:"0.7"}),(0,j.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"white",opacity:"0.85"})]})}),(0,j.jsx)("h1",{style:{fontSize:18,fontWeight:700,color:"#f1f5f9",letterSpacing:"-0.3px",margin:"0 0 7px"},children:"Online Mode Active"}),(0,j.jsxs)("p",{style:{fontSize:12,color:"rgba(255,255,255,0.36)",lineHeight:1.5,margin:0},children:["Connected to"," ",(0,j.jsx)("strong",{style:{color:"rgba(255,255,255,0.55)",fontWeight:500},children:jv||"Vibeflow SaaS"})]})]}),a==="done"&&l&&(0,j.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,j.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",children:(0,j.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"&&u&&(0,j.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:u}),(0,j.jsxs)("div",{style:{padding:"20px 24px 28px",display:"flex",flexDirection:"column",gap:8},children:[Ym&&(0,j.jsx)("a",{href:Ym,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:p=>{p.currentTarget.style.background="#3b82f6",p.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:p=>{p.currentTarget.style.background="#2563eb",p.currentTarget.style.transform="none"},children:"Open Web App \\u2192"}),a!=="done"&&(0,j.jsx)("button",{onClick:()=>{m()},disabled:g,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:g?"rgba(255,255,255,0.25)":"rgba(255,255,255,0.4)",fontSize:13,fontWeight:500,cursor:g?"not-allowed":"pointer",transition:"border-color 0.15s, color 0.15s, background 0.15s"},onMouseEnter:p=>{g||(p.currentTarget.style.borderColor="rgba(255,255,255,0.15)",p.currentTarget.style.color="rgba(255,255,255,0.65)",p.currentTarget.style.background="rgba(255,255,255,0.03)")},onMouseLeave:p=>{g||(p.currentTarget.style.borderColor="rgba(255,255,255,0.08)",p.currentTarget.style.color="rgba(255,255,255,0.4)",p.currentTarget.style.background="transparent")},children:g?"\\u23F3 Pushing\\u2026":"\\u2191 Push local tasks"})]}),(0,j.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px 20px"},children:[(0,j.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:7,cursor:"pointer"},children:[(0,j.jsx)("input",{type:"checkbox",checked:o,onChange:p=>n(p.target.checked),style:{accentColor:"#2563eb",width:13,height:13,cursor:"pointer"}}),(0,j.jsx)("span",{style:{fontSize:11.5,color:"rgba(255,255,255,0.28)"},children:"Keep local files"})]}),tg&&e&&(0,j.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:p=>{p.currentTarget.style.color="rgba(255,255,255,0.45)"},onMouseLeave:p=>{p.currentTarget.style.color="rgba(255,255,255,0.2)"},children:"Dismiss (admin)"})]})]})})}var Zm={backlog:"Backlog",todo:"Todo","in-progress":"In Progress",review:"Review",done:"Done"};function Qv(e,t,a){let r=a?e.filter(s=>{var u,d;return((u=s.title)==null?void 0:u.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 wo,Rr;let[e,t]=te.default.useState([]),[a,r]=te.default.useState(!0),[o,n]=te.default.useState(!1),[l,s]=te.default.useState({open:!1,task:null,tab:"details"}),[u,d]=te.default.useState("board"),[m,g]=te.default.useState(!1),[p,v]=te.default.useState({open:!1,startMode:"whatsnew",sections:[],version:""}),[y,C]=te.default.useState({open:!1,name:"",url:""}),[O,c]=te.default.useState(420),[i,f]=te.default.useState(!1),[L,w]=te.default.useState(""),[b,S]=te.default.useState(Ka.map(x=>x.id)),[h,P]=te.default.useState({status:"all",component:null,type:null,user:null,tags:[]}),[B,R]=te.default.useState("Proto Board"),[H,$]=te.default.useState(!1),[Y,ue]=te.default.useState(!1),[X,N]=te.default.useState("You"),[re,J]=te.default.useState(null),[Z,ie]=te.default.useState(""),[Oe,Mt]=te.default.useState({}),At=te.default.useRef(null),xt=te.default.useRef(null),Cr=te.default.useRef(0),tt=te.default.useRef(null),Vt=te.default.useRef(null),[wr,ya]=te.default.useState([]),Io=te.default.useRef(!1),at=te.default.useRef([]),[kr,ra]=te.default.useState([]);te.default.useEffect(()=>(vt(),Ya(),Un(),Fs(),oa(),Ds(),Co(),()=>{var x;xt.current&&clearTimeout(xt.current),(x=At.current)==null||x.close()}),[]),te.default.useEffect(()=>{if(H){tt.current&&(clearInterval(tt.current),tt.current=null);return}return tt.current=setInterval(()=>{vt()},5e3),()=>{tt.current&&(clearInterval(tt.current),tt.current=null)}},[H]),te.default.useEffect(()=>{document.body.setAttribute("data-theme","dark")},[]),te.default.useEffect(()=>{function x(){let _=window.location.hash.match(/^#task-([a-f0-9]{30})$/i);if(!_){Vt.current=null;return}let pe=_[1].toLowerCase();if(Vt.current===pe)return;let me=e.find(ae=>ae.id.toLowerCase()===pe);me&&(Vt.current=pe,Io.current?s(ae=>({...ae,open:!0,task:me,tab:"details"})):s(ae=>(ae.task&&ae.task.id!==me.id&&ya(oe=>[...oe,ae.task]),{...ae,open:!0,task:me,tab:"details"})),Io.current=!1)}function k(){}x();let D=()=>{Vt.current=null,x()};return window.addEventListener("hashchange",D),window.addEventListener("vibeflow-task-ref-click",k),()=>{window.removeEventListener("hashchange",D),window.removeEventListener("vibeflow-task-ref-click",k)}},[e]),te.default.useEffect(()=>{if(!l.open||!l.task)return;let x=e.find(_=>_.id===l.task.id);if(!x)return;let k=l.task;Object.keys(x).some(_=>x[_]!==k[_])&&s(_=>({..._,task:x}))},[e,l.open,(wo=l.task)==null?void 0:wo.id]),te.default.useEffect(()=>{function x(k){var pe,me,ae;let D=(pe=k.target)==null?void 0:pe.tagName,_=D==="INPUT"||D==="TEXTAREA"||((me=k.target)==null?void 0:me.isContentEditable);if(k.key==="Escape"){if(y.open){C(oe=>({...oe,open:!1}));return}if(l.open){s(oe=>({...oe,open:!1}));return}if(m){g(!1);return}}if(!_&&((k.key==="?"||k.key==="/"&&k.shiftKey)&&((ae=document.getElementById("header-shortcuts-hint"))==null||ae.click()),k.altKey&&!k.ctrlKey&&!k.metaKey&&(k.key==="n"||k.key==="N")&&(k.preventDefault(),na(null,"details")),k.altKey&&!k.ctrlKey&&!k.metaKey&&(k.key==="f"||k.key==="F"))){k.preventDefault();let oe=document.getElementById("global-search");oe==null||oe.focus(),oe==null||oe.select()}}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[y.open,l.open,m]);function rt(x,k,D,_,pe){let me=new Date().toISOString(),ae=Zm[k]??k,oe=Zm[D]??D,He=Date.now()-3e3;ra(Me=>Me.some(E=>E.taskId===x&&E.to===oe&&new Date(E.timestamp).getTime()>He)?Me:[...Me,{taskId:x,field:"status",from:ae,to:oe,actor:_,timestamp:me,source:pe}].slice(-500))}async function vt(){try{let x=await ht.getTasks();at.current=x.tasks??[],t(x.tasks??[])}catch{}finally{r(!1)}}let zn=te.default.useCallback((x,k,D)=>{let _=String(x.id??"");if(!_)return;let pe=x.created??x.createdAt,me=x.updated?String(x.updated):void 0,ae=Array.isArray(x.comments)?x.comments.filter(Te=>!Te.deleted).length:void 0,oe=Array.isArray(x.files)?x.files.length:void 0,He=x.status?String(x.status):void 0,Me=at.current.find(Te=>Te.id===_);He&&Me&&Me.status!==He&&rt(_,Me.status,He,k??"Someone",D),t(Te=>{let E=Te.find(yt=>yt.id===_),_e={id:_,title:x.title?String(x.title):(E==null?void 0:E.title)??"Untitled",description:x.description==null?(E==null?void 0:E.description)??"":String(x.description),status:He??(E==null?void 0:E.status)??"todo",type:x.type?String(x.type):E==null?void 0:E.type,priority:x.priority?String(x.priority):E==null?void 0:E.priority,selector:x.selector?String(x.selector):E==null?void 0:E.selector,cssSelector:x.cssSelector?String(x.cssSelector):E==null?void 0:E.cssSelector,file:x.file?String(x.file):E==null?void 0:E.file,line:typeof x.line=="number"?x.line:E==null?void 0:E.line,col:typeof x.col=="number"?x.col:E==null?void 0:E.col,component:x.component?String(x.component):E==null?void 0:E.component,url:x.url?String(x.url):E==null?void 0:E.url,reportBack:x.reportBack===!0||(E==null?void 0:E.reportBack)===!0,commit:x.commit?String(x.commit):E==null?void 0:E.commit,commits:Array.isArray(x.commits)?x.commits:E==null?void 0:E.commits,commentCount:ae??(E==null?void 0:E.commentCount),fileCount:oe??(E==null?void 0:E.fileCount),createdAt:pe?String(pe):(E==null?void 0:E.createdAt)??new Date().toISOString(),updatedAt:me??(E==null?void 0:E.updatedAt),author:x.author?String(x.author):E==null?void 0:E.author,tags:Array.isArray(x.tags)?x.tags:E==null?void 0:E.tags,sortKey:x.sortKey?String(x.sortKey):E==null?void 0:E.sortKey},la=Te.filter(yt=>yt.id!==_);return la.push(_e),la.sort((yt,La)=>{let Mr=new Date(yt.updatedAt??yt.createdAt??"").getTime(),Kn=new Date(La.updatedAt??La.createdAt??"").getTime();return Mr===Kn?yt.id.localeCompare(La.id):Kn-Mr}),at.current=la,la})},[]);async function Ya(){try{let x=await ht.getProject();x.name&&R(x.name),x.gitUserName&&N(x.gitUserName)}catch{}}async function oa(){try{let x=await fetch("/api/github-url").then(k=>k.json());J(x.githubUrl??null)}catch{}}async function Ds(){var pe;let x=Gm(),k=Jm,D=null;if(k||(D=await Ms(),k=((pe=D[0])==null?void 0:pe.version)??""),!k)return;if(!x){Rs(k);return}if(!Km(x,k))return;let _=D??await Ms();if(_.length===0){Rs(k);return}v({open:!0,startMode:"whatsnew",sections:_,version:k})}async function Nn(){var D;let x=p.sections.length?p.sections:await Ms(),k=Jm||((D=x[0])==null?void 0:D.version)||p.version;v({open:!0,startMode:"full",sections:x,version:k})}function Es(){p.version&&Rs(p.version),v(x=>({...x,open:!1}))}async function Un(){var x;try{let D=await ht.getSettings();Mt(D),(x=D.visibleCols)!=null&&x.length&&S(D.visibleCols),D.viewMode&&d(D.viewMode),D.panelWidth&&D.panelWidth>=280&&D.panelWidth<=900&&c(D.panelWidth)}catch{}}async function Fs(){try{let x=await ht.getCopilotStatus();x!=null&&x.authenticated&&(x!=null&&x.username)?ie(`Copilot: ${x.username}`):ie("Copilot: not logged in")}catch{}}function Co(){let k=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,D=new WebSocket(k);At.current=D,D.addEventListener("open",()=>{$(!0),ue(!0),Cr.current=0,vt()}),D.addEventListener("close",()=>{$(!1),xt.current&&clearTimeout(xt.current),xt.current=setTimeout(Co,2e3)}),D.addEventListener("error",()=>{}),D.addEventListener("message",pe=>{var me;try{let ae=JSON.parse(pe.data);if(ae.type==="tasks-updated"||(me=ae.type)!=null&&me.startsWith("task:")){vt();return}if(ae.type==="task-changed"&&ae.task){let oe=ae.task,He=typeof oe.alteredBy=="string"?oe.alteredBy:typeof oe.author=="string"?oe.author:"Someone",Me=ae.source==="cli"?"cli":void 0;zn(oe,He,Me);return}if(ae.type==="task-deleted"&&ae.taskId){let oe=String(ae.taskId);t(He=>{let Me=He.filter(Te=>Te.id!==oe);return at.current=Me,Me})}}catch{}});let _=setInterval(()=>{D.readyState===WebSocket.OPEN&&D.send(JSON.stringify({type:"ping"}))},2e4);D.addEventListener("close",()=>clearInterval(_)),D.addEventListener("error",()=>{})}async function Dt(x,k){let D=at.current.find(_=>_.id===x);t(_=>{let pe=_.map(me=>me.id===x?{...me,...k}:me);return at.current=pe,pe}),k.status&&(D!=null&&D.status)&&k.status!==D.status&&rt(x,D.status,k.status,X);try{let _=await ht.updateTask(x,k);_.task&&t(pe=>{let me=pe.map(ae=>ae.id===x?_.task:ae);return at.current=me,me})}catch{vt()}}async function br(x,k,D,_,pe){let me=at.current.filter(Me=>Me.status===k).sort(vn),ae=nd(me,x,D,_),oe=pe??ae.newSortKey,He=ae.normalizationPatches;t(Me=>{let Te=new Map;for(let{id:_e,sortKey:la}of He)Te.set(_e,{sortKey:la});Te.set(x,{status:k,sortKey:oe});let E=Me.map(_e=>Te.has(_e.id)?{..._e,...Te.get(_e.id)}:_e);return at.current=E,E}),await ht.updateTask(x,{status:k,sortKey:oe}).catch(()=>{vt()})}async function Bs(x){t(k=>{let D=k.filter(_=>_.id!==x);return at.current=D,D});try{await ht.deleteTask(x)}catch{vt()}}async function Hn(x){var k,D;try{let _=await ht.createTask(x);return await vt(),(k=_==null?void 0:_.task)!=null&&k.id&&x.selector&&$m(_.task.id,x.selector),(D=_==null?void 0:_.task)==null?void 0:D.id}catch{}}function na(x,k="details",D){ya([]),s({open:!0,task:x,tab:k,addColumnId:D})}function _n(){ya(x=>{if(x.length===0)return x;let k=x[x.length-1],D=x.slice(0,-1);return Io.current=!0,Vt.current=null,window.location.hash=`#task-${k.id}`,s(_=>({..._,open:!0,task:k,tab:"details"})),D})}function qn(x,k){if(k.startsWith("/")&&!k.startsWith("//")||k.startsWith(window.location.origin+"/")){if(/\\.html?$/i.test(x)){window.open(k,"_blank","noopener,noreferrer");return}C({open:!0,name:x,url:k})}}let Wn=Qv(e,b,L.toLowerCase()),Os=window.location.origin,$n=te.default.useMemo(()=>{let x=new Set;return e.forEach(k=>(k.tags??[]).forEach(D=>x.add(D))),Array.from(x).sort()},[e]),Vn=te.default.useMemo(()=>{var k;let x=(k=l.task)==null?void 0:k.id;return x?kr.filter(D=>D.taskId===x).map(({field:D,from:_,to:pe,actor:me,timestamp:ae,source:oe})=>({field:D,from:_,to:pe,actor:me,timestamp:ae,source:oe})):[]},[(Rr=l.task)==null?void 0:Rr.id,kr]),Pr=te.default.useMemo(()=>{let x=e;return h.status!=="all"&&(x=x.filter(k=>k.status===h.status)),h.component&&(x=x.filter(k=>k.component===h.component)),h.type&&(x=x.filter(k=>k.type===h.type)),h.user&&(x=x.filter(k=>k.author===h.user)),h.tags&&h.tags.length>0&&(x=x.filter(k=>h.tags.every(D=>(k.tags??[]).includes(D)))),x},[e,h]),Tr=Y&&!H;return(0,j.jsxs)(j.Fragment,{children:[Gv&&!o&&(0,j.jsx)(Xv,{onClose:tg?()=>n(!0):void 0}),(0,j.jsx)(fd,{projectName:B,missingProjectIconStyle:"vibeflow",wsConnected:H,port:Kv,searchQuery:L,filterTags:h.tags,allTags:$n,onToggleTag:x=>{let k=h.tags??[],D=k.includes(x)?k.filter(_=>_!==x):[...k,x];P(_=>({..._,tags:D}))},premiumUsage:Z,isLoading:a,taskSummary:Wn,onSearchChange:w,onSettings:()=>g(!0),extraActions:(0,j.jsx)("button",{id:"changelog-btn",onClick:()=>{Nn()},title:"View changelog",style:{fontSize:12,color:"var(--p-text-m)",background:"transparent",border:"1px solid var(--p-border)",borderRadius:8,padding:"5px 10px",cursor:"pointer",whiteSpace:"nowrap"},children:"Changelog"})}),(0,j.jsx)(Sd,{tasks:e,filter:h,view:u,onFilter:P,onViewChange:x=>{d(x),ht.saveSettings({...Oe,viewMode:x}),Mt(k=>({...k,viewMode:x}))}}),(0,j.jsxs)("div",{className:"flex flex-1 overflow-hidden",style:{minHeight:0,position:"relative"},children:[u==="list"?(0,j.jsx)(dd,{tasks:Pr,searchQuery:L,isLoading:a,onOpenPanel:(x,k)=>na(x,k),onAddTask:x=>na(null,"details",x),onDrop:(x,k)=>Dt(x,{status:k})}):(0,j.jsx)(ud,{tasks:Pr,visibleCols:b,searchQuery:L,isLoading:a,onOpenPanel:(x,k,D)=>na(x,k,D),onDrop:(x,k)=>Dt(x,{status:k}),onReorder:br}),l.open&&(0,j.jsxs)("div",{id:"detail-panel-container",style:{width:O,zIndex:i?30:10},className:i?"resizing":"",children:[(0,j.jsx)("div",{id:"detail-panel-resize-handle",onMouseDown:x=>{x.preventDefault(),f(!0),document.body.classList.add("vibeflow-resizing-panel");let k=x.clientX,D=O,_=me=>{let ae=D-(me.clientX-k);c(Math.max(360,Math.min(860,ae)))},pe=me=>{f(!1),document.body.classList.remove("vibeflow-resizing-panel");let ae=Math.max(360,Math.min(860,D-(me.clientX-k)));ht.saveSettings({...Oe,panelWidth:ae}),Mt(oe=>({...oe,panelWidth:ae})),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",pe)};window.addEventListener("mousemove",_),window.addEventListener("mouseup",pe)}}),(0,j.jsx)(Ld,{open:l.open,task:l.task,tab:l.tab,showLockIndicator:!1,addColumnId:l.addColumnId,gitUserName:X,githubUrl:re,baseUrl:Os,isResizing:i,api:ht,onClose:()=>{ya([]),s(x=>({...x,open:!1}))},onSave:async x=>{l.task&&await Dt(l.task.id,x),s(k=>({...k,open:!1}))},onCreate:async x=>{let k=await Hn(x);return s(D=>({...D,open:!1})),k},onDelete:async x=>{await Bs(x),s(k=>({...k,open:!1}))},onPatch:Dt,onFilePreview:qn,onGoBack:wr.length>0?_n:void 0,navBackLabel:wr.length>0?wr[wr.length-1].title:void 0,externalLocalChanges:Vn,allTasks:e,createBranch:Oe.createBranch})]})]}),Tr&&(0,eg.createPortal)((0,j.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,j.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,j.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,j.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,j.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),(0,j.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--p-text)"},children:"Connection Lost"})]}),(0,j.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,j.jsx)(Id,{open:m,visibleCols:b,settings:Oe,onClose:()=>g(!1),onSave:(x,k)=>{S(x);let D={...Oe,...k,visibleCols:x};Mt(D),ht.saveSettings(D)}}),(0,j.jsx)(Cd,{open:y.open,name:y.name,url:y.url,onClose:()=>C(x=>({...x,open:!1}))}),(0,j.jsx)(Qm,{open:p.open,sections:p.sections,version:p.version,startMode:p.startMode,onClose:Es})]})}var ng=M(W(),1),rg=document.getElementById("root");rg&&(0,og.createRoot)(rg).render((0,ng.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/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/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/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/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/tag.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 oa=aa(import.meta.url),ia=ra(oa),la=[yt(ia,"kanban-template.html"),yt(process.cwd(),"src","server","kanban-template.html"),yt(process.cwd(),"dist","server","kanban-template.html")];function sa(t){let e=la.find(n=>ta(n));if(!e)throw new Error("kanban-template.html not found in expected locations");return na(e,"utf8").replaceAll("__PORT__",String(t))}function ca(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 ua="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiByeD0iNCIgZmlsbD0iIzI1NjNlYiIvPjxyZWN0IHg9IjIuNSIgeT0iNSIgd2lkdGg9IjIiIGhlaWdodD0iOCIgcng9IjEiIGZpbGw9IndoaXRlIiBvcGFjaXR5PSIwLjciLz48cmVjdCB4PSI2LjUiIHk9IjIiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiByeD0iMSIgZmlsbD0id2hpdGUiLz48cmVjdCB4PSIxMC41IiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSI2IiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuNyIvPjxyZWN0IHg9IjE0LjUiIHk9IjQiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuODUiLz48L3N2Zz4=";function da(t){return`<!DOCTYPE html>
1699
+ `+it}function hn(t){return`var PROTO_CONFIG = ${JSON.stringify({port:0,wsUrl:"",apiUrl:`${t}/api/overlay/tasks`,pagesUrl:"",screenshotsUrl:""})};
1700
+ `+it}import{existsSync as Yr,readFileSync as Gr}from"fs";import{dirname as Qr,join as ct}from"path";import{fileURLToPath as Xr}from"url";var vn=`*,: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: }
1701
+ /*! 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}.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-red-400{--tw-text-opacity:1;color:rgb(248 113 113/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}.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)}.blur,.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;display:flex;flex-direction:column;gap:5px;padding-bottom:8px}.column-scroll[data-status=done]{overflow-y:hidden}.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;display:flex;flex-direction:column;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;display:flex;flex-direction:column}.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 st='"use strict";(()=>{var Lg=Object.create;var Rd=Object.defineProperty;var Sg=Object.getOwnPropertyDescriptor;var Ig=Object.getOwnPropertyNames;var Cg=Object.getPrototypeOf,wg=Object.prototype.hasOwnProperty;var sa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var kg=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ig(t))!wg.call(e,o)&&o!==a&&Rd(e,o,{get:()=>t[o],enumerable:!(r=Sg(t,o))||r.enumerable});return e};var A=(e,t,a)=>(a=e!=null?Lg(Cg(e)):{},kg(t||!e||!e.__esModule?Rd(a,"default",{value:e,enumerable:!0}):a,e));var _d=sa(ne=>{"use strict";var ko=Symbol.for("react.element"),bg=Symbol.for("react.portal"),Pg=Symbol.for("react.fragment"),Tg=Symbol.for("react.strict_mode"),Rg=Symbol.for("react.profiler"),Mg=Symbol.for("react.provider"),Ag=Symbol.for("react.context"),Dg=Symbol.for("react.forward_ref"),Eg=Symbol.for("react.suspense"),Fg=Symbol.for("react.memo"),Bg=Symbol.for("react.lazy"),Md=Symbol.iterator;function Og(e){return e===null||typeof e!="object"?null:(e=Md&&e[Md]||e["@@iterator"],typeof e=="function"?e:null)}var Ed={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fd=Object.assign,Bd={};function Rr(e,t,a){this.props=e,this.context=t,this.refs=Bd,this.updater=a||Ed}Rr.prototype.isReactComponent={};Rr.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")};Rr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Od(){}Od.prototype=Rr.prototype;function Ns(e,t,a){this.props=e,this.context=t,this.refs=Bd,this.updater=a||Ed}var Hs=Ns.prototype=new Od;Hs.constructor=Ns;Fd(Hs,Rr.prototype);Hs.isPureReactComponent=!0;var Ad=Array.isArray,zd=Object.prototype.hasOwnProperty,Us={current:null},Nd={key:!0,ref:!0,__self:!0,__source:!0};function Hd(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)zd.call(t,r)&&!Nd.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=a;else if(1<s){for(var u=Array(s),d=0;d<s;d++)u[d]=arguments[d+2];o.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)o[r]===void 0&&(o[r]=s[r]);return{$$typeof:ko,type:e,key:n,ref:l,props:o,_owner:Us.current}}function zg(e,t){return{$$typeof:ko,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _s(e){return typeof e=="object"&&e!==null&&e.$$typeof===ko}function Ng(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var Dd=/\\/+/g;function zs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ng(""+e.key):t.toString(36)}function Qn(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 ko:case bg:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+zs(l,0):r,Ad(o)?(a="",e!=null&&(a=e.replace(Dd,"$&/")+"/"),Qn(o,t,a,"",function(d){return d})):o!=null&&(_s(o)&&(o=zg(o,a+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(Dd,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",Ad(e))for(var s=0;s<e.length;s++){n=e[s];var u=r+zs(n,s);l+=Qn(n,t,a,u,o)}else if(u=Og(e),typeof u=="function")for(e=u.call(e),s=0;!(n=e.next()).done;)n=n.value,u=r+zs(n,s++),l+=Qn(n,t,a,u,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 Xn(e,t,a){if(e==null)return e;var r=[],o=0;return Qn(e,r,"","",function(n){return t.call(a,n,o++)}),r}function Hg(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 Qe={current:null},Yn={transition:null},Ug={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:Yn,ReactCurrentOwner:Us};function Ud(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:Xn,forEach:function(e,t,a){Xn(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Xn(e,function(){t++}),t},toArray:function(e){return Xn(e,function(t){return t})||[]},only:function(e){if(!_s(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ne.Component=Rr;ne.Fragment=Pg;ne.Profiler=Rg;ne.PureComponent=Ns;ne.StrictMode=Tg;ne.Suspense=Eg;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ug;ne.act=Ud;ne.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=Fd({},e.props),o=e.key,n=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,l=Us.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(u in t)zd.call(t,u)&&!Nd.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&s!==void 0?s[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=a;else if(1<u){s=Array(u);for(var d=0;d<u;d++)s[d]=arguments[d+2];r.children=s}return{$$typeof:ko,type:e.type,key:o,ref:n,props:r,_owner:l}};ne.createContext=function(e){return e={$$typeof:Ag,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Mg,_context:e},e.Consumer=e};ne.createElement=Hd;ne.createFactory=function(e){var t=Hd.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:Dg,render:e}};ne.isValidElement=_s;ne.lazy=function(e){return{$$typeof:Bg,_payload:{_status:-1,_result:e},_init:Hg}};ne.memo=function(e,t){return{$$typeof:Fg,type:e,compare:t===void 0?null:t}};ne.startTransition=function(e){var t=Yn.transition;Yn.transition={};try{e()}finally{Yn.transition=t}};ne.unstable_act=Ud;ne.useCallback=function(e,t){return Qe.current.useCallback(e,t)};ne.useContext=function(e){return Qe.current.useContext(e)};ne.useDebugValue=function(){};ne.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};ne.useEffect=function(e,t){return Qe.current.useEffect(e,t)};ne.useId=function(){return Qe.current.useId()};ne.useImperativeHandle=function(e,t,a){return Qe.current.useImperativeHandle(e,t,a)};ne.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};ne.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};ne.useMemo=function(e,t){return Qe.current.useMemo(e,t)};ne.useReducer=function(e,t,a){return Qe.current.useReducer(e,t,a)};ne.useRef=function(e){return Qe.current.useRef(e)};ne.useState=function(e){return Qe.current.useState(e)};ne.useSyncExternalStore=function(e,t,a){return Qe.current.useSyncExternalStore(e,t,a)};ne.useTransition=function(){return Qe.current.useTransition()};ne.version="18.3.1"});var Se=sa((ey,qd)=>{"use strict";qd.exports=_d()});var Jd=sa(ye=>{"use strict";function Vs(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Jn(o,t))e[r]=t,e[a]=o,a=r;else break e}}function Bt(e){return e.length===0?null:e[0]}function el(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],u=l+1,d=e[u];if(0>Jn(s,a))u<o&&0>Jn(d,s)?(e[r]=d,e[u]=a,r=u):(e[r]=s,e[l]=a,r=l);else if(u<o&&0>Jn(d,a))e[r]=d,e[u]=a,r=u;else break e}}return t}function Jn(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Wd=performance,ye.unstable_now=function(){return Wd.now()}):(qs=Date,$d=qs.now(),ye.unstable_now=function(){return qs.now()-$d});var Wd,qs,$d,jt=[],Ia=[],_g=1,It=null,$e=3,tl=!1,er=!1,Po=!1,Gd=typeof setTimeout=="function"?setTimeout:null,jd=typeof clearTimeout=="function"?clearTimeout:null,Vd=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ks(e){for(var t=Bt(Ia);t!==null;){if(t.callback===null)el(Ia);else if(t.startTime<=e)el(Ia),t.sortIndex=t.expirationTime,Vs(jt,t);else break;t=Bt(Ia)}}function Gs(e){if(Po=!1,Ks(e),!er)if(Bt(jt)!==null)er=!0,Xs(js);else{var t=Bt(Ia);t!==null&&Qs(Gs,t.startTime-e)}}function js(e,t){er=!1,Po&&(Po=!1,jd(To),To=-1),tl=!0;var a=$e;try{for(Ks(t),It=Bt(jt);It!==null&&(!(It.expirationTime>t)||e&&!Yd());){var r=It.callback;if(typeof r=="function"){It.callback=null,$e=It.priorityLevel;var o=r(It.expirationTime<=t);t=ye.unstable_now(),typeof o=="function"?It.callback=o:It===Bt(jt)&&el(jt),Ks(t)}else el(jt);It=Bt(jt)}if(It!==null)var n=!0;else{var l=Bt(Ia);l!==null&&Qs(Gs,l.startTime-t),n=!1}return n}finally{It=null,$e=a,tl=!1}}var al=!1,Zn=null,To=-1,Xd=5,Qd=-1;function Yd(){return!(ye.unstable_now()-Qd<Xd)}function Ws(){if(Zn!==null){var e=ye.unstable_now();Qd=e;var t=!0;try{t=Zn(!0,e)}finally{t?bo():(al=!1,Zn=null)}}else al=!1}var bo;typeof Vd=="function"?bo=function(){Vd(Ws)}:typeof MessageChannel<"u"?($s=new MessageChannel,Kd=$s.port2,$s.port1.onmessage=Ws,bo=function(){Kd.postMessage(null)}):bo=function(){Gd(Ws,0)};var $s,Kd;function Xs(e){Zn=e,al||(al=!0,bo())}function Qs(e,t){To=Gd(function(){e(ye.unstable_now())},t)}ye.unstable_IdlePriority=5;ye.unstable_ImmediatePriority=1;ye.unstable_LowPriority=4;ye.unstable_NormalPriority=3;ye.unstable_Profiling=null;ye.unstable_UserBlockingPriority=2;ye.unstable_cancelCallback=function(e){e.callback=null};ye.unstable_continueExecution=function(){er||tl||(er=!0,Xs(js))};ye.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"):Xd=0<e?Math.floor(1e3/e):5};ye.unstable_getCurrentPriorityLevel=function(){return $e};ye.unstable_getFirstCallbackNode=function(){return Bt(jt)};ye.unstable_next=function(e){switch($e){case 1:case 2:case 3:var t=3;break;default:t=$e}var a=$e;$e=t;try{return e()}finally{$e=a}};ye.unstable_pauseExecution=function(){};ye.unstable_requestPaint=function(){};ye.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=$e;$e=e;try{return t()}finally{$e=a}};ye.unstable_scheduleCallback=function(e,t,a){var r=ye.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:_g++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Vs(Ia,e),Bt(jt)===null&&e===Bt(Ia)&&(Po?(jd(To),To=-1):Po=!0,Qs(Gs,a-r))):(e.sortIndex=o,Vs(jt,e),er||tl||(er=!0,Xs(js))),e};ye.unstable_shouldYield=Yd;ye.unstable_wrapCallback=function(e){var t=$e;return function(){var a=$e;$e=t;try{return e.apply(this,arguments)}finally{$e=a}}}});var ef=sa((ay,Zd)=>{"use strict";Zd.exports=Jd()});var nm=sa(Lt=>{"use strict";var qg=Se(),vt=ef();function R(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 uc=new Set,Qo={};function pr(e,t){Qr(e,t),Qr(e+"Capture",t)}function Qr(e,t){for(Qo[e]=t,e=0;e<t.length;e++)uc.add(t[e])}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yu=Object.prototype.hasOwnProperty,Wg=/^[: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]*$/,tf={},af={};function $g(e){return yu.call(af,e)?!0:yu.call(tf,e)?!1:Wg.test(e)?af[e]=!0:(tf[e]=!0,!1)}function Vg(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 Kg(e,t,a,r){if(t===null||typeof t>"u"||Vg(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 Ze(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 _e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_e[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_e[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_e[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_e[e]=new Ze(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){_e[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_e[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_e[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_e[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_e[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var fi=/[\\-:]([a-z])/g;function ci(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(fi,ci);_e[t]=new Ze(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(fi,ci);_e[t]=new Ze(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(fi,ci);_e[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_e[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});_e.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_e[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function pi(e,t,a,r){var o=_e.hasOwnProperty(t)?_e[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Kg(t,a,o,r)&&(a=null),r||o===null?$g(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 xa=qg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,rl=Symbol.for("react.element"),Dr=Symbol.for("react.portal"),Er=Symbol.for("react.fragment"),mi=Symbol.for("react.strict_mode"),Lu=Symbol.for("react.profiler"),ic=Symbol.for("react.provider"),dc=Symbol.for("react.context"),gi=Symbol.for("react.forward_ref"),Su=Symbol.for("react.suspense"),Iu=Symbol.for("react.suspense_list"),hi=Symbol.for("react.memo"),wa=Symbol.for("react.lazy"),fc=Symbol.for("react.offscreen"),rf=Symbol.iterator;function Ro(e){return e===null||typeof e!="object"?null:(e=rf&&e[rf]||e["@@iterator"],typeof e=="function"?e:null)}var Pe=Object.assign,Ys;function zo(e){if(Ys===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\\n( *(at )?)/);Ys=t&&t[1]||""}return`\n`+Ys+e}var Js=!1;function Zs(e,t){if(!e||Js)return"";Js=!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 u=`\n`+o[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=s);break}}}finally{Js=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?zo(e):""}function Gg(e){switch(e.tag){case 5:return zo(e.type);case 16:return zo("Lazy");case 13:return zo("Suspense");case 19:return zo("SuspenseList");case 0:case 2:case 15:return e=Zs(e.type,!1),e;case 11:return e=Zs(e.type.render,!1),e;case 1:return e=Zs(e.type,!0),e;default:return""}}function Cu(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 Er:return"Fragment";case Dr:return"Portal";case Lu:return"Profiler";case mi:return"StrictMode";case Su:return"Suspense";case Iu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case dc:return(e.displayName||"Context")+".Consumer";case ic:return(e._context.displayName||"Context")+".Provider";case gi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hi:return t=e.displayName||null,t!==null?t:Cu(e.type)||"Memo";case wa:t=e._payload,e=e._init;try{return Cu(e(t))}catch{}}return null}function jg(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 Cu(t);case 8:return t===mi?"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 Na(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xg(e){var t=cc(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 ol(e){e._valueTracker||(e._valueTracker=Xg(e))}function pc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=cc(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function Dl(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 wu(e,t){var a=t.checked;return Pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function of(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Na(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 mc(e,t){t=t.checked,t!=null&&pi(e,"checked",t,!1)}function ku(e,t){mc(e,t);var a=Na(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")?bu(e,t.type,a):t.hasOwnProperty("defaultValue")&&bu(e,t.type,Na(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nf(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 bu(e,t,a){(t!=="number"||Dl(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var No=Array.isArray;function $r(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=""+Na(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 Pu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(R(91));return Pe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function lf(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(R(92));if(No(a)){if(1<a.length)throw Error(R(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Na(a)}}function gc(e,t){var a=Na(t.value),r=Na(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 sf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function hc(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 Tu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?hc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var nl,xc=(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(nl=nl||document.createElement("div"),nl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=nl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yo(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var _o={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},Qg=["Webkit","ms","Moz","O"];Object.keys(_o).forEach(function(e){Qg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_o[t]=_o[e]})});function vc(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||_o.hasOwnProperty(e)&&_o[e]?(""+t).trim():t+"px"}function yc(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=vc(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var Yg=Pe({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 Ru(e,t){if(t){if(Yg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function Mu(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 Au=null;function xi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Du=null,Vr=null,Kr=null;function uf(e){if(e=hn(e)){if(typeof Du!="function")throw Error(R(280));var t=e.stateNode;t&&(t=ls(t),Du(e.stateNode,e.type,t))}}function Lc(e){Vr?Kr?Kr.push(e):Kr=[e]:Vr=e}function Sc(){if(Vr){var e=Vr,t=Kr;if(Kr=Vr=null,uf(e),t)for(e=0;e<t.length;e++)uf(t[e])}}function Ic(e,t){return e(t)}function Cc(){}var eu=!1;function wc(e,t,a){if(eu)return e(t,a);eu=!0;try{return Ic(e,t,a)}finally{eu=!1,(Vr!==null||Kr!==null)&&(Cc(),Sc())}}function Jo(e,t){var a=e.stateNode;if(a===null)return null;var r=ls(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(R(231,t,typeof a));return a}var Eu=!1;if(pa)try{Mr={},Object.defineProperty(Mr,"passive",{get:function(){Eu=!0}}),window.addEventListener("test",Mr,Mr),window.removeEventListener("test",Mr,Mr)}catch{Eu=!1}var Mr;function Jg(e,t,a,r,o,n,l,s,u){var d=Array.prototype.slice.call(arguments,3);try{t.apply(a,d)}catch(g){this.onError(g)}}var qo=!1,El=null,Fl=!1,Fu=null,Zg={onError:function(e){qo=!0,El=e}};function eh(e,t,a,r,o,n,l,s,u){qo=!1,El=null,Jg.apply(Zg,arguments)}function th(e,t,a,r,o,n,l,s,u){if(eh.apply(this,arguments),qo){if(qo){var d=El;qo=!1,El=null}else throw Error(R(198));Fl||(Fl=!0,Fu=d)}}function mr(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 kc(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 df(e){if(mr(e)!==e)throw Error(R(188))}function ah(e){var t=e.alternate;if(!t){if(t=mr(e),t===null)throw Error(R(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 df(o),e;if(n===r)return df(o),t;n=n.sibling}throw Error(R(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(R(189))}}if(a.alternate!==r)throw Error(R(190))}if(a.tag!==3)throw Error(R(188));return a.stateNode.current===a?e:t}function bc(e){return e=ah(e),e!==null?Pc(e):null}function Pc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Pc(e);if(t!==null)return t;e=e.sibling}return null}var Tc=vt.unstable_scheduleCallback,ff=vt.unstable_cancelCallback,rh=vt.unstable_shouldYield,oh=vt.unstable_requestPaint,Me=vt.unstable_now,nh=vt.unstable_getCurrentPriorityLevel,vi=vt.unstable_ImmediatePriority,Rc=vt.unstable_UserBlockingPriority,Bl=vt.unstable_NormalPriority,lh=vt.unstable_LowPriority,Mc=vt.unstable_IdlePriority,as=null,Jt=null;function sh(e){if(Jt&&typeof Jt.onCommitFiberRoot=="function")try{Jt.onCommitFiberRoot(as,e,void 0,(e.current.flags&128)===128)}catch{}}var Ut=Math.clz32?Math.clz32:dh,uh=Math.log,ih=Math.LN2;function dh(e){return e>>>=0,e===0?32:31-(uh(e)/ih|0)|0}var ll=64,sl=4194304;function Ho(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 Ol(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=Ho(s):(n&=l,n!==0&&(r=Ho(n)))}else l=a&~o,l!==0?r=Ho(l):n!==0&&(r=Ho(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-Ut(t),o=1<<a,r|=e[a],t&=~o;return r}function fh(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 ch(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var l=31-Ut(n),s=1<<l,u=o[l];u===-1?((s&a)===0||(s&r)!==0)&&(o[l]=fh(s,t)):u<=t&&(e.expiredLanes|=s),n&=~s}}function Bu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ac(){var e=ll;return ll<<=1,(ll&4194240)===0&&(ll=64),e}function tu(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function mn(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ut(t),e[t]=a}function ph(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-Ut(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function yi(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Ut(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var xe=0;function Dc(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ec,Li,Fc,Bc,Oc,Ou=!1,ul=[],Ma=null,Aa=null,Da=null,Zo=new Map,en=new Map,ba=[],mh="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 cf(e,t){switch(e){case"focusin":case"focusout":Ma=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":Zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":en.delete(t.pointerId)}}function Mo(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=hn(t),t!==null&&Li(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function gh(e,t,a,r,o){switch(t){case"focusin":return Ma=Mo(Ma,e,t,a,r,o),!0;case"dragenter":return Aa=Mo(Aa,e,t,a,r,o),!0;case"mouseover":return Da=Mo(Da,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return Zo.set(n,Mo(Zo.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,en.set(n,Mo(en.get(n)||null,e,t,a,r,o)),!0}return!1}function zc(e){var t=rr(e.target);if(t!==null){var a=mr(t);if(a!==null){if(t=a.tag,t===13){if(t=kc(a),t!==null){e.blockedOn=t,Oc(e.priority,function(){Fc(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 Il(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=zu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Au=r,a.target.dispatchEvent(r),Au=null}else return t=hn(a),t!==null&&Li(t),e.blockedOn=a,!1;t.shift()}return!0}function pf(e,t,a){Il(e)&&a.delete(t)}function hh(){Ou=!1,Ma!==null&&Il(Ma)&&(Ma=null),Aa!==null&&Il(Aa)&&(Aa=null),Da!==null&&Il(Da)&&(Da=null),Zo.forEach(pf),en.forEach(pf)}function Ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Ou||(Ou=!0,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,hh)))}function tn(e){function t(o){return Ao(o,e)}if(0<ul.length){Ao(ul[0],e);for(var a=1;a<ul.length;a++){var r=ul[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Ma!==null&&Ao(Ma,e),Aa!==null&&Ao(Aa,e),Da!==null&&Ao(Da,e),Zo.forEach(t),en.forEach(t),a=0;a<ba.length;a++)r=ba[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<ba.length&&(a=ba[0],a.blockedOn===null);)zc(a),a.blockedOn===null&&ba.shift()}var Gr=xa.ReactCurrentBatchConfig,zl=!0;function xh(e,t,a,r){var o=xe,n=Gr.transition;Gr.transition=null;try{xe=1,Si(e,t,a,r)}finally{xe=o,Gr.transition=n}}function vh(e,t,a,r){var o=xe,n=Gr.transition;Gr.transition=null;try{xe=4,Si(e,t,a,r)}finally{xe=o,Gr.transition=n}}function Si(e,t,a,r){if(zl){var o=zu(e,t,a,r);if(o===null)uu(e,t,r,Nl,a),cf(e,r);else if(gh(o,e,t,a,r))r.stopPropagation();else if(cf(e,r),t&4&&-1<mh.indexOf(e)){for(;o!==null;){var n=hn(o);if(n!==null&&Ec(n),n=zu(e,t,a,r),n===null&&uu(e,t,r,Nl,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else uu(e,t,r,null,a)}}var Nl=null;function zu(e,t,a,r){if(Nl=null,e=xi(r),e=rr(e),e!==null)if(t=mr(e),t===null)e=null;else if(a=t.tag,a===13){if(e=kc(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 Nl=e,null}function Nc(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(nh()){case vi:return 1;case Rc:return 4;case Bl:case lh:return 16;case Mc:return 536870912;default:return 16}default:return 16}}var Ta=null,Ii=null,Cl=null;function Hc(){if(Cl)return Cl;var e,t=Ii,a=t.length,r,o="value"in Ta?Ta.value:Ta.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 Cl=o.slice(e,1<r?1-r:void 0)}function wl(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 il(){return!0}function mf(){return!1}function yt(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)?il:mf,this.isPropagationStopped=mf,this}return Pe(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=il)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=il)},persist:function(){},isPersistent:il}),t}var ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ci=yt(ro),gn=Pe({},ro,{view:0,detail:0}),yh=yt(gn),au,ru,Do,rs=Pe({},gn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wi,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!==Do&&(Do&&e.type==="mousemove"?(au=e.screenX-Do.screenX,ru=e.screenY-Do.screenY):ru=au=0,Do=e),au)},movementY:function(e){return"movementY"in e?e.movementY:ru}}),gf=yt(rs),Lh=Pe({},rs,{dataTransfer:0}),Sh=yt(Lh),Ih=Pe({},gn,{relatedTarget:0}),ou=yt(Ih),Ch=Pe({},ro,{animationName:0,elapsedTime:0,pseudoElement:0}),wh=yt(Ch),kh=Pe({},ro,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bh=yt(kh),Ph=Pe({},ro,{data:0}),hf=yt(Ph),Th={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Rh={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"},Mh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ah(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mh[e])?!!t[e]:!1}function wi(){return Ah}var Dh=Pe({},gn,{key:function(e){if(e.key){var t=Th[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=wl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Rh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wi,charCode:function(e){return e.type==="keypress"?wl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?wl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Eh=yt(Dh),Fh=Pe({},rs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xf=yt(Fh),Bh=Pe({},gn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wi}),Oh=yt(Bh),zh=Pe({},ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nh=yt(zh),Hh=Pe({},rs,{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}),Uh=yt(Hh),_h=[9,13,27,32],ki=pa&&"CompositionEvent"in window,Wo=null;pa&&"documentMode"in document&&(Wo=document.documentMode);var qh=pa&&"TextEvent"in window&&!Wo,Uc=pa&&(!ki||Wo&&8<Wo&&11>=Wo),vf=" ",yf=!1;function _c(e,t){switch(e){case"keyup":return _h.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fr=!1;function Wh(e,t){switch(e){case"compositionend":return qc(t);case"keypress":return t.which!==32?null:(yf=!0,vf);case"textInput":return e=t.data,e===vf&&yf?null:e;default:return null}}function $h(e,t){if(Fr)return e==="compositionend"||!ki&&_c(e,t)?(e=Hc(),Cl=Ii=Ta=null,Fr=!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 Uc&&t.locale!=="ko"?null:t.data;default:return null}}var Vh={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 Lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vh[e.type]:t==="textarea"}function Wc(e,t,a,r){Lc(r),t=Hl(t,"onChange"),0<t.length&&(a=new Ci("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var $o=null,an=null;function Kh(e){ep(e,0)}function os(e){var t=zr(e);if(pc(t))return e}function Gh(e,t){if(e==="change")return t}var $c=!1;pa&&(pa?(fl="oninput"in document,fl||(nu=document.createElement("div"),nu.setAttribute("oninput","return;"),fl=typeof nu.oninput=="function"),dl=fl):dl=!1,$c=dl&&(!document.documentMode||9<document.documentMode));var dl,fl,nu;function Sf(){$o&&($o.detachEvent("onpropertychange",Vc),an=$o=null)}function Vc(e){if(e.propertyName==="value"&&os(an)){var t=[];Wc(t,an,e,xi(e)),wc(Kh,t)}}function jh(e,t,a){e==="focusin"?(Sf(),$o=t,an=a,$o.attachEvent("onpropertychange",Vc)):e==="focusout"&&Sf()}function Xh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return os(an)}function Qh(e,t){if(e==="click")return os(t)}function Yh(e,t){if(e==="input"||e==="change")return os(t)}function Jh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:Jh;function rn(e,t){if(qt(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(!yu.call(t,o)||!qt(e[o],t[o]))return!1}return!0}function If(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cf(e,t){var a=If(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=If(a)}}function Kc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gc(){for(var e=window,t=Dl();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Dl(e.document)}return t}function bi(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 Zh(e){var t=Gc(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&Kc(a.ownerDocument.documentElement,a)){if(r!==null&&bi(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=Cf(a,n);var l=Cf(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 ex=pa&&"documentMode"in document&&11>=document.documentMode,Br=null,Nu=null,Vo=null,Hu=!1;function wf(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Hu||Br==null||Br!==Dl(r)||(r=Br,"selectionStart"in r&&bi(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}),Vo&&rn(Vo,r)||(Vo=r,r=Hl(Nu,"onSelect"),0<r.length&&(t=new Ci("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Br)))}function cl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Or={animationend:cl("Animation","AnimationEnd"),animationiteration:cl("Animation","AnimationIteration"),animationstart:cl("Animation","AnimationStart"),transitionend:cl("Transition","TransitionEnd")},lu={},jc={};pa&&(jc=document.createElement("div").style,"AnimationEvent"in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),"TransitionEvent"in window||delete Or.transitionend.transition);function ns(e){if(lu[e])return lu[e];if(!Or[e])return e;var t=Or[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in jc)return lu[e]=t[a];return e}var Xc=ns("animationend"),Qc=ns("animationiteration"),Yc=ns("animationstart"),Jc=ns("transitionend"),Zc=new Map,kf="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 Ua(e,t){Zc.set(e,t),pr(t,[e])}for(pl=0;pl<kf.length;pl++)ml=kf[pl],bf=ml.toLowerCase(),Pf=ml[0].toUpperCase()+ml.slice(1),Ua(bf,"on"+Pf);var ml,bf,Pf,pl;Ua(Xc,"onAnimationEnd");Ua(Qc,"onAnimationIteration");Ua(Yc,"onAnimationStart");Ua("dblclick","onDoubleClick");Ua("focusin","onFocus");Ua("focusout","onBlur");Ua(Jc,"onTransitionEnd");Qr("onMouseEnter",["mouseout","mouseover"]);Qr("onMouseLeave",["mouseout","mouseover"]);Qr("onPointerEnter",["pointerout","pointerover"]);Qr("onPointerLeave",["pointerout","pointerover"]);pr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pr("onBeforeInput",["compositionend","keypress","textInput","paste"]);pr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uo="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(Uo));function Tf(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,th(r,t,void 0,e),e.currentTarget=null}function ep(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],u=s.instance,d=s.currentTarget;if(s=s.listener,u!==n&&o.isPropagationStopped())break e;Tf(o,s,d),n=u}else for(l=0;l<r.length;l++){if(s=r[l],u=s.instance,d=s.currentTarget,s=s.listener,u!==n&&o.isPropagationStopped())break e;Tf(o,s,d),n=u}}}if(Fl)throw e=Fu,Fl=!1,Fu=null,e}function Ie(e,t){var a=t[$u];a===void 0&&(a=t[$u]=new Set);var r=e+"__bubble";a.has(r)||(tp(t,e,2,!1),a.add(r))}function su(e,t,a){var r=0;t&&(r|=4),tp(a,e,r,t)}var gl="_reactListening"+Math.random().toString(36).slice(2);function on(e){if(!e[gl]){e[gl]=!0,uc.forEach(function(a){a!=="selectionchange"&&(tx.has(a)||su(a,!1,e),su(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[gl]||(t[gl]=!0,su("selectionchange",!1,t))}}function tp(e,t,a,r){switch(Nc(t)){case 1:var o=xh;break;case 4:o=vh;break;default:o=Si}a=o.bind(null,t,a,e),o=void 0,!Eu||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 uu(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 u=l.tag;if((u===3||u===4)&&(u=l.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;l=l.return}for(;s!==null;){if(l=rr(s),l===null)return;if(u=l.tag,u===5||u===6){r=n=l;continue e}s=s.parentNode}}r=r.return}wc(function(){var d=n,g=xi(a),m=[];e:{var c=Zc.get(e);if(c!==void 0){var y=Ci,x=e;switch(e){case"keypress":if(wl(a)===0)break e;case"keydown":case"keyup":y=Eh;break;case"focusin":x="focus",y=ou;break;case"focusout":x="blur",y=ou;break;case"beforeblur":case"afterblur":y=ou;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":y=gf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=Sh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Oh;break;case Xc:case Qc:case Yc:y=wh;break;case Jc:y=Nh;break;case"scroll":y=yh;break;case"wheel":y=Uh;break;case"copy":case"cut":case"paste":y=bh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=xf}var C=(t&4)!==0,O=!C&&e==="scroll",f=C?c!==null?c+"Capture":null:c;C=[];for(var i=d,p;i!==null;){p=i;var L=p.stateNode;if(p.tag===5&&L!==null&&(p=L,f!==null&&(L=Jo(i,f),L!=null&&C.push(nn(i,L,p)))),O)break;i=i.return}0<C.length&&(c=new y(c,x,null,a,g),m.push({event:c,listeners:C}))}}if((t&7)===0){e:{if(c=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",c&&a!==Au&&(x=a.relatedTarget||a.fromElement)&&(rr(x)||x[ma]))break e;if((y||c)&&(c=g.window===g?g:(c=g.ownerDocument)?c.defaultView||c.parentWindow:window,y?(x=a.relatedTarget||a.toElement,y=d,x=x?rr(x):null,x!==null&&(O=mr(x),x!==O||x.tag!==5&&x.tag!==6)&&(x=null)):(y=null,x=d),y!==x)){if(C=gf,L="onMouseLeave",f="onMouseEnter",i="mouse",(e==="pointerout"||e==="pointerover")&&(C=xf,L="onPointerLeave",f="onPointerEnter",i="pointer"),O=y==null?c:zr(y),p=x==null?c:zr(x),c=new C(L,i+"leave",y,a,g),c.target=O,c.relatedTarget=p,L=null,rr(g)===d&&(C=new C(f,i+"enter",x,a,g),C.target=p,C.relatedTarget=O,L=C),O=L,y&&x)t:{for(C=y,f=x,i=0,p=C;p;p=Ar(p))i++;for(p=0,L=f;L;L=Ar(L))p++;for(;0<i-p;)C=Ar(C),i--;for(;0<p-i;)f=Ar(f),p--;for(;i--;){if(C===f||f!==null&&C===f.alternate)break t;C=Ar(C),f=Ar(f)}C=null}else C=null;y!==null&&Rf(m,c,y,C,!1),x!==null&&O!==null&&Rf(m,O,x,C,!0)}}e:{if(c=d?zr(d):window,y=c.nodeName&&c.nodeName.toLowerCase(),y==="select"||y==="input"&&c.type==="file")var I=Gh;else if(Lf(c))if($c)I=Yh;else{I=Xh;var P=jh}else(y=c.nodeName)&&y.toLowerCase()==="input"&&(c.type==="checkbox"||c.type==="radio")&&(I=Qh);if(I&&(I=I(e,d))){Wc(m,I,a,g);break e}P&&P(e,c,d),e==="focusout"&&(P=c._wrapperState)&&P.controlled&&c.type==="number"&&bu(c,"number",c.value)}switch(P=d?zr(d):window,e){case"focusin":(Lf(P)||P.contentEditable==="true")&&(Br=P,Nu=d,Vo=null);break;case"focusout":Vo=Nu=Br=null;break;case"mousedown":Hu=!0;break;case"contextmenu":case"mouseup":case"dragend":Hu=!1,wf(m,a,g);break;case"selectionchange":if(ex)break;case"keydown":case"keyup":wf(m,a,g)}var v;if(ki)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Fr?_c(e,a)&&(S="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(S="onCompositionStart");S&&(Uc&&a.locale!=="ko"&&(Fr||S!=="onCompositionStart"?S==="onCompositionEnd"&&Fr&&(v=Hc()):(Ta=g,Ii="value"in Ta?Ta.value:Ta.textContent,Fr=!0)),P=Hl(d,S),0<P.length&&(S=new hf(S,e,null,a,g),m.push({event:S,listeners:P}),v?S.data=v:(v=qc(a),v!==null&&(S.data=v)))),(v=qh?Wh(e,a):$h(e,a))&&(d=Hl(d,"onBeforeInput"),0<d.length&&(g=new hf("onBeforeInput","beforeinput",null,a,g),m.push({event:g,listeners:d}),g.data=v))}ep(m,t)})}function nn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Hl(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=Jo(e,a),n!=null&&r.unshift(nn(e,n,o)),n=Jo(e,t),n!=null&&r.push(nn(e,n,o))),e=e.return}return r}function Ar(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Rf(e,t,a,r,o){for(var n=t._reactName,l=[];a!==null&&a!==r;){var s=a,u=s.alternate,d=s.stateNode;if(u!==null&&u===r)break;s.tag===5&&d!==null&&(s=d,o?(u=Jo(a,n),u!=null&&l.unshift(nn(a,u,s))):o||(u=Jo(a,n),u!=null&&l.push(nn(a,u,s)))),a=a.return}l.length!==0&&e.push({event:t,listeners:l})}var ax=/\\r\\n?/g,rx=/\\u0000|\\uFFFD/g;function Mf(e){return(typeof e=="string"?e:""+e).replace(ax,`\n`).replace(rx,"")}function hl(e,t,a){if(t=Mf(t),Mf(e)!==t&&a)throw Error(R(425))}function Ul(){}var Uu=null,_u=null;function qu(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 Wu=typeof setTimeout=="function"?setTimeout:void 0,ox=typeof clearTimeout=="function"?clearTimeout:void 0,Af=typeof Promise=="function"?Promise:void 0,nx=typeof queueMicrotask=="function"?queueMicrotask:typeof Af<"u"?function(e){return Af.resolve(null).then(e).catch(lx)}:Wu;function lx(e){setTimeout(function(){throw e})}function iu(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),tn(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);tn(t)}function Ea(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 Df(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 oo=Math.random().toString(36).slice(2),Yt="__reactFiber$"+oo,ln="__reactProps$"+oo,ma="__reactContainer$"+oo,$u="__reactEvents$"+oo,sx="__reactListeners$"+oo,ux="__reactHandles$"+oo;function rr(e){var t=e[Yt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ma]||a[Yt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Df(e);e!==null;){if(a=e[Yt])return a;e=Df(e)}return t}e=a,a=e.parentNode}return null}function hn(e){return e=e[Yt]||e[ma],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(R(33))}function ls(e){return e[ln]||null}var Vu=[],Nr=-1;function _a(e){return{current:e}}function Ce(e){0>Nr||(e.current=Vu[Nr],Vu[Nr]=null,Nr--)}function Le(e,t){Nr++,Vu[Nr]=e.current,e.current=t}var Ha={},je=_a(Ha),ut=_a(!1),ur=Ha;function Yr(e,t){var a=e.type.contextTypes;if(!a)return Ha;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 it(e){return e=e.childContextTypes,e!=null}function _l(){Ce(ut),Ce(je)}function Ef(e,t,a){if(je.current!==Ha)throw Error(R(168));Le(je,t),Le(ut,a)}function ap(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(R(108,jg(e)||"Unknown",o));return Pe({},a,r)}function ql(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ha,ur=je.current,Le(je,e),Le(ut,ut.current),!0}function Ff(e,t,a){var r=e.stateNode;if(!r)throw Error(R(169));a?(e=ap(e,t,ur),r.__reactInternalMemoizedMergedChildContext=e,Ce(ut),Ce(je),Le(je,e)):Ce(ut),Le(ut,a)}var ia=null,ss=!1,du=!1;function rp(e){ia===null?ia=[e]:ia.push(e)}function ix(e){ss=!0,rp(e)}function qa(){if(!du&&ia!==null){du=!0;var e=0,t=xe;try{var a=ia;for(xe=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}ia=null,ss=!1}catch(o){throw ia!==null&&(ia=ia.slice(e+1)),Tc(vi,qa),o}finally{xe=t,du=!1}}return null}var Hr=[],Ur=0,Wl=null,$l=0,Ct=[],wt=0,ir=null,da=1,fa="";function tr(e,t){Hr[Ur++]=$l,Hr[Ur++]=Wl,Wl=e,$l=t}function op(e,t,a){Ct[wt++]=da,Ct[wt++]=fa,Ct[wt++]=ir,ir=e;var r=da;e=fa;var o=32-Ut(r)-1;r&=~(1<<o),a+=1;var n=32-Ut(t)+o;if(30<n){var l=o-o%5;n=(r&(1<<l)-1).toString(32),r>>=l,o-=l,da=1<<32-Ut(t)+o|a<<o|r,fa=n+e}else da=1<<n|a<<o|r,fa=e}function Pi(e){e.return!==null&&(tr(e,1),op(e,1,0))}function Ti(e){for(;e===Wl;)Wl=Hr[--Ur],Hr[Ur]=null,$l=Hr[--Ur],Hr[Ur]=null;for(;e===ir;)ir=Ct[--wt],Ct[wt]=null,fa=Ct[--wt],Ct[wt]=null,da=Ct[--wt],Ct[wt]=null}var xt=null,ht=null,we=!1,Ht=null;function np(e,t){var a=kt(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 Bf(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,xt=e,ht=Ea(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,xt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=ir!==null?{id:da,overflow:fa}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=kt(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,xt=e,ht=null,!0):!1;default:return!1}}function Ku(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gu(e){if(we){var t=ht;if(t){var a=t;if(!Bf(e,t)){if(Ku(e))throw Error(R(418));t=Ea(a.nextSibling);var r=xt;t&&Bf(e,t)?np(r,a):(e.flags=e.flags&-4097|2,we=!1,xt=e)}}else{if(Ku(e))throw Error(R(418));e.flags=e.flags&-4097|2,we=!1,xt=e}}}function Of(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;xt=e}function xl(e){if(e!==xt)return!1;if(!we)return Of(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qu(e.type,e.memoizedProps)),t&&(t=ht)){if(Ku(e))throw lp(),Error(R(418));for(;t;)np(e,t),t=Ea(t.nextSibling)}if(Of(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){ht=Ea(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=xt?Ea(e.stateNode.nextSibling):null;return!0}function lp(){for(var e=ht;e;)e=Ea(e.nextSibling)}function Jr(){ht=xt=null,we=!1}function Ri(e){Ht===null?Ht=[e]:Ht.push(e)}var dx=xa.ReactCurrentBatchConfig;function Eo(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(R(309));var r=a.stateNode}if(!r)throw Error(R(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(R(284));if(!a._owner)throw Error(R(290,e))}return e}function vl(e,t){throw e=Object.prototype.toString.call(t),Error(R(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function zf(e){var t=e._init;return t(e._payload)}function sp(e){function t(f,i){if(e){var p=f.deletions;p===null?(f.deletions=[i],f.flags|=16):p.push(i)}}function a(f,i){if(!e)return null;for(;i!==null;)t(f,i),i=i.sibling;return null}function r(f,i){for(f=new Map;i!==null;)i.key!==null?f.set(i.key,i):f.set(i.index,i),i=i.sibling;return f}function o(f,i){return f=za(f,i),f.index=0,f.sibling=null,f}function n(f,i,p){return f.index=p,e?(p=f.alternate,p!==null?(p=p.index,p<i?(f.flags|=2,i):p):(f.flags|=2,i)):(f.flags|=1048576,i)}function l(f){return e&&f.alternate===null&&(f.flags|=2),f}function s(f,i,p,L){return i===null||i.tag!==6?(i=xu(p,f.mode,L),i.return=f,i):(i=o(i,p),i.return=f,i)}function u(f,i,p,L){var I=p.type;return I===Er?g(f,i,p.props.children,L,p.key):i!==null&&(i.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===wa&&zf(I)===i.type)?(L=o(i,p.props),L.ref=Eo(f,i,p),L.return=f,L):(L=Al(p.type,p.key,p.props,null,f.mode,L),L.ref=Eo(f,i,p),L.return=f,L)}function d(f,i,p,L){return i===null||i.tag!==4||i.stateNode.containerInfo!==p.containerInfo||i.stateNode.implementation!==p.implementation?(i=vu(p,f.mode,L),i.return=f,i):(i=o(i,p.children||[]),i.return=f,i)}function g(f,i,p,L,I){return i===null||i.tag!==7?(i=sr(p,f.mode,L,I),i.return=f,i):(i=o(i,p),i.return=f,i)}function m(f,i,p){if(typeof i=="string"&&i!==""||typeof i=="number")return i=xu(""+i,f.mode,p),i.return=f,i;if(typeof i=="object"&&i!==null){switch(i.$$typeof){case rl:return p=Al(i.type,i.key,i.props,null,f.mode,p),p.ref=Eo(f,null,i),p.return=f,p;case Dr:return i=vu(i,f.mode,p),i.return=f,i;case wa:var L=i._init;return m(f,L(i._payload),p)}if(No(i)||Ro(i))return i=sr(i,f.mode,p,null),i.return=f,i;vl(f,i)}return null}function c(f,i,p,L){var I=i!==null?i.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return I!==null?null:s(f,i,""+p,L);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case rl:return p.key===I?u(f,i,p,L):null;case Dr:return p.key===I?d(f,i,p,L):null;case wa:return I=p._init,c(f,i,I(p._payload),L)}if(No(p)||Ro(p))return I!==null?null:g(f,i,p,L,null);vl(f,p)}return null}function y(f,i,p,L,I){if(typeof L=="string"&&L!==""||typeof L=="number")return f=f.get(p)||null,s(i,f,""+L,I);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case rl:return f=f.get(L.key===null?p:L.key)||null,u(i,f,L,I);case Dr:return f=f.get(L.key===null?p:L.key)||null,d(i,f,L,I);case wa:var P=L._init;return y(f,i,p,P(L._payload),I)}if(No(L)||Ro(L))return f=f.get(p)||null,g(i,f,L,I,null);vl(i,L)}return null}function x(f,i,p,L){for(var I=null,P=null,v=i,S=i=0,_=null;v!==null&&S<p.length;S++){v.index>S?(_=v,v=null):_=v.sibling;var k=c(f,v,p[S],L);if(k===null){v===null&&(v=_);break}e&&v&&k.alternate===null&&t(f,v),i=n(k,i,S),P===null?I=k:P.sibling=k,P=k,v=_}if(S===p.length)return a(f,v),we&&tr(f,S),I;if(v===null){for(;S<p.length;S++)v=m(f,p[S],L),v!==null&&(i=n(v,i,S),P===null?I=v:P.sibling=v,P=v);return we&&tr(f,S),I}for(v=r(f,v);S<p.length;S++)_=y(v,f,S,p[S],L),_!==null&&(e&&_.alternate!==null&&v.delete(_.key===null?S:_.key),i=n(_,i,S),P===null?I=_:P.sibling=_,P=_);return e&&v.forEach(function(M){return t(f,M)}),we&&tr(f,S),I}function C(f,i,p,L){var I=Ro(p);if(typeof I!="function")throw Error(R(150));if(p=I.call(p),p==null)throw Error(R(151));for(var P=I=null,v=i,S=i=0,_=null,k=p.next();v!==null&&!k.done;S++,k=p.next()){v.index>S?(_=v,v=null):_=v.sibling;var M=c(f,v,k.value,L);if(M===null){v===null&&(v=_);break}e&&v&&M.alternate===null&&t(f,v),i=n(M,i,S),P===null?I=M:P.sibling=M,P=M,v=_}if(k.done)return a(f,v),we&&tr(f,S),I;if(v===null){for(;!k.done;S++,k=p.next())k=m(f,k.value,L),k!==null&&(i=n(k,i,S),P===null?I=k:P.sibling=k,P=k);return we&&tr(f,S),I}for(v=r(f,v);!k.done;S++,k=p.next())k=y(v,f,S,k.value,L),k!==null&&(e&&k.alternate!==null&&v.delete(k.key===null?S:k.key),i=n(k,i,S),P===null?I=k:P.sibling=k,P=k);return e&&v.forEach(function(U){return t(f,U)}),we&&tr(f,S),I}function O(f,i,p,L){if(typeof p=="object"&&p!==null&&p.type===Er&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case rl:e:{for(var I=p.key,P=i;P!==null;){if(P.key===I){if(I=p.type,I===Er){if(P.tag===7){a(f,P.sibling),i=o(P,p.props.children),i.return=f,f=i;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===wa&&zf(I)===P.type){a(f,P.sibling),i=o(P,p.props),i.ref=Eo(f,P,p),i.return=f,f=i;break e}a(f,P);break}else t(f,P);P=P.sibling}p.type===Er?(i=sr(p.props.children,f.mode,L,p.key),i.return=f,f=i):(L=Al(p.type,p.key,p.props,null,f.mode,L),L.ref=Eo(f,i,p),L.return=f,f=L)}return l(f);case Dr:e:{for(P=p.key;i!==null;){if(i.key===P)if(i.tag===4&&i.stateNode.containerInfo===p.containerInfo&&i.stateNode.implementation===p.implementation){a(f,i.sibling),i=o(i,p.children||[]),i.return=f,f=i;break e}else{a(f,i);break}else t(f,i);i=i.sibling}i=vu(p,f.mode,L),i.return=f,f=i}return l(f);case wa:return P=p._init,O(f,i,P(p._payload),L)}if(No(p))return x(f,i,p,L);if(Ro(p))return C(f,i,p,L);vl(f,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,i!==null&&i.tag===6?(a(f,i.sibling),i=o(i,p),i.return=f,f=i):(a(f,i),i=xu(p,f.mode,L),i.return=f,f=i),l(f)):a(f,i)}return O}var Zr=sp(!0),up=sp(!1),Vl=_a(null),Kl=null,_r=null,Mi=null;function Ai(){Mi=_r=Kl=null}function Di(e){var t=Vl.current;Ce(Vl),e._currentValue=t}function ju(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 jr(e,t){Kl=e,Mi=_r=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(st=!0),e.firstContext=null)}function Pt(e){var t=e._currentValue;if(Mi!==e)if(e={context:e,memoizedValue:t,next:null},_r===null){if(Kl===null)throw Error(R(308));_r=e,Kl.dependencies={lanes:0,firstContext:e}}else _r=_r.next=e;return t}var or=null;function Ei(e){or===null?or=[e]:or.push(e)}function ip(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,Ei(t)):(a.next=o.next,o.next=a),t.interleaved=a,ga(e,r)}function ga(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 Fi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dp(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 ca(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fa(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(pe&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ga(e,a)}return o=r.interleaved,o===null?(t.next=t,Ei(r)):(t.next=o.next,o.next=t),r.interleaved=t,ga(e,a)}function kl(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,yi(e,a)}}function Nf(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 Gl(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 u=s,d=u.next;u.next=null,l===null?n=d:l.next=d,l=u;var g=e.alternate;g!==null&&(g=g.updateQueue,s=g.lastBaseUpdate,s!==l&&(s===null?g.firstBaseUpdate=d:s.next=d,g.lastBaseUpdate=u))}if(n!==null){var m=o.baseState;l=0,g=d=u=null,s=n;do{var c=s.lane,y=s.eventTime;if((r&c)===c){g!==null&&(g=g.next={eventTime:y,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,C=s;switch(c=t,y=a,C.tag){case 1:if(x=C.payload,typeof x=="function"){m=x.call(y,m,c);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=C.payload,c=typeof x=="function"?x.call(y,m,c):x,c==null)break e;m=Pe({},m,c);break e;case 2:ka=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,c=o.effects,c===null?o.effects=[s]:c.push(s))}else y={eventTime:y,lane:c,tag:s.tag,payload:s.payload,callback:s.callback,next:null},g===null?(d=g=y,u=m):g=g.next=y,l|=c;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;c=s,s=c.next,c.next=null,o.lastBaseUpdate=c,o.shared.pending=null}}while(!0);if(g===null&&(u=m),o.baseState=u,o.firstBaseUpdate=d,o.lastBaseUpdate=g,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);fr|=l,e.lanes=l,e.memoizedState=m}}function Hf(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(R(191,o));o.call(r)}}}var xn={},Zt=_a(xn),sn=_a(xn),un=_a(xn);function nr(e){if(e===xn)throw Error(R(174));return e}function Bi(e,t){switch(Le(un,t),Le(sn,e),Le(Zt,xn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tu(t,e)}Ce(Zt),Le(Zt,t)}function eo(){Ce(Zt),Ce(sn),Ce(un)}function fp(e){nr(un.current);var t=nr(Zt.current),a=Tu(t,e.type);t!==a&&(Le(sn,e),Le(Zt,a))}function Oi(e){sn.current===e&&(Ce(Zt),Ce(sn))}var ke=_a(0);function jl(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 fu=[];function zi(){for(var e=0;e<fu.length;e++)fu[e]._workInProgressVersionPrimary=null;fu.length=0}var bl=xa.ReactCurrentDispatcher,cu=xa.ReactCurrentBatchConfig,dr=0,be=null,Fe=null,Oe=null,Xl=!1,Ko=!1,dn=0,fx=0;function Ve(){throw Error(R(321))}function Ni(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!qt(e[a],t[a]))return!1;return!0}function Hi(e,t,a,r,o,n){if(dr=n,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bl.current=e===null||e.memoizedState===null?gx:hx,e=a(r,o),Ko){n=0;do{if(Ko=!1,dn=0,25<=n)throw Error(R(301));n+=1,Oe=Fe=null,t.updateQueue=null,bl.current=xx,e=a(r,o)}while(Ko)}if(bl.current=Ql,t=Fe!==null&&Fe.next!==null,dr=0,Oe=Fe=be=null,Xl=!1,t)throw Error(R(300));return e}function Ui(){var e=dn!==0;return dn=0,e}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Oe===null?be.memoizedState=Oe=e:Oe=Oe.next=e,Oe}function Tt(){if(Fe===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=Oe===null?be.memoizedState:Oe.next;if(t!==null)Oe=t,Fe=e;else{if(e===null)throw Error(R(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},Oe===null?be.memoizedState=Oe=e:Oe=Oe.next=e}return Oe}function fn(e,t){return typeof t=="function"?t(e):t}function pu(e){var t=Tt(),a=t.queue;if(a===null)throw Error(R(311));a.lastRenderedReducer=e;var r=Fe,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,u=null,d=n;do{var g=d.lane;if((dr&g)===g)u!==null&&(u=u.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:g,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};u===null?(s=u=m,l=r):u=u.next=m,be.lanes|=g,fr|=g}d=d.next}while(d!==null&&d!==n);u===null?l=r:u.next=s,qt(r,t.memoizedState)||(st=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=u,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,be.lanes|=n,fr|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function mu(e){var t=Tt(),a=t.queue;if(a===null)throw Error(R(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);qt(n,t.memoizedState)||(st=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function cp(){}function pp(e,t){var a=be,r=Tt(),o=t(),n=!qt(r.memoizedState,o);if(n&&(r.memoizedState=o,st=!0),r=r.queue,_i(hp.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||Oe!==null&&Oe.memoizedState.tag&1){if(a.flags|=2048,cn(9,gp.bind(null,a,r,o,t),void 0,null),ze===null)throw Error(R(349));(dr&30)!==0||mp(a,t,o)}return o}function mp(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function gp(e,t,a,r){t.value=a,t.getSnapshot=r,xp(t)&&vp(e)}function hp(e,t,a){return a(function(){xp(t)&&vp(e)})}function xp(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!qt(e,a)}catch{return!0}}function vp(e){var t=ga(e,1);t!==null&&_t(t,e,1,-1)}function Uf(e){var t=Qt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:e},t.queue=e,e=e.dispatch=mx.bind(null,be,e),[t.memoizedState,e]}function cn(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.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 yp(){return Tt().memoizedState}function Pl(e,t,a,r){var o=Qt();be.flags|=e,o.memoizedState=cn(1|t,a,void 0,r===void 0?null:r)}function us(e,t,a,r){var o=Tt();r=r===void 0?null:r;var n=void 0;if(Fe!==null){var l=Fe.memoizedState;if(n=l.destroy,r!==null&&Ni(r,l.deps)){o.memoizedState=cn(t,a,n,r);return}}be.flags|=e,o.memoizedState=cn(1|t,a,n,r)}function _f(e,t){return Pl(8390656,8,e,t)}function _i(e,t){return us(2048,8,e,t)}function Lp(e,t){return us(4,2,e,t)}function Sp(e,t){return us(4,4,e,t)}function Ip(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 Cp(e,t,a){return a=a!=null?a.concat([e]):null,us(4,4,Ip.bind(null,t,e),a)}function qi(){}function wp(e,t){var a=Tt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Ni(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function kp(e,t){var a=Tt();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Ni(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function bp(e,t,a){return(dr&21)===0?(e.baseState&&(e.baseState=!1,st=!0),e.memoizedState=a):(qt(a,t)||(a=Ac(),be.lanes|=a,fr|=a,e.baseState=!0),t)}function cx(e,t){var a=xe;xe=a!==0&&4>a?a:4,e(!0);var r=cu.transition;cu.transition={};try{e(!1),t()}finally{xe=a,cu.transition=r}}function Pp(){return Tt().memoizedState}function px(e,t,a){var r=Oa(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},Tp(e))Rp(t,a);else if(a=ip(e,t,a,r),a!==null){var o=Je();_t(a,e,r,o),Mp(a,t,r)}}function mx(e,t,a){var r=Oa(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(Tp(e))Rp(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,qt(s,l)){var u=t.interleaved;u===null?(o.next=o,Ei(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}a=ip(e,t,o,r),a!==null&&(o=Je(),_t(a,e,r,o),Mp(a,t,r))}}function Tp(e){var t=e.alternate;return e===be||t!==null&&t===be}function Rp(e,t){Ko=Xl=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Mp(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,yi(e,a)}}var Ql={readContext:Pt,useCallback:Ve,useContext:Ve,useEffect:Ve,useImperativeHandle:Ve,useInsertionEffect:Ve,useLayoutEffect:Ve,useMemo:Ve,useReducer:Ve,useRef:Ve,useState:Ve,useDebugValue:Ve,useDeferredValue:Ve,useTransition:Ve,useMutableSource:Ve,useSyncExternalStore:Ve,useId:Ve,unstable_isNewReconciler:!1},gx={readContext:Pt,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:_f,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,Pl(4194308,4,Ip.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Pl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pl(4,2,e,t)},useMemo:function(e,t){var a=Qt();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=Qt();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=px.bind(null,be,e),[r.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:Uf,useDebugValue:qi,useDeferredValue:function(e){return Qt().memoizedState=e},useTransition:function(){var e=Uf(!1),t=e[0];return e=cx.bind(null,e[1]),Qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=be,o=Qt();if(we){if(a===void 0)throw Error(R(407));a=a()}else{if(a=t(),ze===null)throw Error(R(349));(dr&30)!==0||mp(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,_f(hp.bind(null,r,n,e),[e]),r.flags|=2048,cn(9,gp.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=Qt(),t=ze.identifierPrefix;if(we){var a=fa,r=da;a=(r&~(1<<32-Ut(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=dn++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=fx++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hx={readContext:Pt,useCallback:wp,useContext:Pt,useEffect:_i,useImperativeHandle:Cp,useInsertionEffect:Lp,useLayoutEffect:Sp,useMemo:kp,useReducer:pu,useRef:yp,useState:function(){return pu(fn)},useDebugValue:qi,useDeferredValue:function(e){var t=Tt();return bp(t,Fe.memoizedState,e)},useTransition:function(){var e=pu(fn)[0],t=Tt().memoizedState;return[e,t]},useMutableSource:cp,useSyncExternalStore:pp,useId:Pp,unstable_isNewReconciler:!1},xx={readContext:Pt,useCallback:wp,useContext:Pt,useEffect:_i,useImperativeHandle:Cp,useInsertionEffect:Lp,useLayoutEffect:Sp,useMemo:kp,useReducer:mu,useRef:yp,useState:function(){return mu(fn)},useDebugValue:qi,useDeferredValue:function(e){var t=Tt();return Fe===null?t.memoizedState=e:bp(t,Fe.memoizedState,e)},useTransition:function(){var e=mu(fn)[0],t=Tt().memoizedState;return[e,t]},useMutableSource:cp,useSyncExternalStore:pp,useId:Pp,unstable_isNewReconciler:!1};function zt(e,t){if(e&&e.defaultProps){t=Pe({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Xu(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Pe({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var is={isMounted:function(e){return(e=e._reactInternals)?mr(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Je(),o=Oa(e),n=ca(r,o);n.payload=t,a!=null&&(n.callback=a),t=Fa(e,n,o),t!==null&&(_t(t,e,o,r),kl(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Je(),o=Oa(e),n=ca(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Fa(e,n,o),t!==null&&(_t(t,e,o,r),kl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Je(),r=Oa(e),o=ca(a,r);o.tag=2,t!=null&&(o.callback=t),t=Fa(e,o,r),t!==null&&(_t(t,e,r,a),kl(t,e,r))}};function qf(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?!rn(a,r)||!rn(o,n):!0}function Ap(e,t,a){var r=!1,o=Ha,n=t.contextType;return typeof n=="object"&&n!==null?n=Pt(n):(o=it(t)?ur:je.current,r=t.contextTypes,n=(r=r!=null)?Yr(e,o):Ha),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=is,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function Wf(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&&is.enqueueReplaceState(t,t.state,null)}function Qu(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},Fi(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=Pt(n):(n=it(t)?ur:je.current,o.context=Yr(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Xu(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&&is.enqueueReplaceState(o,o.state,null),Gl(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function to(e,t){try{var a="",r=t;do a+=Gg(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 gu(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Yu(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var vx=typeof WeakMap=="function"?WeakMap:Map;function Dp(e,t,a){a=ca(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Jl||(Jl=!0,si=r),Yu(e,t)},a}function Ep(e,t,a){a=ca(-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(){Yu(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Yu(e,t),typeof r!="function"&&(Ba===null?Ba=new Set([this]):Ba.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),a}function $f(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new vx;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=Dx.bind(null,e,t,a),t.then(e,e))}function Vf(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 Kf(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=ca(-1,1),t.tag=2,Fa(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var yx=xa.ReactCurrentOwner,st=!1;function Ye(e,t,a,r){t.child=e===null?up(t,null,a,r):Zr(t,e.child,a,r)}function Gf(e,t,a,r,o){a=a.render;var n=t.ref;return jr(t,o),r=Hi(e,t,a,r,n,o),a=Ui(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ha(e,t,o)):(we&&a&&Pi(t),t.flags|=1,Ye(e,t,r,o),t.child)}function jf(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Qi(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,Fp(e,t,n,r,o)):(e=Al(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:rn,a(l,r)&&e.ref===t.ref)return ha(e,t,o)}return t.flags|=1,e=za(n,r),e.ref=t.ref,e.return=t,t.child=e}function Fp(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(rn(n,r)&&e.ref===t.ref)if(st=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(st=!0);else return t.lanes=e.lanes,ha(e,t,o)}return Ju(e,t,a,r,o)}function Bp(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},Le(Wr,gt),gt|=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,Le(Wr,gt),gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,Le(Wr,gt),gt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,Le(Wr,gt),gt|=r;return Ye(e,t,o,a),t.child}function Op(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Ju(e,t,a,r,o){var n=it(a)?ur:je.current;return n=Yr(t,n),jr(t,o),a=Hi(e,t,a,r,n,o),r=Ui(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ha(e,t,o)):(we&&r&&Pi(t),t.flags|=1,Ye(e,t,a,o),t.child)}function Xf(e,t,a,r,o){if(it(a)){var n=!0;ql(t)}else n=!1;if(jr(t,o),t.stateNode===null)Tl(e,t),Ap(t,a,r),Qu(t,a,r,o),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var u=l.context,d=a.contextType;typeof d=="object"&&d!==null?d=Pt(d):(d=it(a)?ur:je.current,d=Yr(t,d));var g=a.getDerivedStateFromProps,m=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function";m||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||u!==d)&&Wf(t,l,r,d),ka=!1;var c=t.memoizedState;l.state=c,Gl(t,r,l,o),u=t.memoizedState,s!==r||c!==u||ut.current||ka?(typeof g=="function"&&(Xu(t,a,g,r),u=t.memoizedState),(s=ka||qf(t,a,s,r,c,u,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=u),l.props=r,l.state=u,l.context=d,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,dp(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:zt(t.type,s),l.props=d,m=t.pendingProps,c=l.context,u=a.contextType,typeof u=="object"&&u!==null?u=Pt(u):(u=it(a)?ur:je.current,u=Yr(t,u));var y=a.getDerivedStateFromProps;(g=typeof y=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==m||c!==u)&&Wf(t,l,r,u),ka=!1,c=t.memoizedState,l.state=c,Gl(t,r,l,o);var x=t.memoizedState;s!==m||c!==x||ut.current||ka?(typeof y=="function"&&(Xu(t,a,y,r),x=t.memoizedState),(d=ka||qf(t,a,d,r,c,x,u)||!1)?(g||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,x,u),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,x,u)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),l.props=r,l.state=x,l.context=u,r=d):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&c===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&c===e.memoizedState||(t.flags|=1024),r=!1)}return Zu(e,t,a,r,n,o)}function Zu(e,t,a,r,o,n){Op(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return o&&Ff(t,a,!1),ha(e,t,n);r=t.stateNode,yx.current=t;var s=l&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=Zr(t,e.child,null,n),t.child=Zr(t,null,s,n)):Ye(e,t,s,n),t.memoizedState=r.state,o&&Ff(t,a,!0),t.child}function zp(e){var t=e.stateNode;t.pendingContext?Ef(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ef(e,t.context,!1),Bi(e,t.containerInfo)}function Qf(e,t,a,r,o){return Jr(),Ri(o),t.flags|=256,Ye(e,t,a,r),t.child}var ei={dehydrated:null,treeContext:null,retryLane:0};function ti(e){return{baseLanes:e,cachePool:null,transitions:null}}function Np(e,t,a){var r=t.pendingProps,o=ke.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),Le(ke,o&1),e===null)return Gu(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=cs(l,r,0,null),e=sr(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=ti(a),t.memoizedState=ei,e):Wi(t,l));if(o=e.memoizedState,o!==null&&(s=o.dehydrated,s!==null))return Lx(e,t,l,r,s,o,a);if(n){n=r.fallback,l=t.mode,o=e.child,s=o.sibling;var u={mode:"hidden",children:r.children};return(l&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=za(o,u),r.subtreeFlags=o.subtreeFlags&14680064),s!==null?n=za(s,n):(n=sr(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?ti(a):{baseLanes:l.baseLanes|a,cachePool:null,transitions:l.transitions},n.memoizedState=l,n.childLanes=e.childLanes&~a,t.memoizedState=ei,r}return n=e.child,e=n.sibling,r=za(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 Wi(e,t){return t=cs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function yl(e,t,a,r){return r!==null&&Ri(r),Zr(t,e.child,null,a),e=Wi(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lx(e,t,a,r,o,n,l){if(a)return t.flags&256?(t.flags&=-257,r=gu(Error(R(422))),yl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=cs({mode:"visible",children:r.children},o,0,null),n=sr(n,o,l,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&Zr(t,e.child,null,l),t.child.memoizedState=ti(l),t.memoizedState=ei,n);if((t.mode&1)===0)return yl(e,t,l,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var s=r.dgst;return r=s,n=Error(R(419)),r=gu(n,r,void 0),yl(e,t,l,r)}if(s=(l&e.childLanes)!==0,st||s){if(r=ze,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,ga(e,o),_t(r,e,o,-1))}return Xi(),r=gu(Error(R(421))),yl(e,t,l,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Ex.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,ht=Ea(o.nextSibling),xt=t,we=!0,Ht=null,e!==null&&(Ct[wt++]=da,Ct[wt++]=fa,Ct[wt++]=ir,da=e.id,fa=e.overflow,ir=t),t=Wi(t,r.children),t.flags|=4096,t)}function Yf(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ju(e.return,t,a)}function hu(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 Hp(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(Ye(e,t,r.children,a),r=ke.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&&Yf(e,a,t);else if(e.tag===19)Yf(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(Le(ke,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&&jl(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),hu(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&&jl(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}hu(t,!0,a,null,n);break;case"together":hu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Tl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ha(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),fr|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(R(153));if(t.child!==null){for(e=t.child,a=za(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=za(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Sx(e,t,a){switch(t.tag){case 3:zp(t),Jr();break;case 5:fp(t);break;case 1:it(t.type)&&ql(t);break;case 4:Bi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Le(Vl,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Le(ke,ke.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?Np(e,t,a):(Le(ke,ke.current&1),e=ha(e,t,a),e!==null?e.sibling:null);Le(ke,ke.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Hp(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Le(ke,ke.current),r)break;return null;case 22:case 23:return t.lanes=0,Bp(e,t,a)}return ha(e,t,a)}var Up,ai,_p,qp;Up=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}};ai=function(){};_p=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,nr(Zt.current);var n=null;switch(a){case"input":o=wu(e,o),r=wu(e,r),n=[];break;case"select":o=Pe({},o,{value:void 0}),r=Pe({},r,{value:void 0}),n=[];break;case"textarea":o=Pu(e,o),r=Pu(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ul)}Ru(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"&&(Qo.hasOwnProperty(d)?n||(n=[]):(n=n||[]).push(d,null));for(d in r){var u=r[d];if(s=o!=null?o[d]:void 0,r.hasOwnProperty(d)&&u!==s&&(u!=null||s!=null))if(d==="style")if(s){for(l in s)!s.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(a||(a={}),a[l]="");for(l in u)u.hasOwnProperty(l)&&s[l]!==u[l]&&(a||(a={}),a[l]=u[l])}else a||(n||(n=[]),n.push(d,a)),a=u;else d==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,s=s?s.__html:void 0,u!=null&&s!==u&&(n=n||[]).push(d,u)):d==="children"?typeof u!="string"&&typeof u!="number"||(n=n||[]).push(d,""+u):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Qo.hasOwnProperty(d)?(u!=null&&d==="onScroll"&&Ie("scroll",e),n||s===u||(n=[])):(n=n||[]).push(d,u))}a&&(n=n||[]).push("style",a);var d=n;(t.updateQueue=d)&&(t.flags|=4)}};qp=function(e,t,a,r){a!==r&&(t.flags|=4)};function Fo(e,t){if(!we)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 Ke(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 Ix(e,t,a){var r=t.pendingProps;switch(Ti(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(t),null;case 1:return it(t.type)&&_l(),Ke(t),null;case 3:return r=t.stateNode,eo(),Ce(ut),Ce(je),zi(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ht!==null&&(di(Ht),Ht=null))),ai(e,t),Ke(t),null;case 5:Oi(t);var o=nr(un.current);if(a=t.type,e!==null&&t.stateNode!=null)_p(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(R(166));return Ke(t),null}if(e=nr(Zt.current),xl(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Yt]=t,r[ln]=n,e=(t.mode&1)!==0,a){case"dialog":Ie("cancel",r),Ie("close",r);break;case"iframe":case"object":case"embed":Ie("load",r);break;case"video":case"audio":for(o=0;o<Uo.length;o++)Ie(Uo[o],r);break;case"source":Ie("error",r);break;case"img":case"image":case"link":Ie("error",r),Ie("load",r);break;case"details":Ie("toggle",r);break;case"input":of(r,n),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},Ie("invalid",r);break;case"textarea":lf(r,n),Ie("invalid",r)}Ru(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&&hl(r.textContent,s,e),o=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(n.suppressHydrationWarning!==!0&&hl(r.textContent,s,e),o=["children",""+s]):Qo.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&Ie("scroll",r)}switch(a){case"input":ol(r),nf(r,n,!0);break;case"textarea":ol(r),sf(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Ul)}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=hc(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[Yt]=t,e[ln]=r,Up(e,t,!1,!1),t.stateNode=e;e:{switch(l=Mu(a,r),a){case"dialog":Ie("cancel",e),Ie("close",e),o=r;break;case"iframe":case"object":case"embed":Ie("load",e),o=r;break;case"video":case"audio":for(o=0;o<Uo.length;o++)Ie(Uo[o],e);o=r;break;case"source":Ie("error",e),o=r;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),o=r;break;case"details":Ie("toggle",e),o=r;break;case"input":of(e,r),o=wu(e,r),Ie("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Pe({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":lf(e,r),o=Pu(e,r),Ie("invalid",e);break;default:o=r}Ru(a,o),s=o;for(n in s)if(s.hasOwnProperty(n)){var u=s[n];n==="style"?yc(e,u):n==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&xc(e,u)):n==="children"?typeof u=="string"?(a!=="textarea"||u!=="")&&Yo(e,u):typeof u=="number"&&Yo(e,""+u):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(Qo.hasOwnProperty(n)?u!=null&&n==="onScroll"&&Ie("scroll",e):u!=null&&pi(e,n,u,l))}switch(a){case"input":ol(e),nf(e,r,!1);break;case"textarea":ol(e),sf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Na(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?$r(e,!!r.multiple,n,!1):r.defaultValue!=null&&$r(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ul)}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 Ke(t),null;case 6:if(e&&t.stateNode!=null)qp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(R(166));if(a=nr(un.current),nr(Zt.current),xl(t)){if(r=t.stateNode,a=t.memoizedProps,r[Yt]=t,(n=r.nodeValue!==a)&&(e=xt,e!==null))switch(e.tag){case 3:hl(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&hl(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Yt]=t,t.stateNode=r}return Ke(t),null;case 13:if(Ce(ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&&ht!==null&&(t.mode&1)!==0&&(t.flags&128)===0)lp(),Jr(),t.flags|=98560,n=!1;else if(n=xl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(R(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(R(317));n[Yt]=t}else Jr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ke(t),n=!1}else Ht!==null&&(di(Ht),Ht=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||(ke.current&1)!==0?Be===0&&(Be=3):Xi())),t.updateQueue!==null&&(t.flags|=4),Ke(t),null);case 4:return eo(),ai(e,t),e===null&&on(t.stateNode.containerInfo),Ke(t),null;case 10:return Di(t.type._context),Ke(t),null;case 17:return it(t.type)&&_l(),Ke(t),null;case 19:if(Ce(ke),n=t.memoizedState,n===null)return Ke(t),null;if(r=(t.flags&128)!==0,l=n.rendering,l===null)if(r)Fo(n,!1);else{if(Be!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(l=jl(e),l!==null){for(t.flags|=128,Fo(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 Le(ke,ke.current&1|2),t.child}e=e.sibling}n.tail!==null&&Me()>ao&&(t.flags|=128,r=!0,Fo(n,!1),t.lanes=4194304)}else{if(!r)if(e=jl(l),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Fo(n,!0),n.tail===null&&n.tailMode==="hidden"&&!l.alternate&&!we)return Ke(t),null}else 2*Me()-n.renderingStartTime>ao&&a!==1073741824&&(t.flags|=128,r=!0,Fo(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=Me(),t.sibling=null,a=ke.current,Le(ke,r?a&1|2:a&1),t):(Ke(t),null);case 22:case 23:return ji(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(gt&1073741824)!==0&&(Ke(t),t.subtreeFlags&6&&(t.flags|=8192)):Ke(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function Cx(e,t){switch(Ti(t),t.tag){case 1:return it(t.type)&&_l(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return eo(),Ce(ut),Ce(je),zi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Oi(t),null;case 13:if(Ce(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));Jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(ke),null;case 4:return eo(),null;case 10:return Di(t.type._context),null;case 22:case 23:return ji(),null;case 24:return null;default:return null}}var Ll=!1,Ge=!1,wx=typeof WeakSet=="function"?WeakSet:Set,N=null;function qr(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Te(e,t,r)}else a.current=null}function ri(e,t,a){try{a()}catch(r){Te(e,t,r)}}var Jf=!1;function kx(e,t){if(Uu=zl,e=Gc(),bi(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,u=-1,d=0,g=0,m=e,c=null;t:for(;;){for(var y;m!==a||o!==0&&m.nodeType!==3||(s=l+o),m!==n||r!==0&&m.nodeType!==3||(u=l+r),m.nodeType===3&&(l+=m.nodeValue.length),(y=m.firstChild)!==null;)c=m,m=y;for(;;){if(m===e)break t;if(c===a&&++d===o&&(s=l),c===n&&++g===r&&(u=l),(y=m.nextSibling)!==null)break;m=c,c=m.parentNode}m=y}a=s===-1||u===-1?null:{start:s,end:u}}else a=null}a=a||{start:0,end:0}}else a=null;for(_u={focusedElem:e,selectionRange:a},zl=!1,N=t;N!==null;)if(t=N,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,N=e;else for(;N!==null;){t=N;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 C=x.memoizedProps,O=x.memoizedState,f=t.stateNode,i=f.getSnapshotBeforeUpdate(t.elementType===t.type?C:zt(t.type,C),O);f.__reactInternalSnapshotBeforeUpdate=i}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(L){Te(t,t.return,L)}if(e=t.sibling,e!==null){e.return=t.return,N=e;break}N=t.return}return x=Jf,Jf=!1,x}function Go(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&&ri(t,a,n)}o=o.next}while(o!==r)}}function ds(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 oi(e){var t=e.ref;if(t!==null){var a=e.stateNode;e.tag,e=a,typeof t=="function"?t(e):t.current=e}}function Wp(e){var t=e.alternate;t!==null&&(e.alternate=null,Wp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yt],delete t[ln],delete t[$u],delete t[sx],delete t[ux])),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 $p(e){return e.tag===5||e.tag===3||e.tag===4}function Zf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$p(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 ni(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=Ul));else if(r!==4&&(e=e.child,e!==null))for(ni(e,t,a),e=e.sibling;e!==null;)ni(e,t,a),e=e.sibling}function li(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(li(e,t,a),e=e.sibling;e!==null;)li(e,t,a),e=e.sibling}var He=null,Nt=!1;function Ca(e,t,a){for(a=a.child;a!==null;)Vp(e,t,a),a=a.sibling}function Vp(e,t,a){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(as,a)}catch{}switch(a.tag){case 5:Ge||qr(a,t);case 6:var r=He,o=Nt;He=null,Ca(e,t,a),He=r,Nt=o,He!==null&&(Nt?(e=He,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):He.removeChild(a.stateNode));break;case 18:He!==null&&(Nt?(e=He,a=a.stateNode,e.nodeType===8?iu(e.parentNode,a):e.nodeType===1&&iu(e,a),tn(e)):iu(He,a.stateNode));break;case 4:r=He,o=Nt,He=a.stateNode.containerInfo,Nt=!0,Ca(e,t,a),He=r,Nt=o;break;case 0:case 11:case 14:case 15:if(!Ge&&(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)&&ri(a,t,l),o=o.next}while(o!==r)}Ca(e,t,a);break;case 1:if(!Ge&&(qr(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(s){Te(a,t,s)}Ca(e,t,a);break;case 21:Ca(e,t,a);break;case 22:a.mode&1?(Ge=(r=Ge)||a.memoizedState!==null,Ca(e,t,a),Ge=r):Ca(e,t,a);break;default:Ca(e,t,a)}}function ec(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new wx),t.forEach(function(r){var o=Fx.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function Ot(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:He=s.stateNode,Nt=!1;break e;case 3:He=s.stateNode.containerInfo,Nt=!0;break e;case 4:He=s.stateNode.containerInfo,Nt=!0;break e}s=s.return}if(He===null)throw Error(R(160));Vp(n,l,o),He=null,Nt=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(d){Te(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Kp(t,e),t=t.sibling}function Kp(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ot(t,e),Xt(e),r&4){try{Go(3,e,e.return),ds(3,e)}catch(C){Te(e,e.return,C)}try{Go(5,e,e.return)}catch(C){Te(e,e.return,C)}}break;case 1:Ot(t,e),Xt(e),r&512&&a!==null&&qr(a,a.return);break;case 5:if(Ot(t,e),Xt(e),r&512&&a!==null&&qr(a,a.return),e.flags&32){var o=e.stateNode;try{Yo(o,"")}catch(C){Te(e,e.return,C)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,l=a!==null?a.memoizedProps:n,s=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{s==="input"&&n.type==="radio"&&n.name!=null&&mc(o,n),Mu(s,l);var d=Mu(s,n);for(l=0;l<u.length;l+=2){var g=u[l],m=u[l+1];g==="style"?yc(o,m):g==="dangerouslySetInnerHTML"?xc(o,m):g==="children"?Yo(o,m):pi(o,g,m,d)}switch(s){case"input":ku(o,n);break;case"textarea":gc(o,n);break;case"select":var c=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var y=n.value;y!=null?$r(o,!!n.multiple,y,!1):c!==!!n.multiple&&(n.defaultValue!=null?$r(o,!!n.multiple,n.defaultValue,!0):$r(o,!!n.multiple,n.multiple?[]:"",!1))}o[ln]=n}catch(C){Te(e,e.return,C)}}break;case 6:if(Ot(t,e),Xt(e),r&4){if(e.stateNode===null)throw Error(R(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(C){Te(e,e.return,C)}}break;case 3:if(Ot(t,e),Xt(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{tn(t.containerInfo)}catch(C){Te(e,e.return,C)}break;case 4:Ot(t,e),Xt(e);break;case 13:Ot(t,e),Xt(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(Ki=Me())),r&4&&ec(e);break;case 22:if(g=a!==null&&a.memoizedState!==null,e.mode&1?(Ge=(d=Ge)||g,Ot(t,e),Ge=d):Ot(t,e),Xt(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!g&&(e.mode&1)!==0)for(N=e,g=e.child;g!==null;){for(m=N=g;N!==null;){switch(c=N,y=c.child,c.tag){case 0:case 11:case 14:case 15:Go(4,c,c.return);break;case 1:qr(c,c.return);var x=c.stateNode;if(typeof x.componentWillUnmount=="function"){r=c,a=c.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(C){Te(r,a,C)}}break;case 5:qr(c,c.return);break;case 22:if(c.memoizedState!==null){ac(m);continue}}y!==null?(y.return=c,N=y):ac(m)}g=g.sibling}e:for(g=null,m=e;;){if(m.tag===5){if(g===null){g=m;try{o=m.stateNode,d?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(s=m.stateNode,u=m.memoizedProps.style,l=u!=null&&u.hasOwnProperty("display")?u.display:null,s.style.display=vc("display",l))}catch(C){Te(e,e.return,C)}}}else if(m.tag===6){if(g===null)try{m.stateNode.nodeValue=d?"":m.memoizedProps}catch(C){Te(e,e.return,C)}}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;g===m&&(g=null),m=m.return}g===m&&(g=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:Ot(t,e),Xt(e),r&4&&ec(e);break;case 21:break;default:Ot(t,e),Xt(e)}}function Xt(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if($p(a)){var r=a;break e}a=a.return}throw Error(R(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Yo(o,""),r.flags&=-33);var n=Zf(e);li(e,n,o);break;case 3:case 4:var l=r.stateNode.containerInfo,s=Zf(e);ni(e,s,l);break;default:throw Error(R(161))}}catch(u){Te(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bx(e,t,a){N=e,Gp(e,t,a)}function Gp(e,t,a){for(var r=(e.mode&1)!==0;N!==null;){var o=N,n=o.child;if(o.tag===22&&r){var l=o.memoizedState!==null||Ll;if(!l){var s=o.alternate,u=s!==null&&s.memoizedState!==null||Ge;s=Ll;var d=Ge;if(Ll=l,(Ge=u)&&!d)for(N=o;N!==null;)l=N,u=l.child,l.tag===22&&l.memoizedState!==null?rc(o):u!==null?(u.return=l,N=u):rc(o);for(;n!==null;)N=n,Gp(n,t,a),n=n.sibling;N=o,Ll=s,Ge=d}tc(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,N=n):tc(e,t,a)}}function tc(e){for(;N!==null;){var t=N;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ge||ds(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ge)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:zt(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&Hf(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}Hf(t,l,a)}break;case 5:var s=t.stateNode;if(a===null&&t.flags&4){a=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&a.focus();break;case"img":u.src&&(a.src=u.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 g=d.memoizedState;if(g!==null){var m=g.dehydrated;m!==null&&tn(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}Ge||t.flags&512&&oi(t)}catch(c){Te(t,t.return,c)}}if(t===e){N=null;break}if(a=t.sibling,a!==null){a.return=t.return,N=a;break}N=t.return}}function ac(e){for(;N!==null;){var t=N;if(t===e){N=null;break}var a=t.sibling;if(a!==null){a.return=t.return,N=a;break}N=t.return}}function rc(e){for(;N!==null;){var t=N;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{ds(4,t)}catch(u){Te(t,a,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Te(t,o,u)}}var n=t.return;try{oi(t)}catch(u){Te(t,n,u)}break;case 5:var l=t.return;try{oi(t)}catch(u){Te(t,l,u)}}}catch(u){Te(t,t.return,u)}if(t===e){N=null;break}var s=t.sibling;if(s!==null){s.return=t.return,N=s;break}N=t.return}}var Px=Math.ceil,Yl=xa.ReactCurrentDispatcher,$i=xa.ReactCurrentOwner,bt=xa.ReactCurrentBatchConfig,pe=0,ze=null,De=null,Ue=0,gt=0,Wr=_a(0),Be=0,pn=null,fr=0,fs=0,Vi=0,jo=null,lt=null,Ki=0,ao=1/0,ua=null,Jl=!1,si=null,Ba=null,Sl=!1,Ra=null,Zl=0,Xo=0,ui=null,Rl=-1,Ml=0;function Je(){return(pe&6)!==0?Me():Rl!==-1?Rl:Rl=Me()}function Oa(e){return(e.mode&1)===0?1:(pe&2)!==0&&Ue!==0?Ue&-Ue:dx.transition!==null?(Ml===0&&(Ml=Ac()),Ml):(e=xe,e!==0||(e=window.event,e=e===void 0?16:Nc(e.type)),e)}function _t(e,t,a,r){if(50<Xo)throw Xo=0,ui=null,Error(R(185));mn(e,a,r),((pe&2)===0||e!==ze)&&(e===ze&&((pe&2)===0&&(fs|=a),Be===4&&Pa(e,Ue)),dt(e,r),a===1&&pe===0&&(t.mode&1)===0&&(ao=Me()+500,ss&&qa()))}function dt(e,t){var a=e.callbackNode;ch(e,t);var r=Ol(e,e===ze?Ue:0);if(r===0)a!==null&&ff(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&ff(a),t===1)e.tag===0?ix(oc.bind(null,e)):rp(oc.bind(null,e)),nx(function(){(pe&6)===0&&qa()}),a=null;else{switch(Dc(r)){case 1:a=vi;break;case 4:a=Rc;break;case 16:a=Bl;break;case 536870912:a=Mc;break;default:a=Bl}a=tm(a,jp.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function jp(e,t){if(Rl=-1,Ml=0,(pe&6)!==0)throw Error(R(327));var a=e.callbackNode;if(Xr()&&e.callbackNode!==a)return null;var r=Ol(e,e===ze?Ue:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=es(e,r);else{t=r;var o=pe;pe|=2;var n=Qp();(ze!==e||Ue!==t)&&(ua=null,ao=Me()+500,lr(e,t));do try{Mx();break}catch(s){Xp(e,s)}while(!0);Ai(),Yl.current=n,pe=o,De!==null?t=0:(ze=null,Ue=0,t=Be)}if(t!==0){if(t===2&&(o=Bu(e),o!==0&&(r=o,t=ii(e,o))),t===1)throw a=pn,lr(e,0),Pa(e,r),dt(e,Me()),a;if(t===6)Pa(e,r);else{if(o=e.current.alternate,(r&30)===0&&!Tx(o)&&(t=es(e,r),t===2&&(n=Bu(e),n!==0&&(r=n,t=ii(e,n))),t===1))throw a=pn,lr(e,0),Pa(e,r),dt(e,Me()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(R(345));case 2:ar(e,lt,ua);break;case 3:if(Pa(e,r),(r&130023424)===r&&(t=Ki+500-Me(),10<t)){if(Ol(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Je(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Wu(ar.bind(null,e,lt,ua),t);break}ar(e,lt,ua);break;case 4:if(Pa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var l=31-Ut(r);n=1<<l,l=t[l],l>o&&(o=l),r&=~n}if(r=o,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Px(r/1960))-r,10<r){e.timeoutHandle=Wu(ar.bind(null,e,lt,ua),r);break}ar(e,lt,ua);break;case 5:ar(e,lt,ua);break;default:throw Error(R(329))}}}return dt(e,Me()),e.callbackNode===a?jp.bind(null,e):null}function ii(e,t){var a=jo;return e.current.memoizedState.isDehydrated&&(lr(e,t).flags|=256),e=es(e,t),e!==2&&(t=lt,lt=a,t!==null&&di(t)),e}function di(e){lt===null?lt=e:lt.push.apply(lt,e)}function Tx(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(!qt(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 Pa(e,t){for(t&=~Vi,t&=~fs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Ut(t),r=1<<a;e[a]=-1,t&=~r}}function oc(e){if((pe&6)!==0)throw Error(R(327));Xr();var t=Ol(e,0);if((t&1)===0)return dt(e,Me()),null;var a=es(e,t);if(e.tag!==0&&a===2){var r=Bu(e);r!==0&&(t=r,a=ii(e,r))}if(a===1)throw a=pn,lr(e,0),Pa(e,t),dt(e,Me()),a;if(a===6)throw Error(R(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ar(e,lt,ua),dt(e,Me()),null}function Gi(e,t){var a=pe;pe|=1;try{return e(t)}finally{pe=a,pe===0&&(ao=Me()+500,ss&&qa())}}function cr(e){Ra!==null&&Ra.tag===0&&(pe&6)===0&&Xr();var t=pe;pe|=1;var a=bt.transition,r=xe;try{if(bt.transition=null,xe=1,e)return e()}finally{xe=r,bt.transition=a,pe=t,(pe&6)===0&&qa()}}function ji(){gt=Wr.current,Ce(Wr)}function lr(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,ox(a)),De!==null)for(a=De.return;a!==null;){var r=a;switch(Ti(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&_l();break;case 3:eo(),Ce(ut),Ce(je),zi();break;case 5:Oi(r);break;case 4:eo();break;case 13:Ce(ke);break;case 19:Ce(ke);break;case 10:Di(r.type._context);break;case 22:case 23:ji()}a=a.return}if(ze=e,De=e=za(e.current,null),Ue=gt=t,Be=0,pn=null,Vi=fs=fr=0,lt=jo=null,or!==null){for(t=0;t<or.length;t++)if(a=or[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}or=null}return e}function Xp(e,t){do{var a=De;try{if(Ai(),bl.current=Ql,Xl){for(var r=be.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Xl=!1}if(dr=0,Oe=Fe=be=null,Ko=!1,dn=0,$i.current=null,a===null||a.return===null){Be=1,pn=t,De=null;break}e:{var n=e,l=a.return,s=a,u=t;if(t=Ue,s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var d=u,g=s,m=g.tag;if((g.mode&1)===0&&(m===0||m===11||m===15)){var c=g.alternate;c?(g.updateQueue=c.updateQueue,g.memoizedState=c.memoizedState,g.lanes=c.lanes):(g.updateQueue=null,g.memoizedState=null)}var y=Vf(l);if(y!==null){y.flags&=-257,Kf(y,l,s,n,t),y.mode&1&&$f(n,d,t),t=y,u=d;var x=t.updateQueue;if(x===null){var C=new Set;C.add(u),t.updateQueue=C}else x.add(u);break e}else{if((t&1)===0){$f(n,d,t),Xi();break e}u=Error(R(426))}}else if(we&&s.mode&1){var O=Vf(l);if(O!==null){(O.flags&65536)===0&&(O.flags|=256),Kf(O,l,s,n,t),Ri(to(u,s));break e}}n=u=to(u,s),Be!==4&&(Be=2),jo===null?jo=[n]:jo.push(n),n=l;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var f=Dp(n,u,t);Nf(n,f);break e;case 1:s=u;var i=n.type,p=n.stateNode;if((n.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Ba===null||!Ba.has(p)))){n.flags|=65536,t&=-t,n.lanes|=t;var L=Ep(n,s,t);Nf(n,L);break e}}n=n.return}while(n!==null)}Jp(a)}catch(I){t=I,De===a&&a!==null&&(De=a=a.return);continue}break}while(!0)}function Qp(){var e=Yl.current;return Yl.current=Ql,e===null?Ql:e}function Xi(){(Be===0||Be===3||Be===2)&&(Be=4),ze===null||(fr&268435455)===0&&(fs&268435455)===0||Pa(ze,Ue)}function es(e,t){var a=pe;pe|=2;var r=Qp();(ze!==e||Ue!==t)&&(ua=null,lr(e,t));do try{Rx();break}catch(o){Xp(e,o)}while(!0);if(Ai(),pe=a,Yl.current=r,De!==null)throw Error(R(261));return ze=null,Ue=0,Be}function Rx(){for(;De!==null;)Yp(De)}function Mx(){for(;De!==null&&!rh();)Yp(De)}function Yp(e){var t=em(e.alternate,e,gt);e.memoizedProps=e.pendingProps,t===null?Jp(e):De=t,$i.current=null}function Jp(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=Ix(a,t,gt),a!==null){De=a;return}}else{if(a=Cx(a,t),a!==null){a.flags&=32767,De=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Be=6,De=null;return}}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Be===0&&(Be=5)}function ar(e,t,a){var r=xe,o=bt.transition;try{bt.transition=null,xe=1,Ax(e,t,a,r)}finally{bt.transition=o,xe=r}return null}function Ax(e,t,a,r){do Xr();while(Ra!==null);if((pe&6)!==0)throw Error(R(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(R(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(ph(e,n),e===ze&&(De=ze=null,Ue=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||Sl||(Sl=!0,tm(Bl,function(){return Xr(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=bt.transition,bt.transition=null;var l=xe;xe=1;var s=pe;pe|=4,$i.current=null,kx(e,a),Kp(a,e),Zh(_u),zl=!!Uu,_u=Uu=null,e.current=a,bx(a,e,o),oh(),pe=s,xe=l,bt.transition=n}else e.current=a;if(Sl&&(Sl=!1,Ra=e,Zl=o),n=e.pendingLanes,n===0&&(Ba=null),sh(a.stateNode,r),dt(e,Me()),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(Jl)throw Jl=!1,e=si,si=null,e;return(Zl&1)!==0&&e.tag!==0&&Xr(),n=e.pendingLanes,(n&1)!==0?e===ui?Xo++:(Xo=0,ui=e):Xo=0,qa(),null}function Xr(){if(Ra!==null){var e=Dc(Zl),t=bt.transition,a=xe;try{if(bt.transition=null,xe=16>e?16:e,Ra===null)var r=!1;else{if(e=Ra,Ra=null,Zl=0,(pe&6)!==0)throw Error(R(331));var o=pe;for(pe|=4,N=e.current;N!==null;){var n=N,l=n.child;if((N.flags&16)!==0){var s=n.deletions;if(s!==null){for(var u=0;u<s.length;u++){var d=s[u];for(N=d;N!==null;){var g=N;switch(g.tag){case 0:case 11:case 15:Go(8,g,n)}var m=g.child;if(m!==null)m.return=g,N=m;else for(;N!==null;){g=N;var c=g.sibling,y=g.return;if(Wp(g),g===d){N=null;break}if(c!==null){c.return=y,N=c;break}N=y}}}var x=n.alternate;if(x!==null){var C=x.child;if(C!==null){x.child=null;do{var O=C.sibling;C.sibling=null,C=O}while(C!==null)}}N=n}}if((n.subtreeFlags&2064)!==0&&l!==null)l.return=n,N=l;else e:for(;N!==null;){if(n=N,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:Go(9,n,n.return)}var f=n.sibling;if(f!==null){f.return=n.return,N=f;break e}N=n.return}}var i=e.current;for(N=i;N!==null;){l=N;var p=l.child;if((l.subtreeFlags&2064)!==0&&p!==null)p.return=l,N=p;else e:for(l=i;N!==null;){if(s=N,(s.flags&2048)!==0)try{switch(s.tag){case 0:case 11:case 15:ds(9,s)}}catch(I){Te(s,s.return,I)}if(s===l){N=null;break e}var L=s.sibling;if(L!==null){L.return=s.return,N=L;break e}N=s.return}}if(pe=o,qa(),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(as,e)}catch{}r=!0}return r}finally{xe=a,bt.transition=t}}return!1}function nc(e,t,a){t=to(a,t),t=Dp(e,t,1),e=Fa(e,t,1),t=Je(),e!==null&&(mn(e,1,t),dt(e,t))}function Te(e,t,a){if(e.tag===3)nc(e,e,a);else for(;t!==null;){if(t.tag===3){nc(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ba===null||!Ba.has(r))){e=to(a,e),e=Ep(t,e,1),t=Fa(t,e,1),e=Je(),t!==null&&(mn(t,1,e),dt(t,e));break}}t=t.return}}function Dx(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=Je(),e.pingedLanes|=e.suspendedLanes&a,ze===e&&(Ue&a)===a&&(Be===4||Be===3&&(Ue&130023424)===Ue&&500>Me()-Ki?lr(e,0):Vi|=a),dt(e,t)}function Zp(e,t){t===0&&((e.mode&1)===0?t=1:(t=sl,sl<<=1,(sl&130023424)===0&&(sl=4194304)));var a=Je();e=ga(e,t),e!==null&&(mn(e,t,a),dt(e,a))}function Ex(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Zp(e,a)}function Fx(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(R(314))}r!==null&&r.delete(t),Zp(e,a)}var em;em=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||ut.current)st=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return st=!1,Sx(e,t,a);st=(e.flags&131072)!==0}else st=!1,we&&(t.flags&1048576)!==0&&op(t,$l,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Tl(e,t),e=t.pendingProps;var o=Yr(t,je.current);jr(t,a),o=Hi(null,t,r,e,o,a);var n=Ui();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,it(r)?(n=!0,ql(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Fi(t),o.updater=is,t.stateNode=o,o._reactInternals=t,Qu(t,r,e,a),t=Zu(null,t,r,!0,n,a)):(t.tag=0,we&&n&&Pi(t),Ye(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(Tl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Ox(r),e=zt(r,e),o){case 0:t=Ju(null,t,r,e,a);break e;case 1:t=Xf(null,t,r,e,a);break e;case 11:t=Gf(null,t,r,e,a);break e;case 14:t=jf(null,t,r,zt(r.type,e),a);break e}throw Error(R(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zt(r,o),Ju(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zt(r,o),Xf(e,t,r,o,a);case 3:e:{if(zp(t),e===null)throw Error(R(387));r=t.pendingProps,n=t.memoizedState,o=n.element,dp(e,t),Gl(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=to(Error(R(423)),t),t=Qf(e,t,r,a,o);break e}else if(r!==o){o=to(Error(R(424)),t),t=Qf(e,t,r,a,o);break e}else for(ht=Ea(t.stateNode.containerInfo.firstChild),xt=t,we=!0,Ht=null,a=up(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Jr(),r===o){t=ha(e,t,a);break e}Ye(e,t,r,a)}t=t.child}return t;case 5:return fp(t),e===null&&Gu(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,l=o.children,qu(r,o)?l=null:n!==null&&qu(r,n)&&(t.flags|=32),Op(e,t),Ye(e,t,l,a),t.child;case 6:return e===null&&Gu(t),null;case 13:return Np(e,t,a);case 4:return Bi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zr(t,null,r,a):Ye(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zt(r,o),Gf(e,t,r,o,a);case 7:return Ye(e,t,t.pendingProps,a),t.child;case 8:return Ye(e,t,t.pendingProps.children,a),t.child;case 12:return Ye(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,Le(Vl,r._currentValue),r._currentValue=l,n!==null)if(qt(n.value,l)){if(n.children===o.children&&!ut.current){t=ha(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 u=s.firstContext;u!==null;){if(u.context===r){if(n.tag===1){u=ca(-1,a&-a),u.tag=2;var d=n.updateQueue;if(d!==null){d=d.shared;var g=d.pending;g===null?u.next=u:(u.next=g.next,g.next=u),d.pending=u}}n.lanes|=a,u=n.alternate,u!==null&&(u.lanes|=a),ju(n.return,a,t),s.lanes|=a;break}u=u.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(R(341));l.lanes|=a,s=l.alternate,s!==null&&(s.lanes|=a),ju(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}Ye(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,jr(t,a),o=Pt(o),r=r(o),t.flags|=1,Ye(e,t,r,a),t.child;case 14:return r=t.type,o=zt(r,t.pendingProps),o=zt(r.type,o),jf(e,t,r,o,a);case 15:return Fp(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zt(r,o),Tl(e,t),t.tag=1,it(r)?(e=!0,ql(t)):e=!1,jr(t,a),Ap(t,r,o),Qu(t,r,o,a),Zu(null,t,r,!0,e,a);case 19:return Hp(e,t,a);case 22:return Bp(e,t,a)}throw Error(R(156,t.tag))};function tm(e,t){return Tc(e,t)}function Bx(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 kt(e,t,a,r){return new Bx(e,t,a,r)}function Qi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ox(e){if(typeof e=="function")return Qi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gi)return 11;if(e===hi)return 14}return 2}function za(e,t){var a=e.alternate;return a===null?(a=kt(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 Al(e,t,a,r,o,n){var l=2;if(r=e,typeof e=="function")Qi(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Er:return sr(a.children,o,n,t);case mi:l=8,o|=8;break;case Lu:return e=kt(12,a,t,o|2),e.elementType=Lu,e.lanes=n,e;case Su:return e=kt(13,a,t,o),e.elementType=Su,e.lanes=n,e;case Iu:return e=kt(19,a,t,o),e.elementType=Iu,e.lanes=n,e;case fc:return cs(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ic:l=10;break e;case dc:l=9;break e;case gi:l=11;break e;case hi:l=14;break e;case wa:l=16,r=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=kt(l,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function sr(e,t,a,r){return e=kt(7,e,r,t),e.lanes=a,e}function cs(e,t,a,r){return e=kt(22,e,r,t),e.elementType=fc,e.lanes=a,e.stateNode={isHidden:!1},e}function xu(e,t,a){return e=kt(6,e,null,t),e.lanes=a,e}function vu(e,t,a){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zx(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=tu(0),this.expirationTimes=tu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Yi(e,t,a,r,o,n,l,s,u){return e=new zx(e,t,a,s,u),t===1?(t=1,n===!0&&(t|=8)):t=0,n=kt(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fi(n),e}function Nx(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Dr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function am(e){if(!e)return Ha;e=e._reactInternals;e:{if(mr(e)!==e||e.tag!==1)throw Error(R(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(it(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(R(171))}if(e.tag===1){var a=e.type;if(it(a))return ap(e,a,t)}return t}function rm(e,t,a,r,o,n,l,s,u){return e=Yi(a,r,!0,e,o,n,l,s,u),e.context=am(null),a=e.current,r=Je(),o=Oa(a),n=ca(r,o),n.callback=t??null,Fa(a,n,o),e.current.lanes=o,mn(e,o,r),dt(e,r),e}function ps(e,t,a,r){var o=t.current,n=Je(),l=Oa(o);return a=am(a),t.context===null?t.context=a:t.pendingContext=a,t=ca(n,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Fa(o,t,l),e!==null&&(_t(e,o,l,n),kl(e,o,l)),l}function ts(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function lc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Ji(e,t){lc(e,t),(e=e.alternate)&&lc(e,t)}function Hx(){return null}var om=typeof reportError=="function"?reportError:function(e){console.error(e)};function Zi(e){this._internalRoot=e}ms.prototype.render=Zi.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(R(409));ps(e,t,null,null)};ms.prototype.unmount=Zi.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cr(function(){ps(null,e,null,null)}),t[ma]=null}};function ms(e){this._internalRoot=e}ms.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bc();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ba.length&&t!==0&&t<ba[a].priority;a++);ba.splice(a,0,e),a===0&&zc(e)}};function ed(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function gs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function sc(){}function Ux(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var d=ts(l);n.call(d)}}var l=rm(t,r,e,0,null,!1,!1,"",sc);return e._reactRootContainer=l,e[ma]=l.current,on(e.nodeType===8?e.parentNode:e),cr(),l}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var s=r;r=function(){var d=ts(u);s.call(d)}}var u=Yi(e,0,!1,null,null,!1,!1,"",sc);return e._reactRootContainer=u,e[ma]=u.current,on(e.nodeType===8?e.parentNode:e),cr(function(){ps(t,u,a,r)}),u}function hs(e,t,a,r,o){var n=a._reactRootContainer;if(n){var l=n;if(typeof o=="function"){var s=o;o=function(){var u=ts(l);s.call(u)}}ps(t,l,e,o)}else l=Ux(a,t,e,o,r);return ts(l)}Ec=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=Ho(t.pendingLanes);a!==0&&(yi(t,a|1),dt(t,Me()),(pe&6)===0&&(ao=Me()+500,qa()))}break;case 13:cr(function(){var r=ga(e,1);if(r!==null){var o=Je();_t(r,e,1,o)}}),Ji(e,1)}};Li=function(e){if(e.tag===13){var t=ga(e,134217728);if(t!==null){var a=Je();_t(t,e,134217728,a)}Ji(e,134217728)}};Fc=function(e){if(e.tag===13){var t=Oa(e),a=ga(e,t);if(a!==null){var r=Je();_t(a,e,t,r)}Ji(e,t)}};Bc=function(){return xe};Oc=function(e,t){var a=xe;try{return xe=e,t()}finally{xe=a}};Du=function(e,t,a){switch(t){case"input":if(ku(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=ls(r);if(!o)throw Error(R(90));pc(r),ku(r,o)}}}break;case"textarea":gc(e,a);break;case"select":t=a.value,t!=null&&$r(e,!!a.multiple,t,!1)}};Ic=Gi;Cc=cr;var _x={usingClientEntryPoint:!1,Events:[hn,zr,ls,Lc,Sc,Gi]},Bo={findFiberByHostInstance:rr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qx={bundleType:Bo.bundleType,version:Bo.version,rendererPackageName:Bo.rendererPackageName,rendererConfig:Bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=bc(e),e===null?null:e.stateNode},findFiberByHostInstance:Bo.findFiberByHostInstance||Hx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Oo=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Oo.isDisabled&&Oo.supportsFiber))try{as=Oo.inject(qx),Jt=Oo}catch{}var Oo;Lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_x;Lt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ed(t))throw Error(R(200));return Nx(e,t,null,a)};Lt.createRoot=function(e,t){if(!ed(e))throw Error(R(299));var a=!1,r="",o=om;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Yi(e,1,!1,null,null,a,!1,r,o),e[ma]=t.current,on(e.nodeType===8?e.parentNode:e),new Zi(t)};Lt.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(R(188)):(e=Object.keys(e).join(","),Error(R(268,e)));return e=bc(t),e=e===null?null:e.stateNode,e};Lt.flushSync=function(e){return cr(e)};Lt.hydrate=function(e,t,a){if(!gs(t))throw Error(R(200));return hs(null,e,t,!0,a)};Lt.hydrateRoot=function(e,t,a){if(!ed(e))throw Error(R(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",l=om;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(l=a.onRecoverableError)),t=rm(t,null,e,1,a??null,o,!1,n,l),e[ma]=t.current,on(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 ms(t)};Lt.render=function(e,t,a){if(!gs(t))throw Error(R(200));return hs(null,e,t,!1,a)};Lt.unmountComponentAtNode=function(e){if(!gs(e))throw Error(R(40));return e._reactRootContainer?(cr(function(){hs(null,null,e,!1,function(){e._reactRootContainer=null,e[ma]=null})}),!0):!1};Lt.unstable_batchedUpdates=Gi;Lt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!gs(a))throw Error(R(200));if(e==null||e._reactInternals===void 0)throw Error(R(38));return hs(e,t,a,!1,r)};Lt.version="18.3.1-next-f1338f8080-20240426"});var no=sa((oy,sm)=>{"use strict";function lm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lm)}catch(e){console.error(e)}}lm(),sm.exports=nm()});var im=sa(td=>{"use strict";var um=no();td.createRoot=um.createRoot,td.hydrateRoot=um.hydrateRoot;var ny});var gm=sa(Cs=>{"use strict";var Kx=Se(),Gx=Symbol.for("react.element"),jx=Symbol.for("react.fragment"),Xx=Object.prototype.hasOwnProperty,Qx=Kx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Yx={key:!0,ref:!0,__self:!0,__source:!0};function mm(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)Xx.call(t,r)&&!Yx.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:Gx,type:e,key:n,ref:l,props:o,_owner:Qx.current}}Cs.Fragment=jx;Cs.jsx=mm;Cs.jsxs=mm});var $=sa((BL,hm)=>{"use strict";hm.exports=gm()});var og=A(im(),1);var te=A(Se(),1),eg=A(no(),1);function dm(e){return e.trim().replace(/^\\|/,"").replace(/\\|$/,"").split("|").map(a=>a.trim())}function Wx(e){return/^\\s*\\|?\\s*:?-{3,}:?\\s*(\\|\\s*:?-{3,}:?\\s*)+\\|?\\s*$/.test(e)}function $x(e){let t=e.split(`\n`),a=[],r=0;for(;r<t.length;){let o=t[r]??"",n=t[r+1]??"";if(o.includes("|")&&Wx(n)){let l=dm(o),s=[];for(r+=2;r<t.length&&t[r].includes("|")&&t[r].trim()!=="";)s.push(dm(t[r])),r+=1;let u=`<tr>${l.map(g=>`<th style="text-align:left;padding:7px 10px;border:1px solid #334155;color:#e2e8f0;background:#0f172a;">${g}</th>`).join("")}</tr>`,d=s.map(g=>`<tr>${g.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>${u}</thead><tbody>${d}</tbody></table></div>`);continue}a.push(t[r]),r+=1}return a.join(`\n`)}function xs(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 $x(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 Vx="proto-comments-seen";function ad(e,t){try{let a=localStorage.getItem(Vx),r=a?JSON.parse(a):{};return t>(r[e]??0)}catch{return!1}}function rd(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function ft(e){try{return new Date(e).toLocaleString()}catch{return e}}var od=16,lo=1000000n,Ls=BigInt("9".repeat(od));function Rt(e){return(e<0n?0n:e>Ls?Ls:e).toString().padStart(od,"0")}function vs(e){let t=e.split(".")[0];return/^\\d+$/.test(t)?BigInt(t):Ls}function ys(e){let t=e.indexOf(".");return t>=0?e.slice(t+1):null}function gr(e,t){if(t===null){if(e===null)return Rt(lo);let l=vs(e);if(l<Ls-lo)return Rt(l+lo);let s=ys(e)??"0".repeat(od);return Rt(l)+"."+gr(s,null)}if(e===null){let l=vs(t),s=ys(t);return l>lo?Rt(l-lo):s!==null?Rt(l)+"."+gr(null,s):l>0n?Rt(l/2n):Rt(0n)+".0"}let a=vs(e),r=vs(t),o=ys(e),n=ys(t);return r>a+1n?Rt((a+r)/2n):r===a+1n?Rt(a)+"."+gr(o,null):o===null&&n===null?Rt(a)+"."+Rt(lo):Rt(a)+"."+gr(o,n)}function vn(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 nd(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 c of s){let y=gr(m,null);o.set(c.id,y),m=y,c.id!==t&&l.push({id:c.id,sortKey:y})}}let u=a?o.get(a)??null:null,d=r?o.get(r)??null:null;return{newSortKey:gr(u,d),normalizationPatches:l}}var et=A(Se(),1);var Is=A(Se());var fm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ss=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim();var yn=A(Se());var cm={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 pm=(0,yn.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:l,...s},u)=>(0,yn.createElement)("svg",{ref:u,...cm,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Ss("lucide",o),...s},[...l.map(([d,g])=>(0,yn.createElement)(d,g)),...Array.isArray(n)?n:[n]]));var ee=(e,t)=>{let a=(0,Is.forwardRef)(({className:r,...o},n)=>(0,Is.createElement)(pm,{ref:n,iconNode:t,className:Ss(`lucide-${fm(e)}`,r),...o}));return a.displayName=`${e}`,a};var hr=ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var Ln=ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var Wa=ee("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 xr=ee("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 Sn=ee("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 so=ee("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 In=ee("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 Cn=ee("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 wn=ee("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 kn=ee("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=ee("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);var $a=ee("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 yr=ee("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 bn=ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var Va=ee("Rows3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var Pn=ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var Lr=ee("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 Tn=ee("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 uo=ee("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 Ka=ee("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 io=ee("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 Rn=ee("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 Ne=ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var co=A(Se(),1),Pm=A(no(),1);var ym=A($(),1),xm={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 vm({type:e,style:t}){let a=typeof e=="string"&&e.trim()&&e!=="[object Object]"&&xm[e]?e:"Task",r=xm[a];return(0,ym.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 Im=A($(),1),Lm={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 Sm({priority:e,style:t}){if(!e||!Lm[e])return null;let a=Lm[e];return(0,Im.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 Sr=[{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."}],NL=Sr.map(e=>e.value),wm=Object.fromEntries(Sr.map(e=>[e.value,e.icon])),HL=Object.fromEntries(Sr.map(e=>[e.value,e.css])),Cm={Task:"#94a3b8",Bug:"#ef4444",Research:"#a855f7"};function Mn(e){return Cm[e??"Task"]??Cm.Task}var km=[{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 Jx(e){let t=0;for(let a=0;a<e.length;a++)t=t*31+e.charCodeAt(a)>>>0;return t%km.length}function Wt(e){return km[Jx(e)]}var An=A($(),1);function fo({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,An.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:3,alignItems:"center"},children:e.map(n=>{let{bg:l,text:s,border:u}=Wt(n);return(0,An.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,padding:r,borderRadius:100,background:l,border:`1px solid ${u}`,color:s,fontSize:o,fontWeight:600,whiteSpace:"nowrap"},children:[n,t&&(0,An.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 le=A($(),1);function Zx(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function Tm(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 Rm(e,t){return Tm(e,t==="Critical"?.36:t==="High"?.3:.24)??"color-mix(in srgb, var(--p-text-g) 40%, transparent)"}function ev(e){return Tm(e,.1)??"transparent"}var tv={padding:"7px 8px",gap:4,opacity:1,userSelect:"none"},av={display:"flex",alignItems:"center",gap:5},rv={width:12,height:12,color:"color-mix(in srgb, var(--p-green) 55%, transparent)",flexShrink:0},ov={fontSize:11.5,fontWeight:600,color:"var(--p-text-m)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},nv={fontSize:9,fontWeight:700,color:"#22c55e",background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.3)",borderRadius:4,padding:"1px 5px",marginLeft:6,flexShrink:0,letterSpacing:.5},lv={display:"flex",alignItems:"center",gap:5,minWidth:0},sv={flexShrink:0},uv={fontSize:11.5,fontWeight:600,color:"var(--p-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},iv={display:"flex",alignItems:"flex-start",gap:8},dv={fontSize:10,color:"var(--p-text-g)",lineHeight:"1.45",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,flex:1,minWidth:0},fv={position:"relative",flexShrink:0},cv={width:52,height:34,borderRadius:6,objectFit:"cover",border:"1px solid color-mix(in srgb, var(--p-border) 90%, transparent)",display:"block",cursor:"pointer"},pv={display:"flex",alignItems:"center",gap:2,marginTop:1},mv={flex:1},ld=co.default.memo(function({task:t,col:a,liveActivity:r,compact:o,onOpen:n,onDragStart:l}){var _;let s=a.id==="in-progress",u=a.id==="done",[d,g]=co.default.useState(!1),[m,c]=co.default.useState(null),y=co.default.useRef(null),x=t.commentCount??0,C=t.fileCount??0,O=x>0&&ad(t.id,x),f=Rm(a.color,t.priority),i=Mn(t.type),p=ev(i),L=(_=t.files)==null?void 0:_.find(k=>Zx(k.name)),I=L?`/api/tasks/${t.id}/files/${encodeURIComponent(L.name)}`:null;function P(k){l(k,t.id),k.currentTarget.classList.add("dragging")}function v(k){k.currentTarget.classList.remove("dragging")}function S(){n(t)}if(o||u){let k=a.id==="in-progress"?"sd-inprogress":`sd-${a.id}`;return(0,le.jsx)("article",{className:"task-card",draggable:!0,"data-task-id":t.id,"data-compact":o?"true":void 0,style:{...tv},onDragStart:P,onDragEnd:v,onClick:S,children:(0,le.jsxs)("div",{style:av,children:[u?(0,le.jsx)(Wa,{style:rv}):(0,le.jsx)("span",{className:k,style:{flexShrink:0}}),(0,le.jsx)("span",{style:{...ov,...u?{}:{color:"var(--p-text)"}},children:t.title}),!o&&!u&&t.tags&&t.tags.length>0&&(0,le.jsx)(fo,{tags:t.tags,size:"xs"}),!o&&!u&&(x>0||C>0)&&(0,le.jsxs)("span",{style:{fontSize:9,color:"var(--p-text-m)",flexShrink:0},children:[x>0&&`\\u{1F4AC}${x}`,x>0&&C>0&&" ",C>0&&`\\u{1F4CE}${C}`]}),u&&t.verified&&(0,le.jsx)("span",{style:nv,children:"\\u2713 VERIFIED"})]})})}return(0,le.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)":p,border:r?"1px solid rgba(59,130,246,0.5)":f?`1px solid ${f}`:void 0,...r?{boxShadow:"0 0 0 2px rgba(59,130,246,0.14)"}:{}},onDragStart:P,onDragEnd:v,onClick:S,children:[(0,le.jsxs)("div",{style:lv,children:[s&&(0,le.jsx)("span",{className:"spinner",style:sv}),(0,le.jsx)("span",{style:uv,children:t.title})]}),(t.description||I)&&(0,le.jsxs)("div",{style:iv,children:[t.description&&(0,le.jsx)("div",{style:dv,children:t.description}),I&&(0,le.jsxs)("div",{style:fv,onMouseEnter:()=>{if(y.current){let k=y.current.getBoundingClientRect();c({top:k.top,right:k.right})}g(!0)},onMouseLeave:()=>{g(!1),c(null)},children:[(0,le.jsx)("img",{ref:y,src:I,alt:"Task screenshot","data-role":"task-thumb",style:cv}),d&&m&&Pm.default.createPortal((0,le.jsx)("img",{src:I,alt:"Task screenshot enlarged preview","data-role":"task-thumb-preview",style:{position:"fixed",right:window.innerWidth-m.right,bottom:window.innerHeight-m.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,le.jsxs)("div",{className:"flex items-center",style:pv,children:[(0,le.jsx)(vm,{type:t.type}),t.priority&&(0,le.jsx)(Sm,{priority:t.priority}),s&&t.assigneeName&&(0,le.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,le.jsx)(fo,{tags:t.tags,size:"xs"}),(0,le.jsx)("div",{style:mv}),r&&(0,le.jsx)(sd,{activity:r}),(0,le.jsx)(bm,{icon:(0,le.jsx)(vr,{style:{width:9,height:9}}),label:x>0?String(x):"",color:O?"var(--p-purple)":x>0?"var(--p-text-m)":"var(--p-border-t)",hoverColor:O?"var(--p-purple-300)":"var(--p-text)",title:x>0?`${x} comment(s)`:"Add comment",badge:O,badgeColor:"var(--p-purple)",onClick:k=>{k.stopPropagation(),n(t,"comments")}}),(0,le.jsx)(bm,{icon:(0,le.jsx)(yr,{style:{width:9,height:9}}),label:C>0?String(C):"",color:C>0?"var(--p-blue-300)":"var(--p-border-t)",hoverColor:C>0?"var(--p-cyan-300)":"var(--p-text-sub)",title:C>0?`${C} file(s) attached`:"Files",onClick:k=>{k.stopPropagation(),n(t,"files")}})]})]})});function bm({icon:e,label:t,color:a,hoverColor:r,title:o,badge:n,badgeColor:l,onClick:s}){let[u,d]=co.default.useState(!1);return(0,le.jsxs)("button",{style:{display:"inline-flex",alignItems:"center",gap:2,padding:"2px 3px",borderRadius:3,border:"none",background:u?"color-mix(in srgb, var(--p-text-m) 10%, transparent)":"transparent",cursor:"pointer",fontSize:9,color:u?r:a,transition:"color .1s, background .1s"},title:o,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:s,children:[e,t&&(0,le.jsx)("span",{children:t}),n&&(0,le.jsx)("span",{style:{width:4,height:4,background:l??a,borderRadius:"50%",flexShrink:0}})]})}function sd({activity:e}){let t=e.state==="locked"||e.state==="editing",a=t?(0,le.jsx)(kn,{style:{width:8,height:8}}):(0,le.jsx)(Sn,{style:{width:8,height:8}}),r=t?`Locked by ${e.user}`:`${e.user} viewing`;return(0,le.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,le.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",minWidth:0,flex:"1 1 0"},children:e.user})]})}var ge=A($(),1),Ga=[{id:"backlog",label:"Backlog",color:"var(--p-text-f)",accent:"color-mix(in srgb, var(--p-text-g) 25%, transparent)"},{id:"todo",label:"Todo",color:"var(--p-amber)",accent:"color-mix(in srgb, var(--p-amber) 18%, transparent)"},{id:"in-progress",label:"In Progress",color:"var(--p-blue)",accent:"color-mix(in srgb, var(--p-blue) 18%, transparent)",glow:!0},{id:"review",label:"Review",color:"var(--p-purple)",accent:"color-mix(in srgb, var(--p-purple) 18%, transparent)"},{id:"done",label:"Done",color:"var(--p-green)",accent:"color-mix(in srgb, var(--p-green) 18%, transparent)"}];var gv=3;function hv(){return(0,ge.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,ge.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"75%",marginBottom:8}}),(0,ge.jsx)("div",{style:{height:10,borderRadius:4,background:"var(--p-border-s)",width:"50%",marginBottom:8}}),(0,ge.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,ge.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:48}}),(0,ge.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,compact:n,onOpenPanel:l,onDrop:s,onReorder:u}){let d=et.default.useRef(null),g=et.default.useRef(null),[m,c]=et.default.useState(null),[y,x]=et.default.useState(null),[C,O]=et.default.useState(null),f=et.default.useRef(null),i=et.default.useRef(null),p=a?e.filter(k=>(k.title??"").toLowerCase().includes(a.toLowerCase())||(k.description??"").toLowerCase().includes(a.toLowerCase())):e,L=Ga.filter(k=>t.includes(k.id));et.default.useEffect(()=>{let k=d.current,M=g.current;if(!k||!M)return;function U(){if(!k||!M)return;let j=k.scrollWidth>k.clientWidth?k.clientWidth/k.scrollWidth:1,se=Math.max(40,k.clientWidth*j);M.style.width=`${se}px`;let qe=k.scrollWidth-k.clientWidth,at=k.clientWidth-se;M.style.left=`${qe>0?k.scrollLeft/qe*at:0}px`,M.style.opacity=j<1?"1":"0"}k.addEventListener("scroll",U);let z=new ResizeObserver(U);z.observe(k),U();let V=!1,ae=0,T=0;function K(j){V=!0,ae=j.clientX,T=k.scrollLeft,M.classList.add("dragging"),document.addEventListener("mousemove",re),document.addEventListener("mouseup",J)}function re(j){if(!V||!k||!M)return;let se=k.scrollWidth>k.clientWidth?k.scrollWidth/k.clientWidth:1;k.scrollLeft=T+(j.clientX-ae)*se}function J(){V=!1,M==null||M.classList.remove("dragging"),document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",J)}return M.addEventListener("mousedown",K),()=>{k.removeEventListener("scroll",U),z.disconnect(),M.removeEventListener("mousedown",K)}},[L.length]);function I(k,M){f.current=M,c(M),k.dataTransfer.effectAllowed="move"}function P(k,M){k.preventDefault(),x(M)}function v(k,M){k.preventDefault(),k.stopPropagation();let U=k.currentTarget.getBoundingClientRect(),z=k.clientY<U.top+U.height/2?"before":"after",V={taskId:M,position:z};i.current=V,O(ae=>(ae==null?void 0:ae.taskId)===M&&ae.position===z?ae:V)}function S(k,M,U){k.preventDefault(),x(null);let z=i.current;i.current=null,O(null);let V=f.current;if(f.current=null,c(null),!!V)if(u&&z){let ae=U.findIndex(re=>re.id===z.taskId),T=null,K=null;z.position==="before"?(K=z.taskId,T=ae>0?U[ae-1].id:null):(T=z.taskId,K=ae<U.length-1?U[ae+1].id:null),u(V,M,T,K)}else s(V,M)}function _(){f.current=null,c(null),x(null),i.current=null,O(null)}return(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)("main",{id:"kanban-board",ref:d,className:"flex-1 flex overflow-x-auto overflow-y-hidden",style:{padding:"16px 20px",gap:16},onDragEnd:_,children:L.map(k=>{let M=r?[]:p.filter(z=>z.status===k.id).sort(vn),U=k.id==="done"?[...M].reverse():M;return(0,ge.jsx)(xv,{col:k,tasks:U,isLoading:r,liveActivities:o,compact:n,isDragOver:y===k.id&&!C,onDragOver:z=>P(z,k.id),onDrop:z=>S(z,k.id,M),onDragLeave:z=>{let V=z.relatedTarget;V&&z.currentTarget.contains(V)||(x(null),i.current=null,O(null))},onStatusChange:(z,V)=>s(z,V),onAddTask:()=>l(null,"details",k.id),onOpenTask:l,onDragStart:I,onCardDragOver:v,cardDropTarget:C,isDragging:m!==null},k.id)})}),(0,ge.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,ge.jsx)("div",{id:"kanban-scroll-thumb",ref:g,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:k=>{k.currentTarget.style.background="var(--p-text-g)"},onMouseLeave:k=>{k.currentTarget.classList.contains("dragging")||(k.currentTarget.style.background="var(--p-border-t)")}})})]})}function xv({col:e,tasks:t,isLoading:a,liveActivities:r,isDragOver:o,onDragOver:n,onDrop:l,onDragLeave:s,onStatusChange:u,onAddTask:d,onOpenTask:g,onDragStart:m,onCardDragOver:c,cardDropTarget:y,compact:x,isDragging:C}){let[O,f]=et.default.useState(!1),i=et.default.useRef(null),[p,L]=et.default.useState(0),[I,P]=et.default.useState(0);et.default.useEffect(()=>{if(e.id!=="done")return;let T=i.current;if(!T)return;L(J=>J===T.clientHeight?J:T.clientHeight);let K=0,re=new ResizeObserver(()=>{cancelAnimationFrame(K),K=requestAnimationFrame(()=>{L(J=>J===T.clientHeight?J:T.clientHeight)})});return re.observe(T),()=>{cancelAnimationFrame(K),re.disconnect()}},[]),et.default.useEffect(()=>{if(e.id!=="done"||C||a||t.length===0)return;let T=requestAnimationFrame(()=>{let K=i.current;if(!K)return;let re=K.querySelector("[data-task-id]");!re||re.offsetHeight<=0||P(J=>J===re.offsetHeight?J:re.offsetHeight)});return()=>cancelAnimationFrame(T)},[t.length,C,a]);let v=e.id==="in-progress"?"sd-inprogress":`sd-${e.id}`,S=10,_=e.id==="done",k=34,M=5,z=_&&I>0&&p>0&&!C&&!a?Math.max(1,Math.floor(Math.max(0,p-k+M)/(I+M))):S,V=_?t.slice(0,z):t,ae=t.length-V.length;return(0,ge.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,ge.jsxs)("div",{className:"column-header",style:{background:e.accent,borderColor:`color-mix(in srgb, ${e.color} 30%, transparent)`},children:[(0,ge.jsx)("div",{className:`status-dot ${v}`}),(0,ge.jsxs)("span",{style:{fontSize:12,fontWeight:600,color:e.id==="done"?`${e.color}b3`:e.color},children:[e.label,a?"":` \\xB7 ${t.length}`]}),(0,ge.jsx)("span",{style:{marginLeft:"auto"}}),(0,ge.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:O?e.color:"var(--p-text-g)",cursor:"pointer",transition:"color .15s",padding:0},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:d,children:(0,ge.jsx)(bn,{style:{width:14,height:14}})})]}),(0,ge.jsx)("div",{className:"column-scroll","data-status":e.id,ref:i,children:a?Array.from({length:gv}).map((T,K)=>(0,ge.jsx)(hv,{},K)):t.length===0?(0,ge.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,ge.jsxs)(ge.Fragment,{children:[V.map(T=>(0,ge.jsxs)("div",{style:{position:"relative"},onDragOver:K=>c(K,T.id),children:[(y==null?void 0:y.taskId)===T.id&&y.position==="before"&&(0,ge.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}}),(0,ge.jsx)(ld,{task:T,col:e,liveActivity:r==null?void 0:r.get(T.id),compact:x,onOpen:g,onDragStart:m}),(y==null?void 0:y.taskId)===T.id&&y.position==="after"&&(0,ge.jsx)("div",{style:{height:2,borderRadius:1,background:e.color,margin:"2px 0"}})]},T.id)),ae>0&&(0,ge.jsxs)("div",{"data-fit-chip":!0,style:{background:"var(--p-card)",border:"2px dashed var(--p-border-t)",borderRadius:10,padding:"11px 13px",fontSize:12,color:"var(--p-text-g)",textAlign:"center",lineHeight:1.4,opacity:.7},children:["+",ae," more"]})]})})]})}var Ir=A(Se(),1);var oe=A($(),1),Mm={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)"}},vv=wm,Am={Critical:"var(--p-red)",High:"var(--p-amber-300)",Medium:"var(--p-text-m)",Low:"var(--p-text-f)"},id=["todo","in-progress","review","backlog","done"];function yv(){return(0,oe.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,oe.jsx)("div",{style:{width:14,height:14,borderRadius:3,background:"var(--p-border-s)"}}),(0,oe.jsx)("div",{style:{height:12,borderRadius:4,background:"var(--p-border-s)",width:"60%"}}),(0,oe.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:44}}),(0,oe.jsx)("div",{style:{height:18,borderRadius:10,background:"var(--p-border-s)",width:36}})]})}function dd({tasks:e,searchQuery:t,isLoading:a,liveActivities:r,onOpenPanel:o,onAddTask:n,onDrop:l}){let[s,u]=Ir.default.useState(null),[d,g]=Ir.default.useState(null),[m,c]=Ir.default.useState(null),[y,x]=Ir.default.useState({backlog:!1,todo:!1,"in-progress":!1,review:!1,done:!1}),C=t?e.filter(f=>(f.title??"").toLowerCase().includes(t.toLowerCase())||(f.description??"").toLowerCase().includes(t.toLowerCase())):e,O=Ir.default.useMemo(()=>{let f=new Map;for(let i of id)f.set(i,[]);for(let i of C)(f.get(i.status)??[]).push(i);return f},[C]);return(0,oe.jsxs)("div",{id:"kanban-list-view",style:{flex:1,overflowY:"auto",padding:"16px 24px",minHeight:0},children:[a?id.slice(0,3).map(f=>{let i=Mm[f];return(0,oe.jsxs)("div",{style:{marginBottom:24},children:[(0,oe.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,oe.jsx)("div",{style:{width:18,height:18,borderRadius:5,background:"var(--p-border-s)",animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,oe.jsx)("div",{style:{height:18,borderRadius:6,background:i.bg,border:`1px solid ${i.border}`,width:72,animation:"skeleton-pulse 1.5s ease-in-out infinite"}}),(0,oe.jsx)("div",{style:{height:14,borderRadius:4,background:"var(--p-border-s)",width:16,animation:"skeleton-pulse 1.5s ease-in-out infinite"}})]}),(0,oe.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:Array.from({length:3}).map((p,L)=>(0,oe.jsx)(yv,{},L))})]},f)}):id.map(f=>{let i=O.get(f)??[];if(i.length===0)return null;let p=Mm[f];return(0,oe.jsxs)("div",{style:{marginBottom:24},children:[(0,oe.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8,padding:"4px 6px",borderRadius:6,transition:"background .1s",background:d===f?p.bg:"transparent",outline:d===f?`1px dashed ${p.border}`:void 0},onDragOver:L=>{L.preventDefault(),g(f)},onDragLeave:()=>g(null),onDrop:L=>{L.preventDefault(),g(null),c(null),s&&l(s,f),u(null)},children:[(0,oe.jsx)("button",{type:"button",title:y[f]?"Expand":"Collapse",onClick:L=>{L.stopPropagation(),x(I=>({...I,[f]:!I[f]}))},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:y[f]?"+":"\\u2212"}),(0,oe.jsx)("span",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"2px 8px",borderRadius:6,background:p.bg,border:`1px solid ${p.border}`,color:p.text},children:f}),(0,oe.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)"},children:i.length}),(0,oe.jsx)("button",{type:"button",title:`Add task to ${f}`,onClick:L=>{L.stopPropagation(),n(f)},style:{marginLeft:"auto",width:22,height:22,borderRadius:7,border:`1px solid ${p.border}`,background:p.bg,color:p.text,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:600},children:"+"})]}),(0,oe.jsx)("div",{style:{display:y[f]?"none":"flex",flexDirection:"column",gap:2},children:i.map(L=>(0,oe.jsx)(Lv,{task:L,liveActivity:r==null?void 0:r.get(L.id),onOpen:o,onDragStart:I=>u(I),dragOver:m===L.id,onDragOver:()=>c(L.id),onDragLeave:()=>c(I=>I===L.id?null:I),onDropToStatus:()=>{s&&l(s,L.status),u(null),c(null)}},L.id))})]},f)}),!a&&C.length===0&&(0,oe.jsx)("div",{style:{textAlign:"center",color:"var(--p-text-g)",fontSize:13,marginTop:60},children:"No tasks found"})]})}function Lv({task:e,liveActivity:t,onOpen:a,onDragStart:r,dragOver:o,onDragOver:n,onDragLeave:l,onDropToStatus:s}){let[u,d]=Ir.default.useState(!1),g=vv[e.type??"Task"]??"\\u2611",m=e.commentCount??0,c=e.fileCount??0;return(0,oe.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)":u?"var(--p-hover)":"transparent",border:`1px solid ${o?"color-mix(in srgb, var(--p-blue) 40%, transparent)":u?"var(--p-border)":"transparent"}`,cursor:"grab",transition:"background .1s,border-color .1s",userSelect:"none"},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:()=>a(e),onDragStart:y=>{y.dataTransfer.effectAllowed="move",r(e.id),y.currentTarget.style.opacity="0.4"},onDragEnd:y=>{y.currentTarget.style.opacity="1"},onDragOver:y=>{y.preventDefault(),n()},onDragLeave:l,onDrop:y=>{y.preventDefault(),s()},children:[(0,oe.jsx)("span",{style:{fontSize:12,textAlign:"center",flexShrink:0},children:g}),(0,oe.jsxs)("div",{style:{minWidth:0},children:[(0,oe.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,oe.jsx)("span",{style:{fontSize:13,fontWeight:500,color:"var(--p-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),e.priority&&Am[e.priority]&&(0,oe.jsx)(In,{className:"w-2.5 h-2.5 flex-shrink-0",style:{color:Am[e.priority]}}),e.component&&(0,oe.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,oe.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,oe.jsxs)("button",{title:m>0?`${m} comment(s)`:"Add comment",style:{display:"flex",alignItems:"center",gap:3,fontSize:11,color:m>0?"var(--p-text-m)":"var(--p-border-t)",background:"none",border:"none",cursor:"pointer",padding:"0 2px",flexShrink:0},onClick:y=>{y.stopPropagation(),a(e,"comments")},children:[(0,oe.jsx)(vr,{className:"w-3 h-3"}),m>0&&(0,oe.jsx)("span",{children:m})]}),c>0&&(0,oe.jsxs)("button",{title:`${c} 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:y=>{y.stopPropagation(),a(e,"files")},children:[(0,oe.jsx)(yr,{className:"w-3 h-3"}),(0,oe.jsx)("span",{children:c})]}),t&&(0,oe.jsx)(sd,{activity:t})]})}var mo=A(Se(),1);var ja=A($(),1);function Dm({size:e=32,style:t,className:a}){return(0,ja.jsxs)("svg",{width:e,height:e,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:a,"aria-label":"Vibeflow",role:"img",children:[(0,ja.jsx)("rect",{width:"18",height:"18",rx:"4",fill:"#2563eb"}),(0,ja.jsx)("rect",{x:"2.5",y:"4",width:"2.5",height:"10",rx:"1",fill:"white",opacity:"0.9"}),(0,ja.jsx)("rect",{x:"6.5",y:"3",width:"2.5",height:"12",rx:"1",fill:"white"}),(0,ja.jsx)("rect",{x:"10.5",y:"5",width:"2.5",height:"8",rx:"1",fill:"white",opacity:"0.8"}),(0,ja.jsx)("rect",{x:"14.5",y:"6",width:"2.5",height:"6",rx:"1",fill:"white",opacity:"0.6"})]})}var ws=A($(),1);function po({id:e,title:t,onClick:a,label:r,icon:o,variant:n="neutral"}){return(0,ws.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,ws.jsx)("span",{children:r})]})}var X=A($(),1);function fd({projectName:e,projectIcon:t,missingProjectIconStyle:a="initial",wsConnected:r,port:o,searchQuery:n,isLoading:l,filterTags:s,allTags:u,onToggleTag:d,backHref:g,backLabel:m,onSearchChange:c,onSettings:y,extraActions:x,taskSummary:C}){let[O,f]=mo.default.useState(!1),[i,p]=mo.default.useState(0),L=mo.default.useRef(null),I=mo.default.useRef(null),P=n.match(/(?:^|\\s)#(\\S*)$/),v=P?P[1]:null,S=s??[],_=(u??[]).filter(T=>!S.includes(T)),k=v===null?[]:_.filter(T=>T.toLowerCase().includes(v.toLowerCase()));mo.default.useEffect(()=>{p(0)},[k.length]);function M(T){var re;let K=n.replace(/\\s*#\\S*$/,"");c(K),d==null||d(T),(re=L.current)==null||re.focus()}function U(T){if(T.key==="Backspace"&&n===""&&S.length>0){T.preventDefault(),d==null||d(S[S.length-1]);return}if(!(v===null||k.length===0)){if(T.key==="ArrowDown")T.preventDefault(),p(K=>Math.min(K+1,k.length-1));else if(T.key==="ArrowUp")T.preventDefault(),p(K=>Math.max(K-1,0));else if(T.key==="Enter")T.preventDefault(),k[i]&&M(k[i]);else if(T.key==="Escape"){let K=n.replace(/\\s*#\\S*$/,"");c(K)}}}let z=(t??"").trim(),V=e?e.charAt(0).toUpperCase()+e.slice(1):"Vibeflow Board",ae=n||S.length>0;return(0,X.jsxs)("header",{className:"px-5 py-3 flex items-center gap-3 border-b border-slate-800/60 flex-shrink-0",children:[(0,X.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[g&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("a",{id:"header-back-link",href:g,className:"text-xs text-slate-400 hover:text-slate-200 transition-colors no-underline",style:{textDecoration:"none",fontWeight:500},children:m??"Back"}),(0,X.jsx)(Ln,{className:"w-3 h-3 text-slate-600 flex-shrink-0"})]}),(0,X.jsx)("div",{className:"flex-shrink-0",style:{width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center",...z?{fontSize:20}:void 0},children:z||(a==="vibeflow"?(0,X.jsx)(Dm,{size:32}):(0,X.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:V,children:V.charAt(0).toUpperCase()}))}),(0,X.jsxs)("div",{children:[(0,X.jsxs)("div",{className:"flex items-center gap-2",children:[(0,X.jsx)("h1",{id:"header-project-name",className:"text-sm font-semibold text-white leading-tight",children:V}),r&&(0,X.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,X.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-green-400",style:{animation:"pulse-live 2s ease-in-out infinite"}}),(0,X.jsxs)("span",{className:"text-[10px] font-medium text-green-400",children:["live \\xB7 :",o]})]})]}),(0,X.jsxs)("p",{className:"text-[10px] text-slate-500 font-mono mt-0.5",children:[C,l&&(0,X.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,X.jsx)("div",{className:"flex-1 flex justify-center px-4",children:(0,X.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,X.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 T;return(T=L.current)==null?void 0:T.focus()},children:[(0,X.jsx)(Pn,{className:"w-3.5 h-3.5 text-slate-500 flex-shrink-0 mr-0.5"}),S.map(T=>{let{bg:K,text:re,border:J}=Wt(T);return(0,X.jsxs)("span",{style:{background:K,color:re,border:`1px solid ${J}`,display:"inline-flex",alignItems:"center",gap:3,padding:"1px 7px",borderRadius:100,fontSize:11,fontWeight:500,whiteSpace:"nowrap"},children:[T,(0,X.jsx)("button",{onClick:j=>{j.stopPropagation(),d==null||d(T)},style:{background:"none",border:"none",cursor:"pointer",padding:0,lineHeight:1,color:"inherit",opacity:.7,display:"flex"},children:(0,X.jsx)(Ne,{style:{width:9,height:9}})})]},T)}),(0,X.jsx)("input",{ref:L,id:"global-search",type:"text",placeholder:S.length===0?"Search\\u2026 or type #tag":"#tag or search\\u2026",value:n,onChange:T=>c(T.target.value),onKeyDown:U,className:"flex-1 min-w-[100px] bg-transparent border-none outline-none text-xs text-slate-200 placeholder-slate-500",autoComplete:"off",spellCheck:!1}),ae&&(0,X.jsx)("button",{id:"global-search-clear",onClick:()=>{c(""),S.forEach(T=>d==null?void 0:d(T))},className:"text-slate-500 hover:text-slate-300 transition-colors flex-shrink-0 flex",title:"Clear search and tag filters",children:(0,X.jsx)(Ne,{className:"w-3.5 h-3.5"})})]}),v!==null&&k.length>0&&(0,X.jsxs)("div",{ref:I,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,X.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"}),k.map((T,K)=>{let{bg:re,text:J,border:j}=Wt(T);return(0,X.jsxs)("button",{onMouseDown:se=>{se.preventDefault(),M(T)},onMouseEnter:()=>p(K),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:8,padding:"7px 12px",background:K===i?"var(--p-hover)":"none",border:"none",cursor:"pointer"},children:[(0,X.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:J,flexShrink:0}}),(0,X.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:T}),(0,X.jsx)("span",{style:{marginLeft:"auto",display:"inline-flex",alignItems:"center",padding:"1px 7px",borderRadius:100,fontSize:10,background:re,color:J,border:`1px solid ${j}`},children:"tag"})]},T)}),(0,X.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,X.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[x,(0,X.jsx)(po,{id:"header-shortcuts-hint",title:"Click to see keyboard shortcuts",onClick:()=>f(!0),label:"? shortcuts"}),(0,X.jsx)(po,{id:"btn-settings",title:"Settings",onClick:y,icon:(0,X.jsx)(Lr,{className:"w-3.5 h-3.5"})})]}),O&&(0,X.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:()=>f(!1),children:(0,X.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:T=>T.stopPropagation(),children:[(0,X.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,X.jsx)("span",{style:{fontSize:13,fontWeight:700,color:"var(--p-text)"},children:"Keyboard Shortcuts"}),(0,X.jsx)("button",{onClick:()=>f(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--p-text-f)",padding:2},children:(0,X.jsx)(Ne,{style:{width:14,height:14}})})]}),(0,X.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(([T,K])=>(0,X.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,X.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:T}),(0,X.jsx)("span",{style:{fontSize:12,color:"var(--p-text-m)"},children:K})]},T))})]})})]})}var Q=A(Se(),1);var ks=A(Se(),1);var ea=A($(),1);function bs({id:e,value:t,onChange:a,disabled:r}){let[o,n]=ks.default.useState(!1),l=ks.default.useRef(null),s=Sr.find(u=>u.value===t)??Sr[0];return ks.default.useEffect(()=>{let u=d=>{var g;(g=l.current)!=null&&g.contains(d.target)||n(!1)};return document.addEventListener("click",u),()=>document.removeEventListener("click",u)},[]),(0,ea.jsxs)("div",{id:e,ref:l,style:{position:"relative",display:"inline-block"},children:[(0,ea.jsxs)("button",{type:"button",title:s==null?void 0:s.tooltip,onClick:u=>{u.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,ea.jsx)("span",{style:{fontSize:13},children:s==null?void 0:s.icon}),(0,ea.jsx)("span",{children:s==null?void 0:s.label})]}),o&&(0,ea.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:Sr.map(u=>(0,ea.jsxs)("button",{type:"button",title:u.tooltip,onClick:()=>{a(u.value),n(!1)},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",border:"none",background:u.value===t?"var(--p-hover, rgba(255,255,255,0.06))":"transparent",color:u.value===t?"var(--p-text, #fff)":"var(--p-text-f, rgba(255,255,255,0.55))",fontSize:12,cursor:"pointer",textAlign:"left"},children:[(0,ea.jsx)("span",{style:{fontSize:14,lineHeight:1},children:u.icon}),(0,ea.jsx)("span",{children:u.label})]},u.value))})]})}var tt=A(Se(),1);var Dn=A(Se(),1);var Xa=A($(),1);function ta({markdown:e,className:t,style:a}){let r=Dn.default.useRef(null),o=Dn.default.useRef({}),[n,l]=Dn.default.useState(null);return Dn.default.useEffect(()=>{let s=r.current;if(!s)return;function u(){l(null)}async function d(m){let c=m.target,y=c==null?void 0:c.closest("a[data-task-ref]");if(!y){u();return}m.preventDefault();let x=y.getAttribute("data-task-ref");if(!x)return;let C=y.getBoundingClientRect(),O=o.current[x];if(O){l({id:x,title:O.title,status:O.status,x:C.left,y:C.bottom+6});return}try{let i=await(await fetch(`/api/tasks/${x}`)).json(),p={title:i.title??`Task ${x}`,status:i.status??"unknown"};o.current[x]=p,l({id:x,title:p.title,status:p.status,x:C.left,y:C.bottom+6})}catch{l({id:x,title:`Task ${x}`,status:"unknown",x:C.left,y:C.bottom+6})}}function g(m){var x,C;let c=(C=(x=m.target)==null?void 0:x.closest)==null?void 0:C.call(x,"a[data-task-ref]");if(!c)return;let y=c.getAttribute("data-task-ref");y&&window.dispatchEvent(new CustomEvent("vibeflow-task-ref-click",{detail:{refId:y}}))}return s.addEventListener("mouseover",d),s.addEventListener("mouseleave",u),s.addEventListener("click",g),()=>{s.removeEventListener("mouseover",d),s.removeEventListener("mouseleave",u),s.removeEventListener("click",g)}},[]),(0,Xa.jsxs)("div",{style:{position:"relative"},children:[(0,Xa.jsx)("div",{ref:r,className:t,style:a,dangerouslySetInnerHTML:{__html:xs(e)}}),n&&(0,Xa.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,Xa.jsxs)("div",{style:{color:"#60a5fa",fontFamily:"Menlo,monospace",marginBottom:3},children:["#",n.id]}),(0,Xa.jsx)("div",{style:{fontWeight:600,marginBottom:3},children:n.title}),(0,Xa.jsxs)("div",{style:{color:"#94a3b8"},children:["status: ",n.status]})]})]})}var En=A(Se(),1),Em=A($(),1),go=En.default.forwardRef(function({value:t,onChange:a,baseRows:r=4,maxRows:o,style:n,...l},s){let u=En.default.useRef(null),d=o??r*2,g=En.default.useCallback(()=>{let m=u.current;if(!m)return;m.style.height="auto";let c=window.getComputedStyle(m),y=Number.parseFloat(c.lineHeight||"0")||18,x=Number.parseFloat(c.paddingTop||"0")+Number.parseFloat(c.paddingBottom||"0"),C=Number.parseFloat(c.borderTopWidth||"0")+Number.parseFloat(c.borderBottomWidth||"0"),O=r*y+x+C,f=d*y+x+C,i=Math.max(O,Math.min(m.scrollHeight,f));m.style.height=`${i}px`,m.style.overflowY=m.scrollHeight>f?"auto":"hidden"},[r,d]);return En.default.useLayoutEffect(()=>{g()},[t,g]),(0,Em.jsx)("textarea",{...l,ref:m=>{u.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 Om=A(Se(),1);var Fm=A(Se(),1),Bm=A(no(),1),aa=A($(),1);function va({open:e,onClose:t,icon:a,title:r,headerActions:o,width:n,maxHeight:l,id:s,children:u,footer:d,boxStyle:g,onKeyDown:m}){if(Fm.default.useEffect(()=>{if(!e)return;function x(C){C.key==="Escape"&&t(),m==null||m(C)}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[e,t,m]),!e)return null;let c=!!(a||r||o),y=(0,aa.jsx)("div",{id:s,className:"modal-backdrop",onClick:x=>{x.target===x.currentTarget&&t()},onMouseDown:x=>x.stopPropagation(),children:(0,aa.jsxs)("div",{className:"modal-box",style:{width:n??"min(420px, 95vw)",maxHeight:l,...g},children:[c&&(0,aa.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 18px",borderBottom:"1px solid var(--p-border)",flexShrink:0},children:[a&&(0,aa.jsx)("span",{style:{flexShrink:0,display:"flex",alignItems:"center"},children:a}),r&&(0,aa.jsx)("span",{style:{fontSize:14,fontWeight:600,color:"var(--p-text)",flex:1,minWidth:0},children:r}),o&&(0,aa.jsx)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,marginLeft:"auto"},children:o})]}),(0,aa.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:u}),d&&(0,aa.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,Bm.createPortal)(y,document.body)}var Mt=A($(),1);function ra({open:e,message:t,title:a="Confirm",confirmLabel:r="Delete",cancelLabel:o="Cancel",loading:n,error:l,onConfirm:s,onCancel:u}){let d=Om.default.useCallback(g=>{g.key==="Enter"&&s()},[s]);return(0,Mt.jsx)(va,{open:e,onClose:u,id:"confirm-modal",width:"min(380px, 95vw)",icon:(0,Mt.jsx)(Ka,{style:{width:20,height:20,color:"#f87171"}}),title:a,onKeyDown:d,footer:(0,Mt.jsxs)(Mt.Fragment,{children:[(0,Mt.jsx)("button",{id:"confirm-modal-cancel",onClick:u,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,Mt.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,Mt.jsxs)("div",{style:{padding:"16px 18px"},children:[typeof t=="string"?(0,Mt.jsx)("p",{style:{margin:0,fontSize:13,color:"var(--p-text-f)",lineHeight:1.6},children:t}):t,l&&(0,Mt.jsx)("p",{style:{margin:"8px 0 0",fontSize:12,color:"var(--p-red)"},children:l})]})})}var Ee=A($(),1);function zm(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 Sv(e){return/\\.(png|jpe?g|gif|webp|svg|html?)$/i.test(e.name)}function Iv(e){return/\\.html?$/i.test(e.name)}function Ps({file:e,url:t,variant:a,onPreview:r,onDelete:o}){let n=Sv(e),l=Iv(e);function s(){r?r(e,t):window.open(t,"_blank")}return a==="compact"?(0,Ee.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,Ee.jsx)("span",{style:{fontSize:14,flexShrink:0},children:zm(e)}),(0,Ee.jsx)("div",{style:{flex:1,minWidth:0},children:(0,Ee.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,Ee.jsx)("span",{className:"file-compact-ts",style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:e.createdAt?ft(e.createdAt):"attached"}),(0,Ee.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,Ee.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,Ee.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:u=>u.stopPropagation(),children:"\\u2193"}),o&&(0,Ee.jsx)("button",{onClick:()=>{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,Ee.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,Ee.jsx)("span",{style:{fontSize:18,flexShrink:0},children:zm(e)}),(0,Ee.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,Ee.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,Ee.jsx)("p",{style:{fontSize:10,color:"var(--p-text-f)",margin:0},children:e.linkedPath?`linked: ${e.linkedPath}`:rd(e.size??0)})]}),(0,Ee.jsxs)("div",{className:"file-normal-actions",style:{display:"flex",alignItems:"center",gap:4,transition:"opacity 0.15s"},children:[n&&(0,Ee.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,Ee.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:u=>u.stopPropagation(),children:"\\u2193"}),o&&(0,Ee.jsx)("button",{onClick:()=>{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 B=A($(),1);function Nm({source:e}){return e!=="cli"?null:(0,B.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 Cv(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 wv(e,t){let a=[];for(let r of e){let o=Cv(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 cd({comments:e,files:t=[],localChanges:a=[],loading:r,error:o,gitUserName:n="You",taskAuthorName:l,baseUrl:s="",taskId:u,taskCreatedAt:d,taskUpdatedAt:g,onEdit:m,onDelete:c,onDeleteFile:y,onFilePreview:x}){let C=tt.default.useRef(null),O=tt.default.useRef(null),[f,i]=tt.default.useState(null),[p,L]=tt.default.useState(""),[I,P]=tt.default.useState(null),[v,S]=tt.default.useState(null),[_,k]=tt.default.useState(()=>{try{return localStorage.getItem("vibeflow-show-updates")!=="false"}catch{return!0}}),M=tt.default.useRef(r),U=tt.default.useMemo(()=>{let T=[];d&&T.push({kind:"lifecycle",sortKey:d,label:"Task created",icon:"\\u2726",author:l??n}),g&&g!==d&&T.push({kind:"lifecycle",sortKey:g,label:"Task edited",icon:"\\u270E"});let K=e.map(j=>({kind:"comment",sortKey:j.createdAt,comment:j})),re=t.map(j=>{let se=j.url.startsWith("http")?j.url:`${s}${j.url}`;return{kind:"file",sortKey:j.createdAt??"9999",file:j,url:se}}),J=a.map(j=>({kind:"change",sortKey:j.timestamp,field:j.field,from:j.from,to:j.to,actor:j.actor,source:j.source}));return[...T,...K,...re,...J].sort((j,se)=>se.sortKey.localeCompare(j.sortKey))},[e,t,a,s,d,g]),z=tt.default.useMemo(()=>U.filter(T=>T.kind==="lifecycle"||T.kind==="change").length,[U]),V=tt.default.useMemo(()=>_?U:U.filter(T=>T.kind==="comment"||T.kind==="file"),[U,_]),ae=tt.default.useMemo(()=>wv(V,n),[V,n]);return tt.default.useEffect(()=>{let T=M.current&&!r;M.current=r,C.current&&T&&requestAnimationFrame(()=>{C.current&&(C.current.scrollTop=0)})},[r]),tt.default.useEffect(()=>{f&&O.current&&(O.current.focus(),O.current.scrollIntoView({block:"nearest"}))},[f]),r?(0,B.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):o?(0,B.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):U.length===0?(0,B.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No activity yet."}):(0,B.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:[z>0&&(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"4px 0 4px",flexShrink:0,borderBottom:"1px solid var(--p-border)",marginBottom:4},children:[(0,B.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",flex:1,letterSpacing:"0.04em"},children:_?"":`${z} system event${z!==1?"s":""} hidden`}),(0,B.jsx)("button",{id:"dp-toggle-updates",onClick:()=>k(T=>{let K=!T;try{localStorage.setItem("vibeflow-show-updates",String(K))}catch{}return K}),style:{all:"unset",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:5,color:_?"var(--p-text-m)":"var(--p-text-g)",transition:"color .12s, background .12s"},title:_?"Hide system events":`Show ${z} system event${z!==1?"s":""}`,onMouseEnter:T=>{T.currentTarget.style.color="var(--p-text)",T.currentTarget.style.background="var(--p-hover)"},onMouseLeave:T=>{T.currentTarget.style.color=_?"var(--p-text-m)":"var(--p-text-g)",T.currentTarget.style.background="transparent"},children:_?(0,B.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,B.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}):(0,B.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.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,B.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})})]}),(0,B.jsx)("div",{ref:C,style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:2,minHeight:0},children:ae.map((T,K)=>{let re=T.author!==null&&T.items.length>1,J=re,j=T.author==="\\u{1F916} Agent";return(0,B.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[J&&(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 0 2px",marginTop:4},children:[(0,B.jsx)("span",{style:{fontSize:11,fontWeight:600,color:j?"var(--p-purple)":"var(--p-blue-300)",flexShrink:0},children:T.author}),(0,B.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",flexShrink:0},children:`${ft(T.oldestSortKey)} \\u2013 ${ft(T.newestSortKey)}`}),(0,B.jsxs)("span",{style:{fontSize:10,color:"var(--p-border-t)",flexShrink:0,marginLeft:2},children:["(",T.items.length," activities)"]})]}),(0,B.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:re?4:8,paddingLeft:re?8:0,borderLeft:re?"1.5px solid var(--p-border)":"none",marginLeft:re?4:0},children:T.items.map((se,qe)=>kv(se,qe,K,re,n,f,p,O,i,L,m,P,y?S:null,x))})]},`group-${K}`)})}),(0,B.jsx)(ra,{open:I!==null,message:"Delete this comment? This action cannot be undone.",onConfirm:()=>{I&&c(I),P(null)},onCancel:()=>P(null)}),y&&(0,B.jsx)(ra,{open:v!==null,message:v?`Delete "${v.name}"? This action cannot be undone.`:"",onConfirm:()=>{v&&y(v),S(null)},onCancel:()=>S(null)})]})}function kv(e,t,a,r,o,n,l,s,u,d,g,m,c,y){if(e.kind==="lifecycle")return(0,B.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-purple)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:e.icon}),(0,B.jsx)("div",{style:{flex:1,minWidth:0},children:(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)",fontStyle:"italic"},children:e.label}),!r&&(0,B.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:ft(e.sortKey)})]})})]},`lifecycle-${e.sortKey}-${a}-${t}`);if(e.kind==="change"){let I=e.from.length>28?e.from.slice(0,28)+"\\u2026":e.from,P=e.to.length>28?e.to.slice(0,28)+"\\u2026":e.to,v=e.from.length>28||e.to.length>28;return(0,B.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:6,padding:"2px 0"},children:[(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-blue)",fontWeight:600,flexShrink:0,minWidth:18,paddingTop:1},children:"\\u270E"}),(0,B.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[!r&&(0,B.jsxs)("span",{style:{fontSize:11,fontWeight:600,color:"var(--p-blue-300)"},children:["\\u{1F464} ",e.actor]}),!r&&(0,B.jsx)(Nm,{source:e.source}),(0,B.jsxs)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:["changed ",(0,B.jsx)("strong",{style:{color:"var(--p-text)"},children:e.field})]}),!r&&(0,B.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",marginLeft:"auto",flexShrink:0},children:ft(e.sortKey)})]}),(0,B.jsxs)("div",{title:v?`${e.from} \\u2192 ${e.to}`:void 0,style:{marginTop:2,fontSize:11,color:"var(--p-text-g)",display:"flex",alignItems:"center",gap:4,cursor:v?"help":"default"},children:[(0,B.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:I}),(0,B.jsx)("span",{style:{color:"var(--p-text-g)"},children:"\\u2192"}),(0,B.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:P})]})]})]},`change-${e.sortKey}-${a}-${t}`)}if(e.kind==="file"){let{file:L,url:I}=e;return(0,B.jsx)(Ps,{file:L,url:I,variant:"compact",onPreview:y?(P,v)=>y(P.name,v):void 0,onDelete:c?P=>(c(P),Promise.resolve()):void 0},`file-${L.name}-${a}-${t}`)}let x=e.comment,C=x.author==="agent",O=x.type==="system",f=x.deleted===!0,i=!!x.id&&!C&&!O&&!f&&x.isOwnComment!==!1,p=n===x.id;return O?(0,B.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"2px 0",fontSize:11,color:"var(--p-text-g)",fontStyle:"italic"},children:[(0,B.jsx)("span",{style:{opacity:.6},children:"\\u2B21"}),(0,B.jsx)("span",{children:x.text}),!r&&(0,B.jsx)("span",{style:{marginLeft:"auto",flexShrink:0,opacity:.6},children:ft(x.createdAt)})]},x.id):(0,B.jsxs)("div",{className:"flex flex-col gap-1 group/comment",style:{paddingTop:r?2:4},children:[!r&&(0,B.jsxs)("div",{className:"flex items-center justify-between gap-1.5 text-xs mb-0.5",children:[(0,B.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,B.jsx)("span",{style:{color:f?"var(--p-text-g)":C?"var(--p-purple)":"var(--p-blue-300)"},children:C?"\\u{1F916} Agent":`\\u{1F464} ${x.authorName??o}`}),(0,B.jsx)(Nm,{source:x.source}),(0,B.jsxs)("span",{style:{color:"var(--p-text-g)"},children:[ft(x.createdAt),!f&&x.updatedAt?" \\xB7 edited":"",f?" \\xB7 deleted":""]})]}),i&&(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,B.jsx)("button",{onClick:()=>{u(x.id),d(x.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,B.jsx)("button",{onClick:()=>m(x),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),r&&(0,B.jsxs)("div",{className:"flex items-center justify-between gap-1.5",style:{marginBottom:2},children:[(0,B.jsxs)("span",{style:{fontSize:10,color:"var(--p-text-g)"},children:[ft(x.createdAt),!f&&x.updatedAt?" \\xB7 edited":"",f?" \\xB7 deleted":""]}),i&&(0,B.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/comment:opacity-100 transition-opacity",children:[(0,B.jsx)("button",{onClick:()=>{u(x.id),d(x.text)},className:"p-1 rounded hover:bg-slate-700 transition-colors",title:"Edit",children:(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u270E"})}),(0,B.jsx)("button",{onClick:()=>m(x),className:"p-1 rounded hover:bg-red-900/40 transition-colors",title:"Delete",children:(0,B.jsx)("span",{style:{fontSize:11,color:"var(--p-text-m)"},children:"\\u2715"})})]})]}),p?(0,B.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,B.jsx)(go,{ref:s,value:l,onChange:d,baseRows:4,maxRows:12,onKeyDown:L=>{L.key==="Enter"&&(L.ctrlKey||L.metaKey)&&(L.preventDefault(),g(x,l).then(()=>u(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,B.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,B.jsx)("button",{onClick:()=>u(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,B.jsx)("button",{onClick:async()=>{await g(x,l),u(null)},style:{padding:"4px 10px",background:"var(--p-blue)",border:"none",borderRadius:5,fontSize:11,color:"var(--p-white)",cursor:"pointer"},children:"Save"})]})]}):f?(0,B.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,B.jsx)(ta,{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 Hm=A(Se(),1);var Qa=A($(),1);function pd({files:e,loading:t,error:a,baseUrl:r,onPreview:o,onDelete:n}){let[l,s]=Hm.default.useState(null);return t?(0,Qa.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"Loading\\u2026"}):a?(0,Qa.jsx)("p",{style:{color:"var(--p-red-500)",fontSize:12,textAlign:"center",padding:"8px 0"},children:"Failed to load."}):e.length===0?(0,Qa.jsx)("p",{style:{color:"var(--p-text-g)",fontSize:12,textAlign:"center",padding:"16px 0"},children:"No files attached."}):(0,Qa.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.map(u=>{let d=u.url??`${r}/api/files/${encodeURIComponent(u.name)}`;return(0,Qa.jsx)(Ps,{file:u,url:d,variant:"normal",onPreview:g=>o(g),onDelete:n?g=>(s(g),Promise.resolve()):void 0},u.name)}),n&&(0,Qa.jsx)(ra,{open:l!==null,message:l?`Delete "${l.name}"? This action cannot be undone.`:"",onConfirm:()=>{l&&n(l),s(null)},onCancel:()=>s(null)})]})}var hd=A(Se(),1);var ho=A(Se(),1),Um=A(no(),1);var $t=A($(),1);function Fn({value:e,onChange:t,previewValue:a,showPreview:r,setShowPreview:o,previewId:n,textareaId:l,placeholder:s,previewEmptyText:u,previewMinHeight:d=54,previewMaxHeight:g=220,baseRows:m=5,maxRows:c=12,autoFocus:y=!1,textareaRef:x,onKeyDown:C,afterTextarea:O,onBlur:f}){let i=ho.default.useRef(null),[p,L]=ho.default.useState([]),[I,P]=ho.default.useState(null),[v,S]=ho.default.useState(null);ho.default.useEffect(()=>{let M=!0;return fetch("/api/tasks").then(U=>U.json()).then(U=>{if(!M)return;let z=(U.tasks??[]).map(V=>({id:String(V.id??""),title:String(V.title??"")})).filter(V=>V.id.length>0);L(z)}).catch(()=>{}),()=>{M=!1}},[]);function _(M){let U=i.current;if(!U){P(null);return}let z=U.selectionStart??M.length,V=M.slice(0,z),ae=-1;for(let J=V.length-1;J>=0;J--){if(V[J]!=="#")continue;let j=J>0?V[J-1]:"";if(j&&!/\\s/.test(j))continue;let se=V.slice(J+1);if(!se.includes("#")){if(se.length>80)return;ae=J;break}}if(ae===-1){P(null);return}let T=V.slice(ae+1).trim().toLowerCase(),K=p.filter(J=>{if(!T)return!0;let j=J.id.toLowerCase(),se=J.title.toLowerCase();return j.includes(T)||se.includes(T)}).sort((J,j)=>{let se=J.id.toLowerCase().startsWith(T)?1:0,qe=j.id.toLowerCase().startsWith(T)?1:0;if(se!==qe)return qe-se;let at=J.title.toLowerCase().startsWith(T)?1:0,Kt=j.title.toLowerCase().startsWith(T)?1:0;return at!==Kt?Kt-at:J.id.localeCompare(j.id)}).slice(0,6);if(!K.length){P(null),S(null);return}let re=U.getBoundingClientRect();S({top:re.top,left:re.left,width:re.width}),P({queryStart:ae,queryEnd:z,items:K})}function k(M){let U=I;if(!U)return;let z=`${e.slice(0,U.queryStart)}#${M} ${e.slice(U.queryEnd)}`;t(z),P(null),S(null),requestAnimationFrame(()=>{let V=i.current;if(!V)return;let ae=U.queryStart+M.length+2;V.focus(),V.setSelectionRange(ae,ae)})}return r?(0,$t.jsx)("div",{id:n,onClick:M=>{M.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:g},children:(a??e).trim()?(0,$t.jsx)(ta,{markdown:a??e}):(0,$t.jsx)("span",{style:{color:"var(--p-border-t)"},children:u??s})}):(0,$t.jsxs)("div",{style:{position:"relative"},children:[(0,$t.jsx)(go,{id:l,ref:M=>{i.current=M,x&&(x.current=M)},className:"dp-textarea",placeholder:s,value:e,onChange:M=>{t(M),_(M)},onFocus:()=>o(!1),onBlur:()=>{P(null),S(null),o(!0),f==null||f()},baseRows:m,maxRows:c,autoFocus:y,onKeyDown:M=>{M.key==="Escape"&&(P(null),S(null)),C==null||C(M)}}),I&&v&&(0,Um.createPortal)((0,$t.jsx)("div",{"data-task-ref-suggest":"true",style:{position:"fixed",left:v.left+8,width:v.width-16,top:v.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:I.items.map(M=>(0,$t.jsxs)("button",{type:"button",onMouseDown:U=>{U.preventDefault(),k(M.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:U=>{U.currentTarget.style.background="var(--p-hover)"},onMouseLeave:U=>{U.currentTarget.style.background="transparent"},children:[(0,$t.jsxs)("span",{style:{fontFamily:"monospace",color:"var(--p-blue-300)"},children:["#",M.id]}),(0,$t.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:M.title})]},M.id))}),document.body),O]})}var Cr=A(Se(),1);var At=A($(),1);function md({tags:e,allTags:t,onChange:a,disabled:r}){let[o,n]=Cr.default.useState(""),[l,s]=Cr.default.useState(!1),u=Cr.default.useRef(null),d=Cr.default.useRef(null),g=o.trim().toLowerCase(),m=Cr.default.useMemo(()=>t.filter(p=>!e.includes(p)&&p.toLowerCase().includes(g)).slice(0,8),[t,e,g]),c=g.length>0&&!t.some(i=>i.toLowerCase()===g)&&!e.some(i=>i.toLowerCase()===g),y=g.length>0&&t.some(i=>i.toLowerCase()===g)&&!e.some(i=>i.toLowerCase()===g);function x(i){var L;let p=i.trim();!p||e.includes(p)||(a([...e,p]),n(""),s(!1),(L=u.current)==null||L.focus())}function C(i){a(e.filter(p=>p!==i))}function O(i){if(i.key==="Enter")if(i.preventDefault(),c||y){let p=t.find(L=>L.toLowerCase()===g);x(p??o.trim())}else m.length>0&&x(m[0]);i.key==="Escape"&&(s(!1),n("")),i.key==="Backspace"&&!o&&e.length>0&&C(e[e.length-1])}Cr.default.useEffect(()=>{function i(p){d.current&&!d.current.contains(p.target)&&s(!1)}return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);let f=l&&(m.length>0||c);return(0,At.jsxs)("div",{ref:d,style:{position:"relative"},children:[(0,At.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 i;r||(i=u.current)==null||i.focus()},children:[(0,At.jsx)(fo,{tags:e,onRemove:r?void 0:C,size:"sm"}),!r&&(0,At.jsx)("input",{ref:u,type:"text",value:o,placeholder:e.length?"":"Add tags\\u2026",onChange:i=>{n(i.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:O,style:{background:"none",border:"none",outline:"none",fontSize:12,color:"var(--p-text)",minWidth:80,flex:1,padding:0,lineHeight:"1.4"}})]}),f&&(0,At.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:i=>i.preventDefault(),children:[m.map(i=>{let{bg:p,text:L,border:I}=Wt(i);return(0,At.jsxs)("button",{type:"button",onClick:()=>x(i),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:P=>{P.currentTarget.style.background="var(--p-hover)"},onMouseLeave:P=>{P.currentTarget.style.background="none"},children:[(0,At.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:L,border:`1px solid ${I}`,flexShrink:0}}),i]},i)}),c&&(0,At.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:i=>{i.currentTarget.style.background="var(--p-hover)",i.currentTarget.style.color="var(--p-text-m)"},onMouseLeave:i=>{i.currentTarget.style.background="none",i.currentTarget.style.color="var(--p-text-g)"},children:[(0,At.jsx)("span",{style:{fontSize:14,lineHeight:1},children:"+"}),\'Create "\',(0,At.jsx)("strong",{style:{color:"var(--p-text)"},children:o.trim()}),\'"\']})]})]})}var W=A($(),1);function xd({task:e,description:t,setDescription:a,showDescPreview:r,setShowDescPreview:o,priority:n,setPriority:l,onDescriptionBlur:s,onDescriptionDiscard:u,originalDescription:d,onPriorityChange:g,githubUrl:m,onFilePreview:c,onPatch:y,onDeleteScreenshot:x,liveFiles:C,allTags:O=[],overrideTags:f,onTagsChange:i}){var U;let p=(e==null?void 0:e.files)??[],L=C?C.map(z=>({name:z.name,linkedPath:z.linkedPath,addedAt:z.createdAt,url:z.url})):p,I=L==null?void 0:L.find(z=>/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(z.name)),P=e&&I?I.url||`/api/tasks/${e.id}/files/${encodeURIComponent(I.name)}`:null,v=hd.default.useRef(null),[S,_]=hd.default.useState(null),{userPart:k,consolePart:M}=Tv(t);return(0,W.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:"Description"}),(0,W.jsx)(Fn,{value:t,previewValue:M?k: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:v,afterTextarea:u&&d!==void 0&&t!==d?(0,W.jsx)("button",{type:"button",onMouseDown:z=>{z.preventDefault(),u()},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:z=>{z.currentTarget.style.color="var(--p-amber-300)",z.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:z=>{z.currentTarget.style.color="var(--p-text-g)",z.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9 Discard changes"}):void 0})]}),M&&(0,W.jsx)(Rv,{logs:M}),e&&I&&P&&(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"dp-meta-label",children:"Screenshot"}),(0,W.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,W.jsx)("button",{onClick:()=>c(I.name,P),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,W.jsx)("img",{src:P,alt:"Task screenshot",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderTop:"1px solid var(--p-border)",background:"var(--p-surface)"},children:[(0,W.jsx)("span",{style:{fontSize:10,color:"var(--p-text-f)",flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:I.addedAt?`Captured ${ft(I.addedAt)}`:"Screenshot attached"}),(0,W.jsx)("button",{onClick:()=>c(I.name,P),style:{fontSize:10,color:"var(--p-text-m)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Preview screenshot",children:"Preview"}),(0,W.jsx)("button",{onClick:()=>_(I.name),style:{fontSize:10,color:"var(--p-red)",background:"transparent",border:"none",cursor:"pointer",padding:0},title:"Remove screenshot",children:"Remove"})]})]})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"dp-meta-label",children:"Tags"}),(0,W.jsx)(md,{tags:f??(e==null?void 0:e.tags)??[],allTags:O,disabled:!e&&!i,onChange:z=>{i?i(z):e&&y(e.id,{tags:z})}})]}),(0,W.jsxs)("div",{children:[(0,W.jsx)("div",{className:"dp-meta-label",children:"Priority"}),(0,W.jsxs)("select",{id:"dp-priority",className:"dp-input",value:n,onChange:z=>{let V=z.target.value;l(V),g==null||g(V)},style:{padding:"5px 8px",fontSize:12,cursor:"pointer",width:"auto"},children:[(0,W.jsx)("option",{value:"",children:"\\u2014"}),(0,W.jsx)("option",{value:"Critical",children:"Critical"}),(0,W.jsx)("option",{value:"High",children:"High"}),(0,W.jsx)("option",{value:"Medium",children:"Medium"}),(0,W.jsx)("option",{value:"Low",children:"Low"})]})]}),e&&(0,W.jsxs)("div",{id:"dp-metadata",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,W.jsx)(gd,{label:"Created",id:"dp-created",children:e.createdAt?ft(e.createdAt):"\\u2014"}),(0,W.jsx)(gd,{label:"ID",id:"dp-id",children:(0,W.jsx)("span",{style:{fontFamily:"monospace"},children:e.id})}),(0,W.jsx)(gd,{label:"Author",id:"dp-author",children:e.authorName??e.author??"\\u2014"}),(e.commit||((U=e.commits)==null?void 0:U.length))&&(0,W.jsx)(bv,{task:e,githubUrl:m}),e.branchName&&(0,W.jsx)(Pv,{branchName:e.branchName}),e.annotatedElementText&&(0,W.jsxs)("div",{id:"dp-annotated-text",style:{gridColumn:"1 / -1",background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,W.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Annotated element text"}),(0,W.jsx)("div",{style:{fontSize:11,color:"var(--p-text-f)",fontStyle:"italic",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e.annotatedElementText})]})]}),(0,W.jsx)(ra,{open:S!==null,message:"Remove this screenshot? This action cannot be undone.",confirmLabel:"Remove",onConfirm:()=>{S&&x(S),_(null)},onCancel:()=>_(null)})]})}function gd({label:e,id:t,children:a}){return(0,W.jsxs)("div",{id:t,style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px"},children:[(0,W.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:e}),(0,W.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 bv({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,W.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,W.jsxs)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:["Commit",a.length>1?"s":""]}),(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5},children:[t&&e.commitPushed!==!1?(0,W.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,W.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,W.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 Pv({branchName:e}){return(0,W.jsxs)("div",{id:"dp-branch",style:{background:"var(--p-card)",borderRadius:8,padding:"8px 10px",cursor:"default"},title:`Branch: ${e}`,children:[(0,W.jsx)("div",{style:{fontSize:9,color:"var(--p-border-t)",marginBottom:2,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Branch"}),(0,W.jsxs)("div",{style:{fontSize:10,color:"var(--p-green-300)",fontFamily:"monospace"},children:["\\u2387 ",e]})]})}function Tv(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 Rv({logs:e}){let t=e.replace(/^---\\s*\\n/,"").split(`\n`).filter(a=>a.trim());return(0,W.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,W.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,W.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,W.jsx)("span",{style:{fontSize:9,color:"var(--p-text-g)",marginLeft:"auto"},children:"captured at submission"})]}),(0,W.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,W.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,W.jsx)("div",{style:{fontSize:10,color:"var(--p-text-g)",fontStyle:"italic"},children:"No log entries captured."})]})]})}var xo=A($(),1);function vd({commentInput:e,setCommentInput:t,commentSubmitting:a,onSubmit:r,baseRows:o=4}){return(0,xo.jsx)("div",{id:"dp-comment-input-area",children:(0,xo.jsx)(Fn,{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,xo.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,xo.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,xo.jsx)("path",{d:"M2 8L14 2L10 8L14 14L2 8Z",fill:"currentColor"})})})})})}var E=A($(),1),Mv="vibeflow-paste-hint-dismissed";function Av({storageKey:e=Mv}){let[t,a]=Q.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,E.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,E.jsxs)("span",{style:{flex:1,lineHeight:1.4},children:["\\u{1F4A1} ",(0,E.jsx)("strong",{children:"Tip:"})," Paste screenshots or files anywhere in this panel \\u2014 they attach automatically."]}),(0,E.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,E.jsx)(Ne,{style:{width:12,height:12}})})]})}var Dv=[{id:"backlog",label:"backlog"},{id:"todo",label:"todo"},{id:"in-progress",label:"in-progress"},{id:"review",label:"review"},{id:"done",label:"done"}],Ev=5*1024*1024;function yd(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(u=>{u?a(u):r(new Error("canvas.toBlob failed"))},"image/jpeg",t)},o.onerror=()=>{URL.revokeObjectURL(n),r(new Error("image load failed"))},o.src=n})}function Ld({open:e,task:t,tab:a,addColumnId:r="todo",gitUserName:o="You",githubUrl:n,baseUrl:l,isResizing:s,api:u,onClose:d,onSave:g,onCreate:m,onDelete:c,onPatch:y,onFilePreview:x,onActivityChange:C,externalLocalChanges:O=[],showLockIndicator:f=!0,lockedByUser:i,onGoBack:p,navBackLabel:L,commentVersion:I,allTasks:P=[],createBranch:v}){let S=!t,_=t?Mn(t.type):Mn("Task"),k=Q.default.useRef(null),[M,U]=Q.default.useState([]),z=Q.default.useRef(!1),V=Q.default.useRef(""),ae=Q.default.useRef(""),T=Q.default.useMemo(()=>{let w=new Set;for(let H of P)for(let G of H.tags??[])w.add(G);return[...w].sort()},[P]),[K,re]=Q.default.useState(a),[J,j]=Q.default.useState(""),[se,qe]=Q.default.useState(""),[at,Kt]=Q.default.useState(r),[rt,Gt]=Q.default.useState("Task"),[Et,oa]=Q.default.useState(""),[Lo,ot]=Q.default.useState(!1),[zn,So]=Q.default.useState(!1),[kr,We]=Q.default.useState(!1),[ct,Io]=Q.default.useState(""),[Nn,Ya]=Q.default.useState(!1),na=Q.default.useRef(null),[Es,Hn]=Q.default.useState([]),[Un,Ja]=Q.default.useState(!1),[Fs,_n]=Q.default.useState(null),[La,la]=Q.default.useState(""),[Bs,qn]=Q.default.useState(!1),[br,Wn]=Q.default.useState([]),[$n,Vn]=Q.default.useState(!1),[Kn,Gn]=Q.default.useState(null),[Co,Pr]=Q.default.useState(0),h=Q.default.useRef(0),[b,D]=Q.default.useState(0),[q,ce]=Q.default.useState(null),[ue,ie]=Q.default.useState([]),[de,Xe]=Q.default.useState([]),Ae=Q.default.useRef(null),Re=Q.default.useRef(()=>{}),F=Q.default.useRef(""),pt=Q.default.useRef(!1);Q.default.useEffect(()=>{F.current=La},[La]),Q.default.useEffect(()=>{pt.current=kr},[kr]),Q.default.useEffect(()=>{z.current=s??!1},[s]),Q.default.useEffect(()=>{e||C==null||C(null,"viewing")},[e]),Q.default.useEffect(()=>{if(!e||!t)return;J!==V.current||se!==ae.current?C==null||C(t.id,"locked"):C==null||C(t.id,"viewing")},[J,se,e,t==null?void 0:t.id]),Q.default.useEffect(()=>{if(!e)return;function w(H){var G,ve,he,Ft;if(!z.current&&!((ve=(G=H.target)==null?void 0:G.closest)!=null&&ve.call(G,"[data-task-ref-suggest]"))&&!((Ft=(he=H.target)==null?void 0:he.closest)!=null&&Ft.call(he,".modal-backdrop"))&&k.current&&!k.current.contains(H.target)){if(pt.current)return;if(F.current.trim().length>0){Re.current(),We(!0);return}Re.current(),d()}}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[e,d]),Q.default.useEffect(()=>{if(!e)return;function w(H){if(H.key==="Escape"){if(pt.current){We(!1),H.stopPropagation();return}if(F.current.trim().length>0){H.stopPropagation(),Re.current(),We(!0);return}}}return document.addEventListener("keydown",w,{capture:!0}),()=>document.removeEventListener("keydown",w,{capture:!0})},[e]),Q.default.useEffect(()=>{if(e){if(re(a),ot(!!t),la(""),Hn([]),Wn([]),Pr(0),D(0),ie([]),Xe([]),Io((t==null?void 0:t.branchName)??""),Ya(!1),na.current=null,t){let w=(t.title??"").trim(),H=(t.description??"").trim();j(w),qe(H),Kt(t.status),Gt(t.type??"Task"),oa(t.priority??""),V.current=w,ae.current=H,C==null||C(t.id,"viewing")}else j(""),qe(""),Kt(r),Gt("Task"),oa("");t&&(nt(t.id),St(t.id)),setTimeout(()=>{var w;return(w=Ae.current)==null?void 0:w.focus()},50)}},[e,t==null?void 0:t.id,a]),Q.default.useEffect(()=>{!e||!t||(K==="comments"?(mt(t.id),St(t.id)):K==="files"&&St(t.id))},[K,e,t==null?void 0:t.id]),Q.default.useEffect(()=>{if(!e||!t||J!==V.current||se!==ae.current)return;let H=(t.title??"").trim(),G=(t.description??"").trim();(H!==V.current||G!==ae.current)&&(j(H),qe(G),V.current=H,ae.current=G),t.status&&t.status!==at&&Kt(t.status),t.type&&t.type!==rt&&Gt(t.type),t.priority!==void 0&&t.priority!==Et&&oa(t.priority??"");let ve=t.branchName??"";ve!==ct&&Io(ve)},[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.branchName]),Q.default.useEffect(()=>{!e||!t||I===void 0||(K==="comments"?mt(t.id):nt(t.id))},[I]);async function nt(w){var H,G;try{let[ve,he]=await Promise.all([u.getComments(w),u.getFiles(w)]);Pr(((H=ve.comments)==null?void 0:H.length)??0),D(((G=he.files)==null?void 0:G.length)??0)}catch{}}async function mt(w){var G;let H=++h.current;Ja(!0),_n(null);try{let ve=await u.getComments(w);if(h.current!==H)return;Hn(ve.comments??[]),Pr(((G=ve.comments)==null?void 0:G.length)??0)}catch{if(h.current!==H)return;_n("failed")}finally{h.current===H&&Ja(!1)}}async function St(w){var H;Vn(!0),Gn(null);try{let G=await u.getFiles(w);Wn(G.files??[]),D(((H=G.files)==null?void 0:H.length)??0)}catch{Gn("failed")}finally{Vn(!1)}}async function wo(){var w;if(!J.trim()){(w=Ae.current)==null||w.focus();return}if(!S&&La.trim()&&await Os(),S){let H=await m({title:J.trim(),description:se.trim()||J.trim(),status:at,type:rt,priority:Et||void 0,selector:"/",tags:de.length>0?de:void 0});if(H&&M.length>0){for(let G of M)await u.uploadFile(H,G).catch(()=>null);U([])}d()}else Za()}function Za(){if(!t||S)return;let w=J.trim();if(!w)return;let H=V.current,G=ae.current,ve=w!==H,he=se.trim()!==G;!ve&&!he||(ve&&jn("title",H,w),he&&jn("description",G,se.trim()),y(t.id,{title:w,description:se.trim(),type:rt,priority:Et||void 0}),V.current=w,ae.current=se.trim())}Re.current=Za;function jn(w,H,G){H!==G&&ie(ve=>[...ve,{field:w,from:H,to:G,actor:o,timestamp:new Date().toISOString()}])}async function Os(){if(!(!t||!La.trim())){qn(!0);try{await u.addComment(t.id,La.trim()),la(""),await mt(t.id)}finally{qn(!1)}}}async function lg(w,H){t&&(await u.updateComment(t.id,w.id,H),await mt(t.id))}async function sg(w){t&&(await u.deleteComment(t.id,w.id),await mt(t.id))}async function ug(w){if(!t)return;let H=t.id;ce(null);for(let G of Array.from(w.target.files??[])){if(!G.type.startsWith("image/")&&G.size>Ev){ce(`"${G.name}" exceeds the 5 MB limit and was skipped.`);continue}let ve;if(G.type.startsWith("image/")){let he=await yd(G),Ft=G.name.replace(/\\.(png|bmp|gif|webp|tiff?)$/i,".jpg");ve=new File([he],Ft,{type:"image/jpeg"})}else ve=G;await u.uploadFile(H,ve)}w.target.value="",await St(H),nt(H)}async function ig(w){if(!t)return;ce(null);let H=await yd(w),ve=`paste-${new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}.jpg`,he=new File([H],ve,{type:"image/jpeg"});await u.uploadFile(t.id,he),await St(t.id),nt(t.id)}async function dg(w){if(!t)return;let H=Array.from(w.items),G=H.find(he=>he.type.startsWith("image/"));if(G){let he=G.getAsFile();he&&await ig(he);return}let ve=H.filter(he=>he.kind==="file"&&!he.type.startsWith("image/"));if(ve.length>0){for(let he of ve){let Ft=he.getAsFile();Ft&&await u.uploadFile(t.id,Ft)}await St(t.id),nt(t.id);return}}Q.default.useEffect(()=>{if(!e)return;function w(H){if(!H.clipboardData)return;let G=H.target;if(!((G.tagName==="TEXTAREA"||G.tagName==="INPUT"||G.isContentEditable)&&!Array.from(H.clipboardData.items).some(Tr=>Tr.kind==="file"))){if(H.preventDefault(),!t){let Ft=Array.from(H.clipboardData.items).find(Tr=>Tr.type.startsWith("image/"));if(Ft){let Tr=Ft.getAsFile();Tr&&(async()=>{let hg=await yd(Tr),xg=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),vg=new File([hg],`paste-${xg}.jpg`,{type:"image/jpeg"});U(yg=>[...yg,vg])})()}return}dg(H.clipboardData)}}return document.addEventListener("paste",w),()=>document.removeEventListener("paste",w)},[e,t==null?void 0:t.id]);async function kd(w){t&&(await u.deleteFile(t.id,w.name),await St(t.id),nt(t.id))}async function fg(w){if(!t)return;await u.deleteFile(t.id,w);let H=(t.files??[]).filter(G=>G.name!==w);y(t.id,{files:H}),await St(t.id),nt(t.id)}function cg(w){if(Nn&&w!=="review"&&(Ya(!1),na.current=null),Kt(w),S||!t)return;if(v&&w==="review"&&!ct.trim()){na.current={taskId:t.id,patch:{status:w}},Ya(!0);return}let H={status:w};ct.trim()&&(H.branchName=ct.trim()),y(t.id,H)}function bd(){if(!na.current||!t||!ct.trim())return;let w={...na.current.patch,branchName:ct.trim()};y(t.id,w),Ya(!1),na.current=null}function Pd(){Ya(!1),na.current=null,t&&Kt(t.status)}let pg=w=>w!==at?"dp-status-btn":`dp-status-btn active-${w}`;function Td(){if(!pt.current){if(F.current.trim().length>0){Re.current(),We(!0);return}Re.current(),d()}}let mg=e&&t!=null&&(J!==V.current||se!==ae.current),gg=Q.default.useMemo(()=>{let w=[...O,...ue].sort((G,ve)=>new Date(G.timestamp).getTime()-new Date(ve.timestamp).getTime()),H=[];for(let G of w)H.some(he=>he.field===G.field&&he.from.toLowerCase()===G.from.toLowerCase()&&he.to.toLowerCase()===G.to.toLowerCase()&&he.actor===G.actor&&Math.abs(new Date(he.timestamp).getTime()-new Date(G.timestamp).getTime())<=3e3)||H.push(G);return H},[O,ue]),Sa=!S&&!!i;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("aside",{id:"detail-panel",className:"open",ref:k,children:[Sa&&(0,E.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,E.jsx)("strong",{children:i})," \\u2014 editing disabled until they finish."]}),(0,E.jsxs)("div",{className:"dp-header",children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[p&&(0,E.jsx)("button",{id:"dp-back",onClick:p,title:L?`Back to: ${L}`:"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:w=>{w.currentTarget.style.background="var(--p-border)",w.currentTarget.style.color="var(--p-blue-300)",w.currentTarget.style.borderColor="var(--p-blue)"},onMouseOut:w=>{w.currentTarget.style.background="transparent",w.currentTarget.style.color="var(--p-text-g)",w.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u2190"}),(0,E.jsx)(bs,{id:"dp-type-picker",value:rt,disabled:Sa,onChange:w=>{!S&&t&&w!==rt&&jn("type",rt,w),Gt(w),!S&&t&&y(t.id,{type:w})}}),(0,E.jsx)("input",{id:"dp-title",ref:Ae,className:"dp-input",type:"text",placeholder:"Task title\\u2026",value:J,readOnly:Sa,onChange:w=>j(w.target.value),onKeyDown:w=>{w.key==="Escape"&&(w.stopPropagation(),Td()),w.key==="Enter"&&S&&wo()},style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",borderColor:"transparent",background:"transparent"},onFocus:w=>{w.currentTarget.style.borderColor="var(--p-blue)",w.currentTarget.style.background="var(--p-input)"},onBlur:w=>{w.currentTarget.style.borderColor="transparent",w.currentTarget.style.background="transparent",S||Za()}}),!S&&J!==V.current&&J.trim()!==""&&(0,E.jsx)("button",{type:"button",title:"Discard title changes",onMouseDown:w=>{w.preventDefault(),j(V.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:w=>{w.currentTarget.style.color="var(--p-amber-300)",w.currentTarget.style.borderColor="var(--p-amber-300)"},onMouseLeave:w=>{w.currentTarget.style.color="var(--p-text-g)",w.currentTarget.style.borderColor="var(--p-border-t)"},children:"\\u21A9"}),(0,E.jsx)("button",{id:"dp-close",onClick:Td,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:w=>{w.currentTarget.style.background="var(--p-border)",w.currentTarget.style.color="var(--p-text-m)"},onMouseOut:w=>{w.currentTarget.style.background="transparent",w.currentTarget.style.color="var(--p-text-g)"},children:(0,E.jsx)(Ne,{style:{width:14,height:14}})}),f&&mg&&t&&(0,E.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,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",...Sa?{pointerEvents:"none",opacity:.6}:{}},children:[(0,E.jsx)("span",{style:{fontSize:10,color:"var(--p-text-g)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Status"}),Dv.map(w=>(0,E.jsx)("button",{className:pg(w.id),"data-status":w.id,onClick:()=>cg(w.id),children:w.label},w.id))]}),Nn&&!Sa&&(0,E.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,E.jsx)("span",{style:{color:"var(--p-purple-300)",fontWeight:500,whiteSpace:"nowrap"},children:"Branch name:"}),(0,E.jsx)("input",{id:"dp-branch-name",type:"text",placeholder:"e.g. feat/add-hover-effect",value:ct,onChange:w=>Io(w.target.value),onKeyDown:w=>{w.key==="Enter"&&ct.trim()&&bd(),w.key==="Escape"&&Pd()},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,E.jsx)("button",{onClick:bd,disabled:!ct.trim(),style:{padding:"4px 12px",borderRadius:6,border:"1px solid var(--p-purple)",background:ct.trim()?"var(--p-purple)":"var(--p-border)",color:"#fff",fontSize:11,fontWeight:600,cursor:ct.trim()?"pointer":"not-allowed",transition:"background .12s"},children:"Apply & Review"}),(0,E.jsx)("button",{onClick:Pd,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"})]})]}),!S&&(0,E.jsxs)("div",{className:"dp-tabs",id:"dp-tabs-row",children:[(0,E.jsx)("button",{className:`dp-tab${K==="details"?" active":""}`,id:"dp-tab-details",onClick:()=>re("details"),children:"Details"}),(0,E.jsxs)("button",{className:`dp-tab${K==="comments"?" active":""}`,id:"dp-tab-activity",onClick:()=>re("comments"),children:["Activity ",Co>0&&(0,E.jsxs)("span",{id:"dp-activity-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",Co,")"]})]}),(0,E.jsxs)("button",{className:`dp-tab${K==="files"?" active":""}`,id:"dp-tab-files",onClick:()=>re("files"),children:["Files ",b>0&&(0,E.jsxs)("span",{id:"dp-file-count",style:{color:"var(--p-text-g)",fontSize:10},children:["(",b,")"]})]})]}),(0,E.jsxs)("div",{className:"dp-body",children:[!S&&(0,E.jsx)(Av,{}),(0,E.jsxs)("div",{className:"dp-pane",id:"dp-details-pane",style:{display:!t||K==="details"?"":"none"},children:[(0,E.jsx)("div",{style:Sa?{pointerEvents:"none",opacity:.6,flexShrink:0}:{flexShrink:0},children:(0,E.jsx)(xd,{task:t,description:se,setDescription:qe,showDescPreview:Lo,setShowDescPreview:ot,priority:Et,setPriority:oa,onDescriptionBlur:S?void 0:Za,onDescriptionDiscard:S?void 0:()=>{qe(ae.current),ot(!0)},originalDescription:S?void 0:ae.current,onPriorityChange:S?void 0:w=>{t&&(w!==Et&&jn("priority",Et||"\\u2014",w||"\\u2014"),y(t.id,{priority:w||void 0}))},githubUrl:n,onFilePreview:x,onDeleteScreenshot:fg,onPatch:y,liveFiles:br.length>0||$n?br:void 0,allTags:T,overrideTags:S?de:void 0,onTagsChange:S?Xe:void 0})}),!S&&t&&(0,E.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,E.jsx)(Fv,{task:t})})]}),(0,E.jsxs)("div",{className:"dp-pane",id:"dp-activity-pane",style:{display:K==="comments"&&!S?"":"none"},children:[(0,E.jsx)("div",{style:{borderBottom:"1px solid var(--p-border)",paddingBottom:8,flexShrink:0},children:(0,E.jsx)(vd,{commentInput:La,setCommentInput:la,commentSubmitting:Bs,onSubmit:()=>{Os()},baseRows:2})}),(0,E.jsx)(cd,{comments:Es,files:br,localChanges:gg,loading:Un,error:Fs,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:lg,onDelete:sg,onDeleteFile:kd,onFilePreview:x})]}),(0,E.jsxs)("div",{className:"dp-pane",id:"dp-files-pane",style:{display:K==="files"&&!S?"":"none"},children:[(0,E.jsx)(pd,{files:br,loading:$n,error:Kn,baseUrl:l,onPreview:w=>x(w.name,w.linkedPath?`${l}/api/tasks/${t==null?void 0:t.id}/files/${encodeURIComponent(w.name)}`:`${l}${w.url}`),onDelete:Sa?void 0:kd}),(0,E.jsxs)("div",{style:{borderTop:"1px solid var(--p-border)",paddingTop:8,flexShrink:0,display:"flex",gap:8,flexWrap:"wrap",alignItems:"center",...Sa?{pointerEvents:"none",opacity:.5}:{}},children:[q&&(0,E.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:q}),(0,E.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:w=>{w.currentTarget.style.borderColor="var(--p-border-t)",w.currentTarget.style.color="var(--p-text)"},onMouseOut:w=>{w.currentTarget.style.borderColor="var(--p-border)",w.currentTarget.style.color="var(--p-text-m)"},children:[(0,E.jsx)(io,{style:{width:12,height:12}}),"Upload",(0,E.jsx)("input",{id:"dp-file-upload",type:"file",style:{display:"none"},multiple:!0,onChange:ug})]}),(0,E.jsx)("span",{style:{fontSize:11,color:"var(--p-border-t)",marginLeft:"auto"},children:"or paste image"})]})]})]}),(0,E.jsxs)("div",{className:"dp-footer",children:[!S&&(0,E.jsx)("button",{id:"dp-delete",onClick:()=>So(!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:w=>{w.currentTarget.style.borderColor="var(--p-red)"},onMouseOut:w=>{w.currentTarget.style.borderColor="var(--p-border-t)"},children:"Delete"}),(0,E.jsx)("div",{style:{flex:1}}),S?(0,E.jsxs)(E.Fragment,{children:[M.length>0&&(0,E.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} ",M.length," screenshot",M.length!==1?"s":""," will attach on save"]}),(0,E.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:w=>{w.currentTarget.style.borderColor="var(--p-text-g)"},onMouseOut:w=>{w.currentTarget.style.borderColor="var(--p-border-t)"},children:"Cancel"}),(0,E.jsx)("button",{id:"dp-save",onClick:()=>{wo()},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:w=>{w.currentTarget.style.background="var(--p-blue-700)"},onMouseOut:w=>{w.currentTarget.style.background="var(--p-blue)"},children:"Add Task"})]}):(0,E.jsx)("span",{style:{fontSize:11,color:"var(--p-text-g)",padding:"5px 4px"},children:"Changes are saved automatically"})]}),(0,E.jsx)(ra,{open:zn,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:()=>{So(!1),c(t.id),d()},onCancel:()=>So(!1)})]}),kr&&(0,E.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,E.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,E.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,E.jsx)(io,{style:{width:20,height:20,color:"var(--p-purple)"}})}),(0,E.jsx)("h2",{style:{margin:"0 0 8px",fontSize:17,fontWeight:700,color:"var(--p-text)"},children:"Send comment?"}),(0,E.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,E.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,E.jsx)("button",{onClick:()=>{We(!1),Os().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,E.jsx)("button",{type:"button",onClick:()=>{We(!1),la(""),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,E.jsx)("button",{type:"button",onClick:()=>We(!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 Fv({task:e}){let t=[];if(e.component&&t.push((0,E.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,E.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,E.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,E.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,E.jsx)("span",{className:"dp-source-pill",title:e.url,children:r},"url"))}return e.reportBack&&t.push((0,E.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,E.jsx)("div",{id:"dp-meta-row",style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap",flex:1},children:t})}var wr=A(Se(),1);var Z=A($(),1),Bv=[{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)"}],Ov={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 Sd({tasks:e,filter:t,onFilter:a,view:r="board",onViewChange:o,activityCounter:n}){let[l,s]=wr.default.useState(!1),[u,d]=wr.default.useState(!1),[g,m]=wr.default.useState(!1),c=wr.default.useMemo(()=>[...new Set(e.map(v=>v.type).filter(Boolean))].sort(),[e]),y=wr.default.useMemo(()=>[...new Set(e.map(v=>v.author).filter(Boolean))].sort(),[e]),x=wr.default.useMemo(()=>{let v=new Set;for(let S of e)for(let _ of S.tags??[])v.add(_);return[...v].sort()},[e]);function C(v){return e.filter(S=>S.status===v).length}function O(v){a({...t,status:v}),s(!1),d(!1),m(!1)}function f(v){a({...t,type:v}),s(!1)}function i(v){a({...t,user:v}),d(!1)}function p(v){let S=t.tags??[],_=S.includes(v)?S.filter(k=>k!==v):[...S,v];a({...t,tags:_})}function L(v){v.stopPropagation();let S=v.currentTarget.dataset.status;S&&O(S)}let I={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},P={...I,background:"var(--p-card)",border:"1px solid var(--p-border)",color:"var(--p-text-f)",padding:"3px 10px",position:"relative"};return(0,Z.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,Z.jsx)("div",{style:{display:"flex",alignItems:"center",gap:2},children:Bv.map(v=>{let S=t.status===v.id,_=v.id!=="all"?C(v.id):null,k=S?Ov[v.id]:{};return(0,Z.jsxs)("button",{"data-status":v.id,style:{...I,...k},onMouseOver:M=>{S||(M.currentTarget.style.background="var(--p-hover)",M.currentTarget.style.color="var(--p-text-m)")},onMouseOut:M=>{S||(M.currentTarget.style.background="transparent",M.currentTarget.style.color="var(--p-text-f)")},onClick:L,children:[v.dot&&(0,Z.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:v.dot,flexShrink:0,display:"inline-block"}}),v.label,_!=null&&(0,Z.jsx)("span",{style:{color:S?"inherit":"var(--p-border-t)",fontSize:10,opacity:.8},children:_})]},v.id)})}),(0,Z.jsx)("div",{style:{flex:1}}),n,t.user&&(0,Z.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,Z.jsx)("button",{onClick:()=>i(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-purple-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,Z.jsx)(Ne,{style:{width:10,height:10}})})]}),t.type&&(0,Z.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,Z.jsx)("button",{onClick:()=>f(null),style:{display:"flex",background:"none",border:"none",color:"var(--p-cyan-300)",cursor:"pointer",padding:0,lineHeight:1},children:(0,Z.jsx)(Ne,{style:{width:10,height:10}})})]}),(t.tags??[]).map(v=>{let{bg:S,text:_,border:k}=Wt(v);return(0,Z.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:100,background:S,border:`1px solid ${k}`,fontSize:10,color:_,fontWeight:600},children:[v,(0,Z.jsx)("button",{onClick:()=>p(v),style:{display:"flex",background:"none",border:"none",color:_,cursor:"pointer",padding:0,lineHeight:1},children:(0,Z.jsx)(Ne,{style:{width:10,height:10}})})]},v)}),(0,Z.jsxs)("div",{style:{position:"relative"},children:[(0,Z.jsxs)("button",{style:{...P,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:v=>{v.stopPropagation(),x.length&&(d(!1),s(!1),m(S=>!S))},children:[(0,Z.jsx)(uo,{style:{width:12,height:12}}),"Tags",(t.tags??[]).length>0&&(0,Z.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,Z.jsx)(hr,{style:{width:12,height:12}})]}),g&&x.length>0&&(0,Z.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:v=>v.stopPropagation(),children:[(t.tags??[]).length>0&&(0,Z.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(v=>{let{bg:S,text:_,border:k}=Wt(v),M=(t.tags??[]).includes(v);return(0,Z.jsxs)("button",{style:{width:"100%",textAlign:"left",padding:"6px 12px",fontSize:11,color:"var(--p-text-m)",background:M?"var(--p-hover)":"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:6},onMouseEnter:U=>{U.currentTarget.style.background="var(--p-hover)"},onMouseLeave:U=>{U.currentTarget.style.background=M?"var(--p-hover)":"none"},onClick:()=>p(v),children:[(0,Z.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:_,border:`1px solid ${k}`,flexShrink:0}}),(0,Z.jsx)("span",{style:{flex:1},children:v}),M&&(0,Z.jsx)("span",{style:{color:_,fontSize:12,lineHeight:1},children:"\\u2713"})]},v)})]})]}),(0,Z.jsxs)("div",{style:{position:"relative"},children:[(0,Z.jsxs)("button",{style:{...P,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:y.length?1:.55},onClick:v=>{v.stopPropagation(),y.length&&(s(!1),d(S=>!S))},children:[(0,Z.jsx)(Rn,{style:{width:12,height:12}}),"User",(0,Z.jsx)(hr,{style:{width:12,height:12}})]}),u&&y.length>0&&(0,Z.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:v=>v.stopPropagation(),children:[(0,Z.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:()=>i(null),children:"All users"}),y.map(v=>(0,Z.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.user===v?"var(--p-purple-300)":"var(--p-text-m)",background:t.user===v?"color-mix(in srgb, var(--p-purple) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:S=>{t.user!==v&&(S.currentTarget.style.background="var(--p-hover)")},onMouseOut:S=>{t.user!==v&&(S.currentTarget.style.background="none")},onClick:()=>i(v),children:v},v))]})]}),(0,Z.jsxs)("div",{style:{position:"relative"},children:[(0,Z.jsxs)("button",{style:{...P,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:c.length?1:.55},onClick:v=>{v.stopPropagation(),c.length&&s(S=>!S)},children:[(0,Z.jsx)(uo,{style:{width:12,height:12}}),"Type",(0,Z.jsx)(hr,{style:{width:12,height:12}})]}),l&&c.length>0&&(0,Z.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:v=>v.stopPropagation(),children:[(0,Z.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:()=>f(null),children:"All types"}),c.map(v=>(0,Z.jsx)("button",{style:{width:"100%",textAlign:"left",padding:"7px 12px",fontSize:11,color:t.type===v?"var(--p-cyan-300)":"var(--p-text-m)",background:t.type===v?"color-mix(in srgb, var(--p-blue) 12%, transparent)":"none",border:"none",cursor:"pointer"},onMouseOver:S=>{t.type!==v&&(S.currentTarget.style.background="var(--p-hover)")},onMouseOut:S=>{t.type!==v&&(S.currentTarget.style.background="none")},onClick:()=>f(v),children:v},v))]})]}),(0,Z.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,Z.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:v=>{v.stopPropagation(),o==null||o("board")},children:(0,Z.jsx)(Cn,{style:{width:13,height:13}})}),(0,Z.jsx)("button",{title:"Compact view",style:{padding:"4px 7px",borderRadius:5,background:r==="compact"?"var(--p-surface)":"none",color:r==="compact"?"var(--p-text-sub)":"var(--p-text-g)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",transition:"background .12s,color .12s"},onClick:v=>{v.stopPropagation(),o==null||o("compact")},children:(0,Z.jsx)(Va,{style:{width:13,height:13}})}),(0,Z.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:v=>{v.stopPropagation(),o==null||o("list")},children:(0,Z.jsx)(wn,{style:{width:13,height:13}})})]})]})}var ya=A(Se(),1);var fe=A($(),1),zv=[{id:"board",label:"Board",icon:(0,fe.jsx)($a,{className:"w-3.5 h-3.5"})},{id:"enforcement",label:"Enforcement",icon:(0,fe.jsx)(Tn,{className:"w-3.5 h-3.5"})}];function Id({open:e,visibleCols:t,settings:a,onClose:r,onSave:o}){let[n,l]=ya.default.useState("board"),[s,u]=ya.default.useState({}),[d,g]=ya.default.useState(a.autoCommit??!1),[m,c]=ya.default.useState(a.autoComment??!1),[y,x]=ya.default.useState(a.autoPush??!1),[C,O]=ya.default.useState(a.createBranch??!1),[f,i]=ya.default.useState(a.requireVerifyBeforeReview??!1);ya.default.useEffect(()=>{if(!e)return;let I={};Ga.forEach(P=>{I[P.id]=t.includes(P.id)}),u(I),g(a.autoCommit??!1),c(a.autoComment??!1),x(a.autoPush??!1),O(a.createBranch??!1),i(a.requireVerifyBeforeReview??!1),l("board")},[e,t,a]);function p(){let I=Ga.filter(P=>s[P.id]).map(P=>P.id);o(I,{autoCommit:d,autoComment:m,autoPush:y,createBranch:C,requireVerifyBeforeReview:f}),r()}function L(I){u(P=>({...P,[I]:!P[I]}))}return(0,fe.jsxs)(va,{open:e,onClose:r,id:"settings-modal",width:"min(460px, 95vw)",icon:(0,fe.jsx)(Lr,{style:{width:14,height:14,color:"var(--p-text-g)"}}),title:"Settings",headerActions:(0,fe.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:I=>{I.currentTarget.style.background="var(--p-surface)",I.currentTarget.style.color="var(--p-text-m)"},onMouseOut:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--p-text-g)"},children:(0,fe.jsx)(Ne,{style:{width:14,height:14}})}),footer:(0,fe.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,fe.jsx)("button",{id:"settings-cancel",onClick:r,className:"dp-status-btn",style:{padding:"5px 14px",fontSize:12},children:"Cancel"}),(0,fe.jsx)("button",{id:"settings-apply",onClick:p,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:I=>{I.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 28%, transparent)"},onMouseOut:I=>{I.currentTarget.style.background="color-mix(in srgb, var(--p-purple) 18%, transparent)"},children:"Apply"})]}),children:[(0,fe.jsx)("div",{className:"dp-tabs",children:zv.map(I=>(0,fe.jsxs)("button",{onClick:()=>l(I.id),className:`dp-tab${n===I.id?" active":""}`,style:{display:"flex",alignItems:"center",gap:6},children:[I.icon,I.label]},I.id))}),n==="board"&&(0,fe.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:10},children:[(0,fe.jsx)("div",{className:"dp-meta-label",children:"Visible Columns"}),Ga.map(I=>(0,fe.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",userSelect:"none"},children:[(0,fe.jsx)("input",{id:`settings-col-${I.id}`,type:"checkbox",checked:s[I.id]??!0,onChange:()=>L(I.id),style:{width:14,height:14,accentColor:I.color,cursor:"pointer"}}),(0,fe.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:I.color,flexShrink:0}}),(0,fe.jsx)("span",{style:{fontSize:13,color:"var(--p-text-m)"},children:I.label})]},I.id))]}),n==="enforcement"&&(0,fe.jsxs)("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:16},children:[(0,fe.jsx)(Bn,{id:"settings-verify-before-review",label:"Require verify before review",description:"CLI enforces vibeflow verify before setting status to review (skipped for tasks without URL/selector). The \'verified\' flag persists until the task is moved back to in-progress.",value:f,onChange:i}),(0,fe.jsx)(Bn,{id:"settings-auto-comment",label:"Require comment on review",description:"CLI enforces an implementation report when setting task status to review.",value:m,onChange:c}),(0,fe.jsx)("div",{style:{height:1,background:"var(--p-border)",marginTop:-4,marginBottom:-4}}),(0,fe.jsx)(Bn,{id:"settings-create-branch",label:"Require branch per task",description:"CLI enforces a dedicated branch name when setting task status to review.",value:C,onChange:O}),(0,fe.jsx)(Bn,{id:"settings-auto-commit",label:"Auto-commit on review",description:"CLI automatically commits staged changes when setting task status to review.",value:d,onChange:g}),(0,fe.jsx)(Bn,{id:"settings-auto-push",label:"Auto-push after commit",description:`CLI pushes after auto-commit. Requires \'Auto-commit\' to be ON.${d?"":" (Enable Auto-commit first)"}`,value:y&&d,onChange:I=>x(I&&d)})]})]})}function Bn({id:e,label:t,description:a,value:r,onChange:o}){return(0,fe.jsxs)("div",{children:[(0,fe.jsx)("div",{className:"dp-meta-label",style:{marginBottom:4},children:t}),(0,fe.jsx)("div",{style:{fontSize:11,color:"var(--p-text-g)",marginBottom:10},children:a}),(0,fe.jsxs)("div",{id:e,style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer"},onClick:()=>o(!r),children:[(0,fe.jsxs)("div",{style:{position:"relative",width:36,height:20,flexShrink:0},children:[(0,fe.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,fe.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,fe.jsx)("span",{style:{fontSize:12,color:"var(--p-text-g)"},children:r?"On":"Off"})]})]})}var vo=A(Se(),1);var me=A($(),1);function _m(e){return/\\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function Ts(e){return/\\.md$/i.test(e)}function On(e){return/\\.json$/i.test(e)}function Nv(e){let t=[],a=0;for(;a<e.length;){let r=e.slice(a).match(/^(\\s+)/);if(r){t.push({type:"punct",value:r[1]}),a+=r[1].length;continue}let o=e.slice(a).match(/^([{}[\\]:,])/);if(o){t.push({type:"punct",value:o[1]}),a+=1;continue}let n=e.slice(a).match(/^"([^"\\\\]|\\\\.)*"/);if(n){let d=n[0],g=e[a+d.length]===":",c=d.slice(1,-1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");t.push({type:g?"key":"string",value:c}),a+=d.length;continue}let l=e.slice(a).match(/^(-?\\d+(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)/);if(l){t.push({type:"number",value:l[1]}),a+=l[1].length;continue}let s=e.slice(a).match(/^(true|false)/);if(s){t.push({type:"bool",value:s[1]}),a+=s[1].length;continue}let u=e.slice(a).match(/^(null)/);if(u){t.push({type:"null",value:u[1]}),a+=1;continue}t.push({type:"punct",value:e[a]}),a++}return t}var Hv={key:{color:"#c084fc"},string:{color:"#86efac"},number:{color:"#67e8f9"},bool:{color:"#fb923c"},null:{color:"#f87171"},punct:{color:"inherit"}};function Uv({tokens:e}){return(0,me.jsx)("div",{children:e.map((t,a)=>(0,me.jsx)("span",{style:Hv[t.type],children:t.value},a))})}function Cd({open:e,name:t,url:a,onClose:r}){let[o,n]=vo.default.useState(null),[l,s]=vo.default.useState(null),[u,d]=vo.default.useState(!1),[g,m]=vo.default.useState(!1);return vo.default.useEffect(()=>{!e||!a||(d(!1),Ts(t)?(m(!0),n(null),fetch(a).then(c=>c.text()).then(c=>{n(c),m(!1)}).catch(()=>{n("Error loading file."),m(!1)})):On(t)?(m(!0),s(null),fetch(a).then(c=>c.text()).then(c=>{try{let y=JSON.parse(c),C=JSON.stringify(y,null,2).split(`\n`).map(Nv);s(C)}catch{d(!0)}m(!1)}).catch(()=>{d(!0),m(!1)})):(n(null),s(null)))},[e,t,a]),(0,me.jsx)(va,{open:e,onClose:r,id:"file-preview-modal",width:"min(1100px, 95vw)",maxHeight:"88vh",boxStyle:{display:"flex",flexDirection:"column"},icon:(0,me.jsx)(so,{className:"w-4 h-4 text-slate-400"}),title:t,headerActions:(0,me.jsxs)(me.Fragment,{children:[(0,me.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,me.jsx)(xr,{className:"w-4 h-4"})}),(0,me.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,me.jsx)(Ne,{className:"w-4 h-4"})})]}),footer:(0,me.jsxs)(me.Fragment,{children:[(0,me.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,me.jsx)(xr,{className:"w-3.5 h-3.5"}),"Download"]}),(0,me.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,me.jsxs)("div",{className:"flex-1 overflow-auto",style:{minHeight:0,padding:"16px 20px"},children:[_m(t)&&(0,me.jsx)("div",{style:{borderRadius:8,overflow:"hidden",border:"1px solid var(--p-border)",background:"var(--p-card)",display:"inline-block",width:"100%"},children:(0,me.jsx)("img",{src:a,alt:t,style:{maxWidth:"100%",display:"block",margin:"0 auto",objectFit:"contain"}})}),Ts(t)&&g&&(0,me.jsx)("p",{className:"text-xs text-slate-500 py-4",children:"Loading\\u2026"}),Ts(t)&&!g&&o!==null&&(0,me.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,me.jsx)(ta,{markdown:o})}),On(t)&&g&&(0,me.jsx)("p",{className:"text-xs text-slate-500 py-4",children:"Loading\\u2026"}),On(t)&&!g&&u&&(0,me.jsx)("p",{className:"text-xs text-red-400 py-4",children:"Error loading or parsing JSON file."}),On(t)&&!g&&l!==null&&(0,me.jsx)("pre",{id:"file-preview-json",style:{background:"var(--p-input)",border:"1px solid var(--p-border-s)",borderRadius:8,padding:"12px 16px",fontSize:12,lineHeight:1.6,overflow:"auto",maxHeight:"70vh",margin:0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:l.map((c,y)=>(0,me.jsx)(Uv,{tokens:c},y))}),!_m(t)&&!Ts(t)&&!On(t)&&(0,me.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-slate-500",children:[(0,me.jsx)(so,{className:"w-10 h-10 opacity-40"}),(0,me.jsx)("p",{className:"text-sm",children:"Preview not available for this file type."}),(0,me.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,me.jsx)(xr,{className:"w-3.5 h-3.5"}),"Download file"]})]})]})})}var Rs=window.location.origin,Vt=`${Rs}/api/tasks`,Dt={async getTasks(){return(await fetch(`${Vt}?_=${Date.now()}`,{cache:"no-store"})).json()},async createTask(e){return(await fetch(Vt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()},async updateTask(e,t){return(await fetch(`${Vt}/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()},async deleteTask(e){await fetch(`${Vt}/${e}`,{method:"DELETE"})},async getComments(e){return(await fetch(`${Vt}/${e}/comments`)).json()},async addComment(e,t){await fetch(`${Vt}/${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(`${Vt}/${e}/comments/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})})},async deleteComment(e,t){await fetch(`${Vt}/${e}/comments/${t}`,{method:"DELETE"})},async getFiles(e){return(await fetch(`${Vt}/${e}/files`)).json()},async uploadFile(e,t){let a=await t.arrayBuffer();await fetch(`${Vt}/${e}/files/${encodeURIComponent(t.name)}`,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:a})},async deleteFile(e,t){await fetch(`${Vt}/${e}/files/${encodeURIComponent(t)}`,{method:"DELETE"})},async getProject(){return(await fetch(`${Rs}/api/project`)).json()},async getSettings(){return(await fetch(`${Rs}/api/settings`,{cache:"no-store"})).json()},async saveSettings(e){await fetch(`${Rs}/api/settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},wsUrl(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`}};var qm=["display","visibility","opacity","position","overflow","overflow-x","overflow-y","width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-width","border-style","border-color","border-radius","background-color","background-image","color","font-size","font-weight","font-style","font-family","line-height","letter-spacing","text-align","text-decoration","text-overflow","white-space","flex-direction","flex-wrap","flex","justify-content","align-items","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","z-index","box-shadow","transform","transition","cursor","user-select","pointer-events","top","left","right","bottom"];function _v(e){let t=[],a=e;for(;a&&a!==document.documentElement;){let r=1,o=a.previousElementSibling;for(;o;)o.tagName===a.tagName&&r++,o=o.previousElementSibling;let n=a.tagName.toLowerCase();t.unshift(`${n}[${r}]`),a=a.parentElement}return"/"+t.join("/")}function qv(e){let t=e.parentElement;if(!t||t===document.body)return;let a=t.outerHTML;return a.length<=500?a:a.slice(0,500)+"\\u2026"}function Wv(){return navigator.userAgent}function $v(e){let t=e.getBoundingClientRect(),a="auto",r="static",o,n=e;for(;n&&n!==document.documentElement;){let l=window.getComputedStyle(n),s=l.position,u=l.zIndex;if(s!=="static"||u!=="auto"){if(n===e)r=s,a=u;else if(o===void 0){o=u;break}}if(s!=="static")break;n=n.parentElement}return{boundingBox:{x:t.x,y:t.y,width:t.width,height:t.height},scrollPosition:{x:window.scrollX,y:window.scrollY},viewport:{width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio},stackingContext:{zIndex:a,position:r,parentZIndex:o}}}function Vv(e){let t=window.getComputedStyle(e),a={};for(let r of qm)a[r]=t.getPropertyValue(r);return a}function Wm(e,t,a=[]){return{outerHTML:e.outerHTML,computedStyles:Vv(e),selector:t,xpath:_v(e),position:$v(e),parentSnippet:qv(e),browser:Wv(),consoleErrors:a,capturedAt:new Date().toISOString()}}async function $m(e,t){if(!(!t||t==="/"||t==="body"||t==="html"))try{let a=document.querySelector(t);if(!a){console.warn(`[Vibeflow] Cannot capture baseline: element not found for selector "${t}"`);return}let r=Wm(a,t),o=`/api/tasks/${e}/baseline`;await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseline:r})})}catch(a){console.error("[Vibeflow] Failed to store baseline:",a)}}var Ds=A(Se(),1);var Vm="vibeflow-last-seen-version";function Kv(e,t){let a=d=>d.replace(/[^0-9.]/g,"").split(".").map(Number),[r=0,o=0,n=0]=a(e),[l=0,s=0,u=0]=a(t);return r!==l?r>l:o!==s?o>s:n>u}function Km(e,t){return!t||!e?!1:Kv(t,e)}function Gm(){try{return localStorage.getItem(Vm)}catch{return null}}function Ms(e){try{localStorage.setItem(Vm,e)}catch{}}function jm(e,t){return e.find(r=>r.version===t)??e[0]??null}function wd(e){return e?`## ${e.version}\n\n${e.markdown}`:""}function Xm(e){return e.map(t=>wd(t)).join(`\n\n`)}async function As(){try{let e=await fetch(`${window.location.origin}/api/changelog?_=${Date.now()}`,{cache:"no-store"});if(!e.ok)return[];let t=await e.json();return Array.isArray(t.sections)?t.sections:[]}catch{return[]}}var yo=A($(),1);function Qm({open:e,sections:t,version:a,startMode:r,onClose:o}){let[n,l]=Ds.default.useState(r);Ds.default.useEffect(()=>{e&&l(r)},[e,r]);let s=Ds.default.useMemo(()=>jm(t,a),[t,a]),u=n==="full"?Xm(t):wd(s);return(0,yo.jsx)(va,{open:e,onClose:o,id:"whats-new-modal",width:"min(680px, 95vw)",maxHeight:"80vh",title:n==="full"?"Changelog":"What\'s new in Vibeflow",headerActions:(0,yo.jsx)("button",{id:"whats-new-toggle",onClick:()=>l(d=>d==="full"?"whatsnew":"full"),style:{fontSize:12,color:"#60a5fa",background:"transparent",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:n==="full"?"What\'s new":"View full changelog"}),footer:(0,yo.jsx)("button",{id:"whats-new-close",onClick:o,style:{padding:"7px 16px",borderRadius:8,background:"#2563eb",border:"none",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:n==="full"?"Close":"Got it"}),children:(0,yo.jsx)("div",{style:{padding:"14px 18px",overflowY:"auto",flex:1,minHeight:0,fontSize:13,color:"var(--p-text-f)"},children:(0,yo.jsx)(ta,{markdown:u})})})}var Y=A($(),1),Gv=window.__PORT__??3700,jv=window.__SAAS_MODE__??!1,Ym=window.__BOARD_URL__??"",Xv=window.__BOARD_NAME__??"",tg=window.__IS_ADMIN__??!1,Jm=window.__CLI_VERSION__??"";function Qv({onClose:e}){let t=window.location.origin,[a,r]=te.default.useState("idle"),[o,n]=te.default.useState(!0),[l,s]=te.default.useState(null),[u,d]=te.default.useState("");async function g(){r("pushing"),d("");try{let c=await fetch(`${t}/api/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({keepLocalFiles:o})}),y=await c.json();if(!c.ok){d(y.error??"Push failed"),r("error");return}s({imported:y.imported??0,skipped:y.skipped}),r("done")}catch(c){d(c instanceof Error?c.message:"Network error"),r("error")}}let m=a==="pushing";return(0,Y.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,Y.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,Y.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,Y.jsxs)("div",{style:{padding:"36px 36px 20px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,Y.jsx)("div",{style:{position:"relative",width:52,height:52,marginBottom:22},children:(0,Y.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Y.jsx)("rect",{width:"18",height:"18",rx:"4",fill:"#2563eb"}),(0,Y.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"white",opacity:"0.7"}),(0,Y.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"white"}),(0,Y.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"white",opacity:"0.7"}),(0,Y.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"white",opacity:"0.85"})]})}),(0,Y.jsx)("h1",{style:{fontSize:18,fontWeight:700,color:"#f1f5f9",letterSpacing:"-0.3px",margin:"0 0 7px"},children:"Online Mode Active"}),(0,Y.jsxs)("p",{style:{fontSize:12,color:"rgba(255,255,255,0.36)",lineHeight:1.5,margin:0},children:["Connected to"," ",(0,Y.jsx)("strong",{style:{color:"rgba(255,255,255,0.55)",fontWeight:500},children:Xv||"Vibeflow SaaS"})]})]}),a==="done"&&l&&(0,Y.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,Y.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",children:(0,Y.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"&&u&&(0,Y.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:u}),(0,Y.jsxs)("div",{style:{padding:"20px 24px 28px",display:"flex",flexDirection:"column",gap:8},children:[Ym&&(0,Y.jsx)("a",{href:Ym,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:c=>{c.currentTarget.style.background="#3b82f6",c.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:c=>{c.currentTarget.style.background="#2563eb",c.currentTarget.style.transform="none"},children:"Open Web App \\u2192"}),a!=="done"&&(0,Y.jsx)("button",{onClick:()=>{g()},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:c=>{m||(c.currentTarget.style.borderColor="rgba(255,255,255,0.15)",c.currentTarget.style.color="rgba(255,255,255,0.65)",c.currentTarget.style.background="rgba(255,255,255,0.03)")},onMouseLeave:c=>{m||(c.currentTarget.style.borderColor="rgba(255,255,255,0.08)",c.currentTarget.style.color="rgba(255,255,255,0.4)",c.currentTarget.style.background="transparent")},children:m?"\\u23F3 Pushing\\u2026":"\\u2191 Push local tasks"})]}),(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px 20px"},children:[(0,Y.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:7,cursor:"pointer"},children:[(0,Y.jsx)("input",{type:"checkbox",checked:o,onChange:c=>n(c.target.checked),style:{accentColor:"#2563eb",width:13,height:13,cursor:"pointer"}}),(0,Y.jsx)("span",{style:{fontSize:11.5,color:"rgba(255,255,255,0.28)"},children:"Keep local files"})]}),tg&&e&&(0,Y.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:c=>{c.currentTarget.style.color="rgba(255,255,255,0.45)"},onMouseLeave:c=>{c.currentTarget.style.color="rgba(255,255,255,0.2)"},children:"Dismiss (admin)"})]})]})})}var Zm={backlog:"Backlog",todo:"Todo","in-progress":"In Progress",review:"Review",done:"Done"};function Yv(e,t,a){let r=a?e.filter(s=>{var u,d;return((u=s.title)==null?void 0:u.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 Co,Pr;let[e,t]=te.default.useState([]),[a,r]=te.default.useState(!0),[o,n]=te.default.useState(!1),[l,s]=te.default.useState({open:!1,task:null,tab:"details"}),[u,d]=te.default.useState("board"),[g,m]=te.default.useState(!1),[c,y]=te.default.useState({open:!1,startMode:"whatsnew",sections:[],version:""}),[x,C]=te.default.useState({open:!1,name:"",url:""}),[O,f]=te.default.useState(420),[i,p]=te.default.useState(!1),[L,I]=te.default.useState(""),[P,v]=te.default.useState(Ga.map(h=>h.id)),[S,_]=te.default.useState({status:"all",component:null,type:null,user:null,tags:[]}),[k,M]=te.default.useState("Proto Board"),[U,z]=te.default.useState(!1),[V,ae]=te.default.useState(!1),[T,K]=te.default.useState("You"),[re,J]=te.default.useState(null),[j,se]=te.default.useState({}),qe=te.default.useRef(null),at=te.default.useRef(null),Kt=te.default.useRef(0),rt=te.default.useRef(null),Gt=te.default.useRef(null),[Et,oa]=te.default.useState([]),Lo=te.default.useRef(!1),ot=te.default.useRef([]),[zn,So]=te.default.useState([]);te.default.useEffect(()=>(We(),Io(),Hn(),Nn(),Ya(),Un(),()=>{var h;at.current&&clearTimeout(at.current),(h=qe.current)==null||h.close()}),[]),te.default.useEffect(()=>{if(U){rt.current&&(clearInterval(rt.current),rt.current=null);return}return rt.current=setInterval(()=>{We()},5e3),()=>{rt.current&&(clearInterval(rt.current),rt.current=null)}},[U]),te.default.useEffect(()=>{document.body.setAttribute("data-theme","dark")},[]),te.default.useEffect(()=>{function h(){let D=window.location.hash.match(/^#task-([a-f0-9]{30})$/i);if(!D){Gt.current=null;return}let q=D[1].toLowerCase();if(Gt.current===q)return;let ce=e.find(ue=>ue.id.toLowerCase()===q);ce&&(Gt.current=q,Lo.current?s(ue=>({...ue,open:!0,task:ce,tab:"details"})):s(ue=>(ue.task&&ue.task.id!==ce.id&&oa(ie=>[...ie,ue.task]),{...ue,open:!0,task:ce,tab:"details"})),Lo.current=!1)}h();let b=()=>{Gt.current=null,h()};return window.addEventListener("hashchange",b),()=>{window.removeEventListener("hashchange",b)}},[e]),te.default.useEffect(()=>{if(!l.open||!l.task)return;let h=e.find(q=>q.id===l.task.id);if(!h)return;let b=l.task;Object.keys(h).some(q=>h[q]!==b[q])&&s(q=>({...q,task:h}))},[e,l.open,(Co=l.task)==null?void 0:Co.id]),te.default.useEffect(()=>{function h(b){var ce,ue,ie;let D=(ce=b.target)==null?void 0:ce.tagName,q=D==="INPUT"||D==="TEXTAREA"||((ue=b.target)==null?void 0:ue.isContentEditable);if(b.key==="Escape"){if(x.open){C(de=>({...de,open:!1}));return}if(l.open){s(de=>({...de,open:!1}));return}if(g){m(!1);return}}if(!q&&((b.key==="?"||b.key==="/"&&b.shiftKey)&&((ie=document.getElementById("header-shortcuts-hint"))==null||ie.click()),b.altKey&&!b.ctrlKey&&!b.metaKey&&(b.key==="n"||b.key==="N")&&(b.preventDefault(),la(null,"details")),b.altKey&&!b.ctrlKey&&!b.metaKey&&(b.key==="f"||b.key==="F"))){b.preventDefault();let de=document.getElementById("global-search");de==null||de.focus(),de==null||de.select()}}return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[x.open,l.open,g]);function kr(h,b,D,q,ce){let ue=new Date().toISOString(),ie=Zm[b]??b,de=Zm[D]??D,Xe=Date.now()-3e3;So(Ae=>Ae.some(F=>F.taskId===h&&F.to===de&&new Date(F.timestamp).getTime()>Xe)?Ae:[...Ae,{taskId:h,field:"status",from:ie,to:de,actor:q,timestamp:ue,source:ce}].slice(-500))}async function We(){try{let h=await Dt.getTasks();ot.current=h.tasks??[],t(h.tasks??[])}catch{}finally{r(!1)}}let ct=te.default.useCallback((h,b,D)=>{let q=String(h.id??"");if(!q)return;let ce=h.created??h.createdAt,ue=h.updated?String(h.updated):void 0,ie=Array.isArray(h.comments)?h.comments.filter(Re=>!Re.deleted).length:void 0,de=typeof h.fileCount=="number"?h.fileCount:Array.isArray(h.files)?h.files.length:void 0,Xe=h.status?String(h.status):void 0,Ae=ot.current.find(Re=>Re.id===q);Xe&&Ae&&Ae.status!==Xe&&kr(q,Ae.status,Xe,b??"Someone",D),t(Re=>{let F=Re.find(mt=>mt.id===q),pt={id:q,title:h.title?String(h.title):(F==null?void 0:F.title)??"Untitled",description:h.description==null?(F==null?void 0:F.description)??"":String(h.description),status:Xe??(F==null?void 0:F.status)??"todo",type:h.type?String(h.type):F==null?void 0:F.type,priority:h.priority?String(h.priority):F==null?void 0:F.priority,selector:h.selector?String(h.selector):F==null?void 0:F.selector,cssSelector:h.cssSelector?String(h.cssSelector):F==null?void 0:F.cssSelector,file:h.file?String(h.file):F==null?void 0:F.file,line:typeof h.line=="number"?h.line:F==null?void 0:F.line,col:typeof h.col=="number"?h.col:F==null?void 0:F.col,component:h.component?String(h.component):F==null?void 0:F.component,url:h.url?String(h.url):F==null?void 0:F.url,reportBack:h.reportBack===!0||(F==null?void 0:F.reportBack)===!0,commit:h.commit?String(h.commit):F==null?void 0:F.commit,commits:Array.isArray(h.commits)?h.commits:F==null?void 0:F.commits,commentCount:ie??(F==null?void 0:F.commentCount),fileCount:de??(F==null?void 0:F.fileCount),createdAt:ce?String(ce):(F==null?void 0:F.createdAt)??new Date().toISOString(),updatedAt:ue??(F==null?void 0:F.updatedAt),author:h.author?String(h.author):F==null?void 0:F.author,tags:Array.isArray(h.tags)?h.tags:F==null?void 0:F.tags,sortKey:h.sortKey?String(h.sortKey):F==null?void 0:F.sortKey},nt=Re.filter(mt=>mt.id!==q);return nt.push(pt),nt.sort((mt,St)=>{let wo=new Date(mt.updatedAt??mt.createdAt??"").getTime(),Za=new Date(St.updatedAt??St.createdAt??"").getTime();return wo===Za?mt.id.localeCompare(St.id):Za-wo}),ot.current=nt,nt})},[]);async function Io(){try{let h=await Dt.getProject();h.name&&M(h.name),h.gitUserName&&K(h.gitUserName)}catch{}}async function Nn(){try{let h=await fetch("/api/github-url").then(b=>b.json());J(h.githubUrl??null)}catch{}}async function Ya(){var ce;let h=Gm(),b=Jm,D=null;if(b||(D=await As(),b=((ce=D[0])==null?void 0:ce.version)??""),!b)return;if(!h){Ms(b);return}if(!Km(h,b))return;let q=D??await As();if(q.length===0){Ms(b);return}y({open:!0,startMode:"whatsnew",sections:q,version:b})}async function na(){var D;let h=c.sections.length?c.sections:await As(),b=Jm||((D=h[0])==null?void 0:D.version)||c.version;y({open:!0,startMode:"full",sections:h,version:b})}function Es(){c.version&&Ms(c.version),y(h=>({...h,open:!1}))}async function Hn(){var h;try{let D=await Dt.getSettings();se(D),(h=D.visibleCols)!=null&&h.length&&v(D.visibleCols),D.viewMode&&d(D.viewMode==="condensed"?"compact":D.viewMode),D.panelWidth&&D.panelWidth>=280&&D.panelWidth<=900&&f(D.panelWidth)}catch{}}function Un(){let b=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,D=new WebSocket(b);qe.current=D,D.addEventListener("open",()=>{z(!0),ae(!0),Kt.current=0,We()}),D.addEventListener("close",()=>{z(!1),at.current&&clearTimeout(at.current),at.current=setTimeout(Un,2e3)}),D.addEventListener("error",()=>{}),D.addEventListener("message",ce=>{var ue;try{let ie=JSON.parse(ce.data);if(ie.type==="tasks-updated"||(ue=ie.type)!=null&&ue.startsWith("task:")){We();return}if(ie.type==="task-changed"&&ie.task){let de=ie.task,Xe=typeof de.alteredBy=="string"?de.alteredBy:typeof de.author=="string"?de.author:"Someone",Ae=ie.source==="cli"?"cli":void 0;ct(de,Xe,Ae);return}if(ie.type==="task-deleted"&&ie.taskId){let de=String(ie.taskId);t(Xe=>{let Ae=Xe.filter(Re=>Re.id!==de);return ot.current=Ae,Ae})}}catch{}});let q=setInterval(()=>{D.readyState===WebSocket.OPEN&&D.send(JSON.stringify({type:"ping"}))},2e4);D.addEventListener("close",()=>clearInterval(q)),D.addEventListener("error",()=>{})}async function Ja(h,b){let D=ot.current.find(q=>q.id===h);t(q=>{let ce=q.map(ue=>ue.id===h?{...ue,...b}:ue);return ot.current=ce,ce}),b.status&&(D!=null&&D.status)&&b.status!==D.status&&kr(h,D.status,b.status,T);try{let q=await Dt.updateTask(h,b);q.task&&t(ce=>{let ue=ce.map(ie=>ie.id===h?q.task:ie);return ot.current=ue,ue})}catch{We()}}async function Fs(h,b,D,q,ce){let ue=ot.current.filter(Ae=>Ae.status===b).sort(vn),ie=nd(ue,h,D,q),de=ce??ie.newSortKey,Xe=ie.normalizationPatches;t(Ae=>{let Re=new Map;for(let{id:pt,sortKey:nt}of Xe)Re.set(pt,{sortKey:nt});Re.set(h,{status:b,sortKey:de});let F=Ae.map(pt=>Re.has(pt.id)?{...pt,...Re.get(pt.id)}:pt);return ot.current=F,F}),await Dt.updateTask(h,{status:b,sortKey:de}).catch(()=>{We()})}async function _n(h){t(b=>{let D=b.filter(q=>q.id!==h);return ot.current=D,D});try{await Dt.deleteTask(h)}catch{We()}}async function La(h){var b,D;try{let q=await Dt.createTask(h);return await We(),(b=q==null?void 0:q.task)!=null&&b.id&&h.selector&&$m(q.task.id,h.selector),(D=q==null?void 0:q.task)==null?void 0:D.id}catch{}}function la(h,b="details",D){oa([]),s({open:!0,task:h,tab:b,addColumnId:D})}function Bs(){oa(h=>{if(h.length===0)return h;let b=h[h.length-1],D=h.slice(0,-1);return Lo.current=!0,Gt.current=null,window.location.hash=`#task-${b.id}`,s(q=>({...q,open:!0,task:b,tab:"details"})),D})}function qn(h,b){if(b.startsWith("/")&&!b.startsWith("//")||b.startsWith(window.location.origin+"/")){if(/\\.html?$/i.test(h)){window.open(b,"_blank","noopener,noreferrer");return}C({open:!0,name:h,url:b})}}let br=Yv(e,P,L.toLowerCase()),Wn=window.location.origin,$n=te.default.useMemo(()=>{let h=new Set;return e.forEach(b=>(b.tags??[]).forEach(D=>h.add(D))),Array.from(h).sort()},[e]),Vn=te.default.useMemo(()=>{var b;let h=(b=l.task)==null?void 0:b.id;return h?zn.filter(D=>D.taskId===h).map(({field:D,from:q,to:ce,actor:ue,timestamp:ie,source:de})=>({field:D,from:q,to:ce,actor:ue,timestamp:ie,source:de})):[]},[(Pr=l.task)==null?void 0:Pr.id,zn]),Kn=te.default.useMemo(()=>{let h=e;return S.status!=="all"&&(h=h.filter(b=>b.status===S.status)),S.component&&(h=h.filter(b=>b.component===S.component)),S.type&&(h=h.filter(b=>b.type===S.type)),S.user&&(h=h.filter(b=>b.author===S.user)),S.tags&&S.tags.length>0&&(h=h.filter(b=>S.tags.every(D=>(b.tags??[]).includes(D)))),h},[e,S]),Gn=V&&!U;return(0,Y.jsxs)(Y.Fragment,{children:[jv&&!o&&(0,Y.jsx)(Qv,{onClose:tg?()=>n(!0):void 0}),(0,Y.jsx)(fd,{projectName:k,missingProjectIconStyle:"vibeflow",wsConnected:U,port:Gv,searchQuery:L,filterTags:S.tags,allTags:$n,onToggleTag:h=>{let b=S.tags??[],D=b.includes(h)?b.filter(q=>q!==h):[...b,h];_(q=>({...q,tags:D}))},isLoading:a,taskSummary:br,onSearchChange:I,onSettings:()=>m(!0),extraActions:(0,Y.jsx)(po,{id:"changelog-btn",title:"View changelog",onClick:()=>{na()},label:"Changelog"})}),(0,Y.jsx)(Sd,{tasks:e,filter:S,view:u,onFilter:_,onViewChange:h=>{d(h),Dt.saveSettings({...j,viewMode:h}),se(b=>({...b,viewMode:h}))}}),(0,Y.jsxs)("div",{className:"flex flex-1 overflow-hidden",style:{minHeight:0,position:"relative"},children:[u==="list"?(0,Y.jsx)(dd,{tasks:Kn,searchQuery:L,isLoading:a,onOpenPanel:(h,b)=>la(h,b),onAddTask:h=>la(null,"details",h),onDrop:(h,b)=>Ja(h,{status:b})}):(0,Y.jsx)(ud,{tasks:Kn,visibleCols:P,searchQuery:L,isLoading:a,compact:u==="compact",onOpenPanel:(h,b,D)=>la(h,b,D),onDrop:(h,b)=>Ja(h,{status:b}),onReorder:Fs}),l.open&&(0,Y.jsxs)("div",{id:"detail-panel-container",style:{width:O,zIndex:i?30:10},className:i?"resizing":"",children:[(0,Y.jsx)("div",{id:"detail-panel-resize-handle",onMouseDown:h=>{h.preventDefault(),p(!0),document.body.classList.add("vibeflow-resizing-panel");let b=h.clientX,D=O,q=ue=>{let ie=D-(ue.clientX-b);f(Math.max(360,Math.min(860,ie)))},ce=ue=>{p(!1),document.body.classList.remove("vibeflow-resizing-panel");let ie=Math.max(360,Math.min(860,D-(ue.clientX-b)));Dt.saveSettings({...j,panelWidth:ie}),se(de=>({...de,panelWidth:ie})),window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",ce)};window.addEventListener("mousemove",q),window.addEventListener("mouseup",ce)}}),(0,Y.jsx)(Ld,{open:l.open,task:l.task,tab:l.tab,showLockIndicator:!1,addColumnId:l.addColumnId,gitUserName:T,githubUrl:re,baseUrl:Wn,isResizing:i,api:Dt,onClose:()=>{oa([]),s(h=>({...h,open:!1}))},onSave:async h=>{l.task&&await Ja(l.task.id,h),s(b=>({...b,open:!1}))},onCreate:async h=>{let b=await La(h);return s(D=>({...D,open:!1})),b},onDelete:async h=>{await _n(h),s(b=>({...b,open:!1}))},onPatch:Ja,onFilePreview:qn,onGoBack:Et.length>0?Bs:void 0,navBackLabel:Et.length>0?Et[Et.length-1].title:void 0,externalLocalChanges:Vn,allTasks:e,createBranch:j.createBranch})]})]}),Gn&&(0,eg.createPortal)((0,Y.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,Y.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,Y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,Y.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,Y.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),(0,Y.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--p-text)"},children:"Connection Lost"})]}),(0,Y.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,Y.jsx)(Id,{open:g,visibleCols:P,settings:j,onClose:()=>m(!1),onSave:(h,b)=>{v(h);let D={...j,...b,visibleCols:h};se(D),Dt.saveSettings(D)}}),(0,Y.jsx)(Cd,{open:x.open,name:x.name,url:x.url,onClose:()=>C(h=>({...h,open:!1}))}),(0,Y.jsx)(Qm,{open:c.open,sections:c.sections,version:c.version,startMode:c.startMode,onClose:Es})]})}var ng=A($(),1),rg=document.getElementById("root");rg&&(0,og.createRoot)(rg).render((0,ng.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/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/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/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/plus.js:\nlucide-react/dist/esm/icons/rows-3.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/tag.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 Jr=Xr(import.meta.url),Zr=Qr(Jr),ea=[ct(Zr,"kanban-template.html"),ct(process.cwd(),"src","server","kanban-template.html"),ct(process.cwd(),"dist","server","kanban-template.html")];function ta(t){let e=ea.find(n=>Yr(n));if(!e)throw new Error("kanban-template.html not found in expected locations");return Gr(e,"utf8").replaceAll("__PORT__",String(t))}function na(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 ra="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiByeD0iNCIgZmlsbD0iIzI1NjNlYiIvPjxyZWN0IHg9IjIuNSIgeT0iNSIgd2lkdGg9IjIiIGhlaWdodD0iOCIgcng9IjEiIGZpbGw9IndoaXRlIiBvcGFjaXR5PSIwLjciLz48cmVjdCB4PSI2LjUiIHk9IjIiIHdpZHRoPSIyIiBoZWlnaHQ9IjE0IiByeD0iMSIgZmlsbD0id2hpdGUiLz48cmVjdCB4PSIxMC41IiB5PSI2IiB3aWR0aD0iMiIgaGVpZ2h0PSI2IiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuNyIvPjxyZWN0IHg9IjE0LjUiIHk9IjQiIHdpZHRoPSIyIiBoZWlnaHQ9IjEwIiByeD0iMSIgZmlsbD0id2hpdGUiIG9wYWNpdHk9IjAuODUiLz48L3N2Zz4=";function aa(t){return`<!DOCTYPE html>
1698
1702
  <html lang="en" class="dark">
1699
1703
  <head>
1700
1704
  <meta charset="UTF-8">
1701
1705
  <meta name="viewport" content="width=device-width, initial-scale=1">
1702
1706
  <title>Vibeflow \u2014 Board</title>
1703
- <link rel="icon" href="${ua}" type="image/svg+xml">
1707
+ <link rel="icon" href="${ra}" type="image/svg+xml">
1704
1708
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
1705
- <style>${Zt}</style>
1709
+ <style>${vn}</style>
1706
1710
  </head>
1707
1711
  <body class="h-screen overflow-hidden flex flex-col" style="background:#020c1b;">
1708
1712
  <div id="root"></div>
1709
- <script>window.__PORT__ = ${t.port}; window.__CLI_VERSION__ = ${JSON.stringify(t.cliVersion??"")}; ${ca(t)}</script>
1710
- <script>${vt}</script>
1713
+ <script>window.__PORT__ = ${t.port}; window.__CLI_VERSION__ = ${JSON.stringify(t.cliVersion??"")}; ${na(t)}</script>
1714
+ <script>${st}</script>
1711
1715
  </body>
1712
- </html>`}function xt(t){let e=typeof t=="number"?{port:t}:t;return vt?da(e):sa(e.port)}import{existsSync as pa,readFileSync as fa}from"fs";import{dirname as ga,join as en}from"path";import{fileURLToPath as ma}from"url";import kt from"chalk";var ba=ga(ma(import.meta.url));function tn(t){let e=/^## (\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)[ \t]*$/gm,n=[...t.matchAll(e)],i=[];for(let l=0;l<n.length;l++){let o=n[l];if(!o)continue;let r=(o.index??0)+o[0].length,s=n[l+1],c=s?s.index??t.length:t.length;i.push({version:o[1]??"",markdown:t.slice(r,c).trim()})}return i}function ha(t){return t[0]??null}function va(t){let e=[` ${kt.bold(`What's new in ${t.version}`)}`,""];for(let n of t.markdown.split(`
1713
- `)){let i=/^### (.+)$/.exec(n);i?e.push(` ${kt.bold.underline(i[1]??"")}`):e.push(` ${kt.dim(n.trimEnd())}`)}return e.join(`
1714
- `)}function qe(t,e={}){let n=tn(t);return n.length===0?"":(e.all?n:n.slice(0,1)).map(l=>va(l)).join(`
1716
+ </html>`}function ut(t){let e=typeof t=="number"?{port:t}:t;return st?aa(e):ta(e.port)}import{existsSync as oa,readFileSync as ia}from"fs";import{dirname as la,join as yn}from"path";import{fileURLToPath as sa}from"url";import dt from"chalk";var ca=la(sa(import.meta.url));function xn(t){let e=/^## (\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)[ \t]*$/gm,n=[...t.matchAll(e)],l=[];for(let a=0;a<n.length;a++){let o=n[a];if(!o)continue;let i=(o.index??0)+o[0].length,s=n[a+1],c=s?s.index??t.length:t.length;l.push({version:o[1]??"",markdown:t.slice(i,c).trim()})}return l}function ua(t){return t[0]??null}function da(t){let e=[` ${dt.bold(`What's new in ${t.version}`)}`,""];for(let n of t.markdown.split(`
1717
+ `)){let l=/^### (.+)$/.exec(n);l?e.push(` ${dt.bold.underline(l[1]??"")}`):e.push(` ${dt.dim(n.trimEnd())}`)}return e.join(`
1718
+ `)}function qe(t,e={}){let n=xn(t);return n.length===0?"":(e.all?n:n.slice(0,1)).map(a=>da(a)).join(`
1715
1719
 
1716
- `)}function ya(t){return[en(t,"..","CHANGELOG.md"),en(t,"..","..","CHANGELOG.md")]}function Re(t=ba){try{for(let e of ya(t))if(pa(e))return fa(e,"utf8");return null}catch{return null}}function nn(t){let e=tn(t??"");return{version:ha(e)?.version??null,sections:e}}import{readFileSync as rn,writeFileSync as Ji,mkdirSync as Zi,existsSync as an}from"fs";import{join as on,basename as xa}from"path";import{execSync as ka}from"child_process";var wt={port:3700};function wa(t){return on(t,U,Ht)}function Le(t){let e=wa(t);if(!an(e))return{...wt};let n=rn(e,"utf-8"),i;try{i=JSON.parse(n)}catch{return{...wt}}return{...wt,...i}}function Ke(t){let e=on(t,"package.json");if(an(e))try{let n=JSON.parse(rn(e,"utf-8"));if(n.name)return n.name}catch{}return xa(t)}function ln(t){try{return ka("git branch --show-current",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}import{mkdirSync as Sa,writeFileSync as _a,renameSync as Ca}from"fs";import{dirname as Ea}from"path";import{randomBytes as Ta}from"crypto";function sn(t){let e=t;return{...t,text:t.text||e.body||"",author:t.author??"agent"}}function pe(t,e){let n=V(t,e);return((n?ee(n):null)?.comments??[]).filter(l=>!l.deleted).map(sn)}function cn(t){return Vt(t)}function be(t,e,n,i,l,o,r){i=cn(i);let s=V(t,e),u=(s?ee(s):null)?.comments??[],d={id:Ta(8).toString("hex"),author:n,text:i,...l&&l.length>0?{files:l}:{},...o&&o!=="comment"?{type:o}:{},createdAt:new Date().toISOString(),source:r??"cli"},b=[...u,d];if(!B(t,e,{comments:b})){let h=Wt(t,e,new Date().toISOString());Sa(Ea(h),{recursive:!0});let j=h+".tmp";_a(j,JSON.stringify({id:e,comments:b},null,2),"utf-8"),Ca(j,h)}return d}function Ye(t,e,n,i){let l=V(t,e),r=(l?ee(l):null)?.comments??[],s=r.find(c=>c.id===n&&!c.deleted);return s?(s.text=cn(i),s.updatedAt=new Date().toISOString(),B(t,e,{comments:r}),sn(s)):null}function Ge(t,e,n){let i=V(t,e),o=(i?ee(i):null)?.comments??[],r=o.findIndex(s=>s.id===n&&!s.deleted);return r===-1?!1:(o[r]={...o[r],deleted:!0,text:"[Comment deleted]",updatedAt:new Date().toISOString()},B(t,e,{comments:o}),!0)}import Qe from"crypto";var ja="vibeflow-auth-v1",Ia=1440*60*1e3;function un(t){return Qe.scryptSync(t,ja,32)}function dn(t,e){let n=un(e),i=Qe.randomBytes(16),l=Qe.createCipheriv("aes-256-gcm",n,i),o=JSON.stringify(t),r=Buffer.concat([l.update(o),l.final()]),s=l.getAuthTag();return{version:1,createdAt:new Date().toISOString(),expiresAt:new Date(Date.now()+Ia).toISOString(),iv:i.toString("hex"),tag:s.toString("hex"),data:r.toString("hex")}}function pn(t,e){if(new Date(t.expiresAt)<new Date)return null;try{let n=un(e),i=Qe.createDecipheriv("aes-256-gcm",n,Buffer.from(t.iv,"hex"));i.setAuthTag(Buffer.from(t.tag,"hex"));let l=Buffer.concat([i.update(Buffer.from(t.data,"hex")),i.final()]);return JSON.parse(l.toString())}catch{return null}}import{execSync as fn}from"child_process";import{existsSync as Na,readFileSync as Pa,writeFileSync as fl,mkdirSync as gl}from"fs";import{join as Ra}from"path";var La="config.json";function Oa(t){return Ra(t,U,La)}function Aa(t){let e=Oa(t);if(!Na(e))return{};try{return JSON.parse(Pa(e,"utf-8"))}catch{return{}}}function $a(t){return t.length<=8?"***":t.slice(0,6)+"..."+t.slice(-4)}function za(){try{return fn("gh auth token --hostname github.com",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()||null}catch{return null}}async function Ma(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 Da(t){let e=process.env.GITHUB_TOKEN;if(e?.trim())return{token:e.trim(),source:"env"};let i=Aa(t).copilotToken;if(typeof i=="string"&&i.trim())return{token:i.trim(),source:"config"};let l=za();return l?{token:l,source:"gh-cli"}:null}async function Fe(t){let e=Da(t);if(!e)return{authenticated:!1,source:null,tokenHint:null,username:null};let n=await Ma(e.token).catch(()=>null);return{authenticated:!0,source:e.source,tokenHint:$a(e.token),username:n}}function Xe(){try{return fn("gh --version",{encoding:"utf-8",timeout:3e3,stdio:["pipe","pipe","pipe"]}),!0}catch{return!1}}import{existsSync as St,readFileSync as gn,writeFileSync as mn,mkdirSync as bn,renameSync as hn}from"fs";import{join as Je}from"path";import vn from"os";var Fa="settings.json";function yn(){return Je(vn.homedir(),".vibeflow","settings.json")}function xn(t){return Je(t,U,Fa)}function _t(){try{return JSON.parse(gn(yn(),"utf-8"))}catch{return{}}}function kn(t){let e=Je(vn.homedir(),".vibeflow");St(e)||bn(e,{recursive:!0});let n=yn(),i=n+".tmp";mn(i,JSON.stringify(t,null,2),"utf-8"),hn(i,n)}function ne(t){let e=_t(),n=xn(t);if(!St(n))return e;try{let i=JSON.parse(gn(n,"utf-8"));return{...e,...i}}catch{return e}}function wn(t,e){let n=Je(t,U);St(n)||bn(n,{recursive:!0});let i=xn(t),o={...ne(t),...e},r=i+".tmp";return mn(r,JSON.stringify(o,null,2),"utf-8"),hn(r,i),o}import Ze from"fs/promises";import Ba from"os";import Ct from"path";var Ua=Ct.join(Ba.homedir(),".vibeflow"),et=Ct.join(Ua,"token");async function Z(){try{return(await Ze.readFile(et,"utf8")).trim()||null}catch{return null}}async function Sn(t){await Ze.mkdir(Ct.dirname(et),{recursive:!0}),await Ze.writeFile(et,t,{mode:384})}async function _n(){try{await Ze.unlink(et)}catch{}}import{initTRPC as Ha,TRPCError as Et}from"@trpc/server";import{z as L}from"zod";var Tn=Ha.context().create(),Wa=Tn.router,ie=Tn.procedure,Cn=L.enum(["backlog","todo","in-progress","review","done"]),Be=L.string().regex(/^[a-f0-9]{30}$/,"Invalid task ID"),En=L.string().regex(/^[a-f0-9]{16}$/,"Invalid comment ID"),Tt=L.object({id:Be}),jn=Wa({project:ie.query(({ctx:t})=>({name:Ke(t.projectDir),projectDir:t.projectDir})),copilotStatus:ie.query(async({ctx:t})=>await Xe()?await Fe(t.projectDir):{authenticated:!1,reason:"gh CLI not found"}),tasks:ie.query(({ctx:t})=>({tasks:re(t.projectDir).map(i=>({...i,createdAt:i.created,commentCount:(i.comments??[]).filter(l=>!l.deleted).length,fileCount:i.files?.length??0}))})),searchTasks:ie.input(L.object({query:L.string().min(1),limit:L.number().int().min(1).max(100).optional()})).query(({ctx:t,input:e})=>{let n=re(t.projectDir),i=Math.max(1,e.limit??10),l=e.query.toLowerCase();return{results:n.filter(r=>`${r.title} ${r.description??""} ${r.type??""} ${r.component??""}`.toLowerCase().includes(l)).slice(0,i).map(r=>({score:1,task:r,commentCount:(r.comments??[]).filter(s=>!s.deleted).length,fileCount:r.files?.length??0}))}}),createTask:ie.input(L.object({title:L.string().min(1),selector:L.string().min(1),description:L.string().optional(),cssSelector:L.string().optional(),url:L.string().optional(),type:L.string().optional(),priority:L.string().optional(),file:L.string().optional(),line:L.number().int().positive().optional(),col:L.number().int().positive().optional(),component:L.string().optional(),status:Cn.optional(),agent:L.string().optional(),model:L.string().optional(),author:L.string().optional(),annotatedElementText:L.string().max(300).optional()})).mutation(({ctx:t,input:e})=>{let n=Ne(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:n}}),updateTask:ie.input(L.object({id:Be,updates:L.object({status:Cn.optional(),title:L.string().min(1).optional(),description:L.string().optional(),type:L.string().optional(),priority:L.string().optional(),reportBack:L.boolean().optional(),agent:L.string().optional(),model:L.string().optional(),tags:L.array(L.string().max(50)).max(20).optional(),sortKey:L.string().optional(),branchName:L.string().optional()})})).mutation(({ctx:t,input:e})=>{let n=B(t.projectDir,e.id,e.updates);if(!n)throw new Et({code:"NOT_FOUND",message:"Task not found"});return t.broadcast({type:"tasks-updated"}),{success:!0,task:n}}),deleteTask:ie.input(Tt).mutation(({ctx:t,input:e})=>{if(!Ve(t.projectDir,e.id))throw new Et({code:"NOT_FOUND",message:"Task not found"});return t.broadcast({type:"tasks-updated"}),{success:!0}}),comments:ie.input(Tt).query(({ctx:t,input:e})=>({comments:pe(t.projectDir,e.id)})),addComment:ie.input(L.object({taskId:Be,text:L.string().trim().min(1,"Comment text is required"),author:L.enum(["user","agent"]).optional().default("user"),files:L.array(L.string()).optional(),source:L.enum(["cli","web"]).optional().default("web")})).mutation(({ctx:t,input:e})=>{let n=be(t.projectDir,e.taskId,e.author,e.text.trim(),e.files,void 0,e.source);return t.broadcast({type:"tasks-updated"}),{success:!0,comment:n}}),updateComment:ie.input(L.object({taskId:Be,commentId:En,text:L.string().min(1)})).mutation(({ctx:t,input:e})=>{let n=Ye(t.projectDir,e.taskId,e.commentId,e.text.trim());if(!n)throw new Et({code:"NOT_FOUND",message:"Comment not found"});return{success:!0,comment:n}}),deleteComment:ie.input(L.object({taskId:Be,commentId:En})).mutation(({ctx:t,input:e})=>(Ge(t.projectDir,e.taskId,e.commentId),t.broadcast({type:"tasks-updated"}),{success:!0})),files:ie.input(Tt).query(({ctx:t,input:e})=>({files:te(t.projectDir,e.id)}))});import{execSync as In}from"child_process";function jt(t){try{let e=In("git config user.name",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim(),n=In("git config user.email",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim();return{name:e||"Unknown",email:n||""}}catch{return{name:"Unknown",email:""}}}function Rt(t){return/^[a-f0-9]{30}$/.test(t)}function Za(t){return/^[a-f0-9]{16}$/.test(t)}function It(t){if(!t||t.includes("/")||t.includes("\\")||t==="."||t===".."||t.includes("..")||t.includes("\0"))return!1;for(let e=0;e<t.length;e++)if(t.charCodeAt(e)<32)return!1;return!0}function tt(t,e){let n=t.headers.origin;return n&&!n.startsWith("http://localhost")?(e.status(403).json({error:"Forbidden"}),!1):!0}var eo=["backlog","todo","in-progress","review","done"],to=new Set(["https://app.vibeflow.tools"]);function no(t){if(!t)return null;try{let e=new URL(t).origin;return to.has(e)?e:null}catch{return null}}var Rn="0.11.0";function Hn(){for(let t of Object.values(Xa()))for(let e of t??[])if(e.family==="IPv4"&&!e.internal)return e.address;return null}function he(t,e,n,i=""){return t?S.dim(" ".repeat(n)+i)+S.cyan(`${t}${e}`):null}function Wn(t,e){return t?S.dim(" ".repeat(e)+"or: ")+S.yellow(`<script src="${t}/vibeflow-overlay.js" data-vibeflow-overlay></script>`):null}function Vn(t,e){t.get("/api/pages",(n,i)=>{i.json({pages:e})})}var Ln=new Map;function On(t){let n=Ln.get(t);if(n&&Date.now()-n.fetchedAt<3e5)return n.shas;try{let i=Fn("git log --remotes --format=%H",{cwd:t,timeout:5e3}).toString().trim(),l=new Set(i?i.split(`
1717
- `):[]);return Ln.set(t,{shas:l,fetchedAt:Date.now()}),l}catch{return new Set}}function An(t,e){return t?e.has(t):null}function qn(t,e,n){t.get("/api/project",(o,r)=>{r.json({name:Ke(e),projectDir:e,branch:ln(e)})}),t.get("/api/health",(o,r)=>{r.json({ok:!0})}),t.get("/api/changelog",(o,r)=>{r.json(nn(Re()))}),t.get("/api/tasks",(o,r)=>{let s=re(e),c=On(e),u=o.query.status;u&&typeof u=="string"&&(s=s.filter(g=>g.status===u));let d=o.query.limit;if(d){let g=parseInt(d,10);!isNaN(g)&&g>0&&(s=s.slice(0,g))}let b=s.map(g=>{let h=g.commits?.length?g.commits[g.commits.length-1].sha:void 0;return{...g,createdAt:g.created,commentCount:(g.comments??[]).filter(j=>!j.deleted).length,fileCount:g.files?.length??0,commitPushed:An(h,c)}});r.json({tasks:b})}),t.param("id",(o,r,s,c)=>{if(!Rt(c)){r.status(400).json({error:"Invalid task id"});return}s()}),t.param("commentId",(o,r,s,c)=>{if(!Za(c)){r.status(400).json({error:"Invalid comment id"});return}s()}),t.get("/api/tasks/:id",(o,r)=>{let{id:s}=o.params,c=V(e,s),u=c?ee(c):null;if(!u){r.status(404).json({error:"Task not found"});return}let d=On(e),b=u.commits?.length?u.commits[u.commits.length-1].sha:void 0;r.json({...u,commitPushed:An(b,d)})}),t.post("/api/tasks",(o,r)=>{let{title:s,description:c,selector:u,cssSelector:d,url:b,type:g,priority:h,file:j,line:m,col:p,component:f,status:y,agent:x,model:E,screenshot:T,annotatedElementText:C,tags:w,sortKey:k}=o.body;if(!s||!u){r.status(400).json({error:"Missing required fields: title, selector"});return}let I=jt(e),N=Ne(e,{title:s,description:c||"",selector:u,cssSelector:d||void 0,url:b||void 0,status:eo.includes(y)?y:"todo",file:j||void 0,line:m==null?void 0:Number(m),col:p==null?void 0:Number(p),component:f||void 0,type:g||void 0,priority:h||void 0,author:I.name,agent:x||void 0,model:E||void 0,annotatedElementText:C?String(C).slice(0,300):void 0,tags:Array.isArray(w)?w.filter(P=>typeof P=="string"&&P.length>0):void 0,sortKey:k?String(k):void 0});if(T){let P=le(e,U,ze);Pn(P,{recursive:!0});let v=`${N.id}.png`;Nn(le(P,v),Buffer.from(T,"base64")),B(e,N.id,{screenshot:v}),N.screenshot=v}console.log(`[Vibeflow] Task created: "${N.title}" (${N.id})`),n({type:"tasks-updated"}),r.json({success:!0,task:N})}),t.patch("/api/tasks/:id",(o,r)=>{let{id:s}=o.params,c=o.body,u=["backlog","todo","in-progress","review","done"];if(c.status!==void 0&&!u.includes(c.status)){r.status(400).json({error:`Invalid status: ${c.status}`});return}let d=B(e,s,c);if(!d){r.status(404).json({error:"Task not found"});return}console.log(`[Vibeflow] Task updated: "${d.title}" (${d.id}) \u2192 status:${d.status}`),n({type:"task-changed",taskId:d.id,action:"update",task:d}),r.json({success:!0,task:d})}),t.delete("/api/tasks/:id",(o,r)=>{let{id:s}=o.params;if(!Ve(e,s)){r.status(404).json({error:"Task not found"});return}console.log(`[Vibeflow] Task deleted: ${s}`),n({type:"task-deleted",taskId:s}),r.json({success:!0})}),t.get("/api/tasks/:id/comments",(o,r)=>{let{id:s}=o.params,c=pe(e,s);r.json({comments:c})}),t.post("/api/tasks/:id/comments",(o,r)=>{let{id:s}=o.params,{author:c,text:u,files:d,source:b}=o.body;if(!u||!u.trim()){r.status(400).json({error:"Missing required field: text"});return}let g=c==="agent"?"agent":"user",h=b==="cli"?"cli":"web",j=be(e,s,g,u.trim(),Array.isArray(d)?d:void 0,void 0,h);n({type:"tasks-updated"}),r.json({success:!0,comment:j})}),t.patch("/api/tasks/:id/comments/:commentId",(o,r)=>{let{id:s,commentId:c}=o.params,{text:u}=o.body;if(!u||!u.trim()){r.status(400).json({error:"Missing required field: text"});return}let d=Ye(e,s,c,u.trim());if(!d){r.status(404).json({error:"Comment not found"});return}r.json({success:!0,comment:d})}),t.delete("/api/tasks/:id/comments/:commentId",(o,r)=>{let{id:s,commentId:c}=o.params;if(!Ge(e,s,c)){r.status(404).json({error:"Comment not found"});return}n({type:"tasks-updated"}),r.json({success:!0})}),t.get("/api/tasks/:id/files",(o,r)=>{let{id:s}=o.params,c=te(e,s);r.json({files:c})}),t.get("/api/tasks/:id/files/:filename",(o,r)=>{let{id:s,filename:c}=o.params;if(!It(c)){r.status(400).json({error:"Invalid filename"});return}let u=Pe(e,s,c);if(!u){r.status(404).json({error:"File not found"});return}r.sendFile(u)});let i=new Set([".png",".jpg",".jpeg",".gif",".webp",".pdf",".txt",".md",".json",".csv",".svg",".mp4",".mov",".zip"]);t.post("/api/tasks/:id/files/:filename",ge.raw({type:"*/*",limit:"50mb"}),(o,r)=>{let{id:s,filename:c}=o.params;if(!It(c)){r.status(400).json({error:"Invalid filename"});return}let u=Mn(decodeURIComponent(c)).toLowerCase();if(!i.has(u)){r.status(415).json({error:"File type not allowed"});return}let d=o.body;if(!Buffer.isBuffer(d)||d.length===0){r.status(400).json({error:"Empty file body"});return}let b=G(e,s,decodeURIComponent(c),d);n({type:"tasks-updated"}),r.json({success:!0,file:b})}),t.delete("/api/tasks/:id/files/:filename",(o,r)=>{let{id:s,filename:c}=o.params;if(!It(c)){r.status(400).json({error:"Invalid filename"});return}if(!Yt(e,s,c)){r.status(404).json({error:"File not found"});return}be(e,s,"user",`\u{1F5D1}\uFE0F File removed: \`${c}\``,void 0,"system","web"),n({type:"tasks-updated"}),r.json({success:!0})});let l=le(e,U,ze);t.post("/api/tasks/:id/screenshot",ge.json(),(o,r)=>{let{id:s}=o.params,{screenshot:c}=o.body;if(!V(e,s)){r.status(404).json({error:"Task not found"});return}if(!c){r.status(400).json({error:"Missing screenshot"});return}Pn(l,{recursive:!0});let u=`${s}.png`;Nn(le(l,u),Buffer.from(c,"base64")),B(e,s,{screenshot:u}),n({type:"tasks-updated"}),r.json({success:!0,screenshot:u})}),t.delete("/api/tasks/:id/screenshot",(o,r)=>{let{id:s}=o.params;if(!V(e,s)){r.status(404).json({error:"Task not found"});return}let c=`${s}.png`,u=le(l,c);Pt(u)&&zn(u),B(e,s,{screenshot:void 0}),n({type:"tasks-updated"}),r.json({success:!0})}),t.post("/api/tasks/:id/auth-state",ge.json(),async(o,r)=>{let{id:s}=o.params,{authState:c,taskAuthor:u}=o.body;if(!V(e,s)){r.status(404).json({error:"Task not found"});return}if(!c||!u){r.status(400).json({error:"Missing required fields: authState, taskAuthor"});return}try{let b=dn(c,u);B(e,s,{authStateEnc:JSON.stringify(b)}),console.log(`[Vibeflow] Auth state stored for task ${s}`),r.json({success:!0})}catch(b){let g=b instanceof Error?b.message:String(b);console.error(`[Vibeflow] Failed to store auth state for ${s}: ${g}`),r.status(500).json({error:"Failed to store auth state"})}}),t.post("/api/tasks/:id/baseline",ge.json(),(o,r)=>{let{id:s}=o.params,{baseline:c}=o.body;if(!V(e,s)){r.status(404).json({error:"Task not found"});return}if(!c||!c.selector||!c.outerHTML){r.status(400).json({error:"Missing required fields: baseline.selector, baseline.outerHTML"});return}try{let u="baseline-element.json";G(e,s,u,Buffer.from(JSON.stringify(c,null,2))),B(e,s,{baselineElementFile:u}),console.log(`[Vibeflow] Baseline snapshot stored for task ${s} (${u})`),r.json({success:!0})}catch(u){let d=u instanceof Error?u.message:String(u);console.error(`[Vibeflow] Failed to store baseline for ${s}: ${d}`),r.status(500).json({error:"Failed to store baseline"})}}),t.post("/api/tasks/:id/baseline-page",ge.json({limit:"10mb"}),(o,r)=>{let{id:s}=o.params,{page:c}=o.body;if(!V(e,s)){r.status(404).json({error:"Task not found"});return}if(!c||c.version!==1||!c.elements){r.status(400).json({error:"Missing required fields: page.version, page.elements"});return}try{let u="baseline-page.json";G(e,s,u,Buffer.from(JSON.stringify(c,null,2))),B(e,s,{baselineFile:u}),console.log(`[Vibeflow] Page baseline stored for task ${s} (${u})`),r.json({success:!0})}catch(u){let d=u instanceof Error?u.message:String(u);console.error(`[Vibeflow] Failed to store page baseline for ${s}: ${d}`),r.status(500).json({error:"Failed to store page baseline"})}})}function Kn(t,e,n){t.get("/api/user",(l,o)=>{o.json(jt(e))}),t.get("/api/settings",(l,o)=>{o.json(ne(e))}),t.post("/api/settings",(l,o)=>{if(!tt(l,o))return;let r=new Set(["visibleCols","viewMode","panelWidth","autoCommit","autoComment","autoPush","createBranch"]),s=Object.fromEntries(Object.entries(l.body).filter(([u])=>r.has(u))),c=wn(e,s);o.json({success:!0,settings:c})}),t.get("/api/push/workspaces",async(l,o)=>{let r=await Z().catch(()=>null);if(!r){o.status(401).json({error:"Not logged in"});return}let s=process.env.VIBEFLOW_API_URL??"http://localhost:3000";try{let c=await fetch(`${s}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${r}`}});if(!c.ok){let d=(await c.json().catch(()=>({}))).error??`HTTP ${c.status} from ${s}`;console.error(`[Vibeflow] GET /api/push/workspaces failed: ${d}`),o.status(c.status).json({error:d});return}o.json(await c.json())}catch(c){let u=c instanceof Error?c.message:String(c);console.error(`[Vibeflow] GET /api/push/workspaces network error: ${u}`),o.status(502).json({error:`Network error contacting SaaS API: ${u}`})}}),t.post("/api/push",ge.json(),async(l,o)=>{let{workspaceId:r,keepLocalFiles:s}=l.body,c=await Z().catch(()=>null);if(!c){o.status(401).json({error:"Not logged in"});return}let u=ae(e);if(u.length===0){o.json({imported:0,message:"No local tasks found"});return}let d=process.env.VIBEFLOW_API_URL??"http://localhost:3000",b={tasks:u};try{let g=await fetch(`${d}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c}`},body:JSON.stringify(b)});if(!g.ok){let j=await g.json().catch(()=>({}));o.status(g.status).json({error:j.error??"Import failed"});return}let h=await g.json();if(!s){for(let j of u)try{zn(j.filePath)}catch{}n?.({type:"tasks-updated"})}o.json({imported:h.imported,skipped:h.skipped??0,workspaceId:h.workspaceId,boardId:h.boardId})}catch(g){let h=g instanceof Error?g.message:String(g);console.error(`[Vibeflow] POST /api/push network error: ${h}`),o.status(502).json({error:`Network error contacting SaaS API: ${h}`})}}),t.get("/api/copilot/status",(l,o)=>{Fe(e).then(r=>o.json(r)).catch(r=>{console.error(`[Vibeflow] GET /api/copilot/status error: ${r instanceof Error?r.message:String(r)}`),o.json({authenticated:!1,source:null,tokenHint:null,username:null})})}),t.post("/api/copilot/login",async(l,o)=>{if(tt(l,o))try{let r=await Fe(e);if(r.authenticated){o.json({launched:!1,alreadyAuthenticated:!0,username:r.username??null});return}if(!Xe()){o.status(400).json({launched:!1,error:"GitHub CLI is not installed. Install gh and authenticate with 'gh auth login'."});return}Qa("gh",["auth","login","--web","--hostname","github.com","--git-protocol","https","--scopes","read:user,copilot"],{cwd:e,detached:!0,stdio:"ignore"}).unref(),o.json({launched:!0})}catch(r){let s=r instanceof Error?r.message:String(r);console.error(`[Vibeflow] POST /api/copilot/login error: ${s}`),o.status(500).json({launched:!1,error:s})}});let i=null;t.get("/api/agent-status",(l,o)=>{o.json(i??{message:"",active:!1,updatedAt:null})}),t.post("/api/agent-status",(l,o)=>{if(!tt(l,o))return;let{message:r,active:s}=l.body;i={message:(r??"").slice(0,200),active:s!==!1,updatedAt:new Date().toISOString()},n?.({type:"agent-status",...i}),o.json({ok:!0})}),t.delete("/api/agent-status",(l,o)=>{tt(l,o)&&(i=null,n?.({type:"agent-status",message:"",active:!1,updatedAt:null}),o.json({ok:!0}))}),t.get("/api/github-url",(l,o)=>{try{let r=Fn("git remote get-url origin",{cwd:e,timeout:3e3}).toString().trim(),s=r.match(/^git@github\.com:(.+?)(?:\.git)?$/);if(s){o.json({githubUrl:`https://github.com/${s[1]}`});return}let c=r.match(/^(https?:\/\/github\.com\/[^/]+\/[^/]+?)(?:\.git)?$/);if(c){o.json({githubUrl:c[1]});return}}catch{}o.json({githubUrl:null})})}function Yn(t,e){let n=process.env.VIBEFLOW_ADMIN_EMAIL??"",i=process.env.VIBEFLOW_API_URL??"http://localhost:3000";t.get("/kanban",async(l,o)=>{let r=await Z().catch(()=>null);if(!r){o.type("html").send(xt({port:e,cliVersion:Rn}));return}let s=await oe().catch(()=>null),c=!1;if(n)try{let d=await fetch(`${i}/api/cli/profile`,{headers:{Authorization:`Bearer ${r}`}}).catch(()=>null);d?.ok&&(c=(await d.json()).email===n)}catch{}let u={port:e,cliVersion:Rn,saasMode:!0,boardUrl:s?.url??`${i}/kanban`,boardName:s?.name,isAdmin:c};o.type("html").send(xt(u))})}var ro=`*{box-sizing:border-box;margin:0;padding:0}
1720
+ `)}function pa(t){return[yn(t,"..","CHANGELOG.md"),yn(t,"..","..","CHANGELOG.md")]}function je(t=ca){try{for(let e of pa(t))if(oa(e))return ia(e,"utf8");return null}catch{return null}}function kn(t){let e=xn(t??"");return{version:ua(e)?.version??null,sections:e}}import{initTRPC as fa,TRPCError as pt}from"@trpc/server";import{z as E}from"zod";var _n=fa.context().create(),ga=_n.router,te=_n.procedure,wn=E.enum(J),ze=E.string().regex(/^[a-f0-9]{30}$/,"Invalid task ID"),Sn=E.string().regex(/^[a-f0-9]{16}$/,"Invalid comment ID"),ft=E.object({id:ze}),Cn=ga({project:te.query(({ctx:t})=>({name:Ve(t.projectDir),projectDir:t.projectDir,gitUserName:ie(t.projectDir).name})),tasks:te.query(({ctx:t})=>({tasks:K(t.projectDir).map(l=>({...l,createdAt:l.created,commentCount:(l.comments??[]).filter(a=>!a.deleted).length,fileCount:Ce(t.projectDir,l.id)}))})),searchTasks:te.input(E.object({query:E.string().min(1),limit:E.number().int().min(1).max(100).optional()})).query(({ctx:t,input:e})=>{let n=K(t.projectDir),l=Math.max(1,e.limit??10),a=e.query.toLowerCase();return{results:n.filter(i=>`${i.title} ${i.description??""} ${i.type??""} ${i.component??""}`.toLowerCase().includes(a)).slice(0,l).map(i=>({score:1,task:i,commentCount:(i.comments??[]).filter(s=>!s.deleted).length,fileCount:Ce(t.projectDir,i.id)}))}}),createTask:te.input(E.object({title:E.string().min(1),selector:E.string().min(1),description:E.string().optional(),cssSelector:E.string().optional(),url:E.string().optional(),type:E.string().optional(),priority:E.string().optional(),file:E.string().optional(),line:E.number().int().positive().optional(),col:E.number().int().positive().optional(),component:E.string().optional(),status:wn.optional(),agent:E.string().optional(),model:E.string().optional(),author:E.string().optional(),annotatedElementText:E.string().max(300).optional()})).mutation(({ctx:t,input:e})=>{let n=_e(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:n}}),updateTask:te.input(E.object({id:ze,updates:E.object({status:wn.optional(),title:E.string().min(1).optional(),description:E.string().optional(),type:E.string().optional(),priority:E.string().optional(),reportBack:E.boolean().optional(),agent:E.string().optional(),model:E.string().optional(),tags:E.array(E.string().max(50)).max(20).optional(),sortKey:E.string().optional(),branchName:E.string().optional()})})).mutation(({ctx:t,input:e})=>{let n=V(t.projectDir,e.id,e.updates);if(!n)throw new pt({code:"NOT_FOUND",message:"Task not found"});return t.broadcast({type:"tasks-updated"}),{success:!0,task:n}}),deleteTask:te.input(ft).mutation(({ctx:t,input:e})=>{if(!Fe(t.projectDir,e.id))throw new pt({code:"NOT_FOUND",message:"Task not found"});return t.broadcast({type:"tasks-updated"}),{success:!0}}),comments:te.input(ft).query(({ctx:t,input:e})=>({comments:oe(t.projectDir,e.id)})),addComment:te.input(E.object({taskId:ze,text:E.string().trim().min(1,"Comment text is required"),author:E.enum(["user","agent"]).optional().default("user"),files:E.array(E.string()).optional(),source:E.enum(["cli","web"]).optional().default("web")})).mutation(async({ctx:t,input:e})=>{let n=await ye(t.projectDir,e.taskId,e.author,e.text.trim(),e.files,void 0,e.source);return t.broadcast({type:"tasks-updated"}),{success:!0,comment:n}}),updateComment:te.input(E.object({taskId:ze,commentId:Sn,text:E.string().min(1)})).mutation(async({ctx:t,input:e})=>{let n=await Ue(t.projectDir,e.taskId,e.commentId,e.text.trim());if(!n)throw new pt({code:"NOT_FOUND",message:"Comment not found"});return t.broadcast({type:"tasks-updated"}),{success:!0,comment:n}}),deleteComment:te.input(E.object({taskId:ze,commentId:Sn})).mutation(async({ctx:t,input:e})=>(await We(t.projectDir,e.taskId,e.commentId),t.broadcast({type:"tasks-updated"}),{success:!0})),files:te.input(ft).query(({ctx:t,input:e})=>({files:ee(t.projectDir,e.id)}))});function Tn(t){try{let e=new URL(t);return(e.protocol==="http:"||e.protocol==="https:")&&(e.hostname==="localhost"||e.hostname==="127.0.0.1"||e.hostname==="[::1]"||e.hostname==="::1")}catch{return!1}}function bt(t){return/^[a-f0-9]{30}$/.test(t)}function Ta(t){return/^[a-f0-9]{16}$/.test(t)}function Ea(t,e){let n=t.headers.origin;return n&&!Tn(n)?(e.status(403).json({error:"Forbidden"}),!1):!0}var ja=J,Ia=new Set(["https://app.vibeflow.tools"]);function Ra(t){if(!t)return null;try{let e=new URL(t).origin;return Ia.has(e)?e:null}catch{return null}}function ge(t,e){t({type:"tasks-updated",...e&&{taskId:e}})}var In="0.12.0";function zn(){for(let t of Object.values(wa()))for(let e of t??[])if(e.family==="IPv4"&&!e.internal)return e.address;return null}function pe(t,e,n,l=""){return t?f.dim(" ".repeat(n)+l)+f.cyan(`${t}${e}`):null}function Mn(t,e){return t?f.dim(" ".repeat(e)+"or: ")+f.yellow(`<script src="${t}/vibeflow-overlay.js" data-vibeflow-overlay></script>`):null}function Dn(t,e){t.get("/api/pages",(n,l)=>{l.json({pages:e})})}var Rn=new Map;function Nn(t){let n=Rn.get(t);if(n&&Date.now()-n.fetchedAt<3e5)return n.shas;try{let l=An("git log --remotes --format=%H",{cwd:t,timeout:5e3}).toString().trim(),a=new Set(l?l.split(`
1721
+ `):[]);return Rn.set(t,{shas:a,fetchedAt:Date.now()}),a}catch{return new Set}}function Pn(t,e){return t?e.has(t):null}function $n(t,e,n){t.get("/api/project",(a,o)=>{o.json({name:Ve(e),projectDir:e,branch:Ot(e),gitUserName:ie(e).name})}),t.get("/api/health",(a,o)=>{o.json({ok:!0})}),t.get("/api/changelog",(a,o)=>{o.json(kn(je()))}),t.get("/api/tasks",(a,o)=>{let i=K(e),s=Nn(e),c=a.query.status;c&&typeof c=="string"&&(i=i.filter(p=>p.status===c));let u=a.query.limit;if(u){let p=parseInt(u,10);!isNaN(p)&&p>0&&(i=i.slice(0,p))}let g=i.map(p=>{let w=p.commits?.length?p.commits[p.commits.length-1].sha:void 0;return{...p,createdAt:p.created,commentCount:(p.comments??[]).filter(_=>!_.deleted).length,fileCount:Ce(e,p.id),commitPushed:Pn(w,s)}});o.json({tasks:g})}),t.param("id",(a,o,i,s)=>{if(!bt(s)){o.status(400).json({error:"Invalid task id"});return}i()}),t.param("commentId",(a,o,i,s)=>{if(!Ta(s)){o.status(400).json({error:"Invalid comment id"});return}i()}),t.get("/api/tasks/:id",(a,o)=>{let{id:i}=a.params,s=q(e,i),c=s?ve(s):null;if(!c){o.status(404).json({error:"Task not found"});return}let u=Nn(e),g=c.commits?.length?c.commits[c.commits.length-1].sha:void 0;o.json({...c,commitPushed:Pn(g,u)})}),t.post("/api/tasks",(a,o)=>{let{title:i,description:s,selector:c,cssSelector:u,url:g,type:p,priority:w,file:_,line:z,col:$,component:M,status:d,agent:m,model:b,screenshot:R,annotatedElementText:y,tags:j,sortKey:L}=a.body;if(!i||!c){o.status(400).json({error:"Missing required fields: title, selector"});return}let I=ie(e),N=_e(e,{title:i,description:s||"",selector:c,cssSelector:u||void 0,url:g||void 0,status:ja.includes(d)?d:"todo",file:_||void 0,line:z==null?void 0:Number(z),col:$==null?void 0:Number($),component:M||void 0,type:p||void 0,priority:w||void 0,author:I.name,agent:m||void 0,model:b||void 0,annotatedElementText:y?String(y).slice(0,300):void 0,tags:Array.isArray(j)?j.filter(C=>typeof C=="string"&&C.length>0):void 0,sortKey:L?String(L):void 0});if(R){let C=G(e,Z,Le);jn(C,{recursive:!0});let h=`${N.id}.png`;En(G(C,h),Buffer.from(R,"base64")),V(e,N.id,{screenshot:h}),N.screenshot=h}console.log(`[Vibeflow] Task created: "${N.title}" (${N.id})`),n({type:"tasks-updated"}),o.json({success:!0,task:N})}),t.patch("/api/tasks/:id",(a,o)=>{let{id:i}=a.params,s=new Set(["status","title","description","type","priority","reportBack","agent","model","tags","sortKey","branchName"]),c=Object.fromEntries(Object.entries(a.body).filter(([g])=>s.has(g)));if(c.status!==void 0&&!J.includes(c.status)){o.status(400).json({error:`Invalid status: ${c.status}`});return}if(c.status==="review"){let g=ve(q(e,i)??"");if(g&&(g.type??"").toLowerCase()==="research"&&!ee(e,i).some(_=>/\.md$/i.test(_.name))){o.status(422).json({error:"RESEARCH_REPORT_REQUIRED"});return}}let u=V(e,i,c);if(!u){o.status(404).json({error:"Task not found"});return}console.log(`[Vibeflow] Task updated: "${u.title}" (${u.id}) \u2192 status:${u.status}`),n({type:"task-changed",taskId:u.id,action:"update",task:{...u,fileCount:Ce(e,u.id)}}),o.json({success:!0,task:u})}),t.delete("/api/tasks/:id",(a,o)=>{let{id:i}=a.params;if(!Fe(e,i)){o.status(404).json({error:"Task not found"});return}console.log(`[Vibeflow] Task deleted: ${i}`),n({type:"task-deleted",taskId:i}),o.json({success:!0})}),t.get("/api/tasks/:id/comments",(a,o)=>{let{id:i}=a.params,s=oe(e,i);o.json({comments:s})}),t.post("/api/tasks/:id/comments",(a,o)=>{let{id:i}=a.params,{author:s,text:c,files:u,source:g}=a.body;if(!c||!c.trim()){o.status(400).json({error:"Missing required field: text"});return}let p=s==="agent"?"agent":"user",w=g==="cli"?"cli":"web",_=ye(e,i,p,c.trim(),Array.isArray(u)?u:void 0,void 0,w);ge(n,i),o.json({success:!0,comment:_})}),t.patch("/api/tasks/:id/comments/:commentId",(a,o)=>{let{id:i,commentId:s}=a.params,{text:c}=a.body;if(!c||!c.trim()){o.status(400).json({error:"Missing required field: text"});return}let u=Ue(e,i,s,c.trim());if(!u){o.status(404).json({error:"Comment not found"});return}ge(n,i),o.json({success:!0,comment:u})}),t.delete("/api/tasks/:id/comments/:commentId",(a,o)=>{let{id:i,commentId:s}=a.params;if(!We(e,i,s)){o.status(404).json({error:"Comment not found"});return}ge(n,i),o.json({success:!0})}),t.get("/api/tasks/:id/files",(a,o)=>{let{id:i}=a.params,s=ee(e,i);o.json({files:s})}),t.get("/api/tasks/:id/files/:filename",(a,o)=>{let{id:i,filename:s}=a.params;if(!Be(s)){o.status(400).json({error:"Invalid filename"});return}let c=Pt(e,i,s);if(!c){o.status(404).json({error:"File not found"});return}o.sendFile(c)}),t.post("/api/tasks/:id/files/:filename",me.raw({type:"*/*",limit:"50mb"}),(a,o)=>{let{id:i,filename:s}=a.params;if(!Be(s)){o.status(400).json({error:"Invalid filename"});return}if(!It(s)){o.status(415).json({error:"File type not allowed"});return}let c=a.body;if(!Buffer.isBuffer(c)||c.length===0){o.status(400).json({error:"Empty file body"});return}let u=He(e,i,s,c);ge(n,i),o.json({success:!0,file:u})}),t.delete("/api/tasks/:id/files/:filename",(a,o)=>{let{id:i,filename:s}=a.params;if(!Be(s)){o.status(400).json({error:"Invalid filename"});return}if(!Nt(e,i,s)){o.status(404).json({error:"File not found"});return}ye(e,i,"user",`\u{1F5D1}\uFE0F File removed: \`${s}\``,void 0,"system","web"),ge(n,i),o.json({success:!0})});let l=G(e,Z,Le);t.post("/api/tasks/:id/screenshot",me.json(),(a,o)=>{let{id:i}=a.params,{screenshot:s}=a.body;if(!q(e,i)){o.status(404).json({error:"Task not found"});return}if(!s){o.status(400).json({error:"Missing screenshot"});return}jn(l,{recursive:!0});let c=`${i}.png`;En(G(l,c),Buffer.from(s,"base64")),V(e,i,{screenshot:c}),ge(n,i),o.json({success:!0,screenshot:c})}),t.delete("/api/tasks/:id/screenshot",(a,o)=>{let{id:i}=a.params;if(!q(e,i)){o.status(404).json({error:"Task not found"});return}let s=`${i}.png`,c=G(l,s);mt(c)&&On(c),V(e,i,{screenshot:void 0}),ge(n,i),o.json({success:!0})}),t.post("/api/tasks/:id/auth-state",me.json(),async(a,o)=>{let{id:i}=a.params,{authState:s,taskAuthor:c}=a.body;if(!q(e,i)){o.status(404).json({error:"Task not found"});return}if(!s||!c){o.status(400).json({error:"Missing required fields: authState, taskAuthor"});return}try{let g=Lt(s,c);V(e,i,{authStateEnc:JSON.stringify(g)}),console.log(`[Vibeflow] Auth state stored for task ${i}`),o.json({success:!0})}catch(g){let p=g instanceof Error?g.message:String(g);console.error(`[Vibeflow] Failed to store auth state for ${i}: ${p}`),o.status(500).json({error:"Failed to store auth state"})}}),t.post("/api/tasks/:id/baseline",me.json(),(a,o)=>{let{id:i}=a.params,{baseline:s}=a.body;if(!q(e,i)){o.status(404).json({error:"Task not found"});return}if(!s||!s.selector||!s.outerHTML){o.status(400).json({error:"Missing required fields: baseline.selector, baseline.outerHTML"});return}try{let c="baseline-element.json";He(e,i,c,Buffer.from(JSON.stringify(s,null,2))),V(e,i,{baselineElementFile:c}),console.log(`[Vibeflow] Baseline snapshot stored for task ${i} (${c})`),o.json({success:!0})}catch(c){let u=c instanceof Error?c.message:String(c);console.error(`[Vibeflow] Failed to store baseline for ${i}: ${u}`),o.status(500).json({error:"Failed to store baseline"})}}),t.post("/api/tasks/:id/baseline-page",me.json({limit:"10mb"}),(a,o)=>{let{id:i}=a.params,{page:s}=a.body;if(!q(e,i)){o.status(404).json({error:"Task not found"});return}if(!s||s.version!==1||!s.elements){o.status(400).json({error:"Missing required fields: page.version, page.elements"});return}try{let c="baseline-page.json";He(e,i,c,Buffer.from(JSON.stringify(s,null,2))),V(e,i,{baselineFile:c}),console.log(`[Vibeflow] Page baseline stored for task ${i} (${c})`),o.json({success:!0})}catch(c){let u=c instanceof Error?c.message:String(c);console.error(`[Vibeflow] Failed to store page baseline for ${i}: ${u}`),o.status(500).json({error:"Failed to store page baseline"})}})}function Fn(t,e,n){t.get("/api/user",(l,a)=>{a.json(ie(e))}),t.get("/api/settings",(l,a)=>{a.json(Y(e))}),t.post("/api/settings",(l,a)=>{if(!Ea(l,a))return;let o=new Set(["visibleCols","viewMode","panelWidth","autoCommit","autoComment","autoPush","createBranch","requireVerifyBeforeReview"]),i=Object.fromEntries(Object.entries(l.body).filter(([c])=>o.has(c))),s=jt(e,i);a.json({success:!0,settings:s})}),t.get("/api/push/workspaces",async(l,a)=>{let o=await ue().catch(()=>null);if(!o){a.status(401).json({error:"Not logged in"});return}let i=process.env.VIBEFLOW_API_URL??"http://localhost:3000";try{let s=await fetch(`${i}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${o}`}});if(!s.ok){let u=(await s.json().catch(()=>({}))).error??`HTTP ${s.status} from ${i}`;console.error(`[Vibeflow] GET /api/push/workspaces failed: ${u}`),a.status(s.status).json({error:u});return}a.json(await s.json())}catch(s){let c=s instanceof Error?s.message:String(s);console.error(`[Vibeflow] GET /api/push/workspaces network error: ${c}`),a.status(502).json({error:`Network error contacting SaaS API: ${c}`})}}),t.post("/api/push",me.json(),async(l,a)=>{let{workspaceId:o,keepLocalFiles:i}=l.body,s=await ue().catch(()=>null);if(!s){a.status(401).json({error:"Not logged in"});return}let c=ce(e);if(c.length===0){a.json({imported:0,message:"No local tasks found"});return}let u=process.env.VIBEFLOW_API_URL??"http://localhost:3000",g={tasks:c};try{let p=await fetch(`${u}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify(g)});if(!p.ok){let _=await p.json().catch(()=>({}));a.status(p.status).json({error:_.error??"Import failed"});return}let w=await p.json();if(!i){for(let _ of c)try{On(_.filePath)}catch{}n&&ge(n)}a.json({imported:w.imported,skipped:w.skipped??0,workspaceId:w.workspaceId,boardId:w.boardId})}catch(p){let w=p instanceof Error?p.message:String(p);console.error(`[Vibeflow] POST /api/push network error: ${w}`),a.status(502).json({error:`Network error contacting SaaS API: ${w}`})}}),t.get("/api/github-url",(l,a)=>{try{let o=An("git remote get-url origin",{cwd:e,timeout:3e3}).toString().trim(),i=o.match(/^git@github\.com:(.+?)(?:\.git)?$/);if(i){a.json({githubUrl:`https://github.com/${i[1]}`});return}let s=o.match(/^(https?:\/\/github\.com\/[^/]+\/[^/]+?)(?:\.git)?$/);if(s){a.json({githubUrl:s[1]});return}}catch{}a.json({githubUrl:null})})}function Bn(t,e){let n=process.env.VIBEFLOW_ADMIN_EMAIL??"",l=process.env.VIBEFLOW_API_URL??"http://localhost:3000";t.get("/kanban",async(a,o)=>{let i=await ue().catch(()=>null);if(!i){o.type("html").send(ut({port:e,cliVersion:In}));return}let s=await de().catch(()=>null),c=!1;if(n)try{let g=await fetch(`${l}/api/cli/profile`,{headers:{Authorization:`Bearer ${i}`}}).catch(()=>null);g?.ok&&(c=(await g.json()).email===n)}catch{}let u={port:e,cliVersion:In,saasMode:!0,boardUrl:s?.url??`${l}/kanban`,boardName:s?.name,isAdmin:c};o.type("html").send(ut(u))})}var Na=`*{box-sizing:border-box;margin:0;padding:0}
1718
1722
  body{font-family:system-ui,sans-serif;background:#0f172a;color:#e2e8f0;padding:32px;max-width:700px;margin:0 auto}
1719
1723
  h1{font-size:22px;font-weight:700;color:#f1f5f9;margin-bottom:6px}
1720
1724
  h2{font-size:14px;font-weight:600;color:#94a3b8;margin:24px 0 8px;text-transform:uppercase;letter-spacing:.06em}
@@ -1727,66 +1731,54 @@ code{font-family:monospace;font-size:12px;color:#a5b4fc;word-break:break-all}
1727
1731
  .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}
1728
1732
  .badge.green{background:rgba(34,197,94,.15);border-color:rgba(34,197,94,.3);color:#4ade80}
1729
1733
  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}
1730
- .note{font-size:11px;color:#64748b;margin-top:8px;padding:8px 10px;background:#0a0f1e;border-radius:6px;border-left:3px solid #334155}`;function Nt(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}var ao="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 $n(t,e){return`<!DOCTYPE html>
1734
+ .note{font-size:11px;color:#64748b;margin-top:8px;padding:8px 10px;background:#0a0f1e;border-radius:6px;border-left:3px solid #334155}`;function gt(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Pa="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 Ln(t,e){return`<!DOCTYPE html>
1731
1735
  <html lang="en">
1732
- <head><meta charset="UTF-8"><title>Vibeflow \u2014 Inject Overlay</title><link rel="icon" type="image/svg+xml" href="${ao}"><style>${ro}</style></head>
1736
+ <head><meta charset="UTF-8"><title>Vibeflow \u2014 Inject Overlay</title><link rel="icon" type="image/svg+xml" href="${Pa}"><style>${Na}</style></head>
1733
1737
  <body>
1734
1738
  <h1>Vibeflow \u2014 Inject Overlay</h1>
1735
1739
  <p style="margin-top:6px">${t}</p>
1736
1740
  ${e.join(`
1737
1741
  `)}
1738
- </body></html>`}function Gn(t,e,n,i){let l=n?n.replace(/[^a-zA-Z0-9_-]/g,""):void 0;if(i){let d=`${i}/api/overlay.js`,b=l?`window.__PROTO_BOARD_ID='${l}';`:"",g=`javascript:(function(){if(document.getElementById('vibeflow-studio-root')){alert('Vibeflow overlay is already active.')}else{${b}fetch('${d}').then(function(r){return r.text()}).then(function(code){eval(code)}).catch(function(){alert('Failed to load Vibeflow overlay')})}})()`,h=`${b}fetch('${d}').then(r=>r.text()).then(code=>eval(code));`,j=l?`<script src="${d}" data-vibeflow-overlay data-board-id="${l}"></script>`:`<script src="${d}" data-vibeflow-overlay></script>`;t.get("/inject",(m,p)=>{p.type("html").send($n(`Add the Vibeflow overlay to any page to annotate and create tasks.${l?`<br><span style="font-size:12px;color:#64748b">Connected to board <code style="background:#1e293b;padding:2px 6px;border-radius:4px">${l}</code> via SaaS.</span>`:""}`,[`<h2>Option 1 \u2014 Bookmarklet <span class="badge green">CSP-safe</span> <span class="badge">recommended</span></h2>
1742
+ </body></html>`}function Hn(t,e,n,l){let a=n?n.replace(/[^a-zA-Z0-9_-]/g,""):void 0;if(l){let g=`${l}/api/overlay.js`,p=a?`window.__PROTO_BOARD_ID='${a}';`:"",w=`javascript:(function(){if(document.getElementById('vibeflow-studio-root')){alert('Vibeflow overlay is already active.')}else{${p}fetch('${g}').then(function(r){return r.text()}).then(function(code){eval(code)}).catch(function(){alert('Failed to load Vibeflow overlay')})}})()`,_=`${p}fetch('${g}').then(r=>r.text()).then(code=>eval(code));`,z=a?`<script src="${g}" data-vibeflow-overlay data-board-id="${a}"></script>`:`<script src="${g}" data-vibeflow-overlay></script>`;t.get("/inject",($,M)=>{M.type("html").send(Ln(`Add the Vibeflow overlay to any page to annotate and create tasks.${a?`<br><span style="font-size:12px;color:#64748b">Connected to board <code style="background:#1e293b;padding:2px 6px;border-radius:4px">${a}</code> via SaaS.</span>`:""}`,[`<h2>Option 1 \u2014 Bookmarklet <span class="badge green">CSP-safe</span> <span class="badge">recommended</span></h2>
1739
1743
  <div class="card"><p>Drag this link to your bookmarks bar, then click it on any page to activate the overlay:</p>
1740
- <a class="bookmarklet" href="${g}"><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>
1744
+ <a class="bookmarklet" href="${w}"><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>
1741
1745
  <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>
1742
1746
  <div class="card"><p>Open browser DevTools console on your target page and paste:</p>
1743
- <pre>${Nt(h)}</pre>
1747
+ <pre>${gt(_)}</pre>
1744
1748
  <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>
1745
1749
  <div class="card"><p>Add this tag to your HTML (before <code>&lt;/body&gt;</code>):</p>
1746
- <pre>${Nt(j)}</pre>
1747
- <div class="note">Requires your CSP to allow loading scripts from <code>${i}</code>. Suitable when you control the page's HTML.</div></div>`]))});return}let o=`http://localhost:${e}/vibeflow-overlay.js`,r=l?` data-board-id="${l}"`:"",s=`<script src="${o}" data-vibeflow-overlay${r}></script>`,c=l?`s.setAttribute('data-board-id','${l}');`:"",u=`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='${o}';s.setAttribute('data-vibeflow-overlay','');${c}document.head.appendChild(s);}})()`;t.get("/inject",(d,b)=>{b.type("html").send($n("Add the Vibeflow overlay to any page without modifying source code.",[`<h2>Option 1 \u2014 Bookmarklet <span class="badge">recommended</span></h2>
1750
+ <pre>${gt(z)}</pre>
1751
+ <div class="note">Requires your CSP to allow loading scripts from <code>${l}</code>. Suitable when you control the page's HTML.</div></div>`]))});return}let o=`http://localhost:${e}/vibeflow-overlay.js`,i=a?` data-board-id="${a}"`:"",s=`<script src="${o}" data-vibeflow-overlay${i}></script>`,c=a?`s.setAttribute('data-board-id','${a}');`:"",u=`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='${o}';s.setAttribute('data-vibeflow-overlay','');${c}document.head.appendChild(s);}})()`;t.get("/inject",(g,p)=>{p.type("html").send(Ln("Add the Vibeflow overlay to any page without modifying source code.",[`<h2>Option 1 \u2014 Bookmarklet <span class="badge">recommended</span></h2>
1748
1752
  <div class="card"><p>Drag this link to your bookmarks bar, then click it on any page to activate the overlay:</p>
1749
1753
  <a class="bookmarklet" href="${u}"><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>
1750
1754
  <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>
1751
1755
  <div class="card"><p>Add this tag to your HTML (before <code>&lt;/body&gt;</code>):</p>
1752
- <pre>${Nt(s)}</pre>
1756
+ <pre>${gt(s)}</pre>
1753
1757
  <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>
1754
1758
  <div class="card"><p>Open browser DevTools console and paste:</p>
1755
- <pre>var s=document.createElement('script');s.src='${o}';s.setAttribute('data-vibeflow-overlay','');${l?`s.setAttribute('data-board-id','${l}');`:""}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 Qn(t,e,n){t.use("/trpc",Ja({router:jn,createContext:()=>({projectDir:e,broadcast:n})}))}function Xn(t){t.use((e,n,i,l)=>{console.error("[Vibeflow] Unhandled error:",e.message),i.status(500).json({error:"Internal server error"})})}function Jn(t){t.use((e,n,i)=>{let l=e.headers.origin??"*",o=/^https?:\/\/localhost(:\d+)?$/i.test(l)||/^https?:\/\/127\.0\.0\.1(:\d+)?$/i.test(l);if(n.setHeader("Access-Control-Allow-Origin",o?l:"http://localhost:3700"),n.setHeader("Access-Control-Allow-Methods","GET, POST, PATCH, DELETE, OPTIONS"),n.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){n.status(204).end();return}i()})}function Zn(t){t.disable("x-powered-by"),t.use((e,n,i)=>{n.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("; ")),n.setHeader("Permissions-Policy","camera=(), microphone=(), geolocation=()"),n.setHeader("X-Content-Type-Options","nosniff"),n.setHeader("X-Frame-Options","DENY"),n.setHeader("Referrer-Policy","strict-origin-when-cross-origin"),n.setHeader("Cross-Origin-Embedder-Policy","unsafe-none"),n.setHeader("Cross-Origin-Opener-Policy","same-origin"),i()})}async function oo(t,e){let n=e._testToken===void 0?await Z().catch(()=>null):e._testToken,i=e._testWorkspace===void 0?n?await oe().catch(()=>null):null:e._testWorkspace,l=!!(n&&i),o=ge();Jn(o),Zn(o),o.use(ge.json({limit:"10mb"}));let r=Dn(o),s=new Bn({server:r}),c=b=>{let g=JSON.stringify(b);for(let h of s.clients)h.readyState===Un.OPEN&&h.send(g)};s.on("connection",b=>{b.on("message",g=>{try{JSON.parse(g.toString()).type==="ping"&&b.send(JSON.stringify({type:"pong"}))}catch{}})});let u=no(i?.url)??process.env.VIBEFLOW_API_URL??"http://localhost:3000";if(l){o.use(["/api/tasks","/api/push","/trpc"],(g,h)=>{h.status(503).json({error:"Online mode active \u2014 local task API is disabled. All task operations go through the SaaS backend."})});let b=Jt(u);o.get("/vibeflow-overlay.js",(g,h)=>{h.type("application/javascript").send(b)})}else{Ee(t);let b=ht(e.port);o.get("/vibeflow-overlay.js",(h,j)=>{j.type("application/javascript").send(b)});let g=le(t,U,ze);o.get("/screenshots/:filename",(h,j)=>{let{filename:m}=h.params,p=fe(m,".png");if(!Rt(p)){j.status(400).end();return}let f=le(g,`${p}.png`);if(!Pt(f)){j.status(404).end();return}j.sendFile(f)}),Vn(o,[]),qn(o,t,c),Qn(o,t,c),Kn(o,t,c)}Yn(o,e.port),Gn(o,e.port,l?i?.id:void 0,l?u:void 0);let d=l?null:De(le(t,U,Ce),{onChanged:b=>{let g=ee(b);c(g?{type:"task-changed",taskId:g.id,action:"update",task:g,source:"cli"}:{type:"tasks-updated"})},onDeleted:b=>{let g=fe(b,".json");c({type:"task-deleted",taskId:g})}});return Xn(o),new Promise((b,g)=>{let h=e.host??"localhost";r.listen(e.port,h,()=>{let m=`http://${h==="0.0.0.0"?Hn()??"localhost":h}:${e.port}`,p=h==="0.0.0.0"?`http://localhost:${e.port}`:null,f=S.dim(" "+"\u2500".repeat(62));if(console.log(),console.log(S.green(" \u2713 Vibeflow running")+S.dim(" \xB7 ")+S.cyan(m)),p&&console.log(S.dim(" Local: ")+S.cyan(p)),console.log(f),l){console.log(S.dim(" Mode: ")+S.green("\u25CF Online")+S.dim(" \u2014 connected to Vibeflow SaaS")),console.log(S.dim(" Board: ")+S.white(i.name??"your board")),console.log(S.dim(" Web: ")+S.cyan(i.url)),console.log(f),console.log(S.dim(" Overlay script: ")+S.cyan(`${m}/vibeflow-overlay.js`));let y=he(p,"/vibeflow-overlay.js",19);y&&console.log(y),console.log(),console.log(S.dim(" \u250C\u2500 Add to your HTML ")+S.dim("\u2500".repeat(43)+"\u2510")),console.log(S.dim(" \u2502 ")+S.yellow(`<script src="${m}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)+S.dim(" \u2502")),p&&console.log(S.dim(" \u2502 or: ")+S.yellow(`<script src="${p}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)+S.dim(" \u2502")),console.log(S.dim(" \u2502 ")+S.dim("Or drag the bookmarklet: ")+S.cyan(`${m}/inject`)+S.dim(" \u2502")),p&&console.log(S.dim(" \u2502 or: ")+S.cyan(`${p}/inject`)+S.dim(" \u2502")),console.log(S.dim(" \u2514"+"\u2500".repeat(63)+"\u2518"))}else{console.log(S.dim(" Mode: ")+S.yellow("\u25CE Local")+S.dim(" \u2014 no account needed")),console.log(f),console.log(S.bold.white(" BOARDS & APIS")),console.log(S.dim(" Kanban board ")+S.cyan(`${m}/kanban`));let y=he(p,"/kanban",18);y&&console.log(y),console.log(S.dim(" Task API ")+S.cyan(`${m}/api/tasks`));let x=he(p,"/api/tasks",18);x&&console.log(x),console.log(f),console.log(S.bold.white(" INTEGRATE INTO YOUR APP")+S.dim(` (full guide: ${m}/inject)`));let E=he(p,"/inject",40);E&&console.log(E),console.log(S.dim(" 1. Add this script tag to your HTML:")),console.log(S.dim(" ")+S.yellow(`<script src="${m}/vibeflow-overlay.js" data-vibeflow-overlay></script>`));let T=Wn(p,5);T&&console.log(T),console.log(S.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(S.dim(" 3. Click anything to annotate it.")),console.log(f),console.log(S.dim(" Bookmarklet \u2014 no code changes needed:")),console.log(S.dim(" Visit and drag the bookmarklet from ")+S.cyan(`${m}/inject`)+S.dim(" to your bookmarks bar."));let C=he(p,"/inject",2,"or: ");C&&console.log(C)}console.log(),e.noCtrlCHint||(console.log(S.dim(" Press Ctrl+C to stop")),console.log()),b({url:m,localUrl:p,close:async()=>{d&&await d.close(),s.close(),await new Promise(y=>r.close(()=>y()))}})}),r.on("error",g)})}async function Lt(t,e){if(!t)return oo(e.projectDir??process.cwd(),e);if(t.startsWith("http://")||t.startsWith("https://"))throw new Error(`Proxy mode is no longer supported.
1759
+ <pre>var s=document.createElement('script');s.src='${o}';s.setAttribute('data-vibeflow-overlay','');${a?`s.setAttribute('data-board-id','${a}');`:""}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 Un(t,e,n){t.use("/trpc",Ca({router:Cn,createContext:()=>({projectDir:e,broadcast:n})}))}function Wn(t){t.use((e,n,l,a)=>{console.error("[Vibeflow] Unhandled error:",e.message),l.status(500).json({error:"Internal server error"})})}function La(t){t.use((e,n,l)=>{let a=e.headers.origin??"*",o=/^https?:\/\/localhost(:\d+)?$/i.test(a)||/^https?:\/\/127\.0\.0\.1(:\d+)?$/i.test(a);if(n.setHeader("Access-Control-Allow-Origin",o?a:"http://localhost:3700"),n.setHeader("Access-Control-Allow-Methods","GET, POST, PATCH, DELETE, OPTIONS"),n.setHeader("Access-Control-Allow-Headers","Content-Type"),e.method==="OPTIONS"){n.status(204).end();return}l()})}function Oa(t){t.disable("x-powered-by"),t.use((e,n,l)=>{n.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("; ")),n.setHeader("Permissions-Policy","camera=(), microphone=(), geolocation=()"),n.setHeader("X-Content-Type-Options","nosniff"),n.setHeader("X-Frame-Options","DENY"),n.setHeader("Referrer-Policy","strict-origin-when-cross-origin"),n.setHeader("Cross-Origin-Embedder-Policy","unsafe-none"),n.setHeader("Cross-Origin-Opener-Policy","same-origin"),l()})}function Vn(){let t=me();La(t),Oa(t),t.use(me.json({limit:"10mb"}));let e=ka(t),n=new Sa({server:e}),l=a=>{let o=JSON.stringify(a);for(let i of n.clients)i.readyState===_a.OPEN&&i.send(o)};return n.on("connection",a=>{a.on("message",o=>{try{JSON.parse(o.toString()).type==="ping"&&a.send(JSON.stringify({type:"pong"}))}catch{}})}),{app:t,httpServer:e,wss:n,broadcast:l}}async function Aa(t,e){let n=e._testToken===void 0?await ue().catch(()=>null):e._testToken,l=e._testWorkspace===void 0?n?await de().catch(()=>null):null:e._testWorkspace,a=!!(n&&l),{app:o,httpServer:i,wss:s,broadcast:c}=Vn(),u=Ra(l?.url)??process.env.VIBEFLOW_API_URL??"http://localhost:3000";if(a){o.use(["/api/tasks","/api/push","/trpc"],(w,_)=>{_.status(503).json({error:"Online mode active \u2014 local task API is disabled. All task operations go through the SaaS backend."})});let p=hn(u);o.get("/vibeflow-overlay.js",(w,_)=>{_.type("application/javascript").send(p)})}else{he(t);let p=lt(e.port);o.get("/vibeflow-overlay.js",(_,z)=>{z.type("application/javascript").send(p)});let w=G(t,Z,Le);o.get("/screenshots/:filename",(_,z)=>{let{filename:$}=_.params,M=se($,".png");if(!bt(M)){z.status(400).end();return}let d=G(w,`${M}.png`);if(!mt(d)){z.status(404).end();return}z.sendFile(d)}),Dn(o,[]),$n(o,t,c),Un(o,t,c),Fn(o,t,c),mn(o,t,"local")}Bn(o,e.port),Hn(o,e.port,a?l?.id:void 0,a?u:void 0);let g=a?null:Ae(G(t,Z,Pe),{onChanged:p=>{let w=ve(p);c(w?{type:"task-changed",taskId:w.id,action:"update",task:w,source:"cli"}:{type:"tasks-updated"})},onDeleted:p=>{let w=se(p,".json");c({type:"task-deleted",taskId:w})}});return Wn(o),new Promise((p,w)=>{let _=e.host??"localhost";i.listen(e.port,_,()=>{let $=`http://${_==="0.0.0.0"?zn()??"localhost":_}:${e.port}`,M=_==="0.0.0.0"?`http://localhost:${e.port}`:null,d=f.dim(" "+"\u2500".repeat(62));if(console.log(),console.log(f.green(" \u2713 Vibeflow running")+f.dim(" \xB7 ")+f.cyan($)),M&&console.log(f.dim(" Local: ")+f.cyan(M)),console.log(d),a){console.log(f.dim(" Mode: ")+f.green("\u25CF Online")+f.dim(" \u2014 connected to Vibeflow SaaS")),console.log(f.dim(" Board: ")+f.white(l.name??"your board")),console.log(f.dim(" Web: ")+f.cyan(l.url)),console.log(d),console.log(f.dim(" Overlay script: ")+f.cyan(`${$}/vibeflow-overlay.js`));let m=pe(M,"/vibeflow-overlay.js",19);m&&console.log(m),console.log(),console.log(f.dim(" \u250C\u2500 Add to your HTML ")+f.dim("\u2500".repeat(43)+"\u2510")),console.log(f.dim(" \u2502 ")+f.yellow(`<script src="${$}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)+f.dim(" \u2502")),M&&console.log(f.dim(" \u2502 or: ")+f.yellow(`<script src="${M}/vibeflow-overlay.js" data-vibeflow-overlay></script>`)+f.dim(" \u2502")),console.log(f.dim(" \u2502 ")+f.dim("Or drag the bookmarklet: ")+f.cyan(`${$}/inject`)+f.dim(" \u2502")),M&&console.log(f.dim(" \u2502 or: ")+f.cyan(`${M}/inject`)+f.dim(" \u2502")),console.log(f.dim(" \u2514"+"\u2500".repeat(63)+"\u2518"))}else{console.log(f.dim(" Mode: ")+f.yellow("\u25CE Local")+f.dim(" \u2014 no account needed")),console.log(d),console.log(f.bold.white(" BOARDS & APIS")),console.log(f.dim(" Kanban board ")+f.cyan(`${$}/kanban`));let m=pe(M,"/kanban",18);m&&console.log(m),console.log(f.dim(" Task API ")+f.cyan(`${$}/api/tasks`));let b=pe(M,"/api/tasks",18);b&&console.log(b),console.log(d),console.log(f.bold.white(" INTEGRATE INTO YOUR APP")+f.dim(` (full guide: ${$}/inject)`));let R=pe(M,"/inject",40);R&&console.log(R),console.log(f.dim(" 1. Add this script tag to your HTML:")),console.log(f.dim(" ")+f.yellow(`<script src="${$}/vibeflow-overlay.js" data-vibeflow-overlay></script>`));let y=Mn(M,5);y&&console.log(y),console.log(f.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(f.dim(" 3. Click anything to annotate it.")),console.log(d),console.log(f.dim(" Bookmarklet \u2014 no code changes needed:")),console.log(f.dim(" Visit and drag the bookmarklet from ")+f.cyan(`${$}/inject`)+f.dim(" to your bookmarks bar."));let j=pe(M,"/inject",2,"or: ");j&&console.log(j)}console.log(),e.noCtrlCHint||(console.log(f.dim(" Press Ctrl+C to stop")),console.log()),p({url:$,localUrl:M,close:async()=>{g&&await g.close(),at(),s.close(),await new Promise(m=>i.close(()=>m()))}})}),i.on("error",w)})}async function ht(t,e){if(!t)return Aa(e.projectDir??process.cwd(),e);if(t.startsWith("http://")||t.startsWith("https://"))throw new Error(`Proxy mode is no longer supported.
1756
1760
  To annotate an existing app, run: proto serve (API-only mode)
1757
- Then install the Chrome extension and navigate to your app.`);let n=Ya(t),l=Ka(n).isDirectory(),o=l?qa(n).filter(f=>Mn(f)===".html").map(f=>le(n,f)):[n];if(o.length===0)throw new Error("No HTML files found at "+t);let r=l?n:Ga(n);Ee(r);let s=ge();Jn(s),Zn(s),s.use(ge.json({limit:"10mb"}));let c=Dn(s),u=new Bn({server:c}),d=f=>{let y=JSON.stringify(f);for(let x of u.clients)x.readyState===Un.OPEN&&x.send(y)};u.on("connection",f=>{f.on("message",y=>{try{JSON.parse(y.toString()).type==="ping"&&f.send(JSON.stringify({type:"pong"}))}catch{}})});let b=e.noOverlay?null:ht(e.port);b&&s.get("/vibeflow-overlay.js",(f,y)=>{y.type("application/javascript").send(b)});let g=le(r,U,ze);s.get("/screenshots/:filename",(f,y)=>{let{filename:x}=f.params,E=fe(x,".png");if(!Rt(E)){y.status(400).end();return}let T=le(g,`${E}.png`);if(!Pt(T)){y.status(404).end();return}y.sendFile(T)}),l&&s.get("/",(f,y)=>{let x=o.map(E=>{let T=fe(E);return`<li><a href="/${T}">${T}</a></li>`}).join(`
1758
- `);y.send(`<!DOCTYPE html><html><head><title>Vibeflow Studio</title>
1761
+ Then install the Chrome extension and navigate to your app.`);let n=va(t),a=ha(n).isDirectory(),o=a?ba(n).filter(d=>ya(d)===".html").map(d=>G(n,d)):[n];if(o.length===0)throw new Error("No HTML files found at "+t);let i=a?n:xa(n);he(i);let{app:s,httpServer:c,wss:u,broadcast:g}=Vn(),p=e.noOverlay?null:lt(e.port);p&&s.get("/vibeflow-overlay.js",(d,m)=>{m.type("application/javascript").send(p)});let w=G(i,Z,Le);s.get("/screenshots/:filename",(d,m)=>{let{filename:b}=d.params,R=se(b,".png");if(!bt(R)){m.status(400).end();return}let y=G(w,`${R}.png`);if(!mt(y)){m.status(404).end();return}m.sendFile(y)}),a&&s.get("/",(d,m)=>{let b=o.map(R=>{let y=se(R);return`<li><a href="/${y}">${y}</a></li>`}).join(`
1762
+ `);m.send(`<!DOCTYPE html><html><head><title>Vibeflow Studio</title>
1759
1763
  <style>body{font-family:system-ui;max-width:600px;margin:40px auto;padding:0 20px}
1760
1764
  a{color:#2563eb;text-decoration:none}a:hover{text-decoration:underline}
1761
1765
  li{margin:8px 0}</style></head>
1762
1766
  <body><h1>Vibeflow Studio</h1>
1763
1767
  <p>Select a prototype to review:</p>
1764
- <ul>${x}</ul></body></html>`)});for(let f of o){let y=l?`/${fe(f)}`:"/";s.get(y,(x,E)=>{let T=Va(f,"utf-8"),C=b?Xt(T,b):T;E.type("html").send(C)})}let h=o.map(f=>`/${fe(f)}`);Vn(s,l?h:[]),qn(s,r,d),Qn(s,r,d),Kn(s,r,d),Yn(s,e.port),Gn(s,e.port);let j=null;j=mt(n,{onChange:f=>{let y=fe(f);console.log(S.dim(` File changed: ${y}`)),d({type:"reload",file:y})}});let m=le(r,U,Ce),p=De(m,{onChanged:f=>{let y=ee(f);d(y?{type:"task-changed",taskId:y.id,action:"update",task:y,source:"cli"}:{type:"tasks-updated"})},onDeleted:f=>{let y=fe(f,".json");d({type:"task-deleted",taskId:y})}});return Xn(s),new Promise((f,y)=>{let x=e.host??"localhost";c.listen(e.port,x,()=>{let T=`http://${x==="0.0.0.0"?Hn()??"localhost":x}:${e.port}`,C=x==="0.0.0.0"?`http://localhost:${e.port}`:null,w=S.dim(" "+"\u2500".repeat(62));console.log(),console.log(S.green(" \u2713 Vibeflow running")+S.dim(" \xB7 ")+S.cyan(T)),C&&console.log(S.dim(" Local: ")+S.cyan(C)),console.log(w);for(let v of o){let R=l?`/${fe(v)}`:"/";console.log(S.dim(" File: ")+S.cyan(`${T}${R}`)+S.dim(` (${fe(v)})`));let _=he(C,R,17);_&&console.log(_)}console.log(S.dim(" Kanban board: ")+S.cyan(`${T}/kanban`));let k=he(C,"/kanban",17);k&&console.log(k),console.log(S.dim(" Task API: ")+S.cyan(`${T}/api/tasks`));let I=he(C,"/api/tasks",17);I&&console.log(I),console.log(w),console.log(S.bold.white(" INTEGRATE INTO YOUR APP")+S.dim(` (full guide: ${T}/inject)`));let N=he(C,"/inject",40);N&&console.log(N),console.log(S.dim(" 1. Add this script tag to your HTML:")),console.log(S.dim(" ")+S.yellow(`<script src="${T}/vibeflow-overlay.js" data-vibeflow-overlay></script>`));let P=Wn(C,5);P&&console.log(P),console.log(S.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(S.dim(" 3. Click anything to annotate it.")),console.log(),console.log(S.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then(v=>v.default(T)).catch(()=>{}),f({url:T,localUrl:C,close:async()=>{j&&await j.close(),await p.close(),u.close(),await new Promise(v=>c.close(()=>v()))}})}),c.on("error",y)})}async function Te(){return await Z()?"saas":"local"}import z from"chalk";import io from"open";import er from"readline";import lo from"@inquirer/select";import{existsSync as so,readdirSync as tr,readFileSync as co}from"fs";import{join as nt,resolve as uo}from"path";var O={SUCCESS:0,GENERAL:1,USAGE:2,NOT_FOUND:3,AUTH:4,CONFLICT:5};var po="https://app.vibeflow.tools",fo=300*1e3;function nr(){return process.env.VIBEFLOW_API_URL??po}async function go(t){return new Promise(e=>setTimeout(e,t))}async function mo(t){return t.length===1?(console.log(z.dim(` Using board: ${t[0].icon??""} ${t[0].name}`)),t[0]):await lo({message:"Select a board to use:",choices:t.map(n=>({name:`${n.icon??""} ${n.name}`,value:n}))})}async function rr(t,e){try{let n=await fetch(`${t}/api/cli/settings`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)return;let i=await n.json();i.settings&&Object.keys(i.settings).length>0&&kn({...i.settings,_settingsRefreshedAt:Date.now()})}catch{}}async function ar(){try{let t=await Z();if(!t)return;let n=_t()._settingsRefreshedAt??0;if(Date.now()-n<fo)return;let i=nr();rr(i,t)}catch{}}async function bo(t,e){try{let[n,i]=await Promise.all([fetch(`${t}/api/cli/workspaces`,{headers:{Authorization:`Bearer ${e}`}}),fetch(`${t}/api/cli/profile`,{headers:{Authorization:`Bearer ${e}`}})]);if(!n.ok)return;let l=await n.json();if(!l.workspaces?.length){console.log(z.yellow(" No boards found. Create a board in the web app first."));return}let o=i.ok?await i.json():null,r=await mo(l.workspaces);await Gt({...r,email:o?.email??null}),console.log(z.green(` Board set: ${r.icon??""} ${r.name}`)),console.log(z.dim(` Open at: ${r.url}`))}catch{}}async function ho(t,e,n,i){let l=nt(t,U,Ce);if(!so(l))return;let o=[];try{for(let d of tr(l,{withFileTypes:!0}))if(d.isDirectory()){let b=nt(l,d.name);for(let g of tr(b).filter(h=>h.endsWith(".json")))o.push(nt(b,g))}else d.isFile()&&d.name.endsWith(".json")&&o.push(nt(l,d.name))}catch{return}if(o.length===0)return;let r=o.flatMap(d=>{try{return[JSON.parse(co(d,"utf-8"))]}catch{return[]}}),s=new Set;try{let d=await fetch(`${e}/api/cli/tasks?boardId=${i.id}`,{headers:{Authorization:`Bearer ${n}`}}).catch(()=>null);if(d?.ok){let b=await d.json();s=new Set((b.tasks??[]).flatMap(g=>[g.id,...g.cliId?[g.cliId]:[]]))}}catch{}let c=r.filter(d=>!s.has(d.id));if(c.length===0)return;console.log(),console.log(z.bold(` ${c.length} local task${c.length!==1?"s are":" is"} not yet synced to the board:`));let u=c.slice(0,10);for(let d of u){let b=d.status?z.dim(` [${d.status}]`):"";console.log(z.dim(` \u2022 ${d.title??d.id}${b}`))}return c.length>10&&console.log(z.dim(` \u2026 and ${c.length-10} more`)),new Promise(d=>{let b=er.createInterface({input:process.stdin,output:process.stdout});b.question(z.cyan(`
1765
- Push them to your board now? [Y/n]: `),async g=>{if(b.close(),g.trim().toLowerCase()==="n"){console.log(z.dim(" Skipped. You can push later with: vibeflow push")),d();return}let h=er.createInterface({input:process.stdin,output:process.stdout});h.question(z.cyan(" Delete local task files after push? [y/N]: "),async j=>{h.close();let m=j.trim().toLowerCase()!=="y";try{let p=await fetch(`${e}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({boardId:i.id,tasks:c,keepLocalFiles:m})}),f={};try{f=await p.json()}catch{}p.ok?(console.log(z.green(` \u2713 Pushed ${f.imported??0} task${(f.imported??0)!==1?"s":""} to ${i.name}`)),(f.skipped??0)>0&&console.log(z.dim(` (${f.skipped} already existed and were skipped)`))):console.log(z.red(` Push failed: ${f.error??`HTTP ${p.status}`}`))}catch(p){console.log(z.red(` Push failed: ${p instanceof Error?p.message:"Network error"}`))}d()})})})}async function rt(t=uo(".")){let e=nr();console.log(z.cyan(" Initiating device login flow..."));let n;try{n=await fetch(`${e}/api/cli/auth/device-init`,{method:"POST",headers:{"Content-Type":"application/json"}})}catch(u){console.error(z.red(` Failed to connect to login server: ${u instanceof Error?u.message:"Network error"}`)),process.exitCode=O.AUTH;return}if(!n.ok){console.error(z.red(` Failed to initiate login: ${n.status} ${n.statusText}`)),process.exitCode=O.AUTH;return}let{deviceCode:i,userCode:l,verificationUrl:o,expiresIn:r}=await n.json();console.log(),console.log(z.bold(" Open this URL in your browser to authorize:")),console.log(z.underline(` ${o}`)),console.log();try{await io(o),console.log(z.dim(" (Browser opened automatically)"))}catch{}let s=Date.now()+r*1e3,c=3e3;for(;Date.now()<s;){await go(c);let u=null;try{u=await fetch(`${e}/api/cli/auth/device-poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:i})})}catch{console.error(z.red(" Poll request failed (network error). Retrying..."));continue}if(!u.ok){console.error(z.red(" Poll request failed. Retrying..."));continue}let d=await u.json();if("token"in d){await Sn(d.token),console.log(),console.log(z.green(" Logged in successfully. Now operating in SaaS mode.")),await Promise.all([bo(e,d.token),rr(e,d.token)]);let{readWorkspace:b}=await import("./workspace-KGOQ67YV.js"),g=await b();g&&await ho(t,e,d.token,g);return}if("expired"in d){console.error(z.red(" Device code expired. Please try again.")),process.exitCode=O.AUTH;return}process.stdout.write(z.dim("."))}console.error(z.red(`
1766
- Login timed out. Please try again.`)),process.exitCode=O.AUTH}import vo from"chalk";async function or(){await Promise.all([_n(),Qt()]),console.log(vo.green(" Logged out. Now operating in local mode."))}import q from"chalk";import{unlinkSync as yo,readFileSync as xo,existsSync as ko}from"fs";import{resolve as wo,join as So}from"path";var _o="https://app.vibeflow.tools";function Co(){return process.env.VIBEFLOW_API_URL??_o}function Eo(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function ir(t,e,n=24){let i=Math.round(t/e*n);return`[${"\u2588".repeat(i)+"\u2591".repeat(n-i)}]`}async function To(t,e,n,i){let l=[];for(let{localId:h,remoteId:j}of i){let m=te(n,h);for(let p of m){let f=p.linkedPath??So(Y(n,h),p.name);ko(f)&&l.push({remoteId:j,name:p.name,filePath:f,size:p.size})}}if(l.length===0)return{uploaded:0,failed:0,failedFiles:[]};let o=l.length,r=l.reduce((h,j)=>h+j.size,0);console.log(q.cyan(`
1767
- Uploading ${o} file(s) (${Eo(r)})...`));let s=0,c=0,u=0,d=Date.now(),b=[];for(let h of l){let j=Math.round(s/o*100),m=ir(s,o),p=(Date.now()-d)/1e3,f=u/Math.max(p,.01),y=r-u,x=f>0?Math.ceil(y/f):0,E=x>60?`${Math.ceil(x/60)}m`:`${x}s`;process.stdout.write(`\r ${m} ${j}% ${h.name.slice(0,28)} ETA: ${E} `);try{let T=xo(h.filePath),C=await fetch(`${t}/api/tasks/${encodeURIComponent(h.remoteId)}/files`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/octet-stream","x-filename":encodeURIComponent(h.name)},body:T});C.ok?(s++,u+=h.size):(c++,b.push({name:h.name,reason:`HTTP ${C.status}`}))}catch(T){c++,b.push({name:h.name,reason:T instanceof Error?T.message:String(T)})}}let g=ir(o,o);return process.stdout.write(`\r ${g} 100% Done${" ".repeat(40)}
1768
- `),{uploaded:s,failed:c,failedFiles:b}}async function lr(t,e){let n=wo(t),i=await Z();if(!i&&(console.log(q.yellow(" Not logged in. Starting login flow...")),await rt(),i=await Z(),!i)){console.error(q.red(" Login failed. Please run `vibeflow login` and try again.")),process.exitCode=O.AUTH;return}let l=ae(n);if(l.length===0){console.log(q.dim(" No local tasks found. Nothing to push."));return}console.log(q.cyan(` Found ${l.length} local task(s). Pushing to SaaS...`));let o=Co(),r=e.workspace;if(!r){let p=await oe();p&&(r=p.id,console.log(q.dim(` Using board: ${p.icon??""} ${p.name}`)))}let s={tasks:l};r&&(s.workspaceId=r);let c;try{let p=await fetch(`${o}/api/cli/import`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(s)});if(!p.ok){let f=await p.json().catch(()=>({}));console.error(q.red(` Import failed: ${p.status} ${f.error??p.statusText}`)),process.exitCode=O.GENERAL;return}c=await p.json()}catch(p){let f=p instanceof Error?p.message:String(p);console.error(q.red(` Network error: ${f}`)),process.exitCode=O.GENERAL;return}console.log(q.green(` \u2713 Pushed ${c.imported} task(s) to SaaS`)),c.skipped&&c.skipped>0&&console.log(q.dim(` Skipped ${c.skipped} already-imported task(s).`));let u=(await oe())?.name??c.workspaceId;console.log(q.dim(` Board: ${u}`));let d=c.idMap??{},b=l.filter(p=>p.id&&d[p.id]).map(p=>({localId:p.id,remoteId:d[p.id]})),{uploaded:g,failed:h,failedFiles:j}=await To(o,i,n,b);if(g>0&&console.log(q.green(` \u2713 Uploaded ${g} file(s) to storage`)),h>0){console.log(q.yellow(` \u26A0 ${h} file(s) failed to upload`));for(let p of j)console.log(q.dim(` - ${p.name}: ${p.reason}`))}if(e.keepLocalFiles){console.log(q.dim(" Local task files kept (--keep-local-files)."));return}let m=0;for(let p of l)try{yo(p.filePath),m++}catch{}console.log(q.dim(` Deleted ${m} local task file(s).`))}import Q from"chalk";import{basename as sr,resolve as jo,join as Io}from"path";import{existsSync as No,statSync as Po}from"fs";function Ro(t,e){return t===void 0?"new":t!=="todo"&&e==="todo"?"moved-to-todo":null}function Lo(t,e){try{let n=ae(t).find(r=>r.id===e);if(!n)return null;let i=Le(t),l=pe(t,e),o=te(t,e).map(r=>({...r,url:`http://localhost:${i.port}${r.url}`}));return Me(n,n.filePath,l,o,t)}catch{return null}}function cr(t){let e=jo(t);if(!No(e)){console.error(Q.red(` Error: directory does not exist: ${e}`)),process.exitCode=O.USAGE;return}if(!Po(e).isDirectory()){console.error(Q.red(` Error: not a directory: ${e}`)),process.exitCode=O.USAGE;return}Ee(e);let n=Io(e,U,Ce),i=new Map;for(let r of ae(e))i.set(r.id,r.status);let l=(r,s)=>{try{let c=Lo(e,s);if(!c)return;console.log(),console.log(r==="new"?Q.green.bold("\u{1F195} NEW TASK"):Q.blue.bold("\u25B6 MOVED TO TODO")),console.log(Q.dim("\u2500".repeat(62)));for(let u of c.split(`
1769
- `))console.log(Q.dim(u));console.log(Q.dim("\u2500".repeat(62)))}catch(c){console.error(Q.red(` Error rendering task ${s}:`),c)}},o=De(n,{onChanged:r=>{try{let s=ee(r);if(!s)return;let c=i.get(s.id),u=Ro(c,s.status);i.set(s.id,s.status),u&&l(u,s.id)}catch(s){console.error(Q.red(` Error processing ${sr(r)}:`),s)}},onDeleted:r=>{i.delete(sr(r,".json"))}});o.on("error",r=>{console.error(Q.red(" Watcher error:"),r)}),console.log(),console.log(Q.bold(" Vibeflow \u2014 watching for task updates")),console.log(Q.dim(` ${n}`)),console.log(Q.dim(" Notifies on: new tasks, tasks moved to todo.")),console.log(Q.dim(" Press Ctrl+C to stop.")),console.log(),process.once("SIGINT",()=>{o.close().then(()=>{console.log(Q.dim(`
1770
- Watch stopped.`)),process.exit(0)},()=>process.exit(0))}),process.once("SIGTERM",()=>{o.close().then(()=>process.exit(0),()=>process.exit(0))})}import at from"chalk";function ur(t={}){let e=qe(Re()??"",t);if(!e){console.log(at.dim(" No changelog found for this installation."));return}console.log(),console.log(e),console.log(),t.all||(console.log(at.dim(" Run ")+at.cyan("vibeflow changelog --all")+at.dim(" to see every release.")),console.log())}import{readdirSync as Oo,unlinkSync as Ao,existsSync as $o,statSync as zo}from"fs";import{join as dr}from"path";var pr="auth-state.",fr=".enc";function gr(t){let e=dr(t,U);if(!$o(e))return[];try{return Oo(e).filter(n=>n.startsWith(pr)&&n.endsWith(fr)).map(n=>dr(e,n))}catch{return[]}}function mr(t){let e=gr(t),n=0;for(let i of e)try{Ao(i),n++}catch{}return n}function br(t){let e=gr(t),n=[];for(let i of e){let o=(i.split("/").pop()??"").slice(pr.length,-fr.length);if(!o)continue;let r="unknown";try{let s=zo(i),c=Date.now()-s.mtimeMs,u=Math.floor(c/(1e3*60*60));u<1?r=`${Math.floor(c/6e4)}m`:u<24?r=`${u}h`:r=`${Math.floor(u/24)}d`}catch{}n.push({taskId:o,path:i,age:r})}return n}import $ from"chalk";import{resolve as Sr,join as me}from"path";import{readFileSync as At}from"fs";import{statSync as Do,readdirSync as Fo,unlinkSync as Bo}from"fs";function Mo(t,e){return Math.abs(t.x-e.x)>2||Math.abs(t.y-e.y)>2||Math.abs(t.width-e.width)>2||Math.abs(t.height-e.height)>2}function ot(t,e){let n=!!e.outerHTML,i=t.outerHTML!==e.outerHTML,l={},o=new Set([...Object.keys(t.computedStyles),...Object.keys(e.computedStyles)]);for(let u of o){let d=t.computedStyles[u],b=e.computedStyles[u];d!==b&&(l[u]=[d??"",b??""])}let r=Mo(t.position.boundingBox,e.position.boundingBox),s=new Set(t.consoleErrors),c=e.consoleErrors.filter(u=>!s.has(u));return{selectorResolves:n,htmlChanged:i,stylesChanged:l,positionChanged:r,newConsoleErrors:c}}function hr(t,e){let n=[];if(t.selectorResolves){t.htmlChanged&&n.push("HTML changed");let i=Object.keys(t.stylesChanged).length;if(i>0){let l=Object.keys(t.stylesChanged).slice(0,5).join(", "),o=i>5?` (+${i-5} more)`:"";n.push(`${i} style property change(s): ${l}${o}`)}t.positionChanged&&n.push("position shifted"),t.newConsoleErrors.length>0&&n.push(`${t.newConsoleErrors.length} new console error(s)`),n.length===0&&n.push("no structural changes detected")}else n.push(`Selector "${e}" no longer resolves`);return n.join("; ")}var Ot=["display","visibility","opacity","position","overflow","overflow-x","overflow-y","width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-width","border-style","border-color","border-radius","background-color","background-image","color","font-size","font-weight","font-style","font-family","line-height","letter-spacing","text-align","text-decoration","text-overflow","white-space","flex-direction","flex-wrap","flex","justify-content","align-items","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","z-index","box-shadow","transform","transition","cursor","user-select","pointer-events","top","left","right","bottom"];function vr(t){let e=[],n=t;for(;n&&n!==document.documentElement;){let i=n.parentElement;if(!i)break;let l=Array.from(i.children).indexOf(n);e.unshift(l),n=i}return e.join("/")}function yr(t){let e=t.tagName.toLowerCase(),n=t.getAttribute("data-task-id");if(n)return`${e}.task-card[data-task-id=${n}]`;let i=t.getAttribute("data-status");if(i&&t.classList.contains("column-scroll"))return`${e}.column-scroll[data-status=${i}]`;let l=t.getAttribute("data-column-id");if(l)return`${e}[data-column-id=${l}]`;let o=Array.from(t.classList).slice(0,2),r=e;o.length&&(r+="."+o.join("."));let s=t.parentElement;if(s){let c=Array.from(s.children).filter(u=>u.tagName===t.tagName);if(c.length>1){let u=c.indexOf(t)+1;r+=`:nth-of-type(${u})`}}return r}function xr(t,e=Ot){let n=window.getComputedStyle(t),i={};for(let l of e)i[l]=n.getPropertyValue(l);return i}function kr(t,e=200){return t.replace(/\s+/g," ").trim().slice(0,e)}function wr(t){let e=new Map;for(let n of t){let i=n.tagName.toLowerCase(),l=Array.from(n.classList).slice(0,2).join("."),o=l?`${i}.${l}`:i;e.set(o,(e.get(o)||0)+1)}return Array.from(e.entries()).map(([n,i])=>`${n} \xD7${i}`).slice(0,10)}var K=class extends Error{constructor(n,i,l){super(i);this.code=n;this.suggestion=l;this.name="VerifyError"}code;suggestion};async function Uo(){try{return await import("playwright")}catch{throw new K("E_PLAYWRIGHT_MISSING","Playwright is not installed.","Run: npx playwright install chromium")}}async function Ho(t,e,n={}){let i=Sr(t),l=V(i,e);if(!l)throw new K("E_NOT_FOUND",`Task not found: ${e}`,"Run 'vibeflow tasks' to see available task IDs.");let o=ee(l);if(!o)throw new K("E_NOT_FOUND",`Task not found: ${e}`);let r,s=o.baselineElementFile||"baseline-element.json",c=Pe(i,e,s);if(c)try{r=JSON.parse(At(c,"utf-8"))}catch{}if(!r&&o.baseline&&(r=o.baseline),!r)throw new K("E_NO_BASELINE","Task has no baseline. Re-annotate to capture one.");let u=[],d={},b={};if(o.authStateEnc&&o.author)try{let y=JSON.parse(o.authStateEnc),x=pn(y,o.author);if(!x)throw new K("E_AUTH_EXPIRED","Auth state expired. Re-annotate to capture fresh cookies.");u=x.cookies,d=x.localStorage,b=x.sessionStorage}catch(y){throw y instanceof K?y:new K("E_AUTH_CORRUPT","Auth state corrupted. Re-annotate.")}let g=n.url??o.url;if(!g)throw new K("E_NO_URL","Task has no URL. Cannot verify without a target URL.","Re-annotate the element with a URL, or use --url to override.");let h=g.startsWith("http")?g:`http://localhost:3700${g.startsWith("/")?g:"/"+g}`,j=o.cssSelector??o.selector;if(!j||j==="/")throw new K("E_NO_SELECTOR","Task has no CSS selector. Cannot verify without a selector.");let m=await Uo(),p;try{p=await m.chromium.launch({headless:!0})}catch(y){let x=y instanceof Error?y.message:String(y);throw x.includes("not found")||x.includes("not installed")||x.includes("Executable doesn't exist")?new K("E_PLAYWRIGHT_MISSING","Chromium is not installed.","Run: npx playwright install chromium"):new K("E_PLAYWRIGHT_CRASH",`Verification failed: ${x}`,"Try again.")}let f;try{let y=r.position?.viewport;f=await p.newContext({viewport:y?{width:y.width,height:y.height}:void 0,deviceScaleFactor:y?.dpr,userAgent:r.browser||void 0}),u.length>0&&await f.addCookies(u.map(v=>({name:v.name,value:v.value,domain:v.domain,path:v.path,expires:v.expires,httpOnly:v.httpOnly,secure:v.secure,sameSite:v.sameSite})));let x=await f.newPage(),E=[];x.on("console",v=>{v.type()==="error"&&E.push(v.text())}),x.on("pageerror",v=>{E.push(v.message)});try{await x.goto(h,{waitUntil:"networkidle",timeout:15e3})}catch(v){let R=v instanceof Error?v.message:String(v);throw R.includes("ERR_CONNECTION_REFUSED")||R.includes("ECONNREFUSED")?new K("E_APP_NOT_RUNNING",`Cannot connect to ${h}. Is the dev server running?`):new K("E_NAVIGATION_FAILED",`Failed to navigate to ${h}: ${R}`)}try{Object.keys(d).length>0&&await x.evaluate(v=>{for(let[R,_]of Object.entries(v))window.localStorage.setItem(R,_)},d),Object.keys(b).length>0&&await x.evaluate(v=>{for(let[R,_]of Object.entries(v))window.sessionStorage.setItem(R,_)},b)}catch{}let T=0;try{await x.waitForSelector(j,{timeout:1e4}),T=await x.locator(j).count()}catch{let v={outerHTML:"",computedStyles:{},selector:j,position:r.position,browser:r.browser,consoleErrors:E,capturedAt:new Date().toISOString()},R=ot(r,v);return $t(o.id,o.description,r,v,R,[],j)}if(T>1){let v={outerHTML:"",computedStyles:{},selector:j,position:r.position,browser:r.browser,consoleErrors:E,capturedAt:new Date().toISOString()},R=ot(r,v),_=`Selector matches ${T} elements. The selector may need to be more specific.`;return $t(o.id,o.description,r,v,R,[],j,_)}let C=await Wo(x,j,r,E),w=null,k=o.baselineFile||"baseline-page.json",I=Pe(i,e,k);if(I)try{w=JSON.parse(At(I,"utf-8"))}catch{}let N=ot(r,C),P=await Vo(i,e,r,C,N,E,x,j);if(w&&w.elements){let v=Pe(i,e,"verify-all-styles.json");if(v)try{let R=JSON.parse(At(v,"utf-8"));if(R&&R.elements){let _={},M=Object.entries(R.elements);for(let[A,ye]of M){let xe=w.elements[A]?.after;if(xe){ye.baseline=xe;let de={};for(let[H,ke]of Object.entries(ye.after)){let we=xe[H];we!==ke&&(de[H]=[we,ke])}Object.keys(de).length>0&&(_[A]=de)}}G(i,e,"verify-all-styles.json",Buffer.from(JSON.stringify(R,null,2)));let F=JSON.stringify({totalChanged:Object.keys(_).length,elements:_},null,2);G(i,e,"verify-page-diff.json",Buffer.from(F)),P.push(me(Y(i,e),"verify-page-diff.json"))}}catch{}}return B(i,e,{verified:!0}),$t(o.id,o.description,r,C,N,P,j)}finally{await f?.close(),await p?.close()}}async function Wo(t,e,n,i){let l=t.locator(e).first(),o=await l.evaluate(u=>u.outerHTML).catch(()=>""),r=await l.evaluate(u=>{let d=window.getComputedStyle(u),b={};for(let g=0;g<d.length;g++){let h=d[g];b[h]=d.getPropertyValue(h)}return b}).catch(()=>({})),c={boundingBox:await l.boundingBox().catch(()=>null)??n.position.boundingBox,scrollPosition:await t.evaluate(()=>({x:window.scrollX,y:window.scrollY})),viewport:await t.evaluate(()=>({width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio})),stackingContext:n.position.stackingContext};return{outerHTML:o,computedStyles:r,selector:e,position:c,browser:n.browser,consoleErrors:i,capturedAt:new Date().toISOString()}}async function Vo(t,e,n,i,l,o,r,s){let c=[],u=Y(t,e);try{let h=Fo(u);for(let j of h)(j.startsWith("verify-")||j==="baseline.json")&&Bo(me(u,j))}catch{}let d=JSON.stringify(i,null,2);G(t,e,"verify-after.json",Buffer.from(d)),c.push(me(Y(t,e),"verify-after.json"));let b=JSON.stringify(l,null,2);G(t,e,"verify-diff.json",Buffer.from(b)),c.push(me(Y(t,e),"verify-diff.json"));let g=o.length>0?o.join(`
1771
- `):"(no console errors)";if(G(t,e,"verify-console.txt",Buffer.from(g)),c.push(me(Y(t,e),"verify-console.txt")),r){try{let h=await r.content();G(t,e,"verify-page.html",Buffer.from(h)),c.push(me(Y(t,e),"verify-page.html"))}catch{}try{let j=await r.evaluate(({buildKeyFn:m,buildSelectorFn:p,filterStylesFn:f,childSignatureFn:y,normalizeTextFn:x,styles:E,maxElements:T})=>{let C={},w=0,k=!1,I=document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode(v){if(w>=T)return NodeFilter.FILTER_REJECT;let R=v;return R.classList.length>0||R.hasAttribute("data-task-id")||R.hasAttribute("data-status")||R.hasAttribute("data-column-id")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),N=[],P;for(;P=I.nextNode();)N.push(P);for(let v of N){if(w>=T){k=!0;break}let R=m(v),_=Array.from(v.children),M={};for(let A of Array.from(v.attributes))A.name.startsWith("data-")&&(M[A.name.slice(5)]=A.value);let F={x:0,y:0,width:0,height:0};try{let A=v.getBoundingClientRect();F={x:Math.round(A.x),y:Math.round(A.y),width:Math.round(A.width),height:Math.round(A.height)}}catch{}C[R]={key:R,selector:p(v),tag:v.tagName.toLowerCase(),classes:Array.from(v.classList),dataAttrs:M,parentKey:v.parentElement?m(v.parentElement):"",childCount:_.length,childSignature:y(_),text:x(v.textContent??""),position:F,baseline:f(v,E),after:f(v,E)},w++}return{version:1,capturedAt:new Date().toISOString(),truncated:k,elements:C}},{buildKeyFn:vr,buildSelectorFn:yr,filterStylesFn:xr,childSignatureFn:wr,normalizeTextFn:kr,styles:Ot,maxElements:1e3});if(j){let m=JSON.stringify(j,null,2);G(t,e,"verify-all-styles.json",Buffer.from(m)),c.push(me(Y(t,e),"verify-all-styles.json"))}}catch{}try{let h=await r.screenshot({fullPage:!1});G(t,e,"verify-screenshot.png",h),c.push(me(Y(t,e),"verify-screenshot.png"))}catch{}if(s)try{let h=await r.locator(s).first().evaluate(j=>j.outerHTML);G(t,e,"verify-element.html",Buffer.from(h)),c.push(me(Y(t,e),"verify-element.html"))}catch{}}if(n){let h=JSON.stringify(n,null,2);G(t,e,"baseline.json",Buffer.from(h)),c.push(me(Y(t,e),"baseline.json"))}return c}function $t(t,e,n,i,l,o,r,s){let c=l.selectorResolves&&l.newConsoleErrors.length===0,u=s??hr(l,r);return{taskId:t,ok:c,taskDescription:e,baseline:{selector:n.selector,url:"",capturedAt:n.capturedAt,snapshot:n},after:{snapshot:i,consoleErrors:i.consoleErrors},diff:l,evidenceFiles:o,verdict:u}}async function _r(t,e,n){let i=Sr(t);try{let l=await Ho(i,e,n),o=`**Verification ${l.ok?"\u2705 passed":"\u26A0\uFE0F issues detected"}**
1772
-
1773
- ${l.verdict}`;be(i,e,"agent",o,void 0,"system"),n.json?console.log(JSON.stringify(l,null,2)):qo(l)}catch(l){if(l instanceof K)n.json?process.stderr.write(JSON.stringify({ok:!1,error:{code:l.code,message:l.message,suggestion:l.suggestion}})+`
1774
- `):(process.stderr.write($.red(`\u2717 ${l.message}
1775
- `)),l.suggestion&&process.stderr.write($.dim(` ${l.suggestion}
1776
- `))),process.exitCode=O.GENERAL;else{let o=l instanceof Error?l.message:String(l);n.json?process.stderr.write(JSON.stringify({ok:!1,error:{code:"E_UNKNOWN",message:o}})+`
1777
- `):process.stderr.write($.red(`\u2717 Verification failed: ${o}
1778
- `)),process.exitCode=O.GENERAL}}}function qo(t){let e=t.ok?$.green("\u2705"):$.yellow("\u26A0\uFE0F");console.log(),console.log(` ${e} Evidences collected for task ${t.taskId}`),console.log($.dim("\u2500".repeat(60))),console.log($.dim(` Verdict: ${t.verdict}`)),console.log();let n=t.diff;if(n.selectorResolves){n.htmlChanged?console.log($.cyan(" \u2713 HTML changed")):console.log($.dim(" \xB7 HTML unchanged"));let i=Object.keys(n.stylesChanged).length;if(i>0){console.log($.cyan(` \u2713 ${i} style property change(s):`));for(let[l,[o,r]]of Object.entries(n.stylesChanged).slice(0,8))console.log($.dim(` ${l}: ${o} \u2192 ${r}`));i>8&&console.log($.dim(` ... and ${i-8} more`))}if(n.positionChanged&&console.log($.cyan(" \u2713 Position shifted")),n.newConsoleErrors.length>0){console.log($.yellow(` \u26A0 ${n.newConsoleErrors.length} new console error(s):`));for(let l of n.newConsoleErrors.slice(0,3))console.log($.dim(` ${l.slice(0,120)}`))}}else console.log($.red(" \u26A0 Target element not found \u2014 the fix may have renamed/removed it."));if(t.evidenceFiles.length>0){console.log($.cyan(` Evidence files (${t.evidenceFiles.length}):`));for(let i of t.evidenceFiles){let l=i.split("/").pop()??i;try{let r=(Do(i).size/1024).toFixed(1);console.log($.dim(` ${l} (${r} KB)`))}catch{console.log($.dim(` ${l}`))}}}console.log(),console.log($.cyan(" Explore evidence (agent tools):")),console.log($.dim(` vibeflow verify style_query ${t.taskId} <property>`)),console.log($.dim(` vibeflow verify style_diff ${t.taskId} [--filter <pattern>]`)),console.log($.dim(` vibeflow verify element_info ${t.taskId}`)),console.log($.dim(` vibeflow verify html_diff ${t.taskId}`)),console.log(),console.log($.cyan(" Review evidences:")),console.log($.dim(" 1. Check if the fix is confirmed (styles match expectations)")),console.log($.dim(` 2. If confirmed \u2192 vibeflow tasks --edit ${t.taskId} --set-status review --comment "Verified: <what you confirmed>"`)),console.log($.dim(" 3. If not sure \u2192 leave a comment explaining uncertainty")),console.log($.dim(` 4. If wrong \u2192 vibeflow tasks --edit ${t.taskId} --set-status in-progress`)),console.log(),t.ok||(console.log($.yellow(" \u26A0 Verification failed \u2014 move to in-progress and fix:")),console.log($.dim(` vibeflow tasks --edit ${t.taskId} --set-status in-progress`)))}import{readFileSync as Ir,existsSync as Nr}from"fs";import{join as Pr}from"path";import{resolve as Ko}from"path";function Er(t,e){let n=[];for(let[i,l]of Object.entries(e.elements)){let o=t.elements[i];if(!o)continue;let r=o.childCount,s=l.childCount;if(r===s)continue;let c=[],u=Math.max(0,s-r);if(r>s){let b=new Set(o.childSignature),g=new Set(l.childSignature);for(let h of b)g.has(h)||c.push(h)}let d=[`children: ${r} \u2192 ${s}`,c.length?`removed: ${c.join(", ")}`:"",u?`added: ${u} element(s)`:""].filter(Boolean).join("; ");n.push({selector:l.selector,details:d})}return{queryType:"children",matches:n}}function Tr(t,e){let n=[];for(let[i,l]of Object.entries(e.elements)){let o=t.elements[i];o&&o.text!==l.text&&n.push({selector:l.selector,details:`text: "${Cr(o.text,60)}" \u2192 "${Cr(l.text,60)}"`})}return{queryType:"text",matches:n}}function jr(t,e){let n=[];for(let[i,l]of Object.entries(e.elements)){let o=t.elements[i];if(!o)continue;let r=new Set([...Object.keys(o.dataAttrs),...Object.keys(l.dataAttrs)]),s=[];for(let c of r){let u=o.dataAttrs[c]??"",d=l.dataAttrs[c]??"";u!==d&&s.push(`${c}: "${u}" \u2192 "${d}"`)}s.length>0&&n.push({selector:l.selector,details:s.join("; ")})}return{queryType:"attributes",matches:n}}function Cr(t,e){return t.length<=e?t:t.slice(0,e-1)+"\u2026"}var Rr=new Set(["style_query","style_diff","element_info","html_diff","html_query"]);async function Yo(t,e){let n=Y(t,e),i=b=>{let g=Pr(n,b);if(!Nr(g))return null;try{return JSON.parse(Ir(g,"utf-8"))}catch{return null}},l=b=>{let g=Pr(n,b);if(!Nr(g))return null;try{return Ir(g,"utf-8")}catch{return null}},o=i("baseline.json"),r=i("verify-after.json"),s=i("verify-diff.json"),c=l("verify-console.txt"),u=i("verify-all-styles.json"),d=i("baseline-page.json");if(u?.elements&&d?.elements)for(let[b,g]of Object.entries(u.elements)){let h=d.elements[b];h?.after&&(g.baseline=h.after)}return{taskId:e,baseline:o?.computedStyles??null,after:r?.computedStyles??null,diff:s?.stylesChanged??null,consoleText:c,baselineHtml:o?.outerHTML??null,afterHtml:r?.outerHTML??null,selector:r?.selector??null,position:r?.position??null,allStyles:u,pageBaseline:d}}function Go(t,e){if(t.allStyles){let o=t.allStyles,r=[];for(let[,s]of Object.entries(o.elements)){let c=s.baseline?.[e]??null,u=s.after?.[e]??null;c!==u&&(c!==null||u!==null)&&r.push({selector:s.selector,tag:s.tag,childCount:s.childCount,from:c??"(not set)",to:u??"(not set)",isRelevant:!!(c==="hidden"&&u==="auto"||c==="visible"&&u==="auto"||c==="line-through"&&u==="none"||c==="none"&&u&&u!=="none")})}return{ok:!0,tool:"style_query",taskId:t.taskId,property:e,matches:r}}if(!t.after)return{ok:!1,error:"No verify-after.json found. Run 'vibeflow verify <task-id>' first."};let n=t.baseline?.[e]??t.baseline?.[zt(e)]??null,i=t.after?.[e]??t.after?.[zt(e)]??null,l=t.diff?.[e]!==void 0||t.diff?.[zt(e)]!==void 0;return{ok:!0,tool:"style_query",taskId:t.taskId,property:e,baseline:n,after:i,changed:l}}function Qo(t,e){if(!t.diff)return{ok:!1,error:"No verify-diff.json found. Run 'vibeflow verify <task-id>' first."};let n=Object.entries(t.diff),i=e?n.filter(([o])=>o.toLowerCase().includes(e.toLowerCase())):n,l=Object.fromEntries(i);return{ok:!0,tool:"style_diff",taskId:t.taskId,filter:e??null,total:n.length,matched:i.length,styles:l}}function Xo(t){if(!t.after)return{ok:!1,error:"No verify-after.json found. Run 'vibeflow verify <task-id>' first."};let e=t.consoleText&&!t.consoleText.includes("no console errors")&&t.consoleText.trim().length>0;return{ok:!0,tool:"element_info",taskId:t.taskId,selector:t.selector,position:t.position,consoleErrors:e?t.consoleText.split(`
1779
- `).filter(Boolean):[]}}function Jo(t){if(!t.afterHtml)return{ok:!1,error:"No after HTML found. Run 'vibeflow verify <task-id>' first."};let e=t.baselineHtml!==t.afterHtml;return{ok:!0,tool:"html_diff",taskId:t.taskId,htmlChanged:e,baselineChars:t.baselineHtml?.length??0,afterChars:t.afterHtml?.length??0,baselineHtml:t.baselineHtml,afterHtml:t.afterHtml}}async function Lr(t,e,n,i={}){let l=Ko(t),o=n[0];if(!o){let u=`Usage: vibeflow verify ${e} <task-id> ${e==="style_query"?"<property>":""}`;i.json?console.log(JSON.stringify({ok:!1,error:u})):process.stderr.write(`\u2717 ${u}
1780
- `),process.exitCode=1;return}if(!V(l,o)){let u=`Task not found: ${o}`;i.json?console.log(JSON.stringify({ok:!1,error:u})):process.stderr.write(`\u2717 ${u}
1781
- `),process.exitCode=1;return}let s=await Yo(l,o),c;switch(e){case"style_query":{let u=n[1];if(!u){c={ok:!1,error:"Usage: vibeflow verify style_query <task-id> <property>"};break}c=Go(s,u);break}case"style_diff":c=Qo(s,i.filter);break;case"element_info":c=Xo(s);break;case"html_diff":c=Jo(s);break;case"html_query":{let u=n[1];if(!u||!["children","text","attributes"].includes(u)){c={ok:!1,error:"Usage: vibeflow verify html_query <task-id> children|text|attributes"};break}c=Zo(s,u);break}default:c={ok:!1,error:`Unknown tool: ${e}`};break}if(i.json)console.log(JSON.stringify(c,null,2));else{if(!c.ok){process.stderr.write(`\u2717 ${c.error}
1782
- `);return}console.log(JSON.stringify(c,null,2))}}function Zo(t,e){if(!t.allStyles)return{ok:!1,error:"No verify-all-styles.json found. Run 'vibeflow verify <task-id>' first."};let n=t.allStyles,i=t.pageBaseline?t.pageBaseline:{version:1,capturedAt:n.capturedAt,truncated:!1,elements:{}},l;switch(e){case"children":l=Er(i,n);break;case"text":l=Tr(i,n);break;case"attributes":l=jr(i,n);break}return{ok:!0,tool:"html_query",taskId:t.taskId,...l}}function zt(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}var Mt="https://app.vibeflow.tools";function it(){let t=process.env.VIBEFLOW_API_URL??Mt;try{let e=new URL(t);return e.protocol!=="https:"&&e.protocol!=="http:"?Mt:t.replace(/\/+$/,"")}catch{return Mt}}var ei={backlog:"backlog",todo:"todo","in-progress":"in_progress",review:"review",done:"done"},ti={backlog:"backlog",todo:"todo",in_progress:"in-progress",review:"review",done:"done",cancelled:"done"};function ve(t){return ti[t]??"todo"}function ni(t){return ei[t]??"todo"}async function lt(){let t=await Z();return t?{Authorization:`Bearer ${t}`}:null}async function Oe(t){let e=await lt();if(!e)return null;let n=new URL(`${it()}/api/cli/tasks`);t&&n.searchParams.set("boardId",t);try{let i=await fetch(n.toString(),{headers:e});return i.ok?i.json():null}catch{return null}}async function Or(t){let e=await Oe();return e?e.tasks.find(n=>n.id===t)??null:null}async function Dt(t,e){let n=await lt();if(!n)return null;let i={};e.status!==void 0&&(i.status=ni(e.status)),e.title!==void 0&&(i.title=e.title),e.description!==void 0&&(i.description=e.description),e.priority!==void 0&&(i.priority=e.priority),e.branchName!==void 0&&(i.branchName=e.branchName);try{let l=await fetch(`${it()}/api/cli/tasks/${encodeURIComponent(t)}`,{method:"PATCH",headers:{...n,"Content-Type":"application/json"},body:JSON.stringify(i)});if(!l.ok)return null;let o=await l.json();return{task:o.task,warning:o.warning}}catch{return null}}async function Ar(t,e){let n=await lt();if(!n)return null;try{let i=await fetch(`${it()}/api/cli/tasks/${encodeURIComponent(t)}/comments`,{method:"POST",headers:{...n,"Content-Type":"application/json"},body:JSON.stringify({body:e})});return i.ok?(await i.json()).comment:null}catch{return null}}async function $r(t){let e=await lt();if(!e)return null;try{let n=await fetch(`${it()}/api/cli/tasks`,{method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t)});return n.ok?(await n.json()).task:null}catch{return null}}import{readFileSync as Xr,existsSync as Jr,unlinkSync as hi}from"fs";import{resolve as W,join as vi,basename as Wr}from"path";import a from"chalk";import{createHash as ri,randomUUID as ai}from"crypto";import{existsSync as oi,readFileSync as ii,writeFileSync as li,mkdirSync as si,renameSync as ci}from"fs";import{join as zr}from"path";import Mr from"os";import{PostHog as ui}from"posthog-node";var di="phc_C9AUV3rnayLfVvxgHtvj6AXcwsd8FKWUfJ9262zWsCvM",pi="https://eu.i.posthog.com";function Dr(){return zr(process.env.HOME??Mr.homedir(),".vibeflow")}function Fr(){return zr(Dr(),"config.json")}function st(){try{return JSON.parse(ii(Fr(),"utf-8"))}catch{return{}}}function Br(t){let e=Dr();oi(e)||si(e,{recursive:!0});let n=st(),i=Fr(),l=i+".tmp";li(l,JSON.stringify({...n,...t},null,2),"utf-8"),ci(l,i)}function Ur(){return process.env.VIBEFLOW_TELEMETRY==="0"?!1:st().disabled!==!0}function Ft(t){Br({disabled:!t})}function Hr(){let t=Ur(),e=st();return{enabled:t,anonymousId:e.anonymousId??null}}function fi(){let t=st();if(t.anonymousId)return t.anonymousId;let e=ai();return Br({anonymousId:e}),e}function gi(){let t=Mr.userInfo().username;return ri("sha256").update(t).digest("hex").slice(0,16)}var Ue=null;function mi(){return Ur()?(Ue||(Ue=new ui(di,{host:pi,flushAt:1,flushInterval:0})),Ue):null}function ce(t,e){let n=mi();if(!n)return;let i=fi();n.capture({distinctId:i,event:t,properties:{...e,$user_id:gi()}})}async function se(){if(Ue)try{await Ue.shutdown()}catch{}}function yi(t,e){let n=u=>u.replace(/[^0-9.]/g,"").split(".").map(Number),[i=0,l=0,o=0]=n(t),[r=0,s=0,c=0]=n(e);return i!==r?i>r:l!==s?l>s:o>c}var Vr=!1;function xi(){if(!Vr){Vr=!0;try{let t=qe(Re()??"");t&&(console.log(t),console.log())}catch{}}}function ki(t=!0){let e="0.11.0";if(!e)return;let n="@vibeflow-tools/cli";import("https").then(({default:i})=>{let l=i.get(`https://registry.npmjs.org/${encodeURIComponent(n)}/latest`,{timeout:5e3},o=>{let r="";o.on("data",s=>{r+=s.toString()}),o.on("end",()=>{try{let{version:s}=JSON.parse(r);s&&yi(s,e)&&(console.log(),console.log(a.bgYellow.black.bold(` \u2191 Update available: ${e} \u2192 ${s} `)),console.log(a.dim(" Run: ")+a.cyan(`npm install -g ${n}@${s}`)+a.dim(" to update")),console.log(),t&&xi())}catch{}})});l.on("error",()=>{}),l.on("timeout",()=>{l.destroy()})}).catch(()=>{})}ar();var Ie={backlog:a.gray,todo:a.yellow,"in-progress":a.blue,review:a.magenta,done:a.green},wi=new Set(["Task","Bug","Research"]),ct=["backlog","todo","in-progress","review","done"],je=(t,e)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();function qr(t){let e=n=>t.filter(i=>i.status===n).length;return` Total: ${t.length} | Backlog: ${e("backlog")} | Todo: ${e("todo")} | In Progress: ${e("in-progress")} | Review: ${e("review")} | Done: ${e("done")}`}function Si(t){if(t){for(let e of wi)if(e.toLowerCase()===t.toLowerCase())return e}}function _e(t){let e=(t??"Medium").trim().toLowerCase();return e==="critical"?0:e==="high"?1:e==="low"?3:2}var Kr=["in-progress","review","todo","backlog","done"];function ut(t){let e=Kr.indexOf(t);return e===-1?Kr.length:e}function Yr(t){try{return ft("git",["push"],{cwd:t,stdio:"inherit"}),{ok:!0}}catch{try{let e=Ut("git rev-parse --abbrev-ref HEAD",{cwd:t}).toString().trim();return ft("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 Ae(t){let e=Kt(t);for(let n of e.split(`
1783
- `))n.startsWith("Agent instructions")?console.log(a.bold(n)):n.startsWith(" \u26A0")?console.log(a.yellow(n)):n.startsWith(" CRITICAL:")?console.log(a.red(n)):console.log(a.dim(n))}var Gr=["Task","Bug","Feature","Enhancement","Research"];function X(t,e){switch(t){case"add":return["set status to in-progress before implementation","add a description"];case"set-status:in-progress":return["implement the change","run tests",`commit with vibeflow tasks --commit --task ${e} --message "..."`,"set review status"];case"set-status:review":return["only humans mark done after reviewing"];case"commit":return['set review status with vibeflow tasks --edit <id> --set-status review --comment "what changed and why"']}}function Bt(t,e){if(e.length===0)return t;let n={};for(let i of e)i in t&&(n[i]=t[i]);return n}function ue(t){let e=t.slice(0,3).join(", ");console.log(a.cyan(` \u2192 Next: ${e}`))}var Qr=t=>t.trim().toLowerCase();function dt(t){if(t.json){let e={ok:!1,error:{code:t.code,message:t.message,retryable:t.retryable??!1,...t.suggestion?{suggestion:t.suggestion}:{}}};process.stderr.write(JSON.stringify(e)+`
1784
- `)}else process.stderr.write(a.red(`\u2717 ${t.message}
1785
- `)),t.suggestion&&process.stderr.write(a.dim(` ${t.suggestion}
1786
- `))}function $e(t,e){let n=Qr(e);return n?Qr(t??"")===n:!0}function _i(t){return[...new Set(t.map(e=>e.author?.trim()).filter(e=>!!e))].sort((e,n)=>e.localeCompare(n))}function pt(t){return Gr.map(e=>e.toLowerCase()).includes(t.toLowerCase())?!0:(console.log(a.red(`\u2717 Invalid type filter: "${t}"`)),console.log(a.yellow(` Available types: ${Gr.join(" | ")}`)),console.log(a.dim(" Type filter is exact (example: --type Bug)")),process.exitCode=O.USAGE,!1)}function He(t,e){let n=_i(e);return n.length===0?(console.log(a.red("\u2717 Cannot filter by user: no task authors are available on this board.")),process.exitCode=O.USAGE,!1):n.some(i=>$e(i,t))?!0:(console.log(a.red(`\u2717 User not found: "${t}"`)),console.log(a.yellow(` Available users: ${n.join(" | ")}`)),console.log(a.dim(" User filter is exact email match (case-insensitive).")),process.exitCode=O.USAGE,!1)}function Ci(t,e,n,i,l){let o=Ie[t.status]??a.white;if(console.log(` ${a.dim(`${n+1}.`)} ${o(`[${e.status}]`)} ${e.title}`),console.log(a.dim(` id: ${e.id}`)),console.log(a.dim(` file: ${t.filePath}`)),e.file&&console.log(a.dim(` source: ${e.file}${e.line==null?"":`:${e.line}`}${e.col==null?"":`:${e.col}`}`)),e.component&&console.log(a.dim(` component: ${e.component}`)),console.log(a.dim(` selector: ${e.selector}`)),t.cssSelector&&console.log(a.dim(` css: ${t.cssSelector}`)),e.url&&console.log(a.dim(` url: ${e.url}`)),t.screenshot&&console.log(a.dim(` screenshot: http://localhost:${i}/screenshots/${t.screenshot}`)),t.commits&&t.commits.length>0)if(t.commits.length===1)console.log(a.dim(` commit: ${t.commits[0].sha}`));else{console.log(a.dim(` commits (${t.commits.length}):`));for(let r of t.commits)console.log(a.dim(` ${r.sha.slice(0,8)} ${r.timestamp} ${r.message.slice(0,60)}`))}if(t.branchName&&console.log(a.dim(` branch: ${t.branchName}`)),console.log(a.dim(` created: ${e.created}`)),e.type&&console.log(a.dim(` type: ${e.type}`)),e.priority&&console.log(a.dim(` priority: ${e.priority}`)),e.description){console.log(a.dim(" description:"));for(let r of e.description.split(`
1787
- `))console.log(a.dim(` ${r}`))}if(e.structuredComments&&e.structuredComments.length>0){console.log(a.dim(` comments (${e.structuredComments.length}):`));for(let r of e.structuredComments){let s=r.updatedAt?` (edited ${r.updatedAt})`:"";console.log(a.dim(` [${r.author??"agent"}] ${r.createdAt}${s}`));for(let c of r.text.split(`
1788
- `))console.log(a.dim(` ${c}`))}}if(e.linkedFiles&&e.linkedFiles.length>0){console.log(a.dim(` linked files (${e.linkedFiles.length}):`));for(let r of e.linkedFiles){let s=r.linkedPath??vi(l,".vibeflow","files",t.id,r.name);if(console.log(a.dim(` - ${r.name} ${r.url}`)),/\.(md|txt)$/i.test(r.name)&&r.size<1e5&&Jr(s))try{let c=Xr(s,"utf-8");console.log(a.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let u of c.split(`
1789
- `))console.log(a.dim(` \u2502 ${u}`));console.log(a.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}catch{}}}console.log()}var J=new bi;J.name("vibeflow").description("Vibeflow \u2014 CLI tool for frontend prototyping with LLM assistance").version("0.11.0");J.addHelpText("after",`
1768
+ <ul>${b}</ul></body></html>`)});for(let d of o){let m=a?`/${se(d)}`:"/";s.get(m,(b,R)=>{let y=ma(d,"utf-8"),j=p?bn(y,p):y;R.type("html").send(j)})}let _=o.map(d=>`/${se(d)}`);Dn(s,a?_:[]),$n(s,i,g),Un(s,i,g),Fn(s,i,g),Bn(s,e.port),Hn(s,e.port);let z=null;z=ot(n,{onChange:d=>{let m=se(d);console.log(f.dim(` File changed: ${m}`)),g({type:"reload",file:m})}});let $=G(i,Z,Pe),M=Ae($,{onChanged:d=>{let m=ve(d);g(m?{type:"task-changed",taskId:m.id,action:"update",task:m,source:"cli"}:{type:"tasks-updated"})},onDeleted:d=>{let m=se(d,".json");g({type:"task-deleted",taskId:m})}});return Wn(s),new Promise((d,m)=>{let b=e.host??"localhost";c.listen(e.port,b,()=>{let y=`http://${b==="0.0.0.0"?zn()??"localhost":b}:${e.port}`,j=b==="0.0.0.0"?`http://localhost:${e.port}`:null,L=f.dim(" "+"\u2500".repeat(62));console.log(),console.log(f.green(" \u2713 Vibeflow running")+f.dim(" \xB7 ")+f.cyan(y)),j&&console.log(f.dim(" Local: ")+f.cyan(j)),console.log(L);for(let S of o){let x=a?`/${se(S)}`:"/";console.log(f.dim(" File: ")+f.cyan(`${y}${x}`)+f.dim(` (${se(S)})`));let k=pe(j,x,17);k&&console.log(k)}console.log(f.dim(" Kanban board: ")+f.cyan(`${y}/kanban`));let I=pe(j,"/kanban",17);I&&console.log(I),console.log(f.dim(" Task API: ")+f.cyan(`${y}/api/tasks`));let N=pe(j,"/api/tasks",17);N&&console.log(N),console.log(L),console.log(f.bold.white(" INTEGRATE INTO YOUR APP")+f.dim(` (full guide: ${y}/inject)`));let C=pe(j,"/inject",40);C&&console.log(C),console.log(f.dim(" 1. Add this script tag to your HTML:")),console.log(f.dim(" ")+f.yellow(`<script src="${y}/vibeflow-overlay.js" data-vibeflow-overlay></script>`));let h=Mn(j,5);h&&console.log(h),console.log(f.dim(" 2. Reload your page \u2014 the overlay appears automatically.")),console.log(f.dim(" 3. Click anything to annotate it.")),console.log(),console.log(f.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then(S=>S.default(y)).catch(()=>{}),d({url:y,localUrl:j,close:async()=>{at(),z&&await z.close(),await M.close(),u.close(),await new Promise(S=>c.close(()=>S()))}})}),c.on("error",m)})}async function xe(){return await ue()?"saas":"local"}import za from"chalk";async function qn(){await Promise.all([zt(),Mt()]),console.log(za.green(" Logged out. Now operating in local mode."))}import H from"chalk";import{basename as Kn,resolve as Ma,join as Da}from"path";import{existsSync as $a,statSync as Fa}from"fs";function Ba(t,e){return t===void 0?"new":t!=="todo"&&e==="todo"?"moved-to-todo":null}function Ha(t,e){try{let n=ce(t).find(i=>i.id===e);if(!n)return null;let l=Te(t),a=oe(t,e),o=ee(t,e).map(i=>({...i,url:`http://localhost:${l.port}${i.url}`}));return Oe(n,n.filePath,a,o,t)}catch{return null}}function Yn(t){let e=Ma(t);if(!$a(e)){console.error(H.red(` Error: directory does not exist: ${e}`)),process.exitCode=A.USAGE;return}if(!Fa(e).isDirectory()){console.error(H.red(` Error: not a directory: ${e}`)),process.exitCode=A.USAGE;return}he(e);let n=Da(e,Z,Pe),l=new Map;for(let i of ce(e))l.set(i.id,i.status);let a=(i,s)=>{try{let c=Ha(e,s);if(!c)return;console.log(),console.log(i==="new"?H.green.bold("\u{1F195} NEW TASK"):H.blue.bold("\u25B6 MOVED TO TODO")),console.log(H.dim("\u2500".repeat(62)));for(let u of c.split(`
1769
+ `))console.log(H.dim(u));console.log(H.dim("\u2500".repeat(62)))}catch(c){console.error(H.red(` Error rendering task ${s}:`),c)}},o=Ae(n,{onChanged:i=>{try{let s=ve(i);if(!s)return;let c=l.get(s.id),u=Ba(c,s.status);l.set(s.id,s.status),u&&a(u,s.id)}catch(s){console.error(H.red(` Error processing ${Kn(i)}:`),s)}},onDeleted:i=>{l.delete(Kn(i,".json"))}});o.on("error",i=>{console.error(H.red(" Watcher error:"),i)}),console.log(),console.log(H.bold(" Vibeflow \u2014 watching for task updates")),console.log(H.dim(` ${n}`)),console.log(H.dim(" Notifies on: new tasks, tasks moved to todo.")),console.log(H.dim(" Press Ctrl+C to stop.")),console.log(),process.once("SIGINT",()=>{o.close().then(()=>{console.log(H.dim(`
1770
+ Watch stopped.`)),process.exit(0)},()=>process.exit(0))}),process.once("SIGTERM",()=>{o.close().then(()=>process.exit(0),()=>process.exit(0))})}import Ke from"chalk";function Gn(t={}){let e=qe(je()??"",t);if(!e){console.log(Ke.dim(" No changelog found for this installation."));return}console.log(),console.log(e),console.log(),t.all||(console.log(Ke.dim(" Run ")+Ke.cyan("vibeflow changelog --all")+Ke.dim(" to see every release.")),console.log())}import{readdirSync as Ua,unlinkSync as Wa,existsSync as Va,statSync as qa}from"fs";import{join as Qn}from"path";var Xn="auth-state.",Jn=".enc";function Zn(t){let e=Qn(t,Z);if(!Va(e))return[];try{return Ua(e).filter(n=>n.startsWith(Xn)&&n.endsWith(Jn)).map(n=>Qn(e,n))}catch{return[]}}function er(t){let e=Zn(t),n=0;for(let l of e)try{Wa(l),n++}catch{}return n}function tr(t){let e=Zn(t),n=[];for(let l of e){let o=(l.split("/").pop()??"").slice(Xn.length,-Jn.length);if(!o)continue;let i="unknown";try{let s=qa(l),c=Date.now()-s.mtimeMs,u=Math.floor(c/(1e3*60*60));u<1?i=`${Math.floor(c/6e4)}m`:u<24?i=`${u}h`:i=`${Math.floor(u/24)}d`}catch{}n.push({taskId:o,path:l,age:i})}return n}import{readFileSync as ir,existsSync as lr}from"fs";import{join as sr}from"path";import{resolve as Ka}from"path";function rr(t,e){let n=[];for(let[l,a]of Object.entries(e.elements)){let o=t.elements[l];if(!o)continue;let i=o.childCount,s=a.childCount;if(i===s)continue;let c=[],u=Math.max(0,s-i);if(i>s){let p=new Set(o.childSignature),w=new Set(a.childSignature);for(let _ of p)w.has(_)||c.push(_)}let g=[`children: ${i} \u2192 ${s}`,c.length?`removed: ${c.join(", ")}`:"",u?`added: ${u} element(s)`:""].filter(Boolean).join("; ");n.push({selector:a.selector,details:g})}return{queryType:"children",matches:n}}function ar(t,e){let n=[];for(let[l,a]of Object.entries(e.elements)){let o=t.elements[l];o&&o.text!==a.text&&n.push({selector:a.selector,details:`text: "${nr(o.text,60)}" \u2192 "${nr(a.text,60)}"`})}return{queryType:"text",matches:n}}function or(t,e){let n=[];for(let[l,a]of Object.entries(e.elements)){let o=t.elements[l];if(!o)continue;let i=new Set([...Object.keys(o.dataAttrs),...Object.keys(a.dataAttrs)]),s=[];for(let c of i){let u=o.dataAttrs[c]??"",g=a.dataAttrs[c]??"";u!==g&&s.push(`${c}: "${u}" \u2192 "${g}"`)}s.length>0&&n.push({selector:a.selector,details:s.join("; ")})}return{queryType:"attributes",matches:n}}function nr(t,e){return t.length<=e?t:t.slice(0,e-1)+"\u2026"}var cr=new Set(["style_query","style_diff","element_info","html_diff","html_query"]);async function Ya(t,e){let n=Rt(t,e),l=p=>{let w=sr(n,p);if(!lr(w))return null;try{return JSON.parse(ir(w,"utf-8"))}catch{return null}},a=p=>{let w=sr(n,p);if(!lr(w))return null;try{return ir(w,"utf-8")}catch{return null}},o=l("baseline.json"),i=l("verify-after.json"),s=l("verify-diff.json"),c=a("verify-console.txt"),u=l("verify-all-styles.json"),g=l("baseline-page.json");if(u?.elements&&g?.elements)for(let[p,w]of Object.entries(u.elements)){let _=g.elements[p];_?.after&&(w.baseline=_.after)}return{taskId:e,baseline:o?.computedStyles??null,after:i?.computedStyles??null,diff:s?.stylesChanged??null,consoleText:c,baselineHtml:o?.outerHTML??null,afterHtml:i?.outerHTML??null,selector:i?.selector??null,position:i?.position??null,allStyles:u,pageBaseline:g}}function Ga(t,e){if(t.allStyles){let o=t.allStyles,i=[];for(let[,s]of Object.entries(o.elements)){let c=s.baseline?.[e]??null,u=s.after?.[e]??null;c!==u&&(c!==null||u!==null)&&i.push({selector:s.selector,tag:s.tag,childCount:s.childCount,from:c??"(not set)",to:u??"(not set)",isRelevant:!!(c==="hidden"&&u==="auto"||c==="visible"&&u==="auto"||c==="line-through"&&u==="none"||c==="none"&&u&&u!=="none")})}return{ok:!0,tool:"style_query",taskId:t.taskId,property:e,matches:i}}if(!t.after)return{ok:!1,error:"No verify-after.json found. Run 'vibeflow verify <task-id>' first."};let n=t.baseline?.[e]??t.baseline?.[vt(e)]??null,l=t.after?.[e]??t.after?.[vt(e)]??null,a=t.diff?.[e]!==void 0||t.diff?.[vt(e)]!==void 0;return{ok:!0,tool:"style_query",taskId:t.taskId,property:e,baseline:n,after:l,changed:a}}function Qa(t,e){if(!t.diff)return{ok:!1,error:"No verify-diff.json found. Run 'vibeflow verify <task-id>' first."};let n=Object.entries(t.diff),l=e?n.filter(([o])=>o.toLowerCase().includes(e.toLowerCase())):n,a=Object.fromEntries(l);return{ok:!0,tool:"style_diff",taskId:t.taskId,filter:e??null,total:n.length,matched:l.length,styles:a}}function Xa(t){if(!t.after)return{ok:!1,error:"No verify-after.json found. Run 'vibeflow verify <task-id>' first."};let e=t.consoleText&&!t.consoleText.includes("no console errors")&&t.consoleText.trim().length>0;return{ok:!0,tool:"element_info",taskId:t.taskId,selector:t.selector,position:t.position,consoleErrors:e?t.consoleText.split(`
1771
+ `).filter(Boolean):[]}}function Ja(t){if(!t.afterHtml)return{ok:!1,error:"No after HTML found. Run 'vibeflow verify <task-id>' first."};let e=t.baselineHtml!==t.afterHtml;return{ok:!0,tool:"html_diff",taskId:t.taskId,htmlChanged:e,baselineChars:t.baselineHtml?.length??0,afterChars:t.afterHtml?.length??0,baselineHtml:t.baselineHtml,afterHtml:t.afterHtml}}async function ur(t,e,n,l={}){let a=Ka(t),o=n[0];if(!o){let u=`Usage: vibeflow verify ${e} <task-id> ${e==="style_query"?"<property>":""}`;l.json?console.log(JSON.stringify({ok:!1,error:u})):process.stderr.write(`\u2717 ${u}
1772
+ `),process.exitCode=1;return}if(!q(a,o)){let u=`Task not found: ${o}`;l.json?console.log(JSON.stringify({ok:!1,error:u})):process.stderr.write(`\u2717 ${u}
1773
+ `),process.exitCode=1;return}let s=await Ya(a,o),c;switch(e){case"style_query":{let u=n[1];if(!u){c={ok:!1,error:"Usage: vibeflow verify style_query <task-id> <property>"};break}c=Ga(s,u);break}case"style_diff":c=Qa(s,l.filter);break;case"element_info":c=Xa(s);break;case"html_diff":c=Ja(s);break;case"html_query":{let u=n[1];if(!u||!["children","text","attributes"].includes(u)){c={ok:!1,error:"Usage: vibeflow verify html_query <task-id> children|text|attributes"};break}c=Za(s,u);break}default:c={ok:!1,error:`Unknown tool: ${e}`};break}if(l.json)console.log(JSON.stringify(c,null,2));else{if(!c.ok){process.stderr.write(`\u2717 ${c.error}
1774
+ `);return}console.log(JSON.stringify(c,null,2))}}function Za(t,e){if(!t.allStyles)return{ok:!1,error:"No verify-all-styles.json found. Run 'vibeflow verify <task-id>' first."};let n=t.allStyles,l=t.pageBaseline?t.pageBaseline:{version:1,capturedAt:n.capturedAt,truncated:!1,elements:{}},a;switch(e){case"children":a=rr(l,n);break;case"text":a=ar(l,n);break;case"attributes":a=or(l,n);break}return{ok:!0,tool:"html_query",taskId:t.taskId,...a}}function vt(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}var yt="https://app.vibeflow.tools";function Ye(){let t=process.env.VIBEFLOW_API_URL??yt;try{let e=new URL(t);return e.protocol!=="https:"&&e.protocol!=="http:"?yt:t.replace(/\/+$/,"")}catch{return yt}}var eo={backlog:"backlog",todo:"todo","in-progress":"in_progress",review:"review",done:"done"},to={backlog:"backlog",todo:"todo",in_progress:"in-progress",review:"review",done:"done",cancelled:"done"};function fe(t){return to[t]??"todo"}function no(t){return eo[t]??"todo"}async function Ge(){let t=await ue();return t?{Authorization:`Bearer ${t}`}:null}async function Ie(t){let e=await Ge();if(!e)return{ok:!1,error:{code:"NOT_AUTHENTICATED",message:"Not logged in"}};let n=Ye(),l=new URL(`${n}/api/cli/tasks`);t&&l.searchParams.set("boardId",t);try{let a=await fetch(l.toString(),{headers:e});return a.ok?{ok:!0,data:await a.json()}:{ok:!1,error:{code:"HTTP_ERROR",message:`HTTP ${a.status}`,status:a.status}}}catch(a){return{ok:!1,error:{code:"NETWORK_ERROR",message:a instanceof Error?a.message:String(a)}}}}async function dr(t){let e=await Ie();return e.ok?e.data.tasks.find(n=>n.id===t)??null:null}async function xt(t,e){let n=await Ge();if(!n)return{ok:!1,error:{code:"NOT_AUTHENTICATED",message:"Not logged in"}};let l={};e.status!==void 0&&(l.status=no(e.status)),e.title!==void 0&&(l.title=e.title),e.description!==void 0&&(l.description=e.description),e.priority!==void 0&&(l.priority=e.priority),e.branchName!==void 0&&(l.branchName=e.branchName);try{let a=await fetch(`${Ye()}/api/cli/tasks/${encodeURIComponent(t)}`,{method:"PATCH",headers:{...n,"Content-Type":"application/json"},body:JSON.stringify(l)});if(!a.ok)return{ok:!1,error:{code:"HTTP_ERROR",message:(await a.json().catch(()=>({}))).error??`HTTP ${a.status}`,status:a.status}};let o=await a.json();return{ok:!0,data:{task:o.task,warning:o.warning}}}catch(a){return{ok:!1,error:{code:"NETWORK_ERROR",message:a instanceof Error?a.message:String(a)}}}}async function pr(t,e){let n=await Ge();if(!n)return{ok:!1,error:{code:"NOT_AUTHENTICATED",message:"Not logged in"}};try{let l=await fetch(`${Ye()}/api/cli/tasks/${encodeURIComponent(t)}/comments`,{method:"POST",headers:{...n,"Content-Type":"application/json"},body:JSON.stringify({body:e})});return l.ok?{ok:!0,data:(await l.json()).comment}:{ok:!1,error:{code:"HTTP_ERROR",message:(await l.json().catch(()=>({}))).error??`HTTP ${l.status}`,status:l.status}}}catch(l){return{ok:!1,error:{code:"NETWORK_ERROR",message:l instanceof Error?l.message:String(l)}}}}async function fr(t){let e=await Ge();if(!e)return{ok:!1,error:{code:"NOT_AUTHENTICATED",message:"Not logged in"}};try{let n=await fetch(`${Ye()}/api/cli/tasks`,{method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t)});return n.ok?{ok:!0,data:(await n.json()).task}:{ok:!1,error:{code:"HTTP_ERROR",message:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`,status:n.status}}}catch(n){return{ok:!1,error:{code:"NETWORK_ERROR",message:n instanceof Error?n.message:String(n)}}}}import{readFileSync as Ir,existsSync as Rr,unlinkSync as vo}from"fs";import{resolve as B,join as yo,basename as kr}from"path";import r from"chalk";import{createHash as ro,randomUUID as ao}from"crypto";import{existsSync as oo,readFileSync as io,writeFileSync as lo,mkdirSync as so,renameSync as co}from"fs";import{join as gr}from"path";import mr from"os";import{PostHog as uo}from"posthog-node";var po="phc_C9AUV3rnayLfVvxgHtvj6AXcwsd8FKWUfJ9262zWsCvM",fo="https://eu.i.posthog.com";function br(){return gr(process.env.HOME??mr.homedir(),".vibeflow")}function hr(){return gr(br(),"config.json")}function Qe(){try{return JSON.parse(io(hr(),"utf-8"))}catch{return{}}}function vr(t){let e=br();oo(e)||so(e,{recursive:!0});let n=Qe(),l=hr(),a=l+".tmp";lo(a,JSON.stringify({...n,...t},null,2),"utf-8"),co(a,l)}function yr(){return process.env.VIBEFLOW_TELEMETRY==="0"?!1:Qe().disabled!==!0}function kt(t){vr({disabled:!t})}function xr(){let t=yr(),e=Qe();return{enabled:t,anonymousId:e.anonymousId??null}}function go(){let t=Qe();if(t.anonymousId)return t.anonymousId;let e=ao();return vr({anonymousId:e}),e}function mo(){let t=mr.userInfo().username;return ro("sha256").update(t).digest("hex").slice(0,16)}var Re=null;function bo(){return yr()?(Re||(Re=new uo(po,{host:fo,flushAt:1,flushInterval:0})),Re):null}function ne(t,e){let n=bo();if(!n)return;let l=go();n.capture({distinctId:l,event:t,properties:{...e,$user_id:mo()}})}async function Q(){if(!Re)return;let t=Re;Re=null;try{await t.shutdown(2e3)}catch{}}function xo(t,e){let n=u=>u.replace(/[^0-9.]/g,"").split(".").map(Number),[l=0,a=0,o=0]=n(t),[i=0,s=0,c=0]=n(e);return l!==i?l>i:a!==s?a>s:o>c}var wr=!1;function ko(){if(!wr){wr=!0;try{let t=qe(je()??"");t&&(console.log(t),console.log())}catch{}}}function wo(t=!0){let e="0.12.0";if(!e)return;let n="@vibeflow-tools/cli";import("https").then(({default:l})=>{let a=l.get(`https://registry.npmjs.org/${encodeURIComponent(n)}/latest`,{timeout:5e3},o=>{let i="";o.on("data",s=>{i+=s.toString()}),o.on("end",()=>{try{let{version:s}=JSON.parse(i);s&&xo(s,e)&&(console.log(),console.log(r.bgYellow.black.bold(` \u2191 Update available: ${e} \u2192 ${s} `)),console.log(r.dim(" Run: ")+r.cyan(`npm install -g ${n}@${s}`)+r.dim(" to update")),console.log(),t&&ko())}catch{}})});a.on("error",()=>{}),a.on("timeout",()=>{a.destroy()})}).catch(()=>{})}Dt();var we={backlog:r.gray,todo:r.yellow,"in-progress":r.blue,review:r.magenta,done:r.green},So=new Set(["Task","Bug","Research"]),Xe=J,ke=(t,e)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime();function Sr(t){let e=n=>t.filter(l=>l.status===n).length;return` Total: ${t.length} | Backlog: ${e("backlog")} | Todo: ${e("todo")} | In Progress: ${e("in-progress")} | Review: ${e("review")} | Done: ${e("done")}`}function _o(t){if(t){for(let e of So)if(e.toLowerCase()===t.toLowerCase())return e}}var _r=["in-progress","review","todo","backlog","done"];function Je(t){let e=_r.indexOf(t);return e===-1?_r.length:e}function Cr(t){try{return St("git",["push"],{cwd:t,stdio:"inherit"}),{ok:!0}}catch{try{let e=jr("git rev-parse --abbrev-ref HEAD",{cwd:t}).toString().trim();return St("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 Ne(t){let e=Et(t);for(let n of e.split(`
1775
+ `))n.startsWith("Agent instructions")?console.log(r.bold(n)):n.startsWith(" \u26A0")?console.log(r.yellow(n)):n.startsWith(" CRITICAL:")?console.log(r.red(n)):console.log(r.dim(n))}var Tr=["Task","Bug","Feature","Enhancement","Research"];function U(t,e){switch(t){case"add":return["set status to in-progress before implementation","add a description"];case"set-status:in-progress":return["implement the change","run tests",`commit with vibeflow tasks --commit --task ${e} --message "..."`,"set review status"];case"set-status:review":return["only humans mark done after reviewing"];case"commit":return['set review status with vibeflow tasks --edit <id> --set-status review --comment "what changed and why"']}}function wt(t,e){if(e.length===0)return t;let n={};for(let l of e)l in t&&(n[l]=t[l]);return n}function re(t){let e=t.slice(0,3).join(", ");console.log(r.cyan(` \u2192 Next: ${e}`))}var Er=t=>t.trim().toLowerCase();function Ze(t){if(t.json){let e={ok:!1,error:{code:t.code,message:t.message,retryable:t.retryable??!1,...t.suggestion?{suggestion:t.suggestion}:{}}};process.stderr.write(JSON.stringify(e)+`
1776
+ `)}else process.stderr.write(r.red(`\u2717 ${t.message}
1777
+ `)),t.suggestion&&process.stderr.write(r.dim(` ${t.suggestion}
1778
+ `))}function De(t,e){let n=Er(e);return n?Er(t??"")===n:!0}function Co(t){return[...new Set(t.map(e=>e.author?.trim()).filter(e=>!!e))].sort((e,n)=>e.localeCompare(n))}function et(t){return Tr.map(e=>e.toLowerCase()).includes(t.toLowerCase())?!0:(console.log(r.red(`\u2717 Invalid type filter: "${t}"`)),console.log(r.yellow(` Available types: ${Tr.join(" | ")}`)),console.log(r.dim(" Type filter is exact (example: --type Bug)")),process.exitCode=A.USAGE,!1)}function Me(t,e){let n=Co(e);return n.length===0?(console.log(r.red("\u2717 Cannot filter by user: no task authors are available on this board.")),process.exitCode=A.USAGE,!1):n.some(l=>De(l,t))?!0:(console.log(r.red(`\u2717 User not found: "${t}"`)),console.log(r.yellow(` Available users: ${n.join(" | ")}`)),console.log(r.dim(" User filter is exact email match (case-insensitive).")),process.exitCode=A.USAGE,!1)}function To(t,e,n,l,a){let o=we[t.status]??r.white;if(console.log(` ${r.dim(`${n+1}.`)} ${o(`[${e.status}]`)} ${e.title}`),console.log(r.dim(` id: ${e.id}`)),console.log(r.dim(` file: ${t.filePath}`)),e.file&&console.log(r.dim(` source: ${e.file}${e.line==null?"":`:${e.line}`}${e.col==null?"":`:${e.col}`}`)),e.component&&console.log(r.dim(` component: ${e.component}`)),console.log(r.dim(` selector: ${e.selector}`)),t.cssSelector&&console.log(r.dim(` css: ${t.cssSelector}`)),e.url&&console.log(r.dim(` url: ${e.url}`)),t.screenshot&&console.log(r.dim(` screenshot: http://localhost:${l}/screenshots/${t.screenshot}`)),t.commits&&t.commits.length>0)if(t.commits.length===1)console.log(r.dim(` commit: ${t.commits[0].sha}`));else{console.log(r.dim(` commits (${t.commits.length}):`));for(let i of t.commits)console.log(r.dim(` ${i.sha.slice(0,8)} ${i.timestamp} ${i.message.slice(0,60)}`))}if(t.branchName&&console.log(r.dim(` branch: ${t.branchName}`)),console.log(r.dim(` created: ${e.created}`)),e.type&&console.log(r.dim(` type: ${e.type}`)),e.priority&&console.log(r.dim(` priority: ${e.priority}`)),e.description){console.log(r.dim(" description:"));for(let i of e.description.split(`
1779
+ `))console.log(r.dim(` ${i}`))}if(e.structuredComments&&e.structuredComments.length>0){console.log(r.dim(` comments (${e.structuredComments.length}):`));for(let i of e.structuredComments){let s=i.updatedAt?` (edited ${i.updatedAt})`:"";console.log(r.dim(` [${i.author??"agent"}] ${i.createdAt}${s}`));for(let c of i.text.split(`
1780
+ `))console.log(r.dim(` ${c}`))}}if(e.linkedFiles&&e.linkedFiles.length>0){console.log(r.dim(` linked files (${e.linkedFiles.length}):`));for(let i of e.linkedFiles){let s=i.linkedPath??yo(a,".vibeflow","files",t.id,i.name);if(console.log(r.dim(` - ${i.name} ${i.url}`)),/\.(md|txt)$/i.test(i.name)&&i.size<1e5&&Rr(s))try{let c=Ir(s,"utf-8");console.log(r.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let u of c.split(`
1781
+ `))console.log(r.dim(` \u2502 ${u}`));console.log(r.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}catch{}}}console.log()}var W=new ho;W.name("vibeflow").description("Vibeflow \u2014 CLI tool for frontend prototyping with LLM assistance").version("0.12.0");W.addHelpText("after",`
1790
1782
  ${"\u2500".repeat(60)}
1791
1783
  For coding agents \u2014 quick reference:
1792
1784
 
@@ -1821,17 +1813,17 @@ File attachments:
1821
1813
  <file binary body>
1822
1814
  List: GET /api/tasks/<id>/files
1823
1815
  Delete: DELETE /api/tasks/<id>/files/<filename>
1824
- `);J.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)=>{ce("command_run",{command:"serve"}),await se(),await Lt(t,{port:parseInt(e.port,10),host:e.host,open:e.open})});J.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").option("--no-changelog","Do not show the changelog with the update notice").action(async(t,e)=>{ce("command_run",{command:"kanban"}),await se();let n=parseInt(e.port,10),i=await Lt(void 0,{port:n,host:e.host,open:!1,projectDir:W(t),noCtrlCHint:!0}),l=i.url+"/kanban";console.log(),console.log(a.green(" \u2713 Kanban board ready")),console.log(a.dim(" ")+a.cyan(l)),i.localUrl&&console.log(a.dim(" ")+a.cyan(`${i.localUrl}/kanban`)),console.log(),console.log(a.bold("Agent prompt:")),console.log(a.dim(" Get new tasks and implement them, once done check again for new ones:")),console.log(a.dim(" ")+a.green("npx @vibeflow-tools/cli tasks --next")),console.log(),console.log(a.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then(o=>o.default(l)).catch(()=>{console.log(a.dim(" Visit: ")+a.cyan(l))}),ki(e.changelog!==!1)});J.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)").option("--dry-run","Preview what would change without modifying anything (mutations only)").option("--fields <fields>","Comma-separated list of fields to include in output (list/get modes)").action((t,e)=>{(async()=>{let n=e.add?"add":e.next?"next":e.edit?"edit":e.get?"get":"list";if(ce("command_run",{command:"tasks",subcommand:n}),e.get){if(await Te()==="saas"){let v=await oe(),R=await Oe(v?.id);if(!R){console.log(a.red("\u2717 Unable to reach the online backend.")),process.exitCode=O.GENERAL;return}let _=R.tasks.find(H=>H.id===e.get||H.id.startsWith(e.get));if(!_){console.log(a.red(`\u2717 Task not found: ${e.get}`)),process.exitCode=O.NOT_FOUND;return}let M=ve(_.status);if(e.json){console.log(JSON.stringify({..._,status:M},null,2));return}let F=Ie[M]??a.white;if(console.log(` ${F(`[${M}]`)} ${a.bold(_.title)}`),console.log(a.dim(` id: ${_.id}`)),console.log(a.dim(" selector: /")),_.type&&console.log(a.dim(` type: ${_.type}`)),_.priority&&console.log(a.dim(` priority: ${_.priority}`)),console.log(a.dim(` created: ${_.createdAt}`)),_.description){console.log(a.dim(" description:"));for(let H of _.description.split(`
1825
- `))console.log(a.dim(` ${H}`))}_.annotatedElementText&&console.log(a.dim(` element text: ${_.annotatedElementText}`)),_.branchName&&console.log(a.dim(` branch: ${_.branchName}`));let A=[..._.comments??[]].sort(je);if(A.length>0){console.log(a.dim(` comments (${A.length}):`));for(let H of A){console.log(a.dim(` [${H.author??"agent"}] ${H.createdAt}`));for(let ke of H.body.split(`
1826
- `))console.log(a.dim(` ${ke}`))}}if(_.files&&_.files.length>0){console.log(a.dim(` linked files (${_.files.length}):`));for(let H of _.files){let ke=H.url??`${process.env.VIBEFLOW_API_URL??"https://app.vibeflow.tools"}/api/tasks/${_.id}/files/${encodeURIComponent(H.name)}`;if(console.log(a.dim(` - ${H.name} ${ke}`)),H.content){console.log(a.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let we of H.content.split(`
1827
- `))console.log(a.dim(` \u2502 ${we}`));console.log(a.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}let ye=ne(W(t)),xe=(_.type??"").toLowerCase()==="research",de=(_.type??"").toLowerCase()==="bug";Ae({hasResearchTasks:xe,hasBugTasks:de,autoCommit:ye.autoCommit,autoPush:ye.autoPush,autoComment:ye.autoComment,createBranch:ye.createBranch});return}let p=W(t),f=Le(p),x=ae(p).find(v=>v.id===e.get||v.id.startsWith(e.get));if(!x){dt({code:"E_NOT_FOUND",message:`Task not found: ${e.get}`,suggestion:"Run 'vibeflow tasks' to see available task IDs.",json:e.json}),process.exitCode=O.NOT_FOUND;return}let E=pe(p,x.id).sort(je),T=te(p,x.id).map(v=>({...v,url:`http://localhost:${f.port}${v.url}`}));if(e.json){let v=e.fields?e.fields.split(",").map(R=>R.trim()).filter(Boolean):[];console.log(JSON.stringify(Bt({...x,comments:E,files:T},v),null,2));return}let C=Ie[x.status]??a.white,k=Me(x,x.filePath,E,T,p).split(`
1828
- `);if(k.length>0){let v=k[0],R=v.match(/^\[(\w+)\]\s+(.+)$/);console.log(R?` ${C(`[${R[1]}]`)} ${a.bold(R[2])}`:a.dim(v));for(let _=1;_<k.length;_++)console.log(a.dim(k[_]))}let I=ne(p),N=(x.type??"").toLowerCase()==="research",P=(x.type??"").toLowerCase()==="bug";Ae({hasResearchTasks:N,hasBugTasks:P,autoCommit:I.autoCommit,autoPush:I.autoPush,autoComment:I.autoComment,createBranch:I.createBranch});return}if(e.next){if(await Te()==="saas"){let _=await oe(),M=await Oe(_?.id);if(!M){console.log(a.red("\u2717 Unable to reach the online backend.")),process.exitCode=O.GENERAL;return}if(e.type&&!pt(e.type))return;let F=M.tasks.map(D=>({...D,status:ve(D.status)})).filter(D=>D.status==="todo");if(e.type&&(F=F.filter(D=>(D.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!He(e.user,F))return;if(e.user&&(F=F.filter(D=>$e(D.author,e.user))),e.tag&&e.tag.length>0&&(F=F.filter(D=>e.tag.every(Se=>(D.tags??[]).includes(Se)))),F=F.sort((D,Se)=>{let We=_e(D.priority??void 0)-_e(Se.priority??void 0);return We!==0?We:je(D,Se)}),F.length===0){let D=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),Se=D.length>0?` matching ${D.join(" ")}`:"";console.log(a.dim(`No todo tasks found${Se}. Nothing to work on.`));return}let A=F[0];if(!await Dt(A.id,{status:"in-progress"})){console.log(a.red(`\u2717 Failed to move task to in-progress: ${A.id}`)),process.exitCode=O.GENERAL;return}let xe=X("set-status:in-progress",A.id);if(e.json){console.log(JSON.stringify({success:!0,task:{...A,status:"in-progress"},next_actions:xe},null,2));return}let de=ne(W(t)),H=(A.type??"").toLowerCase()==="research",ke=(A.type??"").toLowerCase()==="bug";if(Ae({hasResearchTasks:H,hasBugTasks:ke,autoCommit:de.autoCommit,autoPush:de.autoPush,autoComment:de.autoComment,createBranch:de.createBranch}),console.log(a.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log(),console.log(` ${a.blue("[in-progress]")} ${a.bold(A.title)}`),console.log(a.dim(` id: ${A.id}`)),A.type&&console.log(a.dim(` type: ${A.type}`)),A.priority&&console.log(a.dim(` priority: ${A.priority}`)),console.log(a.dim(` created: ${A.createdAt}`)),A.description){console.log(a.dim(" description:"));for(let D of A.description.split(`
1829
- `))console.log(a.dim(` ${D}`))}let we=[...A.comments??[]].sort(je);if(we.length>0){console.log(a.dim(` comments (${we.length}):`));for(let D of we){let Se=D.authorId?`user:${D.authorId.slice(0,8)}`:"agent";console.log(a.dim(` [${Se}] ${D.createdAt}`));for(let We of D.body.split(`
1830
- `))console.log(a.dim(` ${We}`))}}console.log(),console.log(a.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done.")),ue(xe);return}let p=W(t),f=ae(p);if(e.type&&!pt(e.type))return;let y=f.filter(_=>_.status==="todo");if(e.type&&(y=y.filter(_=>(_.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!He(e.user,y))return;if(e.user&&(y=y.filter(_=>$e(_.author,e.user))),e.tag&&e.tag.length>0&&(y=y.filter(_=>e.tag.every(M=>(_.tags??[]).includes(M)))),y=y.sort((_,M)=>{let F=_e(_.priority)-_e(M.priority);return F!==0?F:new Date(_.created).getTime()-new Date(M.created).getTime()}),y.length===0){let _=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),M=_.length>0?` matching ${_.join(" ")}`:"";console.log(a.dim(`No todo tasks found${M}. Nothing to work on.`));return}let x=y[0],E=B(p,x.id,{status:"in-progress"});if(!E){console.log(a.red(`\u2717 Failed to update task: ${x.id}`)),process.exitCode=O.GENERAL;return}let T=X("set-status:in-progress",E.id);if(e.json){console.log(JSON.stringify({success:!0,task:{...E,filePath:x.filePath},next_actions:T},null,2));return}let C=ne(p),w=(E.type??"").toLowerCase()==="research",k=(E.type??"").toLowerCase()==="bug";Ae({hasResearchTasks:w,hasBugTasks:k,autoCommit:C.autoCommit,autoPush:C.autoPush,autoComment:C.autoComment,createBranch:C.createBranch});let I=Le(p),N=pe(p,E.id).sort(je),P=te(p,E.id).map(_=>({..._,url:`http://localhost:${I.port}${_.url}`})),v=Me(E,x.filePath,N,P,p);console.log(a.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log();let R=v.split(`
1831
- `);if(R.length>0){let _=R[0].match(/^\[(\w+)\]\s+(.+)$/);console.log(_?` ${a.blue(`[${_[1]}]`)} ${a.bold(_[2])}`:a.dim(R[0]));for(let M=1;M<R.length;M++)console.log(a.dim(R[M]))}console.log(),console.log(a.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done.")),ue(T);return}if(e.add){if(!e.title?.trim()){dt({code:"E_USAGE",message:"--title is required with --add",suggestion:'Example: vibeflow tasks --add --title "Fix CTA spacing" --description "Button overflows on mobile"',json:e.json}),process.exitCode=O.USAGE;return}if(await Te()==="saas"){let T=await oe(),w=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",k=gt();if(e.dryRun){let P={id:k,title:e.title.trim(),description:e.description?.trim()??"",status:w,boardId:T?.id};e.json?console.log(JSON.stringify({dryRun:!0,action:"create",task:P,next_actions:X("add",k)},null,2)):(console.log(a.yellow(" [dry-run] Would create task:")),console.log(a.dim(` title: ${P.title}`)),console.log(a.dim(` status: ${P.status}`)),P.description&&console.log(a.dim(` description: ${P.description}`)),ue(X("add",k)));return}let I=await $r({id:k,title:e.title.trim(),description:e.description?.trim(),status:w,boardId:T?.id});if(!I){console.log(a.red("\u2717 Failed to create task in online board.")),console.log(a.yellow(" Check your connection or run 'vibeflow login'.")),process.exitCode=O.GENERAL;return}let N=X("add",I.id);e.json?console.log(JSON.stringify({success:!0,task:I,next_actions:N},null,2)):(console.log(a.green(`\u2713 Task created: ${I.title}`)),console.log(a.dim(` id: ${I.id} | status: ${ve(I.status)}`)),ue(N));return}let p=W(t);Ee(p);let y=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo";if(e.dryRun){let T=gt(),C={id:T,title:e.title.trim(),description:e.description?.trim()??"",status:y,selector:"/"};e.json?console.log(JSON.stringify({dryRun:!0,action:"create",task:C,next_actions:X("add",T)},null,2)):(console.log(a.yellow(" [dry-run] Would create task:")),console.log(a.dim(` title: ${C.title}`)),console.log(a.dim(` status: ${C.status}`)),C.description&&console.log(a.dim(` description: ${C.description}`)),ue(X("add",T)));return}let x=Ne(p,{title:e.title.trim(),description:e.description?.trim()??"",status:y,selector:"/"}),E=X("add",x.id);e.json?console.log(JSON.stringify({success:!0,task:x,next_actions:E},null,2)):(console.log(a.green(`\u2713 Task created: ${x.title}`)),console.log(a.dim(` id: ${x.id} | status: ${x.status}`)),ue(E));return}if(e.commit){if(!e.task){dt({code:"E_USAGE",message:"--task <task-id> is required with --commit",suggestion:'Example: vibeflow tasks --commit --task abc12345 --message "fix button alignment"',json:e.json}),process.exitCode=O.USAGE;return}let m=W(t),f=re(m).find(E=>E.id===e.task||E.id.startsWith(e.task));if(!f){dt({code:"E_NOT_FOUND",message:`Task not found: ${e.task}`,suggestion:"Run 'vibeflow tasks' to see available task IDs.",json:e.json}),process.exitCode=O.NOT_FOUND;return}let y=e.message?.trim()||f.title;if(e.dryRun){let E=`${y} [proto:${f.id}]`;e.json?console.log(JSON.stringify({dryRun:!0,action:"commit",message:E,taskId:f.id,next_actions:X("commit",f.id)},null,2)):(console.log(a.yellow(" [dry-run] Would commit:")),console.log(a.dim(` message: ${E}`)),console.log(a.dim(` task: ${f.id}`)),ue(X("commit",f.id)));return}(f.type??"").toLowerCase()==="research"&&(console.log(a.yellow("\u26A0 WARNING: This is a Research task. Research tasks must NOT produce code changes.")),console.log(a.yellow(" Only commit research report files (.md). Do not commit code changes.")),console.log());let x=`${y} [proto:${f.id}]`;try{ft("git",["commit","-m",x],{cwd:m,stdio:"inherit"});let E=Ut("git rev-parse HEAD",{cwd:m}).toString().trim(),T={sha:E,message:y,timestamp:new Date().toISOString()},C=f.commits??[];B(m,f.id,{commits:[...C,T]});let w=X("commit",f.id);if(e.json?console.log(JSON.stringify({success:!0,commit:E,next_actions:w},null,2)):(console.log(a.green(`\u2713 Committed and linked to task: ${f.title}`)),console.log(a.dim(` commit: ${E}`)),console.log(a.dim(` proto: ${f.id}`)),ue(w)),ne(m).autoPush){console.log(a.dim(" auto-push: pushing commit to remote..."));let I=Yr(m);I.ok?console.log(a.green("\u2713 Auto-push complete")):(console.log(a.yellow("\u26A0 Auto-push failed. Commit is local; run 'git push' manually.")),I.error&&console.log(a.dim(` reason: ${I.error}`)))}}catch{console.log(a.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=O.GENERAL}return}if(e.edit!==void 0){let m=typeof e.edit=="string"?e.edit:void 0,p=e.title||e.setStatus||e.description;if(!m||!p){if(e.type&&!pt(e.type))return;let w=re(t);if(e.status&&(w=w.filter(k=>k.status===e.status)),e.type&&(w=w.filter(k=>(k.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!He(e.user,w))return;if(e.user&&(w=w.filter(k=>$e(k.author,e.user))),e.tag&&e.tag.length>0&&(w=w.filter(k=>e.tag.every(I=>(k.tags??[]).includes(I)))),console.log(a.bold("vibeflow tasks --edit \u2014 LLM Usage Instructions")),console.log(),console.log("Edit a task:"),console.log(a.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(a.dim(" vibeflow tasks --edit abc12345 --set-status done")),console.log(a.dim(" vibeflow tasks --edit abc12345 --set-status in-progress")),console.log(a.dim(' vibeflow tasks --edit abc12345 --title "Updated title" --description "More detail"')),console.log(),w.length===0)console.log(a.dim("No tasks found."));else{console.log("Available tasks:");for(let k of w){let I=Ie[k.status]??a.white;console.log(` ${I(`[${k.status}]`)} ${a.bold(k.id)} \u2014 ${k.title}`)}}return}if(e.setStatus==="done"&&(console.log(a.yellow('\u26A0 WARNING: Agents should NEVER set a task status to "done".')),console.log(a.yellow(" Only humans should mark tasks as done after reviewing.")),console.log(a.dim(" If you are an agent, use --set-status review instead.")),console.log()),e.setStatus&&!ct.includes(e.setStatus)){console.log(a.red(`\u2717 Invalid status: "${e.setStatus}"`)),console.log(a.yellow(` Valid statuses: ${ct.join(" | ")}`)),console.log(a.dim(` Example: vibeflow tasks --edit ${m} --set-status in-progress`)),process.exitCode=O.USAGE;return}if(e.setStatus==="review"&&!e.comment?.trim()){console.log(a.red("\u2717 --comment is required when setting status to review")),console.log(a.dim(" Provide a concise implementation report explaining:")),console.log(a.dim(" \xB7 what was changed and why")),console.log(a.dim(" \xB7 key decisions and trade-offs")),console.log(a.dim(" \xB7 anything future agents should know")),console.log(a.dim(` Example: vibeflow tasks --edit ${m} --set-status review --comment "Implemented X by doing Y. Key decision: Z."`)),process.exitCode=O.USAGE;return}let f=await Te();if(e.setStatus==="review"){let w=W(t),k=ne(w);if(k.autoComment&&!e.comment?.trim()){console.log(a.red("\u2717 --comment is required (auto-comment setting is ON)")),console.log(a.dim(" Provide: what changed, why, key decisions, anything future agents should know.")),console.log(a.dim(" Plain text for short notes; Markdown for multi-section reports.")),console.log(a.dim(` Example: vibeflow tasks --edit ${m} --set-status review --comment "Implemented X by doing Y."`)),process.exitCode=O.USAGE;return}if(k.autoCommit&&!e.commitMessage?.trim()){console.log(a.red("\u2717 --commit-message is required (auto-commit setting is ON)")),console.log(a.dim(" Stage your changes first, then provide a one-line commit summary.")),console.log(a.dim(` Example: vibeflow tasks --edit ${m} --set-status review --commit-message "fix: add hover effect" --comment "..."`)),process.exitCode=O.USAGE;return}if(k.createBranch&&!e.branch?.trim()){console.log(a.red("\u2717 --branch is required (create-branch setting is ON)")),console.log(a.dim(" Provide the git branch name created for this task.")),console.log(a.dim(` Example: vibeflow tasks --edit ${m} --set-status review --branch feat/add-hover-effect --comment "..."`)),process.exitCode=O.USAGE;return}}if(f==="saas"){let w={};if(e.setStatus&&(w.status=e.setStatus),e.title&&(w.title=e.title),e.description&&(w.description=e.description),e.branch&&(w.branchName=e.branch),e.setStatus==="in-progress"){let N=await Or(m);if(N&&ve(N.status)==="in-progress"){let P=N.author??"another user";console.log(a.yellow(`\u26A0 Task is already in-progress (last updated by: ${P})`)),console.log(a.yellow(" Another agent or user may be working on this task.")),console.log(a.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}let k=await Dt(m,w);if(!k){console.log(a.red(`\u2717 Failed to update task: ${m}`)),console.log(a.yellow(" Ensure you are connected and the task ID exists in the online board.")),process.exitCode=O.GENERAL;return}k.warning&&console.log(a.yellow(`\u26A0 Server warning: ${k.warning}`)),e.setStatus==="review"&&e.comment?.trim()&&await Ar(m,e.comment.trim())&&console.log(a.dim(" comment: added"));let I=e.setStatus?X(e.setStatus==="review"?"set-status:review":"set-status:in-progress",m):[];e.json?console.log(JSON.stringify({success:!0,task:k.task,next_actions:I},null,2)):(console.log(a.green(`\u2713 Task updated: ${k.task.title}`)),console.log(a.dim(` id: ${k.task.id} | status: ${ve(k.task.status)}`)),I.length>0&&ue(I));return}let y=W(t),x=re(y).find(w=>w.id===m||w.id.startsWith(m))?.id??m;if(e.dryRun){let w={};if(e.title&&(w.title=e.title),e.setStatus&&(w.status=e.setStatus),e.description&&(w.description=e.description),e.branch&&(w.branchName=e.branch),e.json)console.log(JSON.stringify({dryRun:!0,action:"update",taskId:x,updates:w,next_actions:e.setStatus?X(e.setStatus==="review"?"set-status:review":"set-status:in-progress",x):[]},null,2));else{console.log(a.yellow(" [dry-run] Would update task:")),console.log(a.dim(` id: ${x}`));for(let[k,I]of Object.entries(w))console.log(a.dim(` ${k}: ${I}`));e.setStatus&&ue(X(e.setStatus==="review"?"set-status:review":"set-status:in-progress",x))}return}let E={};if(e.title&&(E.title=e.title),e.setStatus&&(E.status=e.setStatus),e.description&&(E.description=e.description),e.branch&&(E.branchName=e.branch),e.setStatus==="in-progress"){let w=W(t),I=re(w).find(N=>N.id===m||N.id.startsWith(m));if(I&&((I.type??"").toLowerCase()==="research"&&(console.log(a.yellow("\u26A0 WARNING: This is a Research task. Policy: do NOT implement code.")),console.log(a.yellow(" Research only \u2014 attach a .md report file, leave a summary comment, mark as review.")),console.log()),I.status==="in-progress")){let N=I.updated?new Date(I.updated).toLocaleString():"unknown",P=I.author??"another user";console.log(a.yellow(`\u26A0 Task is already in-progress (author: ${P}, last updated: ${N})`)),console.log(a.yellow(" Another agent or user may be working on this task.")),console.log(a.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}if(e.setStatus==="review"){let w=W(t),I=re(w).find(N=>N.id===m||N.id.startsWith(m));if(I&&(I.type??"").toLowerCase()==="research"){if(e.reportFile){let N=W(e.reportFile);if(!Jr(N)){console.log(a.red(`\u2717 Report file not found: ${N}`)),process.exitCode=O.NOT_FOUND;return}if(!/\.md$/i.test(N)){console.log(a.red("\u2717 Report file must be a Markdown (.md) file")),process.exitCode=O.USAGE;return}let P=Xr(N),{saveFile:v}=await import("./files-RNEVXCMZ.js");v(w,I.id,Wr(N),P),hi(N),console.log(a.green(`\u2713 Report uploaded: ${Wr(N)} (local file removed)`))}else if(!te(w,I.id).some(v=>/\.md$/i.test(v.name))){console.log(a.red("\u2717 Cannot mark Research task as review: no .md report file attached.")),console.log(a.dim(" Provide a research report:")),console.log(a.dim(` vibeflow tasks --edit ${m} --set-status review --report-file ./my-research.md --comment "..."`)),process.exitCode=O.USAGE;return}}}let T=B(t,x,E);if(!T){console.log(a.red(`\u2717 Task not found: ${m}`)),console.log(a.yellow(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=O.NOT_FOUND;return}e.setStatus==="review"&&e.comment?.trim()&&(be(W(t),x,"agent",e.comment.trim()),console.log(a.dim(" comment: added")));let C=e.setStatus?X(e.setStatus==="review"?"set-status:review":"set-status:in-progress",x):[];if(e.json?console.log(JSON.stringify({success:!0,task:T,next_actions:C},null,2)):(console.log(a.green(`\u2713 Task updated: ${T.title}`)),console.log(a.dim(` id: ${T.id} | status: ${T.status}`)),C.length>0&&ue(C)),e.setStatus==="review"){let w=W(t),k=ne(w);if(k.autoCommit&&e.commitMessage?.trim()){let N=re(w).find(P=>P.id===m||P.id.startsWith(m));if(N){let P=`${e.commitMessage.trim()} [proto:${N.id}]`;try{ft("git",["commit","-m",P],{cwd:w,stdio:"inherit"});let v=Ut("git rev-parse HEAD",{cwd:w}).toString().trim(),R={sha:v,message:e.commitMessage.trim(),timestamp:new Date().toISOString()},_=N.commits??[];if(B(w,N.id,{commits:[..._,R]}),console.log(a.green(`\u2713 Committed: ${P}`)),console.log(a.dim(` sha: ${v}`)),k.autoPush){console.log(a.dim(" pushing..."));let M=Yr(w);M.ok?console.log(a.green("\u2713 Pushed")):(console.log(a.yellow("\u26A0 Push failed. Run 'git push' manually.")),M.error&&console.log(a.dim(` reason: ${M.error}`)))}}catch{console.log(a.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=O.GENERAL}}}}return}if(e.status&&!ct.includes(e.status)){console.log(a.red(`\u2717 Invalid status filter: "${e.status}"`)),console.log(a.yellow(` Valid statuses: ${ct.join(" | ")}`)),console.log(a.dim(" Example: vibeflow tasks --status todo")),process.exitCode=O.USAGE;return}if(e.type&&!pt(e.type))return;let i=e.fields?e.fields.split(",").map(m=>m.trim()).filter(Boolean):[];if(await Te()==="saas"){let m=await oe(),p=await Oe(m?.id);if(!p){console.log(a.red("\u2717 Unable to reach the online backend.")),console.log(a.yellow(" Check your connection or run 'vibeflow login' if your session expired.")),process.exitCode=O.GENERAL;return}let f=p.tasks.map(C=>({...C,status:ve(C.status)}));if(e.status&&(f=f.filter(C=>C.status===e.status)),e.type&&(f=f.filter(C=>(C.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!He(e.user,f))return;e.user&&(f=f.filter(C=>$e(C.author,e.user))),e.tag&&e.tag.length>0&&(f=f.filter(C=>e.tag.every(w=>(C.tags??[]).includes(w))));let y=e.limit===void 0?5:parseInt(e.limit,10);if(!isNaN(y)&&y>0&&(f=f.slice(0,y)),e.json){console.log(JSON.stringify(f.map(C=>Bt(C,i)),null,2));return}let x=f.some(C=>(C.type??"").toLowerCase()==="research"),E=f.some(C=>(C.type??"").toLowerCase()==="bug"),T=ne(W(t));if(Ae({hasResearchTasks:x,hasBugTasks:E,autoCommit:T.autoCommit,autoPush:T.autoPush,autoComment:T.autoComment,createBranch:T.createBranch}),f.length===0)console.log(a.dim("No tasks found."));else{f=f.sort((w,k)=>{let I=ut(w.status)-ut(k.status);if(I!==0)return I;let N=_e(w.priority??void 0)-_e(k.priority??void 0);return N!==0?N:new Date(k.updatedAt).getTime()-new Date(w.updatedAt).getTime()});for(let[w,k]of f.entries()){let I=Ie[k.status]??a.white,N=Si(k.type);if(console.log(` ${a.dim(`${w+1}.`)} ${I(`[${k.status}]`)} ${k.title}`),console.log(a.dim(` id: ${k.id}`)),console.log(a.dim(" selector: /")),N&&console.log(a.dim(` type: ${N}`)),k.priority&&console.log(a.dim(` priority: ${k.priority}`)),console.log(a.dim(` created: ${k.createdAt}`)),k.description){console.log(a.dim(" description:"));for(let P of k.description.split(`
1832
- `))console.log(a.dim(` ${P}`))}if(k.comments&&k.comments.length>0){let P=[...k.comments].sort(je);console.log(a.dim(` comments (${P.length}):`));for(let v of P){let R=v.authorId?`user:${v.authorId.slice(0,8)}`:"agent";console.log(a.dim(` [${R}] ${v.createdAt}`));for(let _ of v.body.split(`
1833
- `))console.log(a.dim(` ${_}`))}}if(k.files&&k.files.length>0){console.log(a.dim(` linked files (${k.files.length}):`));for(let P of k.files){let v=P.url??`${process.env.VIBEFLOW_API_URL??"https://app.vibeflow.tools"}/api/tasks/${k.id}/files/${encodeURIComponent(P.name)}`;if(console.log(a.dim(` - ${P.name} ${v}`)),P.content){console.log(a.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let R of P.content.split(`
1834
- `))console.log(a.dim(` \u2502 ${R}`));console.log(a.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}console.log()}let C=p.tasks.map(w=>({...w,status:ve(w.status)}));console.log(a.dim(qr(C)))}return}let o=ae(t);if(e.user&&!He(e.user,o))return;let r=e.status?o.filter(m=>m.status===e.status):o;e.type&&(r=r.filter(m=>(m.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&(r=r.filter(m=>$e(m.author,e.user))),e.tag&&e.tag.length>0&&(r=r.filter(m=>e.tag.every(p=>(m.tags??[]).includes(p))));let s=e.limit===void 0?5:parseInt(e.limit,10);if(e.json){console.log(JSON.stringify(r.map(m=>Bt(m,i)),null,2));return}r=r.sort((m,p)=>{let f=ut(m.status)-ut(p.status);if(f!==0)return f;let y=_e(m.priority)-_e(p.priority);if(y!==0)return y;let x=new Date(m.updated??m.created).getTime(),E=new Date(p.updated??p.created).getTime();return x!==E?E-x:m.id.localeCompare(p.id)});let c=r.length;if(!isNaN(s)&&s>0&&(r=r.slice(0,s)),r.length===0){console.log(a.dim("No tasks found."));return}let u=W(t),d=r.some(m=>(m.type??"").toLowerCase()==="research"),b=r.some(m=>(m.type??"").toLowerCase()==="bug"),g=ne(u);Ae({hasResearchTasks:d,hasBugTasks:b,autoCommit:g.autoCommit,autoPush:g.autoPush,autoComment:g.autoComment,createBranch:g.createBranch});let h=Le(u);for(let[m,p]of r.entries()){let f=pe(u,p.id).sort(je),y=te(u,p.id).map(E=>({...E,url:`http://localhost:${h.port}${E.url}`})),x=qt(p,f,y);Ci(p,x,m,h.port,u)}let j=!isNaN(s)&&s>0&&c>s?a.yellow(` (showing ${s} of ${c} matching \u2014 use --limit 0 for all)`):"";console.log(a.dim(qr(o))+j),await se()})()});J.command("login",{hidden:!0}).description("Authenticate CLI against the Vibeflow SaaS backend (device flow)").action(async()=>{ce("command_run",{command:"login"}),await se(),await rt()});J.command("logout",{hidden:!0}).description("Remove stored auth token and switch to local mode").action(async()=>{ce("command_run",{command:"logout"}),await se(),await or()});J.command("status",{hidden:!0}).description("Show login status, connection info, and task statistics").action(async()=>{if(await Te()==="local"){console.log(a.yellow("\u25CF Not logged in")+a.dim(" (local mode)")),console.log(a.dim(" Run ")+a.cyan("vibeflow login")+a.dim(" to connect to the Vibeflow cloud.")),console.log();let o=W("."),r=ae(o);if(r.length>0){let s=r.reduce((c,u)=>(c[u.status]=(c[u.status]??0)+1,c),{});console.log(a.bold(" Local task statistics:"));for(let[c,u]of Object.entries(s)){let d=Ie[c]??a.white;console.log(` ${d(c.padEnd(12))} ${u}`)}console.log(a.dim(` ${"total".padEnd(12)} ${r.length}`))}else console.log(a.dim(" No local tasks found."));return}let e=await oe();console.log(a.green("\u25CF Online")+a.dim(" (SaaS mode)")),e&&(console.log(a.dim(` Board: ${e.icon?e.icon+" ":""}${e.name}`)),e.email&&console.log(a.dim(` Email: ${e.email}`)),console.log(a.dim(" URL: ")+a.cyan(e.url))),console.log();let n=await Oe(e?.id);if(!n){console.log(a.yellow(" \u26A0 Could not reach SaaS backend. Check your connection."));return}let i=n.tasks.map(o=>({...o,status:ve(o.status)}));if(i.length===0){console.log(a.dim(" No tasks found."));return}let l=i.reduce((o,r)=>(o[r.status]=(o[r.status]??0)+1,o),{});console.log(a.bold(" Task statistics:"));for(let[o,r]of Object.entries(l)){let s=Ie[o]??a.white;console.log(` ${s(o.padEnd(12))} ${r}`)}console.log(a.dim(` ${"total".padEnd(12)} ${i.length}`))});J.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)=>{ce("command_run",{command:"push"}),await lr(t,e),await se()});J.command("watch").description("Watch the task store and print ticket details for important updates (new tasks, tasks moved to todo)").argument("[dir]","Project root directory",".").action(async t=>{ce("command_run",{command:"watch"}),await se(),cr(t)});J.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(a.yellow("Telemetry disabled. No usage data will be collected.")),console.log(a.dim("Run `vibeflow telemetry --enable` to re-enable at any time."));return}if(t.enable){Ft(!0),console.log(a.green("Telemetry enabled. Thank you for helping improve Vibeflow!"));return}let{enabled:e,anonymousId:n}=Hr(),i=process.env.VIBEFLOW_TELEMETRY==="0";console.log(a.bold("Telemetry status:")),console.log(` Enabled: ${e?a.green("yes"):a.yellow("no")}`),i&&console.log(a.dim(" (disabled via VIBEFLOW_TELEMETRY=0 environment variable)")),n&&console.log(a.dim(` Anonymous ID: ${n}`)),console.log(),console.log(a.dim(" vibeflow telemetry --disable Opt out of usage tracking")),console.log(a.dim(" vibeflow telemetry --enable Opt back in")),console.log(a.dim(" No PII is ever collected. User identity is hashed."))});J.command("auth").description("Manage stored auth state (encrypted cookies for Playwright verification)").option("--clear","Delete all per-task encrypted auth state files").option("--list","List stored auth state files and their age").action(async t=>{ce("command_run",{command:"auth"}),await se();let e=W(".");if(t.clear){let n=mr(e);console.log(n===0?a.dim(" No auth state files found. Nothing to clear."):a.green(` \u2713 Cleared ${n} auth state file(s)`));return}if(t.list){let n=br(e);if(n.length===0){console.log(a.dim(" No auth state files found."));return}console.log(a.bold(` Auth state files (${n.length}):`));for(let i of n)console.log(a.dim(` ${i.taskId} age: ${i.age} path: ${i.path}`));return}console.log(a.bold("Auth management:")),console.log(a.dim(" vibeflow auth --clear Delete all per-task encrypted auth state files")),console.log(a.dim(" vibeflow auth --list List stored auth state files and their age"))});J.command("verify").description("Verify a task against its baseline snapshot, or explore captured evidence").argument("[args...]","task-id, or a tool: style_query | style_diff | element_info | html_diff").option("--json","Output machine-readable JSON").option("--url <url>","Override target URL (same-origin port changes only)").option("--filter <pattern>","Filter style properties by substring (style_diff only)").action(async(t,e)=>{ce("command_run",{command:"verify"});let[n,...i]=t;if(n&&Rr.has(n)){await Lr(".",n,i,e),await se();return}if(!n){process.stderr.write(a.red(`\u2717 Task ID required.
1835
- `)),process.stderr.write(a.dim(` Usage: vibeflow verify <task-id>
1836
- `)),process.stderr.write(a.dim(` Tools: vibeflow verify <tool> <task-id> [...]
1837
- `)),process.exitCode=1;return}await _r(".",n,e),await se()});J.command("changelog").description("Show the changelog \u2014 latest version by default").option("--all","Show the full changelog for every version").action(async t=>{ce("command_run",{command:"changelog"}),await se(),ur({all:t.all===!0})});J.parse();
1816
+ `);W.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)=>{ne("command_run",{command:"serve"}),await Q(),await ht(t,{port:parseInt(e.port,10),host:e.host,open:e.open})});W.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").option("--no-changelog","Do not show the changelog with the update notice").action(async(t,e)=>{ne("command_run",{command:"kanban"}),await Q();let n=parseInt(e.port,10),l=await ht(void 0,{port:n,host:e.host,open:!1,projectDir:B(t),noCtrlCHint:!0}),a=l.url+"/kanban";console.log(),console.log(r.green(" \u2713 Kanban board ready")),console.log(r.dim(" ")+r.cyan(a)),l.localUrl&&console.log(r.dim(" ")+r.cyan(`${l.localUrl}/kanban`)),console.log(),console.log(r.bold("Agent prompt:")),console.log(r.dim(" Get new tasks and implement them, once done check again for new ones:")),console.log(r.dim(" ")+r.green("npx @vibeflow-tools/cli tasks --next")),console.log(),console.log(r.dim(" Press Ctrl+C to stop")),console.log(),e.open&&import("open").then(o=>o.default(a)).catch(()=>{console.log(r.dim(" Visit: ")+r.cyan(a))}),wo(e.changelog!==!1)});W.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("--skip-verify","Skip the verify-before-review gate (for non-UI tasks, the gate is automatically skipped)").option("--limit <n>","Limit how many tasks are returned in list mode (default: 5; use 0 for unlimited)").option("--dry-run","Preview what would change without modifying anything (mutations only)").option("--fields <fields>","Comma-separated list of fields to include in output (list/get modes)").option("--priority <priority>","Task priority (Critical, High, Medium, Low) \u2014 use with --add").action((t,e)=>{async function n(){let a=e.add?"add":e.next?"next":e.edit?"edit":e.get?"get":"list";if(ne("command_run",{command:"tasks",subcommand:a}),e.get){if(await xe()==="saas"){let k=await de(),P=await Ie(k?.id);if(!P.ok){console.log(r.red("\u2717 Unable to reach the online backend.")),process.exitCode=A.GENERAL;return}let T=P.data.tasks.find(F=>F.id===e.get||F.id.startsWith(e.get));if(!T){console.log(r.red(`\u2717 Task not found: ${e.get}`)),process.exitCode=A.NOT_FOUND;return}let D=fe(T.status);if(e.json){console.log(JSON.stringify({...T,status:D},null,2));return}let _t=we[D]??r.white;if(console.log(` ${_t(`[${D}]`)} ${r.bold(T.title)}`),console.log(r.dim(` id: ${T.id}`)),console.log(r.dim(" selector: /")),T.type&&console.log(r.dim(` type: ${T.type}`)),T.priority&&console.log(r.dim(` priority: ${T.priority}`)),console.log(r.dim(` created: ${T.createdAt}`)),T.description){console.log(r.dim(" description:"));for(let F of T.description.split(`
1817
+ `))console.log(r.dim(` ${F}`))}T.annotatedElementText&&console.log(r.dim(` element text: ${T.annotatedElementText}`)),T.branchName&&console.log(r.dim(` branch: ${T.branchName}`));let Se=[...T.comments??[]].sort(ke);if(Se.length>0){console.log(r.dim(` comments (${Se.length}):`));for(let F of Se){console.log(r.dim(` [${F.author??"agent"}] ${F.createdAt}`));for(let O of F.body.split(`
1818
+ `))console.log(r.dim(` ${O}`))}}if(T.files&&T.files.length>0){console.log(r.dim(` linked files (${T.files.length}):`));for(let F of T.files){let O=F.url??`${process.env.VIBEFLOW_API_URL??"https://app.vibeflow.tools"}/api/tasks/${T.id}/files/${encodeURIComponent(F.name)}`;if(console.log(r.dim(` - ${F.name} ${O}`)),F.content){console.log(r.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let ae of F.content.split(`
1819
+ `))console.log(r.dim(` \u2502 ${ae}`));console.log(r.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}let X=Y(B(t)),tt=(T.type??"").toLowerCase()==="research",nt=(T.type??"").toLowerCase()==="bug";Ne({hasResearchTasks:tt,hasBugTasks:nt,autoCommit:X.autoCommit,autoPush:X.autoPush,autoComment:X.autoComment,createBranch:X.createBranch,requireVerifyBeforeReview:X.requireVerifyBeforeReview});return}let m=B(t),b=Te(m),y=ce(m).find(k=>k.id===e.get||k.id.startsWith(e.get));if(!y){Ze({code:"E_NOT_FOUND",message:`Task not found: ${e.get}`,suggestion:"Run 'vibeflow tasks' to see available task IDs.",json:e.json}),process.exitCode=A.NOT_FOUND;return}let j=oe(m,y.id).sort(ke),L=ee(m,y.id).map(k=>({...k,url:`http://localhost:${b.port}${k.url}`}));if(e.json){let k=e.fields?e.fields.split(",").map(P=>P.trim()).filter(Boolean):[];console.log(JSON.stringify(wt({...y,comments:j,files:L},k),null,2));return}let I=we[y.status]??r.white,C=Oe(y,y.filePath,j,L,m).split(`
1820
+ `);if(C.length>0){let k=C[0],P=k.match(/^\[(\w+)\]\s+(.+)$/);console.log(P?` ${I(`[${P[1]}]`)} ${r.bold(P[2])}`:r.dim(k));for(let T=1;T<C.length;T++)console.log(r.dim(C[T]))}let h=Y(m),S=(y.type??"").toLowerCase()==="research",x=(y.type??"").toLowerCase()==="bug";Ne({hasResearchTasks:S,hasBugTasks:x,autoCommit:h.autoCommit,autoPush:h.autoPush,autoComment:h.autoComment,createBranch:h.createBranch,requireVerifyBeforeReview:h.requireVerifyBeforeReview});return}if(e.next){if(await xe()==="saas"){let k=await de(),P=await Ie(k?.id);if(!P.ok){console.log(r.red("\u2717 Unable to reach the online backend.")),process.exitCode=A.GENERAL;return}if(e.type&&!et(e.type))return;let T=P.data.tasks.map(O=>({...O,status:fe(O.status)})).filter(O=>O.status==="todo");if(e.type&&(T=T.filter(O=>(O.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Me(e.user,T))return;if(e.user&&(T=T.filter(O=>De(O.author,e.user))),e.tag&&e.tag.length>0&&(T=T.filter(O=>e.tag.every(ae=>(O.tags??[]).includes(ae)))),T=T.sort((O,ae)=>{let $e=be(O.priority??void 0)-be(ae.priority??void 0);return $e!==0?$e:ke(O,ae)}),T.length===0){let O=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),ae=O.length>0?` matching ${O.join(" ")}`:"";console.log(r.dim(`No todo tasks found${ae}. Nothing to work on.`));return}let D=T[0];if(!await xt(D.id,{status:"in-progress"})){console.log(r.red(`\u2717 Failed to move task to in-progress: ${D.id}`)),process.exitCode=A.GENERAL;return}let Se=U("set-status:in-progress",D.id);if(e.json){console.log(JSON.stringify({success:!0,task:{...D,status:"in-progress"},next_actions:Se},null,2));return}let X=Y(B(t)),tt=(D.type??"").toLowerCase()==="research",nt=(D.type??"").toLowerCase()==="bug";if(Ne({hasResearchTasks:tt,hasBugTasks:nt,autoCommit:X.autoCommit,autoPush:X.autoPush,autoComment:X.autoComment,createBranch:X.createBranch,requireVerifyBeforeReview:X.requireVerifyBeforeReview}),console.log(r.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log(),console.log(` ${r.blue("[in-progress]")} ${r.bold(D.title)}`),console.log(r.dim(` id: ${D.id}`)),D.type&&console.log(r.dim(` type: ${D.type}`)),D.priority&&console.log(r.dim(` priority: ${D.priority}`)),console.log(r.dim(` created: ${D.createdAt}`)),D.description){console.log(r.dim(" description:"));for(let O of D.description.split(`
1821
+ `))console.log(r.dim(` ${O}`))}let F=[...D.comments??[]].sort(ke);if(F.length>0){console.log(r.dim(` comments (${F.length}):`));for(let O of F){let ae=O.authorId?`user:${O.authorId.slice(0,8)}`:"agent";console.log(r.dim(` [${ae}] ${O.createdAt}`));for(let $e of O.body.split(`
1822
+ `))console.log(r.dim(` ${$e}`))}}console.log(),console.log(r.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done.")),re(Se);return}let m=B(t);if(e.type&&!et(e.type)||e.user&&!Me(e.user,[]))return;let b=Ct(m,{type:e.type,user:e.user,tag:e.tag,author:ie(m).name});if(!b){let k=[e.type&&`type=${e.type}`,e.user&&`user=${e.user}`,e.tag?.length&&`tag=${e.tag.join(",")}`].filter(Boolean),P=k.length>0?` matching ${k.join(" ")}`:"";console.log(r.dim(`No todo tasks found${P}. Nothing to work on.`));return}let R=U("set-status:in-progress",b.id);if(e.json){console.log(JSON.stringify({success:!0,task:b,next_actions:R},null,2));return}let y=Y(m),j=(b.type??"").toLowerCase()==="research",L=(b.type??"").toLowerCase()==="bug";Ne({hasResearchTasks:j,hasBugTasks:L,autoCommit:y.autoCommit,autoPush:y.autoPush,autoComment:y.autoComment,createBranch:y.createBranch,requireVerifyBeforeReview:y.requireVerifyBeforeReview});let I=Te(m),N=oe(m,b.id).sort(ke),C=ee(m,b.id).map(k=>({...k,url:`http://localhost:${I.port}${k.url}`})),h=q(m,b.id)??"",S=Oe(b,h,N,C,m);console.log(r.green.bold("\u25B6 NEXT TASK \u2014 Status moved to in-progress. Implement this now:")),console.log();let x=S.split(`
1823
+ `);if(x.length>0){let k=x[0].match(/^\[(\w+)\]\s+(.+)$/);console.log(k?` ${r.blue(`[${k[1]}]`)} ${r.bold(k[2])}`:r.dim(x[0]));for(let P=1;P<x.length;P++)console.log(r.dim(x[P]))}console.log(),console.log(r.yellow(" \u26A1 This task is already in-progress. Implement it now and mark as review when done.")),re(R);return}if(e.add){if(!e.title?.trim()){Ze({code:"E_USAGE",message:"--title is required with --add",suggestion:'Example: vibeflow tasks --add --title "Fix CTA spacing" --description "Button overflows on mobile"',json:e.json}),process.exitCode=A.USAGE;return}if(await xe()==="saas"){let L=await de(),N=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo",C=rt();if(e.dryRun){let k={id:C,title:e.title.trim(),description:e.description?.trim()??"",status:N,boardId:L?.id};e.json?console.log(JSON.stringify({dryRun:!0,action:"create",task:k,next_actions:U("add",C)},null,2)):(console.log(r.yellow(" [dry-run] Would create task:")),console.log(r.dim(` title: ${k.title}`)),console.log(r.dim(` status: ${k.status}`)),k.description&&console.log(r.dim(` description: ${k.description}`)),re(U("add",C)));return}let h=await fr({id:C,title:e.title.trim(),description:e.description?.trim(),status:N,boardId:L?.id});if(!h.ok){console.log(r.red("\u2717 Failed to create task in online board.")),console.log(r.yellow(" Check your connection or run 'vibeflow login'.")),process.exitCode=A.GENERAL;return}let S=h.data,x=U("add",S.id);e.json?console.log(JSON.stringify({success:!0,task:S,next_actions:x},null,2)):(console.log(r.green(`\u2713 Task created: ${S.title}`)),console.log(r.dim(` id: ${S.id} | status: ${fe(S.status)}`)),re(x));return}let m=B(t);he(m);let R=["backlog","todo","in-progress","review","done"].includes(e.setStatus??"")?e.setStatus:"todo";if(e.dryRun){let L=rt(),I={id:L,title:e.title.trim(),description:e.description?.trim()??"",status:R,selector:"/"};e.json?console.log(JSON.stringify({dryRun:!0,action:"create",task:I,next_actions:U("add",L)},null,2)):(console.log(r.yellow(" [dry-run] Would create task:")),console.log(r.dim(` title: ${I.title}`)),console.log(r.dim(` status: ${I.status}`)),I.description&&console.log(r.dim(` description: ${I.description}`)),re(U("add",L)));return}let y=_e(m,{title:e.title.trim(),description:e.description?.trim()??"",status:R,selector:"/",...e.type?{type:e.type}:{},...e.priority?{priority:e.priority}:{},...e.tag?.length?{tags:e.tag}:{}}),j=U("add",y.id);e.json?console.log(JSON.stringify({success:!0,task:y,next_actions:j},null,2)):(console.log(r.green(`\u2713 Task created: ${y.title}`)),console.log(r.dim(` id: ${y.id} | status: ${y.status}`)),re(j));return}if(e.commit){if(!e.task){Ze({code:"E_USAGE",message:"--task <task-id> is required with --commit",suggestion:'Example: vibeflow tasks --commit --task abc12345 --message "fix button alignment"',json:e.json}),process.exitCode=A.USAGE;return}let d=B(t),b=K(d).find(j=>j.id===e.task||j.id.startsWith(e.task));if(!b){Ze({code:"E_NOT_FOUND",message:`Task not found: ${e.task}`,suggestion:"Run 'vibeflow tasks' to see available task IDs.",json:e.json}),process.exitCode=A.NOT_FOUND;return}let R=e.message?.trim()||b.title;if(e.dryRun){let j=`${R} [proto:${b.id}]`;e.json?console.log(JSON.stringify({dryRun:!0,action:"commit",message:j,taskId:b.id,next_actions:U("commit",b.id)},null,2)):(console.log(r.yellow(" [dry-run] Would commit:")),console.log(r.dim(` message: ${j}`)),console.log(r.dim(` task: ${b.id}`)),re(U("commit",b.id)));return}(b.type??"").toLowerCase()==="research"&&(console.log(r.yellow("\u26A0 WARNING: This is a Research task. Research tasks must NOT produce code changes.")),console.log(r.yellow(" Only commit research report files (.md). Do not commit code changes.")),console.log());let y=`${R} [proto:${b.id}]`;try{St("git",["commit","-m",y],{cwd:d,stdio:"inherit"});let j=jr("git rev-parse HEAD",{cwd:d}).toString().trim(),L={sha:j,message:R,timestamp:new Date().toISOString()},I=b.commits??[];V(d,b.id,{commits:[...I,L]});let N=U("commit",b.id);if(e.json?console.log(JSON.stringify({success:!0,commit:j,next_actions:N},null,2)):(console.log(r.green(`\u2713 Committed and linked to task: ${b.title}`)),console.log(r.dim(` commit: ${j}`)),console.log(r.dim(` proto: ${b.id}`)),re(N)),Y(d).autoPush){console.log(r.dim(" auto-push: pushing commit to remote..."));let h=Cr(d);h.ok?console.log(r.green("\u2713 Auto-push complete")):(console.log(r.yellow("\u26A0 Auto-push failed. Commit is local; run 'git push' manually.")),h.error&&console.log(r.dim(` reason: ${h.error}`)))}}catch{console.log(r.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=A.GENERAL}return}if(e.edit!==void 0){let d=typeof e.edit=="string"?e.edit:void 0,m=e.title||e.setStatus||e.description;if(!d||!m){if(e.type&&!et(e.type))return;let h=K(t);if(e.status&&(h=h.filter(S=>S.status===e.status)),e.type&&(h=h.filter(S=>(S.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Me(e.user,h))return;if(e.user&&(h=h.filter(S=>De(S.author,e.user))),e.tag&&e.tag.length>0&&(h=h.filter(S=>e.tag.every(x=>(S.tags??[]).includes(x)))),console.log(r.bold("vibeflow tasks --edit \u2014 LLM Usage Instructions")),console.log(),console.log("Edit a task:"),console.log(r.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(r.dim(" vibeflow tasks --edit abc12345 --set-status done")),console.log(r.dim(" vibeflow tasks --edit abc12345 --set-status in-progress")),console.log(r.dim(' vibeflow tasks --edit abc12345 --title "Updated title" --description "More detail"')),console.log(),h.length===0)console.log(r.dim("No tasks found."));else{console.log("Available tasks:");for(let S of h){let x=we[S.status]??r.white;console.log(` ${x(`[${S.status}]`)} ${r.bold(S.id)} \u2014 ${S.title}`)}}return}if(e.setStatus==="done"&&(console.log(r.yellow('\u26A0 WARNING: Agents should NEVER set a task status to "done".')),console.log(r.yellow(" Only humans should mark tasks as done after reviewing.")),console.log(r.dim(" If you are an agent, use --set-status review instead.")),console.log()),e.setStatus&&!Xe.includes(e.setStatus)){console.log(r.red(`\u2717 Invalid status: "${e.setStatus}"`)),console.log(r.yellow(` Valid statuses: ${Xe.join(" | ")}`)),console.log(r.dim(` Example: vibeflow tasks --edit ${d} --set-status in-progress`)),process.exitCode=A.USAGE;return}if(e.setStatus==="review"&&!e.comment?.trim()){console.log(r.red("\u2717 --comment is required when setting status to review")),console.log(r.dim(" Provide a concise implementation report explaining:")),console.log(r.dim(" \xB7 what was changed and why")),console.log(r.dim(" \xB7 key decisions and trade-offs")),console.log(r.dim(" \xB7 anything future agents should know")),console.log(r.dim(` Example: vibeflow tasks --edit ${d} --set-status review --comment "Implemented X by doing Y. Key decision: Z."`)),process.exitCode=A.USAGE;return}let b=await xe(),R=B(t),y=Y(R);if(e.setStatus==="review"&&e.reportFile){let S=K(R).find(x=>x.id===d||x.id.startsWith(d));if(S&&(S.type??"").toLowerCase()==="research"){let x=B(e.reportFile);if(!Rr(x)){console.log(r.red(`\u2717 Report file not found: ${x}`)),process.exitCode=A.NOT_FOUND;return}if(!/\.md$/i.test(x)){console.log(r.red("\u2717 Report file must be a Markdown (.md) file")),process.exitCode=A.USAGE;return}let k=Ir(x),{saveFile:P}=await import("./files-R6BRCQQX.js");P(R,S.id,kr(x),k),vo(x),console.log(r.green(`\u2713 Report uploaded: ${kr(x)} (local file removed)`))}}if(e.setStatus==="review"){let{checkReviewTransition:h}=await import("./review-gate-QR2E4REN.js"),S=h(R,d,{comment:e.comment,commitMessage:e.commitMessage,branch:e.branch,skipVerify:e.skipVerify},{projectDir:R,settings:y});if(!S.ok){console.log(r.red(`\u2717 ${S.message}`)),S.suggestion&&console.log(r.dim(` ${S.suggestion}`)),process.exitCode=A.USAGE;return}}if(b==="saas"){let h={};if(e.setStatus&&(h.status=e.setStatus),e.title&&(h.title=e.title),e.description&&(h.description=e.description),e.branch&&(h.branchName=e.branch),e.setStatus==="in-progress"){let P=await dr(d);if(P&&fe(P.status)==="in-progress"){let T=P.author??"another user";console.log(r.yellow(`\u26A0 Task is already in-progress (last updated by: ${T})`)),console.log(r.yellow(" Another agent or user may be working on this task.")),console.log(r.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}let S=await xt(d,h);if(!S.ok){console.log(r.red(`\u2717 Failed to update task: ${d}`)),console.log(r.yellow(" Ensure you are connected and the task ID exists in the online board.")),process.exitCode=A.GENERAL;return}let x=S.data;x.warning&&console.log(r.yellow(`\u26A0 Server warning: ${x.warning}`)),e.setStatus==="review"&&e.comment?.trim()&&(await pr(d,e.comment.trim())).ok&&console.log(r.dim(" comment: added"));let k=e.setStatus?U(e.setStatus==="review"?"set-status:review":"set-status:in-progress",d):[];e.json?console.log(JSON.stringify({success:!0,task:x.task,next_actions:k},null,2)):(console.log(r.green(`\u2713 Task updated: ${x.task.title}`)),console.log(r.dim(` id: ${x.task.id} | status: ${fe(x.task.status)}`)),k.length>0&&re(k));return}let j=B(t),L=K(j).find(h=>h.id===d||h.id.startsWith(d))?.id??d;if(e.dryRun){let h={};if(e.title&&(h.title=e.title),e.setStatus&&(h.status=e.setStatus),e.description&&(h.description=e.description),e.branch&&(h.branchName=e.branch),e.json)console.log(JSON.stringify({dryRun:!0,action:"update",taskId:L,updates:h,next_actions:e.setStatus?U(e.setStatus==="review"?"set-status:review":"set-status:in-progress",L):[]},null,2));else{console.log(r.yellow(" [dry-run] Would update task:")),console.log(r.dim(` id: ${L}`));for(let[S,x]of Object.entries(h))console.log(r.dim(` ${S}: ${x}`));e.setStatus&&re(U(e.setStatus==="review"?"set-status:review":"set-status:in-progress",L))}return}let I={};if(e.title&&(I.title=e.title),e.setStatus&&(I.status=e.setStatus),e.description&&(I.description=e.description),e.branch&&(I.branchName=e.branch),e.setStatus==="in-progress"){let h=B(t),x=K(h).find(k=>k.id===d||k.id.startsWith(d));if(x&&((x.type??"").toLowerCase()==="research"&&(console.log(r.yellow("\u26A0 WARNING: This is a Research task. Policy: do NOT implement code.")),console.log(r.yellow(" Research only \u2014 attach a .md report file, leave a summary comment, mark as review.")),console.log()),x.status==="in-progress")){let k=x.updated?new Date(x.updated).toLocaleString():"unknown",P=x.author??"another user";console.log(r.yellow(`\u26A0 Task is already in-progress (author: ${P}, last updated: ${k})`)),console.log(r.yellow(" Another agent or user may be working on this task.")),console.log(r.yellow(" Proceeding \u2014 but verify the task is not being worked on elsewhere.")),console.log()}}e.setStatus==="in-progress"&&(I.verified=!1);let N=V(t,L,I);if(!N){console.log(r.red(`\u2717 Task not found: ${d}`)),console.log(r.yellow(" Run 'vibeflow tasks' to see available task IDs.")),process.exitCode=A.NOT_FOUND;return}e.setStatus==="review"&&e.comment?.trim()&&(ye(B(t),L,"agent",e.comment.trim()),console.log(r.dim(" comment: added")));let C=e.setStatus?U(e.setStatus==="review"?"set-status:review":"set-status:in-progress",L):[];if(e.json?console.log(JSON.stringify({success:!0,task:N,next_actions:C},null,2)):(console.log(r.green(`\u2713 Task updated: ${N.title}`)),console.log(r.dim(` id: ${N.id} | status: ${N.status}`)),C.length>0&&re(C)),e.setStatus==="review"){let h=B(t),S=Y(h);if(S.autoCommit&&e.commitMessage?.trim()){let k=K(h).find(P=>P.id===d||P.id.startsWith(d));if(k){let{commitTaskChanges:P}=await import("./git-NH6PGXOM.js"),T=P(h,k.id,e.commitMessage.trim());if(T.ok){if(console.log(r.green(`\u2713 Committed: ${e.commitMessage.trim()} [proto:${k.id}]`)),console.log(r.dim(` sha: ${T.sha}`)),S.autoPush){console.log(r.dim(" pushing..."));let D=Cr(h);D.ok?console.log(r.green("\u2713 Pushed")):(console.log(r.yellow("\u26A0 Push failed. Run 'git push' manually.")),D.error&&console.log(r.dim(` reason: ${D.error}`)))}}else console.log(r.red("\u2717 git commit failed \u2014 ensure changes are staged with 'git add'")),process.exitCode=A.GENERAL}}}return}if(e.status&&!Xe.includes(e.status)){console.log(r.red(`\u2717 Invalid status filter: "${e.status}"`)),console.log(r.yellow(` Valid statuses: ${Xe.join(" | ")}`)),console.log(r.dim(" Example: vibeflow tasks --status todo")),process.exitCode=A.USAGE;return}if(e.type&&!et(e.type))return;let o=e.fields?e.fields.split(",").map(d=>d.trim()).filter(Boolean):[];if(await xe()==="saas"){let d=await de(),m=await Ie(d?.id);if(!m.ok){console.log(r.red("\u2717 Unable to reach the online backend.")),console.log(r.yellow(" Check your connection or run 'vibeflow login' if your session expired.")),process.exitCode=A.GENERAL;return}let b=m.data.tasks.map(I=>({...I,status:fe(I.status)}));if(e.status&&(b=b.filter(I=>I.status===e.status)),e.type&&(b=b.filter(I=>(I.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&!Me(e.user,b))return;e.user&&(b=b.filter(I=>De(I.author,e.user))),e.tag&&e.tag.length>0&&(b=b.filter(I=>e.tag.every(N=>(I.tags??[]).includes(N))));let R=e.limit===void 0?5:parseInt(e.limit,10);if(!isNaN(R)&&R>0&&(b=b.slice(0,R)),e.json){console.log(JSON.stringify(b.map(I=>wt(I,o)),null,2));return}let y=b.some(I=>(I.type??"").toLowerCase()==="research"),j=b.some(I=>(I.type??"").toLowerCase()==="bug"),L=Y(B(t));if(Ne({hasResearchTasks:y,hasBugTasks:j,autoCommit:L.autoCommit,autoPush:L.autoPush,autoComment:L.autoComment,createBranch:L.createBranch,requireVerifyBeforeReview:L.requireVerifyBeforeReview}),b.length===0)console.log(r.dim("No tasks found."));else{b=b.sort((N,C)=>{let h=Je(N.status)-Je(C.status);if(h!==0)return h;let S=be(N.priority??void 0)-be(C.priority??void 0);return S!==0?S:new Date(C.updatedAt).getTime()-new Date(N.updatedAt).getTime()});for(let[N,C]of b.entries()){let h=we[C.status]??r.white,S=_o(C.type);if(console.log(` ${r.dim(`${N+1}.`)} ${h(`[${C.status}]`)} ${C.title}`),console.log(r.dim(` id: ${C.id}`)),console.log(r.dim(" selector: /")),S&&console.log(r.dim(` type: ${S}`)),C.priority&&console.log(r.dim(` priority: ${C.priority}`)),console.log(r.dim(` created: ${C.createdAt}`)),C.description){console.log(r.dim(" description:"));for(let x of C.description.split(`
1824
+ `))console.log(r.dim(` ${x}`))}if(C.comments&&C.comments.length>0){let x=[...C.comments].sort(ke);console.log(r.dim(` comments (${x.length}):`));for(let k of x){let P=k.authorId?`user:${k.authorId.slice(0,8)}`:"agent";console.log(r.dim(` [${P}] ${k.createdAt}`));for(let T of k.body.split(`
1825
+ `))console.log(r.dim(` ${T}`))}}if(C.files&&C.files.length>0){console.log(r.dim(` linked files (${C.files.length}):`));for(let x of C.files){let k=x.url??`${process.env.VIBEFLOW_API_URL??"https://app.vibeflow.tools"}/api/tasks/${C.id}/files/${encodeURIComponent(x.name)}`;if(console.log(r.dim(` - ${x.name} ${k}`)),x.content){console.log(r.dim(" \u250C\u2500\u2500 content \u2500\u2500"));for(let P of x.content.split(`
1826
+ `))console.log(r.dim(` \u2502 ${P}`));console.log(r.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"))}}}console.log()}let I=m.data.tasks.map(N=>({...N,status:fe(N.status)}));console.log(r.dim(Sr(I)))}return}let s=ce(t);if(e.user&&!Me(e.user,s))return;let c=e.status?s.filter(d=>d.status===e.status):s;e.type&&(c=c.filter(d=>(d.type??"Task").toLowerCase()===e.type.toLowerCase())),e.user&&(c=c.filter(d=>De(d.author,e.user))),e.tag&&e.tag.length>0&&(c=c.filter(d=>e.tag.every(m=>(d.tags??[]).includes(m))));let u=e.limit===void 0?5:parseInt(e.limit,10);if(e.json){console.log(JSON.stringify(c.map(d=>wt(d,o)),null,2));return}c=c.sort((d,m)=>{let b=Je(d.status)-Je(m.status);if(b!==0)return b;let R=be(d.priority)-be(m.priority);if(R!==0)return R;let y=new Date(d.updated??d.created).getTime(),j=new Date(m.updated??m.created).getTime();return y!==j?j-y:d.id.localeCompare(m.id)});let g=c.length;if(!isNaN(u)&&u>0&&(c=c.slice(0,u)),c.length===0){console.log(r.dim("No tasks found."));return}let p=B(t),w=c.some(d=>(d.type??"").toLowerCase()==="research"),_=c.some(d=>(d.type??"").toLowerCase()==="bug"),z=Y(p);Ne({hasResearchTasks:w,hasBugTasks:_,autoCommit:z.autoCommit,autoPush:z.autoPush,autoComment:z.autoComment,createBranch:z.createBranch,requireVerifyBeforeReview:z.requireVerifyBeforeReview});let $=Te(p);for(let[d,m]of c.entries()){let b=oe(p,m.id).sort(ke),R=ee(p,m.id).map(j=>({...j,url:`http://localhost:${$.port}${j.url}`})),y=Tt(m,b,R);To(m,y,d,$.port,p)}let M=!isNaN(u)&&u>0&&g>u?r.yellow(` (showing ${u} of ${g} matching \u2014 use --limit 0 for all)`):"";console.log(r.dim(Sr(s))+M)}async function l(){try{await n()}finally{await Q()}}l()});W.command("login",{hidden:!0}).description("Authenticate CLI against the Vibeflow SaaS backend (device flow)").action(async()=>{ne("command_run",{command:"login"}),await Q(),await $t()});W.command("logout",{hidden:!0}).description("Remove stored auth token and switch to local mode").action(async()=>{ne("command_run",{command:"logout"}),await Q(),await qn()});W.command("status",{hidden:!0}).description("Show login status, connection info, and task statistics").action(async()=>{if(await xe()==="local"){console.log(r.yellow("\u25CF Not logged in")+r.dim(" (local mode)")),console.log(r.dim(" Run ")+r.cyan("vibeflow login")+r.dim(" to connect to the Vibeflow cloud.")),console.log();let o=B("."),i=ce(o);if(i.length>0){let s=i.reduce((c,u)=>(c[u.status]=(c[u.status]??0)+1,c),{});console.log(r.bold(" Local task statistics:"));for(let[c,u]of Object.entries(s)){let g=we[c]??r.white;console.log(` ${g(c.padEnd(12))} ${u}`)}console.log(r.dim(` ${"total".padEnd(12)} ${i.length}`))}else console.log(r.dim(" No local tasks found."));return}let e=await de();console.log(r.green("\u25CF Online")+r.dim(" (SaaS mode)")),e&&(console.log(r.dim(` Board: ${e.icon?`${e.icon} `:""}${e.name}`)),e.email&&console.log(r.dim(` Email: ${e.email}`)),console.log(r.dim(" URL: ")+r.cyan(e.url))),console.log();let n=await Ie(e?.id);if(!n.ok){console.log(r.yellow(" \u26A0 Could not reach SaaS backend. Check your connection."));return}let l=n.data.tasks.map(o=>({...o,status:fe(o.status)}));if(l.length===0){console.log(r.dim(" No tasks found."));return}let a=l.reduce((o,i)=>(o[i.status]=(o[i.status]??0)+1,o),{});console.log(r.bold(" Task statistics:"));for(let[o,i]of Object.entries(a)){let s=we[o]??r.white;console.log(` ${s(o.padEnd(12))} ${i}`)}console.log(r.dim(` ${"total".padEnd(12)} ${l.length}`))});W.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)").option("--dry-run","Preview what would be pushed without making any changes").action(async(t,e)=>{ne("command_run",{command:"push"}),await Ft(t,e),await Q()});W.command("watch").description("Watch the task store and print ticket details for important updates (new tasks, tasks moved to todo)").argument("[dir]","Project root directory",".").action(async t=>{ne("command_run",{command:"watch"}),await Q(),Yn(t)});W.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){kt(!1),console.log(r.yellow("Telemetry disabled. No usage data will be collected.")),console.log(r.dim("Run `vibeflow telemetry --enable` to re-enable at any time."));return}if(t.enable){kt(!0),console.log(r.green("Telemetry enabled. Thank you for helping improve Vibeflow!"));return}let{enabled:e,anonymousId:n}=xr(),l=process.env.VIBEFLOW_TELEMETRY==="0";console.log(r.bold("Telemetry status:")),console.log(` Enabled: ${e?r.green("yes"):r.yellow("no")}`),l&&console.log(r.dim(" (disabled via VIBEFLOW_TELEMETRY=0 environment variable)")),n&&console.log(r.dim(` Anonymous ID: ${n}`)),console.log(),console.log(r.dim(" vibeflow telemetry --disable Opt out of usage tracking")),console.log(r.dim(" vibeflow telemetry --enable Opt back in")),console.log(r.dim(" No PII is ever collected. User identity is hashed."))});W.command("auth").description("Manage stored auth state (encrypted cookies for Playwright verification)").option("--clear","Delete all per-task encrypted auth state files").option("--list","List stored auth state files and their age").action(async t=>{ne("command_run",{command:"auth"}),await Q();let e=B(".");if(t.clear){let n=er(e);console.log(n===0?r.dim(" No auth state files found. Nothing to clear."):r.green(` \u2713 Cleared ${n} auth state file(s)`));return}if(t.list){let n=tr(e);if(n.length===0){console.log(r.dim(" No auth state files found."));return}console.log(r.bold(` Auth state files (${n.length}):`));for(let l of n)console.log(r.dim(` ${l.taskId} age: ${l.age} path: ${l.path}`));return}console.log(r.bold("Auth management:")),console.log(r.dim(" vibeflow auth --clear Delete all per-task encrypted auth state files")),console.log(r.dim(" vibeflow auth --list List stored auth state files and their age"))});W.command("verify").description("Verify a task against its baseline snapshot, or explore captured evidence").argument("[args...]","task-id, or a tool: style_query | style_diff | element_info | html_diff").option("--json","Output machine-readable JSON").option("--url <url>","Override target URL (same-origin port changes only)").option("--filter <pattern>","Filter style properties by substring (style_diff only)").action(async(t,e)=>{ne("command_run",{command:"verify"});let[n,...l]=t;if(n&&cr.has(n)){await ur(".",n,l,e),await Q();return}if(!n){process.stderr.write(r.red(`\u2717 Task ID required.
1827
+ `)),process.stderr.write(r.dim(` Usage: vibeflow verify <task-id>
1828
+ `)),process.stderr.write(r.dim(` Tools: vibeflow verify <tool> <task-id> [...]
1829
+ `)),process.exitCode=1;return}await At(".",n,e),await Q()});W.command("changelog").description("Show the changelog \u2014 latest version by default").option("--all","Show the full changelog for every version").action(async t=>{ne("command_run",{command:"changelog"}),await Q(),Gn({all:t.all===!0})});W.parse();