agentix-cli 0.16.0 → 0.18.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 (173) hide show
  1. package/dist/agent-RDVGL2TW.js +2 -0
  2. package/dist/audit-Z47AQFFD.js +3 -0
  3. package/dist/audit-Z47AQFFD.js.map +1 -0
  4. package/dist/board-dashboard-KX2CNOSY.js +7282 -0
  5. package/dist/board-dashboard-KX2CNOSY.js.map +1 -0
  6. package/dist/chunk-34NG7UDX.js +11 -0
  7. package/dist/chunk-34NG7UDX.js.map +1 -0
  8. package/dist/{chunk-6MKAXEE5.js → chunk-4ITQP3XL.js} +2 -2
  9. package/dist/{chunk-6MKAXEE5.js.map → chunk-4ITQP3XL.js.map} +1 -1
  10. package/dist/chunk-53NRX2NA.js +2 -0
  11. package/dist/chunk-53NRX2NA.js.map +1 -0
  12. package/dist/chunk-6PPIFDOQ.js +1742 -0
  13. package/dist/chunk-6PPIFDOQ.js.map +1 -0
  14. package/dist/chunk-AFRHKA7B.js +2 -0
  15. package/dist/chunk-AFRHKA7B.js.map +1 -0
  16. package/dist/chunk-ASSJ4Z6Z.js +164 -0
  17. package/dist/chunk-ASSJ4Z6Z.js.map +1 -0
  18. package/dist/chunk-BLUXL6HR.js +854 -0
  19. package/dist/chunk-BLUXL6HR.js.map +1 -0
  20. package/dist/chunk-BTAEYL3P.js +72 -0
  21. package/dist/chunk-BTAEYL3P.js.map +1 -0
  22. package/dist/chunk-CDNWCYF7.js +2 -0
  23. package/dist/chunk-CDNWCYF7.js.map +1 -0
  24. package/dist/chunk-DJEZ2HVU.js +5 -0
  25. package/dist/chunk-DJEZ2HVU.js.map +1 -0
  26. package/dist/{chunk-FLOGK2U7.js → chunk-DSCMCVTV.js} +3 -3
  27. package/dist/chunk-DSCMCVTV.js.map +1 -0
  28. package/dist/chunk-EW27SCCC.js +2 -0
  29. package/dist/chunk-EW27SCCC.js.map +1 -0
  30. package/dist/chunk-HPDHNIA3.js +2 -0
  31. package/dist/chunk-IM376SD6.js +13 -0
  32. package/dist/chunk-IM376SD6.js.map +1 -0
  33. package/dist/chunk-J4WKMKTP.js +5 -0
  34. package/dist/{chunk-YI2T5QYB.js.map → chunk-J4WKMKTP.js.map} +1 -1
  35. package/dist/chunk-JGXE2YNV.js +46 -0
  36. package/dist/chunk-JGXE2YNV.js.map +1 -0
  37. package/dist/chunk-JXEPJ3YD.js +118 -0
  38. package/dist/chunk-JXEPJ3YD.js.map +1 -0
  39. package/dist/chunk-LY7JGDV7.js +6 -0
  40. package/dist/chunk-LY7JGDV7.js.map +1 -0
  41. package/dist/chunk-N67JZAXU.js +2 -0
  42. package/dist/chunk-N67JZAXU.js.map +1 -0
  43. package/dist/chunk-SR3X25TN.js +3 -0
  44. package/dist/chunk-SR3X25TN.js.map +1 -0
  45. package/dist/{chunk-7MBTMCKY.js → chunk-TRQSP67X.js} +2 -2
  46. package/dist/chunk-U364GNQX.js +719 -0
  47. package/dist/chunk-U364GNQX.js.map +1 -0
  48. package/dist/chunk-VJUTQAPJ.js +2 -0
  49. package/dist/chunk-VJUTQAPJ.js.map +1 -0
  50. package/dist/{chunk-HI24KAEY.js → chunk-WJXU5F4Z.js} +3 -4
  51. package/dist/{chunk-HI24KAEY.js.map → chunk-WJXU5F4Z.js.map} +1 -1
  52. package/dist/{chunk-QZP65I2H.js → chunk-ZE2YFX4K.js} +2 -2
  53. package/dist/cli.js +1 -320
  54. package/dist/cli.js.map +1 -1
  55. package/dist/{compaction-JBZZ7I7Y.js → compaction-S5H6DTOR.js} +6 -6
  56. package/dist/compaction-S5H6DTOR.js.map +1 -0
  57. package/dist/config-UOHEG4BW.js +2 -0
  58. package/dist/config-mutator-KSEBWKJH.js +2 -0
  59. package/dist/context-planner-2RGHJHSO.js +17 -0
  60. package/dist/context-planner-2RGHJHSO.js.map +1 -0
  61. package/dist/debug-TGAP7E7W.js +2 -0
  62. package/dist/discover-OATU7SHI.js +4 -0
  63. package/dist/discover-OATU7SHI.js.map +1 -0
  64. package/dist/editor-chat-FUBQLMAQ.js +137 -0
  65. package/dist/editor-chat-FUBQLMAQ.js.map +1 -0
  66. package/dist/heal-YP7QI7D3.js +2 -0
  67. package/dist/inbox-O5UB3YQN.js +315 -0
  68. package/dist/inbox-O5UB3YQN.js.map +1 -0
  69. package/dist/index.d.ts +3390 -1814
  70. package/dist/index.js +23 -53
  71. package/dist/index.js.map +1 -1
  72. package/dist/ingest-whatsapp-C3O5UPBX.js +6 -0
  73. package/dist/ingest-whatsapp-C3O5UPBX.js.map +1 -0
  74. package/dist/loader-BGWA7IRY.js +2 -0
  75. package/dist/loader-LBHKSXBK.js +2 -0
  76. package/dist/memory-extract-KKPKAOPH.js +2 -0
  77. package/dist/processes-7W27G3J3.js +256 -0
  78. package/dist/processes-7W27G3J3.js.map +1 -0
  79. package/dist/program-2MDELQLX.js +2 -0
  80. package/dist/providers-WCQSKTNP.js +2 -0
  81. package/dist/query-FZAL7AQD.js +2 -0
  82. package/dist/recipes-LZ56TA3X.js +2 -0
  83. package/dist/registry-ONJSILH4.js +2 -0
  84. package/dist/scheduler-XRM2RJIV.js +2 -0
  85. package/dist/slack-D27BE37Q.js +3 -0
  86. package/dist/slack-D27BE37Q.js.map +1 -0
  87. package/dist/store-4UCO56K2.js +2 -0
  88. package/dist/store-4UCO56K2.js.map +1 -0
  89. package/dist/{subagent-2SJHSSJS.js → subagent-EPOT3QDM.js} +2 -2
  90. package/dist/task-store-3NUWLYRY.js +2 -0
  91. package/dist/task-store-3NUWLYRY.js.map +1 -0
  92. package/dist/telegram-UWV67KWG.js +3 -0
  93. package/dist/telegram-UWV67KWG.js.map +1 -0
  94. package/dist/timers-QB4KYNAE.js +2 -0
  95. package/dist/timers-QB4KYNAE.js.map +1 -0
  96. package/dist/types-ECMEC5BZ.js +2 -0
  97. package/dist/types-ECMEC5BZ.js.map +1 -0
  98. package/dist/types-TTB6DJUE.js +2 -0
  99. package/dist/types-TTB6DJUE.js.map +1 -0
  100. package/dist/usage-dashboard-FQGPPABD.js +803 -0
  101. package/dist/usage-dashboard-FQGPPABD.js.map +1 -0
  102. package/dist/web/workflow-editor.global.js +1450 -0
  103. package/dist/web/workflow-editor.global.js.map +1 -0
  104. package/dist/whatsapp-KJ2NRKKQ.js +3 -0
  105. package/dist/whatsapp-KJ2NRKKQ.js.map +1 -0
  106. package/dist/{whatsapp-state-6D6FHHD2.js → whatsapp-state-3ZVQ6MQD.js} +2 -2
  107. package/dist/{wiki-UDPYFJBL.js → wiki-OUYKM7MB.js} +2 -2
  108. package/dist/wiki-OUYKM7MB.js.map +1 -0
  109. package/dist/workspace-setup-6GDBEORT.js +2 -0
  110. package/dist/workspace-setup-6GDBEORT.js.map +1 -0
  111. package/package.json +19 -2
  112. package/dist/agent-BCDPSPKU.js +0 -2
  113. package/dist/board-dashboard-LA7WW56M.js +0 -5668
  114. package/dist/board-dashboard-LA7WW56M.js.map +0 -1
  115. package/dist/chunk-6U2XOQHU.js +0 -7
  116. package/dist/chunk-6U2XOQHU.js.map +0 -1
  117. package/dist/chunk-7FJQGD6U.js +0 -6
  118. package/dist/chunk-7FJQGD6U.js.map +0 -1
  119. package/dist/chunk-ABDP7TDL.js +0 -71
  120. package/dist/chunk-ABDP7TDL.js.map +0 -1
  121. package/dist/chunk-CXY2RYNI.js +0 -11
  122. package/dist/chunk-CXY2RYNI.js.map +0 -1
  123. package/dist/chunk-FIOB3MEX.js +0 -2
  124. package/dist/chunk-FLOGK2U7.js.map +0 -1
  125. package/dist/chunk-HVC6FJNP.js +0 -108
  126. package/dist/chunk-HVC6FJNP.js.map +0 -1
  127. package/dist/chunk-K7BE4E35.js +0 -138
  128. package/dist/chunk-K7BE4E35.js.map +0 -1
  129. package/dist/chunk-KXJSLLSQ.js +0 -199
  130. package/dist/chunk-KXJSLLSQ.js.map +0 -1
  131. package/dist/chunk-KXZMYLHQ.js +0 -46
  132. package/dist/chunk-KXZMYLHQ.js.map +0 -1
  133. package/dist/chunk-M7HKBG3V.js +0 -2
  134. package/dist/chunk-M7HKBG3V.js.map +0 -1
  135. package/dist/chunk-MCJUAE6V.js +0 -6
  136. package/dist/chunk-MCJUAE6V.js.map +0 -1
  137. package/dist/chunk-RB7265LO.js +0 -12
  138. package/dist/chunk-RB7265LO.js.map +0 -1
  139. package/dist/chunk-YI2T5QYB.js +0 -5
  140. package/dist/compaction-JBZZ7I7Y.js.map +0 -1
  141. package/dist/config-LN6JEHMF.js +0 -2
  142. package/dist/config-mutator-24TH7PHM.js +0 -2
  143. package/dist/debug-3MEUO2P2.js +0 -2
  144. package/dist/heal-WKY5I4KB.js +0 -2
  145. package/dist/loader-PTCXLJEX.js +0 -2
  146. package/dist/memory-extract-AD7KMRPC.js +0 -2
  147. package/dist/providers-VUIWO3ZK.js +0 -2
  148. package/dist/query-PKGYE5HR.js +0 -2
  149. package/dist/registry-ASC2QS5K.js +0 -2
  150. package/dist/scheduler-A3TQOCKT.js +0 -2
  151. package/dist/types-OIFU3KSQ.js +0 -2
  152. package/dist/usage-dashboard-QX3CF6KK.js +0 -404
  153. package/dist/usage-dashboard-QX3CF6KK.js.map +0 -1
  154. package/dist/workspace-setup-ZWTT42XT.js +0 -2
  155. /package/dist/{agent-BCDPSPKU.js.map → agent-RDVGL2TW.js.map} +0 -0
  156. /package/dist/{chunk-FIOB3MEX.js.map → chunk-HPDHNIA3.js.map} +0 -0
  157. /package/dist/{chunk-7MBTMCKY.js.map → chunk-TRQSP67X.js.map} +0 -0
  158. /package/dist/{chunk-QZP65I2H.js.map → chunk-ZE2YFX4K.js.map} +0 -0
  159. /package/dist/{config-LN6JEHMF.js.map → config-UOHEG4BW.js.map} +0 -0
  160. /package/dist/{config-mutator-24TH7PHM.js.map → config-mutator-KSEBWKJH.js.map} +0 -0
  161. /package/dist/{debug-3MEUO2P2.js.map → debug-TGAP7E7W.js.map} +0 -0
  162. /package/dist/{heal-WKY5I4KB.js.map → heal-YP7QI7D3.js.map} +0 -0
  163. /package/dist/{loader-PTCXLJEX.js.map → loader-BGWA7IRY.js.map} +0 -0
  164. /package/dist/{memory-extract-AD7KMRPC.js.map → loader-LBHKSXBK.js.map} +0 -0
  165. /package/dist/{providers-VUIWO3ZK.js.map → memory-extract-KKPKAOPH.js.map} +0 -0
  166. /package/dist/{query-PKGYE5HR.js.map → program-2MDELQLX.js.map} +0 -0
  167. /package/dist/{registry-ASC2QS5K.js.map → providers-WCQSKTNP.js.map} +0 -0
  168. /package/dist/{scheduler-A3TQOCKT.js.map → query-FZAL7AQD.js.map} +0 -0
  169. /package/dist/{types-OIFU3KSQ.js.map → recipes-LZ56TA3X.js.map} +0 -0
  170. /package/dist/{wiki-UDPYFJBL.js.map → registry-ONJSILH4.js.map} +0 -0
  171. /package/dist/{workspace-setup-ZWTT42XT.js.map → scheduler-XRM2RJIV.js.map} +0 -0
  172. /package/dist/{subagent-2SJHSSJS.js.map → subagent-EPOT3QDM.js.map} +0 -0
  173. /package/dist/{whatsapp-state-6D6FHHD2.js.map → whatsapp-state-3ZVQ6MQD.js.map} +0 -0
@@ -0,0 +1,1450 @@
1
+ "use strict";var AgentXWorkflowEditor=(()=>{var Pp=Object.create;var ms=Object.defineProperty;var Tp=Object.getOwnPropertyDescriptor;var Mp=Object.getOwnPropertyNames;var Fp=Object.getPrototypeOf,Rp=Object.prototype.hasOwnProperty;var Nt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ip=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Mp(t))!Rp.call(e,o)&&o!==n&&ms(e,o,{get:()=>t[o],enumerable:!(r=Tp(t,o))||r.enumerable});return e};var oe=(e,t,n)=>(n=e!=null?Pp(Fp(e)):{},Ip(t||!e||!e.__esModule?ms(n,"default",{value:e,enumerable:!0}):n,e));var Ts=Nt(H=>{"use strict";var pr=Symbol.for("react.element"),Lp=Symbol.for("react.portal"),zp=Symbol.for("react.fragment"),Ap=Symbol.for("react.strict_mode"),Dp=Symbol.for("react.profiler"),jp=Symbol.for("react.provider"),Up=Symbol.for("react.context"),Wp=Symbol.for("react.forward_ref"),Bp=Symbol.for("react.suspense"),Hp=Symbol.for("react.memo"),Gp=Symbol.for("react.lazy"),ys=Symbol.iterator;function $p(e){return e===null||typeof e!="object"?null:(e=ys&&e[ys]||e["@@iterator"],typeof e=="function"?e:null)}var ks={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_s=Object.assign,bs={};function Sn(e,t,n){this.props=e,this.context=t,this.refs=bs,this.updater=n||ks}Sn.prototype.isReactComponent={};Sn.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")};Sn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ss(){}Ss.prototype=Sn.prototype;function Wi(e,t,n){this.props=e,this.context=t,this.refs=bs,this.updater=n||ks}var Bi=Wi.prototype=new Ss;Bi.constructor=Wi;_s(Bi,Sn.prototype);Bi.isPureReactComponent=!0;var xs=Array.isArray,Ns=Object.prototype.hasOwnProperty,Hi={current:null},Cs={key:!0,ref:!0,__self:!0,__source:!0};function Es(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Ns.call(t,r)&&!Cs.hasOwnProperty(r)&&(o[r]=t[r]);var u=arguments.length-2;if(u===1)o.children=n;else if(1<u){for(var s=Array(u),c=0;c<u;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(r in u=e.defaultProps,u)o[r]===void 0&&(o[r]=u[r]);return{$$typeof:pr,type:e,key:i,ref:a,props:o,_owner:Hi.current}}function Vp(e,t){return{$$typeof:pr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Gi(e){return typeof e=="object"&&e!==null&&e.$$typeof===pr}function Kp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ws=/\/+/g;function Ui(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Kp(""+e.key):t.toString(36)}function uo(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case pr:case Lp:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+Ui(a,0):r,xs(o)?(n="",e!=null&&(n=e.replace(ws,"$&/")+"/"),uo(o,t,n,"",function(c){return c})):o!=null&&(Gi(o)&&(o=Vp(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(ws,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",xs(e))for(var u=0;u<e.length;u++){i=e[u];var s=r+Ui(i,u);a+=uo(i,t,n,s,o)}else if(s=$p(e),typeof s=="function")for(e=s.call(e),u=0;!(i=e.next()).done;)i=i.value,s=r+Ui(i,u++),a+=uo(i,t,n,s,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function so(e,t,n){if(e==null)return e;var r=[],o=0;return uo(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Qp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Fe={current:null},co={transition:null},Jp={ReactCurrentDispatcher:Fe,ReactCurrentBatchConfig:co,ReactCurrentOwner:Hi};function Ps(){throw Error("act(...) is not supported in production builds of React.")}H.Children={map:so,forEach:function(e,t,n){so(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return so(e,function(){t++}),t},toArray:function(e){return so(e,function(t){return t})||[]},only:function(e){if(!Gi(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};H.Component=Sn;H.Fragment=zp;H.Profiler=Dp;H.PureComponent=Wi;H.StrictMode=Ap;H.Suspense=Bp;H.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jp;H.act=Ps;H.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=_s({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=Hi.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(s in t)Ns.call(t,s)&&!Cs.hasOwnProperty(s)&&(r[s]=t[s]===void 0&&u!==void 0?u[s]:t[s])}var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){u=Array(s);for(var c=0;c<s;c++)u[c]=arguments[c+2];r.children=u}return{$$typeof:pr,type:e.type,key:o,ref:i,props:r,_owner:a}};H.createContext=function(e){return e={$$typeof:Up,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:jp,_context:e},e.Consumer=e};H.createElement=Es;H.createFactory=function(e){var t=Es.bind(null,e);return t.type=e,t};H.createRef=function(){return{current:null}};H.forwardRef=function(e){return{$$typeof:Wp,render:e}};H.isValidElement=Gi;H.lazy=function(e){return{$$typeof:Gp,_payload:{_status:-1,_result:e},_init:Qp}};H.memo=function(e,t){return{$$typeof:Hp,type:e,compare:t===void 0?null:t}};H.startTransition=function(e){var t=co.transition;co.transition={};try{e()}finally{co.transition=t}};H.unstable_act=Ps;H.useCallback=function(e,t){return Fe.current.useCallback(e,t)};H.useContext=function(e){return Fe.current.useContext(e)};H.useDebugValue=function(){};H.useDeferredValue=function(e){return Fe.current.useDeferredValue(e)};H.useEffect=function(e,t){return Fe.current.useEffect(e,t)};H.useId=function(){return Fe.current.useId()};H.useImperativeHandle=function(e,t,n){return Fe.current.useImperativeHandle(e,t,n)};H.useInsertionEffect=function(e,t){return Fe.current.useInsertionEffect(e,t)};H.useLayoutEffect=function(e,t){return Fe.current.useLayoutEffect(e,t)};H.useMemo=function(e,t){return Fe.current.useMemo(e,t)};H.useReducer=function(e,t,n){return Fe.current.useReducer(e,t,n)};H.useRef=function(e){return Fe.current.useRef(e)};H.useState=function(e){return Fe.current.useState(e)};H.useSyncExternalStore=function(e,t,n){return Fe.current.useSyncExternalStore(e,t,n)};H.useTransition=function(){return Fe.current.useTransition()};H.version="18.3.1"});var Ct=Nt((Om,Ms)=>{"use strict";Ms.exports=Ts()});var Us=Nt(Y=>{"use strict";function Qi(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<po(o,t))e[r]=t,e[n]=o,n=r;else break e}}function lt(e){return e.length===0?null:e[0]}function go(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var a=2*(r+1)-1,u=e[a],s=a+1,c=e[s];if(0>po(u,n))s<o&&0>po(c,u)?(e[r]=c,e[s]=n,r=s):(e[r]=u,e[a]=n,r=a);else if(s<o&&0>po(c,n))e[r]=c,e[s]=n,r=s;else break e}}return t}function po(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Fs=performance,Y.unstable_now=function(){return Fs.now()}):($i=Date,Rs=$i.now(),Y.unstable_now=function(){return $i.now()-Rs});var Fs,$i,Rs,vt=[],At=[],Yp=1,Ze=null,Se=3,ho=!1,on=!1,gr=!1,Ls=typeof setTimeout=="function"?setTimeout:null,zs=typeof clearTimeout=="function"?clearTimeout:null,Is=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ji(e){for(var t=lt(At);t!==null;){if(t.callback===null)go(At);else if(t.startTime<=e)go(At),t.sortIndex=t.expirationTime,Qi(vt,t);else break;t=lt(At)}}function Yi(e){if(gr=!1,Ji(e),!on)if(lt(vt)!==null)on=!0,qi(Xi);else{var t=lt(At);t!==null&&Zi(Yi,t.startTime-e)}}function Xi(e,t){on=!1,gr&&(gr=!1,zs(hr),hr=-1),ho=!0;var n=Se;try{for(Ji(t),Ze=lt(vt);Ze!==null&&(!(Ze.expirationTime>t)||e&&!js());){var r=Ze.callback;if(typeof r=="function"){Ze.callback=null,Se=Ze.priorityLevel;var o=r(Ze.expirationTime<=t);t=Y.unstable_now(),typeof o=="function"?Ze.callback=o:Ze===lt(vt)&&go(vt),Ji(t)}else go(vt);Ze=lt(vt)}if(Ze!==null)var i=!0;else{var a=lt(At);a!==null&&Zi(Yi,a.startTime-t),i=!1}return i}finally{Ze=null,Se=n,ho=!1}}var mo=!1,fo=null,hr=-1,As=5,Ds=-1;function js(){return!(Y.unstable_now()-Ds<As)}function Vi(){if(fo!==null){var e=Y.unstable_now();Ds=e;var t=!0;try{t=fo(!0,e)}finally{t?fr():(mo=!1,fo=null)}}else mo=!1}var fr;typeof Is=="function"?fr=function(){Is(Vi)}:typeof MessageChannel<"u"?(Ki=new MessageChannel,Os=Ki.port2,Ki.port1.onmessage=Vi,fr=function(){Os.postMessage(null)}):fr=function(){Ls(Vi,0)};var Ki,Os;function qi(e){fo=e,mo||(mo=!0,fr())}function Zi(e,t){hr=Ls(function(){e(Y.unstable_now())},t)}Y.unstable_IdlePriority=5;Y.unstable_ImmediatePriority=1;Y.unstable_LowPriority=4;Y.unstable_NormalPriority=3;Y.unstable_Profiling=null;Y.unstable_UserBlockingPriority=2;Y.unstable_cancelCallback=function(e){e.callback=null};Y.unstable_continueExecution=function(){on||ho||(on=!0,qi(Xi))};Y.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"):As=0<e?Math.floor(1e3/e):5};Y.unstable_getCurrentPriorityLevel=function(){return Se};Y.unstable_getFirstCallbackNode=function(){return lt(vt)};Y.unstable_next=function(e){switch(Se){case 1:case 2:case 3:var t=3;break;default:t=Se}var n=Se;Se=t;try{return e()}finally{Se=n}};Y.unstable_pauseExecution=function(){};Y.unstable_requestPaint=function(){};Y.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Se;Se=e;try{return t()}finally{Se=n}};Y.unstable_scheduleCallback=function(e,t,n){var r=Y.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=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=n+o,e={id:Yp++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,Qi(At,e),lt(vt)===null&&e===lt(At)&&(gr?(zs(hr),hr=-1):gr=!0,Zi(Yi,n-r))):(e.sortIndex=o,Qi(vt,e),on||ho||(on=!0,qi(Xi))),e};Y.unstable_shouldYield=js;Y.unstable_wrapCallback=function(e){var t=Se;return function(){var n=Se;Se=t;try{return e.apply(this,arguments)}finally{Se=n}}}});var Bs=Nt((zm,Ws)=>{"use strict";Ws.exports=Us()});var Vd=Nt(Ye=>{"use strict";var Xp=Ct(),Qe=Bs();function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ju=new Set,Ar={};function yn(e,t){$n(e,t),$n(e+"Capture",t)}function $n(e,t){for(Ar[e]=t,e=0;e<t.length;e++)Ju.add(t[e])}var Rt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_a=Object.prototype.hasOwnProperty,qp=/^[: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]*$/,Hs={},Gs={};function Zp(e){return _a.call(Gs,e)?!0:_a.call(Hs,e)?!1:qp.test(e)?Gs[e]=!0:(Hs[e]=!0,!1)}function ef(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tf(e,t,n,r){if(t===null||typeof t>"u"||ef(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Oe(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var _e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_e[e]=new Oe(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 Oe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_e[e]=new Oe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_e[e]=new Oe(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 Oe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_e[e]=new Oe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_e[e]=new Oe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_e[e]=new Oe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_e[e]=new Oe(e,5,!1,e.toLowerCase(),null,!1,!1)});var gl=/[\-:]([a-z])/g;function hl(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(gl,hl);_e[t]=new Oe(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(gl,hl);_e[t]=new Oe(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(gl,hl);_e[t]=new Oe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_e[e]=new Oe(e,1,!1,e.toLowerCase(),null,!1,!1)});_e.xlinkHref=new Oe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_e[e]=new Oe(e,1,!1,e.toLowerCase(),null,!0,!0)});function ml(e,t,n,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")&&(tf(t,n,o,r)&&(n=null),r||o===null?Zp(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var zt=Xp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,vo=Symbol.for("react.element"),En=Symbol.for("react.portal"),Pn=Symbol.for("react.fragment"),vl=Symbol.for("react.strict_mode"),ba=Symbol.for("react.profiler"),Yu=Symbol.for("react.provider"),Xu=Symbol.for("react.context"),yl=Symbol.for("react.forward_ref"),Sa=Symbol.for("react.suspense"),Na=Symbol.for("react.suspense_list"),xl=Symbol.for("react.memo"),jt=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var qu=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var $s=Symbol.iterator;function mr(e){return e===null||typeof e!="object"?null:(e=$s&&e[$s]||e["@@iterator"],typeof e=="function"?e:null)}var le=Object.assign,ea;function Sr(e){if(ea===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ea=t&&t[1]||""}return`
2
+ `+ea+e}var ta=!1;function na(e,t){if(!e||ta)return"";ta=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
3
+ `),i=r.stack.split(`
4
+ `),a=o.length-1,u=i.length-1;1<=a&&0<=u&&o[a]!==i[u];)u--;for(;1<=a&&0<=u;a--,u--)if(o[a]!==i[u]){if(a!==1||u!==1)do if(a--,u--,0>u||o[a]!==i[u]){var s=`
5
+ `+o[a].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}while(1<=a&&0<=u);break}}}finally{ta=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sr(e):""}function nf(e){switch(e.tag){case 5:return Sr(e.type);case 16:return Sr("Lazy");case 13:return Sr("Suspense");case 19:return Sr("SuspenseList");case 0:case 2:case 15:return e=na(e.type,!1),e;case 11:return e=na(e.type.render,!1),e;case 1:return e=na(e.type,!0),e;default:return""}}function Ca(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 Pn:return"Fragment";case En:return"Portal";case ba:return"Profiler";case vl:return"StrictMode";case Sa:return"Suspense";case Na:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xu:return(e.displayName||"Context")+".Consumer";case Yu:return(e._context.displayName||"Context")+".Provider";case yl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xl:return t=e.displayName||null,t!==null?t:Ca(e.type)||"Memo";case jt:t=e._payload,e=e._init;try{return Ca(e(t))}catch{}}return null}function rf(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 Ca(t);case 8:return t===vl?"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 Zt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function of(e){var t=Zu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yo(e){e._valueTracker||(e._valueTracker=of(e))}function ec(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Zu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vo(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 Ea(e,t){var n=t.checked;return le({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vs(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Zt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function tc(e,t){t=t.checked,t!=null&&ml(e,"checked",t,!1)}function Pa(e,t){tc(e,t);var n=Zt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ta(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ta(e,t.type,Zt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ks(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ta(e,t,n){(t!=="number"||Vo(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nr=Array.isArray;function jn(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Zt(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ma(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return le({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qs(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(_(92));if(Nr(n)){if(1<n.length)throw Error(_(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Zt(n)}}function nc(e,t){var n=Zt(t.value),r=Zt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Js(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function rc(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 Fa(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?rc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var xo,oc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(xo=xo||document.createElement("div"),xo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=xo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Dr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pr={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},af=["Webkit","ms","Moz","O"];Object.keys(Pr).forEach(function(e){af.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pr[t]=Pr[e]})});function ic(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pr.hasOwnProperty(e)&&Pr[e]?(""+t).trim():t+"px"}function ac(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=ic(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var lf=le({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 Ra(e,t){if(t){if(lf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function Ia(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 Oa=null;function wl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var La=null,Un=null,Wn=null;function Ys(e){if(e=no(e)){if(typeof La!="function")throw Error(_(280));var t=e.stateNode;t&&(t=wi(t),La(e.stateNode,e.type,t))}}function lc(e){Un?Wn?Wn.push(e):Wn=[e]:Un=e}function sc(){if(Un){var e=Un,t=Wn;if(Wn=Un=null,Ys(e),t)for(e=0;e<t.length;e++)Ys(t[e])}}function uc(e,t){return e(t)}function cc(){}var ra=!1;function dc(e,t,n){if(ra)return e(t,n);ra=!0;try{return uc(e,t,n)}finally{ra=!1,(Un!==null||Wn!==null)&&(cc(),sc())}}function jr(e,t){var n=e.stateNode;if(n===null)return null;var r=wi(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(_(231,t,typeof n));return n}var za=!1;if(Rt)try{Nn={},Object.defineProperty(Nn,"passive",{get:function(){za=!0}}),window.addEventListener("test",Nn,Nn),window.removeEventListener("test",Nn,Nn)}catch{za=!1}var Nn;function sf(e,t,n,r,o,i,a,u,s){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Tr=!1,Ko=null,Qo=!1,Aa=null,uf={onError:function(e){Tr=!0,Ko=e}};function cf(e,t,n,r,o,i,a,u,s){Tr=!1,Ko=null,sf.apply(uf,arguments)}function df(e,t,n,r,o,i,a,u,s){if(cf.apply(this,arguments),Tr){if(Tr){var c=Ko;Tr=!1,Ko=null}else throw Error(_(198));Qo||(Qo=!0,Aa=c)}}function xn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function pc(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 Xs(e){if(xn(e)!==e)throw Error(_(188))}function pf(e){var t=e.alternate;if(!t){if(t=xn(e),t===null)throw Error(_(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Xs(o),e;if(i===r)return Xs(o),t;i=i.sibling}throw Error(_(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,u=o.child;u;){if(u===n){a=!0,n=o,r=i;break}if(u===r){a=!0,r=o,n=i;break}u=u.sibling}if(!a){for(u=i.child;u;){if(u===n){a=!0,n=i,r=o;break}if(u===r){a=!0,r=i,n=o;break}u=u.sibling}if(!a)throw Error(_(189))}}if(n.alternate!==r)throw Error(_(190))}if(n.tag!==3)throw Error(_(188));return n.stateNode.current===n?e:t}function fc(e){return e=pf(e),e!==null?gc(e):null}function gc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gc(e);if(t!==null)return t;e=e.sibling}return null}var hc=Qe.unstable_scheduleCallback,qs=Qe.unstable_cancelCallback,ff=Qe.unstable_shouldYield,gf=Qe.unstable_requestPaint,de=Qe.unstable_now,hf=Qe.unstable_getCurrentPriorityLevel,kl=Qe.unstable_ImmediatePriority,mc=Qe.unstable_UserBlockingPriority,Jo=Qe.unstable_NormalPriority,mf=Qe.unstable_LowPriority,vc=Qe.unstable_IdlePriority,mi=null,kt=null;function vf(e){if(kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(mi,e,void 0,(e.current.flags&128)===128)}catch{}}var pt=Math.clz32?Math.clz32:wf,yf=Math.log,xf=Math.LN2;function wf(e){return e>>>=0,e===0?32:31-(yf(e)/xf|0)|0}var wo=64,ko=4194304;function Cr(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 Yo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var u=a&~o;u!==0?r=Cr(u):(i&=a,i!==0&&(r=Cr(i)))}else a=n&~o,a!==0?r=Cr(a):i!==0&&(r=Cr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-pt(t),o=1<<n,r|=e[n],t&=~o;return r}function kf(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 _f(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-pt(i),u=1<<a,s=o[a];s===-1?(!(u&n)||u&r)&&(o[a]=kf(u,t)):s<=t&&(e.expiredLanes|=u),i&=~u}}function Da(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yc(){var e=wo;return wo<<=1,!(wo&4194240)&&(wo=64),e}function oa(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function eo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pt(t),e[t]=n}function bf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-pt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function _l(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-pt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var J=0;function xc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var wc,bl,kc,_c,bc,ja=!1,_o=[],$t=null,Vt=null,Kt=null,Ur=new Map,Wr=new Map,Wt=[],Sf="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 Zs(e,t){switch(e){case"focusin":case"focusout":$t=null;break;case"dragenter":case"dragleave":Vt=null;break;case"mouseover":case"mouseout":Kt=null;break;case"pointerover":case"pointerout":Ur.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wr.delete(t.pointerId)}}function vr(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=no(t),t!==null&&bl(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Nf(e,t,n,r,o){switch(t){case"focusin":return $t=vr($t,e,t,n,r,o),!0;case"dragenter":return Vt=vr(Vt,e,t,n,r,o),!0;case"mouseover":return Kt=vr(Kt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Ur.set(i,vr(Ur.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Wr.set(i,vr(Wr.get(i)||null,e,t,n,r,o)),!0}return!1}function Sc(e){var t=sn(e.target);if(t!==null){var n=xn(t);if(n!==null){if(t=n.tag,t===13){if(t=pc(n),t!==null){e.blockedOn=t,bc(e.priority,function(){kc(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ua(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Oa=r,n.target.dispatchEvent(r),Oa=null}else return t=no(n),t!==null&&bl(t),e.blockedOn=n,!1;t.shift()}return!0}function eu(e,t,n){zo(e)&&n.delete(t)}function Cf(){ja=!1,$t!==null&&zo($t)&&($t=null),Vt!==null&&zo(Vt)&&(Vt=null),Kt!==null&&zo(Kt)&&(Kt=null),Ur.forEach(eu),Wr.forEach(eu)}function yr(e,t){e.blockedOn===t&&(e.blockedOn=null,ja||(ja=!0,Qe.unstable_scheduleCallback(Qe.unstable_NormalPriority,Cf)))}function Br(e){function t(o){return yr(o,e)}if(0<_o.length){yr(_o[0],e);for(var n=1;n<_o.length;n++){var r=_o[n];r.blockedOn===e&&(r.blockedOn=null)}}for($t!==null&&yr($t,e),Vt!==null&&yr(Vt,e),Kt!==null&&yr(Kt,e),Ur.forEach(t),Wr.forEach(t),n=0;n<Wt.length;n++)r=Wt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wt.length&&(n=Wt[0],n.blockedOn===null);)Sc(n),n.blockedOn===null&&Wt.shift()}var Bn=zt.ReactCurrentBatchConfig,Xo=!0;function Ef(e,t,n,r){var o=J,i=Bn.transition;Bn.transition=null;try{J=1,Sl(e,t,n,r)}finally{J=o,Bn.transition=i}}function Pf(e,t,n,r){var o=J,i=Bn.transition;Bn.transition=null;try{J=4,Sl(e,t,n,r)}finally{J=o,Bn.transition=i}}function Sl(e,t,n,r){if(Xo){var o=Ua(e,t,n,r);if(o===null)da(e,t,r,qo,n),Zs(e,r);else if(Nf(o,e,t,n,r))r.stopPropagation();else if(Zs(e,r),t&4&&-1<Sf.indexOf(e)){for(;o!==null;){var i=no(o);if(i!==null&&wc(i),i=Ua(e,t,n,r),i===null&&da(e,t,r,qo,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else da(e,t,r,null,n)}}var qo=null;function Ua(e,t,n,r){if(qo=null,e=wl(r),e=sn(e),e!==null)if(t=xn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=pc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return qo=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(hf()){case kl:return 1;case mc:return 4;case Jo:case mf:return 16;case vc:return 536870912;default:return 16}default:return 16}}var Ht=null,Nl=null,Ao=null;function Cc(){if(Ao)return Ao;var e,t=Nl,n=t.length,r,o="value"in Ht?Ht.value:Ht.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return Ao=o.slice(e,1<r?1-r:void 0)}function Do(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 bo(){return!0}function tu(){return!1}function Je(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var u in e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(i):i[u]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?bo:tu,this.isPropagationStopped=tu,this}return le(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=bo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=bo)},persist:function(){},isPersistent:bo}),t}var qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cl=Je(qn),to=le({},qn,{view:0,detail:0}),Tf=Je(to),ia,aa,xr,vi=le({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:El,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!==xr&&(xr&&e.type==="mousemove"?(ia=e.screenX-xr.screenX,aa=e.screenY-xr.screenY):aa=ia=0,xr=e),ia)},movementY:function(e){return"movementY"in e?e.movementY:aa}}),nu=Je(vi),Mf=le({},vi,{dataTransfer:0}),Ff=Je(Mf),Rf=le({},to,{relatedTarget:0}),la=Je(Rf),If=le({},qn,{animationName:0,elapsedTime:0,pseudoElement:0}),Of=Je(If),Lf=le({},qn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zf=Je(Lf),Af=le({},qn,{data:0}),ru=Je(Af),Df={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jf={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"},Uf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Uf[e])?!!t[e]:!1}function El(){return Wf}var Bf=le({},to,{key:function(e){if(e.key){var t=Df[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Do(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:El,charCode:function(e){return e.type==="keypress"?Do(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Do(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hf=Je(Bf),Gf=le({},vi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ou=Je(Gf),$f=le({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:El}),Vf=Je($f),Kf=le({},qn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qf=Je(Kf),Jf=le({},vi,{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}),Yf=Je(Jf),Xf=[9,13,27,32],Pl=Rt&&"CompositionEvent"in window,Mr=null;Rt&&"documentMode"in document&&(Mr=document.documentMode);var qf=Rt&&"TextEvent"in window&&!Mr,Ec=Rt&&(!Pl||Mr&&8<Mr&&11>=Mr),iu=String.fromCharCode(32),au=!1;function Pc(e,t){switch(e){case"keyup":return Xf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tn=!1;function Zf(e,t){switch(e){case"compositionend":return Tc(t);case"keypress":return t.which!==32?null:(au=!0,iu);case"textInput":return e=t.data,e===iu&&au?null:e;default:return null}}function eg(e,t){if(Tn)return e==="compositionend"||!Pl&&Pc(e,t)?(e=Cc(),Ao=Nl=Ht=null,Tn=!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 Ec&&t.locale!=="ko"?null:t.data;default:return null}}var tg={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 lu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tg[e.type]:t==="textarea"}function Mc(e,t,n,r){lc(r),t=Zo(t,"onChange"),0<t.length&&(n=new Cl("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Fr=null,Hr=null;function ng(e){Wc(e,0)}function yi(e){var t=Rn(e);if(ec(t))return e}function rg(e,t){if(e==="change")return t}var Fc=!1;Rt&&(Rt?(No="oninput"in document,No||(sa=document.createElement("div"),sa.setAttribute("oninput","return;"),No=typeof sa.oninput=="function"),So=No):So=!1,Fc=So&&(!document.documentMode||9<document.documentMode));var So,No,sa;function su(){Fr&&(Fr.detachEvent("onpropertychange",Rc),Hr=Fr=null)}function Rc(e){if(e.propertyName==="value"&&yi(Hr)){var t=[];Mc(t,Hr,e,wl(e)),dc(ng,t)}}function og(e,t,n){e==="focusin"?(su(),Fr=t,Hr=n,Fr.attachEvent("onpropertychange",Rc)):e==="focusout"&&su()}function ig(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yi(Hr)}function ag(e,t){if(e==="click")return yi(t)}function lg(e,t){if(e==="input"||e==="change")return yi(t)}function sg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gt=typeof Object.is=="function"?Object.is:sg;function Gr(e,t){if(gt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!_a.call(t,o)||!gt(e[o],t[o]))return!1}return!0}function uu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cu(e,t){var n=uu(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=uu(n)}}function Ic(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ic(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Oc(){for(var e=window,t=Vo();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vo(e.document)}return t}function Tl(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 ug(e){var t=Oc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ic(n.ownerDocument.documentElement,n)){if(r!==null&&Tl(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=cu(n,i);var a=cu(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var cg=Rt&&"documentMode"in document&&11>=document.documentMode,Mn=null,Wa=null,Rr=null,Ba=!1;function du(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ba||Mn==null||Mn!==Vo(r)||(r=Mn,"selectionStart"in r&&Tl(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}),Rr&&Gr(Rr,r)||(Rr=r,r=Zo(Wa,"onSelect"),0<r.length&&(t=new Cl("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Mn)))}function Co(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Fn={animationend:Co("Animation","AnimationEnd"),animationiteration:Co("Animation","AnimationIteration"),animationstart:Co("Animation","AnimationStart"),transitionend:Co("Transition","TransitionEnd")},ua={},Lc={};Rt&&(Lc=document.createElement("div").style,"AnimationEvent"in window||(delete Fn.animationend.animation,delete Fn.animationiteration.animation,delete Fn.animationstart.animation),"TransitionEvent"in window||delete Fn.transitionend.transition);function xi(e){if(ua[e])return ua[e];if(!Fn[e])return e;var t=Fn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lc)return ua[e]=t[n];return e}var zc=xi("animationend"),Ac=xi("animationiteration"),Dc=xi("animationstart"),jc=xi("transitionend"),Uc=new Map,pu="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 tn(e,t){Uc.set(e,t),yn(t,[e])}for(Eo=0;Eo<pu.length;Eo++)Po=pu[Eo],fu=Po.toLowerCase(),gu=Po[0].toUpperCase()+Po.slice(1),tn(fu,"on"+gu);var Po,fu,gu,Eo;tn(zc,"onAnimationEnd");tn(Ac,"onAnimationIteration");tn(Dc,"onAnimationStart");tn("dblclick","onDoubleClick");tn("focusin","onFocus");tn("focusout","onBlur");tn(jc,"onTransitionEnd");$n("onMouseEnter",["mouseout","mouseover"]);$n("onMouseLeave",["mouseout","mouseover"]);$n("onPointerEnter",["pointerout","pointerover"]);$n("onPointerLeave",["pointerout","pointerover"]);yn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yn("onBeforeInput",["compositionend","keypress","textInput","paste"]);yn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Er="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(" "),dg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Er));function hu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,df(r,t,void 0,e),e.currentTarget=null}function Wc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var u=r[a],s=u.instance,c=u.currentTarget;if(u=u.listener,s!==i&&o.isPropagationStopped())break e;hu(o,u,c),i=s}else for(a=0;a<r.length;a++){if(u=r[a],s=u.instance,c=u.currentTarget,u=u.listener,s!==i&&o.isPropagationStopped())break e;hu(o,u,c),i=s}}}if(Qo)throw e=Aa,Qo=!1,Aa=null,e}function ee(e,t){var n=t[Ka];n===void 0&&(n=t[Ka]=new Set);var r=e+"__bubble";n.has(r)||(Bc(t,e,2,!1),n.add(r))}function ca(e,t,n){var r=0;t&&(r|=4),Bc(n,e,r,t)}var To="_reactListening"+Math.random().toString(36).slice(2);function $r(e){if(!e[To]){e[To]=!0,Ju.forEach(function(n){n!=="selectionchange"&&(dg.has(n)||ca(n,!1,e),ca(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[To]||(t[To]=!0,ca("selectionchange",!1,t))}}function Bc(e,t,n,r){switch(Nc(t)){case 1:var o=Ef;break;case 4:o=Pf;break;default:o=Sl}n=o.bind(null,t,n,e),o=void 0,!za||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function da(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var u=r.stateNode.containerInfo;if(u===o||u.nodeType===8&&u.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var s=a.tag;if((s===3||s===4)&&(s=a.stateNode.containerInfo,s===o||s.nodeType===8&&s.parentNode===o))return;a=a.return}for(;u!==null;){if(a=sn(u),a===null)return;if(s=a.tag,s===5||s===6){r=i=a;continue e}u=u.parentNode}}r=r.return}dc(function(){var c=i,d=wl(n),g=[];e:{var m=Uc.get(e);if(m!==void 0){var y=Cl,k=e;switch(e){case"keypress":if(Do(n)===0)break e;case"keydown":case"keyup":y=Hf;break;case"focusin":k="focus",y=la;break;case"focusout":k="blur",y=la;break;case"beforeblur":case"afterblur":y=la;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=nu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=Ff;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Vf;break;case zc:case Ac:case Dc:y=Of;break;case jc:y=Qf;break;case"scroll":y=Tf;break;case"wheel":y=Yf;break;case"copy":case"cut":case"paste":y=zf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=ou}var S=(t&4)!==0,B=!S&&e==="scroll",f=S?m!==null?m+"Capture":null:m;S=[];for(var p=c,h;p!==null;){h=p;var x=h.stateNode;if(h.tag===5&&x!==null&&(h=x,f!==null&&(x=jr(p,f),x!=null&&S.push(Vr(p,x,h)))),B)break;p=p.return}0<S.length&&(m=new y(m,k,null,n,d),g.push({event:m,listeners:S}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",m&&n!==Oa&&(k=n.relatedTarget||n.fromElement)&&(sn(k)||k[It]))break e;if((y||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,y?(k=n.relatedTarget||n.toElement,y=c,k=k?sn(k):null,k!==null&&(B=xn(k),k!==B||k.tag!==5&&k.tag!==6)&&(k=null)):(y=null,k=c),y!==k)){if(S=nu,x="onMouseLeave",f="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(S=ou,x="onPointerLeave",f="onPointerEnter",p="pointer"),B=y==null?m:Rn(y),h=k==null?m:Rn(k),m=new S(x,p+"leave",y,n,d),m.target=B,m.relatedTarget=h,x=null,sn(d)===c&&(S=new S(f,p+"enter",k,n,d),S.target=h,S.relatedTarget=B,x=S),B=x,y&&k)t:{for(S=y,f=k,p=0,h=S;h;h=Cn(h))p++;for(h=0,x=f;x;x=Cn(x))h++;for(;0<p-h;)S=Cn(S),p--;for(;0<h-p;)f=Cn(f),h--;for(;p--;){if(S===f||f!==null&&S===f.alternate)break t;S=Cn(S),f=Cn(f)}S=null}else S=null;y!==null&&mu(g,m,y,S,!1),k!==null&&B!==null&&mu(g,B,k,S,!0)}}e:{if(m=c?Rn(c):window,y=m.nodeName&&m.nodeName.toLowerCase(),y==="select"||y==="input"&&m.type==="file")var C=rg;else if(lu(m))if(Fc)C=lg;else{C=ig;var M=og}else(y=m.nodeName)&&y.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(C=ag);if(C&&(C=C(e,c))){Mc(g,C,n,d);break e}M&&M(e,m,c),e==="focusout"&&(M=m._wrapperState)&&M.controlled&&m.type==="number"&&Ta(m,"number",m.value)}switch(M=c?Rn(c):window,e){case"focusin":(lu(M)||M.contentEditable==="true")&&(Mn=M,Wa=c,Rr=null);break;case"focusout":Rr=Wa=Mn=null;break;case"mousedown":Ba=!0;break;case"contextmenu":case"mouseup":case"dragend":Ba=!1,du(g,n,d);break;case"selectionchange":if(cg)break;case"keydown":case"keyup":du(g,n,d)}var F;if(Pl)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Tn?Pc(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Ec&&n.locale!=="ko"&&(Tn||P!=="onCompositionStart"?P==="onCompositionEnd"&&Tn&&(F=Cc()):(Ht=d,Nl="value"in Ht?Ht.value:Ht.textContent,Tn=!0)),M=Zo(c,P),0<M.length&&(P=new ru(P,e,null,n,d),g.push({event:P,listeners:M}),F?P.data=F:(F=Tc(n),F!==null&&(P.data=F)))),(F=qf?Zf(e,n):eg(e,n))&&(c=Zo(c,"onBeforeInput"),0<c.length&&(d=new ru("onBeforeInput","beforeinput",null,n,d),g.push({event:d,listeners:c}),d.data=F))}Wc(g,t)})}function Vr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zo(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=jr(e,n),i!=null&&r.unshift(Vr(e,i,o)),i=jr(e,t),i!=null&&r.push(Vr(e,i,o))),e=e.return}return r}function Cn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function mu(e,t,n,r,o){for(var i=t._reactName,a=[];n!==null&&n!==r;){var u=n,s=u.alternate,c=u.stateNode;if(s!==null&&s===r)break;u.tag===5&&c!==null&&(u=c,o?(s=jr(n,i),s!=null&&a.unshift(Vr(n,s,u))):o||(s=jr(n,i),s!=null&&a.push(Vr(n,s,u)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var pg=/\r\n?/g,fg=/\u0000|\uFFFD/g;function vu(e){return(typeof e=="string"?e:""+e).replace(pg,`
6
+ `).replace(fg,"")}function Mo(e,t,n){if(t=vu(t),vu(e)!==t&&n)throw Error(_(425))}function ei(){}var Ha=null,Ga=null;function $a(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 Va=typeof setTimeout=="function"?setTimeout:void 0,gg=typeof clearTimeout=="function"?clearTimeout:void 0,yu=typeof Promise=="function"?Promise:void 0,hg=typeof queueMicrotask=="function"?queueMicrotask:typeof yu<"u"?function(e){return yu.resolve(null).then(e).catch(mg)}:Va;function mg(e){setTimeout(function(){throw e})}function pa(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Br(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Br(t)}function Qt(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 xu(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Zn=Math.random().toString(36).slice(2),wt="__reactFiber$"+Zn,Kr="__reactProps$"+Zn,It="__reactContainer$"+Zn,Ka="__reactEvents$"+Zn,vg="__reactListeners$"+Zn,yg="__reactHandles$"+Zn;function sn(e){var t=e[wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[It]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xu(e);e!==null;){if(n=e[wt])return n;e=xu(e)}return t}e=n,n=e.parentNode}return null}function no(e){return e=e[wt]||e[It],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Rn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function wi(e){return e[Kr]||null}var Qa=[],In=-1;function nn(e){return{current:e}}function te(e){0>In||(e.current=Qa[In],Qa[In]=null,In--)}function X(e,t){In++,Qa[In]=e.current,e.current=t}var en={},Pe=nn(en),De=nn(!1),fn=en;function Vn(e,t){var n=e.type.contextTypes;if(!n)return en;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function je(e){return e=e.childContextTypes,e!=null}function ti(){te(De),te(Pe)}function wu(e,t,n){if(Pe.current!==en)throw Error(_(168));X(Pe,t),X(De,n)}function Hc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(_(108,rf(e)||"Unknown",o));return le({},n,r)}function ni(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||en,fn=Pe.current,X(Pe,e),X(De,De.current),!0}function ku(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Hc(e,t,fn),r.__reactInternalMemoizedMergedChildContext=e,te(De),te(Pe),X(Pe,e)):te(De),X(De,n)}var Pt=null,ki=!1,fa=!1;function Gc(e){Pt===null?Pt=[e]:Pt.push(e)}function xg(e){ki=!0,Gc(e)}function rn(){if(!fa&&Pt!==null){fa=!0;var e=0,t=J;try{var n=Pt;for(J=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Pt=null,ki=!1}catch(o){throw Pt!==null&&(Pt=Pt.slice(e+1)),hc(kl,rn),o}finally{J=t,fa=!1}}return null}var On=[],Ln=0,ri=null,oi=0,et=[],tt=0,gn=null,Tt=1,Mt="";function an(e,t){On[Ln++]=oi,On[Ln++]=ri,ri=e,oi=t}function $c(e,t,n){et[tt++]=Tt,et[tt++]=Mt,et[tt++]=gn,gn=e;var r=Tt;e=Mt;var o=32-pt(r)-1;r&=~(1<<o),n+=1;var i=32-pt(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Tt=1<<32-pt(t)+o|n<<o|r,Mt=i+e}else Tt=1<<i|n<<o|r,Mt=e}function Ml(e){e.return!==null&&(an(e,1),$c(e,1,0))}function Fl(e){for(;e===ri;)ri=On[--Ln],On[Ln]=null,oi=On[--Ln],On[Ln]=null;for(;e===gn;)gn=et[--tt],et[tt]=null,Mt=et[--tt],et[tt]=null,Tt=et[--tt],et[tt]=null}var Ke=null,Ve=null,ne=!1,dt=null;function Vc(e,t){var n=nt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function _u(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ke=e,Ve=Qt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ke=e,Ve=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gn!==null?{id:Tt,overflow:Mt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ke=e,Ve=null,!0):!1;default:return!1}}function Ja(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ya(e){if(ne){var t=Ve;if(t){var n=t;if(!_u(e,t)){if(Ja(e))throw Error(_(418));t=Qt(n.nextSibling);var r=Ke;t&&_u(e,t)?Vc(r,n):(e.flags=e.flags&-4097|2,ne=!1,Ke=e)}}else{if(Ja(e))throw Error(_(418));e.flags=e.flags&-4097|2,ne=!1,Ke=e}}}function bu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ke=e}function Fo(e){if(e!==Ke)return!1;if(!ne)return bu(e),ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!$a(e.type,e.memoizedProps)),t&&(t=Ve)){if(Ja(e))throw Kc(),Error(_(418));for(;t;)Vc(e,t),t=Qt(t.nextSibling)}if(bu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ve=Qt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ve=null}}else Ve=Ke?Qt(e.stateNode.nextSibling):null;return!0}function Kc(){for(var e=Ve;e;)e=Qt(e.nextSibling)}function Kn(){Ve=Ke=null,ne=!1}function Rl(e){dt===null?dt=[e]:dt.push(e)}var wg=zt.ReactCurrentBatchConfig;function wr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(_(309));var r=n.stateNode}if(!r)throw Error(_(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var u=o.refs;a===null?delete u[i]:u[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(_(284));if(!n._owner)throw Error(_(290,e))}return e}function Ro(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Su(e){var t=e._init;return t(e._payload)}function Qc(e){function t(f,p){if(e){var h=f.deletions;h===null?(f.deletions=[p],f.flags|=16):h.push(p)}}function n(f,p){if(!e)return null;for(;p!==null;)t(f,p),p=p.sibling;return null}function r(f,p){for(f=new Map;p!==null;)p.key!==null?f.set(p.key,p):f.set(p.index,p),p=p.sibling;return f}function o(f,p){return f=qt(f,p),f.index=0,f.sibling=null,f}function i(f,p,h){return f.index=h,e?(h=f.alternate,h!==null?(h=h.index,h<p?(f.flags|=2,p):h):(f.flags|=2,p)):(f.flags|=1048576,p)}function a(f){return e&&f.alternate===null&&(f.flags|=2),f}function u(f,p,h,x){return p===null||p.tag!==6?(p=wa(h,f.mode,x),p.return=f,p):(p=o(p,h),p.return=f,p)}function s(f,p,h,x){var C=h.type;return C===Pn?d(f,p,h.props.children,x,h.key):p!==null&&(p.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===jt&&Su(C)===p.type)?(x=o(p,h.props),x.ref=wr(f,p,h),x.return=f,x):(x=$o(h.type,h.key,h.props,null,f.mode,x),x.ref=wr(f,p,h),x.return=f,x)}function c(f,p,h,x){return p===null||p.tag!==4||p.stateNode.containerInfo!==h.containerInfo||p.stateNode.implementation!==h.implementation?(p=ka(h,f.mode,x),p.return=f,p):(p=o(p,h.children||[]),p.return=f,p)}function d(f,p,h,x,C){return p===null||p.tag!==7?(p=pn(h,f.mode,x,C),p.return=f,p):(p=o(p,h),p.return=f,p)}function g(f,p,h){if(typeof p=="string"&&p!==""||typeof p=="number")return p=wa(""+p,f.mode,h),p.return=f,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case vo:return h=$o(p.type,p.key,p.props,null,f.mode,h),h.ref=wr(f,null,p),h.return=f,h;case En:return p=ka(p,f.mode,h),p.return=f,p;case jt:var x=p._init;return g(f,x(p._payload),h)}if(Nr(p)||mr(p))return p=pn(p,f.mode,h,null),p.return=f,p;Ro(f,p)}return null}function m(f,p,h,x){var C=p!==null?p.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return C!==null?null:u(f,p,""+h,x);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case vo:return h.key===C?s(f,p,h,x):null;case En:return h.key===C?c(f,p,h,x):null;case jt:return C=h._init,m(f,p,C(h._payload),x)}if(Nr(h)||mr(h))return C!==null?null:d(f,p,h,x,null);Ro(f,h)}return null}function y(f,p,h,x,C){if(typeof x=="string"&&x!==""||typeof x=="number")return f=f.get(h)||null,u(p,f,""+x,C);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case vo:return f=f.get(x.key===null?h:x.key)||null,s(p,f,x,C);case En:return f=f.get(x.key===null?h:x.key)||null,c(p,f,x,C);case jt:var M=x._init;return y(f,p,h,M(x._payload),C)}if(Nr(x)||mr(x))return f=f.get(h)||null,d(p,f,x,C,null);Ro(p,x)}return null}function k(f,p,h,x){for(var C=null,M=null,F=p,P=p=0,K=null;F!==null&&P<h.length;P++){F.index>P?(K=F,F=null):K=F.sibling;var W=m(f,F,h[P],x);if(W===null){F===null&&(F=K);break}e&&F&&W.alternate===null&&t(f,F),p=i(W,p,P),M===null?C=W:M.sibling=W,M=W,F=K}if(P===h.length)return n(f,F),ne&&an(f,P),C;if(F===null){for(;P<h.length;P++)F=g(f,h[P],x),F!==null&&(p=i(F,p,P),M===null?C=F:M.sibling=F,M=F);return ne&&an(f,P),C}for(F=r(f,F);P<h.length;P++)K=y(F,f,P,h[P],x),K!==null&&(e&&K.alternate!==null&&F.delete(K.key===null?P:K.key),p=i(K,p,P),M===null?C=K:M.sibling=K,M=K);return e&&F.forEach(function(ve){return t(f,ve)}),ne&&an(f,P),C}function S(f,p,h,x){var C=mr(h);if(typeof C!="function")throw Error(_(150));if(h=C.call(h),h==null)throw Error(_(151));for(var M=C=null,F=p,P=p=0,K=null,W=h.next();F!==null&&!W.done;P++,W=h.next()){F.index>P?(K=F,F=null):K=F.sibling;var ve=m(f,F,W.value,x);if(ve===null){F===null&&(F=K);break}e&&F&&ve.alternate===null&&t(f,F),p=i(ve,p,P),M===null?C=ve:M.sibling=ve,M=ve,F=K}if(W.done)return n(f,F),ne&&an(f,P),C;if(F===null){for(;!W.done;P++,W=h.next())W=g(f,W.value,x),W!==null&&(p=i(W,p,P),M===null?C=W:M.sibling=W,M=W);return ne&&an(f,P),C}for(F=r(f,F);!W.done;P++,W=h.next())W=y(F,f,P,W.value,x),W!==null&&(e&&W.alternate!==null&&F.delete(W.key===null?P:W.key),p=i(W,p,P),M===null?C=W:M.sibling=W,M=W);return e&&F.forEach(function(ir){return t(f,ir)}),ne&&an(f,P),C}function B(f,p,h,x){if(typeof h=="object"&&h!==null&&h.type===Pn&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case vo:e:{for(var C=h.key,M=p;M!==null;){if(M.key===C){if(C=h.type,C===Pn){if(M.tag===7){n(f,M.sibling),p=o(M,h.props.children),p.return=f,f=p;break e}}else if(M.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===jt&&Su(C)===M.type){n(f,M.sibling),p=o(M,h.props),p.ref=wr(f,M,h),p.return=f,f=p;break e}n(f,M);break}else t(f,M);M=M.sibling}h.type===Pn?(p=pn(h.props.children,f.mode,x,h.key),p.return=f,f=p):(x=$o(h.type,h.key,h.props,null,f.mode,x),x.ref=wr(f,p,h),x.return=f,f=x)}return a(f);case En:e:{for(M=h.key;p!==null;){if(p.key===M)if(p.tag===4&&p.stateNode.containerInfo===h.containerInfo&&p.stateNode.implementation===h.implementation){n(f,p.sibling),p=o(p,h.children||[]),p.return=f,f=p;break e}else{n(f,p);break}else t(f,p);p=p.sibling}p=ka(h,f.mode,x),p.return=f,f=p}return a(f);case jt:return M=h._init,B(f,p,M(h._payload),x)}if(Nr(h))return k(f,p,h,x);if(mr(h))return S(f,p,h,x);Ro(f,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,p!==null&&p.tag===6?(n(f,p.sibling),p=o(p,h),p.return=f,f=p):(n(f,p),p=wa(h,f.mode,x),p.return=f,f=p),a(f)):n(f,p)}return B}var Qn=Qc(!0),Jc=Qc(!1),ii=nn(null),ai=null,zn=null,Il=null;function Ol(){Il=zn=ai=null}function Ll(e){var t=ii.current;te(ii),e._currentValue=t}function Xa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hn(e,t){ai=e,Il=zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ae=!0),e.firstContext=null)}function ot(e){var t=e._currentValue;if(Il!==e)if(e={context:e,memoizedValue:t,next:null},zn===null){if(ai===null)throw Error(_(308));zn=e,ai.dependencies={lanes:0,firstContext:e}}else zn=zn.next=e;return t}var un=null;function zl(e){un===null?un=[e]:un.push(e)}function Yc(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,zl(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ot(e,r)}function Ot(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ut=!1;function Al(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xc(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 Ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Jt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Ot(e,n)}return o=r.interleaved,o===null?(t.next=t,zl(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ot(e,n)}function jo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_l(e,n)}}function Nu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function li(e,t,n,r){var o=e.updateQueue;Ut=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,u=o.shared.pending;if(u!==null){o.shared.pending=null;var s=u,c=s.next;s.next=null,a===null?i=c:a.next=c,a=s;var d=e.alternate;d!==null&&(d=d.updateQueue,u=d.lastBaseUpdate,u!==a&&(u===null?d.firstBaseUpdate=c:u.next=c,d.lastBaseUpdate=s))}if(i!==null){var g=o.baseState;a=0,d=c=s=null,u=i;do{var m=u.lane,y=u.eventTime;if((r&m)===m){d!==null&&(d=d.next={eventTime:y,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var k=e,S=u;switch(m=t,y=n,S.tag){case 1:if(k=S.payload,typeof k=="function"){g=k.call(y,g,m);break e}g=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=S.payload,m=typeof k=="function"?k.call(y,g,m):k,m==null)break e;g=le({},g,m);break e;case 2:Ut=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[u]:m.push(u))}else y={eventTime:y,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},d===null?(c=d=y,s=g):d=d.next=y,a|=m;if(u=u.next,u===null){if(u=o.shared.pending,u===null)break;m=u,u=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(1);if(d===null&&(s=g),o.baseState=s,o.firstBaseUpdate=c,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);mn|=a,e.lanes=a,e.memoizedState=g}}function Cu(e,t,n){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=n,typeof o!="function")throw Error(_(191,o));o.call(r)}}}var ro={},_t=nn(ro),Qr=nn(ro),Jr=nn(ro);function cn(e){if(e===ro)throw Error(_(174));return e}function Dl(e,t){switch(X(Jr,t),X(Qr,e),X(_t,ro),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Fa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Fa(t,e)}te(_t),X(_t,t)}function Jn(){te(_t),te(Qr),te(Jr)}function qc(e){cn(Jr.current);var t=cn(_t.current),n=Fa(t,e.type);t!==n&&(X(Qr,e),X(_t,n))}function jl(e){Qr.current===e&&(te(_t),te(Qr))}var ie=nn(0);function si(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ga=[];function Ul(){for(var e=0;e<ga.length;e++)ga[e]._workInProgressVersionPrimary=null;ga.length=0}var Uo=zt.ReactCurrentDispatcher,ha=zt.ReactCurrentBatchConfig,hn=0,ae=null,fe=null,he=null,ui=!1,Ir=!1,Yr=0,kg=0;function Ne(){throw Error(_(321))}function Wl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gt(e[n],t[n]))return!1;return!0}function Bl(e,t,n,r,o,i){if(hn=i,ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Uo.current=e===null||e.memoizedState===null?Ng:Cg,e=n(r,o),Ir){i=0;do{if(Ir=!1,Yr=0,25<=i)throw Error(_(301));i+=1,he=fe=null,t.updateQueue=null,Uo.current=Eg,e=n(r,o)}while(Ir)}if(Uo.current=ci,t=fe!==null&&fe.next!==null,hn=0,he=fe=ae=null,ui=!1,t)throw Error(_(300));return e}function Hl(){var e=Yr!==0;return Yr=0,e}function xt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return he===null?ae.memoizedState=he=e:he=he.next=e,he}function it(){if(fe===null){var e=ae.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=he===null?ae.memoizedState:he.next;if(t!==null)he=t,fe=e;else{if(e===null)throw Error(_(310));fe=e,e={memoizedState:fe.memoizedState,baseState:fe.baseState,baseQueue:fe.baseQueue,queue:fe.queue,next:null},he===null?ae.memoizedState=he=e:he=he.next=e}return he}function Xr(e,t){return typeof t=="function"?t(e):t}function ma(e){var t=it(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=fe,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var u=a=null,s=null,c=i;do{var d=c.lane;if((hn&d)===d)s!==null&&(s=s.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var g={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};s===null?(u=s=g,a=r):s=s.next=g,ae.lanes|=d,mn|=d}c=c.next}while(c!==null&&c!==i);s===null?a=r:s.next=u,gt(r,t.memoizedState)||(Ae=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=s,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,ae.lanes|=i,mn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function va(e){var t=it(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);gt(i,t.memoizedState)||(Ae=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Zc(){}function ed(e,t){var n=ae,r=it(),o=t(),i=!gt(r.memoizedState,o);if(i&&(r.memoizedState=o,Ae=!0),r=r.queue,Gl(rd.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||he!==null&&he.memoizedState.tag&1){if(n.flags|=2048,qr(9,nd.bind(null,n,r,o,t),void 0,null),me===null)throw Error(_(349));hn&30||td(n,t,o)}return o}function td(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ae.updateQueue,t===null?(t={lastEffect:null,stores:null},ae.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function nd(e,t,n,r){t.value=n,t.getSnapshot=r,od(t)&&id(e)}function rd(e,t,n){return n(function(){od(t)&&id(e)})}function od(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gt(e,n)}catch{return!0}}function id(e){var t=Ot(e,1);t!==null&&ft(t,e,1,-1)}function Eu(e){var t=xt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xr,lastRenderedState:e},t.queue=e,e=e.dispatch=Sg.bind(null,ae,e),[t.memoizedState,e]}function qr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ae.updateQueue,t===null?(t={lastEffect:null,stores:null},ae.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function ad(){return it().memoizedState}function Wo(e,t,n,r){var o=xt();ae.flags|=e,o.memoizedState=qr(1|t,n,void 0,r===void 0?null:r)}function _i(e,t,n,r){var o=it();r=r===void 0?null:r;var i=void 0;if(fe!==null){var a=fe.memoizedState;if(i=a.destroy,r!==null&&Wl(r,a.deps)){o.memoizedState=qr(t,n,i,r);return}}ae.flags|=e,o.memoizedState=qr(1|t,n,i,r)}function Pu(e,t){return Wo(8390656,8,e,t)}function Gl(e,t){return _i(2048,8,e,t)}function ld(e,t){return _i(4,2,e,t)}function sd(e,t){return _i(4,4,e,t)}function ud(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 cd(e,t,n){return n=n!=null?n.concat([e]):null,_i(4,4,ud.bind(null,t,e),n)}function $l(){}function dd(e,t){var n=it();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wl(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function pd(e,t){var n=it();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wl(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function fd(e,t,n){return hn&21?(gt(n,t)||(n=yc(),ae.lanes|=n,mn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ae=!0),e.memoizedState=n)}function _g(e,t){var n=J;J=n!==0&&4>n?n:4,e(!0);var r=ha.transition;ha.transition={};try{e(!1),t()}finally{J=n,ha.transition=r}}function gd(){return it().memoizedState}function bg(e,t,n){var r=Xt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hd(e))md(t,n);else if(n=Yc(e,t,n,r),n!==null){var o=Ie();ft(n,e,r,o),vd(n,t,r)}}function Sg(e,t,n){var r=Xt(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hd(e))md(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,u=i(a,n);if(o.hasEagerState=!0,o.eagerState=u,gt(u,a)){var s=t.interleaved;s===null?(o.next=o,zl(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=Yc(e,t,o,r),n!==null&&(o=Ie(),ft(n,e,r,o),vd(n,t,r))}}function hd(e){var t=e.alternate;return e===ae||t!==null&&t===ae}function md(e,t){Ir=ui=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vd(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_l(e,n)}}var ci={readContext:ot,useCallback:Ne,useContext:Ne,useEffect:Ne,useImperativeHandle:Ne,useInsertionEffect:Ne,useLayoutEffect:Ne,useMemo:Ne,useReducer:Ne,useRef:Ne,useState:Ne,useDebugValue:Ne,useDeferredValue:Ne,useTransition:Ne,useMutableSource:Ne,useSyncExternalStore:Ne,useId:Ne,unstable_isNewReconciler:!1},Ng={readContext:ot,useCallback:function(e,t){return xt().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:Pu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Wo(4194308,4,ud.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Wo(4,2,e,t)},useMemo:function(e,t){var n=xt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=bg.bind(null,ae,e),[r.memoizedState,e]},useRef:function(e){var t=xt();return e={current:e},t.memoizedState=e},useState:Eu,useDebugValue:$l,useDeferredValue:function(e){return xt().memoizedState=e},useTransition:function(){var e=Eu(!1),t=e[0];return e=_g.bind(null,e[1]),xt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ae,o=xt();if(ne){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),me===null)throw Error(_(349));hn&30||td(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Pu(rd.bind(null,r,i,e),[e]),r.flags|=2048,qr(9,nd.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=xt(),t=me.identifierPrefix;if(ne){var n=Mt,r=Tt;n=(r&~(1<<32-pt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Yr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=kg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Cg={readContext:ot,useCallback:dd,useContext:ot,useEffect:Gl,useImperativeHandle:cd,useInsertionEffect:ld,useLayoutEffect:sd,useMemo:pd,useReducer:ma,useRef:ad,useState:function(){return ma(Xr)},useDebugValue:$l,useDeferredValue:function(e){var t=it();return fd(t,fe.memoizedState,e)},useTransition:function(){var e=ma(Xr)[0],t=it().memoizedState;return[e,t]},useMutableSource:Zc,useSyncExternalStore:ed,useId:gd,unstable_isNewReconciler:!1},Eg={readContext:ot,useCallback:dd,useContext:ot,useEffect:Gl,useImperativeHandle:cd,useInsertionEffect:ld,useLayoutEffect:sd,useMemo:pd,useReducer:va,useRef:ad,useState:function(){return va(Xr)},useDebugValue:$l,useDeferredValue:function(e){var t=it();return fe===null?t.memoizedState=e:fd(t,fe.memoizedState,e)},useTransition:function(){var e=va(Xr)[0],t=it().memoizedState;return[e,t]},useMutableSource:Zc,useSyncExternalStore:ed,useId:gd,unstable_isNewReconciler:!1};function ut(e,t){if(e&&e.defaultProps){t=le({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function qa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:le({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bi={isMounted:function(e){return(e=e._reactInternals)?xn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ie(),o=Xt(e),i=Ft(r,o);i.payload=t,n!=null&&(i.callback=n),t=Jt(e,i,o),t!==null&&(ft(t,e,o,r),jo(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ie(),o=Xt(e),i=Ft(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Jt(e,i,o),t!==null&&(ft(t,e,o,r),jo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ie(),r=Xt(e),o=Ft(n,r);o.tag=2,t!=null&&(o.callback=t),t=Jt(e,o,r),t!==null&&(ft(t,e,r,n),jo(t,e,r))}};function Tu(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!Gr(n,r)||!Gr(o,i):!0}function yd(e,t,n){var r=!1,o=en,i=t.contextType;return typeof i=="object"&&i!==null?i=ot(i):(o=je(t)?fn:Pe.current,r=t.contextTypes,i=(r=r!=null)?Vn(e,o):en),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=bi,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Mu(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bi.enqueueReplaceState(t,t.state,null)}function Za(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Al(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=ot(i):(i=je(t)?fn:Pe.current,o.context=Vn(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(qa(e,t,i,n),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&&bi.enqueueReplaceState(o,o.state,null),li(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Yn(e,t){try{var n="",r=t;do n+=nf(r),r=r.return;while(r);var o=n}catch(i){o=`
7
+ Error generating stack: `+i.message+`
8
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function ya(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function el(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Pg=typeof WeakMap=="function"?WeakMap:Map;function xd(e,t,n){n=Ft(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pi||(pi=!0,cl=r),el(e,t)},n}function wd(e,t,n){n=Ft(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){el(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){el(e,t),typeof r!="function"&&(Yt===null?Yt=new Set([this]):Yt.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Fu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pg;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(n)||(o.add(n),e=Bg.bind(null,e,t,n),t.then(e,e))}function Ru(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 Iu(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ft(-1,1),t.tag=2,Jt(n,t,1))),n.lanes|=1),e)}var Tg=zt.ReactCurrentOwner,Ae=!1;function Re(e,t,n,r){t.child=e===null?Jc(t,null,n,r):Qn(t,e.child,n,r)}function Ou(e,t,n,r,o){n=n.render;var i=t.ref;return Hn(t,o),r=Bl(e,t,n,r,i,o),n=Hl(),e!==null&&!Ae?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Lt(e,t,o)):(ne&&n&&Ml(t),t.flags|=1,Re(e,t,r,o),t.child)}function Lu(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Zl(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,kd(e,t,i,r,o)):(e=$o(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Gr,n(a,r)&&e.ref===t.ref)return Lt(e,t,o)}return t.flags|=1,e=qt(i,r),e.ref=t.ref,e.return=t,t.child=e}function kd(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Gr(i,r)&&e.ref===t.ref)if(Ae=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Ae=!0);else return t.lanes=e.lanes,Lt(e,t,o)}return tl(e,t,n,r,o)}function _d(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},X(Dn,$e),$e|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,X(Dn,$e),$e|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,X(Dn,$e),$e|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,X(Dn,$e),$e|=r;return Re(e,t,o,n),t.child}function bd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function tl(e,t,n,r,o){var i=je(n)?fn:Pe.current;return i=Vn(t,i),Hn(t,o),n=Bl(e,t,n,r,i,o),r=Hl(),e!==null&&!Ae?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Lt(e,t,o)):(ne&&r&&Ml(t),t.flags|=1,Re(e,t,n,o),t.child)}function zu(e,t,n,r,o){if(je(n)){var i=!0;ni(t)}else i=!1;if(Hn(t,o),t.stateNode===null)Bo(e,t),yd(t,n,r),Za(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,u=t.memoizedProps;a.props=u;var s=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=ot(c):(c=je(n)?fn:Pe.current,c=Vn(t,c));var d=n.getDerivedStateFromProps,g=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";g||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u!==r||s!==c)&&Mu(t,a,r,c),Ut=!1;var m=t.memoizedState;a.state=m,li(t,r,a,o),s=t.memoizedState,u!==r||m!==s||De.current||Ut?(typeof d=="function"&&(qa(t,n,d,r),s=t.memoizedState),(u=Ut||Tu(t,n,u,r,m,s,c))?(g||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),a.props=r,a.state=s,a.context=c,r=u):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Xc(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:ut(t.type,u),a.props=c,g=t.pendingProps,m=a.context,s=n.contextType,typeof s=="object"&&s!==null?s=ot(s):(s=je(n)?fn:Pe.current,s=Vn(t,s));var y=n.getDerivedStateFromProps;(d=typeof y=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(u!==g||m!==s)&&Mu(t,a,r,s),Ut=!1,m=t.memoizedState,a.state=m,li(t,r,a,o);var k=t.memoizedState;u!==g||m!==k||De.current||Ut?(typeof y=="function"&&(qa(t,n,y,r),k=t.memoizedState),(c=Ut||Tu(t,n,c,r,m,k,s)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,k,s),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,k,s)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=k),a.props=r,a.state=k,a.context=s,r=c):(typeof a.componentDidUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return nl(e,t,n,r,i,o)}function nl(e,t,n,r,o,i){bd(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&ku(t,n,!1),Lt(e,t,i);r=t.stateNode,Tg.current=t;var u=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Qn(t,e.child,null,i),t.child=Qn(t,null,u,i)):Re(e,t,u,i),t.memoizedState=r.state,o&&ku(t,n,!0),t.child}function Sd(e){var t=e.stateNode;t.pendingContext?wu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wu(e,t.context,!1),Dl(e,t.containerInfo)}function Au(e,t,n,r,o){return Kn(),Rl(o),t.flags|=256,Re(e,t,n,r),t.child}var rl={dehydrated:null,treeContext:null,retryLane:0};function ol(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nd(e,t,n){var r=t.pendingProps,o=ie.current,i=!1,a=(t.flags&128)!==0,u;if((u=a)||(u=e!==null&&e.memoizedState===null?!1:(o&2)!==0),u?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),X(ie,o&1),e===null)return Ya(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Ci(a,r,0,null),e=pn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ol(n),t.memoizedState=rl,e):Vl(t,a));if(o=e.memoizedState,o!==null&&(u=o.dehydrated,u!==null))return Mg(e,t,a,r,u,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,u=o.sibling;var s={mode:"hidden",children:r.children};return!(a&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=qt(o,s),r.subtreeFlags=o.subtreeFlags&14680064),u!==null?i=qt(u,i):(i=pn(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?ol(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=rl,r}return i=e.child,e=i.sibling,r=qt(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Vl(e,t){return t=Ci({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Io(e,t,n,r){return r!==null&&Rl(r),Qn(t,e.child,null,n),e=Vl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mg(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=ya(Error(_(422))),Io(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Ci({mode:"visible",children:r.children},o,0,null),i=pn(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Qn(t,e.child,null,a),t.child.memoizedState=ol(a),t.memoizedState=rl,i);if(!(t.mode&1))return Io(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var u=r.dgst;return r=u,i=Error(_(419)),r=ya(i,r,void 0),Io(e,t,a,r)}if(u=(a&e.childLanes)!==0,Ae||u){if(r=me,r!==null){switch(a&-a){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|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Ot(e,o),ft(r,e,o,-1))}return ql(),r=ya(Error(_(421))),Io(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Hg.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ve=Qt(o.nextSibling),Ke=t,ne=!0,dt=null,e!==null&&(et[tt++]=Tt,et[tt++]=Mt,et[tt++]=gn,Tt=e.id,Mt=e.overflow,gn=t),t=Vl(t,r.children),t.flags|=4096,t)}function Du(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xa(e.return,t,n)}function xa(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Cd(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Re(e,t,r.children,n),r=ie.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Du(e,n,t);else if(e.tag===19)Du(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(X(ie,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&si(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),xa(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&si(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}xa(t,!0,n,null,i);break;case"together":xa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Lt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),mn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,n=qt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fg(e,t,n){switch(t.tag){case 3:Sd(t),Kn();break;case 5:qc(t);break;case 1:je(t.type)&&ni(t);break;case 4:Dl(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;X(ii,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(X(ie,ie.current&1),t.flags|=128,null):n&t.child.childLanes?Nd(e,t,n):(X(ie,ie.current&1),e=Lt(e,t,n),e!==null?e.sibling:null);X(ie,ie.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Cd(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),X(ie,ie.current),r)break;return null;case 22:case 23:return t.lanes=0,_d(e,t,n)}return Lt(e,t,n)}var Ed,il,Pd,Td;Ed=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};il=function(){};Pd=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,cn(_t.current);var i=null;switch(n){case"input":o=Ea(e,o),r=Ea(e,r),i=[];break;case"select":o=le({},o,{value:void 0}),r=le({},r,{value:void 0}),i=[];break;case"textarea":o=Ma(e,o),r=Ma(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ei)}Ra(n,r);var a;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var u=o[c];for(a in u)u.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ar.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var s=r[c];if(u=o?.[c],r.hasOwnProperty(c)&&s!==u&&(s!=null||u!=null))if(c==="style")if(u){for(a in u)!u.hasOwnProperty(a)||s&&s.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in s)s.hasOwnProperty(a)&&u[a]!==s[a]&&(n||(n={}),n[a]=s[a])}else n||(i||(i=[]),i.push(c,n)),n=s;else c==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,u=u?u.__html:void 0,s!=null&&u!==s&&(i=i||[]).push(c,s)):c==="children"?typeof s!="string"&&typeof s!="number"||(i=i||[]).push(c,""+s):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ar.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&ee("scroll",e),i||u===s||(i=[])):(i=i||[]).push(c,s))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};Td=function(e,t,n,r){n!==r&&(t.flags|=4)};function kr(e,t){if(!ne)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ce(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=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;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rg(e,t,n){var r=t.pendingProps;switch(Fl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ce(t),null;case 1:return je(t.type)&&ti(),Ce(t),null;case 3:return r=t.stateNode,Jn(),te(De),te(Pe),Ul(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Fo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,dt!==null&&(fl(dt),dt=null))),il(e,t),Ce(t),null;case 5:jl(t);var o=cn(Jr.current);if(n=t.type,e!==null&&t.stateNode!=null)Pd(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return Ce(t),null}if(e=cn(_t.current),Fo(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[wt]=t,r[Kr]=i,e=(t.mode&1)!==0,n){case"dialog":ee("cancel",r),ee("close",r);break;case"iframe":case"object":case"embed":ee("load",r);break;case"video":case"audio":for(o=0;o<Er.length;o++)ee(Er[o],r);break;case"source":ee("error",r);break;case"img":case"image":case"link":ee("error",r),ee("load",r);break;case"details":ee("toggle",r);break;case"input":Vs(r,i),ee("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ee("invalid",r);break;case"textarea":Qs(r,i),ee("invalid",r)}Ra(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var u=i[a];a==="children"?typeof u=="string"?r.textContent!==u&&(i.suppressHydrationWarning!==!0&&Mo(r.textContent,u,e),o=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(i.suppressHydrationWarning!==!0&&Mo(r.textContent,u,e),o=["children",""+u]):Ar.hasOwnProperty(a)&&u!=null&&a==="onScroll"&&ee("scroll",r)}switch(n){case"input":yo(r),Ks(r,i,!0);break;case"textarea":yo(r),Js(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ei)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=rc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[wt]=t,e[Kr]=r,Ed(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ia(n,r),n){case"dialog":ee("cancel",e),ee("close",e),o=r;break;case"iframe":case"object":case"embed":ee("load",e),o=r;break;case"video":case"audio":for(o=0;o<Er.length;o++)ee(Er[o],e);o=r;break;case"source":ee("error",e),o=r;break;case"img":case"image":case"link":ee("error",e),ee("load",e),o=r;break;case"details":ee("toggle",e),o=r;break;case"input":Vs(e,r),o=Ea(e,r),ee("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=le({},r,{value:void 0}),ee("invalid",e);break;case"textarea":Qs(e,r),o=Ma(e,r),ee("invalid",e);break;default:o=r}Ra(n,o),u=o;for(i in u)if(u.hasOwnProperty(i)){var s=u[i];i==="style"?ac(e,s):i==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&oc(e,s)):i==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&Dr(e,s):typeof s=="number"&&Dr(e,""+s):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ar.hasOwnProperty(i)?s!=null&&i==="onScroll"&&ee("scroll",e):s!=null&&ml(e,i,s,a))}switch(n){case"input":yo(e),Ks(e,r,!1);break;case"textarea":yo(e),Js(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Zt(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?jn(e,!!r.multiple,i,!1):r.defaultValue!=null&&jn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ei)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ce(t),null;case 6:if(e&&t.stateNode!=null)Td(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(n=cn(Jr.current),cn(_t.current),Fo(t)){if(r=t.stateNode,n=t.memoizedProps,r[wt]=t,(i=r.nodeValue!==n)&&(e=Ke,e!==null))switch(e.tag){case 3:Mo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Mo(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[wt]=t,t.stateNode=r}return Ce(t),null;case 13:if(te(ie),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ne&&Ve!==null&&t.mode&1&&!(t.flags&128))Kc(),Kn(),t.flags|=98560,i=!1;else if(i=Fo(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(_(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(_(317));i[wt]=t}else Kn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ce(t),i=!1}else dt!==null&&(fl(dt),dt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ie.current&1?ge===0&&(ge=3):ql())),t.updateQueue!==null&&(t.flags|=4),Ce(t),null);case 4:return Jn(),il(e,t),e===null&&$r(t.stateNode.containerInfo),Ce(t),null;case 10:return Ll(t.type._context),Ce(t),null;case 17:return je(t.type)&&ti(),Ce(t),null;case 19:if(te(ie),i=t.memoizedState,i===null)return Ce(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)kr(i,!1);else{if(ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=si(e),a!==null){for(t.flags|=128,kr(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return X(ie,ie.current&1|2),t.child}e=e.sibling}i.tail!==null&&de()>Xn&&(t.flags|=128,r=!0,kr(i,!1),t.lanes=4194304)}else{if(!r)if(e=si(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ne)return Ce(t),null}else 2*de()-i.renderingStartTime>Xn&&n!==1073741824&&(t.flags|=128,r=!0,kr(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=de(),t.sibling=null,n=ie.current,X(ie,r?n&1|2:n&1),t):(Ce(t),null);case 22:case 23:return Xl(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?$e&1073741824&&(Ce(t),t.subtreeFlags&6&&(t.flags|=8192)):Ce(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function Ig(e,t){switch(Fl(t),t.tag){case 1:return je(t.type)&&ti(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(),te(De),te(Pe),Ul(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return jl(t),null;case 13:if(te(ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return te(ie),null;case 4:return Jn(),null;case 10:return Ll(t.type._context),null;case 22:case 23:return Xl(),null;case 24:return null;default:return null}}var Oo=!1,Ee=!1,Og=typeof WeakSet=="function"?WeakSet:Set,T=null;function An(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){se(e,t,r)}else n.current=null}function al(e,t,n){try{n()}catch(r){se(e,t,r)}}var ju=!1;function Lg(e,t){if(Ha=Xo,e=Oc(),Tl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,u=-1,s=-1,c=0,d=0,g=e,m=null;t:for(;;){for(var y;g!==n||o!==0&&g.nodeType!==3||(u=a+o),g!==i||r!==0&&g.nodeType!==3||(s=a+r),g.nodeType===3&&(a+=g.nodeValue.length),(y=g.firstChild)!==null;)m=g,g=y;for(;;){if(g===e)break t;if(m===n&&++c===o&&(u=a),m===i&&++d===r&&(s=a),(y=g.nextSibling)!==null)break;g=m,m=g.parentNode}g=y}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ga={focusedElem:e,selectionRange:n},Xo=!1,T=t;T!==null;)if(t=T,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,T=e;else for(;T!==null;){t=T;try{var k=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var S=k.memoizedProps,B=k.memoizedState,f=t.stateNode,p=f.getSnapshotBeforeUpdate(t.elementType===t.type?S:ut(t.type,S),B);f.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(x){se(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,T=e;break}T=t.return}return k=ju,ju=!1,k}function Or(e,t,n){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 i=o.destroy;o.destroy=void 0,i!==void 0&&al(t,n,i)}o=o.next}while(o!==r)}}function Si(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ll(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Md(e){var t=e.alternate;t!==null&&(e.alternate=null,Md(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wt],delete t[Kr],delete t[Ka],delete t[vg],delete t[yg])),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 Fd(e){return e.tag===5||e.tag===3||e.tag===4}function Uu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fd(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 sl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ei));else if(r!==4&&(e=e.child,e!==null))for(sl(e,t,n),e=e.sibling;e!==null;)sl(e,t,n),e=e.sibling}function ul(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ul(e,t,n),e=e.sibling;e!==null;)ul(e,t,n),e=e.sibling}var we=null,ct=!1;function Dt(e,t,n){for(n=n.child;n!==null;)Rd(e,t,n),n=n.sibling}function Rd(e,t,n){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(mi,n)}catch{}switch(n.tag){case 5:Ee||An(n,t);case 6:var r=we,o=ct;we=null,Dt(e,t,n),we=r,ct=o,we!==null&&(ct?(e=we,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):we.removeChild(n.stateNode));break;case 18:we!==null&&(ct?(e=we,n=n.stateNode,e.nodeType===8?pa(e.parentNode,n):e.nodeType===1&&pa(e,n),Br(e)):pa(we,n.stateNode));break;case 4:r=we,o=ct,we=n.stateNode.containerInfo,ct=!0,Dt(e,t,n),we=r,ct=o;break;case 0:case 11:case 14:case 15:if(!Ee&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&al(n,t,a),o=o.next}while(o!==r)}Dt(e,t,n);break;case 1:if(!Ee&&(An(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){se(n,t,u)}Dt(e,t,n);break;case 21:Dt(e,t,n);break;case 22:n.mode&1?(Ee=(r=Ee)||n.memoizedState!==null,Dt(e,t,n),Ee=r):Dt(e,t,n);break;default:Dt(e,t,n)}}function Wu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Og),t.forEach(function(r){var o=Gg.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function st(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,u=a;e:for(;u!==null;){switch(u.tag){case 5:we=u.stateNode,ct=!1;break e;case 3:we=u.stateNode.containerInfo,ct=!0;break e;case 4:we=u.stateNode.containerInfo,ct=!0;break e}u=u.return}if(we===null)throw Error(_(160));Rd(i,a,o),we=null,ct=!1;var s=o.alternate;s!==null&&(s.return=null),o.return=null}catch(c){se(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Id(t,e),t=t.sibling}function Id(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(st(t,e),yt(e),r&4){try{Or(3,e,e.return),Si(3,e)}catch(S){se(e,e.return,S)}try{Or(5,e,e.return)}catch(S){se(e,e.return,S)}}break;case 1:st(t,e),yt(e),r&512&&n!==null&&An(n,n.return);break;case 5:if(st(t,e),yt(e),r&512&&n!==null&&An(n,n.return),e.flags&32){var o=e.stateNode;try{Dr(o,"")}catch(S){se(e,e.return,S)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,u=e.type,s=e.updateQueue;if(e.updateQueue=null,s!==null)try{u==="input"&&i.type==="radio"&&i.name!=null&&tc(o,i),Ia(u,a);var c=Ia(u,i);for(a=0;a<s.length;a+=2){var d=s[a],g=s[a+1];d==="style"?ac(o,g):d==="dangerouslySetInnerHTML"?oc(o,g):d==="children"?Dr(o,g):ml(o,d,g,c)}switch(u){case"input":Pa(o,i);break;case"textarea":nc(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?jn(o,!!i.multiple,y,!1):m!==!!i.multiple&&(i.defaultValue!=null?jn(o,!!i.multiple,i.defaultValue,!0):jn(o,!!i.multiple,i.multiple?[]:"",!1))}o[Kr]=i}catch(S){se(e,e.return,S)}}break;case 6:if(st(t,e),yt(e),r&4){if(e.stateNode===null)throw Error(_(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(S){se(e,e.return,S)}}break;case 3:if(st(t,e),yt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Br(t.containerInfo)}catch(S){se(e,e.return,S)}break;case 4:st(t,e),yt(e);break;case 13:st(t,e),yt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Jl=de())),r&4&&Wu(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ee=(c=Ee)||d,st(t,e),Ee=c):st(t,e),yt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(T=e,d=e.child;d!==null;){for(g=T=d;T!==null;){switch(m=T,y=m.child,m.tag){case 0:case 11:case 14:case 15:Or(4,m,m.return);break;case 1:An(m,m.return);var k=m.stateNode;if(typeof k.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,k.props=t.memoizedProps,k.state=t.memoizedState,k.componentWillUnmount()}catch(S){se(r,n,S)}}break;case 5:An(m,m.return);break;case 22:if(m.memoizedState!==null){Hu(g);continue}}y!==null?(y.return=m,T=y):Hu(g)}d=d.sibling}e:for(d=null,g=e;;){if(g.tag===5){if(d===null){d=g;try{o=g.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(u=g.stateNode,s=g.memoizedProps.style,a=s!=null&&s.hasOwnProperty("display")?s.display:null,u.style.display=ic("display",a))}catch(S){se(e,e.return,S)}}}else if(g.tag===6){if(d===null)try{g.stateNode.nodeValue=c?"":g.memoizedProps}catch(S){se(e,e.return,S)}}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;d===g&&(d=null),g=g.return}d===g&&(d=null),g.sibling.return=g.return,g=g.sibling}}break;case 19:st(t,e),yt(e),r&4&&Wu(e);break;case 21:break;default:st(t,e),yt(e)}}function yt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Fd(n)){var r=n;break e}n=n.return}throw Error(_(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Dr(o,""),r.flags&=-33);var i=Uu(e);ul(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,u=Uu(e);sl(e,u,a);break;default:throw Error(_(161))}}catch(s){se(e,e.return,s)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zg(e,t,n){T=e,Od(e,t,n)}function Od(e,t,n){for(var r=(e.mode&1)!==0;T!==null;){var o=T,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||Oo;if(!a){var u=o.alternate,s=u!==null&&u.memoizedState!==null||Ee;u=Oo;var c=Ee;if(Oo=a,(Ee=s)&&!c)for(T=o;T!==null;)a=T,s=a.child,a.tag===22&&a.memoizedState!==null?Gu(o):s!==null?(s.return=a,T=s):Gu(o);for(;i!==null;)T=i,Od(i,t,n),i=i.sibling;T=o,Oo=u,Ee=c}Bu(e,t,n)}else o.subtreeFlags&8772&&i!==null?(i.return=o,T=i):Bu(e,t,n)}}function Bu(e){for(;T!==null;){var t=T;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||Si(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ee)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ut(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Cu(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Cu(t,a,n)}break;case 5:var u=t.stateNode;if(n===null&&t.flags&4){n=u;var s=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break;case"img":s.src&&(n.src=s.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var g=d.dehydrated;g!==null&&Br(g)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}Ee||t.flags&512&&ll(t)}catch(m){se(t,t.return,m)}}if(t===e){T=null;break}if(n=t.sibling,n!==null){n.return=t.return,T=n;break}T=t.return}}function Hu(e){for(;T!==null;){var t=T;if(t===e){T=null;break}var n=t.sibling;if(n!==null){n.return=t.return,T=n;break}T=t.return}}function Gu(e){for(;T!==null;){var t=T;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Si(4,t)}catch(s){se(t,n,s)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(s){se(t,o,s)}}var i=t.return;try{ll(t)}catch(s){se(t,i,s)}break;case 5:var a=t.return;try{ll(t)}catch(s){se(t,a,s)}}}catch(s){se(t,t.return,s)}if(t===e){T=null;break}var u=t.sibling;if(u!==null){u.return=t.return,T=u;break}T=t.return}}var Ag=Math.ceil,di=zt.ReactCurrentDispatcher,Kl=zt.ReactCurrentOwner,rt=zt.ReactCurrentBatchConfig,G=0,me=null,pe=null,ke=0,$e=0,Dn=nn(0),ge=0,Zr=null,mn=0,Ni=0,Ql=0,Lr=null,ze=null,Jl=0,Xn=1/0,Et=null,pi=!1,cl=null,Yt=null,Lo=!1,Gt=null,fi=0,zr=0,dl=null,Ho=-1,Go=0;function Ie(){return G&6?de():Ho!==-1?Ho:Ho=de()}function Xt(e){return e.mode&1?G&2&&ke!==0?ke&-ke:wg.transition!==null?(Go===0&&(Go=yc()),Go):(e=J,e!==0||(e=window.event,e=e===void 0?16:Nc(e.type)),e):1}function ft(e,t,n,r){if(50<zr)throw zr=0,dl=null,Error(_(185));eo(e,n,r),(!(G&2)||e!==me)&&(e===me&&(!(G&2)&&(Ni|=n),ge===4&&Bt(e,ke)),Ue(e,r),n===1&&G===0&&!(t.mode&1)&&(Xn=de()+500,ki&&rn()))}function Ue(e,t){var n=e.callbackNode;_f(e,t);var r=Yo(e,e===me?ke:0);if(r===0)n!==null&&qs(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&qs(n),t===1)e.tag===0?xg($u.bind(null,e)):Gc($u.bind(null,e)),hg(function(){!(G&6)&&rn()}),n=null;else{switch(xc(r)){case 1:n=kl;break;case 4:n=mc;break;case 16:n=Jo;break;case 536870912:n=vc;break;default:n=Jo}n=Bd(n,Ld.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Ld(e,t){if(Ho=-1,Go=0,G&6)throw Error(_(327));var n=e.callbackNode;if(Gn()&&e.callbackNode!==n)return null;var r=Yo(e,e===me?ke:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=gi(e,r);else{t=r;var o=G;G|=2;var i=Ad();(me!==e||ke!==t)&&(Et=null,Xn=de()+500,dn(e,t));do try{Ug();break}catch(u){zd(e,u)}while(1);Ol(),di.current=i,G=o,pe!==null?t=0:(me=null,ke=0,t=ge)}if(t!==0){if(t===2&&(o=Da(e),o!==0&&(r=o,t=pl(e,o))),t===1)throw n=Zr,dn(e,0),Bt(e,r),Ue(e,de()),n;if(t===6)Bt(e,r);else{if(o=e.current.alternate,!(r&30)&&!Dg(o)&&(t=gi(e,r),t===2&&(i=Da(e),i!==0&&(r=i,t=pl(e,i))),t===1))throw n=Zr,dn(e,0),Bt(e,r),Ue(e,de()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:ln(e,ze,Et);break;case 3:if(Bt(e,r),(r&130023424)===r&&(t=Jl+500-de(),10<t)){if(Yo(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ie(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Va(ln.bind(null,e,ze,Et),t);break}ln(e,ze,Et);break;case 4:if(Bt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-pt(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=de()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ag(r/1960))-r,10<r){e.timeoutHandle=Va(ln.bind(null,e,ze,Et),r);break}ln(e,ze,Et);break;case 5:ln(e,ze,Et);break;default:throw Error(_(329))}}}return Ue(e,de()),e.callbackNode===n?Ld.bind(null,e):null}function pl(e,t){var n=Lr;return e.current.memoizedState.isDehydrated&&(dn(e,t).flags|=256),e=gi(e,t),e!==2&&(t=ze,ze=n,t!==null&&fl(t)),e}function fl(e){ze===null?ze=e:ze.push.apply(ze,e)}function Dg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!gt(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Bt(e,t){for(t&=~Ql,t&=~Ni,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-pt(t),r=1<<n;e[n]=-1,t&=~r}}function $u(e){if(G&6)throw Error(_(327));Gn();var t=Yo(e,0);if(!(t&1))return Ue(e,de()),null;var n=gi(e,t);if(e.tag!==0&&n===2){var r=Da(e);r!==0&&(t=r,n=pl(e,r))}if(n===1)throw n=Zr,dn(e,0),Bt(e,t),Ue(e,de()),n;if(n===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ln(e,ze,Et),Ue(e,de()),null}function Yl(e,t){var n=G;G|=1;try{return e(t)}finally{G=n,G===0&&(Xn=de()+500,ki&&rn())}}function vn(e){Gt!==null&&Gt.tag===0&&!(G&6)&&Gn();var t=G;G|=1;var n=rt.transition,r=J;try{if(rt.transition=null,J=1,e)return e()}finally{J=r,rt.transition=n,G=t,!(G&6)&&rn()}}function Xl(){$e=Dn.current,te(Dn)}function dn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,gg(n)),pe!==null)for(n=pe.return;n!==null;){var r=n;switch(Fl(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ti();break;case 3:Jn(),te(De),te(Pe),Ul();break;case 5:jl(r);break;case 4:Jn();break;case 13:te(ie);break;case 19:te(ie);break;case 10:Ll(r.type._context);break;case 22:case 23:Xl()}n=n.return}if(me=e,pe=e=qt(e.current,null),ke=$e=t,ge=0,Zr=null,Ql=Ni=mn=0,ze=Lr=null,un!==null){for(t=0;t<un.length;t++)if(n=un[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}un=null}return e}function zd(e,t){do{var n=pe;try{if(Ol(),Uo.current=ci,ui){for(var r=ae.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ui=!1}if(hn=0,he=fe=ae=null,Ir=!1,Yr=0,Kl.current=null,n===null||n.return===null){ge=1,Zr=t,pe=null;break}e:{var i=e,a=n.return,u=n,s=t;if(t=ke,u.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){var c=s,d=u,g=d.tag;if(!(d.mode&1)&&(g===0||g===11||g===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var y=Ru(a);if(y!==null){y.flags&=-257,Iu(y,a,u,i,t),y.mode&1&&Fu(i,c,t),t=y,s=c;var k=t.updateQueue;if(k===null){var S=new Set;S.add(s),t.updateQueue=S}else k.add(s);break e}else{if(!(t&1)){Fu(i,c,t),ql();break e}s=Error(_(426))}}else if(ne&&u.mode&1){var B=Ru(a);if(B!==null){!(B.flags&65536)&&(B.flags|=256),Iu(B,a,u,i,t),Rl(Yn(s,u));break e}}i=s=Yn(s,u),ge!==4&&(ge=2),Lr===null?Lr=[i]:Lr.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var f=xd(i,s,t);Nu(i,f);break e;case 1:u=s;var p=i.type,h=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Yt===null||!Yt.has(h)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=wd(i,u,t);Nu(i,x);break e}}i=i.return}while(i!==null)}jd(n)}catch(C){t=C,pe===n&&n!==null&&(pe=n=n.return);continue}break}while(1)}function Ad(){var e=di.current;return di.current=ci,e===null?ci:e}function ql(){(ge===0||ge===3||ge===2)&&(ge=4),me===null||!(mn&268435455)&&!(Ni&268435455)||Bt(me,ke)}function gi(e,t){var n=G;G|=2;var r=Ad();(me!==e||ke!==t)&&(Et=null,dn(e,t));do try{jg();break}catch(o){zd(e,o)}while(1);if(Ol(),G=n,di.current=r,pe!==null)throw Error(_(261));return me=null,ke=0,ge}function jg(){for(;pe!==null;)Dd(pe)}function Ug(){for(;pe!==null&&!ff();)Dd(pe)}function Dd(e){var t=Wd(e.alternate,e,$e);e.memoizedProps=e.pendingProps,t===null?jd(e):pe=t,Kl.current=null}function jd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Ig(n,t),n!==null){n.flags&=32767,pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ge=6,pe=null;return}}else if(n=Rg(n,t,$e),n!==null){pe=n;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);ge===0&&(ge=5)}function ln(e,t,n){var r=J,o=rt.transition;try{rt.transition=null,J=1,Wg(e,t,n,r)}finally{rt.transition=o,J=r}return null}function Wg(e,t,n,r){do Gn();while(Gt!==null);if(G&6)throw Error(_(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(_(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(bf(e,i),e===me&&(pe=me=null,ke=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Lo||(Lo=!0,Bd(Jo,function(){return Gn(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=rt.transition,rt.transition=null;var a=J;J=1;var u=G;G|=4,Kl.current=null,Lg(e,n),Id(n,e),ug(Ga),Xo=!!Ha,Ga=Ha=null,e.current=n,zg(n,e,o),gf(),G=u,J=a,rt.transition=i}else e.current=n;if(Lo&&(Lo=!1,Gt=e,fi=o),i=e.pendingLanes,i===0&&(Yt=null),vf(n.stateNode,r),Ue(e,de()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(pi)throw pi=!1,e=cl,cl=null,e;return fi&1&&e.tag!==0&&Gn(),i=e.pendingLanes,i&1?e===dl?zr++:(zr=0,dl=e):zr=0,rn(),null}function Gn(){if(Gt!==null){var e=xc(fi),t=rt.transition,n=J;try{if(rt.transition=null,J=16>e?16:e,Gt===null)var r=!1;else{if(e=Gt,Gt=null,fi=0,G&6)throw Error(_(331));var o=G;for(G|=4,T=e.current;T!==null;){var i=T,a=i.child;if(T.flags&16){var u=i.deletions;if(u!==null){for(var s=0;s<u.length;s++){var c=u[s];for(T=c;T!==null;){var d=T;switch(d.tag){case 0:case 11:case 15:Or(8,d,i)}var g=d.child;if(g!==null)g.return=d,T=g;else for(;T!==null;){d=T;var m=d.sibling,y=d.return;if(Md(d),d===c){T=null;break}if(m!==null){m.return=y,T=m;break}T=y}}}var k=i.alternate;if(k!==null){var S=k.child;if(S!==null){k.child=null;do{var B=S.sibling;S.sibling=null,S=B}while(S!==null)}}T=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,T=a;else e:for(;T!==null;){if(i=T,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Or(9,i,i.return)}var f=i.sibling;if(f!==null){f.return=i.return,T=f;break e}T=i.return}}var p=e.current;for(T=p;T!==null;){a=T;var h=a.child;if(a.subtreeFlags&2064&&h!==null)h.return=a,T=h;else e:for(a=p;T!==null;){if(u=T,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:Si(9,u)}}catch(C){se(u,u.return,C)}if(u===a){T=null;break e}var x=u.sibling;if(x!==null){x.return=u.return,T=x;break e}T=u.return}}if(G=o,rn(),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(mi,e)}catch{}r=!0}return r}finally{J=n,rt.transition=t}}return!1}function Vu(e,t,n){t=Yn(n,t),t=xd(e,t,1),e=Jt(e,t,1),t=Ie(),e!==null&&(eo(e,1,t),Ue(e,t))}function se(e,t,n){if(e.tag===3)Vu(e,e,n);else for(;t!==null;){if(t.tag===3){Vu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Yt===null||!Yt.has(r))){e=Yn(n,e),e=wd(t,e,1),t=Jt(t,e,1),e=Ie(),t!==null&&(eo(t,1,e),Ue(t,e));break}}t=t.return}}function Bg(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ie(),e.pingedLanes|=e.suspendedLanes&n,me===e&&(ke&n)===n&&(ge===4||ge===3&&(ke&130023424)===ke&&500>de()-Jl?dn(e,0):Ql|=n),Ue(e,t)}function Ud(e,t){t===0&&(e.mode&1?(t=ko,ko<<=1,!(ko&130023424)&&(ko=4194304)):t=1);var n=Ie();e=Ot(e,t),e!==null&&(eo(e,t,n),Ue(e,n))}function Hg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ud(e,n)}function Gg(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Ud(e,n)}var Wd;Wd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||De.current)Ae=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ae=!1,Fg(e,t,n);Ae=!!(e.flags&131072)}else Ae=!1,ne&&t.flags&1048576&&$c(t,oi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Bo(e,t),e=t.pendingProps;var o=Vn(t,Pe.current);Hn(t,n),o=Bl(null,t,r,e,o,n);var i=Hl();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,je(r)?(i=!0,ni(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Al(t),o.updater=bi,t.stateNode=o,o._reactInternals=t,Za(t,r,e,n),t=nl(null,t,r,!0,i,n)):(t.tag=0,ne&&i&&Ml(t),Re(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Bo(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Vg(r),e=ut(r,e),o){case 0:t=tl(null,t,r,e,n);break e;case 1:t=zu(null,t,r,e,n);break e;case 11:t=Ou(null,t,r,e,n);break e;case 14:t=Lu(null,t,r,ut(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ut(r,o),tl(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ut(r,o),zu(e,t,r,o,n);case 3:e:{if(Sd(t),e===null)throw Error(_(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Xc(e,t),li(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Yn(Error(_(423)),t),t=Au(e,t,r,n,o);break e}else if(r!==o){o=Yn(Error(_(424)),t),t=Au(e,t,r,n,o);break e}else for(Ve=Qt(t.stateNode.containerInfo.firstChild),Ke=t,ne=!0,dt=null,n=Jc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Kn(),r===o){t=Lt(e,t,n);break e}Re(e,t,r,n)}t=t.child}return t;case 5:return qc(t),e===null&&Ya(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,$a(r,o)?a=null:i!==null&&$a(r,i)&&(t.flags|=32),bd(e,t),Re(e,t,a,n),t.child;case 6:return e===null&&Ya(t),null;case 13:return Nd(e,t,n);case 4:return Dl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qn(t,null,r,n):Re(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ut(r,o),Ou(e,t,r,o,n);case 7:return Re(e,t,t.pendingProps,n),t.child;case 8:return Re(e,t,t.pendingProps.children,n),t.child;case 12:return Re(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,X(ii,r._currentValue),r._currentValue=a,i!==null)if(gt(i.value,a)){if(i.children===o.children&&!De.current){t=Lt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){a=i.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=Ft(-1,n&-n),s.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?s.next=s:(s.next=d.next,d.next=s),c.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Xa(i.return,n,t),u.lanes|=n;break}s=s.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(_(341));a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Xa(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Re(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Hn(t,n),o=ot(o),r=r(o),t.flags|=1,Re(e,t,r,n),t.child;case 14:return r=t.type,o=ut(r,t.pendingProps),o=ut(r.type,o),Lu(e,t,r,o,n);case 15:return kd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ut(r,o),Bo(e,t),t.tag=1,je(r)?(e=!0,ni(t)):e=!1,Hn(t,n),yd(t,r,o),Za(t,r,o,n),nl(null,t,r,!0,e,n);case 19:return Cd(e,t,n);case 22:return _d(e,t,n)}throw Error(_(156,t.tag))};function Bd(e,t){return hc(e,t)}function $g(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nt(e,t,n,r){return new $g(e,t,n,r)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vg(e){if(typeof e=="function")return Zl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yl)return 11;if(e===xl)return 14}return 2}function qt(e,t){var n=e.alternate;return n===null?(n=nt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $o(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Zl(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Pn:return pn(n.children,o,i,t);case vl:a=8,o|=8;break;case ba:return e=nt(12,n,t,o|2),e.elementType=ba,e.lanes=i,e;case Sa:return e=nt(13,n,t,o),e.elementType=Sa,e.lanes=i,e;case Na:return e=nt(19,n,t,o),e.elementType=Na,e.lanes=i,e;case qu:return Ci(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yu:a=10;break e;case Xu:a=9;break e;case yl:a=11;break e;case xl:a=14;break e;case jt:a=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=nt(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function pn(e,t,n,r){return e=nt(7,e,r,t),e.lanes=n,e}function Ci(e,t,n,r){return e=nt(22,e,r,t),e.elementType=qu,e.lanes=n,e.stateNode={isHidden:!1},e}function wa(e,t,n){return e=nt(6,e,null,t),e.lanes=n,e}function ka(e,t,n){return t=nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kg(e,t,n,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=oa(0),this.expirationTimes=oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oa(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function es(e,t,n,r,o,i,a,u,s){return e=new Kg(e,t,n,u,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=nt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Al(i),e}function Qg(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:En,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Hd(e){if(!e)return en;e=e._reactInternals;e:{if(xn(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(je(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var n=e.type;if(je(n))return Hc(e,n,t)}return t}function Gd(e,t,n,r,o,i,a,u,s){return e=es(n,r,!0,e,o,i,a,u,s),e.context=Hd(null),n=e.current,r=Ie(),o=Xt(n),i=Ft(r,o),i.callback=t??null,Jt(n,i,o),e.current.lanes=o,eo(e,o,r),Ue(e,r),e}function Ei(e,t,n,r){var o=t.current,i=Ie(),a=Xt(o);return n=Hd(n),t.context===null?t.context=n:t.pendingContext=n,t=Ft(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Jt(o,t,a),e!==null&&(ft(e,o,a,i),jo(e,o,a)),a}function hi(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ku(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ts(e,t){Ku(e,t),(e=e.alternate)&&Ku(e,t)}function Jg(){return null}var $d=typeof reportError=="function"?reportError:function(e){console.error(e)};function ns(e){this._internalRoot=e}Pi.prototype.render=ns.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));Ei(e,t,null,null)};Pi.prototype.unmount=ns.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vn(function(){Ei(null,e,null,null)}),t[It]=null}};function Pi(e){this._internalRoot=e}Pi.prototype.unstable_scheduleHydration=function(e){if(e){var t=_c();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wt.length&&t!==0&&t<Wt[n].priority;n++);Wt.splice(n,0,e),n===0&&Sc(e)}};function rs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ti(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qu(){}function Yg(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=hi(a);i.call(c)}}var a=Gd(t,r,e,0,null,!1,!1,"",Qu);return e._reactRootContainer=a,e[It]=a.current,$r(e.nodeType===8?e.parentNode:e),vn(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var u=r;r=function(){var c=hi(s);u.call(c)}}var s=es(e,0,!1,null,null,!1,!1,"",Qu);return e._reactRootContainer=s,e[It]=s.current,$r(e.nodeType===8?e.parentNode:e),vn(function(){Ei(t,s,n,r)}),s}function Mi(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var u=o;o=function(){var s=hi(a);u.call(s)}}Ei(t,a,e,o)}else a=Yg(n,t,e,o,r);return hi(a)}wc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Cr(t.pendingLanes);n!==0&&(_l(t,n|1),Ue(t,de()),!(G&6)&&(Xn=de()+500,rn()))}break;case 13:vn(function(){var r=Ot(e,1);if(r!==null){var o=Ie();ft(r,e,1,o)}}),ts(e,1)}};bl=function(e){if(e.tag===13){var t=Ot(e,134217728);if(t!==null){var n=Ie();ft(t,e,134217728,n)}ts(e,134217728)}};kc=function(e){if(e.tag===13){var t=Xt(e),n=Ot(e,t);if(n!==null){var r=Ie();ft(n,e,t,r)}ts(e,t)}};_c=function(){return J};bc=function(e,t){var n=J;try{return J=e,t()}finally{J=n}};La=function(e,t,n){switch(t){case"input":if(Pa(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=wi(r);if(!o)throw Error(_(90));ec(r),Pa(r,o)}}}break;case"textarea":nc(e,n);break;case"select":t=n.value,t!=null&&jn(e,!!n.multiple,t,!1)}};uc=Yl;cc=vn;var Xg={usingClientEntryPoint:!1,Events:[no,Rn,wi,lc,sc,Yl]},_r={findFiberByHostInstance:sn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qg={bundleType:_r.bundleType,version:_r.version,rendererPackageName:_r.rendererPackageName,rendererConfig:_r.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:zt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=fc(e),e===null?null:e.stateNode},findFiberByHostInstance:_r.findFiberByHostInstance||Jg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(br=__REACT_DEVTOOLS_GLOBAL_HOOK__,!br.isDisabled&&br.supportsFiber))try{mi=br.inject(qg),kt=br}catch{}var br;Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xg;Ye.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rs(t))throw Error(_(200));return Qg(e,t,null,n)};Ye.createRoot=function(e,t){if(!rs(e))throw Error(_(299));var n=!1,r="",o=$d;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=es(e,1,!1,null,null,n,!1,r,o),e[It]=t.current,$r(e.nodeType===8?e.parentNode:e),new ns(t)};Ye.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(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=fc(t),e=e===null?null:e.stateNode,e};Ye.flushSync=function(e){return vn(e)};Ye.hydrate=function(e,t,n){if(!Ti(t))throw Error(_(200));return Mi(null,e,t,!0,n)};Ye.hydrateRoot=function(e,t,n){if(!rs(e))throw Error(_(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=$d;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Gd(t,null,e,1,n??null,o,!1,i,a),e[It]=t.current,$r(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Pi(t)};Ye.render=function(e,t,n){if(!Ti(t))throw Error(_(200));return Mi(null,e,t,!1,n)};Ye.unmountComponentAtNode=function(e){if(!Ti(e))throw Error(_(40));return e._reactRootContainer?(vn(function(){Mi(null,null,e,!1,function(){e._reactRootContainer=null,e[It]=null})}),!0):!1};Ye.unstable_batchedUpdates=Yl;Ye.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ti(n))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return Mi(e,t,n,!1,r)};Ye.version="18.3.1-next-f1338f8080-20240426"});var Jd=Nt((Dm,Qd)=>{"use strict";function Kd(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Kd)}catch(e){console.error(e)}}Kd(),Qd.exports=Vd()});var Xd=Nt(os=>{"use strict";var Yd=Jd();os.createRoot=Yd.createRoot,os.hydrateRoot=Yd.hydrateRoot;var jm});var Zd=Nt(Fi=>{"use strict";var Zg=Ct(),eh=Symbol.for("react.element"),th=Symbol.for("react.fragment"),nh=Object.prototype.hasOwnProperty,rh=Zg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,oh={key:!0,ref:!0,__self:!0,__source:!0};function qd(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)nh.call(t,r)&&!oh.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:eh,type:e,key:i,ref:a,props:o,_owner:rh.current}}Fi.Fragment=th;Fi.jsx=qd;Fi.jsxs=qd});var be=Nt((Bm,ep)=>{"use strict";ep.exports=Zd()});var vs=`/* ---------------------------------------------------------------
9
+ Workflow Editor \u2014 bold redesign
10
+ Design system:
11
+ - Type: Space Grotesk (UI), JetBrains Mono (identifiers/expr),
12
+ Instrument Serif (display accents)
13
+ - Color: cool-neutral base, single accent keyed to workflow type.
14
+ Accent hue tweakable; chroma held constant (oklch).
15
+ - Node geometry: each type has its own shape (trigger pill, state
16
+ card, branch diamond-sliced card, action chip).
17
+ --------------------------------------------------------------- */
18
+
19
+ :root {
20
+ --accent-hue: 255; /* tweakable */
21
+ --accent: oklch(0.70 0.16 var(--accent-hue));
22
+ --accent-ink: oklch(0.22 0.08 var(--accent-hue));
23
+ --accent-soft: oklch(0.70 0.16 var(--accent-hue) / 0.14);
24
+ --accent-line: oklch(0.70 0.16 var(--accent-hue) / 0.38);
25
+
26
+ /* type roles */
27
+ --t-trigger: oklch(0.78 0.14 145);
28
+ --t-state: oklch(0.72 0.14 250);
29
+ --t-branch: oklch(0.78 0.13 60);
30
+ --t-action: oklch(0.72 0.14 330);
31
+ --t-end: oklch(0.62 0.04 260);
32
+
33
+ --t-trigger-soft: oklch(0.78 0.14 145 / 0.14);
34
+ --t-state-soft: oklch(0.72 0.14 250 / 0.14);
35
+ --t-branch-soft: oklch(0.78 0.13 60 / 0.14);
36
+ --t-action-soft: oklch(0.72 0.14 330 / 0.14);
37
+ --t-end-soft: oklch(0.62 0.04 260 / 0.16);
38
+
39
+ --ok: oklch(0.78 0.14 155);
40
+ --warn: oklch(0.78 0.14 75);
41
+ --err: oklch(0.68 0.20 25);
42
+
43
+ --radius: 10px;
44
+ --radius-sm: 6px;
45
+ --density: 1;
46
+ }
47
+
48
+ /* DARK (default) */
49
+ :root[data-theme="dark"] {
50
+ --bg: oklch(0.18 0.014 265);
51
+ --bg-deep: oklch(0.14 0.014 265);
52
+ --surface: oklch(0.22 0.014 265);
53
+ --surface-2: oklch(0.26 0.014 265);
54
+ --line: oklch(0.32 0.018 265);
55
+ --line-soft: oklch(0.28 0.014 265);
56
+ --ink: oklch(0.96 0.006 265);
57
+ --ink-2: oklch(0.82 0.012 265);
58
+ --muted: oklch(0.62 0.012 265);
59
+ --muted-2: oklch(0.48 0.012 265);
60
+ --grid: oklch(0.32 0.014 265 / 0.35);
61
+ --grid-bold: oklch(0.32 0.014 265 / 0.65);
62
+ --node: oklch(0.24 0.014 265);
63
+ --node-hi: oklch(0.28 0.014 265);
64
+ --shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset,
65
+ 0 18px 40px -20px oklch(0 0 0 / 0.7),
66
+ 0 2px 6px -2px oklch(0 0 0 / 0.5);
67
+ }
68
+
69
+ /* LIGHT */
70
+ :root[data-theme="light"] {
71
+ --bg: oklch(0.985 0.003 265);
72
+ --bg-deep: oklch(0.96 0.004 265);
73
+ --surface: oklch(1 0 0);
74
+ --surface-2: oklch(0.975 0.004 265);
75
+ --line: oklch(0.90 0.006 265);
76
+ --line-soft: oklch(0.94 0.005 265);
77
+ --ink: oklch(0.20 0.016 265);
78
+ --ink-2: oklch(0.34 0.014 265);
79
+ --muted: oklch(0.52 0.010 265);
80
+ --muted-2: oklch(0.66 0.010 265);
81
+ --grid: oklch(0.90 0.006 265 / 0.6);
82
+ --grid-bold: oklch(0.80 0.010 265 / 0.75);
83
+ --node: oklch(1 0 0);
84
+ --node-hi: oklch(0.98 0.004 265);
85
+ --shadow: 0 1px 0 oklch(1 0 0 / 0.9) inset,
86
+ 0 20px 40px -24px oklch(0.2 0.02 265 / 0.18),
87
+ 0 2px 6px -3px oklch(0.2 0.02 265 / 0.12);
88
+ }
89
+
90
+ * { box-sizing: border-box; }
91
+ html, body, #root { height: 100%; margin: 0; }
92
+ body {
93
+ background: var(--bg-deep);
94
+ color: var(--ink);
95
+ font: 13px/1.5 "Space Grotesk", system-ui, -apple-system, sans-serif;
96
+ font-feature-settings: "ss01", "cv01";
97
+ -webkit-font-smoothing: antialiased;
98
+ overflow: hidden;
99
+ }
100
+ kbd {
101
+ font: 500 10.5px/1 "JetBrains Mono", ui-monospace, monospace;
102
+ background: var(--surface-2);
103
+ border: 1px solid var(--line);
104
+ border-bottom-width: 2px;
105
+ padding: 2px 5px;
106
+ border-radius: 4px;
107
+ color: var(--ink-2);
108
+ }
109
+ code, .mono {
110
+ font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
111
+ font-size: 0.92em;
112
+ letter-spacing: -0.005em;
113
+ }
114
+
115
+ /* ============================================================
116
+ APP SHELL
117
+ ============================================================ */
118
+ .app {
119
+ display: grid;
120
+ grid-template-rows: 52px 1fr;
121
+ grid-template-columns: 288px 1fr 380px;
122
+ height: 100vh;
123
+ background: var(--bg);
124
+ }
125
+ .app[data-density="compact"] { --density: 0.88; }
126
+ .app[data-density="cozy"] { --density: 1; }
127
+ .app[data-density="roomy"] { --density: 1.12; }
128
+ .app[data-palette="closed"] { grid-template-columns: 0 1fr 380px; }
129
+ .app[data-inspector="closed"] { grid-template-columns: 288px 1fr 0; }
130
+ .app[data-palette="closed"][data-inspector="closed"] { grid-template-columns: 0 1fr 0; }
131
+
132
+ /* ============================================================
133
+ TOOLBAR
134
+ ============================================================ */
135
+ .tb {
136
+ grid-column: 1 / 4;
137
+ display: flex;
138
+ align-items: stretch;
139
+ background: var(--surface);
140
+ border-bottom: 1px solid var(--line);
141
+ position: relative;
142
+ z-index: 5;
143
+ }
144
+ .tb__brand {
145
+ display: flex; align-items: center; gap: 10px;
146
+ padding: 0 16px;
147
+ border-right: 1px solid var(--line);
148
+ width: 288px;
149
+ }
150
+ .tb__mark {
151
+ width: 26px; height: 26px;
152
+ border-radius: 7px;
153
+ background: linear-gradient(140deg, var(--accent) 0%, var(--t-action) 100%);
154
+ position: relative;
155
+ display: grid; place-items: center;
156
+ color: var(--accent-ink);
157
+ font-weight: 700;
158
+ box-shadow: 0 2px 8px -2px var(--accent-line), inset 0 0 0 1px oklch(1 0 0 / 0.2);
159
+ }
160
+ .tb__mark::after {
161
+ content: "";
162
+ position: absolute; inset: 3px;
163
+ border-radius: 5px;
164
+ background: radial-gradient(circle at 30% 30%, oklch(1 0 0 / 0.35), transparent 60%);
165
+ pointer-events: none;
166
+ }
167
+ .tb__brand-label { font-weight: 600; letter-spacing: -0.01em; font-size: 13px; }
168
+ .tb__brand-sub { font-size: 10px; color: var(--muted); font-family: "JetBrains Mono", monospace; letter-spacing: 0; }
169
+
170
+ .tb__main {
171
+ flex: 1;
172
+ display: flex; align-items: center; gap: 4px;
173
+ padding: 0 14px;
174
+ min-width: 0;
175
+ }
176
+ .tb__crumbs {
177
+ display: flex; align-items: center; gap: 8px;
178
+ font-size: 12px; color: var(--muted);
179
+ min-width: 0;
180
+ }
181
+ .tb__crumbs b {
182
+ color: var(--ink);
183
+ font-weight: 600;
184
+ max-width: 320px;
185
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
186
+ font-size: 13px;
187
+ letter-spacing: -0.005em;
188
+ }
189
+ .tb__crumbs input {
190
+ font: inherit;
191
+ font-weight: 600;
192
+ color: var(--ink);
193
+ background: transparent;
194
+ border: 1px solid transparent;
195
+ padding: 3px 6px;
196
+ border-radius: 5px;
197
+ min-width: 240px;
198
+ letter-spacing: -0.005em;
199
+ }
200
+ .tb__crumbs input:focus { outline: none; border-color: var(--accent-line); background: var(--bg); }
201
+ .tb__crumbs .sep { color: var(--muted-2); }
202
+ .tb__status {
203
+ font: 500 10.5px/1 "JetBrains Mono", monospace;
204
+ color: var(--muted);
205
+ display: inline-flex; align-items: center; gap: 6px;
206
+ padding: 4px 8px;
207
+ border-radius: 20px;
208
+ background: var(--surface-2);
209
+ border: 1px solid var(--line-soft);
210
+ }
211
+ .tb__status .dot {
212
+ width: 6px; height: 6px; border-radius: 50%;
213
+ background: var(--muted);
214
+ }
215
+ .tb__status.is-dirty .dot { background: var(--warn); box-shadow: 0 0 0 3px oklch(from var(--warn) l c h / 0.25); }
216
+ .tb__status.is-saved .dot { background: var(--ok); }
217
+ .tb__status.is-running .dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
218
+
219
+ .tb__sep { width: 1px; background: var(--line); margin: 10px 6px; }
220
+ .tb__spacer { flex: 1; }
221
+
222
+ .tb__actions { display: flex; align-items: center; gap: 4px; padding: 0 12px; border-left: 1px solid var(--line); }
223
+
224
+ /* ============================================================
225
+ BUTTONS
226
+ ============================================================ */
227
+ .btn {
228
+ font: 500 12px/1 "Space Grotesk", sans-serif;
229
+ color: var(--ink-2);
230
+ background: transparent;
231
+ border: 1px solid transparent;
232
+ height: 30px;
233
+ padding: 0 10px;
234
+ border-radius: 7px;
235
+ display: inline-flex; align-items: center; gap: 6px;
236
+ cursor: pointer;
237
+ transition: background .12s ease, border-color .12s ease, color .12s ease;
238
+ white-space: nowrap;
239
+ }
240
+ .btn:hover { background: var(--surface-2); color: var(--ink); }
241
+ .btn:disabled { opacity: 0.4; cursor: not-allowed; }
242
+ .btn svg { width: 14px; height: 14px; }
243
+
244
+ .btn--outline { border-color: var(--line); background: var(--surface); }
245
+ .btn--outline:hover { border-color: var(--line); background: var(--node-hi); }
246
+
247
+ .btn--primary {
248
+ background: var(--accent);
249
+ color: var(--accent-ink);
250
+ border-color: var(--accent);
251
+ font-weight: 600;
252
+ }
253
+ .btn--primary:hover { filter: brightness(1.08); color: var(--accent-ink); background: var(--accent); }
254
+
255
+ .btn--ghost-icon {
256
+ width: 30px; padding: 0; justify-content: center;
257
+ color: var(--muted);
258
+ }
259
+ .btn--ghost-icon:hover { color: var(--ink); background: var(--surface-2); }
260
+ .btn--ghost-icon.is-active { color: var(--accent); background: var(--accent-soft); }
261
+
262
+ .btn--danger {
263
+ color: var(--err);
264
+ background: oklch(from var(--err) l c h / 0.08);
265
+ border-color: oklch(from var(--err) l c h / 0.3);
266
+ }
267
+ .btn--danger:hover { background: oklch(from var(--err) l c h / 0.16); }
268
+
269
+ /* ============================================================
270
+ PALETTE (left)
271
+ ============================================================ */
272
+ .pal {
273
+ border-right: 1px solid var(--line);
274
+ background: var(--surface);
275
+ display: flex; flex-direction: column;
276
+ overflow: hidden;
277
+ min-width: 0;
278
+ }
279
+ .pal__search {
280
+ position: relative;
281
+ padding: 12px 14px 8px;
282
+ border-bottom: 1px solid var(--line-soft);
283
+ }
284
+ .pal__search input {
285
+ width: 100%;
286
+ font: 13px "Space Grotesk", sans-serif;
287
+ background: var(--bg);
288
+ border: 1px solid var(--line);
289
+ border-radius: 8px;
290
+ padding: 8px 12px 8px 32px;
291
+ color: var(--ink);
292
+ }
293
+ .pal__search input::placeholder { color: var(--muted-2); }
294
+ .pal__search input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
295
+ .pal__search svg {
296
+ position: absolute; left: 24px; top: 50%;
297
+ width: 14px; height: 14px;
298
+ transform: translateY(-4px);
299
+ color: var(--muted);
300
+ pointer-events: none;
301
+ }
302
+ .pal__search kbd { position: absolute; right: 22px; top: 20px; }
303
+
304
+ .pal__scroll { flex: 1; overflow-y: auto; padding: 14px 10px 18px; }
305
+ .pal__scroll::-webkit-scrollbar { width: 8px; }
306
+ .pal__scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
307
+
308
+ .pal__section {
309
+ display: flex; align-items: center; justify-content: space-between;
310
+ padding: 14px 6px 6px;
311
+ font-size: 10px; font-weight: 600;
312
+ letter-spacing: 0.1em;
313
+ text-transform: uppercase;
314
+ color: var(--muted);
315
+ }
316
+ .pal__section:first-child { padding-top: 4px; }
317
+ .pal__section-count {
318
+ font-size: 10px; font-family: "JetBrains Mono", monospace;
319
+ color: var(--muted-2);
320
+ }
321
+
322
+ .pal__item {
323
+ display: flex; align-items: flex-start; gap: 10px;
324
+ padding: 9px 10px;
325
+ margin: 2px 0;
326
+ border-radius: 8px;
327
+ cursor: grab;
328
+ user-select: none;
329
+ border: 1px solid transparent;
330
+ position: relative;
331
+ transition: background .12s, border-color .12s;
332
+ }
333
+ .pal__item:hover { background: var(--surface-2); border-color: var(--line-soft); }
334
+ .pal__item:active { cursor: grabbing; }
335
+ .pal__item.is-dragging { opacity: 0.35; }
336
+
337
+ .pal__glyph {
338
+ flex-shrink: 0;
339
+ width: 30px; height: 30px;
340
+ display: grid; place-items: center;
341
+ color: var(--gcol, var(--ink));
342
+ background: var(--gbg, var(--surface-2));
343
+ border: 1px solid var(--gbor, var(--line));
344
+ }
345
+ .pal__glyph.g-trigger { --gcol: var(--t-trigger); --gbg: var(--t-trigger-soft); --gbor: oklch(from var(--t-trigger) l c h / 0.3); border-radius: 15px; }
346
+ .pal__glyph.g-state { --gcol: var(--t-state); --gbg: var(--t-state-soft); --gbor: oklch(from var(--t-state) l c h / 0.3); border-radius: 6px; }
347
+ .pal__glyph.g-branch { --gcol: var(--t-branch); --gbg: var(--t-branch-soft); --gbor: oklch(from var(--t-branch) l c h / 0.3); border-radius: 4px; transform: rotate(45deg); }
348
+ .pal__glyph.g-branch svg { transform: rotate(-45deg); }
349
+ .pal__glyph.g-action { --gcol: var(--t-action); --gbg: var(--t-action-soft); --gbor: oklch(from var(--t-action) l c h / 0.3); border-radius: 4px 10px 10px 4px; }
350
+ .pal__glyph.g-end { --gcol: var(--t-end); --gbg: var(--t-end-soft); --gbor: oklch(from var(--t-end) l c h / 0.3); border-radius: 15px; border-style: dashed; }
351
+ .pal__glyph svg { width: 14px; height: 14px; }
352
+
353
+ .pal__meta { min-width: 0; flex: 1; padding-top: 2px; }
354
+ .pal__label { font-size: 12.5px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; }
355
+ .pal__hint { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
356
+
357
+ .pal__tpl {
358
+ display: block;
359
+ padding: 12px 14px;
360
+ background: var(--bg);
361
+ border: 1px solid var(--line);
362
+ border-radius: 10px;
363
+ margin: 6px 4px;
364
+ cursor: pointer;
365
+ position: relative;
366
+ overflow: hidden;
367
+ transition: border-color .12s, transform .12s;
368
+ }
369
+ .pal__tpl:hover { border-color: var(--accent-line); transform: translateY(-1px); }
370
+ .pal__tpl-title { font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em; margin-bottom: 4px; }
371
+ .pal__tpl-hint { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
372
+ .pal__tpl-dots {
373
+ position: absolute; right: 10px; top: 10px;
374
+ display: flex; gap: 3px;
375
+ }
376
+ .pal__tpl-dots span {
377
+ width: 5px; height: 5px; border-radius: 50%;
378
+ background: var(--line);
379
+ }
380
+ .pal__tpl-dots span.on { background: var(--accent); }
381
+
382
+ .pal__foot {
383
+ border-top: 1px solid var(--line);
384
+ padding: 10px 14px;
385
+ font-size: 10.5px; color: var(--muted);
386
+ display: flex; align-items: center; gap: 8px;
387
+ background: var(--surface-2);
388
+ }
389
+
390
+ /* ============================================================
391
+ CANVAS
392
+ ============================================================ */
393
+ .cv {
394
+ position: relative;
395
+ overflow: hidden;
396
+ background: var(--bg);
397
+ background-image:
398
+ radial-gradient(circle at center, var(--grid) 1px, transparent 1px),
399
+ linear-gradient(to right, var(--grid-bold) 1px, transparent 1px),
400
+ linear-gradient(to bottom, var(--grid-bold) 1px, transparent 1px);
401
+ background-size: 24px 24px, 120px 120px, 120px 120px;
402
+ background-position: 0 0, 0 0, 0 0;
403
+ cursor: default;
404
+ }
405
+ .cv.is-panning { cursor: grabbing; }
406
+ .cv.is-drop-target::before {
407
+ content: "";
408
+ position: absolute; inset: 8px;
409
+ border: 2px dashed var(--accent);
410
+ border-radius: 18px;
411
+ background: var(--accent-soft);
412
+ pointer-events: none;
413
+ z-index: 0;
414
+ }
415
+
416
+ .cv__viewport {
417
+ position: absolute;
418
+ left: 0; top: 0;
419
+ width: 100%; height: 100%;
420
+ transform-origin: 0 0;
421
+ }
422
+
423
+ .cv__edges {
424
+ position: absolute; inset: 0;
425
+ pointer-events: none;
426
+ overflow: visible;
427
+ z-index: 1;
428
+ }
429
+ .cv__edges path {
430
+ fill: none;
431
+ stroke: var(--line);
432
+ stroke-width: 1.6;
433
+ pointer-events: stroke;
434
+ cursor: pointer;
435
+ }
436
+ .cv__edges path.edge-bg {
437
+ stroke: transparent;
438
+ stroke-width: 14;
439
+ pointer-events: stroke;
440
+ }
441
+ .cv__edges path.is-hover { stroke: var(--ink-2); }
442
+ .cv__edges path.is-selected { stroke: var(--accent); stroke-width: 2; }
443
+ .cv__edges path.is-running {
444
+ stroke: var(--accent);
445
+ stroke-width: 2;
446
+ stroke-dasharray: 6 4;
447
+ animation: dash 0.6s linear infinite;
448
+ }
449
+ .cv__edges path.is-visited { stroke: var(--accent); stroke-width: 1.8; }
450
+ .cv__edges path.is-true { stroke: var(--ok); }
451
+ .cv__edges path.is-false { stroke: var(--err); }
452
+ .cv__edges .edge-label {
453
+ font: 500 10.5px "JetBrains Mono", monospace;
454
+ fill: var(--ink-2);
455
+ }
456
+ .cv__edges .edge-label-bg {
457
+ fill: var(--surface);
458
+ stroke: var(--line);
459
+ stroke-width: 1;
460
+ }
461
+ @keyframes dash { to { stroke-dashoffset: -20; } }
462
+ @keyframes pulse {
463
+ 0%, 100% { opacity: 1; transform: scale(1); }
464
+ 50% { opacity: 0.55; transform: scale(1.25); }
465
+ }
466
+
467
+ /* ---------- NODE base ---------- */
468
+ .node {
469
+ position: absolute;
470
+ --c: var(--t-state);
471
+ --c-soft: var(--t-state-soft);
472
+ --c-line: oklch(from var(--c) l c h / 0.38);
473
+ background: var(--node);
474
+ color: var(--ink);
475
+ font-family: "Space Grotesk", sans-serif;
476
+ border: 1.25px solid var(--line);
477
+ border-radius: var(--radius);
478
+ min-width: 220px;
479
+ box-shadow: var(--shadow);
480
+ cursor: grab;
481
+ transition: border-color .12s, box-shadow .12s, transform .12s;
482
+ z-index: 2;
483
+ }
484
+ .node.t-trigger { --c: var(--t-trigger); --c-soft: var(--t-trigger-soft); }
485
+ .node.t-state { --c: var(--t-state); --c-soft: var(--t-state-soft); }
486
+ .node.t-branch { --c: var(--t-branch); --c-soft: var(--t-branch-soft); }
487
+ .node.t-action { --c: var(--t-action); --c-soft: var(--t-action-soft); }
488
+ .node.t-end { --c: var(--t-end); --c-soft: var(--t-end-soft); }
489
+
490
+ .node:active { cursor: grabbing; }
491
+ .node.is-selected { border-color: var(--c-line); box-shadow: var(--shadow), 0 0 0 2px oklch(from var(--c) l c h / 0.4); z-index: 4; }
492
+ .node.is-running { box-shadow: var(--shadow), 0 0 0 2px var(--c-line), 0 0 22px 2px oklch(from var(--c) l c h / 0.4); border-color: var(--c-line); }
493
+ .node.is-visited { border-color: var(--c-line); }
494
+ .node.is-error { border-color: var(--err); box-shadow: var(--shadow), 0 0 0 2px oklch(from var(--err) l c h / 0.35); }
495
+
496
+ .node__stripe {
497
+ height: 4px;
498
+ border-radius: var(--radius) var(--radius) 0 0;
499
+ background: linear-gradient(90deg, var(--c) 0%, oklch(from var(--c) l c h / 0.5) 100%);
500
+ position: relative;
501
+ overflow: hidden;
502
+ }
503
+ .node__stripe::after {
504
+ content: "";
505
+ position: absolute; inset: 0;
506
+ background: repeating-linear-gradient(90deg, oklch(1 0 0 / 0.15) 0 2px, transparent 2px 4px);
507
+ mix-blend-mode: overlay;
508
+ }
509
+ .node__head {
510
+ display: flex; align-items: center; gap: 10px;
511
+ padding: 10px 12px 6px;
512
+ }
513
+ .node__icon {
514
+ width: 22px; height: 22px;
515
+ border-radius: 5px;
516
+ background: var(--c-soft);
517
+ color: var(--c);
518
+ border: 1px solid oklch(from var(--c) l c h / 0.28);
519
+ display: grid; place-items: center;
520
+ flex-shrink: 0;
521
+ }
522
+ .node__icon svg { width: 12px; height: 12px; }
523
+ .node__meta { min-width: 0; flex: 1; }
524
+ .node__kind {
525
+ font: 600 9px/1 "JetBrains Mono", monospace;
526
+ letter-spacing: 0.12em;
527
+ text-transform: uppercase;
528
+ color: var(--c);
529
+ }
530
+ .node__name {
531
+ font-weight: 600; font-size: 13.5px;
532
+ letter-spacing: -0.01em;
533
+ margin-top: 2px;
534
+ color: var(--ink);
535
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
536
+ }
537
+ .node__chev {
538
+ color: var(--muted-2);
539
+ display: grid; place-items: center;
540
+ }
541
+ .node__body {
542
+ padding: 0 12px 12px;
543
+ display: flex; flex-direction: column; gap: 6px;
544
+ }
545
+ .node__row {
546
+ display: flex; align-items: center; gap: 6px;
547
+ font-size: 11.5px;
548
+ color: var(--ink-2);
549
+ min-height: 18px;
550
+ }
551
+ .node__row .mono { color: var(--muted); }
552
+ .node__row svg { width: 12px; height: 12px; color: var(--muted); flex-shrink: 0; }
553
+ .node__tag {
554
+ font: 500 10px "JetBrains Mono", monospace;
555
+ padding: 2px 6px;
556
+ background: var(--surface-2);
557
+ border-radius: 3px;
558
+ color: var(--ink-2);
559
+ border: 1px solid var(--line-soft);
560
+ }
561
+
562
+ .node__foot {
563
+ padding: 8px 12px;
564
+ border-top: 1px dashed var(--line-soft);
565
+ display: flex; align-items: center; justify-content: space-between;
566
+ font-size: 10.5px;
567
+ color: var(--muted);
568
+ }
569
+ .node__badges { display: flex; gap: 4px; }
570
+ .node__badge {
571
+ font: 600 9px/1 "JetBrains Mono", monospace;
572
+ letter-spacing: 0.08em;
573
+ padding: 3px 5px;
574
+ border-radius: 3px;
575
+ background: var(--surface-2);
576
+ color: var(--ink-2);
577
+ text-transform: uppercase;
578
+ border: 1px solid var(--line-soft);
579
+ }
580
+ .node__badge.ok { color: var(--ok); background: oklch(from var(--ok) l c h / 0.12); border-color: oklch(from var(--ok) l c h / 0.3); }
581
+ .node__badge.warn { color: var(--warn); background: oklch(from var(--warn) l c h / 0.12); border-color: oklch(from var(--warn) l c h / 0.3); }
582
+ .node__badge.err { color: var(--err); background: oklch(from var(--err) l c h / 0.12); border-color: oklch(from var(--err) l c h / 0.3); }
583
+
584
+ /* ---------- NODE: Trigger (pill) ---------- */
585
+ .node.t-trigger {
586
+ border-radius: 999px;
587
+ min-width: 200px;
588
+ padding: 10px 18px 10px 14px;
589
+ }
590
+ .node.t-trigger .node__stripe { display: none; }
591
+ .node.t-trigger .node__head { padding: 0; gap: 10px; }
592
+ .node.t-trigger .node__body { display: none; }
593
+ .node.t-trigger .node__foot { display: none; }
594
+ .node.t-trigger::before {
595
+ content: "";
596
+ position: absolute;
597
+ left: -6px; top: 50%;
598
+ transform: translateY(-50%);
599
+ width: 10px; height: 10px;
600
+ border-radius: 50%;
601
+ background: var(--c);
602
+ box-shadow: 0 0 0 3px var(--bg), 0 0 14px 2px oklch(from var(--c) l c h / 0.6);
603
+ }
604
+
605
+ /* ---------- NODE: Branch (diamond-clipped card) ---------- */
606
+ .node.t-branch {
607
+ min-width: 240px;
608
+ clip-path: polygon(0% 14px, 14px 0%, calc(100% - 14px) 0%, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0% calc(100% - 14px));
609
+ }
610
+
611
+ /* ---------- NODE: Action (chip, smaller) ---------- */
612
+ .node.t-action {
613
+ min-width: 200px;
614
+ border-radius: 4px 14px 14px 4px;
615
+ border-left: 3px solid var(--c);
616
+ }
617
+ .node.t-action .node__stripe { display: none; }
618
+ .node.t-action .node__head { padding-top: 10px; }
619
+
620
+ /* ---------- HANDLES (ports) ---------- */
621
+ .handle {
622
+ position: absolute;
623
+ width: 12px; height: 12px;
624
+ border-radius: 50%;
625
+ background: var(--node);
626
+ border: 2px solid var(--c);
627
+ transform: translate(-50%, -50%);
628
+ cursor: crosshair;
629
+ z-index: 5;
630
+ transition: transform .1s, background .12s;
631
+ }
632
+ .handle:hover, .handle.is-active {
633
+ background: var(--c);
634
+ transform: translate(-50%, -50%) scale(1.35);
635
+ }
636
+ .handle.h-in { left: 0; top: 50%; }
637
+ .handle.h-out { left: 100%; top: 50%; }
638
+ .handle.h-true { left: 100%; top: 30%; border-color: var(--ok); }
639
+ .handle.h-false { left: 100%; top: 70%; border-color: var(--err); }
640
+ .handle__label {
641
+ position: absolute;
642
+ left: 14px; top: 50%;
643
+ transform: translateY(-50%);
644
+ font: 600 9px/1 "JetBrains Mono", monospace;
645
+ letter-spacing: 0.1em;
646
+ text-transform: uppercase;
647
+ color: var(--muted);
648
+ white-space: nowrap;
649
+ pointer-events: none;
650
+ }
651
+ .handle.h-true .handle__label { color: var(--ok); }
652
+ .handle.h-false .handle__label { color: var(--err); }
653
+
654
+ /* ---------- Canvas overlays ---------- */
655
+ .cv__controls {
656
+ position: absolute;
657
+ left: 14px; bottom: 14px;
658
+ display: flex; gap: 6px;
659
+ background: var(--surface);
660
+ border: 1px solid var(--line);
661
+ border-radius: 10px;
662
+ padding: 4px;
663
+ box-shadow: var(--shadow);
664
+ z-index: 10;
665
+ }
666
+ .cv__controls button {
667
+ width: 28px; height: 28px;
668
+ background: transparent;
669
+ border: 0;
670
+ border-radius: 6px;
671
+ color: var(--ink-2);
672
+ cursor: pointer;
673
+ display: grid; place-items: center;
674
+ }
675
+ .cv__controls button:hover { background: var(--surface-2); color: var(--ink); }
676
+ .cv__zoom { padding: 0 8px; font: 500 11px "JetBrains Mono", monospace; color: var(--muted); display: grid; place-items: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 56px; }
677
+
678
+ .cv__mini {
679
+ position: absolute;
680
+ right: 14px; bottom: 14px;
681
+ width: 200px; height: 140px;
682
+ background: var(--surface);
683
+ border: 1px solid var(--line);
684
+ border-radius: 10px;
685
+ overflow: hidden;
686
+ z-index: 10;
687
+ box-shadow: var(--shadow);
688
+ transition: height .16s, width .16s;
689
+ }
690
+ .cv__mini.is-collapsed { height: 32px; width: 140px; }
691
+ .cv__mini-head {
692
+ height: 28px;
693
+ display: flex; align-items: center; justify-content: space-between;
694
+ padding: 0 10px;
695
+ font: 600 10px "Space Grotesk"; letter-spacing: 0.08em; text-transform: uppercase;
696
+ color: var(--muted);
697
+ border-bottom: 1px solid var(--line-soft);
698
+ }
699
+ .cv__mini-head button { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 4px; display: grid; place-items: center; }
700
+ .cv__mini-head button:hover { color: var(--ink); background: var(--surface-2); }
701
+ .cv__mini svg { width: 100%; height: calc(100% - 28px); display: block; }
702
+ .cv__mini .mini-node { fill: var(--muted-2); }
703
+ .cv__mini .mini-node.sel { fill: var(--accent); }
704
+ .cv__mini .mini-view { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
705
+
706
+ /* ---------- Run panel ---------- */
707
+ .run {
708
+ position: absolute;
709
+ top: 14px; left: 14px;
710
+ width: 320px;
711
+ max-height: calc(100% - 28px);
712
+ background: var(--surface);
713
+ border: 1px solid var(--line);
714
+ border-radius: 12px;
715
+ box-shadow: var(--shadow);
716
+ z-index: 9;
717
+ overflow: hidden;
718
+ display: flex; flex-direction: column;
719
+ }
720
+ .run__head {
721
+ display: flex; align-items: center; gap: 10px;
722
+ padding: 10px 12px;
723
+ border-bottom: 1px solid var(--line-soft);
724
+ }
725
+ .run__title { font-weight: 600; font-size: 12.5px; letter-spacing: -0.005em; }
726
+ .run__chip {
727
+ font: 600 10px "JetBrains Mono", monospace;
728
+ padding: 3px 7px;
729
+ border-radius: 20px;
730
+ background: oklch(from var(--accent) l c h / 0.14);
731
+ color: var(--accent);
732
+ border: 1px solid var(--accent-line);
733
+ display: inline-flex; align-items: center; gap: 5px;
734
+ }
735
+ .run__chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
736
+ .run__body { overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
737
+ .run__step {
738
+ display: flex; gap: 10px;
739
+ padding: 9px 10px;
740
+ background: var(--bg);
741
+ border: 1px solid var(--line-soft);
742
+ border-radius: 8px;
743
+ font-size: 11.5px;
744
+ position: relative;
745
+ }
746
+ .run__step.is-current { border-color: var(--accent-line); background: var(--accent-soft); }
747
+ .run__step.is-done .run__marker { background: var(--ok); color: var(--bg); border-color: var(--ok); }
748
+ .run__step.is-current .run__marker { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); animation: pulse 1s ease-in-out infinite; }
749
+ .run__marker {
750
+ width: 20px; height: 20px; flex-shrink: 0;
751
+ border-radius: 50%;
752
+ display: grid; place-items: center;
753
+ font: 600 10px "JetBrains Mono", monospace;
754
+ color: var(--muted);
755
+ border: 1.5px solid var(--line);
756
+ }
757
+ .run__step-title { font-weight: 600; font-size: 11.5px; }
758
+ .run__step-body { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.4; }
759
+ .run__step-body code { color: var(--ink-2); }
760
+ .run__foot {
761
+ padding: 8px 12px;
762
+ border-top: 1px solid var(--line-soft);
763
+ display: flex; align-items: center; justify-content: space-between;
764
+ font-size: 11px; color: var(--muted);
765
+ font-family: "JetBrains Mono", monospace;
766
+ }
767
+
768
+ /* ---------- Empty state ---------- */
769
+ .cv__empty {
770
+ position: absolute;
771
+ inset: 0;
772
+ display: grid; place-items: center;
773
+ color: var(--muted);
774
+ pointer-events: none;
775
+ }
776
+ .cv__empty-card {
777
+ background: var(--surface);
778
+ border: 1px dashed var(--line);
779
+ border-radius: 14px;
780
+ padding: 28px 32px;
781
+ text-align: center;
782
+ pointer-events: auto;
783
+ max-width: 360px;
784
+ box-shadow: var(--shadow);
785
+ }
786
+ .cv__empty-card h3 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 26px; margin: 8px 0 4px; color: var(--ink); letter-spacing: -0.01em; }
787
+ .cv__empty-card p { font-size: 12px; line-height: 1.5; margin: 0 0 14px; }
788
+
789
+ /* ============================================================
790
+ INSPECTOR (right)
791
+ ============================================================ */
792
+ .insp {
793
+ border-left: 1px solid var(--line);
794
+ background: var(--surface);
795
+ display: flex; flex-direction: column;
796
+ overflow: hidden;
797
+ }
798
+ .insp__head {
799
+ padding: 12px 16px 0;
800
+ border-bottom: 1px solid var(--line-soft);
801
+ background: var(--surface);
802
+ }
803
+ .insp__top {
804
+ display: flex; align-items: center; gap: 8px;
805
+ padding-bottom: 12px;
806
+ }
807
+ .insp__type-pill {
808
+ font: 600 9px "JetBrains Mono", monospace;
809
+ letter-spacing: 0.1em;
810
+ text-transform: uppercase;
811
+ padding: 3px 7px;
812
+ border-radius: 20px;
813
+ background: var(--c-soft, var(--surface-2));
814
+ color: var(--c, var(--ink-2));
815
+ border: 1px solid oklch(from var(--c, var(--line)) l c h / 0.3);
816
+ }
817
+ .insp__name {
818
+ font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
819
+ flex: 1; min-width: 0;
820
+ background: transparent; border: 1px solid transparent;
821
+ color: var(--ink);
822
+ padding: 4px 6px;
823
+ border-radius: 5px;
824
+ font-family: inherit;
825
+ }
826
+ .insp__name:focus { outline: none; border-color: var(--accent-line); background: var(--bg); }
827
+ .insp__tabs {
828
+ display: flex; gap: 2px;
829
+ margin-top: 6px;
830
+ }
831
+ .insp__tab {
832
+ font: 500 11.5px "Space Grotesk";
833
+ color: var(--muted);
834
+ background: transparent;
835
+ border: 0;
836
+ padding: 8px 10px;
837
+ cursor: pointer;
838
+ border-bottom: 2px solid transparent;
839
+ display: inline-flex; align-items: center; gap: 6px;
840
+ margin-bottom: -1px;
841
+ }
842
+ .insp__tab:hover { color: var(--ink-2); }
843
+ .insp__tab.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
844
+ .insp__tab .count {
845
+ font: 600 9.5px "JetBrains Mono", monospace;
846
+ background: var(--surface-2);
847
+ color: var(--muted);
848
+ padding: 2px 5px;
849
+ border-radius: 10px;
850
+ }
851
+ .insp__tab.is-active .count { background: var(--accent-soft); color: var(--accent); }
852
+
853
+ .insp__body { overflow-y: auto; flex: 1; padding-bottom: 24px; }
854
+ .insp__body::-webkit-scrollbar { width: 8px; }
855
+ .insp__body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
856
+
857
+ .insp__section {
858
+ border-bottom: 1px solid var(--line-soft);
859
+ }
860
+ .insp__section-head {
861
+ display: flex; align-items: center; gap: 8px;
862
+ padding: 14px 16px 8px;
863
+ cursor: pointer;
864
+ user-select: none;
865
+ }
866
+ .insp__section-head h4 {
867
+ margin: 0;
868
+ font: 600 10.5px "Space Grotesk";
869
+ letter-spacing: 0.1em;
870
+ text-transform: uppercase;
871
+ color: var(--muted);
872
+ flex: 1;
873
+ }
874
+ .insp__section-head .chev { color: var(--muted-2); transition: transform .16s; }
875
+ .insp__section.is-collapsed .insp__section-body { display: none; }
876
+ .insp__section.is-collapsed .chev { transform: rotate(-90deg); }
877
+ .insp__section-body {
878
+ padding: 4px 16px 16px;
879
+ display: flex; flex-direction: column; gap: 10px;
880
+ }
881
+
882
+ /* ---------- Form fields ---------- */
883
+ .fld { display: flex; flex-direction: column; gap: 5px; }
884
+ .fld__label {
885
+ font: 500 11px "Space Grotesk";
886
+ color: var(--muted);
887
+ display: flex; align-items: center; justify-content: space-between;
888
+ }
889
+ .fld__hint { font-size: 10.5px; color: var(--muted-2); }
890
+ .fld__input,
891
+ .fld__select,
892
+ .fld__textarea {
893
+ font-family: "Space Grotesk", sans-serif;
894
+ font-size: 12.5px;
895
+ background: var(--bg);
896
+ color: var(--ink);
897
+ border: 1px solid var(--line);
898
+ border-radius: 6px;
899
+ padding: 7px 9px;
900
+ width: 100%;
901
+ transition: border-color .12s, box-shadow .12s;
902
+ }
903
+ .fld.is-mono .fld__input,
904
+ .fld.is-mono .fld__textarea { font-family: "JetBrains Mono", monospace; font-size: 11.5px; }
905
+ .fld__input:focus,
906
+ .fld__select:focus,
907
+ .fld__textarea:focus {
908
+ outline: none;
909
+ border-color: var(--accent-line);
910
+ box-shadow: 0 0 0 3px var(--accent-soft);
911
+ }
912
+ .fld__textarea { min-height: 70px; resize: vertical; line-height: 1.5; }
913
+ .fld__select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }
914
+ .fld.is-err .fld__input, .fld.is-err .fld__select, .fld.is-err .fld__textarea { border-color: var(--err); box-shadow: 0 0 0 3px oklch(from var(--err) l c h / 0.15); }
915
+ .fld__err { font-size: 10.5px; color: var(--err); display: flex; align-items: center; gap: 4px; }
916
+ .fld__ok { font-size: 10.5px; color: var(--ok); display: flex; align-items: center; gap: 4px; }
917
+
918
+ /* ---------- Agent picker (combo) ---------- */
919
+ .combo { position: relative; }
920
+ .combo__btn {
921
+ width: 100%;
922
+ display: flex; align-items: center; gap: 8px;
923
+ background: var(--bg);
924
+ border: 1px solid var(--line);
925
+ border-radius: 6px;
926
+ padding: 6px 8px 6px 6px;
927
+ cursor: pointer;
928
+ font-family: inherit;
929
+ font-size: 12.5px;
930
+ color: var(--ink);
931
+ text-align: left;
932
+ }
933
+ .combo__btn:hover { border-color: var(--line); background: var(--node-hi); }
934
+ .combo__btn:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
935
+ .combo__avatar {
936
+ width: 22px; height: 22px;
937
+ border-radius: 5px;
938
+ display: grid; place-items: center;
939
+ font: 700 10px "Space Grotesk";
940
+ letter-spacing: -0.02em;
941
+ color: oklch(0.25 0.04 265);
942
+ flex-shrink: 0;
943
+ }
944
+ .combo__main { min-width: 0; flex: 1; }
945
+ .combo__name { font-weight: 500; font-size: 12px; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
946
+ .combo__id { font: 10.5px "JetBrains Mono", monospace; color: var(--muted); }
947
+ .combo__chev { color: var(--muted); }
948
+ .combo__menu {
949
+ position: absolute;
950
+ top: calc(100% + 4px);
951
+ left: 0; right: 0;
952
+ background: var(--surface);
953
+ border: 1px solid var(--line);
954
+ border-radius: 8px;
955
+ box-shadow: var(--shadow);
956
+ z-index: 20;
957
+ max-height: 280px;
958
+ overflow: hidden;
959
+ display: flex; flex-direction: column;
960
+ }
961
+ .combo__menu-search {
962
+ padding: 8px;
963
+ border-bottom: 1px solid var(--line-soft);
964
+ }
965
+ .combo__menu-search input {
966
+ width: 100%;
967
+ background: var(--bg);
968
+ border: 1px solid var(--line);
969
+ border-radius: 5px;
970
+ padding: 5px 8px;
971
+ font: 12px "Space Grotesk";
972
+ color: var(--ink);
973
+ }
974
+ .combo__menu-search input:focus { outline: none; border-color: var(--accent-line); }
975
+ .combo__menu-list { overflow-y: auto; padding: 4px; flex: 1; }
976
+ .combo__opt {
977
+ display: flex; align-items: center; gap: 10px;
978
+ padding: 6px 8px;
979
+ border-radius: 5px;
980
+ cursor: pointer;
981
+ }
982
+ .combo__opt:hover, .combo__opt.is-active { background: var(--accent-soft); }
983
+ .combo__opt-name { font-weight: 500; font-size: 12px; letter-spacing: -0.005em; }
984
+ .combo__opt-id { font: 10.5px "JetBrains Mono", monospace; color: var(--muted); }
985
+ .combo__opt-tags { display: flex; gap: 3px; margin-left: auto; }
986
+ .combo__opt-tag {
987
+ font: 500 9.5px "JetBrains Mono", monospace;
988
+ padding: 1px 5px;
989
+ border-radius: 3px;
990
+ background: var(--surface-2);
991
+ color: var(--muted);
992
+ border: 1px solid var(--line-soft);
993
+ }
994
+
995
+ /* ---------- Expression editor ---------- */
996
+ .expr {
997
+ position: relative;
998
+ }
999
+ .expr__box {
1000
+ font-family: "JetBrains Mono", monospace;
1001
+ font-size: 11.5px;
1002
+ line-height: 1.55;
1003
+ background: var(--bg);
1004
+ border: 1px solid var(--line);
1005
+ border-radius: 6px;
1006
+ padding: 8px 10px;
1007
+ color: var(--ink);
1008
+ min-height: 72px;
1009
+ resize: vertical;
1010
+ width: 100%;
1011
+ }
1012
+ .expr__box:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
1013
+ .expr__hint {
1014
+ font: 500 10.5px "Space Grotesk";
1015
+ color: var(--muted);
1016
+ display: flex; gap: 4px; align-items: center; margin-top: 2px;
1017
+ }
1018
+ .expr__hint code {
1019
+ background: var(--surface-2);
1020
+ padding: 1px 5px;
1021
+ border-radius: 3px;
1022
+ color: var(--accent);
1023
+ border: 1px solid var(--line-soft);
1024
+ }
1025
+ .expr__popover {
1026
+ position: absolute;
1027
+ left: 0; top: calc(100% + 4px);
1028
+ background: var(--surface);
1029
+ border: 1px solid var(--line);
1030
+ border-radius: 8px;
1031
+ padding: 6px;
1032
+ max-height: 240px;
1033
+ overflow-y: auto;
1034
+ width: 300px;
1035
+ z-index: 30;
1036
+ box-shadow: var(--shadow);
1037
+ }
1038
+ .expr__pop-group {
1039
+ font: 600 9.5px "JetBrains Mono", monospace;
1040
+ letter-spacing: 0.08em;
1041
+ text-transform: uppercase;
1042
+ color: var(--muted);
1043
+ padding: 8px 8px 4px;
1044
+ }
1045
+ .expr__pop-opt {
1046
+ display: flex; gap: 10px; align-items: center;
1047
+ padding: 5px 8px;
1048
+ border-radius: 5px;
1049
+ cursor: pointer;
1050
+ font: 11.5px "JetBrains Mono", monospace;
1051
+ }
1052
+ .expr__pop-opt:hover, .expr__pop-opt.is-active { background: var(--accent-soft); }
1053
+ .expr__pop-opt b { color: var(--accent); font-weight: 600; }
1054
+ .expr__pop-opt .typ {
1055
+ margin-left: auto;
1056
+ font: 500 9.5px "Space Grotesk";
1057
+ color: var(--muted);
1058
+ padding: 1px 5px;
1059
+ background: var(--surface-2);
1060
+ border-radius: 3px;
1061
+ border: 1px solid var(--line-soft);
1062
+ }
1063
+
1064
+ /* ---------- Cards inside inspector ---------- */
1065
+ .card {
1066
+ background: var(--bg);
1067
+ border: 1px solid var(--line);
1068
+ border-radius: 8px;
1069
+ padding: 10px;
1070
+ display: flex; flex-direction: column; gap: 8px;
1071
+ }
1072
+ .card__head {
1073
+ display: flex; align-items: center; gap: 8px;
1074
+ justify-content: space-between;
1075
+ }
1076
+ .card__title {
1077
+ display: flex; align-items: center; gap: 6px;
1078
+ font-weight: 600; font-size: 11.5px; letter-spacing: -0.005em;
1079
+ }
1080
+ .card__del {
1081
+ background: transparent; border: 0; padding: 3px;
1082
+ border-radius: 4px; color: var(--muted); cursor: pointer;
1083
+ }
1084
+ .card__del:hover { color: var(--err); background: oklch(from var(--err) l c h / 0.12); }
1085
+ .card__kind {
1086
+ font: 600 9.5px "JetBrains Mono", monospace;
1087
+ letter-spacing: 0.08em;
1088
+ text-transform: uppercase;
1089
+ padding: 2px 6px;
1090
+ border-radius: 3px;
1091
+ background: var(--surface-2);
1092
+ color: var(--muted);
1093
+ border: 1px solid var(--line-soft);
1094
+ }
1095
+ .card__add {
1096
+ background: transparent;
1097
+ border: 1px dashed var(--line);
1098
+ border-radius: 6px;
1099
+ padding: 8px;
1100
+ width: 100%;
1101
+ font: 500 11.5px "Space Grotesk";
1102
+ color: var(--muted);
1103
+ cursor: pointer;
1104
+ display: flex; align-items: center; justify-content: center; gap: 6px;
1105
+ }
1106
+ .card__add:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
1107
+
1108
+ /* ---------- Empty inspector state ---------- */
1109
+ .insp__empty {
1110
+ padding: 40px 24px;
1111
+ text-align: center;
1112
+ color: var(--muted);
1113
+ }
1114
+ .insp__empty h3 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 24px; margin: 4px 0 2px; color: var(--ink); letter-spacing: -0.005em; }
1115
+ .insp__empty p { font-size: 12px; line-height: 1.5; margin: 0; }
1116
+ .insp__empty-shortcuts { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; font-size: 11.5px; color: var(--ink-2); text-align: left; }
1117
+ .insp__empty-shortcuts div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
1118
+ .insp__empty-shortcuts div:last-child { border: 0; }
1119
+ .insp__empty-shortcuts div > span:first-child { flex: 1; min-width: 0; text-align: left; white-space: nowrap; color: var(--ink-2); }
1120
+ .insp__empty-shortcuts div > *:not(:first-child) { flex-shrink: 0; display: inline-flex; gap: 4px; }
1121
+
1122
+ /* ---------- Delete-workflow zone (in WorkflowPane) ---------- */
1123
+ .insp__danger {
1124
+ display: flex;
1125
+ justify-content: center;
1126
+ padding: 18px 16px 24px;
1127
+ margin-top: 6px;
1128
+ border-top: 1px solid var(--line-soft);
1129
+ }
1130
+ .insp__delete-wf {
1131
+ height: 30px;
1132
+ padding: 0 14px;
1133
+ font-size: 11.5px;
1134
+ color: var(--err);
1135
+ border-color: color-mix(in oklch, var(--err) 35%, var(--line));
1136
+ }
1137
+ .insp__delete-wf:hover {
1138
+ background: color-mix(in oklch, var(--err) 10%, transparent);
1139
+ border-color: color-mix(in oklch, var(--err) 55%, var(--line));
1140
+ }
1141
+
1142
+ /* ============================================================
1143
+ Tweaks panel
1144
+ ============================================================ */
1145
+ .tweaks {
1146
+ position: fixed;
1147
+ right: 396px;
1148
+ bottom: 16px;
1149
+ width: 260px;
1150
+ background: var(--surface);
1151
+ border: 1px solid var(--line);
1152
+ border-radius: 12px;
1153
+ box-shadow: var(--shadow);
1154
+ z-index: 100;
1155
+ font-size: 12px;
1156
+ overflow: hidden;
1157
+ }
1158
+ .tweaks__head {
1159
+ padding: 10px 12px;
1160
+ border-bottom: 1px solid var(--line-soft);
1161
+ font: 600 10.5px "Space Grotesk"; letter-spacing: 0.1em; text-transform: uppercase;
1162
+ color: var(--muted);
1163
+ display: flex; justify-content: space-between; align-items: center;
1164
+ }
1165
+ .tweaks__body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
1166
+ .tweaks__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11.5px; }
1167
+ .tweaks__row label { color: var(--muted); }
1168
+ .tweaks__opts { display: flex; gap: 4px; }
1169
+ .tweaks__opts button {
1170
+ font: 500 11px "Space Grotesk";
1171
+ background: transparent;
1172
+ border: 1px solid var(--line);
1173
+ border-radius: 5px;
1174
+ padding: 4px 8px;
1175
+ cursor: pointer;
1176
+ color: var(--ink-2);
1177
+ }
1178
+ .tweaks__opts button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
1179
+ .tweaks__hue {
1180
+ display: flex; gap: 6px; flex-wrap: wrap;
1181
+ }
1182
+ .tweaks__hue button {
1183
+ width: 22px; height: 22px;
1184
+ border-radius: 50%;
1185
+ border: 2px solid transparent;
1186
+ cursor: pointer;
1187
+ padding: 0;
1188
+ }
1189
+ .tweaks__hue button.on { border-color: var(--ink); }
1190
+
1191
+ /* ============================================================
1192
+ Keyboard overlay
1193
+ ============================================================ */
1194
+ .kbd-overlay {
1195
+ position: fixed; inset: 0;
1196
+ background: oklch(0 0 0 / 0.5);
1197
+ z-index: 200;
1198
+ display: grid; place-items: center;
1199
+ backdrop-filter: blur(4px);
1200
+ }
1201
+ .kbd-card {
1202
+ background: var(--surface);
1203
+ border: 1px solid var(--line);
1204
+ border-radius: 14px;
1205
+ padding: 24px 28px;
1206
+ width: 520px;
1207
+ box-shadow: var(--shadow);
1208
+ }
1209
+ .kbd-card h3 { font-family: "Instrument Serif", serif; font-weight: 400; font-size: 28px; margin: 0 0 16px; letter-spacing: -0.01em; }
1210
+ .kbd-card .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12.5px; }
1211
+ .kbd-card .row:last-child { border: 0; }
1212
+ .kbd-card .row span:first-child { color: var(--ink-2); }
1213
+
1214
+ /* ============================================================
1215
+ Toast
1216
+ ============================================================ */
1217
+ .toast {
1218
+ position: fixed;
1219
+ bottom: 20px; left: 50%;
1220
+ transform: translateX(-50%);
1221
+ padding: 8px 16px;
1222
+ background: var(--surface);
1223
+ border: 1px solid var(--line);
1224
+ border-radius: 8px;
1225
+ font-size: 12px;
1226
+ z-index: 150;
1227
+ box-shadow: var(--shadow);
1228
+ display: inline-flex; align-items: center; gap: 8px;
1229
+ }
1230
+ .toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
1231
+ .toast.err .dot { background: var(--err); }
1232
+
1233
+ /* ============================================================
1234
+ Connecting-edge ghost
1235
+ ============================================================ */
1236
+ .cv__ghost-edge {
1237
+ position: absolute; inset: 0;
1238
+ pointer-events: none;
1239
+ z-index: 8;
1240
+ }
1241
+ .cv__ghost-edge path {
1242
+ fill: none;
1243
+ stroke: var(--accent);
1244
+ stroke-width: 2;
1245
+ stroke-dasharray: 6 4;
1246
+ animation: dash 0.6s linear infinite;
1247
+ }
1248
+
1249
+ /* Utilities */
1250
+ .hstack { display: flex; gap: 8px; align-items: center; }
1251
+ .vstack { display: flex; flex-direction: column; gap: 8px; }
1252
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
1253
+ `;var Sp=oe(Xd(),1);var O=oe(Ct(),1);var We=oe(Ct(),1);var v=oe(be(),1),D=({children:e,size:t=14,...n})=>(0,v.jsx)("svg",{viewBox:"0 0 16 16",width:t,height:t,fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round",...n,children:e}),L={gitlab:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M8 14L2 7l1.2-4.5L5 7h6l1.8-4.5L14 7z"})}),clock:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,v.jsx)("path",{d:"M8 5v3l2 1.5"})]}),hook:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M4 3v4a4 4 0 0 0 4 4h4"}),(0,v.jsx)("path",{d:"M10 9l2 2-2 2"})]}),play:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M5 3.5l7 4.5-7 4.5z",fill:"currentColor"})}),box:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2.5",y:"2.5",width:"11",height:"11",rx:"1.5"}),(0,v.jsx)("path",{d:"M2.5 6h11M6 2.5v11"})]}),branch:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"4",cy:"4",r:"1.5"}),(0,v.jsx)("circle",{cx:"12",cy:"12",r:"1.5"}),(0,v.jsx)("circle",{cx:"12",cy:"4",r:"1.5"}),(0,v.jsx)("path",{d:"M4 5.5v3a2 2 0 0 0 2 2h4.5"}),(0,v.jsx)("path",{d:"M12 5.5v5"})]}),stop:()=>(0,v.jsx)(D,{children:(0,v.jsx)("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1"})}),msg:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M2.5 3.5h11v8h-6l-3 2.5v-2.5h-2z"})}),tag:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M8 2h5v5l-6 6-5-5z"}),(0,v.jsx)("circle",{cx:"10.5",cy:"5.5",r:.8,fill:"currentColor"})]}),bell:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M4 11V7a4 4 0 0 1 8 0v4l1 1.5H3zM6.5 13.5a1.5 1.5 0 0 0 3 0"})}),globe:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,v.jsx)("path",{d:"M2.5 8h11M8 2.5c2 2 2 9 0 11M8 2.5c-2 2-2 9 0 11"})]}),search:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,v.jsx)("path",{d:"M10 10l3.5 3.5"})]}),undo:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M4 7h6a3 3 0 0 1 0 6H7"}),(0,v.jsx)("path",{d:"M6.5 4.5L4 7l2.5 2.5"})]}),redo:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M12 7H6a3 3 0 0 0 0 6h3"}),(0,v.jsx)("path",{d:"M9.5 4.5L12 7 9.5 9.5"})]}),save:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M3 3h8l2 2v8H3z"}),(0,v.jsx)("path",{d:"M5 3v4h6V3M5 13v-4h6v4"})]}),run:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M5 3.5l7 4.5-7 4.5z",fill:"currentColor"})}),stop2:()=>(0,v.jsx)(D,{children:(0,v.jsx)("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1",fill:"currentColor"})}),sun:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"2.75"}),(0,v.jsx)("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.5 3.5l1.4 1.4M11.1 11.1l1.4 1.4M3.5 12.5l1.4-1.4M11.1 4.9l1.4-1.4"})]}),moon:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M13 9.5A5.5 5.5 0 0 1 6.5 3 5.5 5.5 0 1 0 13 9.5z"})}),plus:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M8 3v10M3 8h10"})}),trash:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M3 4.5h10M6 4.5V3h4v1.5M4.5 4.5l.5 8h6l.5-8"})}),chev:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M4 6l4 4 4-4"})}),x:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})}),more:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"4",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),(0,v.jsx)("circle",{cx:"8",cy:"8",r:"1",fill:"currentColor",stroke:"none"}),(0,v.jsx)("circle",{cx:"12",cy:"8",r:"1",fill:"currentColor",stroke:"none"})]}),check:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M3 8.5l3 3 7-7"})}),warn:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M8 2l6 11H2z"}),(0,v.jsx)("path",{d:"M8 6.5v3M8 11.2v.3"})]}),err:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"5.5"}),(0,v.jsx)("path",{d:"M8 5v3.5M8 10.5v.3"})]}),zoomin:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,v.jsx)("path",{d:"M10 10l3.5 3.5M5 7h4M7 5v4"})]}),zoomout:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"7",cy:"7",r:"4"}),(0,v.jsx)("path",{d:"M10 10l3.5 3.5M5 7h4"})]}),fit:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M3 5V3h2M13 5V3h-2M3 11v2h2M13 11v2h-2"}),(0,v.jsx)("rect",{x:"6",y:"6",width:"4",height:"4",rx:.5})]}),minus:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M3 8h10"})}),kbd:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"1.5",y:"4",width:"13",height:"8",rx:"1.5"}),(0,v.jsx)("path",{d:"M4 7h.5M6 7h.5M8 7h.5M10 7h.5M4 10h7"})]}),lightning:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M9 2L3 9h4l-1 5 6-7H8z",fill:"currentColor",fillOpacity:.2})}),variable:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M4 3c-2 3-2 7 0 10M12 3c2 3 2 7 0 10"}),(0,v.jsx)("path",{d:"M6 7.5h.5l1 1 1-1h.5M6 10l1.5-1.5M9 10l-1.5-1.5"})]}),users:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"6",cy:"6",r:"2"}),(0,v.jsx)("path",{d:"M2.5 12c.5-2 2-3 3.5-3s3 1 3.5 3"}),(0,v.jsx)("circle",{cx:"11",cy:"5",r:"1.5"}),(0,v.jsx)("path",{d:"M10 10.5c.5-1 1.2-1.5 2-1.5 1 0 2 .8 2.3 2"})]}),grid:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2.5",y:"2.5",width:"4",height:"4"}),(0,v.jsx)("rect",{x:"9.5",y:"2.5",width:"4",height:"4"}),(0,v.jsx)("rect",{x:"2.5",y:"9.5",width:"4",height:"4"}),(0,v.jsx)("rect",{x:"9.5",y:"9.5",width:"4",height:"4"})]}),eye:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M1.5 8C3 5 5.3 3.5 8 3.5S13 5 14.5 8C13 11 10.7 12.5 8 12.5S3 11 1.5 8z"}),(0,v.jsx)("circle",{cx:"8",cy:"8",r:"1.8"})]}),slide:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),(0,v.jsx)("path",{d:"M5 6h6M5 8.5h4M5 11h5"})]}),gear:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("circle",{cx:"8",cy:"8",r:"2"}),(0,v.jsx)("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.5 3.5l1.4 1.4M11.1 11.1l1.4 1.4M3.5 12.5l1.4-1.4M11.1 4.9l1.4-1.4"})]}),flag:()=>(0,v.jsx)(D,{children:(0,v.jsx)("path",{d:"M3 13V3h7l-1 2.5L10 8H3"})}),dup:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"5",y:"5",width:"8",height:"8",rx:"1"}),(0,v.jsx)("path",{d:"M3 9V3h6"})]}),layout:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("path",{d:"M2.5 3.5h11v9h-11z"}),(0,v.jsx)("path",{d:"M2.5 7h11M7 7v5.5"})]}),panelLeft:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,v.jsx)("path",{d:"M6 3v10"}),(0,v.jsx)("rect",{x:"2.5",y:"3.5",width:"3.5",height:"9",fill:"currentColor",fillOpacity:.18,stroke:"none"})]}),panelRight:()=>(0,v.jsxs)(D,{children:[(0,v.jsx)("rect",{x:"2",y:"3",width:"12",height:"10",rx:"1.5"}),(0,v.jsx)("path",{d:"M10 3v10"}),(0,v.jsx)("rect",{x:"10",y:"3.5",width:"3.5",height:"9",fill:"currentColor",fillOpacity:.18,stroke:"none"})]})};var N=oe(be(),1),ih={trigger:220,state:240,branch:260,action:220,end:160,agent:240,checkpoint:220,transform:220},ah={trigger:46,state:118,branch:110,action:78,end:46,agent:118,checkpoint:92,transform:78};function np(e){return e.startsWith("trigger.")?"trigger":e.startsWith("action.")?"action":e}function er(e){let t=np(e.type);return{w:ih[t]??220,h:ah[t]??100}}function tr(e){return e.position?.x??0}function nr(e){return e.position?.y??0}function Ri(e,t){let{w:n,h:r}=er(e),o=tr(e),i=nr(e);return t==="in"?{x:o,y:i+r/2}:t==="out"?{x:o+n,y:i+r/2}:t==="true"?{x:o+n,y:i+r*.3}:t==="false"?{x:o+n,y:i+r*.7}:{x:o+n/2,y:i+r/2}}function tp(e,t){let n=Math.max(40,Math.abs(t.x-e.x)*.45);return`M ${e.x} ${e.y} C ${e.x+n} ${e.y}, ${t.x-n} ${t.y}, ${t.x} ${t.y}`}function lh(e){let{n:t,selected:n,state:r}=e,{w:o}=er(t),i=np(t.type),a=t.config,u=i==="trigger"?a.source==="cron"?"clock":a.source==="webhook"||a.source==="hook"?"hook":a.source==="manual"?"play":"gitlab":i==="agent"?"box":i==="branch"?"branch":i==="action"?t.type==="action.send"?"msg":t.type==="action.setLabel"?"tag":t.type==="action.react"?"bell":t.type==="action.callHTTP"?"globe":t.type==="action.logTime"?"clock":t.type==="action.createIssue"?"plus":"lightning":i==="checkpoint"?"flag":i==="transform"?"variable":"stop",s=L[u]??L.box,c=["node",`t-${i}`,n&&"is-selected",r==="running"&&"is-running",r==="visited"&&"is-visited",r==="error"&&"is-error"].filter(Boolean).join(" "),d={left:tr(t),top:nr(t),width:o},g=a.agentId,m=a.prompt;return(0,N.jsxs)("div",{className:c,style:d,onMouseDown:y=>e.onMouseDown?.(y,t),onClick:y=>e.onClick?.(y,t),onDoubleClick:y=>e.onDoubleClick?.(y,t),children:[(0,N.jsx)("div",{className:"node__stripe"}),(0,N.jsxs)("div",{className:"node__head",children:[(0,N.jsx)("div",{className:"node__icon",children:(0,N.jsx)(s,{})}),(0,N.jsxs)("div",{className:"node__meta",children:[(0,N.jsx)("div",{className:"node__kind",children:t.type}),(0,N.jsx)("div",{className:"node__name",children:t.id})]}),i!=="trigger"&&i!=="end"&&(0,N.jsx)("div",{className:"node__chev",children:(0,N.jsx)(L.more,{})})]}),i==="agent"&&(0,N.jsxs)("div",{className:"node__body",children:[g?(0,N.jsxs)("div",{className:"node__row",children:[(0,N.jsx)(L.users,{}),(0,N.jsx)("span",{className:"mono",children:g})]}):(0,N.jsx)("div",{className:"node__row",style:{color:"var(--muted-2)"},children:"no agent"}),m&&(0,N.jsx)("div",{className:"node__row",style:{alignItems:"flex-start",lineHeight:1.4},children:(0,N.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"var(--ink-2)",fontSize:11},children:m})})]}),i==="branch"&&(0,N.jsx)("div",{className:"node__body",children:(0,N.jsx)("div",{className:"node__row",children:(0,N.jsxs)("span",{className:"mono",style:{color:"var(--ink-2)"},children:[Array.isArray(a.cases)?a.cases.length:0," case",Array.isArray(a.cases)&&a.cases.length===1?"":"s"," \xB7 default: ",(0,N.jsx)("span",{className:"node__tag mono",children:String(a.default??"\u2014")})]})})}),i==="action"&&(0,N.jsxs)("div",{className:"node__body",children:[(0,N.jsx)("div",{className:"node__row",children:(0,N.jsx)("span",{className:"mono",style:{color:"var(--t-action)"},children:t.type.replace(/^action\./,"")})}),(0,N.jsx)("div",{className:"node__row",children:(0,N.jsx)("span",{style:{fontSize:11,color:"var(--ink-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:String(a.text??a.body??a.title??a.url??"")})})]}),i==="trigger"&&(0,N.jsx)("div",{className:"node__body",children:(0,N.jsx)("div",{className:"node__row",children:(0,N.jsx)("span",{className:"mono",style:{color:"var(--t-trigger)"},children:String(a.source??"")})})}),i!=="trigger"&&(0,N.jsx)("div",{className:"handle h-in",onMouseDown:y=>e.onPortDown?.(y,t,"in"),onMouseEnter:()=>e.onPortEnter?.(t,"in"),onMouseLeave:()=>e.onPortLeave?.()}),i==="branch"?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"handle h-true",onMouseDown:y=>e.onPortDown?.(y,t,"true"),onMouseEnter:()=>e.onPortEnter?.(t,"true"),onMouseLeave:()=>e.onPortLeave?.(),children:(0,N.jsx)("span",{className:"handle__label",children:"true"})}),(0,N.jsx)("div",{className:"handle h-false",onMouseDown:y=>e.onPortDown?.(y,t,"false"),onMouseEnter:()=>e.onPortEnter?.(t,"false"),onMouseLeave:()=>e.onPortLeave?.(),children:(0,N.jsx)("span",{className:"handle__label",children:"false"})})]}):i!=="end"&&(0,N.jsx)("div",{className:"handle h-out",onMouseDown:y=>e.onPortDown?.(y,t,"out"),onMouseEnter:()=>e.onPortEnter?.(t,"out"),onMouseLeave:()=>e.onPortLeave?.()})]})}function sh({nodes:e,viewBox:t,selection:n,hostRef:r}){let[o,i]=(0,We.useState)(!1);if(!e.length)return null;let a=60,u=e.map(P=>tr(P)),s=e.map(P=>nr(P)),c=e.map(P=>er(P).w),d=e.map(P=>er(P).h),g=Math.min(...u)-a,m=Math.min(...s)-a,y=Math.max(...u.map((P,K)=>P+c[K]))+a,k=Math.max(...s.map((P,K)=>P+d[K]))+a,S=y-g,B=k-m,f=r.current?.getBoundingClientRect(),p=f?.width??800,h=f?.height??500,x=-t.tx/t.zoom,C=-t.ty/t.zoom,M=p/t.zoom,F=h/t.zoom;return(0,N.jsxs)("div",{className:"cv__mini"+(o?" is-collapsed":""),children:[(0,N.jsxs)("div",{className:"cv__mini-head",children:[(0,N.jsx)("span",{children:"Map"}),(0,N.jsx)("button",{onClick:()=>i(!o),children:(0,N.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:(0,N.jsx)("path",{d:o?"M2 4l3 3 3-3":"M2 6l3-3 3 3",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"})})})]}),!o&&(0,N.jsxs)("svg",{viewBox:`${g} ${m} ${S} ${B}`,preserveAspectRatio:"xMidYMid meet",children:[(0,N.jsx)("rect",{className:"mini-view",x,y:C,width:M,height:F}),e.map(P=>{let K=er(P),W=n?.kind==="node"&&n.id===P.id;return(0,N.jsx)("rect",{className:"mini-node"+(W?" sel":""),x:tr(P),y:nr(P),width:K.w,height:K.h,rx:3},P.id)})]})]})}function rp(e){let{nodes:t,edges:n,selection:r,setSelection:o,onNodeMove:i,onAddNode:a,onConnect:u,runState:s,viewBox:c,setViewBox:d}=e,g=(0,We.useRef)(null),[m,y]=(0,We.useState)(null),[k,S]=(0,We.useState)(null),[B,f]=(0,We.useState)(!1),[p,h]=(0,We.useState)(null),[x,C]=(0,We.useState)(null),[M,F]=(0,We.useState)(null),{zoom:P,tx:K,ty:W}=c,ve=(E,j)=>{let U=g.current;if(!U)return{x:0,y:0};let Q=U.getBoundingClientRect();return{x:(E-Q.left-K)/P,y:(j-Q.top-W)/P}},ir=E=>{let j=E.target;j!==E.currentTarget&&!j.classList.contains("cv__viewport")||E.button!==0&&E.button!==1||(o(null),C({startX:E.clientX,startY:E.clientY,tx:K,ty:W}))},_n=(E,j)=>{if(E.target.classList.contains("handle"))return;E.stopPropagation(),o({kind:"node",id:j.id});let U=ve(E.clientX,E.clientY);y({id:j.id,offX:U.x-tr(j),offY:U.y-nr(j)})},ar=(E,j,U)=>{E.stopPropagation(),E.preventDefault();let Q=Ri(j,U);S({from:{id:j.id,port:U},x:Q.x,y:Q.y})},ao=(E,j)=>{k&&h({id:E.id,port:j})},lr=()=>h(null);(0,We.useEffect)(()=>{let E=U=>{if(m){let Q=ve(U.clientX,U.clientY);i(m.id,Q.x-m.offX,Q.y-m.offY)}else if(k){let Q=ve(U.clientX,U.clientY);S(q=>q&&{...q,x:Q.x,y:Q.y})}else x&&d(Q=>({...Q,tx:x.tx+(U.clientX-x.startX),ty:x.ty+(U.clientY-x.startY)}))},j=()=>{k&&p&&p.id!==k.from.id&&u({from:k.from.id,fromPort:k.from.port,to:p.id,toPort:"in"}),y(null),S(null),C(null),h(null)};return window.addEventListener("mousemove",E),window.addEventListener("mouseup",j),()=>{window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",j)}},[m,k,x,p,u,i,d]);let ht=E=>{if(!E.ctrlKey&&!E.metaKey&&Math.abs(E.deltaY)<30){d(Z=>({...Z,tx:Z.tx-E.deltaX,ty:Z.ty-E.deltaY}));return}E.preventDefault();let j=g.current;if(!j)return;let U=j.getBoundingClientRect(),Q=E.clientX-U.left,q=E.clientY-U.top,Be=-E.deltaY*.0015;d(Z=>{let qe=Math.min(2,Math.max(.3,Z.zoom*(1+Be))),Le=qe/Z.zoom;return{zoom:qe,tx:Q-(Q-Z.tx)*Le,ty:q-(q-Z.ty)*Le}})},mt=()=>d(E=>({...E,zoom:Math.min(2,E.zoom*1.15)})),Li=()=>d(E=>({...E,zoom:Math.max(.3,E.zoom/1.15)})),zi=()=>{let E=g.current;if(!E||!t.length)return;let j=E.getBoundingClientRect(),U=60,Q=1/0,q=1/0,Be=-1/0,Z=-1/0;t.forEach(at=>{let cr=er(at),dr=tr(at),lo=nr(at);Q=Math.min(Q,dr),q=Math.min(q,lo),Be=Math.max(Be,dr+cr.w),Z=Math.max(Z,lo+cr.h)});let qe=Be-Q+U*2,Le=Z-q+U*2,ye=Math.min(1,Math.min(j.width/qe,j.height/Le));d({zoom:ye,tx:(j.width-qe*ye)/2-(Q-U)*ye,ty:(j.height-Le*ye)/2-(q-U)*ye})},sr=E=>{E.preventDefault(),f(!0)},bn=()=>f(!1),ur=E=>{E.preventDefault(),f(!1);let j=E.dataTransfer.getData("application/x-wfe-item");if(j)try{let U=JSON.parse(j),Q=ve(E.clientX,E.clientY);a(U,Q.x-100,Q.y-40)}catch{}},Ai=E=>{let j=E.id??"",U=["wfe-edge"];return r?.kind==="edge"&&r.id===j&&U.push("is-selected"),M===j&&U.push("is-hover"),s?.currentEdgeId===j&&U.push("is-running"),j&&s?.visitedEdges?.has(j)&&U.push("is-visited"),E.fromPort==="true"&&U.push("is-true"),E.fromPort==="false"&&U.push("is-false"),U.join(" ")},Di=E=>s?.currentNodeId===E.id?"running":s?.visitedNodes?.has(E.id)?"visited":null,ji=(0,We.useMemo)(()=>{if(!k)return null;let E=t.find(Q=>Q.id===k.from.id);if(!E)return null;let j=Ri(E,k.from.port),U={x:k.x,y:k.y};return(0,N.jsx)("svg",{className:"cv__ghost-edge",width:"4000",height:"2400",children:(0,N.jsx)("path",{d:tp(j,U)})})},[k,t]);return(0,N.jsxs)("div",{className:"cv"+(x?" is-panning":"")+(B?" is-drop-target":""),ref:g,onWheel:ht,onMouseDown:ir,onDragOver:sr,onDragLeave:bn,onDrop:ur,children:[(0,N.jsxs)("div",{className:"cv__viewport",style:{transform:`translate(${K}px, ${W}px) scale(${P})`},children:[(0,N.jsxs)("svg",{className:"cv__edges",width:"4000",height:"2400",children:[(0,N.jsxs)("defs",{children:[(0,N.jsx)("marker",{id:"arr",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,N.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"currentColor"})}),(0,N.jsx)("marker",{id:"arr-ok",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,N.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"var(--ok)"})}),(0,N.jsx)("marker",{id:"arr-err",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,N.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"var(--err)"})}),(0,N.jsx)("marker",{id:"arr-acc",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto",children:(0,N.jsx)("path",{d:"M0 0L10 5L0 10z",fill:"var(--accent)"})})]}),n.map((E,j)=>{let U=t.find(at=>at.id===E.from),Q=t.find(at=>at.id===E.to);if(!U||!Q)return null;let q=E.id??`e-${j}`,Be=Ri(U,E.fromPort??"out"),Z=Ri(Q,E.toPort??"in"),qe=tp(Be,Z),Le={x:(Be.x+Z.x)/2,y:(Be.y+Z.y)/2},ye=s?.currentEdgeId===q||s?.visitedEdges?.has(q)?"url(#arr-acc)":E.fromPort==="true"?"url(#arr-ok)":E.fromPort==="false"?"url(#arr-err)":"url(#arr)";return(0,N.jsxs)("g",{children:[(0,N.jsx)("path",{className:"edge-bg",d:qe,onMouseEnter:()=>F(q),onMouseLeave:()=>F(null),onClick:()=>o({kind:"edge",id:q})}),(0,N.jsx)("path",{className:Ai(E),d:qe,markerEnd:ye}),E.label&&(0,N.jsxs)("g",{transform:`translate(${Le.x},${Le.y})`,children:[(0,N.jsx)("rect",{className:"edge-label-bg",x:-E.label.length*3.6-6,y:-9,rx:3,width:E.label.length*7.2+12,height:18}),(0,N.jsx)("text",{className:"edge-label",y:4,textAnchor:"middle",children:E.label})]})]},q)})]}),ji,t.map(E=>(0,N.jsx)(lh,{n:E,selected:r?.kind==="node"&&r.id===E.id,state:Di(E),onMouseDown:_n,onPortDown:ar,onPortEnter:ao,onPortLeave:lr,onClick:(j,U)=>{j.stopPropagation(),o({kind:"node",id:U.id})}},E.id))]}),(0,N.jsxs)("div",{className:"cv__controls",children:[(0,N.jsx)("button",{title:"Zoom out",onClick:Li,children:(0,N.jsx)(L.zoomout,{})}),(0,N.jsxs)("div",{className:"cv__zoom",children:[Math.round(P*100),"%"]}),(0,N.jsx)("button",{title:"Zoom in",onClick:mt,children:(0,N.jsx)(L.zoomin,{})}),(0,N.jsx)("button",{title:"Fit",onClick:zi,children:(0,N.jsx)(L.fit,{})})]}),(0,N.jsx)(sh,{nodes:t,viewBox:c,selection:r,hostRef:g})]})}var re=oe(Ct(),1);var is=[{section:"Triggers",items:[{id:"trigger.channel.whatsapp",type:"trigger.channel",label:"WhatsApp",hint:"On incoming WhatsApp message",glyph:"g-trigger",icon:"msg"},{id:"trigger.channel.telegram",type:"trigger.channel",label:"Telegram",hint:"On incoming Telegram message",glyph:"g-trigger",icon:"msg"},{id:"trigger.channel.gitlab",type:"trigger.channel",label:"GitLab",hint:"Issue / pipeline events",glyph:"g-trigger",icon:"gitlab"},{id:"trigger.cron",type:"trigger.cron",label:"Cron",hint:"Fires on a timer",glyph:"g-trigger",icon:"clock"},{id:"trigger.manual",type:"trigger.manual",label:"Manual",hint:"Kick off from UI / CLI",glyph:"g-trigger",icon:"play"},{id:"trigger.form",type:"trigger.form",label:"Form",hint:"Human fills a form to start",glyph:"g-trigger",icon:"plus"}]},{section:"Compute",items:[{id:"node.agent",type:"agent",label:"Agent",hint:"Run an agent with a templated prompt",glyph:"g-state",icon:"box"},{id:"node.transform",type:"transform",label:"Transform",hint:"Derive a bundle from upstream outputs",glyph:"g-state",icon:"variable"}]},{section:"People & composition",items:[{id:"node.userTask",type:"userTask",label:"User task",hint:"Assign a form to an actor / role; pauses the run",glyph:"g-state",icon:"box"},{id:"node.subProcess",type:"subProcess",label:"Sub-process",hint:"Call another workflow; parent resumes on child end",glyph:"g-state",icon:"box"},{id:"node.signal.emit",type:"signal.emit",label:"Emit signal",hint:"Post an event to other workflows",glyph:"g-action",icon:"msg"},{id:"node.signal.wait",type:"signal.wait",label:"Wait for signal",hint:"Pause until a matching signal arrives",glyph:"g-branch",icon:"flag"},{id:"node.timer.boundary",type:"timer.boundary",label:"Timer",hint:"Pause then fire after a duration (PT1H, P1D\u2026)",glyph:"g-branch",icon:"clock"}]},{section:"Flow control",items:[{id:"node.branch",type:"branch",label:"Branch",hint:"Route based on a condition",glyph:"g-branch",icon:"branch"},{id:"node.gateway.parallel",type:"gateway.parallel",label:"Parallel gateway",hint:"Fan out / join branches (mode: fanOut | join)",glyph:"g-branch",icon:"branch"},{id:"node.rule",type:"rule",label:"Decision table",hint:"DMN-style N-input rules; first match wins",glyph:"g-branch",icon:"branch"},{id:"node.checkpoint",type:"checkpoint",label:"Checkpoint",hint:"Persist state, pause for event",glyph:"g-branch",icon:"flag"},{id:"node.end",type:"end",label:"End",hint:"Run completes here",glyph:"g-end",icon:"stop"}]},{section:"Actions",items:[{id:"action.send",type:"action.send",label:"Send message",hint:"Post a message to any channel",glyph:"g-action",icon:"msg"},{id:"action.createIssue",type:"action.createIssue",label:"Create issue",hint:"Open a new GitLab issue",glyph:"g-action",icon:"plus"},{id:"action.setLabel",type:"action.setLabel",label:"Set Label",hint:"Add or remove labels",glyph:"g-action",icon:"tag"},{id:"action.callHTTP",type:"action.callHTTP",label:"HTTP Request",hint:"Call an external service",glyph:"g-action",icon:"globe"},{id:"action.logTime",type:"action.logTime",label:"Log Time",hint:"Record time spent in a state",glyph:"g-action",icon:"clock"}]}],as=[{group:"issue",items:[{path:"issue.title",type:"string"},{path:"issue.labels",type:"string[]"},{path:"issue.assignee",type:"string?"},{path:"issue.author",type:"string"},{path:"issue.body",type:"string"},{path:"issue.iid",type:"number"},{path:"issue.url",type:"string"}]},{group:"run",items:[{path:"run.id",type:"string"},{path:"run.state",type:"string"},{path:"run.workflow",type:"string"},{path:"run.homeNode",type:"string"}]},{group:"pipeline",items:[{path:"pipeline.status",type:"enum"},{path:"pipeline.ref",type:"string"},{path:"pipeline.id",type:"number"}]},{group:"state",items:[{path:"state.previous",type:"string?"},{path:"state.next",type:"string?"}]},{group:"env",items:[{path:"env.GITLAB_TOKEN",type:"secret (allowlist req.)"},{path:"env.GITLAB_HOST",type:"string (allowlist req.)"}]}],ls=[{id:"tpl.gitlab",title:"GitLab issue lifecycle",hint:"Triage \u2192 Review \u2192 QA \u2192 Done \xB7 5 states",dots:3},{id:"tpl.mr",title:"MR review loop",hint:"Agent-driven 3-state review",dots:2},{id:"tpl.blank",title:"Blank canvas",hint:"Start from a single trigger",dots:1}],op=[{id:"triage-agent",name:"Triage Agent",tags:["default"],color:200},{id:"dev-agent",name:"Dev Agent",tags:["default"],color:145},{id:"code-reviewer",name:"Code Reviewer",tags:["default"],color:28}];var uh=[{path:"channel",type:"string",description:"Channel name that received the event.",example:'"whatsapp"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"chatId",type:"string",description:"Stable chat id \u2014 conversation partner JID (WhatsApp) or chat integer (Telegram). Use as `action.send` chatId to reply on the same thread.",example:'"21624309128@s.whatsapp.net"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"accountId",type:"string",description:"Which bot account received the message. Telegram routes this per-account; inherit into `action.send` to reply through the same bot.",example:'"default"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"text",type:"string",description:"Message body (caption for media), lower-cased for routing but the raw text here is verbatim.",example:'"hello"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"fromJid",type:"string",description:"Raw sender JID/id straight from the platform. Use `sender.id` for the normalized form.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"sender.id",type:"string",description:"Normalized sender id.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"sender.name",type:"string",description:"Display name, e.g. WhatsApp pushName or Telegram first_name.",example:'"Anis"',sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"sender.username",type:"string",description:"Platform-specific handle when available (Telegram @username, ...).",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"group.id",type:"string",description:"Group chat id when the message came from a group; undefined for DMs.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"group.name",type:"string",description:"Group display name when available.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"replyTo",type:"string",description:"ID of the message this one quoted, when any.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"replyToText",type:"string",description:"Text of the quoted message when available.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"media.path",type:"string",description:"Filesystem path of the attached media after download.",sourceFilter:["whatsapp-message","telegram-message"]},{path:"media.type",type:"string",description:"MIME type of the media (`image/jpeg`, `audio/ogg`, ...).",sourceFilter:["whatsapp-message","telegram-message"]},{path:"event.id",type:"string",description:"Platform message id. Use as `action.send` replyTo to thread replies.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"event.timestamp",type:"string",description:"ISO-8601 timestamp of the source message.",sourceFilter:["whatsapp-message","telegram-message","discord-message","slack-message"]},{path:"issue.iid",type:"number",description:"GitLab internal issue id (per project).",example:"42",sourceFilter:["gitlab-issue"]},{path:"issue.title",type:"string",description:"Issue title.",sourceFilter:["gitlab-issue"]},{path:"issue.description",type:"string",description:"Issue description body.",sourceFilter:["gitlab-issue"]},{path:"issue.url",type:"string",description:"Web URL of the issue.",sourceFilter:["gitlab-issue"]},{path:"issue.action",type:"string",description:"Action that triggered the event (`open`, `update`, `close`, ...).",sourceFilter:["gitlab-issue"]},{path:"issue.labels",type:"array",description:"Current labels on the issue.",sourceFilter:["gitlab-issue"]},{path:"issue.assignees",type:"array",description:"Assignees on the issue.",sourceFilter:["gitlab-issue"]},{path:"project",type:"string",description:"GitLab project path.",example:'"noqta/web"',sourceFilter:["gitlab-issue","gitlab-pipeline"]},{path:"chatId",type:"string",description:'Stable entity id for GitLab: "<project>:issue:<iid>" (issue) or "<project>:merge_request:<iid>" (pipeline).',sourceFilter:["gitlab-issue","gitlab-pipeline"]},{path:"channel",type:"string",description:'Always `"gitlab"` for GitLab sources.',sourceFilter:["gitlab-issue","gitlab-pipeline"]},{path:"pipeline.id",type:"number",description:"Pipeline id.",sourceFilter:["gitlab-pipeline"]},{path:"pipeline.status",type:"string",description:"Pipeline status (`success`, `failed`, `canceled`, ...).",sourceFilter:["gitlab-pipeline"]},{path:"pipeline.ref",type:"string",description:"Git ref the pipeline ran on.",sourceFilter:["gitlab-pipeline"]}],ch=[{path:"reply",type:"string",description:"Full agent response text. Most common template target (e.g. echoing it back via `action.send`).",example:'"Got it \u2014 routing to..."'},{path:"result",type:"string",description:"Parsed `RESULT: <token>` marker from the agent's reply (lowercased), or `approved`/`rejected`/`done`/`failed` from a `[BRACKET]`. Used by `branch` nodes to route on agent classification.",example:'"approved"'},{path:"json",type:"any",description:"When `resultParser` is `json`, the parsed first fenced ```json ... ``` block. Useful for structured agent outputs."},{path:"taskId",type:"string",description:"Opaque workflow-scoped task id \u2014 mostly for diagnostics.",example:'"wf-<runId>-<suffix>"'},{path:"durationMs",type:"number",description:"Wall-clock duration of the agent call.",example:"14520"}],dh=[{path:"messageId",type:"string",description:"Platform message id of the sent message. `null` when the adapter couldn't capture it (e.g. mesh-forwarded sends may return null)."},{path:"viaMesh",type:"bool",description:"`true` when the send was forwarded over the mesh to a peer that hosts the channel (workflow on one node, channel adapter on another). Absent for local sends."}],ph=[{path:"issue.iid",type:"number",description:"Newly-created issue iid.",example:"123"},{path:"issue.url",type:"string",description:"Web URL of the new issue."},{path:"issue.webUrl",type:"string",description:"Alias of `issue.url`."}],fh=[{path:"labels",type:"array",description:"Label list after the change."},{path:"add",type:"array",description:"Labels that were added in this call."},{path:"remove",type:"array",description:"Labels that were removed in this call."}],gh=[{path:"labels",type:"array",description:"Current label list on the entity. Use with a `branch` node to route on label state."}],hh=[{path:"emoji",type:"string",description:"The emoji reaction that was applied (echoes the input for debugging)."}],mh=[{path:"edited",type:"bool",description:"`true` when the platform accepted the edit. Treat `false` as a soft miss \u2014 text may have been unchanged or the message was too old."}],vh=[{path:"durationMs",type:"number",description:"Duration logged, in milliseconds (echoed for downstream use)."}],yh=[{path:"ok",type:"bool",description:"Response.ok \u2014 `true` for 2xx."},{path:"status",type:"number",description:"HTTP status code.",example:"200"},{path:"body",type:"any",description:"Parsed JSON body when the response was JSON; otherwise the raw text string."}],xh=[{path:"port",type:"string",description:"Which outgoing port matched. Downstream edges with `fromPort` matching this value will fire."}],wh=[{path:"value",type:"any",description:"When config uses `path`, this carries the value picked from context. In `template` mode, keys from the rendered template land at the top level of this node's output (no `.value` prefix)."}],kh=[{path:"event",type:"any",description:"Payload of the event that resumed this checkpoint. Fields mirror whichever trigger source delivered the resume event."}],_h=[{path:"name",type:"string",description:"Name of the signal that resumed the wait."},{path:"payload",type:"any",description:"Payload the emitter attached to the signal."},{path:"receivedAt",type:"string",description:"ISO-8601 time the signal was observed."}],bh=[{path:"emittedAt",type:"string",description:"ISO-8601 time the signal was published."}],Sh=[{path:"firedAt",type:"string",description:"ISO-8601 time the timer elapsed (when resumed)."},{path:"scheduledFor",type:"string",description:"ISO-8601 time the timer was originally scheduled for."}],Nh=[{path:"submission",type:"object",description:"Form values submitted by the assignee, keyed by field id. Shape depends on this userTask's form schema."},{path:"submittedBy",type:"string",description:"Actor id of the user who completed the task."},{path:"submittedAt",type:"string",description:"ISO-8601 submission timestamp."}],Ch=[{path:"childRunId",type:"string",description:"Run id of the spawned child workflow."},{path:"result",type:"any",description:"Output bundle of the child's terminal `end` node (if any)."}],ss={"trigger.channel":{summary:"Raw event payload from the source channel. Shape varies by `source` \u2014 the Context panel filters accordingly.",fields:uh},"trigger.manual":{summary:"Arbitrary payload posted by `agentx workflow run <id>` / POST /workflows/:id/run.",fields:[{path:"",type:"any",description:"Whatever JSON the caller supplied."}]},"trigger.cron":{summary:"Scheduled tick \u2014 no data bundle beyond the firing metadata.",fields:[{path:"firedAt",type:"string",description:"ISO-8601 time the tick fired."},{path:"cronSpec",type:"string",description:"The `spec` from the node's config (echoed for debug)."}]},"trigger.hook":{summary:"Fires when a custom hook event bubbles through the registry. Payload is whatever the hook subscriber chose to emit.",fields:[{path:"",type:"any",description:"Hook-specific payload."}]},"trigger.form":{summary:"Starts when a published form receives a submission.",fields:[{path:"formId",type:"string",description:"Form id that received the submission."},{path:"submission",type:"object",description:"Submitted values keyed by field id."},{path:"submittedBy",type:"string",description:"Actor id of the submitter."}]},agent:{summary:"Agent response after executing the prompt template.",fields:ch},transform:{summary:"Value picked from upstream context (path mode) or rendered template bundle (template mode).",fields:wh},branch:{summary:"Which outgoing port fired. Downstream edges match via `fromPort`.",fields:xh},"gateway.parallel":{summary:"All incoming branches joined here. No output.",fields:[]},rule:{summary:"Evaluates a declarative rule against context; may short-circuit the walk.",fields:[]},"action.send":{summary:"Dispatched an outbound message through the chosen channel.",fields:dh},"action.createIssue":{summary:"Created an issue on GitLab/GitHub.",fields:ph},"action.setLabel":{summary:"Added/removed labels on a GitLab issue or MR.",fields:fh},"action.readLabel":{summary:"Fetched the current label list \u2014 useful before a `branch`.",fields:gh},"action.react":{summary:"Emoji reaction on a message (Telegram/WhatsApp).",fields:hh},"action.editMessage":{summary:"Edited an existing message in place.",fields:mh},"action.logTime":{summary:"Logged time spent on a GitLab issue/MR.",fields:vh},"action.callHTTP":{summary:"Made an outbound HTTP request with templated params.",fields:yh},userTask:{summary:"Paused for a human to submit a form. Resumes with the submission in this node's output.",fields:Nh},subProcess:{summary:"Spawned a child workflow and waited for its completion.",fields:Ch},"signal.emit":{summary:"Published a signal to the bus. Runs elsewhere can resume on it via `signal.wait`.",fields:bh},"signal.wait":{summary:"Paused until a matching signal arrives. Resumes with that signal in this node's output.",fields:_h},"timer.boundary":{summary:"Paused until a timer elapses. Resumes with timing metadata.",fields:Sh},checkpoint:{summary:"Paused until a matching resume event arrives on this entity.",fields:kh},end:{summary:"Terminal node \u2014 closes the run with the configured status. No output downstream.",fields:[]}};function ip(e,t={}){let n=ss[e];if(!n)return[];let r=typeof t.source=="string"?t.source:void 0;return r?n.fields.filter(o=>!o.sourceFilter||o.sourceFilter.includes(r)):n.fields.filter(o=>!o.sourceFilter)}var l=oe(be(),1);function z({title:e,children:t,defaultOpen:n=!0,right:r}){let[o,i]=(0,re.useState)(n);return(0,l.jsxs)("div",{className:"insp__section"+(o?"":" is-collapsed"),children:[(0,l.jsxs)("div",{className:"insp__section-head",onClick:()=>i(!o),children:[(0,l.jsx)("span",{className:"chev",children:(0,l.jsx)(L.chev,{})}),(0,l.jsx)("h4",{children:e}),r]}),(0,l.jsx)("div",{className:"insp__section-body",children:t})]})}function w({label:e,hint:t,err:n,children:r,mono:o}){return(0,l.jsxs)("div",{className:"fld"+(o?" is-mono":"")+(n?" is-err":""),children:[(0,l.jsxs)("div",{className:"fld__label",children:[(0,l.jsx)("span",{children:e}),t&&(0,l.jsx)("span",{className:"fld__hint",children:t})]}),r,n&&(0,l.jsxs)("div",{className:"fld__err",children:[(0,l.jsx)(L.err,{}),n]})]})}function I({value:e,onChange:t,placeholder:n,mono:r,list:o}){return(0,l.jsx)("input",{className:"fld__input"+(r?" mono":""),type:"text",value:e,placeholder:n,list:o,onChange:i=>t(i.target.value)})}function wn({value:e,onChange:t,placeholder:n}){return(0,l.jsx)("input",{className:"fld__input",type:"number",value:e??"",placeholder:n,onChange:r=>{let o=r.target.value.trim();t(o===""?void 0:Number(o))}})}function St({value:e,onChange:t,rows:n=3,placeholder:r,mono:o}){return(0,l.jsx)("textarea",{className:"fld__input"+(o?" mono":""),rows:n,spellCheck:!1,value:e,placeholder:r,onChange:i=>t(i.target.value)})}function ue({value:e,onChange:t,options:n}){return(0,l.jsx)("select",{className:"fld__select",value:e,onChange:r=>t(r.target.value),children:n.map(r=>{let o=typeof r=="string"?r:r.value,i=typeof r=="string"?r:r.label;return(0,l.jsx)("option",{value:o,children:i},o)})})}function cs({checked:e,onChange:t,label:n}){return(0,l.jsxs)("label",{className:"fld__check",style:{display:"flex",gap:8,alignItems:"center",fontSize:12},children:[(0,l.jsx)("input",{type:"checkbox",checked:e,onChange:r=>t(r.target.checked)}),(0,l.jsx)("span",{children:n})]})}function bt({value:e,onChange:t,placeholder:n,mono:r}){return(0,l.jsx)("input",{className:"fld__input"+(r?" mono":""),type:"text",value:e.join(", "),placeholder:n,onChange:o=>t(o.target.value.split(",").map(i=>i.trim()).filter(Boolean))})}function rr({value:e,onChange:t,placeholder:n,rows:r=3}){let[o,i]=(0,re.useState)(!1),[a,u]=(0,re.useState)(0),s=(0,re.useRef)(null),c=(0,re.useMemo)(()=>{let m=[];return as.forEach(y=>y.items.forEach(k=>m.push({group:y.group,...k}))),m},[]),d=m=>{let y=s.current;if(!y)return;let k=y.selectionStart,S=e.slice(0,k),B=e.slice(k),p=S.endsWith("{{")?S:S+"{{",h=p+m+"}}"+B;t(h),i(!1),requestAnimationFrame(()=>{y.focus();let x=p.length+m.length+2;y.setSelectionRange(x,x)})};return(0,l.jsxs)("div",{className:"expr",style:{position:"relative"},children:[(0,l.jsx)("textarea",{ref:s,className:"fld__input mono",rows:r,spellCheck:!1,value:e,placeholder:n,onChange:m=>t(m.target.value),onKeyDown:m=>{if(!o){m.key==="{"&&m.shiftKey&&i(!0);return}m.key==="ArrowDown"?(m.preventDefault(),u(y=>(y+1)%c.length)):m.key==="ArrowUp"?(m.preventDefault(),u(y=>(y-1+c.length)%c.length)):m.key==="Enter"||m.key==="Tab"?(m.preventDefault(),d(c[a].path)):m.key==="Escape"&&i(!1)}}),(0,l.jsxs)("div",{className:"fld__hint",style:{display:"flex",alignItems:"center",gap:6,marginTop:4},children:[(0,l.jsx)(L.variable,{}),"Type ",(0,l.jsx)("code",{children:"{{"})," to insert a variable \xB7 ",(0,l.jsx)("kbd",{children:"\u2191\u2193"})," ",(0,l.jsx)("kbd",{children:"\u21B5"}),(0,l.jsx)("button",{type:"button",style:{marginLeft:"auto",background:"none",border:"none",color:"inherit",cursor:"pointer"},onClick:()=>i(!o),children:(0,l.jsx)(L.plus,{})})]}),o&&(0,l.jsx)("div",{className:"expr__popover",style:{position:"absolute",left:0,right:0,top:"100%",zIndex:10,background:"var(--bg)",border:"1px solid var(--line)",borderRadius:4,maxHeight:260,overflowY:"auto",boxShadow:"0 6px 20px rgba(0,0,0,0.25)"},children:as.map(m=>(0,l.jsxs)(re.Fragment,{children:[(0,l.jsx)("div",{className:"expr__pop-group",style:{padding:"4px 10px",fontSize:10,color:"var(--muted)",textTransform:"uppercase",letterSpacing:.5},children:m.group}),m.items.map(y=>{let k=c.findIndex(B=>B.path===y.path);return(0,l.jsxs)("div",{onMouseEnter:()=>u(k),onClick:()=>d(y.path),style:{padding:"4px 10px",cursor:"pointer",fontSize:11,display:"flex",justifyContent:"space-between",gap:12,fontFamily:"var(--ax-mono, ui-monospace)",background:k===a?"var(--accent-soft)":"transparent"},children:[(0,l.jsx)("span",{children:`{{${y.path}}}`}),(0,l.jsx)("span",{style:{color:"var(--muted)",fontSize:10},children:y.type})]},y.path)})]},m.group))})]})}function Eh({value:e,onChange:t,agents:n}){let[r,o]=(0,re.useState)(!1),[i,a]=(0,re.useState)(""),u=(0,re.useRef)(null);(0,re.useEffect)(()=>{let d=g=>{u.current&&!u.current.contains(g.target)&&o(!1)};return window.addEventListener("mousedown",d),()=>window.removeEventListener("mousedown",d)},[]);let s=n.find(d=>d.id===e),c=n.filter(d=>!i||d.name.toLowerCase().includes(i.toLowerCase())||d.id.includes(i));return(0,l.jsxs)("div",{ref:u,style:{position:"relative"},children:[(0,l.jsxs)("button",{type:"button",className:"fld__input",onClick:()=>o(d=>!d),style:{display:"flex",alignItems:"center",gap:8,textAlign:"left",width:"100%",cursor:"pointer"},children:[(0,l.jsx)("span",{style:{display:"inline-flex",width:22,height:22,borderRadius:4,background:`oklch(0.78 0.13 ${s?.color??260})`,color:"#fff",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:600,flexShrink:0},children:(s?.name??"??").slice(0,2).toUpperCase()}),(0,l.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:12,fontWeight:500},children:s?.name??"Select agent\u2026"}),(0,l.jsx)("div",{style:{fontSize:10,color:"var(--muted)",fontFamily:"var(--ax-mono, ui-monospace)"},children:s?.id??"\u2014"})]}),(0,l.jsx)(L.chev,{})]}),r&&(0,l.jsxs)("div",{style:{position:"absolute",left:0,right:0,top:"100%",zIndex:10,background:"var(--bg)",border:"1px solid var(--line)",borderRadius:4,marginTop:4,maxHeight:280,overflowY:"auto",boxShadow:"0 6px 20px rgba(0,0,0,0.25)"},children:[(0,l.jsx)("div",{style:{padding:6,borderBottom:"1px solid var(--line)"},children:(0,l.jsx)("input",{autoFocus:!0,className:"fld__input",value:i,placeholder:"Filter agents\u2026",onChange:d=>a(d.target.value),style:{width:"100%"}})}),(0,l.jsxs)("div",{children:[c.map(d=>(0,l.jsxs)("div",{onClick:()=>{t(d.id),o(!1),a("")},style:{padding:"6px 10px",cursor:"pointer",display:"flex",gap:8,alignItems:"center",background:d.id===e?"var(--accent-soft)":"transparent"},children:[(0,l.jsx)("span",{style:{display:"inline-flex",width:22,height:22,borderRadius:4,background:`oklch(0.78 0.13 ${d.color})`,color:"#fff",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:600,flexShrink:0},children:d.name.slice(0,2).toUpperCase()}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:12,fontWeight:500},children:d.name}),(0,l.jsx)("div",{style:{fontSize:10,color:"var(--muted)",fontFamily:"var(--ax-mono, ui-monospace)"},children:d.id})]}),d.tags.length>0&&(0,l.jsx)("div",{style:{display:"flex",gap:3},children:d.tags.map(g=>(0,l.jsx)("span",{style:{fontSize:9,color:"var(--muted)",background:"var(--surface)",padding:"1px 5px",borderRadius:3},children:g},g))})]},d.id)),c.length===0&&(0,l.jsx)("div",{style:{padding:10,fontSize:11,color:"var(--muted)"},children:"No agents match."})]})]}),(0,l.jsx)(w,{label:"",hint:"Free text \u2014 type an agent id directly if it isn't in the list yet",children:(0,l.jsx)(I,{value:e??"",onChange:t,placeholder:"agent-id",mono:!0})})]})}var Ph=new Set(["whatsapp-message","telegram-message","gitlab-issue","gitlab-pipeline"]);function Th({node:e,patchData:t}){let n=e.config,r=n.filter??{},o=g=>t({filter:{...r,...g}}),i=String(n.source??"whatsapp-message"),a=Ph.has(i),u=i==="whatsapp-message"||i==="telegram-message"||i==="discord-message"||i==="slack-message",s=i==="gitlab-issue"||i==="gitlab-pipeline",c=i==="github-issue"||i==="github-pr",d=s||c;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(z,{title:"Source",children:[(0,l.jsx)(w,{label:"Channel event",hint:a?"\u2713 wired end-to-end":"schema-only \u2014 no hook subscriber yet",children:(0,l.jsx)(ue,{value:i,onChange:g=>t({source:g,filter:{}}),options:[{value:"whatsapp-message",label:"WhatsApp message \u2713"},{value:"telegram-message",label:"Telegram message \u2713"},{value:"gitlab-issue",label:"GitLab issue \u2713"},{value:"gitlab-pipeline",label:"GitLab pipeline \u2713"},{value:"github-issue",label:"GitHub issue (not wired)"},{value:"github-pr",label:"GitHub PR (not wired)"},{value:"discord-message",label:"Discord message"},{value:"slack-message",label:"Slack message"}]})}),s&&(0,l.jsx)(w,{label:"Project",hint:'GitLab path (e.g. "noqta/web") or "*" for any',children:(0,l.jsx)(I,{mono:!0,value:String(r.project??""),onChange:g=>o({project:g}),placeholder:"noqta/web"})}),c&&(0,l.jsx)(w,{label:"Repo",hint:'"owner/repo" or "*" for any',children:(0,l.jsx)(I,{mono:!0,value:String(r.repo??""),onChange:g=>o({repo:g}),placeholder:"owner/repo"})}),u&&(0,l.jsx)(w,{label:"Chat",hint:i==="whatsapp-message"?'Contact number or JID (formats like "+216 24 309 128", "21624309128", "...@s.whatsapp.net" all match). "*" for any.':i==="telegram-message"?'Telegram chat id (e.g. "1816212449" for a DM, "-1003861455814" for a group). "*" for any.':'Exact chat id. "*" matches any.',children:(0,l.jsx)(I,{mono:!0,value:String(r.chat??""),onChange:g=>o({chat:g}),placeholder:"*"})}),d&&(0,l.jsx)(w,{label:"Label filter (any of)",hint:"Fires only when at least one of these labels is present on the issue/MR",children:(0,l.jsx)(bt,{mono:!0,value:Array.isArray(r.labels)?r.labels:[],onChange:g=>o({labels:g}),placeholder:"bug, needs-review"})})]}),u&&(0,l.jsx)(z,{title:"Routing",defaultOpen:!1,children:(0,l.jsx)(w,{label:"Passthrough",hint:"When on, the default agent router ALSO replies alongside this workflow. Use for observability-only workflows (tag, log, forward) that shouldn't own the conversation.",children:(0,l.jsx)(cs,{checked:!!n.passthrough,onChange:g=>t({passthrough:g}),label:"Let the default agent also reply"})})})]})}function Mh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"Schedule",children:[(0,l.jsx)(w,{label:"Cron spec",hint:"Standard 5-field cron (minute hour day month weekday)",children:(0,l.jsx)(I,{mono:!0,value:String(n.spec??"0 * * * *"),onChange:r=>t({spec:r}),placeholder:"0 9 * * *"})}),(0,l.jsx)(w,{label:"Timezone",hint:"IANA timezone string \u2014 defaults to UTC",children:(0,l.jsx)(I,{mono:!0,value:String(n.timezone??"UTC"),onChange:r=>t({timezone:r}),placeholder:"Africa/Tunis"})})]})}function Fh({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(z,{title:"Hook subscription",children:(0,l.jsx)(w,{label:"Event",hint:'Any "on:*" hook event fired elsewhere in agentx',children:(0,l.jsx)(I,{mono:!0,value:String(n.event??"on:"),onChange:r=>t({event:r}),placeholder:"on:gitlab-issue"})})})}function Rh(e){return(0,l.jsx)(z,{title:"Manual run",children:(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)",lineHeight:1.5},children:["No configuration needed. Fire this workflow via:",(0,l.jsx)("pre",{style:{marginTop:8,padding:8,background:"var(--bg)",border:"1px solid var(--line)",borderRadius:4,fontSize:11},children:"agentx workflow run <id>"}),"or ",(0,l.jsx)("span",{className:"mono",children:"POST /workflows/<id>/run"}),"."]})})}function Ih({node:e,patchData:t,agents:n}){let r=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(z,{title:"Agent",children:[(0,l.jsx)(w,{label:"Which agent runs",children:(0,l.jsx)(Eh,{value:r.agentId,onChange:o=>t({agentId:o}),agents:n})}),(0,l.jsx)(w,{label:"Prompt",hint:"Supports {{nodeId.path}} variables from upstream context",children:(0,l.jsx)(rr,{value:r.prompt??"",onChange:o=>t({prompt:o}),placeholder:"Classify {{trigger.text}} \u2014 reply RESULT: status-check | new-request | other",rows:5})})]}),(0,l.jsxs)(z,{title:"Behavior",defaultOpen:!1,children:[(0,l.jsx)(w,{label:"Result parser",hint:"How to extract a routing token from the agent's reply",children:(0,l.jsx)(ue,{value:String(r.resultParser??"noqta-result-token"),onChange:o=>t({resultParser:o}),options:[{value:"noqta-result-token",label:"RESULT: token (recommended)"},{value:"json",label:"JSON block (```json \u2026```)"},{value:"raw",label:"Raw reply (no parsing)"}]})}),(0,l.jsx)(w,{label:"Timeout (minutes)",children:(0,l.jsx)(wn,{value:r.timeoutMinutes,onChange:o=>t({timeoutMinutes:o}),placeholder:"5"})})]})]})}function Oh({node:e,patchData:t}){let n=e.config,[r,o]=(0,re.useState)(n.template&&typeof n.template=="object"?"template":"path");return(0,l.jsxs)(z,{title:"Transform",children:[(0,l.jsx)(w,{label:"Mode",children:(0,l.jsx)(ue,{value:r,onChange:i=>{let a=i;o(a),t(a==="path"?{path:n.path??"",template:void 0}:{template:n.template??{},path:void 0})},options:[{value:"path",label:"Pick value from context (dotted path)"},{value:"template",label:"Build a bundle (template object)"}]})}),r==="path"&&(0,l.jsx)(w,{label:"Path",hint:"e.g. classify.reply or trigger.contact.name",children:(0,l.jsx)(I,{mono:!0,value:String(n.path??""),onChange:i=>t({path:i}),placeholder:"classify.reply"})}),r==="template"&&(0,l.jsx)(w,{label:"Template (JSON object)",hint:"Each string value is rendered with {{nodeId.path}} variables",children:(0,l.jsx)(St,{mono:!0,rows:6,value:JSON.stringify(n.template??{},null,2),onChange:i=>{try{t({template:JSON.parse(i)})}catch{}},placeholder:`{
1254
+ "greeting": "hi {{trigger.sender.name}}"
1255
+ }`})})]})}function Lh({node:e,patchData:t}){let n=e.config,r=n.cases??[],o=s=>t({cases:s}),i=(s,c)=>o(r.map((d,g)=>g===s?c:d)),a=(s,c)=>i(s,{...r[s],when:{...r[s].when,...c}}),u=(s,c)=>i(s,{...r[s],when:{...r[s].when,params:{...r[s].when.params,...c}}});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(z,{title:"Cases",right:(0,l.jsx)("span",{className:"card__kind",children:r.length}),children:[r.map((s,c)=>{let d=s.when.params??{};return(0,l.jsxs)("div",{style:{border:"1px solid var(--line)",borderRadius:4,padding:10,marginBottom:8,background:"var(--bg)"},children:[(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[(0,l.jsxs)("strong",{style:{fontSize:11},children:["Case #",c+1]}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",onClick:()=>o(r.filter((g,m)=>m!==c)),children:(0,l.jsx)(L.trash,{})})]}),(0,l.jsx)(w,{label:"If",children:(0,l.jsx)(ue,{value:s.when.kind,onChange:g=>a(c,{kind:g,params:{}}),options:[{value:"equals",label:"Path equals value"},{value:"contains",label:"Path contains value"},{value:"matches",label:"Path matches regex"},{value:"exists",label:"Path exists (non-empty)"}]})}),(0,l.jsx)(w,{label:"Path",hint:"e.g. classify.result",children:(0,l.jsx)(I,{mono:!0,value:String(d.path??""),onChange:g=>u(c,{path:g}),placeholder:"classify.result"})}),(s.when.kind==="equals"||s.when.kind==="contains")&&(0,l.jsx)(w,{label:"Value",children:(0,l.jsx)(I,{mono:!0,value:String(d.value??""),onChange:g=>u(c,{value:g})})}),s.when.kind==="matches"&&(0,l.jsx)(w,{label:"Regex",children:(0,l.jsx)(I,{mono:!0,value:String(d.regex??""),onChange:g=>u(c,{regex:g}),placeholder:"^(approved|done)$"})}),(0,l.jsx)(w,{label:"Port",hint:"Outgoing edge's `fromPort` must match this",children:(0,l.jsx)(I,{mono:!0,value:s.to,onChange:g=>i(c,{...s,to:g}),placeholder:"approved"})})]},c)}),(0,l.jsxs)("button",{className:"btn btn--ghost-icon",style:{width:"100%",padding:8,justifyContent:"center"},onClick:()=>o([...r,{when:{kind:"equals",params:{path:"",value:""}},to:`case${r.length+1}`}]),children:[(0,l.jsx)(L.plus,{})," Add case"]})]}),(0,l.jsx)(z,{title:"Fallback",defaultOpen:!1,children:(0,l.jsx)(w,{label:"Default port",hint:"Used when no case matches. Leave blank to drop the event.",children:(0,l.jsx)(I,{mono:!0,value:String(n.default??"fallback"),onChange:s=>t({default:s})})})})]})}function zh({node:e,patchData:t}){let n=e.config,r=n.waitFor??{},o=a=>t({waitFor:{...r,...a}}),i=n.resumeMatch??{};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(z,{title:"Checkpoint",children:(0,l.jsx)(w,{label:"Name",hint:"Human label shown in logs + run timelines",children:(0,l.jsx)(I,{value:String(n.name??e.id),onChange:a=>t({name:a}),placeholder:"await-label-change"})})}),(0,l.jsxs)(z,{title:"Wait for",children:[(0,l.jsx)(w,{label:"Source",hint:"Which kind of event unpauses this run",children:(0,l.jsx)(ue,{value:String(r.source??""),onChange:a=>o({source:a||void 0}),options:[{value:"",label:"Any (same entity)"},{value:"gitlab-issue",label:"GitLab issue update"},{value:"gitlab-pipeline",label:"GitLab pipeline event"},{value:"whatsapp-message",label:"WhatsApp reply"},{value:"telegram-message",label:"Telegram reply"},{value:"manual",label:"Manual poke"}]})}),(0,l.jsx)(w,{label:"Labels (any of)",hint:"e.g. a label change to one of these resumes the run",children:(0,l.jsx)(bt,{mono:!0,value:Array.isArray(r.labels)?r.labels:[],onChange:a=>o({labels:a.length?a:void 0})})})]}),(0,l.jsx)(z,{title:"Advanced match",defaultOpen:!1,children:(0,l.jsx)(w,{label:"Event id contains",hint:"Optional substring match on the incoming event's id",children:(0,l.jsx)(I,{mono:!0,value:String(i.eventIdLike??""),onChange:a=>t({resumeMatch:{...i,eventIdLike:a||void 0}})})})})]})}function Ah({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"Terminal",children:[(0,l.jsx)(w,{label:"Status",children:(0,l.jsx)(ue,{value:String(n.status??"completed"),onChange:r=>t({status:r}),options:[{value:"completed",label:"Completed (success)"},{value:"failed",label:"Failed"},{value:"canceled",label:"Canceled"}]})}),(0,l.jsx)(w,{label:"Summary (optional)",hint:"Surfaced in run history + notifications",children:(0,l.jsx)(St,{value:String(n.summary??""),onChange:r=>t({summary:r}),rows:2})})]})}var Dh=["gitlab","github","whatsapp","telegram","discord","slack"],us=new Map,ap=6e4;function jh(e){let[t,n]=(0,re.useState)(()=>{let r=us.get(e);return r&&Date.now()-r.at<ap?{chats:r.chats,source:r.source,loading:!1}:{chats:[],source:"",loading:!0}});return(0,re.useEffect)(()=>{let r=!1,o=us.get(e);if(o&&Date.now()-o.at<ap){n({chats:o.chats,source:o.source,loading:!1});return}return n(i=>({...i,loading:!0})),fetch(`/channels/${encodeURIComponent(e)}/chats`).then(i=>i.ok?i.json():{chats:[],source:""}).then(i=>{if(r)return;let a=Array.isArray(i.chats)?i.chats:[],u=typeof i.source=="string"?i.source:"";us.set(e,{at:Date.now(),chats:a,source:u}),n({chats:a,source:u,loading:!1})}).catch(()=>{r||n({chats:[],source:"",loading:!1})}),()=>{r=!0}},[e]),t}function Uh({node:e,patchData:t,nodes:n}){let r=e.config,o=n.find(c=>c.type.startsWith("trigger."))?.id??"trigger",i=c=>`{{${o}.${c}}}`,a=String(r.channel??"whatsapp"),u=jh(a),s=`chats-${a}`;return(0,l.jsxs)(z,{title:"Send message",children:[(0,l.jsx)(w,{label:"Channel",children:(0,l.jsx)(ue,{value:a,onChange:c=>t({channel:c}),options:Dh})}),(0,l.jsxs)(w,{label:"Chat id",hint:u.chats.length>0?`Use ${i("chatId")} to reply to the trigger's chat, or pick one of the ${u.chats.length} known chat(s) ${u.source==="local"?"on this node":`from ${u.source}`} (click the field to see the list).`:u.loading?`Loading known chats for "${a}"\u2026`:`Use ${i("chatId")} to reply to the trigger's chat. For a different destination, paste the channel-specific id (no discovered chats for "${a}" yet).`,children:[(0,l.jsx)(I,{mono:!0,value:String(r.chatId??""),onChange:c=>t({chatId:c}),placeholder:i("chatId"),list:u.chats.length>0?s:void 0}),u.chats.length>0&&(0,l.jsx)("datalist",{id:s,children:u.chats.map(c=>(0,l.jsx)("option",{value:c.id,children:c.name?`${c.name} \u2014 ${c.id}${c.kind==="group"?" (group)":""}`:`${c.id}${c.kind==="group"?" (group)":""}`},c.id))})]}),(0,l.jsx)(w,{label:"Text",hint:"Supports {{nodeId.path}} templates from any upstream node",children:(0,l.jsx)(rr,{value:String(r.text??""),onChange:c=>t({text:c}),rows:4,placeholder:`Thanks ${i("sender.name")} \u2014 working on it.`})}),(0,l.jsx)(w,{label:"Account id",hint:"Telegram only: which bot account sends. Leave empty to inherit from the trigger's account (recommended).",children:(0,l.jsx)(I,{mono:!0,value:String(r.accountId??""),onChange:c=>t({accountId:c}),placeholder:`(inherit from ${i("accountId")})`})}),(0,l.jsx)(w,{label:"Reply to message id",hint:"Optional. When set, the platform threads this reply under the referenced message.",children:(0,l.jsx)(I,{mono:!0,value:String(r.replyTo??""),onChange:c=>t({replyTo:c}),placeholder:i("event.id")})}),(0,l.jsx)(w,{label:"Parse mode",hint:r.channel==="telegram"?'Telegram default is "markdown" (Telegram-flavoured HTML conversion). Use "plain" to send raw text without escaping.':"Platform-specific. WhatsApp ignores; Telegram supports markdown/html.",children:(0,l.jsx)(ue,{value:String(r.parseMode??"markdown"),onChange:c=>t({parseMode:c}),options:["markdown","plain","html"]})})]})}function Wh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(z,{title:"Target",children:[(0,l.jsx)(w,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"gitlab"),onChange:r=>t({channel:r}),options:["gitlab","github"]})}),(0,l.jsx)(w,{label:"Project",hint:'GitLab "group/project" or GitHub "owner/repo"',children:(0,l.jsx)(I,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r}),placeholder:"noqta/web"})})]}),(0,l.jsxs)(z,{title:"Issue",children:[(0,l.jsx)(w,{label:"Title",children:(0,l.jsx)(rr,{rows:1,value:String(n.title??""),onChange:r=>t({title:r}),placeholder:"From WhatsApp: {{trigger.sender.name}}"})}),(0,l.jsx)(w,{label:"Description",children:(0,l.jsx)(rr,{rows:6,value:String(n.description??""),onChange:r=>t({description:r}),placeholder:"Reported by {{trigger.sender.name}}\\n\\n{{trigger.text}}"})}),(0,l.jsx)(w,{label:"Labels",children:(0,l.jsx)(bt,{mono:!0,value:Array.isArray(n.labels)?n.labels:[],onChange:r=>t({labels:r}),placeholder:"Triage, source::whatsapp"})}),(0,l.jsx)(w,{label:"Assignees",hint:"GitLab usernames (resolved to ids at runtime)",children:(0,l.jsx)(bt,{mono:!0,value:Array.isArray(n.assignees)?n.assignees:[],onChange:r=>t({assignees:r}),placeholder:"alice, bob"})})]})]})}function Bh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(z,{title:"Target",children:[(0,l.jsx)(w,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"gitlab"),onChange:r=>t({channel:r}),options:["gitlab","github"]})}),(0,l.jsx)(w,{label:"Entity kind",children:(0,l.jsx)(ue,{value:String(n.kind??"issue"),onChange:r=>t({kind:r}),options:["issue","merge_request"]})}),(0,l.jsx)(w,{label:"Project",children:(0,l.jsx)(I,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r}),placeholder:"{{trigger.project}}"})}),(0,l.jsx)(w,{label:"iid",children:(0,l.jsx)(I,{mono:!0,value:String(n.iid??""),onChange:r=>t({iid:r}),placeholder:"{{trigger.issue.iid}}"})})]}),(0,l.jsxs)(z,{title:"Labels",children:[(0,l.jsx)(w,{label:"Add",hint:"Comma-separated list",children:(0,l.jsx)(bt,{value:Array.isArray(n.add)?n.add:[],onChange:r=>t({add:r}),placeholder:"In review"})}),(0,l.jsx)(w,{label:"Remove",children:(0,l.jsx)(bt,{value:Array.isArray(n.remove)?n.remove:[],onChange:r=>t({remove:r}),placeholder:"Triage"})})]})]})}function Hh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"Read labels",children:[(0,l.jsx)(w,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"gitlab"),onChange:r=>t({channel:r}),options:["gitlab","github"]})}),(0,l.jsx)(w,{label:"Entity kind",children:(0,l.jsx)(ue,{value:String(n.kind??"issue"),onChange:r=>t({kind:r}),options:["issue","merge_request"]})}),(0,l.jsx)(w,{label:"Project",children:(0,l.jsx)(I,{mono:!0,value:String(n.project??""),onChange:r=>t({project:r})})}),(0,l.jsx)(w,{label:"iid",children:(0,l.jsx)(I,{mono:!0,value:String(n.iid??""),onChange:r=>t({iid:r})})}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--muted)",marginTop:8},children:["Output bundle: ",(0,l.jsx)("span",{className:"mono",children:"{{ <nodeId>.labels }}"})," = string[]"]})]})}function Gh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"React",children:[(0,l.jsx)(w,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"telegram"),onChange:r=>t({channel:r}),options:["telegram","whatsapp"]})}),(0,l.jsx)(w,{label:"Chat id",children:(0,l.jsx)(I,{mono:!0,value:String(n.chatId??""),onChange:r=>t({chatId:r}),placeholder:"{{trigger.chatId}}"})}),(0,l.jsx)(w,{label:"Message id",children:(0,l.jsx)(I,{mono:!0,value:String(n.messageId??""),onChange:r=>t({messageId:r}),placeholder:"{{trigger.event.id}}"})}),(0,l.jsx)(w,{label:"Emoji",children:(0,l.jsx)(I,{value:String(n.emoji??"\u{1F440}"),onChange:r=>t({emoji:r})})})]})}function $h({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"Edit message",children:[(0,l.jsx)(w,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"telegram"),onChange:r=>t({channel:r}),options:["telegram","whatsapp","gitlab","github","discord","slack"]})}),(0,l.jsx)(w,{label:"Chat id",children:(0,l.jsx)(I,{mono:!0,value:String(n.chatId??""),onChange:r=>t({chatId:r})})}),(0,l.jsx)(w,{label:"Message id",children:(0,l.jsx)(I,{mono:!0,value:String(n.messageId??""),onChange:r=>t({messageId:r})})}),(0,l.jsx)(w,{label:"New text",children:(0,l.jsx)(rr,{value:String(n.text??""),onChange:r=>t({text:r}),rows:3})}),(0,l.jsx)(w,{label:"Parse mode",children:(0,l.jsx)(ue,{value:String(n.parseMode??"plain"),onChange:r=>t({parseMode:r}),options:["plain","markdown","html"]})})]})}function Vh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"Log time",children:[(0,l.jsx)(w,{label:"Channel",children:(0,l.jsx)(ue,{value:String(n.channel??"gitlab"),onChange:r=>t({channel:r}),options:["gitlab"]})}),(0,l.jsx)(w,{label:"Chat id",hint:'"project:issue:42" or "project:merge_request:7"',children:(0,l.jsx)(I,{mono:!0,value:String(n.chatId??""),onChange:r=>t({chatId:r}),placeholder:"{{trigger.chatId}}"})}),(0,l.jsx)(w,{label:"Duration (ms)",children:(0,l.jsx)(wn,{value:n.durationMs,onChange:r=>t({durationMs:r}),placeholder:"900000"})})]})}function Kh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(z,{title:"Request",children:[(0,l.jsx)(w,{label:"URL",children:(0,l.jsx)(I,{mono:!0,value:String(n.url??""),onChange:r=>t({url:r}),placeholder:"https://example.com/webhook"})}),(0,l.jsx)(w,{label:"Method",children:(0,l.jsx)(ue,{value:String(n.method??"POST"),onChange:r=>t({method:r}),options:["GET","POST","PUT","PATCH","DELETE"]})})]}),(0,l.jsx)(z,{title:"Body",defaultOpen:!1,children:(0,l.jsx)(w,{label:"Body",hint:"String \u2014 rendered with {{nodeId.path}}. Server parses as JSON when possible.",children:(0,l.jsx)(rr,{rows:5,value:typeof n.body=="string"?n.body:n.body?JSON.stringify(n.body,null,2):"",onChange:r=>t({body:r})})})}),(0,l.jsx)(z,{title:"Headers",defaultOpen:!1,children:(0,l.jsx)(w,{label:"Headers (JSON object)",children:(0,l.jsx)(St,{mono:!0,rows:3,value:JSON.stringify(n.headers??{},null,2),onChange:r=>{try{t({headers:JSON.parse(r)})}catch{}},placeholder:'{"Authorization": "Bearer {{env.TOKEN}}"}'})})}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--muted)",marginTop:8,padding:"0 10px"},children:["Output: ",(0,l.jsx)("span",{className:"mono",children:"{{ <nodeId>.ok / .status / .body }}"})]})]})}var Qh=["text","long-text","number","boolean","date","select","multi-select","file"];function lp({form:e,patch:t}){let n=e.fields??[],r=(s,c)=>{let d=[...n];d[s]={...d[s],...c},t({...e,fields:d})},o=(s,c)=>{let d=[...n];d[s]={...d[s],validate:{...d[s].validate??{},...c}},t({...e,fields:d})},i=s=>t({...e,fields:n.filter((c,d)=>d!==s)}),a=(s,c)=>{let d=s+c;if(d<0||d>=n.length)return;let g=[...n];[g[s],g[d]]=[g[d],g[s]],t({...e,fields:g})},u=()=>t({...e,fields:[...n,{key:`field_${n.length+1}`,label:"New field",type:"text"}]});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(z,{title:"Form",children:[(0,l.jsx)(w,{label:"Title",hint:"Header shown to the assignee above the form",children:(0,l.jsx)(I,{value:e.title??"",onChange:s=>t({...e,title:s}),placeholder:"Review application"})}),(0,l.jsx)(w,{label:"Description",hint:"Optional one-line context shown under the title",children:(0,l.jsx)(I,{value:e.description??"",onChange:s=>t({...e,description:s}),placeholder:""})}),(0,l.jsx)(w,{label:"Primary button",hint:"Label on the submit button; default: Submit",children:(0,l.jsx)(I,{value:e.submitLabel??"Submit",onChange:s=>t({...e,submitLabel:s})})}),(0,l.jsx)(w,{label:"Secondary action",hint:"Optional reject/hold button. Submissions carry action='secondary'.",children:(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6},children:[(0,l.jsx)(I,{value:e.secondaryAction?.key??"",onChange:s=>t({...e,secondaryAction:s?{key:s,label:e.secondaryAction?.label??s}:void 0}),placeholder:"key (e.g. reject)",mono:!0}),(0,l.jsx)(I,{value:e.secondaryAction?.label??"",onChange:s=>t({...e,secondaryAction:{key:e.secondaryAction?.key??"secondary",label:s}}),placeholder:"label (e.g. Reject)"})]})})]}),(0,l.jsxs)(z,{title:`Fields (${n.length})`,children:[n.length===0&&(0,l.jsx)("div",{className:"hint",style:{fontSize:12,color:"var(--ax-muted)"},children:"No fields \u2014 approve/reject form with no input."}),n.map((s,c)=>(0,l.jsxs)("div",{className:"fld__field-row",style:{border:"1px solid var(--ax-border)",borderRadius:6,padding:8,marginBottom:8},children:[(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr auto",gap:6,alignItems:"end"},children:[(0,l.jsx)(w,{label:"Key",hint:"Stored under values.<key>",children:(0,l.jsx)(I,{mono:!0,value:s.key,onChange:d=>r(c,{key:d})})}),(0,l.jsx)(w,{label:"Label",children:(0,l.jsx)(I,{value:s.label,onChange:d=>r(c,{label:d})})}),(0,l.jsxs)("div",{style:{display:"flex",gap:4},children:[(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:()=>a(c,-1),title:"Move up",children:"\u2191"}),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:()=>a(c,1),title:"Move down",children:"\u2193"}),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:()=>i(c),title:"Remove",children:"\u2715"})]})]}),(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6,marginTop:6},children:[(0,l.jsx)(w,{label:"Type",children:(0,l.jsx)(ue,{value:s.type,onChange:d=>r(c,{type:d}),options:Qh.slice()})}),(0,l.jsx)(w,{label:"",children:(0,l.jsx)(cs,{checked:!!s.required,onChange:d=>r(c,{required:d}),label:"Required"})})]}),(s.type==="select"||s.type==="multi-select")&&(0,l.jsx)(w,{label:"Options",hint:"Comma-separated list of allowed values",children:(0,l.jsx)(bt,{value:s.options??[],onChange:d=>r(c,{options:d}),placeholder:"low, medium, high"})}),(0,l.jsx)(w,{label:"Hint",hint:"Helper text shown under the input",children:(0,l.jsx)(I,{value:s.hint??"",onChange:d=>r(c,{hint:d})})}),(s.type==="text"||s.type==="long-text"||s.type==="number")&&(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:s.type==="number"?"1fr 1fr":"1fr 1fr 1fr",gap:6},children:[(0,l.jsx)(w,{label:"Min",children:(0,l.jsx)(wn,{value:s.validate?.min,onChange:d=>o(c,{min:d})})}),(0,l.jsx)(w,{label:"Max",children:(0,l.jsx)(wn,{value:s.validate?.max,onChange:d=>o(c,{max:d})})}),s.type!=="number"&&(0,l.jsx)(w,{label:"Pattern",hint:"Regex \u2014 optional",children:(0,l.jsx)(I,{mono:!0,value:s.validate?.pattern??"",onChange:d=>o(c,{pattern:d})})})]})]},c)),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:u,style:{marginTop:4},children:"+ Add field"})]})]})}function Jh({node:e,patchData:t}){let n=e.config,r=n.form??{title:"",fields:[],submitLabel:"Submit"};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(z,{title:"Assignment",children:[(0,l.jsx)(w,{label:"Assignee",hint:"actor:<id> or role:<id> \u2014 managed via `agentx actor` / `agentx role`",children:(0,l.jsx)(I,{mono:!0,value:String(n.assignTo??""),onChange:o=>t({assignTo:o}),placeholder:"role:reviewers"})}),(0,l.jsx)(w,{label:"Title",hint:"Shown in the inbox + notification",children:(0,l.jsx)(I,{value:String(n.title??""),onChange:o=>t({title:o})})}),(0,l.jsx)(w,{label:"Description",children:(0,l.jsx)(St,{value:String(n.description??""),onChange:o=>t({description:o}),rows:2})}),(0,l.jsx)(w,{label:"Due in",hint:"ISO-8601 duration (PT2H, P1D) or number of minutes",children:(0,l.jsx)(I,{mono:!0,value:String(n.dueIn??""),onChange:o=>t({dueIn:o}),placeholder:"P2D"})})]}),(0,l.jsx)(lp,{form:r,patch:o=>t({form:o})})]})}function Yh({node:e,patchData:t}){let n=e.config,r=n.form??{title:"",fields:[],submitLabel:"Submit"};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(z,{title:"Start conditions",children:(0,l.jsx)(w,{label:"Startable by",hint:"actor:<id> or role:<id> \u2014 who is allowed to initiate a new run",children:(0,l.jsx)(I,{mono:!0,value:String(n.startableBy??""),onChange:o=>t({startableBy:o}),placeholder:"role:public"})})}),(0,l.jsx)(lp,{form:r,patch:o=>t({form:o})})]})}function Xh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"Sub-process",children:[(0,l.jsx)(w,{label:"Workflow id",hint:"id of another workflow definition \u2014 it runs to completion, then parent resumes",children:(0,l.jsx)(I,{mono:!0,value:String(n.workflowId??""),onChange:r=>t({workflowId:r}),placeholder:"child-workflow-id"})}),(0,l.jsx)(w,{label:"Input map (JSON)",hint:'Object mapping child-context keys to templated values; "*" for full inheritance',children:(0,l.jsx)(St,{mono:!0,rows:4,value:JSON.stringify(n.inputMap??{},null,2),onChange:r=>{try{t({inputMap:JSON.parse(r)})}catch{}}})})]})}function qh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"Emit signal",children:[(0,l.jsx)(w,{label:"Name",hint:"Signal identifier; other workflows' signal.wait nodes subscribe by this",children:(0,l.jsx)(I,{mono:!0,value:String(n.name??""),onChange:r=>t({name:r}),placeholder:"approved"})}),(0,l.jsx)(w,{label:"Scope",hint:"workflow = only same-workflow waiters; global = every waiter",children:(0,l.jsx)(ue,{value:String(n.scope??"workflow"),onChange:r=>t({scope:r}),options:["workflow","global"]})}),(0,l.jsx)(w,{label:"Payload (JSON)",hint:"Templated object delivered with the signal",children:(0,l.jsx)(St,{mono:!0,rows:4,value:JSON.stringify(n.payload??{},null,2),onChange:r=>{try{t({payload:JSON.parse(r)})}catch{}}})})]})}function Zh({node:e,patchData:t}){let n=e.config;return(0,l.jsxs)(z,{title:"Wait for signal",children:[(0,l.jsx)(w,{label:"Name",children:(0,l.jsx)(I,{mono:!0,value:String(n.name??""),onChange:r=>t({name:r}),placeholder:"approved"})}),(0,l.jsx)(w,{label:"Scope",children:(0,l.jsx)(ue,{value:String(n.scope??"workflow"),onChange:r=>t({scope:r}),options:["workflow","global"]})}),(0,l.jsx)(w,{label:"Match filter (JSON)",hint:"Only resume when the emitted payload matches every key here",children:(0,l.jsx)(St,{mono:!0,rows:3,value:JSON.stringify(n.match??{},null,2),onChange:r=>{try{t({match:JSON.parse(r)})}catch{}}})})]})}function em({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(z,{title:"Timer",children:(0,l.jsx)(w,{label:"After",hint:"ISO-8601 duration (PT30M, PT2H, P1D) or minutes as a number",children:(0,l.jsx)(I,{mono:!0,value:String(n.after??""),onChange:r=>t({after:r}),placeholder:"PT1H"})})})}function tm({node:e,patchData:t}){let n=e.config;return(0,l.jsx)(z,{title:"Parallel gateway",children:(0,l.jsx)(w,{label:"Mode",hint:"fanOut = send to all outgoing edges; join = wait for every incoming edge",children:(0,l.jsx)(ue,{value:String(n.mode??"fanOut"),onChange:r=>t({mode:r}),options:["fanOut","join"]})})})}function nm({node:e,patchData:t}){let n=e.config,r=Array.isArray(n.inputs)?n.inputs.map(String):[],o=Array.isArray(n.rules)?n.rules:[],i=c=>t({inputs:c,rules:o.map(d=>({...d,when:(Array.isArray(d.when)?d.when.slice(0,c.length):[]).concat(Array(Math.max(0,c.length-(d.when?.length??0))).fill("*"))}))}),a=(c,d)=>{let g=[...o];g[c]={...g[c],...d},t({rules:g})},u=()=>t({rules:[...o,{when:r.map(()=>"*"),to:"port",output:{}}]}),s=c=>t({rules:o.filter((d,g)=>g!==c)});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(z,{title:"Inputs",children:(0,l.jsx)(w,{label:"Input expressions",hint:"Comma-separated; each is a template evaluated per-run against the run context",children:(0,l.jsx)(bt,{mono:!0,value:r,onChange:i,placeholder:"{{classify.result}}, {{trigger.values.amount}}"})})}),(0,l.jsxs)(z,{title:`Rules (${o.length})`,children:[o.map((c,d)=>(0,l.jsxs)("div",{style:{border:"1px solid var(--ax-border)",borderRadius:6,padding:8,marginBottom:8},children:[(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:6,alignItems:"end"},children:[(0,l.jsx)(w,{label:"Port (to)",hint:"Outgoing edge port taken when this row matches",children:(0,l.jsx)(I,{mono:!0,value:String(c.to??""),onChange:g=>a(d,{to:g})})}),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:()=>s(d),children:"\u2715"})]}),(0,l.jsx)(w,{label:"When (per-input cells)",hint:'One per input. "*" wildcard, "x" equals, ">10" numeric, "!=x", "/regex/"',children:(0,l.jsx)(bt,{mono:!0,value:(Array.isArray(c.when)?c.when:[]).map(String),onChange:g=>a(d,{when:g}),placeholder:"gold, >100"})}),(0,l.jsx)(w,{label:"Output (JSON)",children:(0,l.jsx)(St,{mono:!0,rows:2,value:JSON.stringify(c.output??{},null,2),onChange:g=>{try{a(d,{output:JSON.parse(g)})}catch{}}})})]},d)),(0,l.jsx)("button",{className:"fld__btn",type:"button",onClick:u,children:"+ Add rule"})]}),(0,l.jsx)(z,{title:"Default",children:(0,l.jsx)(w,{label:"Port (to)",children:(0,l.jsx)(I,{mono:!0,value:String(n.default?.to??"fallback"),onChange:c=>t({default:{...n.default??{},to:c}})})})})]})}var rm={"trigger.channel":e=>(0,l.jsx)(Th,{...e}),"trigger.cron":e=>(0,l.jsx)(Mh,{...e}),"trigger.hook":e=>(0,l.jsx)(Fh,{...e}),"trigger.manual":e=>(0,l.jsx)(Rh,{...e}),"trigger.form":e=>(0,l.jsx)(Yh,{...e}),agent:e=>(0,l.jsx)(Ih,{...e}),transform:e=>(0,l.jsx)(Oh,{...e}),branch:e=>(0,l.jsx)(Lh,{...e}),"gateway.parallel":e=>(0,l.jsx)(tm,{...e}),rule:e=>(0,l.jsx)(nm,{...e}),checkpoint:e=>(0,l.jsx)(zh,{...e}),userTask:e=>(0,l.jsx)(Jh,{...e}),subProcess:e=>(0,l.jsx)(Xh,{...e}),"signal.emit":e=>(0,l.jsx)(qh,{...e}),"signal.wait":e=>(0,l.jsx)(Zh,{...e}),"timer.boundary":e=>(0,l.jsx)(em,{...e}),end:e=>(0,l.jsx)(Ah,{...e}),"action.send":e=>(0,l.jsx)(Uh,{...e}),"action.createIssue":e=>(0,l.jsx)(Wh,{...e}),"action.setLabel":e=>(0,l.jsx)(Bh,{...e}),"action.readLabel":e=>(0,l.jsx)(Hh,{...e}),"action.react":e=>(0,l.jsx)(Gh,{...e}),"action.editMessage":e=>(0,l.jsx)($h,{...e}),"action.logTime":e=>(0,l.jsx)(Vh,{...e}),"action.callHTTP":e=>(0,l.jsx)(Kh,{...e})};function sp(e){let{selection:t,nodes:n,edges:r,patch:o,patchData:i,onDelete:a,onDuplicate:u,validation:s,runState:c,agents:d,meta:g,patchMeta:m,onDeleteWorkflow:y,isNew:k}=e;if(!t)return(0,l.jsx)(cm,{meta:g,patchMeta:m,onDeleteWorkflow:y,isNew:k});if(t.kind==="edge"){let B=r.find(f=>f.id===t.id);return B?(0,l.jsx)(dm,{edge:{...B,id:B.id??""},patch:o,onDelete:()=>a(t)}):null}let S=n.find(B=>B.id===t.id);return S?(0,l.jsx)(om,{node:S,nodes:n,edges:r,patch:o,patchData:i,onDelete:()=>a(t),onDuplicate:()=>u(t),validation:s,runOutput:c?.outputs?.[S.id],agents:d}):null}function om({node:e,nodes:t,edges:n,patch:r,patchData:o,onDelete:i,onDuplicate:a,validation:u,runOutput:s,agents:c}){let[d,g]=(0,re.useState)("config"),m=rm[e.type];return(0,l.jsxs)("aside",{className:"insp",children:[(0,l.jsxs)("div",{className:"insp__head",children:[(0,l.jsxs)("div",{className:"insp__top",children:[(0,l.jsx)("span",{className:"insp__type-pill",children:e.type}),(0,l.jsx)("input",{className:"insp__name",value:e.id,onChange:y=>r({id:y.target.value})}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",title:"Duplicate",onClick:a,children:(0,l.jsx)(L.dup,{})}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",title:"Delete",onClick:i,children:(0,l.jsx)(L.trash,{})})]}),(0,l.jsxs)("div",{className:"insp__tabs",children:[(0,l.jsxs)("button",{className:"insp__tab"+(d==="config"?" is-active":""),onClick:()=>g("config"),children:[(0,l.jsx)(L.gear,{})," Config"]}),(0,l.jsxs)("button",{className:"insp__tab"+(d==="advanced"?" is-active":""),onClick:()=>g("advanced"),children:[(0,l.jsx)(L.layout,{})," Advanced"]}),(0,l.jsxs)("button",{className:"insp__tab"+(d==="preview"?" is-active":""),onClick:()=>g("preview"),children:[(0,l.jsx)(L.eye,{})," Preview ",s&&(0,l.jsx)("span",{className:"count",children:"\u25CF"})]})]})]}),(0,l.jsxs)("div",{className:"insp__body",children:[d==="config"&&(0,l.jsxs)(l.Fragment,{children:[m?m({node:e,nodes:t,patch:r,patchData:o,agents:c}):(0,l.jsx)(z,{title:"Config",children:(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)",marginBottom:8},children:["No typed form yet for ",(0,l.jsx)("span",{className:"mono",children:e.type}),". Use the Advanced tab to edit raw JSON."]})}),(0,l.jsx)(am,{node:e,nodes:t,edges:n})]}),d==="advanced"&&(0,l.jsx)(um,{node:e,patchData:o}),d==="preview"&&(0,l.jsx)(z,{title:"Latest run output",children:s?(0,l.jsx)("pre",{style:{fontSize:11,color:"var(--ink-2)",padding:8,background:"var(--bg)",borderRadius:4,border:"1px solid var(--line)"},dangerouslySetInnerHTML:{__html:s}}):(0,l.jsx)("div",{style:{fontSize:12,color:"var(--muted)"},children:"No run data for this node yet."})}),u&&u.length>0&&(0,l.jsx)(z,{title:"Issues",right:(0,l.jsx)("span",{className:"card__kind",style:{color:"var(--err)"},children:u.length}),children:u.map((y,k)=>(0,l.jsxs)("div",{className:"fld__err",style:{padding:"6px 0"},children:[(0,l.jsx)(L.warn,{})," ",y.message]},k))})]})]})}function im(e,t,n){let r=new Map(t.map(u=>[u.id,u])),o=new Set,i=[],a=u=>{if(!o.has(u)){o.add(u);for(let s of n)s.to===u&&a(s.from);if(u!==e){let s=r.get(u);s&&i.push(s)}}};a(e);for(let u of t)u.type.startsWith("trigger.")&&!o.has(u.id)&&u.id!==e&&i.push(u);return i}function am({node:e,nodes:t,edges:n}){let r=(0,re.useMemo)(()=>im(e.id,t,n),[e.id,t,n]);return r.length===0?(0,l.jsx)(z,{title:"Available inputs",defaultOpen:!1,children:(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--muted)"},children:["No upstream nodes yet \u2014 connect a trigger or upstream node to make its outputs available as ",(0,l.jsx)("span",{className:"mono",children:"{{nodeId.path}}"})," templates here."]})}):(0,l.jsx)(z,{title:`Available inputs (${r.length})`,defaultOpen:!1,right:(0,l.jsx)("span",{className:"card__kind",style:{color:"var(--muted)"},children:"click to copy"}),children:(0,l.jsx)("div",{style:{display:"grid",gap:10},children:r.map(o=>(0,l.jsx)(lm,{node:o},o.id))})})}function lm({node:e}){let t=ss[e.type],n=t?ip(e.type,e.config):[];return(0,l.jsxs)("div",{style:{border:"1px solid var(--line)",borderRadius:6,padding:8,background:"var(--bg)"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[(0,l.jsx)("span",{className:"mono",style:{fontSize:11,color:"var(--ink-2)"},children:e.id}),(0,l.jsx)("span",{className:"insp__type-pill",style:{fontSize:10},children:e.type})]}),t?.summary&&(0,l.jsx)("div",{style:{fontSize:11,color:"var(--muted)",marginBottom:6},children:t.summary}),n.length===0?(0,l.jsx)("div",{style:{fontSize:11,color:"var(--muted)"},children:"No declared outputs."}):(0,l.jsx)("div",{style:{display:"grid",gap:2},children:n.map(r=>(0,l.jsx)(sm,{nodeId:e.id,field:r},r.path))})]})}function sm({nodeId:e,field:t}){let[n,r]=(0,re.useState)(!1),o=t.path?`{{${e}.${t.path}}}`:`{{${e}}}`;return(0,l.jsxs)("button",{type:"button",onClick:async()=>{try{await navigator.clipboard.writeText(o),r(!0),window.setTimeout(()=>r(!1),900)}catch{}},title:t.description,style:{textAlign:"left",display:"grid",gridTemplateColumns:"1fr auto",gap:6,padding:"4px 6px",background:n?"var(--ok-soft, rgba(0, 200, 100, 0.12))":"transparent",border:"1px solid transparent",borderRadius:4,cursor:"pointer",color:"var(--ink-1)",fontSize:11,lineHeight:1.35},children:[(0,l.jsx)("span",{className:"mono",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o}),(0,l.jsx)("span",{style:{color:n?"var(--ok, #2ea043)":"var(--muted)",fontSize:10},children:n?"copied":t.type})]})}function um({node:e,patchData:t}){let[n,r]=(0,re.useState)(()=>JSON.stringify(e.config,null,2)),[o,i]=(0,re.useState)(null);return(0,re.useMemo)(()=>{r(JSON.stringify(e.config,null,2)),i(null)},[e.id]),(0,l.jsxs)(z,{title:"Raw config JSON",children:[(0,l.jsx)(St,{mono:!0,rows:14,value:n,onChange:r}),(0,l.jsxs)("div",{style:{display:"flex",gap:8,marginTop:8},children:[(0,l.jsxs)("button",{className:"btn btn--ghost-icon",onClick:()=>{try{let u=JSON.parse(n);u&&typeof u=="object"&&!Array.isArray(u)?(t(u),i(null)):i("config must be a JSON object")}catch(u){i(u.message)}},children:[(0,l.jsx)(L.check,{})," Apply"]}),(0,l.jsxs)("button",{className:"btn btn--ghost-icon",onClick:()=>r(JSON.stringify(e.config,null,2)),children:[(0,l.jsx)(L.undo,{})," Reset"]})]}),o&&(0,l.jsxs)("div",{className:"fld__err",style:{color:"var(--err)",fontSize:11,marginTop:4},children:[(0,l.jsx)(L.err,{})," ",o]})]})}function cm({meta:e,patchMeta:t,onDeleteWorkflow:n,isNew:r}){let o=e.retention??{maxRuns:500,maxDays:90};return(0,l.jsxs)("aside",{className:"insp",children:[(0,l.jsx)("div",{className:"insp__head",children:(0,l.jsxs)("div",{className:"insp__top",children:[(0,l.jsx)("span",{className:"insp__type-pill",children:"workflow"}),(0,l.jsx)("input",{className:"insp__name",value:e.title,placeholder:"Untitled workflow",onChange:i=>t({title:i.target.value})})]})}),(0,l.jsxs)("div",{className:"insp__body",children:[(0,l.jsxs)(z,{title:"Identity",children:[(0,l.jsx)(w,{label:"ID",hint:r?"URL slug \u2014 set once on first save":"URL slug \u2014 read-only after creation",children:(0,l.jsx)(I,{mono:!0,value:e.id,onChange:i=>r&&t({id:i})})}),(0,l.jsx)(w,{label:"Title",children:(0,l.jsx)(I,{value:e.title,onChange:i=>t({title:i})})}),(0,l.jsx)(w,{label:"Description",hint:"Optional one-liner shown on the workflows index",children:(0,l.jsx)(St,{rows:2,value:e.description??"",onChange:i=>t({description:i})})})]}),(0,l.jsxs)(z,{title:"Execution",children:[(0,l.jsx)(w,{label:"Priority",hint:"Higher numbers run before lower ones when multiple workflows match the same trigger",children:(0,l.jsx)(wn,{value:e.priority,onChange:i=>t({priority:i??0}),placeholder:"0"})}),(0,l.jsx)(w,{label:"",children:(0,l.jsx)(cs,{checked:!!e.fanOut,onChange:i=>t({fanOut:i}),label:"Fan out \u2014 let multiple workflows match the same trigger event"})}),(0,l.jsx)(w,{label:"Allowed env vars",hint:"Comma-separated. Only these env names are exposed to actions/agents in this flow.",children:(0,l.jsx)(bt,{mono:!0,value:e.envAllow??[],onChange:i=>t({envAllow:i}),placeholder:"GITLAB_TOKEN, SLACK_WEBHOOK"})})]}),(0,l.jsxs)(z,{title:"Retention",defaultOpen:!1,children:[(0,l.jsx)(w,{label:"Max runs to keep",children:(0,l.jsx)(wn,{value:o.maxRuns,onChange:i=>t({retention:{...o,maxRuns:i??0}}),placeholder:"500"})}),(0,l.jsx)(w,{label:"Max age (days)",children:(0,l.jsx)(wn,{value:o.maxDays,onChange:i=>t({retention:{...o,maxDays:i??0}}),placeholder:"90"})})]}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--muted)",padding:"4px 16px 14px",borderTop:"1px solid var(--line-soft)",marginTop:4},children:["Tip: pick a node or edge on the canvas to edit its config. Each node's output becomes available as"," ",(0,l.jsx)("span",{className:"mono",children:"{{nodeId.path}}"})," to downstream nodes."]}),n&&!r&&(0,l.jsx)("div",{className:"insp__danger",children:(0,l.jsxs)("button",{className:"btn btn--ghost-icon insp__delete-wf",onClick:n,title:"Delete this workflow permanently",children:[(0,l.jsx)(L.trash,{})," Delete workflow"]})})]})]})}function dm({edge:e,patch:t,onDelete:n}){return(0,l.jsxs)("aside",{className:"insp",children:[(0,l.jsx)("div",{className:"insp__head",children:(0,l.jsxs)("div",{className:"insp__top",children:[(0,l.jsx)("span",{className:"insp__type-pill",children:"edge"}),(0,l.jsxs)("div",{className:"insp__name",style:{padding:0,fontSize:13,color:"var(--ink-2)"},children:[(0,l.jsx)("span",{className:"mono",children:e.from}),e.fromPort?(0,l.jsxs)("span",{className:"mono",children:[" :",e.fromPort]}):null," \u2192 ",(0,l.jsx)("span",{className:"mono",children:e.to})]}),(0,l.jsx)("button",{className:"btn btn--ghost-icon",onClick:n,children:(0,l.jsx)(L.trash,{})})]})}),(0,l.jsxs)("div",{className:"insp__body",children:[(0,l.jsx)(z,{title:"Label",children:(0,l.jsx)(w,{label:"Label",hint:"Shown on the edge (cosmetic only)",children:(0,l.jsx)(I,{mono:!0,value:e.label??"",onChange:r=>t({label:r})})})}),(0,l.jsx)(z,{title:"Port",defaultOpen:!1,children:(0,l.jsx)(w,{label:"fromPort",hint:"Set when the source is a branch node. Must match a case's `to` field or the default port.",children:(0,l.jsx)(I,{mono:!0,value:e.fromPort??"",onChange:r=>t({fromPort:r||void 0})})})})]})]})}var or=oe(Ct(),1);var $=oe(be(),1);function up({onLoadTemplate:e}){let[t,n]=(0,or.useState)(""),r=(0,or.useMemo)(()=>{if(!t.trim())return is;let o=t.toLowerCase();return is.map(i=>({...i,items:i.items.filter(a=>a.label.toLowerCase().includes(o)||a.hint.toLowerCase().includes(o)||a.type.includes(o))})).filter(i=>i.items.length>0)},[t]);return(0,$.jsxs)("aside",{className:"pal",children:[(0,$.jsxs)("div",{className:"pal__search",children:[(0,$.jsx)(L.search,{}),(0,$.jsx)("input",{value:t,onChange:o=>n(o.target.value),placeholder:"Search nodes\u2026"}),(0,$.jsx)("kbd",{children:"/"})]}),(0,$.jsxs)("div",{className:"pal__scroll",children:[r.map(o=>(0,$.jsxs)(or.Fragment,{children:[(0,$.jsxs)("div",{className:"pal__section",children:[(0,$.jsx)("span",{children:o.section}),(0,$.jsx)("span",{className:"pal__section-count",children:o.items.length.toString().padStart(2,"0")})]}),o.items.map(i=>(0,$.jsx)(pm,{item:i},i.id))]},o.section)),!t&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:"pal__section",children:[(0,$.jsx)("span",{children:"Templates"}),(0,$.jsx)("span",{className:"pal__section-count",children:ls.length.toString().padStart(2,"0")})]}),ls.map(o=>(0,$.jsxs)("div",{className:"pal__tpl",onClick:()=>e(o),children:[(0,$.jsx)("div",{className:"pal__tpl-dots",children:[0,1,2].map(i=>(0,$.jsx)("span",{className:i<o.dots?"on":""},i))}),(0,$.jsx)("div",{className:"pal__tpl-title",children:o.title}),(0,$.jsx)("div",{className:"pal__tpl-hint",children:o.hint})]},o.id))]})]}),(0,$.jsxs)("div",{className:"pal__foot",children:[(0,$.jsx)(L.lightning,{}),(0,$.jsx)("span",{children:"Drag items onto the canvas"})]})]})}function pm({item:e}){let t=L[e.icon]??L.box;return(0,$.jsxs)("div",{className:"pal__item",draggable:!0,onDragStart:r=>{r.dataTransfer.setData("application/x-wfe-item",JSON.stringify(e)),r.dataTransfer.effectAllowed="copy";let o=document.createElement("div");o.textContent=e.label,o.style.cssText="position:absolute;top:-1000px;padding:6px 10px;background:var(--accent);color:#fff;border-radius:6px;font:500 12px 'Space Grotesk';",document.body.appendChild(o),r.dataTransfer.setDragImage(o,10,10),setTimeout(()=>document.body.removeChild(o),0)},children:[(0,$.jsx)("div",{className:"pal__glyph "+e.glyph,children:(0,$.jsx)(t,{})}),(0,$.jsxs)("div",{className:"pal__meta",children:[(0,$.jsx)("div",{className:"pal__label",children:e.label}),(0,$.jsx)("div",{className:"pal__hint",children:e.hint})]})]})}var ds=oe(Ct(),1);var b=oe(be(),1);function cp(e){return(0,b.jsxs)("div",{className:"tb",children:[(0,b.jsxs)("div",{className:"tb__brand",children:[(0,b.jsx)("div",{className:"tb__mark",children:"\u2726"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"tb__brand-label",children:"Workflow Editor"}),(0,b.jsx)("div",{className:"tb__brand-sub",children:e.workflowIdLabel})]})]}),(0,b.jsxs)("div",{className:"tb__main",children:[(0,b.jsxs)("div",{className:"tb__crumbs",children:[(0,b.jsx)("a",{href:"/workflows",children:"Workflows"}),(0,b.jsx)("span",{className:"sep",children:"/"}),(0,b.jsx)("input",{value:e.title,onChange:t=>e.setTitle(t.target.value)})]}),(0,b.jsx)("span",{className:"tb__sep"}),(0,b.jsxs)("div",{className:"tb__status "+e.status,children:[(0,b.jsx)("span",{className:"dot"}),e.statusLabel??(e.status==="is-dirty"?"unsaved":e.status==="is-running"?"running":e.status==="is-validating"?"validating\u2026":"saved")]}),(0,b.jsx)("div",{className:"tb__spacer"}),(0,b.jsx)("button",{className:"btn btn--ghost-icon"+(e.paletteOpen?" is-active":""),title:e.paletteOpen?"Hide palette":"Show palette",onClick:()=>e.setPaletteOpen(!e.paletteOpen),children:(0,b.jsx)(L.panelLeft,{})}),(0,b.jsx)("button",{className:"btn btn--ghost-icon"+(e.inspectorOpen?" is-active":""),title:e.inspectorOpen?"Hide inspector":"Show inspector",onClick:()=>e.setInspectorOpen(!e.inspectorOpen),children:(0,b.jsx)(L.panelRight,{})}),(0,b.jsx)("span",{className:"tb__sep"}),(0,b.jsx)("button",{className:"btn btn--ghost-icon",title:"Undo (\u2318Z)",onClick:e.onUndo,disabled:!e.canUndo,children:(0,b.jsx)(L.undo,{})}),(0,b.jsx)("button",{className:"btn btn--ghost-icon",title:"Redo (\u2318\u21E7Z)",onClick:e.onRedo,disabled:!e.canRedo,children:(0,b.jsx)(L.redo,{})}),(0,b.jsx)("button",{className:"btn btn--ghost-icon",title:"Auto layout",onClick:e.onLayout,children:(0,b.jsx)(L.layout,{})}),(0,b.jsx)("button",{className:"btn btn--ghost-icon",title:"Keyboard shortcuts",onClick:e.onHelp,children:(0,b.jsx)(L.kbd,{})}),(0,b.jsx)("button",{className:"btn btn--ghost-icon"+(e.tweaksOpen?" is-active":""),title:"Tweaks",onClick:()=>e.setTweaksOpen(!e.tweaksOpen),children:(0,b.jsx)(L.gear,{})}),(0,b.jsx)("button",{className:"btn btn--ghost-icon",title:"Toggle theme",onClick:()=>e.setTheme(e.theme==="dark"?"light":"dark"),children:e.theme==="dark"?(0,b.jsx)(L.sun,{}):(0,b.jsx)(L.moon,{})})]}),(0,b.jsxs)("div",{className:"tb__actions",children:[(0,b.jsxs)("button",{className:"btn btn--outline",onClick:e.onSave,children:[(0,b.jsx)(L.save,{})," Save"]}),(0,b.jsx)("button",{className:"btn btn--primary",onClick:e.onRun,children:e.running?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(L.stop2,{})," Stop"]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(L.run,{})," Run preview"]})})]})]})}function dp({running:e,script:t,cursor:n,onStop:r}){if(!e)return null;let o=t.filter(i=>i.nodeId);return(0,b.jsxs)("div",{className:"run",children:[(0,b.jsxs)("div",{className:"run__head",children:[(0,b.jsx)(L.lightning,{}),(0,b.jsx)("div",{className:"run__title",children:"Live run"}),(0,b.jsxs)("span",{className:"run__chip",children:[(0,b.jsx)("span",{className:"dot"})," streaming"]}),(0,b.jsx)("button",{className:"btn btn--ghost-icon",onClick:r,style:{height:24,width:24},children:(0,b.jsx)(L.x,{})})]}),(0,b.jsx)("div",{className:"run__body",children:o.map((i,a)=>{let u=t.indexOf(i),s=u<n,c=["run__step"];return s&&c.push("is-done"),u===n&&c.push("is-current"),(0,b.jsxs)("div",{className:c.join(" "),children:[(0,b.jsx)("div",{className:"run__marker",children:s?(0,b.jsx)(L.check,{}):a+1}),(0,b.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,b.jsx)("div",{className:"run__step-title",children:i.title}),i.body&&(0,b.jsx)("div",{className:"run__step-body",dangerouslySetInnerHTML:{__html:i.body}})]})]},a)})}),(0,b.jsxs)("div",{className:"run__foot",children:[(0,b.jsxs)("span",{children:[Math.min(n+1,t.length),"/",t.length]}),(0,b.jsxs)("span",{children:[t.length?Math.round((n+1)/t.length*100):0,"%"]})]})]})}var fm=[{h:255,name:"indigo"},{h:220,name:"blue"},{h:180,name:"teal"},{h:145,name:"green"},{h:70,name:"amber"},{h:28,name:"orange"},{h:330,name:"pink"}];function pp(e){return e.open?(0,b.jsxs)("div",{className:"tweaks",children:[(0,b.jsxs)("div",{className:"tweaks__head",children:[(0,b.jsx)("span",{children:"Tweaks"}),(0,b.jsx)("button",{className:"btn btn--ghost-icon",style:{height:22,width:22},onClick:()=>e.setOpen(!1),children:(0,b.jsx)(L.x,{})})]}),(0,b.jsxs)("div",{className:"tweaks__body",children:[(0,b.jsxs)("div",{className:"tweaks__row",children:[(0,b.jsx)("label",{children:"Theme"}),(0,b.jsx)("div",{className:"tweaks__opts",children:["dark","light"].map(t=>(0,b.jsx)("button",{className:e.theme===t?"on":"",onClick:()=>e.setTheme(t),children:t},t))})]}),(0,b.jsxs)("div",{className:"tweaks__row",children:[(0,b.jsx)("label",{children:"Density"}),(0,b.jsx)("div",{className:"tweaks__opts",children:["compact","cozy","roomy"].map(t=>(0,b.jsx)("button",{className:e.density===t?"on":"",onClick:()=>e.setDensity(t),children:t},t))})]}),(0,b.jsxs)("div",{className:"tweaks__row",style:{alignItems:"flex-start",flexDirection:"column",gap:6},children:[(0,b.jsx)("label",{children:"Accent hue"}),(0,b.jsx)("div",{className:"tweaks__hue",children:fm.map(t=>(0,b.jsx)("button",{title:t.name,className:e.hue===t.h?"on":"",style:{background:`oklch(0.70 0.16 ${t.h})`},onClick:()=>e.setHue(t.h)},t.h))})]})]})]}):null}function fp({open:e,onClose:t}){return e?(0,b.jsx)("div",{className:"kbd-overlay",onClick:t,children:(0,b.jsxs)("div",{className:"kbd-card",onClick:r=>r.stopPropagation(),children:[(0,b.jsx)("h3",{children:"Keyboard shortcuts"}),[["Save workflow","\u2318S"],["Undo / Redo","\u2318Z / \u2318\u21E7Z"],["Delete selection","Delete"],["Duplicate node","\u2318D"],["Run preview","\u2318\u23CE"],["Focus search","/"],["Fit view","F"],["Close panels","Esc"]].map(([r,o])=>(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)("span",{children:r}),(0,b.jsx)("span",{children:o.split(" ").map((i,a)=>(0,b.jsxs)(ds.Fragment,{children:[i.includes("/")?i.split("/").map((u,s)=>(0,b.jsxs)(ds.Fragment,{children:[s>0&&" / ",(0,b.jsx)("kbd",{children:u.trim()})]},s)):(0,b.jsx)("kbd",{children:i})," "]},a))})]},r))]})}):null}var Te=oe(Ct(),1),V=oe(be(),1),fs="agentx.editor.chat.v1";function gp({currentWorkflow:e,onApplyWorkflow:t,agentId:n}){let[r,o]=(0,Te.useState)(!1),[i,a]=(0,Te.useState)(()=>vm()),[u,s]=(0,Te.useState)(""),[c,d]=(0,Te.useState)(!1),g=(0,Te.useRef)(null),m=(0,Te.useRef)(null);(0,Te.useEffect)(()=>{let f=i.filter(p=>!p.pending).map(p=>({role:p.role,content:p.content}));try{sessionStorage.setItem(fs,JSON.stringify(f))}catch{}},[i]),(0,Te.useEffect)(()=>{let f=g.current;f&&(f.scrollTop=f.scrollHeight)},[i,r]),(0,Te.useEffect)(()=>{r&&m.current?.focus()},[r]);let y=(0,Te.useCallback)(async()=>{let f=u.trim();if(!f||c)return;let p=i.filter(x=>!x.pending).map(x=>({role:x.role,content:x.content})),h=[...i,{role:"user",content:f},{role:"assistant",content:"\u2026",pending:!0}];a(h),s(""),d(!0);try{let x=await fetch("/api/workflows/editor/chat",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"agentx-board"},body:JSON.stringify({messages:[...p,{role:"user",content:f}],currentWorkflow:e,agentId:n})}),C=await x.json().catch(()=>({}));x.ok?a(M=>ps(M,{role:"assistant",content:C.reply||"",workflow:C.workflow||void 0})):a(M=>ps(M,{role:"assistant",content:"",error:C.error||`HTTP ${x.status}`}))}catch(x){a(C=>ps(C,{role:"assistant",content:"",error:x?.message||"network error"}))}finally{d(!1)}},[n,c,e,u,i]),k=()=>{a([]);try{sessionStorage.removeItem(fs)}catch{}},S=f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),y())},B=(0,Te.useMemo)(()=>["Describe the process you want \u2014 I'll generate the workflow.","","Examples:",'\u2022 "Expense approval: employee submits form, manager approves over $500 otherwise auto-approve"','\u2022 "Telegram bot that classifies messages as billing/bug/other and routes to the right agent"',`\u2022 "Triage a GitLab issue: label 'bug' \u2192 dev agent; label 'feature' \u2192 product agent; otherwise close"`].join(`
1256
+ `),[]);return(0,V.jsxs)(V.Fragment,{children:[!r&&(0,V.jsxs)("button",{className:"ax-chat__pill","aria-label":"Open workflow assistant",onClick:()=>o(!0),children:[(0,V.jsx)("span",{className:"ax-chat__pill-glyph",children:"\u2728"}),(0,V.jsx)("span",{className:"ax-chat__pill-text",children:"Ask AI to build\u2026"})]}),r&&(0,V.jsxs)("div",{className:"ax-chat__panel",role:"dialog","aria-label":"Workflow assistant",children:[(0,V.jsxs)("header",{className:"ax-chat__head",children:[(0,V.jsxs)("div",{className:"ax-chat__title",children:[(0,V.jsx)("span",{className:"ax-chat__dot"})," Workflow assistant"]}),(0,V.jsxs)("div",{className:"ax-chat__head-actions",children:[(0,V.jsx)("button",{className:"ax-chat__iconbtn",onClick:k,title:"Clear conversation",children:"\u232B"}),(0,V.jsx)("button",{className:"ax-chat__iconbtn",onClick:()=>o(!1),title:"Collapse",children:"\u25BC"})]})]}),(0,V.jsxs)("div",{className:"ax-chat__body",ref:g,children:[i.length===0&&(0,V.jsx)("pre",{className:"ax-chat__empty",children:B}),i.map((f,p)=>(0,V.jsx)(gm,{m:f,onApply:t},p))]}),(0,V.jsxs)("footer",{className:"ax-chat__foot",children:[(0,V.jsx)("textarea",{ref:m,className:"ax-chat__input",value:u,onChange:f=>s(f.target.value),onKeyDown:S,placeholder:"Describe the workflow you want\u2026 (Enter to send, Shift+Enter for newline)",rows:2,disabled:c}),(0,V.jsx)("button",{className:"ax-chat__send",onClick:()=>void y(),disabled:c||!u.trim(),children:c?"\u2026":"Send"})]})]}),(0,V.jsx)("style",{children:ym})]})}function gm({m:e,onApply:t}){if(e.error)return(0,V.jsxs)("div",{className:"ax-chat__msg ax-chat__msg--err",children:["\u26A0 ",e.error]});if(e.pending)return(0,V.jsx)("div",{className:"ax-chat__msg ax-chat__msg--assistant ax-chat__msg--pending",children:(0,V.jsxs)("span",{className:"ax-chat__typing",children:[(0,V.jsx)("span",{}),(0,V.jsx)("span",{}),(0,V.jsx)("span",{})]})});let n=e.role==="user"?"ax-chat__msg ax-chat__msg--user":"ax-chat__msg ax-chat__msg--assistant",r=hm(e.content,!!e.workflow),o=e.role==="assistant"?mm(r):Ii(r);return(0,V.jsxs)("div",{className:n,children:[(0,V.jsx)("div",{className:"ax-chat__text",dangerouslySetInnerHTML:{__html:o}}),e.workflow&&(0,V.jsxs)("div",{className:"ax-chat__apply",children:[(0,V.jsx)("button",{className:"ax-chat__applybtn",onClick:()=>t(e.workflow),children:"Apply to canvas"}),(0,V.jsx)("span",{className:"ax-chat__apply-hint",children:"replaces the current workflow"})]})]})}function hm(e,t){return t?e.replace(/```(?:json)?\s*\n[\s\S]*?```/g,"").trim():e}function Ii(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function mm(e){let t=[],n=e.replace(/```([a-zA-Z0-9_-]*)\n([\s\S]*?)```/g,(d,g,m)=>{let y=Ii(m.replace(/\n+$/,"")),k=g?` class="lang-${Ii(g)}"`:"";return t.push(`<pre><code${k}>${y}</code></pre>`),`\0CODE${t.length-1}\0`});n=Ii(n),n=n.replace(/`([^`\n]+)`/g,(d,g)=>`<code>${g}</code>`),n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(d,g,m)=>`<a href="${/^https?:\/\/|^\//.test(m)?m:"#"}" target="_blank" rel="noopener noreferrer">${g}</a>`),n=n.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>"),n=n.replace(/(?<!\*)\*([^*\n]+)\*(?!\*)/g,"<em>$1</em>");let r=n.split(`
1257
+ `),o=[],i=null,a=()=>{i&&(o.push(`</${i}>`),i=null)},u=[],s=()=>{if(!u.length)return;let d=u.join(" ").trim();d&&o.push(`<p>${d}</p>`),u=[]};for(let d of r){let g=d.trimEnd();if(/^\s*$/.test(g)){s(),a();continue}let m=/^(#{1,3})\s+(.+)/.exec(g);if(m){s(),a();let S=m[1].length+2;o.push(`<h${S}>${m[2]}</h${S}>`);continue}let y=/^\s*[-*]\s+(.+)/.exec(g);if(y){s(),i!=="ul"&&(a(),o.push("<ul>"),i="ul"),o.push(`<li>${y[1]}</li>`);continue}let k=/^\s*\d+\.\s+(.+)/.exec(g);if(k){s(),i!=="ol"&&(a(),o.push("<ol>"),i="ol"),o.push(`<li>${k[1]}</li>`);continue}a(),u.push(g)}s(),a();let c=o.join(`
1258
+ `);return c=c.replace(/CODE(\d+)/g,(d,g)=>t[Number(g)]||""),c}function ps(e,t){let n=[...e];for(let r=n.length-1;r>=0;r--)if(n[r].pending||n[r].role==="assistant")return n[r]=t,n;return n.push(t),n}function vm(){try{let e=sessionStorage.getItem(fs);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>n&&(n.role==="user"||n.role==="assistant")&&typeof n.content=="string"):[]}catch{return[]}}var ym=`
1259
+ .ax-chat__pill {
1260
+ position: fixed; bottom: 18px; right: 18px; z-index: 40;
1261
+ display: flex; align-items: center; gap: 8px;
1262
+ background: linear-gradient(135deg, #6b5bff, #8b5cf6); color: white;
1263
+ border: 0; border-radius: 999px; padding: 10px 18px;
1264
+ font: 600 13px/1 system-ui, -apple-system, sans-serif;
1265
+ box-shadow: 0 10px 28px rgba(107,91,255,0.35);
1266
+ cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease;
1267
+ }
1268
+ .ax-chat__pill:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(107,91,255,0.45); }
1269
+ .ax-chat__pill-glyph { font-size: 16px; line-height: 1; }
1270
+
1271
+ .ax-chat__panel {
1272
+ position: fixed; bottom: 18px; right: 18px; z-index: 40;
1273
+ width: 380px; height: 540px; max-height: calc(100vh - 40px);
1274
+ display: flex; flex-direction: column;
1275
+ background: var(--ax-bg, #fff); color: var(--ax-fg, #111);
1276
+ border: 1px solid var(--ax-border, rgba(0,0,0,0.15));
1277
+ border-radius: 12px;
1278
+ box-shadow: 0 20px 50px rgba(0,0,0,0.25);
1279
+ overflow: hidden;
1280
+ }
1281
+ .ax-chat__head {
1282
+ display: flex; align-items: center; justify-content: space-between;
1283
+ padding: 10px 14px;
1284
+ border-bottom: 1px solid var(--ax-border, rgba(0,0,0,0.1));
1285
+ background: linear-gradient(135deg, rgba(107,91,255,0.08), rgba(139,92,246,0.04));
1286
+ }
1287
+ .ax-chat__title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
1288
+ .ax-chat__dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; }
1289
+ .ax-chat__head-actions { display: flex; gap: 4px; }
1290
+ .ax-chat__iconbtn {
1291
+ background: transparent; border: 0; cursor: pointer;
1292
+ padding: 4px 8px; font-size: 14px; color: var(--ax-muted, #666);
1293
+ border-radius: 4px;
1294
+ }
1295
+ .ax-chat__iconbtn:hover { background: rgba(127,127,127,0.15); color: var(--ax-fg); }
1296
+
1297
+ .ax-chat__body {
1298
+ flex: 1; overflow-y: auto; padding: 12px;
1299
+ display: flex; flex-direction: column; gap: 10px;
1300
+ font-size: 13px; line-height: 1.45;
1301
+ }
1302
+ .ax-chat__empty {
1303
+ font-size: 12px; color: var(--ax-muted, #777); white-space: pre-wrap;
1304
+ font-family: inherit; margin: 0;
1305
+ }
1306
+
1307
+ .ax-chat__msg { max-width: 88%; padding: 8px 12px; border-radius: 10px; word-break: break-word; }
1308
+ .ax-chat__msg--user {
1309
+ align-self: flex-end;
1310
+ background: linear-gradient(135deg, #6b5bff, #8b5cf6); color: white;
1311
+ border-bottom-right-radius: 2px;
1312
+ }
1313
+ .ax-chat__msg--assistant {
1314
+ align-self: flex-start;
1315
+ background: rgba(127,127,127,0.12);
1316
+ border-bottom-left-radius: 2px;
1317
+ }
1318
+ .ax-chat__msg--err { align-self: center; background: rgba(192,57,43,0.15); color: #c0392b; font-size: 12px; max-width: 100%; text-align: center; }
1319
+ .ax-chat__msg--pending { min-height: 20px; }
1320
+ .ax-chat__typing { display: inline-flex; gap: 4px; }
1321
+ .ax-chat__typing span {
1322
+ width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5;
1323
+ animation: axchatblink 1s infinite ease-in-out;
1324
+ }
1325
+ .ax-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
1326
+ .ax-chat__typing span:nth-child(3) { animation-delay: 0.3s; }
1327
+ @keyframes axchatblink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
1328
+
1329
+ .ax-chat__text { margin: 0; }
1330
+ .ax-chat__msg--user .ax-chat__text { white-space: pre-wrap; }
1331
+
1332
+ /* Assistant markdown surface ------------------------------------------- */
1333
+ .ax-chat__msg--assistant .ax-chat__text > :first-child { margin-top: 0; }
1334
+ .ax-chat__msg--assistant .ax-chat__text > :last-child { margin-bottom: 0; }
1335
+ .ax-chat__msg--assistant .ax-chat__text p { margin: 6px 0; }
1336
+ .ax-chat__msg--assistant .ax-chat__text h3,
1337
+ .ax-chat__msg--assistant .ax-chat__text h4,
1338
+ .ax-chat__msg--assistant .ax-chat__text h5 {
1339
+ margin: 10px 0 4px; font-weight: 700; font-size: 13px;
1340
+ }
1341
+ .ax-chat__msg--assistant .ax-chat__text ul,
1342
+ .ax-chat__msg--assistant .ax-chat__text ol {
1343
+ margin: 4px 0; padding-left: 20px;
1344
+ }
1345
+ .ax-chat__msg--assistant .ax-chat__text li { margin: 2px 0; }
1346
+ .ax-chat__msg--assistant .ax-chat__text a {
1347
+ color: #6b5bff; text-decoration: underline; word-break: break-all;
1348
+ }
1349
+ .ax-chat__msg--assistant .ax-chat__text code {
1350
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
1351
+ font-size: 11.5px;
1352
+ background: rgba(0,0,0,0.08);
1353
+ padding: 1px 5px; border-radius: 4px;
1354
+ }
1355
+ .ax-chat__msg--assistant .ax-chat__text pre {
1356
+ margin: 6px 0; padding: 8px 10px;
1357
+ background: rgba(0,0,0,0.08);
1358
+ border-radius: 6px;
1359
+ overflow-x: auto; max-width: 100%;
1360
+ }
1361
+ .ax-chat__msg--assistant .ax-chat__text pre code {
1362
+ background: transparent; padding: 0; border-radius: 0;
1363
+ font-size: 11px; line-height: 1.45; white-space: pre;
1364
+ }
1365
+ @media (prefers-color-scheme: dark) {
1366
+ .ax-chat__msg--assistant .ax-chat__text code,
1367
+ .ax-chat__msg--assistant .ax-chat__text pre { background: rgba(255,255,255,0.06); }
1368
+ }
1369
+
1370
+ .ax-chat__apply { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
1371
+ .ax-chat__applybtn {
1372
+ background: #22c55e; color: white; border: 0; border-radius: 6px;
1373
+ padding: 6px 10px; font: 600 12px/1 system-ui; cursor: pointer;
1374
+ }
1375
+ .ax-chat__applybtn:hover { background: #16a34a; }
1376
+ .ax-chat__apply-hint { font-size: 10px; color: var(--ax-muted, #888); }
1377
+
1378
+ .ax-chat__foot {
1379
+ display: flex; gap: 8px; padding: 10px;
1380
+ border-top: 1px solid var(--ax-border, rgba(0,0,0,0.1));
1381
+ }
1382
+ .ax-chat__input {
1383
+ flex: 1; resize: none;
1384
+ font: inherit; padding: 8px 10px;
1385
+ border: 1px solid var(--ax-border, rgba(0,0,0,0.15));
1386
+ border-radius: 8px; background: var(--ax-bg); color: var(--ax-fg);
1387
+ }
1388
+ .ax-chat__input:focus { outline: 2px solid #8b5cf6; outline-offset: -1px; }
1389
+ .ax-chat__send {
1390
+ background: #6b5bff; color: white; border: 0; border-radius: 8px;
1391
+ padding: 0 14px; font: 600 12px/1 system-ui; cursor: pointer;
1392
+ }
1393
+ .ax-chat__send:disabled { opacity: 0.4; cursor: not-allowed; }
1394
+ .ax-chat__send:hover:not(:disabled) { background: #5b4bf0; }
1395
+
1396
+ @media (prefers-color-scheme: dark) {
1397
+ .ax-chat__panel { background: #1a1a1a; color: #eee; border-color: rgba(255,255,255,0.1); }
1398
+ .ax-chat__head { background: linear-gradient(135deg, rgba(107,91,255,0.15), rgba(139,92,246,0.08)); }
1399
+ .ax-chat__input { background: #2a2a2a; color: #eee; border-color: rgba(255,255,255,0.15); }
1400
+ }
1401
+ `;function oo(e,t){let n=t?.nodes??{},r=e.nodes.map(i=>({...i,position:i.position??n[i.id]??void 0})),o=e.edges.map((i,a)=>({...i,id:xm(i,a)}));return{meta:{id:e.id,version:2,title:e.title,description:e.description,priority:e.priority,fanOut:e.fanOut,envAllow:e.envAllow,retention:e.retention,mesh:e.mesh},nodes:r,edges:o}}function gs(e){let t={id:e.meta.id,version:2,title:e.meta.title,description:e.meta.description,priority:e.meta.priority,fanOut:e.meta.fanOut,nodes:e.nodes.map(r=>({id:r.id,type:r.type,config:r.config??{},position:r.position})),edges:e.edges.map(r=>{let{id:o,...i}=r;return i}),envAllow:e.meta.envAllow,retention:e.meta.retention,mesh:e.meta.mesh??{allowRemote:!1}},n={version:1,nodes:Object.fromEntries(e.nodes.filter(r=>r.position).map(r=>[r.id,{x:r.position.x,y:r.position.y}]))};return{workflow:t,layout:n}}function io(e){return{meta:{id:/^[a-z0-9][a-z0-9_-]*$/.test(e)?e:"new-workflow",version:2,title:"New workflow",priority:0,fanOut:!1,envAllow:[],retention:{maxRuns:500,maxDays:90},mesh:{allowRemote:!1}},nodes:[{id:"trigger",type:"trigger.manual",config:{},position:{x:40,y:80}},{id:"end",type:"end",config:{status:"completed"},position:{x:400,y:80}}],edges:[{id:"e-trigger-end",from:"trigger",to:"end"}]}}function xm(e,t){let n=o=>o.replace(/[^a-zA-Z0-9._-]/g,"_");return`e-${[n(e.from),e.fromPort?n(e.fromPort):"out",n(e.to),String(t)].join("-")}`}var hs="__trigger__";function wm(){try{return localStorage.getItem("ax_token")||""}catch{return""}}function kn(){let e={"Content-Type":"application/json","X-Requested-With":"agentx-board"},t=wm();return t&&(e.Authorization="Bearer "+t),e}async function hp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e),{headers:kn()});if(!t.ok)throw new Error("fetch workflow "+e+": "+t.status);return(await t.json()).workflow}async function mp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e)+"/layout",{headers:kn()});return t.ok?(await t.json()).layout:null}async function vp(e){let t=await fetch("/api/workflows/"+encodeURIComponent(e.id)+"/validate",{method:"POST",headers:kn(),body:JSON.stringify(e)});return t.ok?await t.json():{ok:!1,issues:[{path:"",message:"HTTP "+t.status}]}}async function yp(e,t){let n=t.create?"/api/workflows":"/api/workflows/"+encodeURIComponent(e.id),r=t.create?"POST":"PUT",o=await fetch(n,{method:r,headers:kn(),body:JSON.stringify(e)});if(o.ok)return{ok:!0};let i=await o.json().catch(()=>({}));return{ok:!1,issues:i.issues||[{path:"",message:i.error||"HTTP "+o.status}]}}async function xp(e,t){await fetch("/api/workflows/"+encodeURIComponent(e)+"/layout",{method:"PUT",headers:kn(),body:JSON.stringify(t)})}async function wp(e){return(await fetch("/api/workflows/"+encodeURIComponent(e),{method:"DELETE",headers:kn()})).ok}async function kp(){try{let e=await fetch("/api/agents",{headers:kn()});if(!e.ok)return[];let t=await e.json();if(Array.isArray(t))return t.map(n=>typeof n=="string"?{id:n,name:n}:n&&typeof n=="object"&&"id"in n?{id:String(n.id),name:String(n.name??n.id)}:null).filter(n=>n!==null);if(t&&typeof t=="object"&&"agents"in t){let n=t.agents;if(Array.isArray(n))return n.map(r=>({id:String(r.id??r),name:String(r.name??r.id??r)}))}return[]}catch{return[]}}var Xe=oe(be(),1);function km(e,t){switch(t.type){case"hydrate":return{meta:t.graph.meta,nodes:t.graph.nodes,edges:t.graph.edges,selection:null,isNew:t.isNew};case"setTitle":return{...e,meta:{...e.meta,title:t.title}};case"patchMeta":return{...e,meta:{...e.meta,...t.patch}};case"select":return{...e,selection:t.selection};case"moveNode":return{...e,nodes:e.nodes.map(n=>n.id===t.id?{...n,position:{x:t.x,y:t.y}}:n)};case"patchNode":return{...e,nodes:e.nodes.map(n=>n.id===t.id?{...n,...t.patch}:n)};case"patchNodeData":return{...e,nodes:e.nodes.map(n=>n.id===t.id?{...n,config:{...n.config,...t.patch}}:n)};case"patchEdge":return{...e,edges:e.edges.map(n=>n.id===t.id?{...n,...t.patch}:n)};case"addNode":{let n="n-"+Math.random().toString(36).slice(2,8),r={id:n,type:t.item.type,position:{x:t.x,y:t.y},config:_m(t.item)};return{...e,nodes:[...e.nodes,r],selection:{kind:"node",id:n}}}case"connect":{if(t.conn.from===t.conn.to)return e;let n="e-"+Math.random().toString(36).slice(2,8),r=e.nodes.find(a=>a.id===t.conn.from),o=t.conn.fromPort==="true"||t.conn.fromPort==="false"?t.conn.fromPort:"",i={id:n,from:t.conn.from,fromPort:t.conn.fromPort,to:t.conn.to,toPort:"in",label:o||(r?.type?.startsWith("trigger.")?"start":"")};return e.edges.some(a=>a.from===i.from&&a.fromPort===i.fromPort&&a.to===i.to)?e:{...e,edges:[...e.edges,i]}}case"delete":{let n=t.selection??e.selection;return n?n.kind==="node"?n.id===hs?e:{...e,nodes:e.nodes.filter(r=>r.id!==n.id),edges:e.edges.filter(r=>r.from!==n.id&&r.to!==n.id),selection:null}:n.kind==="edge"?{...e,edges:e.edges.filter(r=>r.id!==n.id),selection:null}:e:e}case"duplicate":{let n=t.selection??e.selection;if(!n||n.kind!=="node")return e;let r=e.nodes.find(u=>u.id===n.id);if(!r||r.id===hs)return e;let o="n-"+Math.random().toString(36).slice(2,8),i=r.position??{x:0,y:0},a={...r,id:o,position:{x:i.x+40,y:i.y+40}};return{...e,nodes:[...e.nodes,a],selection:{kind:"node",id:o}}}case"layout":{let n=bm(e.nodes,e.edges);return{...e,nodes:e.nodes.map(r=>({...r,...n[r.id]??{}}))}}case"setAll":return t.state}}function _m(e){switch(e.type){case"trigger.channel":return{source:e.id.endsWith("whatsapp")?"whatsapp-message":e.id.endsWith("telegram")?"telegram-message":e.id.endsWith("gitlab")?"gitlab-issue":"whatsapp-message",filter:{chat:"*"}};case"trigger.cron":return{spec:"0 * * * *"};case"trigger.manual":return{};case"trigger.hook":return{event:"on:hook"};case"trigger.form":return{form:{title:"New request",fields:[],submitLabel:"Submit"}};case"agent":return{agentId:"",prompt:"",resultParser:"noqta-result-token"};case"transform":return{expr:""};case"branch":return{cases:[{when:{kind:"equals",params:{path:"",value:""}},to:"case1"}],default:"fallback"};case"gateway.parallel":return{mode:"fanOut"};case"rule":return{inputs:[""],rules:[{when:["*"],to:"match",output:{}}],default:{to:"fallback",output:{}}};case"checkpoint":return{name:"wait",waitFor:{source:"manual"},resumeMatch:{}};case"userTask":return{assignTo:"role:reviewers",title:"",form:{title:"Review",fields:[],submitLabel:"Approve",secondaryAction:{key:"reject",label:"Reject"}}};case"subProcess":return{workflowId:"",inputMap:{},awaitCompletion:!0};case"signal.emit":return{name:"",scope:"workflow",payload:{}};case"signal.wait":return{name:"",scope:"workflow",match:{}};case"timer.boundary":return{after:"PT1H"};case"action.send":return{channel:"gitlab",chatId:"",text:""};case"action.createIssue":return{channel:"gitlab",project:"",title:"",description:"",labels:[]};case"action.setLabel":return{channel:"gitlab",add:[],remove:[]};case"action.readLabel":return{channel:"gitlab"};case"action.react":return{channel:"gitlab",emoji:"\u{1F440}"};case"action.editMessage":return{channel:"gitlab",messageId:"",text:""};case"action.logTime":return{channel:"gitlab"};case"action.callHTTP":return{url:"",method:"POST"};case"end":return{status:"completed"}}return{}}function bm(e,t){let n=Object.fromEntries(e.map(s=>[s.id,s])),r={};e.forEach(s=>{r[s.id]=0}),t.forEach(s=>{n[s.to]&&(r[s.to]=(r[s.to]??0)+1)});let o={},i=(s,c)=>{o[s]=Math.max(o[s]??0,c),t.filter(d=>d.from===s).forEach(d=>i(d.to,c+1))};e.filter(s=>(r[s.id]??0)===0).forEach(s=>i(s.id,0));let a={};Object.entries(o).forEach(([s,c])=>{(a[c]??(a[c]=[])).push(s)});let u={};return Object.entries(a).forEach(([s,c])=>{c.forEach((d,g)=>{u[d]={x:80+Number(s)*280,y:120+g*170}})}),u}function Sm(e){let[t,n]=(0,O.useReducer)(km,e),r=(0,O.useRef)([]),o=(0,O.useRef)([]),i=(0,O.useRef)(t);(0,O.useEffect)(()=>{i.current=t},[t]);let a=(0,O.useCallback)(d=>{d.type==="select"||d.type==="moveNode"||(r.current.push(i.current),r.current.length>50&&r.current.shift(),o.current=[]),n(d)},[]),u=(0,O.useCallback)(()=>{let d=r.current.pop();d&&(o.current.push(i.current),n({type:"setAll",state:d}))},[]),s=(0,O.useCallback)(()=>{let d=o.current.pop();d&&(r.current.push(i.current),n({type:"setAll",state:d}))},[]),c=(0,O.useCallback)(d=>{r.current=[],o.current=[],n({type:"setAll",state:d})},[]);return{state:t,dispatch:a,undo:u,redo:s,forceReset:c,canUndo:r.current.length>0,canRedo:o.current.length>0}}function Nm(e){let t={},n=(r,o)=>{(t[r]??(t[r]=[])).push({message:o})};for(let r of e.nodes){let o=r.config;r.type==="agent"&&!o.agentId&&n(r.id,"Agent node has no agentId selected."),r.type==="branch"&&(!Array.isArray(o.cases)||o.cases.length===0)&&n(r.id,"Branch has no cases \u2014 add at least one.");let i=r.type==="end",a=r.type.startsWith("trigger.");!i&&!a&&!e.edges.some(u=>u.from===r.id)&&n(r.id,"No outgoing connection \u2014 the flow dead-ends here.")}return t}function Cm(e){let t=[],n=Object.fromEntries(e.nodes.map(a=>[a.id,a])),r=new Set,o=a=>{if(r.has(a))return;r.add(a);let u=n[a];if(!u)return;let s=u.config;t.push({nodeId:u.id,edgeId:null,title:`${u.id}${s.agentId?` \u2192 ${String(s.agentId)}`:""}`,body:s.prompt?`<span class="mono">${String(s.prompt).slice(0,200)}</span>`:null});let c=e.edges.filter(d=>d.from===a);for(let d of c){let g=d.id??"";t.push({nodeId:null,edgeId:g,title:null,body:null}),o(d.to)}},i=e.nodes.find(a=>a.type.startsWith("trigger."))?.id;return i&&o(i),t}function _p(){let{state:e,dispatch:t,undo:n,redo:r,forceReset:o,canUndo:i,canRedo:a}=Sm({meta:{id:"loading",version:2,title:"Loading\u2026",priority:0,fanOut:!1,envAllow:[],retention:{maxRuns:500,maxDays:90}},nodes:[],edges:[],selection:null,isNew:!0}),{meta:u,nodes:s,edges:c,selection:d,isNew:g}=e,m=(0,O.useRef)(e);(0,O.useEffect)(()=>{m.current=e},[e]);let[y,k]=(0,O.useState)(()=>localStorage.getItem("wfe.theme")??"dark"),[S,B]=(0,O.useState)(()=>localStorage.getItem("wfe.density")??"cozy"),[f,p]=(0,O.useState)(()=>Number(localStorage.getItem("wfe.hue")??255)),[h,x]=(0,O.useState)(()=>localStorage.getItem("wfe.paletteOpen")!=="0"),[C,M]=(0,O.useState)(()=>localStorage.getItem("wfe.inspectorOpen")!=="0"),[F,P]=(0,O.useState)({zoom:.75,tx:40,ty:60});(0,O.useEffect)(()=>{document.documentElement.dataset.theme=y,localStorage.setItem("wfe.theme",y)},[y]),(0,O.useEffect)(()=>{localStorage.setItem("wfe.density",S)},[S]),(0,O.useEffect)(()=>{document.documentElement.style.setProperty("--accent-hue",String(f)),localStorage.setItem("wfe.hue",String(f))},[f]),(0,O.useEffect)(()=>{localStorage.setItem("wfe.paletteOpen",h?"1":"0")},[h]),(0,O.useEffect)(()=>{localStorage.setItem("wfe.inspectorOpen",C?"1":"0")},[C]);let K=R=>k(R),[W,ve]=(0,O.useState)(!1),[ir,_n]=(0,O.useState)(!1),[ar,ao]=(0,O.useState)(null),[lr,ht]=(0,O.useState)("is-saved"),mt=(R,A="ok")=>{ao({msg:R,kind:A}),setTimeout(()=>ao(null),2e3)},[Li,zi]=(0,O.useState)(op);(0,O.useEffect)(()=>{(async()=>{let R=await kp();if(!R.length)return;let A=R.map((ce,xe)=>({id:ce.id,name:ce.name||ce.id,tags:[],color:xe*37%360}));zi(A)})()},[]),(0,O.useEffect)(()=>{let R=new URLSearchParams(location.search),A=R.get("new")==="1",ce=R.get("id")||"new-workflow";if(A){o(Oi(io(ce),!0));return}(async()=>{try{let[xe,He]=await Promise.all([hp(ce),mp(ce)]),Me=oo(xe,He);o(Oi(Me,!1))}catch(xe){mt(`Failed to load "${ce}": ${xe.message}`,"err"),o(Oi(io(ce),!0))}})()},[]),(0,O.useEffect)(()=>{u.id!=="loading"&&ht("is-dirty")},[s,c,u]);let sr=(0,O.useCallback)(async()=>{let R=m.current,{workflow:A,layout:ce}=gs({meta:R.meta,nodes:R.nodes,edges:R.edges});ht("is-validating");let xe=await vp(A);if(!xe.ok){ht("is-dirty"),mt(`${xe.issues.length} validation issue${xe.issues.length===1?"":"s"}`,"err");return}let He=await yp(A,{create:R.isNew});if(!He.ok){ht("is-dirty"),mt(He.issues?.[0]?.message??"Save failed","err");return}try{await xp(A.id,ce)}catch{}if(ht("is-saved"),mt("Saved","ok"),R.isNew){t({type:"patchMeta",patch:{}});let Me=new URL(location.href);Me.searchParams.delete("new"),Me.searchParams.set("id",A.id),history.replaceState(null,"",Me.toString()),o({...R,isNew:!1})}},[t,o]),bn=(0,O.useCallback)(R=>t({type:"delete",selection:R}),[t]),ur=(0,O.useCallback)(R=>t({type:"duplicate",selection:R}),[t]),Ai=(0,O.useCallback)((R,A,ce)=>t({type:"addNode",item:R,x:A,y:ce}),[t]),Di=(0,O.useCallback)(R=>t({type:"connect",conn:R}),[t]),ji=(0,O.useCallback)((R,A,ce)=>t({type:"moveNode",id:R,x:A,y:ce}),[t]),E=(0,O.useCallback)(R=>t({type:"select",selection:R,commit:!0}),[t]),j=R=>{d&&(d.kind==="node"&&t({type:"patchNode",id:d.id,patch:R}),d.kind==="edge"&&t({type:"patchEdge",id:d.id,patch:R}))},U=R=>{!d||d.kind!=="node"||t({type:"patchNodeData",id:d.id,patch:R})},Q=async R=>{if(!confirm(`Replace the current workflow with the "${R.title}" template? (Undoable)`))return;let A=await Em(R.id,u.id);o(Oi(A,g)),mt(`Loaded ${R.title}`,"ok")},[q,Be]=(0,O.useState)(!1),[Z,qe]=(0,O.useState)(-1),Le=(0,O.useMemo)(()=>Cm(e),[e]),ye=(0,O.useRef)(null),at=()=>{ye.current&&window.clearInterval(ye.current),Be(!1),ht("is-saved")},cr=()=>{Be(!0),qe(0),ht("is-running"),ye.current&&window.clearInterval(ye.current),ye.current=window.setInterval(()=>{qe(R=>R>=Le.length-1?(ye.current&&window.clearInterval(ye.current),Be(!1),ht("is-saved"),R):R+1)},900)};(0,O.useEffect)(()=>()=>{ye.current&&window.clearInterval(ye.current)},[]);let dr=(0,O.useMemo)(()=>{if(!q&&Z<0)return null;let R=new Set,A=new Set,ce=null,xe=null;for(let Me=0;Me<=Z;Me++){let Ge=Le[Me];Ge&&(Ge.nodeId&&(Me===Z?ce=Ge.nodeId:R.add(Ge.nodeId)),Ge.edgeId&&(Me===Z?xe=Ge.edgeId:A.add(Ge.edgeId)))}let He={};for(let Me=0;Me<=Z;Me++){let Ge=Le[Me];!Ge||!Ge.nodeId||!Ge.body||(He[Ge.nodeId]=Ge.body)}return{visitedNodes:R,visitedEdges:A,currentNodeId:ce,currentEdgeId:xe,outputs:He}},[q,Z,Le]),lo=(0,O.useMemo)(()=>Nm(e),[e]),Cp=d?.kind==="node"?lo[d.id]:void 0;(0,O.useEffect)(()=>{let R=A=>{let ce=document.activeElement,xe=!!ce&&/^(INPUT|TEXTAREA|SELECT)$/.test(ce.tagName);A.key==="?"&&!xe&&_n(!0),A.key==="Escape"&&(_n(!1),ve(!1));let He=A.metaKey||A.ctrlKey;He&&A.key.toLowerCase()==="z"&&!A.shiftKey?(A.preventDefault(),n()):He&&(A.key.toLowerCase()==="y"||A.shiftKey&&A.key.toLowerCase()==="z")?(A.preventDefault(),r()):He&&A.key.toLowerCase()==="s"?(A.preventDefault(),sr()):He&&A.key==="Enter"?(A.preventDefault(),q?at():cr()):He&&A.key.toLowerCase()==="d"&&!xe&&d?(A.preventDefault(),ur(d)):(A.key==="Delete"||A.key==="Backspace")&&!xe&&d?bn(d):A.key==="/"&&!xe&&(A.preventDefault(),document.querySelector(".pal__search input")?.focus())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[d,q,n,r,sr,bn,ur]),(0,O.useEffect)(()=>{let R=A=>{lr==="is-dirty"&&(A.preventDefault(),A.returnValue="")};return window.addEventListener("beforeunload",R),()=>window.removeEventListener("beforeunload",R)},[lr]);let Ep=async()=>{if(g||!confirm(`Delete workflow "${u.id}"? This cannot be undone.`))return;await wp(u.id)?(mt("Deleted","ok"),setTimeout(()=>{location.href="/workflows"},500)):mt("Delete failed","err")};return(0,Xe.jsxs)("div",{className:"app","data-density":S,"data-palette":h?"open":"closed","data-inspector":C?"open":"closed",children:[(0,Xe.jsx)(cp,{title:u.title,setTitle:R=>t({type:"setTitle",title:R}),status:lr,theme:y,setTheme:K,canUndo:i,canRedo:a,onUndo:n,onRedo:r,onSave:()=>void sr(),onRun:()=>q?at():cr(),running:q,tweaksOpen:W,setTweaksOpen:ve,onHelp:()=>_n(!0),onLayout:()=>t({type:"layout"}),workflowIdLabel:`/workflows/${u.id}`,paletteOpen:h,setPaletteOpen:x,inspectorOpen:C,setInspectorOpen:M}),h&&(0,Xe.jsx)(up,{onLoadTemplate:Q}),(0,Xe.jsx)(rp,{nodes:s,edges:c,selection:d,setSelection:E,onNodeMove:ji,onAddNode:Ai,onConnect:Di,onDelete:bn,runState:dr,viewBox:F,setViewBox:P}),C&&(0,Xe.jsx)(sp,{selection:d,nodes:s,edges:c,patch:j,patchData:U,onDelete:bn,onDuplicate:ur,validation:Cp,runState:dr,agents:Li,meta:u,patchMeta:R=>t({type:"patchMeta",patch:R}),onDeleteWorkflow:Ep,isNew:g}),(0,Xe.jsx)(dp,{running:q||Z>=0,script:Le,cursor:Z,onStop:()=>{at(),qe(-1)}}),(0,Xe.jsx)(pp,{open:W,setOpen:ve,theme:y,setTheme:K,density:S,setDensity:B,hue:f,setHue:p}),(0,Xe.jsx)(fp,{open:ir,onClose:()=>_n(!1)}),(0,Xe.jsx)(gp,{currentWorkflow:gs({meta:u,nodes:s,edges:c}).workflow,onApplyWorkflow:R=>{let A=oo(R);t({type:"setAll",state:{meta:A.meta,nodes:A.nodes,edges:A.edges,selection:null,isNew:!1}}),mt("Applied workflow from chat","ok")}}),ar&&(0,Xe.jsxs)("div",{className:"toast"+(ar.kind==="err"?" err":""),children:[(0,Xe.jsx)("span",{className:"dot"}),ar.msg]})]})}function Oi(e,t){return{meta:e.meta,nodes:e.nodes,edges:e.edges,selection:null,isNew:t}}async function Em(e,t){return e==="tpl.blank"?io(t||"new-workflow"):e==="tpl.whatsapp"?oo(Pm(t)):e==="tpl.mr"?oo(Tm(t)):io(t||"new-workflow")}function Pm(e){return{id:e||"whatsapp-client-support",version:2,title:"WhatsApp client support triage",priority:10,fanOut:!1,envAllow:["GITLAB_TOKEN"],nodes:[{id:"trigger",type:"trigger.channel",config:{source:"whatsapp-message",filter:{chat:"*"}}},{id:"classify",type:"agent",config:{agentId:"intent-classifier",prompt:"Classify this message from {{trigger.sender.name}}:\n{{trigger.text}}\nReply with `RESULT: status-check`, `RESULT: new-request`, or `RESULT: other`."}},{id:"route",type:"branch",config:{cases:[{when:{kind:"equals",params:{path:"classify.result",value:"status-check"}},to:"status"},{when:{kind:"equals",params:{path:"classify.result",value:"new-request"}},to:"new"}],default:"fallback"}},{id:"lookup_ticket",type:"agent",config:{agentId:"gitlab-ticket-lookup",prompt:"Find related issues for {{trigger.sender.name}}. Summarise."}},{id:"reply_status",type:"action.send",config:{channel:"whatsapp",chatId:"{{trigger.chatId}}",text:"{{lookup_ticket.reply}}"}},{id:"create_issue",type:"action.createIssue",config:{channel:"gitlab",project:"noqta/web",title:"WhatsApp: {{trigger.sender.name}}",description:`From: {{trigger.sender.name}} ({{trigger.fromJid}})
1402
+
1403
+ {{trigger.text}}`,labels:["source::whatsapp","Triage"]}},{id:"confirm_new",type:"action.send",config:{channel:"whatsapp",chatId:"{{trigger.chatId}}",text:"Thanks \u2014 ticket {{create_issue.issue.webUrl}} opened."}},{id:"fallback",type:"action.send",config:{channel:"whatsapp",chatId:"{{trigger.chatId}}",text:"Got it \u2014 a human will reply shortly."}},{id:"done",type:"end",config:{status:"completed"}}],edges:[{from:"trigger",to:"classify"},{from:"classify",to:"route"},{from:"route",fromPort:"status",to:"lookup_ticket"},{from:"route",fromPort:"new",to:"create_issue"},{from:"route",fromPort:"fallback",to:"fallback"},{from:"lookup_ticket",to:"reply_status"},{from:"create_issue",to:"confirm_new"},{from:"reply_status",to:"done"},{from:"confirm_new",to:"done"},{from:"fallback",to:"done"}],retention:{maxRuns:500,maxDays:90}}}function Tm(e){return{id:e||"mr-review",version:2,title:"MR review loop",priority:5,fanOut:!1,envAllow:["GITLAB_TOKEN"],nodes:[{id:"trigger",type:"trigger.channel",config:{source:"gitlab-pipeline",filter:{project:"noqta/web"}}},{id:"review",type:"agent",config:{agentId:"code-reviewer",prompt:"Review MR #{{trigger.pipeline.id}}. Reply `RESULT: approved` or `RESULT: changes-requested`."}},{id:"route",type:"branch",config:{cases:[{when:{kind:"equals",params:{path:"review.result",value:"approved"}},to:"approved"},{when:{kind:"equals",params:{path:"review.result",value:"changes-requested"}},to:"rejected"}],default:"done"}},{id:"approved",type:"action.send",config:{channel:"gitlab",chatId:"{{trigger.chatId}}",text:"\u2705 Approved by reviewer"}},{id:"rejected",type:"action.send",config:{channel:"gitlab",chatId:"{{trigger.chatId}}",text:"\u274C Changes requested"}},{id:"done",type:"end",config:{status:"completed"}}],edges:[{from:"trigger",to:"review"},{from:"review",to:"route"},{from:"route",fromPort:"approved",to:"approved"},{from:"route",fromPort:"rejected",to:"rejected"},{from:"route",fromPort:"done",to:"done"},{from:"approved",to:"done"},{from:"rejected",to:"done"}],retention:{maxRuns:500,maxDays:90}}}var Np=oe(be(),1);function Mm(e,t){if(document.getElementById(e))return;let n=document.createElement("style");n.id=e,n.textContent=t,document.head.appendChild(n)}function bp(){Mm("wfe-redesign-css",vs);let e=document.getElementById("wfe-root");if(!e){console.error("[wfe] #wfe-root missing \u2014 editor cannot mount");return}(0,Sp.createRoot)(e).render((0,Np.jsx)(_p,{}))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",bp):bp();})();
1404
+ /*! Bundled license information:
1405
+
1406
+ react/cjs/react.production.min.js:
1407
+ (**
1408
+ * @license React
1409
+ * react.production.min.js
1410
+ *
1411
+ * Copyright (c) Facebook, Inc. and its affiliates.
1412
+ *
1413
+ * This source code is licensed under the MIT license found in the
1414
+ * LICENSE file in the root directory of this source tree.
1415
+ *)
1416
+
1417
+ scheduler/cjs/scheduler.production.min.js:
1418
+ (**
1419
+ * @license React
1420
+ * scheduler.production.min.js
1421
+ *
1422
+ * Copyright (c) Facebook, Inc. and its affiliates.
1423
+ *
1424
+ * This source code is licensed under the MIT license found in the
1425
+ * LICENSE file in the root directory of this source tree.
1426
+ *)
1427
+
1428
+ react-dom/cjs/react-dom.production.min.js:
1429
+ (**
1430
+ * @license React
1431
+ * react-dom.production.min.js
1432
+ *
1433
+ * Copyright (c) Facebook, Inc. and its affiliates.
1434
+ *
1435
+ * This source code is licensed under the MIT license found in the
1436
+ * LICENSE file in the root directory of this source tree.
1437
+ *)
1438
+
1439
+ react/cjs/react-jsx-runtime.production.min.js:
1440
+ (**
1441
+ * @license React
1442
+ * react-jsx-runtime.production.min.js
1443
+ *
1444
+ * Copyright (c) Facebook, Inc. and its affiliates.
1445
+ *
1446
+ * This source code is licensed under the MIT license found in the
1447
+ * LICENSE file in the root directory of this source tree.
1448
+ *)
1449
+ */
1450
+ //# sourceMappingURL=workflow-editor.global.js.map