0sec-cli 0.22.0 → 0.22.4

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 (107) hide show
  1. package/0.js +56 -45
  2. package/README.md +12 -0
  3. package/chunks/{adapt-loop-7I57LXXR.js → adapt-loop-3CCOWE43.js} +4 -4
  4. package/chunks/{artifact-scraper-PYZ3RU3O.js → artifact-scraper-Z4UUIOH3.js} +2 -2
  5. package/chunks/{assumption-mining-MFLF43IR.js → assumption-mining-2UAKQB6V.js} +18 -14
  6. package/chunks/{chunk-RE5EZDG2.js → chunk-2WWAPKAW.js} +126 -1089
  7. package/chunks/{chunk-LPTRPRZR.js → chunk-3BPX75OR.js} +1 -1
  8. package/chunks/chunk-4ZYYX5GY.js +74 -0
  9. package/chunks/{chunk-RSIUX3RW.js → chunk-5JNTMWPK.js} +2 -2
  10. package/chunks/{chunk-RRD4XXPU.js → chunk-5WAJGLCW.js} +3 -3
  11. package/chunks/{chunk-76KSBWOQ.js → chunk-6KFB6AYN.js} +515 -20
  12. package/chunks/{chunk-HR2TU42B.js → chunk-6WQDXWQC.js} +169 -15
  13. package/chunks/chunk-6YZE552K.js +5603 -0
  14. package/chunks/chunk-BGX53365.js +309 -0
  15. package/chunks/{chunk-7DEHG7YT.js → chunk-C6JPA32H.js} +1 -1
  16. package/chunks/chunk-CF3MNS3O.js +990 -0
  17. package/chunks/{chunk-4VGLO2YS.js → chunk-CPCHLL6A.js} +5 -2
  18. package/chunks/{chunk-DM5C5L5D.js → chunk-DPUXXMJW.js} +1 -1
  19. package/chunks/{chunk-LYUAM3TG.js → chunk-E3OOBVOK.js} +30 -12
  20. package/chunks/{chunk-HUNAPTKV.js → chunk-E74LXQFY.js} +1 -1
  21. package/chunks/{chunk-UU7PQP6N.js → chunk-ELI3BVIK.js} +3 -3
  22. package/chunks/chunk-FFHRANYC.js +547 -0
  23. package/chunks/{chunk-IO7R7WBM.js → chunk-G2BE2FC7.js} +1 -1
  24. package/chunks/chunk-GQ3DGHWE.js +1659 -0
  25. package/chunks/{chunk-V36HVTUL.js → chunk-GVY3S5E5.js} +21 -18
  26. package/chunks/{chunk-UV5QWZGE.js → chunk-H4DH7COV.js} +192 -40
  27. package/chunks/{chunk-SJBCK2EI.js → chunk-H6Q2QAIY.js} +23475 -22747
  28. package/chunks/{chunk-VMRRNRMR.js → chunk-IHPTOTLL.js} +1 -1
  29. package/chunks/chunk-IXAHQICR.js +31 -0
  30. package/chunks/{chunk-TH2LW437.js → chunk-KCA35IL3.js} +2 -190
  31. package/chunks/{chunk-VNRY6AWF.js → chunk-L2CCO4KE.js} +282 -34
  32. package/chunks/{chunk-6YNKRUMC.js → chunk-NJLKFC66.js} +321 -5
  33. package/chunks/{chunk-W6UWZFKL.js → chunk-O6KPVYOI.js} +100 -5
  34. package/chunks/{chunk-EGZGZFAH.js → chunk-OAS5SAVZ.js} +6768 -2100
  35. package/chunks/chunk-PS5E7LUQ.js +277 -0
  36. package/chunks/{chunk-2GV4HQKE.js → chunk-QVIRWJ45.js} +257 -145
  37. package/chunks/{chunk-OWLJYJ5O.js → chunk-QWK4R3DB.js} +9 -9
  38. package/chunks/{chunk-XFCTUKXR.js → chunk-RCRTSKQN.js} +1 -1
  39. package/chunks/chunk-RS4MAN3Q.js +73 -0
  40. package/chunks/{chunk-7UFUALR2.js → chunk-RTBZ36BD.js} +8 -274
  41. package/chunks/{chunk-TZFIAMWZ.js → chunk-SCWWLABR.js} +1 -1
  42. package/chunks/chunk-VDOWARMJ.js +63 -0
  43. package/chunks/{chunk-5MWAG3FT.js → chunk-WBRGXCU2.js} +79 -18
  44. package/chunks/{chunk-LCRTAQN2.js → chunk-WHUAUFSX.js} +1 -1
  45. package/chunks/{chunk-YIQSGNAA.js → chunk-XODDLNBI.js} +1535 -1306
  46. package/chunks/chunk-YAZARMJY.js +355 -0
  47. package/chunks/{chunk-OAYUPGF6.js → chunk-YED25PA4.js} +1 -1
  48. package/chunks/{codex-models-7TLJSY3L.js → codex-models-Z43V3427.js} +9 -3
  49. package/chunks/{commands-NEI7L3QA.js → commands-EUGF4FUZ.js} +5844 -4095
  50. package/chunks/{db-5AP3JB4W.js → db-NVAW4WWR.js} +3 -3
  51. package/chunks/{dist-3FNZIBB4.js → dist-27BNG6WD.js} +195 -112
  52. package/chunks/{dist-5YHYNLI3.js → dist-7RUOKPRJ.js} +12 -2
  53. package/chunks/{dist-KEULE5IQ.js → dist-LNXGATR2.js} +2 -2
  54. package/chunks/{dist-XZB53PS5.js → dist-M2X367VW.js} +2 -2
  55. package/chunks/{dist-DD4H6HMQ.js → dist-NG2HT5XU.js} +27 -1
  56. package/chunks/{eval-runner-43BO2C4T.js → eval-runner-6Q3H52SP.js} +13 -9
  57. package/chunks/{exploit-agent-N4A5ELBK.js → exploit-agent-FCCR2HYX.js} +1 -1
  58. package/chunks/{exploit-autoclimb-N7P6KIF5.js → exploit-autoclimb-X5ZS5FAO.js} +1 -1
  59. package/chunks/{exploit-climb-WNEJUB5W.js → exploit-climb-3JHGEO36.js} +2 -2
  60. package/chunks/{fix-Z452M4EC.js → fix-NSNPU33B.js} +12 -6
  61. package/chunks/{harness-QJJJVSG4.js → harness-KXQOVIDQ.js} +3 -3
  62. package/chunks/{hunt-scan-K6D2V3PX.js → hunt-scan-ELTKGKC4.js} +16 -12
  63. package/chunks/{kernel-primitive-TKUACPKD.js → kernel-primitive-MT7YZSIG.js} +2 -2
  64. package/chunks/{kernel-vm-runner-RAAO2PGT.js → kernel-vm-runner-YFRHYC6G.js} +2 -2
  65. package/chunks/{native-loop-2ZRJENZ3.js → native-loop-OFJDRHPI.js} +18 -8
  66. package/chunks/orchestrate-DRZ2SVCP.js +62 -0
  67. package/chunks/{prepare-KYHGFWCJ.js → prepare-72GWTRVI.js} +6 -2
  68. package/chunks/{process-N245QIQG.js → process-MJYJ2K5E.js} +2 -1
  69. package/chunks/{run-U3XU4CTC.js → run-WTJCZZHV.js} +3091 -6037
  70. package/chunks/{runtime-G75TEWQY.js → runtime-FCKOUB7V.js} +10 -4
  71. package/chunks/{runtime-XFWJTBUO.js → runtime-LCJ4XSKE.js} +5 -1
  72. package/chunks/{scan-stream-BMOCPKQX.js → scan-stream-GT6GKQ3U.js} +7 -1
  73. package/chunks/{scope-WXI46UHJ.js → scope-E5QZUOOH.js} +2 -2
  74. package/chunks/service-plugins-MSK2EQP6.js +62 -0
  75. package/chunks/{session-store-27L3ZU73.js → session-store-H3Q7KCYG.js} +6 -4
  76. package/chunks/{variant-candidates-YWZORZMK.js → variant-candidates-SZKDCOLK.js} +9 -3
  77. package/chunks/{web-recon-prepass-YVMFXCIK.js → web-recon-prepass-IO3GXQMW.js} +11 -6
  78. package/dashboard/apple-touch-icon.png +0 -0
  79. package/dashboard/assets/operations-BvB5Qpmk.css +1 -0
  80. package/dashboard/assets/operations-D8Ii01SV.js +114 -0
  81. package/dashboard/assets/zero-peek-Dzm3MT3X.png +0 -0
  82. package/dashboard/favicon.ico +0 -0
  83. package/dashboard/favicon.svg +10 -0
  84. package/dashboard/index.html +5 -3
  85. package/package.json +1 -1
  86. package/chunks/chunk-6GHSR47F.js +0 -147
  87. package/chunks/chunk-CAYANSH6.js +0 -3524
  88. package/chunks/chunk-GHWODZMR.js +0 -16
  89. package/chunks/chunk-MICHDTBK.js +0 -193
  90. package/chunks/orchestrate-2GWGNTBF.js +0 -58
  91. package/dashboard/assets/bot-Bg1Tp9_d.js +0 -1
  92. package/dashboard/assets/dist-B_dDCPbu.js +0 -1
  93. package/dashboard/assets/findings-page-mayGhNx6.js +0 -5
  94. package/dashboard/assets/format--susmHX7.js +0 -1
  95. package/dashboard/assets/input-TuVPR3Zl.js +0 -1
  96. package/dashboard/assets/jsx-runtime-MGseXjj5.js +0 -3
  97. package/dashboard/assets/live-page-HWWHX99U.js +0 -1
  98. package/dashboard/assets/meta-tile-ckHo-w7k.js +0 -1
  99. package/dashboard/assets/operations-BxZ0OoXO.js +0 -10
  100. package/dashboard/assets/operations-CMFVrXEe.css +0 -2
  101. package/dashboard/assets/operations-app-D3d35rgo.js +0 -46
  102. package/dashboard/assets/overview-page-W_4IteEr.js +0 -1
  103. package/dashboard/assets/page-header-Bw9AJgBV.js +0 -1
  104. package/dashboard/assets/scans-page-CgzVXHnn.js +0 -1
  105. package/dashboard/assets/siren-KQj8QAnJ.js +0 -1
  106. package/dashboard/assets/table-8EDklulN.js +0 -1
  107. package/dashboard/assets/tabs-CFHPOwg8.js +0 -1
@@ -0,0 +1,114 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.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`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},z=[],ee=-1;function B(e){return{current:e}}function V(e){0>ee||(e.current=z[ee],z[ee]=null,ee--)}function H(e,t){ee++,z[ee]=e.current,e.current=t}var te=B(null),U=B(null),ne=B(null),re=B(null);function ie(e,t){switch(H(ne,t),H(U,e),H(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}V(te),H(te,e)}function ae(){V(te),V(U),V(ne)}function oe(e){e.memoizedState!==null&&H(re,e);var t=te.current,n=qd(t,e.type);t!==n&&(H(U,e),H(te,n))}function se(e){U.current===e&&(V(te),V(U)),re.current===e&&(V(re),rp._currentValue=R)}var ce,le;function ue(e){if(ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ce=t&&t[1]||``,le=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+ce+e+le}var de=!1;function fe(e,t){if(!e||de)return``;de=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ue(n):``}function pe(e,t){switch(e.tag){case 26:case 27:case 5:return ue(e.type);case 16:return ue(`Lazy`);case 13:return e.child!==t&&t!==null?ue(`Suspense Fallback`):ue(`Suspense`);case 19:return ue(`SuspenseList`);case 0:case 15:return fe(e.type,!1);case 11:return fe(e.type.render,!1);case 1:return fe(e.type,!0);case 31:return ue(`Activity`);default:return``}}function me(e){try{var t=``,n=null;do t+=pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var he=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Te=t.unstable_LowPriority,Ee=t.unstable_IdlePriority,De=t.log,Oe=t.unstable_setDisableYieldValue,ke=null,Ae=null;function je(e){if(typeof De==`function`&&Oe(e),Ae&&typeof Ae.setStrictMode==`function`)try{Ae.setStrictMode(ke,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var Ie=256,Le=262144,Re=4194304;function ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Be(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ue(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function We(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ge(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ke(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Me(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ye(e,t){var n=t&-t;return n=n&42?1:Xe(n),(n&(e.suspendedLanes|t))===0?n:0}function Xe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ze(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Qe(){var e=L.p;return e===0?(e=window.event,e===void 0?32:yp(e.type)):e}function $e(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var et=Math.random().toString(36).slice(2),tt=`__reactFiber$`+et,nt=`__reactProps$`+et,rt=`__reactContainer$`+et,it=`__reactEvents$`+et,at=`__reactListeners$`+et,ot=`__reactHandles$`+et,st=`__reactResources$`+et,ct=`__reactMarker$`+et;function lt(e){delete e[tt],delete e[nt],delete e[it],delete e[at],delete e[ot]}function ut(e){var t=e[tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[rt]||n[tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[tt])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function dt(e){if(e=e[tt]||e[rt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function pt(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function mt(e){e[ct]=!0}var ht=new Set,gt={};function _t(e,t){vt(e,t),vt(e+`Capture`,t)}function vt(e,t){for(gt[e]=t,e=0;e<t.length;e++)ht.add(t[e])}var yt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),bt={},xt={};function St(e){return he.call(xt,e)?!0:he.call(bt,e)?!1:yt.test(e)?xt[e]=!0:(bt[e]=!0,!1)}function Ct(e,t,n){if(St(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Tt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Et(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Dt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ot(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kt(e){if(!e._valueTracker){var t=Dt(e)?`checked`:`value`;e._valueTracker=Ot(e,t,``+e[t])}}function At(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Dt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function jt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Mt=/[\n"\\]/g;function Nt(e){return e.replace(Mt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Pt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Et(t)):e.value!==``+Et(t)&&(e.value=``+Et(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):It(e,o,Et(n)):It(e,o,Et(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Et(s):e.removeAttribute(`name`)}function Ft(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){kt(e);return}n=n==null?``:``+Et(n),t=t==null?n:``+Et(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),kt(e)}function It(e,t,n){t===`number`&&jt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Lt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Et(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Rt(e,t,n){if(t!=null&&(t=``+Et(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Et(n)}function zt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Et(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),kt(e)}function Bt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ht(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Vt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Ut(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ht(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ht(e,o,t[o])}function Wt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Gt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Kt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function qt(e){return Kt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Jt(){}var Yt=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zt=null,Qt=null;function $t(e){var t=dt(e);if(t&&(e=t.stateNode)){var n=e[nt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Pt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Nt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[nt]||null;if(!a)throw Error(i(90));Pt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&At(r)}break a;case`textarea`:Rt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Lt(e,!!n.multiple,t,!1)}}}var en=!1;function tn(e,t,n){if(en)return e(t,n);en=!0;try{return e(t)}finally{if(en=!1,(Zt!==null||Qt!==null)&&(Su(),Zt&&(t=Zt,e=Qt,Qt=Zt=null,$t(t),e)))for(t=0;t<e.length;t++)$t(e[t])}}function nn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[nt]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var rn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,"passive",{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return ln=i.slice(e,1<r?1-r:void 0)}function dn(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 fn(){return!0}function pn(){return!1}function mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?fn:pn,this.isPropagationStopped=pn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=fn)},persist:function(){},isPersistent:fn}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gn=mn(hn),_n=m({},hn,{view:0,detail:0}),vn=mn(_n),yn,bn,xn,Sn=m({},_n,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,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!==xn&&(xn&&e.type===`mousemove`?(yn=e.screenX-xn.screenX,bn=e.screenY-xn.screenY):bn=yn=0,xn=e),yn)},movementY:function(e){return`movementY`in e?e.movementY:bn}}),Cn=mn(Sn),wn=mn(m({},Sn,{dataTransfer:0})),Tn=mn(m({},_n,{relatedTarget:0})),En=mn(m({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=mn(m({},hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=mn(m({},hn,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={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`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=mn(m({},_n,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=mn(m({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=mn(m({},_n,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=mn(m({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=mn(m({},Sn,{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})),zn=mn(m({},hn,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=rn&&`CompositionEvent`in window,Hn=null;rn&&`documentMode`in document&&(Hn=document.documentMode);var Un=rn&&`TextEvent`in window&&!Hn,Wn=rn&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=un(),ln=cn=sn=null,Yn=!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 Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){Zt?Qt?Qt.push(r):Qt=[r]:Zt=r,t=Ad(t,`onChange`),0<t.length&&(n=new gn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){Sd(e,0)}function ir(e){if(At(ft(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(rn){var sr;if(rn){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Xt(e)),tn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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 i=n[r];if(!he.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=jt(e.document)}return t}function Cr(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`)}var wr=rn&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==jt(r)||(r=Tr,`selectionStart`in r&&Cr(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}),Dr&&vr(Dr,r)||(Dr=r,r=Ad(Er,`onSelect`),0<r.length&&(t=new gn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};rn&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),W=Pr(`transitioncancel`),Br=Pr(`transitionend`),Vr=new Map,Hr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Hr.push(`scrollEnd`);function Ur(e,t){Vr.set(e,t),_t(t,[e])}var Wr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Gr=[],Kr=0,qr=0;function Jr(){for(var e=Kr,t=qr=Kr=0;t<e;){var n=Gr[t];Gr[t++]=null;var r=Gr[t];Gr[t++]=null;var i=Gr[t];Gr[t++]=null;var a=Gr[t];if(Gr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Qr(n,i,a)}}function Yr(e,t,n,r){Gr[Kr++]=e,Gr[Kr++]=t,Gr[Kr++]=n,Gr[Kr++]=r,qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Xr(e,t,n,r){return Yr(e,t,n,r),$r(e)}function Zr(e,t){return Yr(e,null,null,t),$r(e)}function Qr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Me(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function $r(e){if(50<pu)throw pu=0,mu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ei={};function ti(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.refCleanup=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 ni(e,t,n,r){return new ti(e,t,n,r)}function ri(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ii(e,t){var n=e.alternate;return n===null?(n=ni(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&65011712,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.refCleanup=e.refCleanup,n}function ai(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function oi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ri(e)&&(s=1);else if(typeof e==`string`)s=Jf(e,n,te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ni(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ni(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ni(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ni(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function si(e,t,n,r){return e=ni(7,e,r,t),e.lanes=n,e}function ci(e,t,n){return e=ni(6,e,null,t),e.lanes=n,e}function G(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==`object`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Me(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function wi(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function Ti(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ei=null,Di=null,Oi=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[tt]=e,t[nt]=r,n){case`dialog`:Cd(`cancel`,t),Cd(`close`,t);break;case`iframe`:case`object`:case`embed`:Cd(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Cd(bd[n],t);break;case`source`:Cd(`error`,t);break;case`img`:case`image`:case`link`:Cd(`error`,t),Cd(`load`,t);break;case`details`:Cd(`toggle`,t);break;case`input`:Cd(`invalid`,t),Ft(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Cd(`invalid`,t);break;case`textarea`:Cd(`invalid`,t),zt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(Cd(`beforetoggle`,t),Cd(`toggle`,t)),r.onScroll!=null&&Cd(`scroll`,t),r.onScrollEnd!=null&&Cd(`scrollend`,t),r.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Ei=e.return;Ei;)switch(Ei.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Ei=Ei.return}}function Fi(e){if(e!==Ei)return!1;if(!Oi)return Pi(e),Oi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Jd(e.type,e.memoizedProps)),n=!n),n&&Di&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=hf(e)}else t===27?(t=Di,nf(e.type)?(e=mf,mf=null,Di=e):Di=t):Di=Ei?pf(e.stateNode.nextSibling):null;return!0}function Ii(){Di=Ei=null,Oi=!1}function Li(){var e=ki;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=B(null),Bi=null,Vi=null;function Hi(e,t,n){H(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,V(zi)}function Wi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Gi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Wi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Wi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ki(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===re.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[rp]:e.push(rp))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var K=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Qi=t.unstable_scheduleCallback,$i=t.unstable_NormalPriority,ea={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ta(){return{controller:new K,data:new Map,refCount:0}}function na(e){e.refCount--,e.refCount===0&&Qi($i,function(){e.controller.abort()})}var ra=null,ia=0,aa=0,oa=null;function sa(e,t){if(ra===null){var n=ra=[];ia=0,aa=md(),oa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ia++,t.then(ca,ca),t}function ca(){if(--ia===0&&ra!==null){oa!==null&&(oa.status=`fulfilled`);var e=ra;ra=null,aa=0,oa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function la(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ua=I.S;I.S=function(e,t){nu=be(),typeof t==`object`&&t&&typeof t.then==`function`&&sa(e,t),ua!==null&&ua(e,t)};var da=B(null);function fa(){var e=da.current;return e===null?Ll.pooledCache:e}function pa(e,t){t===null?H(da,da.current):H(da,t.pool)}function ma(){var e=fa();return e===null?null:{parent:ea._currentValue,pool:e}}var ha=Error(i(460)),ga=Error(i(474)),_a=Error(i(542)),va={then:function(){}};function ya(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ba(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jt,Jt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e;default:if(typeof t.status==`string`)t.then(Jt,Jt);else{if(e=Ll,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,wa(e),e}throw Sa=t,ha}}function xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Sa=e,ha):e}}var Sa=null;function Ca(){if(Sa===null)throw Error(i(459));var e=Sa;return Sa=null,e}function wa(e){if(e===ha||e===_a)throw Error(i(483))}var Ta=null,Ea=0;function Da(e){var t=Ea;return Ea+=1,Ta===null&&(Ta=[]),ba(Ta,e,t)}function Oa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ka(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Aa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ii(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ci(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&xa(i)===t.type)?(t=a(t,n.props),Oa(t,n),t.return=e,t):(t=oi(n.type,n.key,n.props,null,e.mode,r),Oa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=si(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=oi(t.type,t.key,t.props,null,e.mode,n),Oa(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=xa(t),f(e,t,n)}if(F(t)||M(t))return t=si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Da(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);ka(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=xa(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Da(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);ka(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=xa(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Da(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);ka(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Oi&&xi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Oi&&xi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Oi&&xi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Oi&&xi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Oi&&xi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Oi&&xi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Oa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),Oa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=xa(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Da(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);ka(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ea=0;var i=b(e,t,n,r);return Ta=null,i}catch(t){if(t===ha||t===_a)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ja=Aa(!0),Ma=Aa(!1),Na=!1;function Pa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function La(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Il&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function Ra(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}function za(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ba=!1;function Va(){if(Ba){var e=oa;if(e!==null)throw e}}function Ha(e,t,n,r){Ba=!1;var i=e.updateQueue;Na=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(zl&f)===f:(r&f)===f){f!==0&&f===aa&&(Ba=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Na=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ql|=o,e.lanes=o,e.memoizedState=d}}function Ua(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Wa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ua(n[e],t)}var Ga=B(null),Ka=B(0);function qa(e,t){e=Gl,H(Ka,e),H(Ga,t),Gl=e|t.baseLanes}function Ja(){H(Ka,Gl),H(Ga,Ga.current)}function Ya(){Gl=Ka.current,V(Ga),V(Ka)}var Xa=B(null),Za=null;function Qa(e){var t=e.alternate;H(ro,ro.current&1),H(Xa,e),Za===null&&(t===null||Ga.current!==null||t.memoizedState!==null)&&(Za=e)}function $a(e){H(ro,ro.current),H(Xa,e),Za===null&&(Za=e)}function eo(e){e.tag===22?(H(ro,ro.current),H(Xa,e),Za===null&&(Za=e)):to(e)}function to(){H(ro,ro.current),H(Xa,Xa.current)}function no(e){V(Xa),Za===e&&(Za=null),V(ro)}var ro=B(0);function io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 ao=0,oo=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return ao=a,oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){I.H=Fs;var t=so!==null&&so.next!==null;if(ao=0,co=so=oo=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&qi(e)&&(ec=!0))}function xo(e,t,n,r){oo=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=Rs,o=t(n,r)}while(uo);return o}function So(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(oo.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}ao=0,co=so=oo=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?oo.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=oo.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?oo.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw oo.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?oo.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=ba(ho,e,t),t=oo,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=oo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=oo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Oo(),oo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(ao&f)===f:(zl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===aa&&(d=!0);else if((ao&p)===p){u=u.next,p===aa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,oo.lanes|=p,ql|=p;f=u.action,fo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,oo.lanes|=f,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(ec=!0,d&&(n=oa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fo(e){var t=Do(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=oo,a=Do(),o=Oi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((so||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),Ll===null)throw Error(i(349));o||ao&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=oo.updateQueue,t===null?(t=Oo(),oo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Vo(e){var t=Zr(e,2);t!==null&&_u(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){je(!0);try{n()}finally{je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(Oi){var n=Ll.formState;if(n!==null){a:{var r=oo;if(Oi){if(Di){b:{for(var i=Di,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Di=pf(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,oo,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,oo,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,oo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),so,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ha?_a:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(oo.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=so;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=oo.updateQueue,t===null&&(t=Oo(),oo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();oo.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(oo.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){oo.flags|=4;var t=oo.updateQueue;if(t===null)t=Oo(),oo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Il&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||ao&1073741824&&!(zl&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),oo.lanes|=e,ql|=e,n)}function vs(e,t,n,r){return _r(n,t)?n:Ga.current===null?!(ao&42)||ao&1073741824&&!(zl&261930)?(ec=!0,e.memoizedState=n):(e=gu(),oo.lanes|=e,ql|=e,t):(e=_s(e,n,r),_r(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,js(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,la(c,r),hu(e)):As(e,t,r,hu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},hu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,R,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:R},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},hu())}function ws(){return Yi(rp)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=Ia(n);var r=La(t,e,n);r!==null&&(_u(r,t,n),Ra(r,t,n)),t={cache:ta()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Xr(e,t,n,r),n!==null&&(_u(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,hu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Yr(e,t,i,0),Ll===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return _u(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&_u(t,e,2)}function Ms(e){var t=e.alternate;return e===oo||t!==null&&t===oo}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Je(e,n)}}var Fs={readContext:Yi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){je(!0);try{n(t)}finally{je(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,oo,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,oo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,oo,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oo,a=Eo();if(Oi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));zl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Ll.identifierPrefix;if(Oi){var n=bi,r=yi;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,oo,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,oo)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Il&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return so===null?_s(n,e,t):vs(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ia(r);i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(_u(t,e,r),Ra(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ia(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=La(e,i,r),t!==null&&(_u(t,e,r),Ra(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=Ia(n);r.tag=2,t!=null&&(r.callback=t),t=La(e,r,n),t!==null&&(_u(t,e,n),Ra(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function Hs(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&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){Wr(e)}function Gs(e){console.error(e)}function Ks(e){Wr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=Ia(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Ia(e),e.tag=3,e}function Zs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Xa.current,n!==null){switch(n.tag){case 31:case 13:return Za===null?ku():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===va?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ju(e,r,a)),!1;case 22:return n.flags|=65536,r===va?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ju(e,r,a)),!1}throw Error(i(435,n.tag))}return Ju(e,r,a),ku(),!1}if(Oi)return t=Xa.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Ys(e.stateNode,r,a),za(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),Ql===null?Ql=[o]:Ql.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),za(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(au===null||!au.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),za(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Ma(t,null,n,r):ja(t,e.child,n,r)}function nc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ji(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Tc(e,t,i)):(Oi&&s&&Ci(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ri(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=oi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ii(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref){if(ec=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Tc(e,t,i)}}return fc(e,t,n,r,i)}function ac(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pa(t,a===null?null:a.cachePool),a===null?Ja():qa(t,a),eo(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&pa(t,null),Ja(),to(t)):(pa(t,a.cachePool),qa(t,a),to(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=fa();return a=a===null?null:{parent:ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&pa(t,null),Ja(),eo(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return ja(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,no(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Oi){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if($a(t),(e=Di)?(e=lf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=G(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if($a(t),a){if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(ec||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=Ll,r!==null&&(s=Ye(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Zr(e,s),_u(r,e,s),$s;ku(),t=lc(e,t,n)}else e=o.treeContext,Di=pf(s.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=cc(t,r),t.flags|=4096;return t}return e=ii(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function fc(e,t,n,r,i){return Ji(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Tc(e,t,i)):(Oi&&r&&Ci(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Tc(e,t,a)):(Oi&&r&&Ci(t),t.flags|=1,tc(e,t,n,a),t.child)}function q(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=ei,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Pa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Ha(t,r,a,i),Va(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ei,typeof u==`object`&&u&&(o=Yi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Na=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,i),Va(),l=t.memoizedState,s||f!==l||Na?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Na||Vs(t,n,c,r,f,l,o))?(u||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=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fa(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ei,typeof l==`object`&&l&&(c=Yi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Na=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,i),Va();var p=t.memoizedState;o!==d||f!==p||Na||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Na||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,dc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ja(t,e.child,null,i),t.child=ja(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Ii(),t.flags|=256,tc(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:ma()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(ro.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Oi){if(a?Qa(t):to(t),(e=Di)?(e=lf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=G(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(to(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,oc(null,r)):(Qa(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Qa(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(to(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ja(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=oc(null,r)):(to(t),t.child=e.child,t.flags|=128,t=null);else if(Qa(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=xc(e,t,n)}else if(ec||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=Ll,s!==null&&(r=Ye(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Zr(e,r),_u(s,e,r),$s;uf(c)||ku(),t=xc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Di=pf(c.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(to(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ii(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=si(c,a,n,null),c.flags|=2):c=ii(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=ma():(l=ea._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,oc(e.child,r)):(Qa(t),n=e.child,e=n.sibling,n=ii(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return ja(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ro.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,H(ro,o),tc(e,t,r,n),r=Oi?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&io(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ki(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&qi(e)))}function Dc(e,t,n){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),Hi(t,ea,e.memoizedState.cache),Ii();break;case 27:case 5:oe(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,$a(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Qa(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):(Qa(t),t.flags|=128,null);Qa(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),H(ro,ro.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Hi(t,ea,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Ec(e,n)&&!(t.flags&128))return ec=!1,Dc(e,t,n);ec=!!(e.flags&131072)}}else ec=!1,Oi&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=xa(t.elementType),t.type=e,typeof e==`function`)ri(e)?(r=Us(e,r),t.tag=1,t=q(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),q(e,t,r,a,n);case 3:a:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Fa(e,t),Ha(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ea,r),r!==o.cache&&Gi(t,[ea],n,!0),Va(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}if(r!==a){a=di(Error(i(424)),t),Ri(a),t=mc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Di=pf(e.firstChild),Ei=t,Oi=!0,ki=null,Ai=!0,n=Ma(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Tc(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Oi||(n=t.type,e=t.pendingProps,r=Gd(ne.current).createElement(n),r[tt]=t,r[nt]=e,zd(r,n,e),mt(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&Oi&&(r=t.stateNode=_f(t.type,t.pendingProps,ne.current),Ei=t,Ai=!0,a=Di,nf(t.type)?(mf=a,Di=pf(r.firstChild)):Di=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oi&&((a=r=Di)&&(r=sf(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Ei=t,Di=pf(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),rp._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&Oi&&((e=n=Di)&&(n=cf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Ei=t,Di=null,e=!0)),e||Mi(t)),null;case 13:return vc(e,t,n);case 4:return ie(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ja(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ea),e===null?(a=fa(),a===null&&(a=Ll,o=ta(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Pa(t),Hi(t,ea,a)):((e.lanes&n)!==0&&(Fa(e,t),Ha(t,null,null,n),Va()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ea,r),r!==a.cache&&Gi(t,[ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ea,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Eu())e.flags|=8192;else throw Sa=va,ga}}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yf(t)){if(Eu())e.flags|=8192;else throw Sa=va,ga}}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ue(),e.lanes|=t,Zl|=t)}function Nc(e,t){if(!Oi)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 J(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Pc(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return J(t),null;case 1:return J(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ea),ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),J(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(J(t),Ac(t,a,null,r,n)):(J(t),jc(t,o))):o?o===e.memoizedState?(J(t),t.flags&=-16777217):(kc(t),J(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),J(t),Ac(t,a,e,r,n)),null;case 27:if(se(t),n=ne.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return J(t),null}e=te.current,Fi(t)?Ni(t,e):(e=_f(a,r,n),t.stateNode=e,kc(t))}return J(t),null;case 5:if(se(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return J(t),null}if(o=te.current,Fi(t))Ni(t,o);else{var s=Gd(ne.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[tt]=t,o[nt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return J(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ne.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Mi(t,!0)}else e=Gd(e).createTextNode(r),e[tt]=t,t.stateNode=e}return J(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[tt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;J(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(no(t),t):(no(t),null);if(t.flags&128)throw Error(i(558))}return J(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[tt]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;J(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(no(t),t):(no(t),null)}return no(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),J(t),null);case 4:return ae(),e===null&&Ed(t.stateNode.containerInfo),J(t),null;case 10:return Ui(t.type),J(t),null;case 19:if(V(ro),r=t.memoizedState,r===null)return J(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Nc(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=io(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return H(ro,ro.current&1|2),Oi&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>ru&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Oi)return J(t),null}else 2*be()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(J(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=ro.current,H(ro,a?n&1|2:n&1),Oi&&xi(t,r.treeForkCount),e);case 22:case 23:return no(t),Ya(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(J(t),t.subtreeFlags&6&&(t.flags|=8192)):J(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&V(da),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ea),J(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Fc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ea),ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return se(t),null;case 31:if(t.memoizedState!==null){if(no(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(no(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(ro),null;case 4:return ae(),null;case 10:return Ui(t.type),null;case 22:case 23:return no(t),Ya(),e!==null&&V(da),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ea),null;case 25:return null;default:return null}}function Ic(e,t){switch(wi(t),t.tag){case 3:Ui(ea),ae();break;case 26:case 27:case 5:se(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&no(t);break;case 13:no(t);break;case 19:V(ro);break;case 10:Ui(t.type);break;case 22:case 23:no(t),Ya(),e!==null&&V(da);break;case 24:Ui(ea)}}function Lc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){qu(t,t.return,e)}}function Rc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){qu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){qu(t,t.return,e)}}function zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wa(t,n)}catch(t){qu(e,e.return,t)}}}function Bc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){qu(e,t,n)}}function Vc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){qu(e,t,n)}}function Hc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){qu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){qu(e,t,n)}else n.current=null}}function Uc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){qu(e,e.return,t)}}function Wc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[nt]=t}catch(t){qu(e,e.return,t)}}function Gc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function Kc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Gc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jt));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(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&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[tt]=e,t[nt]=n}catch(t){qu(e,e.return,t)}}var Xc=!1,Zc=!1,Qc=!1,$c=typeof WeakSet==`function`?WeakSet:Set,el=null;function tl(e,t){if(e=e.containerInfo,Ud=fp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},fp=!1,el=t;el!==null;)if(t=el,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,el=e;else for(;el!==null;){switch(t=el,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){qu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,el=e;break}el=t.return}}function nl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:_l(e,n),r&4&&Lc(5,n);break;case 1:if(_l(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){qu(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){qu(n,n.return,e)}}}r&64&&zc(n),r&512&&Vc(n,n.return);break;case 3:if(_l(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Wa(e,t)}catch(e){qu(n,n.return,e)}}break;case 27:t===null&&r&4&&Yc(n);case 26:case 5:_l(e,n),t===null&&r&4&&Uc(n),r&512&&Vc(n,n.return);break;case 12:_l(e,n);break;case 31:_l(e,n),r&4&&cl(e,n);break;case 13:_l(e,n),r&4&&ll(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||Xc,!r){t=t!==null&&t.memoizedState!==null||Zc,i=Xc;var a=Zc;Xc=r,(Zc=t)&&!a?yl(e,n,!!(n.subtreeFlags&8772)):_l(e,n),Xc=i,Zc=a}break;case 30:break;default:_l(e,n)}}function rl(e){var t=e.alternate;t!==null&&(e.alternate=null,rl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var il=null,al=!1;function ol(e,t,n){for(n=n.child;n!==null;)sl(e,t,n),n=n.sibling}function sl(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount==`function`)try{Ae.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 26:Zc||Hc(n,t),ol(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zc||Hc(n,t);var r=il,i=al;nf(n.type)&&(il=n.stateNode,al=!1),ol(e,t,n),vf(n.stateNode),il=r,al=i;break;case 5:Zc||Hc(n,t);case 6:if(r=il,i=al,il=null,ol(e,t,n),il=r,al=i,il!==null){if(al)try{(il.nodeType===9?il.body:il.nodeName===`HTML`?il.ownerDocument.body:il).removeChild(n.stateNode)}catch(e){qu(n,t,e)}else try{il.removeChild(n.stateNode)}catch(e){qu(n,t,e)}}break;case 18:il!==null&&(al?(e=il,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Rp(e)):rf(il,n.stateNode));break;case 4:r=il,i=al,il=n.stateNode.containerInfo,al=!0,ol(e,t,n),il=r,al=i;break;case 0:case 11:case 14:case 15:Rc(2,n,t),Zc||Rc(4,n,t),ol(e,t,n);break;case 1:Zc||(Hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Bc(n,t,r)),ol(e,t,n);break;case 21:ol(e,t,n);break;case 22:Zc=(r=Zc)||n.memoizedState!==null,ol(e,t,n),Zc=r;break;default:ol(e,t,n)}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rp(e)}catch(e){qu(t,t.return,e)}}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rp(e)}catch(e){qu(t,t.return,e)}}function ul(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $c),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $c),t;default:throw Error(i(435,e.tag))}}function dl(e,t){var n=ul(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Qu.bind(null,e,t);t.then(r,r)}})}function fl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){il=c.stateNode,al=!1;break a}break;case 5:il=c.stateNode,al=!1;break a;case 3:case 4:il=c.stateNode.containerInfo,al=!0;break a}c=c.return}if(il===null)throw Error(i(160));sl(o,s,a),il=null,al=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ml(t,e),t=t.sibling}var pl=null;function ml(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:fl(t,e),hl(e),r&4&&(Rc(3,e,e.return),Lc(3,e),Rc(5,e,e.return));break;case 1:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),r&64&&Xc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=pl;if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[tt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[tt]=e,mt(o),r=o;break a;case`link`:var s=Kf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Kf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[tt]=e,mt(o),r=o}e.stateNode=r}else qf(a,e.type,e.stateNode)}else e.stateNode=Vf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?qf(a,e.type,e.stateNode):Vf(a,r,e.memoizedProps))}break;case 27:fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),n!==null&&r&4&&Wc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(fl(t,e),hl(e),r&512&&(Zc||n===null||Hc(n,n.return)),e.flags&32){a=e.stateNode;try{Bt(a,``)}catch(t){qu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Wc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Qc=!0);break;case 6:if(fl(t,e),hl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){qu(e,e.return,t)}}break;case 3:if(Gf=null,a=pl,pl=xf(t.containerInfo),fl(t,e),pl=a,hl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Rp(t.containerInfo)}catch(t){qu(e,e.return,t)}Qc&&(Qc=!1,gl(e));break;case 4:r=pl,pl=xf(e.stateNode.containerInfo),fl(t,e),hl(e),pl=r;break;case 12:fl(t,e),hl(e);break;case 31:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 13:fl(t,e),hl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Xc,d=Zc;if(Xc=u||a,Zc=d||l,fl(t,e),Zc=d,Xc=u,hl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Xc||Zc||vl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){qu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){qu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){qu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,dl(e,n))));break;case 19:fl(t,e),hl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,dl(e,r)));break;case 30:break;case 21:break;default:fl(t,e),hl(e)}}function hl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Gc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Jc(e,Kc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Bt(o,``),n.flags&=-33),Jc(e,Kc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;qc(e,Kc(e),s);break;default:throw Error(i(161))}}catch(t){qu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function gl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;gl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _l(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)nl(e,t.alternate,t),t=t.sibling}function vl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Rc(4,t,t.return),vl(t);break;case 1:Hc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Bc(t,t.return,n),vl(t);break;case 27:vf(t.stateNode);case 26:case 5:Hc(t,t.return),vl(t);break;case 22:t.memoizedState===null&&vl(t);break;case 30:vl(t);break;default:vl(t)}e=e.sibling}}function yl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:yl(i,a,n),Lc(4,a);break;case 1:if(yl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){qu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ua(c[i],s)}catch(e){qu(r,r.return,e)}}n&&o&64&&zc(a),Vc(a,a.return);break;case 27:Yc(a);case 26:case 5:yl(i,a,n),n&&r===null&&o&4&&Uc(a),Vc(a,a.return);break;case 12:yl(i,a,n);break;case 31:yl(i,a,n),n&&o&4&&cl(i,a);break;case 13:yl(i,a,n),n&&o&4&&ll(i,a);break;case 22:a.memoizedState===null&&yl(i,a,n),Vc(a,a.return);break;case 30:break;default:yl(i,a,n)}t=t.sibling}}function bl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&na(n))}function xl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e))}function Sl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Cl(e,t,n,r),t=t.sibling}function Cl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Sl(e,t,n,r),i&2048&&Lc(9,t);break;case 1:Sl(e,t,n,r);break;case 3:Sl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&na(e)));break;case 12:if(i&2048){Sl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){qu(t,t.return,e)}}else Sl(e,t,n,r);break;case 31:Sl(e,t,n,r);break;case 13:Sl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Sl(e,t,n,r):(a._visibility|=2,wl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Sl(e,t,n,r):Tl(e,t),i&2048&&bl(o,t);break;case 24:Sl(e,t,n,r),i&2048&&xl(t.alternate,t);break;default:Sl(e,t,n,r)}}function wl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:wl(a,o,s,c,i),Lc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,wl(a,o,s,c,i)):u._visibility&2?wl(a,o,s,c,i):Tl(a,o),i&&l&2048&&bl(o.alternate,o);break;case 24:wl(a,o,s,c,i),i&&l&2048&&xl(o.alternate,o);break;default:wl(a,o,s,c,i)}t=t.sibling}}function Tl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Tl(n,r),i&2048&&bl(r.alternate,r);break;case 24:Tl(n,r),i&2048&&xl(r.alternate,r);break;default:Tl(n,r)}t=t.sibling}}var El=8192;function Dl(e,t,n){if(e.subtreeFlags&El)for(e=e.child;e!==null;)Ol(e,t,n),e=e.sibling}function Ol(e,t,n){switch(e.tag){case 26:Dl(e,t,n),e.flags&El&&e.memoizedState!==null&&Xf(n,pl,e.memoizedState,e.memoizedProps);break;case 5:Dl(e,t,n);break;case 3:case 4:var r=pl;pl=xf(e.stateNode.containerInfo),Dl(e,t,n),pl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=El,El=16777216,Dl(e,t,n),El=r):Dl(e,t,n));break;default:Dl(e,t,n)}}function kl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Nl(r,e)}kl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jl(e),e=e.sibling}function jl(e){switch(e.tag){case 0:case 11:case 15:Al(e),e.flags&2048&&Rc(9,e,e.return);break;case 3:Al(e);break;case 12:Al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ml(e)):Al(e);break;default:Al(e)}}function Ml(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];el=r,Nl(r,e)}kl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rc(8,t,t.return),Ml(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ml(t));break;default:Ml(t)}e=e.sibling}}function Nl(e,t){for(;el!==null;){var n=el;switch(n.tag){case 0:case 11:case 15:Rc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,el=r;else a:for(n=e;el!==null;){r=el;var i=r.sibling,a=r.return;if(rl(r),r===n){el=null;break a}if(i!==null){i.return=a,el=i;break a}el=a}}}var Pl={getCacheForType:function(e){var t=Yi(ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ea).controller.signal}},Fl=typeof WeakMap==`function`?WeakMap:Map,Il=0,Ll=null,Rl=null,zl=0,Bl=0,Vl=null,Hl=!1,Ul=!1,Wl=!1,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return Il&2&&zl!==0?zl&-zl:I.T===null?Qe():md()}function gu(){if(Xl===0){if(!(zl&536870912)||Oi){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),Xl=e}else Xl=536870912}return e=Xa.current,e!==null&&(e.flags|=32),Xl}function _u(e,t,n){(e===Ll&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)&&(wu(e,0),xu(e,zl,Xl,!1)),Ge(e,n),(!(Il&2)||e!==Ll)&&(e===Ll&&(!(Il&2)&&(Jl|=n),Kl===4&&xu(e,zl,Xl,!1)),od(e))}function vu(e,t,n){if(Il&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ve(e,t),a=r?Mu(e,t):Au(e,t,!0),o=r;do{if(a===0){Ul&&!r&&xu(e,t,0,!1);break}if(n=e.current.alternate,o&&!bu(n)){a=Au(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(wu(c,s).flags|=256),s=Au(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,Jl|=o,a=4;break a}o=$l,$l=a,o!==null&&($l===null?$l=o:$l.push.apply($l,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){wu(e,0),xu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:xu(r,t,Xl,!Hl);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=tu+300-be(),10<a)){if(xu(r,t,Xl,!Hl),Be(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=Zd(yu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,`Throttled`,-0,0),a);break a}yu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,null,-0,0)}break}while(1);od(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},Ol(t,a,d);var m=(a&62914560)===a?tu-be():(a&4194048)===a?nu-be():0;if(m=Qf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),xu(e,a,o,!l);return}}zu(e,t,a,n,r,i,o,s,c)}function bu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))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 xu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&qe(e,n,t)}function Su(){return Il&6?!0:(sd(0,!1),!1)}function Cu(){if(Rl!==null){if(Bl===0)var e=Rl.return;else e=Rl,Vi=Bi=null,To(e),Ta=null,Ea=0,e=Rl;for(;e!==null;)Ic(e.alternate,e),e=e.return;Rl=null}}function wu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Cu(),Ll=e,Rl=n=ii(e.current,null),zl=t,Bl=0,Vl=null,Hl=!1,Ul=Ve(e,t),Wl=!1,Zl=Xl=Yl=Jl=ql=Kl=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Me(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,Jr(),n}function Tu(e,t){oo=null,I.H=Fs,t===ha||t===_a?(t=Ca(),Bl=3):t===ga?(t=Ca(),Bl=4):Bl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Vl=t,Rl===null&&(Kl=1,qs(e,di(t,e.current)))}function Eu(){var e=Xa.current;return e===null?!0:(zl&4194048)===zl?Za===null:(zl&62914560)===zl||zl&536870912?e===Za:!1}function Du(){var e=I.H;return I.H=Fs,e===null?Fs:e}function Ou(){var e=I.A;return I.A=Pl,e}function ku(){Kl=4,Hl||(zl&4194048)!==zl&&Xa.current!==null||(Ul=!0),!(ql&134217727)&&!(Jl&134217727)||Ll===null||xu(Ll,zl,Xl,!1)}function Au(e,t,n){var r=Il;Il|=2;var i=Du(),a=Ou();(Ll!==e||zl!==t)&&(iu=null,wu(e,t)),t=!1;var o=Kl;a:do try{if(Bl!==0&&Rl!==null){var s=Rl,c=Vl;switch(Bl){case 8:Cu(),o=6;break a;case 3:case 2:case 9:case 6:Xa.current===null&&(t=!0);var l=Bl;if(Bl=0,Vl=null,Iu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=Bl,Bl=0,Vl=null,Iu(e,s,c,l)}}ju(),o=Kl;break}catch(t){Tu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Il=r,I.H=i,I.A=a,Rl===null&&(Ll=null,zl=0,Jr()),o}function ju(){for(;Rl!==null;)Pu(Rl)}function Mu(e,t){var n=Il;Il|=2;var r=Du(),a=Ou();Ll!==e||zl!==t?(iu=null,ru=be()+500,wu(e,t)):Ul=Ve(e,t);a:do try{if(Bl!==0&&Rl!==null){t=Rl;var o=Vl;b:switch(Bl){case 1:Bl=0,Vl=null,Iu(e,t,o,1);break;case 2:case 9:if(ya(o)){Bl=0,Vl=null,Fu(t);break}t=function(){Bl!==2&&Bl!==9||Ll!==e||(Bl=7),od(e)},o.then(t,t);break a;case 3:Bl=7;break a;case 4:Bl=5;break a;case 7:ya(o)?(Bl=0,Vl=null,Fu(t)):(Bl=0,Vl=null,Iu(e,t,o,7));break;case 5:var s=null;switch(Rl.tag){case 26:s=Rl.memoizedState;case 5:case 27:var c=Rl;if(s?Yf(s):c.stateNode.complete){Bl=0,Vl=null;var l=c.sibling;if(l!==null)Rl=l;else{var u=c.return;u===null?Rl=null:(Rl=u,Lu(u))}break b}}Bl=0,Vl=null,Iu(e,t,o,5);break;case 6:Bl=0,Vl=null,Iu(e,t,o,6);break;case 8:Cu(),Kl=6;break a;default:throw Error(i(462))}}Nu();break}catch(t){Tu(e,t)}while(1);return Vi=Bi=null,I.H=r,I.A=a,Il=n,Rl===null?(Ll=null,zl=0,Jr(),Kl):0}function Nu(){for(;Rl!==null&&!ve();)Pu(Rl)}function Pu(e){var t=Oc(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Lu(e):Rl=t}function Fu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,zl);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,zl);break;case 5:To(t);default:Ic(n,t),t=Rl=ai(t,Gl),t=Oc(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Lu(e):Rl=t}function Iu(e,t,n,r){Vi=Bi=null,To(t),Ta=null,Ea=0;var i=t.return;try{if(Qs(e,i,t,n,zl)){Kl=1,qs(e,di(n,e.current)),Rl=null;return}}catch(t){if(i!==null)throw Rl=i,t;Kl=1,qs(e,di(n,e.current)),Rl=null;return}t.flags&32768?(Oi||r===1?e=!0:Ul||zl&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Xa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ru(t,e)):Lu(t)}function Lu(e){var t=e;do{if(t.flags&32768){Ru(t,Hl);return}e=t.return;var n=Pc(t.alternate,t,Gl);if(n!==null){Rl=n;return}if(t=t.sibling,t!==null){Rl=t;return}Rl=t=e}while(t!==null);Kl===0&&(Kl=5)}function Ru(e,t){do{var n=Fc(e.alternate,e);if(n!==null){n.flags&=32767,Rl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Rl=e;return}Rl=e=n}while(e!==null);Kl=6,Rl=null}function zu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Wu();while(ou!==0);if(Il&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=qr,Ke(e,n,o,s,c,l),e===Ll&&(Rl=Ll=null,zl=0),cu=t,su=e,lu=n,uu=o,du=a,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,$u(we,function(){return Gu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=Il,Il|=4;try{tl(e,t,n)}finally{Il=s,L.p=a,I.T=r}}ou=1,Bu(),Vu(),Hu()}}function Bu(){if(ou===1){ou=0;var e=su,t=cu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Il;Il|=4;try{ml(t,e);var a=Wd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}fp=!!Ud,Wd=Ud=null}finally{Il=i,L.p=r,I.T=n}}e.current=t,ou=2}}function Vu(){if(ou===2){ou=0;var e=su,t=cu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Il;Il|=4;try{nl(e,t.alternate,t)}finally{Il=i,L.p=r,I.T=n}}ou=3}}function Hu(){if(ou===4||ou===3){ou=0,ye();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Uu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),Ze(n),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot==`function`)try{Ae.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}lu&3&&Wu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,sd(0,!1)}}function Uu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,na(t)))}function Wu(){return Bu(),Vu(),Hu(),Gu()}function Gu(){if(ou!==5)return!1;var e=su,t=uu;uu=0;var n=Ze(lu),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=du,du=null;var o=su,s=lu;if(ou=0,cu=su=null,lu=0,Il&6)throw Error(i(331));var c=Il;if(Il|=4,jl(o.current),Cl(o,o.current,s,n),Il=c,sd(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot==`function`)try{Ae.onPostCommitFiberRoot(ke,o)}catch{}return!0}finally{L.p=a,I.T=r,Uu(e,t)}}function Ku(e,t,n){t=di(n,t),t=Ys(e.stateNode,t,2),e=La(e,t,2),e!==null&&(Ge(e,2),od(e))}function qu(e,t,n){if(e.tag===3)Ku(e,e,n);else for(;t!==null;){if(t.tag===3){Ku(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=di(n,e),n=Xs(2),r=La(t,n,2),r!==null&&(Zs(n,r,t,e),Ge(r,2),od(r));break}}t=t.return}}function Ju(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Fl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Wl=!0,i.add(n),e=Yu.bind(null,e,t,n),t.then(e,e))}function Yu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ll===e&&(zl&n)===n&&(Kl===4||Kl===3&&(zl&62914560)===zl&&300>be()-tu?!(Il&2)&&wu(e,0):Yl|=n,Zl===zl&&(Zl=0)),od(e)}function Xu(e,t){t===0&&(t=Ue()),e=Zr(e,t),e!==null&&(Ge(e,t),od(e))}function Zu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xu(e,n)}function Qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Xu(e,n)}function $u(e,t){return ge(e,t)}var ed=null,td=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==td&&e.next===null&&(td===null?ed=td=e:td=td.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=ed;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Me(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=zl,a=Be(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ve(r,a)||(n=!0,fd(r,a))}r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&Xd()&&(e=ad);for(var t=be(),n=null,r=ed;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?ed=i:n.next=i,i===null&&(td=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}ou!==0&&ou!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=He(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ll,n=zl,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ve(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Ze(n)){case 2:case 8:n=Ce;break;case 32:n=we;break;case 268435456:n=Ee;break;default:n=we}return r=dd.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=zl;return r=Be(e,e===Ll?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),ud(e,be()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Wu())return null;vu(e,t,!0)}function pd(){ef(function(){Il&6?ge(Se,cd):ld()})}function md(){if(ad===0){var e=aa;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:qt(``+e)}function gd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[nt]||null).action),o=r.submitter;o&&(t=(t=o[nt]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new gn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Hr.length;vd++){var yd=Hr[vd];Ur(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}Ur(Fr,`onAnimationEnd`),Ur(Ir,`onAnimationIteration`),Ur(Lr,`onAnimationStart`),Ur(`dblclick`,`onDoubleClick`),Ur(`focusin`,`onFocus`),Ur(`focusout`,`onBlur`),Ur(Rr,`onTransitionRun`),Ur(zr,`onTransitionStart`),Ur(W,`onTransitionCancel`),Ur(Br,`onTransitionEnd`),vt(`onMouseEnter`,[`mouseout`,`mouseover`]),vt(`onMouseLeave`,[`mouseout`,`mouseover`]),vt(`onPointerEnter`,[`pointerout`,`pointerover`]),vt(`onPointerLeave`,[`pointerout`,`pointerover`]),_t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),_t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),_t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),_t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),_t(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`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(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Wr(e)}i.currentTarget=null,a=c}}}}function Cd(e,t){var n=t[it];n===void 0&&(n=t[it]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,ht.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(yp(t)){case 2:var i=pp;break;case 8:i=mp;break;default:i=hp}n=i.bind(null,t,n,e),i=void 0,!an||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ut(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}tn(function(){var r=a,i=Xt(n),s=[];a:{var c=Vr.get(e);if(c!==void 0){var l=gn,u=e;switch(e){case`keypress`:if(dn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=En;break;case Br:l=Ln;break;case`scroll`:case`scrollend`:l=vn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=nn(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Yt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[rt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ft(l),h=u==null?c:ft(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c)){if(or)v=hr;else{v=pr;var y=fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Wt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&It(c,`number`,c.value)}switch(y=r?ft(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=un()):(sn=i,cn=`value`in sn?sn.value:sn.textContent,Yn=!0)),y=Ad(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}Sd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=nn(e,n),i!=null&&r.unshift(kd(e,i,a)),i=nn(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=nn(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=nn(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`
9
+ `).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Bt(e,``+r);break;case`className`:wt(e,`class`,r);break;case`tabIndex`:wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:wt(e,n,r);break;case`style`:Ut(e,r,o);break;case`data`:if(t!==`object`){wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Ct(e,`popover`,r);break;case`xlinkActuate`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Tt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Tt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ct(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Gt.get(n)||n,Ct(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Ut(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Bt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Bt(e,``+r);break;case`onScroll`:r!=null&&Cd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Cd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Jt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!gt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[nt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ct(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Cd(`error`,e),Cd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:Cd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ld(e,t,r,d,n,null)}}Ft(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Cd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Lt(e,!!r,n,!0):Lt(e,!!r,t,!1);return;case`textarea`:for(s in Cd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ld(e,t,s,c,n,null)}zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ld(e,t,l,r,n,null)}return;case`dialog`:Cd(`beforetoggle`,e),Cd(`toggle`,e),Cd(`cancel`,e),Cd(`close`,e);break;case`iframe`:case`object`:Cd(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Cd(bd[r],e);break;case`image`:Cd(`error`,e),Cd(`load`,e);break;case`details`:Cd(`toggle`,e);break;case`embed`:case`source`:case`link`:Cd(`error`,e),Cd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ld(e,t,u,r,n,null)}return;default:if(Wt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ld(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}Pt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ld(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Lt(e,!!n,n?[]:``,!1):Lt(e,!!n,t,!0)):Lt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ld(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Rt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ld(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ld(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ld(e,t,u,p,r,m)}return;default:if(Wt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Vd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Vd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Jd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e!==Yd&&(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Rp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body)}n=i}while(n);Rp(t)}function af(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function of(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:of(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pf(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _f(e,t,n){switch(t=Gd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=L.d;L.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=Su();return e||t}function wf(e){var t=dt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Nt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Nt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Nt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Nt(n.imageSizes)+`"]`)):i+=`[href="`+Nt(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=zf(e)}yf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(Bf(a))||(t=r.createElement(`link`),zd(t,`link`,e),mt(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Nt(r)+`"][href="`+Nt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zf(e)}if(!yf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),mt(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=pt(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Uf(e,n);var c=o=r.createElement(`link`);mt(c),zd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Hf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=pt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=m({src:e,async:!0},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),mt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=pt(n).hoistableScripts,i=zf(e),a=r.get(i);a||(a=n.querySelector(Bf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Wf(e,t),a=n.createElement(`script`),mt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=ne.current)?xf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Ff(n.href),n=pt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Ff(n.href);var o=pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Rf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=zf(n),n=pt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+Nt(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),mt(t),e.head.appendChild(t))}function zf(e){return`[src="`+Nt(e)+`"]`}function Bf(e){return`script[async]`+e}function Vf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Nt(n.href)+`"]`);if(r)return t.instance=r,mt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),mt(r),zd(r,`style`,a),Hf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,mt(o),o;r=Lf(n),(a=yf.get(a))&&Uf(r,a),o=(e.ownerDocument||e).createElement(`link`),mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Hf(o,n.precedence,e),t.instance=o;case`script`:return o=zf(n.src),(a=e.querySelector(Bf(o)))?(t.instance=a,mt(a),a):(r=n,(a=yf.get(o))&&(r=m({},n),Wf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),mt(a),zd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Hf(r,n.precedence,e));return t.instance}function Hf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gf=null;function Kf(e,t,n){if(Gf===null){var r=new Map,i=Gf=new Map;i.set(n,r)}else i=Gf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ct]||a[tt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Yf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=$f.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,mt(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Uf(r,i),a=a.createElement(`link`),mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=$f.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Zf=0;function Qf(e,t){return e.stylesheets&&e.count===0&&tp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Zf===0&&(Zf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&tp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Zf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function $f(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function tp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(np,e),ep=null,$f.call(e))}function np(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=$f.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var rp={$$typeof:C,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function ip(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ap(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ip(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ni(3,null,null,t),e.current=a,a.stateNode=e,t=ta(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Pa(a),e}function op(e){return e?(e=ei,e):ei}function sp(e,t,n,r,i,a){i=op(i),r.context===null?r.context=i:r.pendingContext=i,r=Ia(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=La(e,r,t),n!==null&&(_u(n,e,t),Ra(n,e,t))}function cp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lp(e,t){cp(e,t),(e=e.alternate)&&cp(e,t)}function up(e){if(e.tag===13||e.tag===31){var t=Zr(e,67108864);t!==null&&_u(t,e,67108864),lp(e,67108864)}}function dp(e){if(e.tag===13||e.tag===31){var t=hu();t=Xe(t);var n=Zr(e,t);n!==null&&_u(n,e,t),lp(e,t)}}var fp=!0;function pp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,hp(e,t,n,r)}finally{L.p=a,I.T=i}}function mp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,hp(e,t,n,r)}finally{L.p=a,I.T=i}}function hp(e,t,n,r){if(fp){var i=gp(r);if(i===null)Od(e,t,r,_p,n),Op(e,r);else if(Ap(i,e,t,n,r))r.stopPropagation();else if(Op(e,r),t&4&&-1<Dp.indexOf(e)){for(;i!==null;){var a=dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}od(a),!(Il&6)&&(ru=be()+500,sd(0,!1))}}break;case 31:case 13:s=Zr(a,2),s!==null&&_u(s,a,2),Su(),lp(a,2)}if(a=gp(r),a===null&&Od(e,t,r,_p,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function gp(e){return e=Xt(e),vp(e)}var _p=null;function vp(e){if(_p=null,e=ut(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 _p=e,null}function yp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(xe()){case Se:return 2;case Ce:return 8;case we:case Te:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var bp=!1,xp=null,Sp=null,Cp=null,wp=new Map,Tp=new Map,Ep=[],Dp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Op(e,t){switch(e){case`focusin`:case`focusout`:xp=null;break;case`dragenter`:case`dragleave`:Sp=null;break;case`mouseover`:case`mouseout`:Cp=null;break;case`pointerover`:case`pointerout`:wp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Tp.delete(t.pointerId)}}function kp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=dt(t),t!==null&&up(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ap(e,t,n,r,i){switch(t){case`focusin`:return xp=kp(xp,e,t,n,r,i),!0;case`dragenter`:return Sp=kp(Sp,e,t,n,r,i),!0;case`mouseover`:return Cp=kp(Cp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return wp.set(a,kp(wp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Tp.set(a,kp(Tp.get(a)||null,e,t,n,r,i)),!0}return!1}function jp(e){var t=ut(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,$e(e.priority,function(){dp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,$e(e.priority,function(){dp(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 Mp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=gp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yt=r,n.target.dispatchEvent(r),Yt=null}else return t=dt(n),t!==null&&up(t),e.blockedOn=n,!1;t.shift()}return!0}function Np(e,t,n){Mp(e)&&n.delete(t)}function Pp(){bp=!1,xp!==null&&Mp(xp)&&(xp=null),Sp!==null&&Mp(Sp)&&(Sp=null),Cp!==null&&Mp(Cp)&&(Cp=null),wp.forEach(Np),Tp.forEach(Np)}function Fp(e,n){e.blockedOn===n&&(e.blockedOn=null,bp||(bp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Pp)))}var Ip=null;function Lp(e){Ip!==e&&(Ip=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ip===e&&(Ip=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(vp(r||n)===null)continue;break}var a=dt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Rp(e){function t(t){return Fp(t,e)}xp!==null&&Fp(xp,e),Sp!==null&&Fp(Sp,e),Cp!==null&&Fp(Cp,e),wp.forEach(t),Tp.forEach(t);for(var n=0;n<Ep.length;n++){var r=Ep[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ep.length&&(n=Ep[0],n.blockedOn===null);)jp(n),n.blockedOn===null&&Ep.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[nt]||null;if(typeof a==`function`)o||Lp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[nt]||null)s=o.formAction;else if(vp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Lp(n)}}}function zp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Bp(e){this._internalRoot=e}Vp.prototype.render=Bp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;sp(n,hu(),e,t,null,null)},Vp.prototype.unmount=Bp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sp(e.current,2,null,e,null,null),Su(),t[rt]=null}};function Vp(e){this._internalRoot=e}Vp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ep.length&&t!==0&&t<Ep[n].priority;n++);Ep.splice(n,0,e),n===0&&jp(e)}};var Hp=n.version;if(Hp!==`19.2.6`)throw Error(i(527,Hp,`19.2.6`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Up={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{ke=Wp.inject(Up),Ae=Wp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ap(e,1,!1,null,null,n,r,null,o,s,c,zp),e[rt]=t.current,Ed(e),new Bp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=`modulepreload`,y=function(e){return`/`+e},b={},x=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=y(t,n),t=s(t),t in b)return;b[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:v,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},S=l(d(),1),C=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,w=/^[\\/]{2}/;function T(e,t){return t+e.replace(/\\/g,`/`)}var E=`popstate`;function D(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function O(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return N(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:P(t)}return I(t,n,null,e)}function k(e,t){if(e===!1||e==null)throw Error(t)}function A(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function j(){return Math.random().toString(36).substring(2,10)}function M(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function N(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?F(t):t,state:n,key:t&&t.key||r||j(),mask:i}}function P({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function F(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function I(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=D(e)?e:N(h.location,e,t);n&&n(r,e),l=u()+1;let d=M(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=D(e)?e:N(h.location,e,t);n&&n(r,e),l=u();let i=M(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return L(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(E,d),c=e,()=>{i.removeEventListener(E,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function L(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),k(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:P(t);return i=i.replace(/ $/,`%20`),!n&&w.test(i)&&(i=r+i),new URL(i,r)}function R(e,t,n=`/`){return z(e,t,n,!1)}function z(e,t,n,r,i){let a=me((typeof t==`string`?F(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ee(e),s=null,c=pe(a);for(let e=0;s==null&&e<o.length;++e)s=le(o[e],c,r);return s}function ee(e){let t=B(e);return H(t),t}function B(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;k(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Se([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(k(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),B(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:se(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=fe(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of V(e.path))a(e,t,!0,n)}),t}function V(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=V(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function H(e){e.sort((e,t)=>e.score===t.score?ce(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var te=/^:[\w-]+$/,U=3,ne=2,re=1,ie=10,ae=-2,oe=e=>e===`*`;function se(e,t){let n=e.split(`/`),r=n.length;return n.some(oe)&&(r+=ae),t&&(r+=ne),n.filter(e=>!oe(e)).reduce((e,t)=>e+(te.test(t)?U:t===``?re:ie),r)}function ce(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function le(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?de(u,l,s.matcher,s.compiledParams):ue(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=ue({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Se([a,d.pathname]),pathnameBase:we(Se([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Se([a,d.pathnameBase]))}return o}function ue(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=fe(e.path,e.caseSensitive,e.end);return de(e,t,n,r)}function de(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function fe(e,t=!1,n=!0){A(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function pe(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return A(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function me(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function he(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?F(e):e,a;return n?(n=xe(n),a=n.startsWith(`/`)?ge(n.substring(1),`/`):ge(n,t)):a=t,{pathname:a,search:Te(r),hash:Ee(i)}}function ge(e,t){let n=Ce(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function _e(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ve(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ye(e){let t=ve(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function be(e,t,n,r=!1){let i;typeof e==`string`?i=F(e):(i={...e},k(!i.pathname||!i.pathname.includes(`?`),_e(`?`,`pathname`,`search`,i)),k(!i.pathname||!i.pathname.includes(`#`),_e(`#`,`pathname`,`hash`,i)),k(!i.search||!i.search.includes(`#`),_e(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=he(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var xe=e=>e.replace(/[\\/]{2,}/g,`/`),Se=e=>xe(e.join(`/`)),Ce=e=>e.replace(/\/+$/,``),we=e=>Ce(e).replace(/^\/*/,`/`),Te=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ee=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,De=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Oe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ke(e){return Se(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ae=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function je(e,t){let n=e;if(typeof n!=`string`||!C.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ae)try{let e=new URL(window.location.href),r=w.test(n)?new URL(T(n,e.protocol)):new URL(n),a=me(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{A(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Me=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Me);var Ne=[`GET`,...Me];new Set(Ne);var Pe=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Fe(e){try{return Pe.includes(new URL(e).protocol)}catch{return!1}}var Ie=S.createContext(null);Ie.displayName=`DataRouter`;var Le=S.createContext(null);Le.displayName=`DataRouterState`;var Re=S.createContext(!1);function ze(){return S.useContext(Re)}var Be=S.createContext({isTransitioning:!1});Be.displayName=`ViewTransition`;var Ve=S.createContext(new Map);Ve.displayName=`Fetchers`;var He=S.createContext(null);He.displayName=`Await`;var Ue=S.createContext(null);Ue.displayName=`Navigation`;var We=S.createContext(null);We.displayName=`Location`;var Ge=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ge.displayName=`Route`;var Ke=S.createContext(null);Ke.displayName=`RouteError`;var qe=`REACT_ROUTER_ERROR`,Je=`REDIRECT`,Ye=`ROUTE_ERROR_RESPONSE`;function Xe(e){if(e.startsWith(`${qe}:${Je}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ze(e){if(e.startsWith(`${qe}:${Ye}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new De(t.status,t.statusText,t.data)}catch{}}function Qe(e,{relative:t}={}){k($e(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=S.useContext(Ue),{hash:i,pathname:a,search:o}=ot(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Se([n,a])),r.createHref({pathname:s,search:o,hash:i})}function $e(){return S.useContext(We)!=null}function et(){return k($e(),`useLocation() may be used only in the context of a <Router> component.`),S.useContext(We).location}var tt=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function nt(e){S.useContext(Ue).static||S.useLayoutEffect(e)}function rt(){let{isDataRoute:e}=S.useContext(Ge);return e?Ct():it()}function it(){k($e(),`useNavigate() may be used only in the context of a <Router> component.`);let e=S.useContext(Ie),{basename:t,navigator:n}=S.useContext(Ue),{matches:r}=S.useContext(Ge),{pathname:i}=et(),a=JSON.stringify(ye(r)),o=S.useRef(!1);return nt(()=>{o.current=!0}),S.useCallback((r,s={})=>{if(A(o.current,tt),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=be(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Se([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}S.createContext(null);function at(){let{matches:e}=S.useContext(Ge);return e[e.length-1]?.params??{}}function ot(e,{relative:t}={}){let{matches:n}=S.useContext(Ge),{pathname:r}=et(),i=JSON.stringify(ye(n));return S.useMemo(()=>be(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function st(e,t){return ct(e,t)}function ct(e,t,n){k($e(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=S.useContext(Ue),{matches:i}=S.useContext(Ge),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Tt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
+
11
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=et(),d;if(t){let e=typeof t==`string`?F(t):t;k(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):R(e,{pathname:p});A(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),A(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=ht(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Se([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Se([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?S.createElement(We.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function lt(){let e=St(),t=Oe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=S.createElement(S.Fragment,null,S.createElement(`p`,null,`💿 Hey developer 👋`),S.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,S.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,S.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),S.createElement(S.Fragment,null,S.createElement(`h2`,null,`Unexpected Application Error!`),S.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?S.createElement(`pre`,{style:i},n):null,o)}var ut=S.createElement(lt,null),dt=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ze(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:S.createElement(Ge.Provider,{value:this.props.routeContext},S.createElement(Ke.Provider,{value:e,children:this.props.component}));return this.context?S.createElement(pt,{error:e},t):t}};dt.contextType=Re;var ft=new WeakMap;function pt({children:e,error:t}){let{basename:n}=S.useContext(Ue);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Xe(t.digest);if(e){let r=ft.get(t);if(r)throw r;let i=je(e.location,n),a=i.absoluteURL||i.to;if(Fe(a))throw Error(`Invalid redirect location`);if(Ae&&!ft.get(t)){if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ft.set(t,n),n}}return S.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function mt({routeContext:e,match:t,children:n}){let r=S.useContext(Ie);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Ge.Provider,{value:e},n)}function ht(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);k(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:ke(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||ut,o&&(s<0&&c===0?(Tt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?S.createElement(n.route.Component,null):n.route.element?n.route.element:e,S.createElement(mt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?S.createElement(dt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function gt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _t(e){let t=S.useContext(Ie);return k(t,gt(e)),t}function vt(e){let t=S.useContext(Le);return k(t,gt(e)),t}function yt(e){let t=S.useContext(Ge);return k(t,gt(e)),t}function bt(e){let t=yt(e),n=t.matches[t.matches.length-1];return k(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function xt(){return bt(`useRouteId`)}function St(){let e=S.useContext(Ke),t=vt(`useRouteError`),n=bt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ct(){let{router:e}=_t(`useNavigate`),t=bt(`useNavigate`),n=S.useRef(!1);return nt(()=>{n.current=!0}),S.useCallback(async(r,i={})=>{A(n.current,tt),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var wt={};function Tt(e,t,n){!t&&!wt[e]&&(wt[e]=!0,A(!1,n))}S.memo(Et);function Et({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return ct(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Dt({to:e,replace:t,state:n,relative:r}){k($e(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=S.useContext(Ue);A(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=S.useContext(Ge),{pathname:o}=et(),s=rt(),c=be(e,ye(a),o,r===`path`),l=JSON.stringify(c);return S.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Ot(e){k(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function kt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){k(!$e(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=S.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=F(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=S.useMemo(()=>{let e=me(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return A(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:S.createElement(Ue.Provider,{value:c},S.createElement(We.Provider,{children:t,value:h}))}function At({children:e,location:t}){return st(jt(e),t)}S.Component;function jt(e,t=[]){let n=[];return S.Children.forEach(e,(e,r)=>{if(!S.isValidElement(e))return;let i=[...t,r];if(e.type===S.Fragment){n.push.apply(n,jt(e.props.children,i));return}k(e.type===Ot,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),k(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=jt(e.props.children,i)),n.push(a)}),n}var Mt=`get`,Nt=`application/x-www-form-urlencoded`;function Pt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Ft(e){return Pt(e)&&e.tagName.toLowerCase()===`button`}function It(e){return Pt(e)&&e.tagName.toLowerCase()===`form`}function Lt(e){return Pt(e)&&e.tagName.toLowerCase()===`input`}function Rt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zt(e,t){return e.button===0&&(!t||t===`_self`)&&!Rt(e)}function Bt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Vt(e,t){let n=Bt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Ht=null;function Ut(){if(Ht===null)try{new FormData(document.createElement(`form`),0),Ht=!1}catch{Ht=!0}return Ht}var Wt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Gt(e){return e!=null&&!Wt.has(e)?(A(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nt}"`),null):e}function Kt(e,t){let n,r,i,a,o;if(It(e)){let o=e.getAttribute(`action`);r=o?me(o,t):null,n=e.getAttribute(`method`)||Mt,i=Gt(e.getAttribute(`enctype`))||Nt,a=new FormData(e)}else if(Ft(e)||Lt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?me(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Mt,i=Gt(e.getAttribute(`formenctype`))||Gt(o.getAttribute(`enctype`))||Nt,a=new FormData(o,e),!Ut()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Pt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Mt,r=null,i=Nt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function qt(e,t){if(e===!1||e==null)throw Error(t)}function Jt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&me(i.pathname,t)===`/`?`${Ce(t)}/_root.${r}`:`${Ce(i.pathname)}.${r}`,i}async function Yt(e,t){if(e.id in t)return t[e.id];try{let n=await x(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Xt(e){return e!=null&&typeof e.page==`string`}function Zt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Qt(e,t,n){return rn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Yt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Zt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function $t(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function en(e,t,{includeHydrateFallback:n}={}){return tn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function tn(e){return[...new Set(e)]}function nn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function rn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Xt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(nn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function an(){let e=S.useContext(Ie);return qt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function on(){let e=S.useContext(Le);return qt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var sn=S.createContext(void 0);sn.displayName=`FrameworkContext`;function cn(){let e=S.useContext(sn);return qt(e,`You must render this element inside a <HydratedRouter> element`),e}function ln(e,t){let n=S.useContext(sn),[r,i]=S.useState(!1),[a,o]=S.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=S.useRef(null);S.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),S.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:un(s,p),onBlur:un(c,m),onMouseEnter:un(l,p),onMouseLeave:un(u,m),onTouchStart:un(d,p)}]:[a,f,{}]:[!1,f,{}]}function un(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dn({page:e,...t}){let n=ze(),{nonce:r}=cn(),{router:i}=an(),a=S.useMemo(()=>R(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?S.createElement(pn,{page:e,matches:a,...t}):S.createElement(mn,{page:e,matches:a,...t})):null}function fn(e){let{manifest:t,routeModules:n}=cn(),[r,i]=S.useState([]);return S.useEffect(()=>{let r=!1;return Qt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function pn({page:e,matches:t,...n}){let r=et(),{future:i}=cn(),{basename:a}=an(),o=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Jt(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return S.createElement(S.Fragment,null,o.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function mn({page:e,matches:t,...n}){let r=et(),{future:i,manifest:a,routeModules:o}=cn(),{basename:s}=an(),{loaderData:c,matches:l}=on(),u=S.useMemo(()=>$t(e,t,l,a,r,`data`),[e,t,l,a,r]),d=S.useMemo(()=>$t(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Jt(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=S.useMemo(()=>en(d,a),[d,a]),m=fn(d);return S.createElement(S.Fragment,null,f.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>S.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>S.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function hn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}S.Component;var gn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{gn&&(window.__reactRouterVersion=`7.18.2`)}catch{}function _n({basename:e,children:t,useTransitions:n,window:r}){let i=S.useRef();i.current??=O({window:r,v5Compat:!0});let a=i.current,[o,s]=S.useState({action:a.action,location:a.location}),c=S.useCallback(e=>{n===!1?s(e):S.startTransition(()=>s(e))},[n]);return S.useLayoutEffect(()=>a.listen(c),[a,c]),S.createElement(kt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var vn=S.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=S.useContext(Ue),v=typeof l==`string`&&C.test(l),y=je(l,h);l=y.to;let b=Qe(l,{relative:r}),x=et(),w=null;if(o){let e=be(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Se([h,e.pathname])),w=g.createHref(e)}let[T,E,D]=ln(n,p),O=Cn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function k(t){e&&e(t),t.defaultPrevented||O(t)}let A=!(y.isExternal||i),j=S.createElement(`a`,{...p,...D,href:(A?w:void 0)||y.absoluteURL||b,onClick:A?k:e,ref:hn(m,E),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return T&&!v?S.createElement(S.Fragment,null,j,S.createElement(dn,{page:b})):j});vn.displayName=`Link`;var yn=S.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ot(a,{relative:c.relative}),d=et(),f=S.useContext(Le),{navigator:p,basename:m}=S.useContext(Ue),h=f!=null&&kn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=me(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:x,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return S.createElement(vn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});yn.displayName=`NavLink`;var bn=S.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Mt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=S.useContext(Ue),g=Dn(),_=On(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&C.test(s);return S.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?S.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});bn.displayName=`Form`;function xn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sn(e){let t=S.useContext(Ie);return k(t,xn(e)),t}function Cn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=rt(),d=et(),f=ot(e,{relative:o});return S.useCallback(p=>{if(zt(p,t)){p.preventDefault();let t=n===void 0?P(d)===P(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?S.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function wn(e){A(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=S.useRef(Bt(e)),n=S.useRef(!1),r=et(),i=S.useMemo(()=>Vt(r.search,n.current?null:t.current),[r.search]),a=rt();return[i,S.useCallback((e,t)=>{let r=Bt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Tn=0,En=()=>`__${String(++Tn)}__`;function Dn(){let{router:e}=Sn(`useSubmit`),{basename:t}=S.useContext(Ue),n=xt(),r=e.fetch,i=e.navigate;return S.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Kt(e,t);if(a.navigate===!1){let e=a.fetcherKey||En();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function On(e,{relative:t}={}){let{basename:n}=S.useContext(Ue),r=S.useContext(Ge);k(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ot(e||`.`,{relative:t})},o=et();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Se([n,a.pathname])),P(a)}function kn(e,{relative:t}={}){let n=S.useContext(Be);k(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Sn(`useViewTransitionState`),i=ot(e,{relative:t});if(!n.isTransitioning)return!1;let a=me(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=me(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ue(i.pathname,o)!=null||ue(i.pathname,a)!=null}var An=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},jn=new class extends An{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Mn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Nn=new class{#e=Mn;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Pn(e){setTimeout(e,0)}var Fn=typeof window>`u`||`Deno`in globalThis;function In(){}function Ln(e,t){return typeof e==`function`?e(t):e}function Rn(e){return typeof e==`number`&&e>=0&&e!==1/0}function zn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Bn(e,t){return typeof e==`function`?e(t):e}function Vn(e,t){return typeof e==`function`?e(t):e}function Hn(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Wn(o,t.options))return!1}else if(!Kn(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Un(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Gn(t.options.mutationKey)!==Gn(a))return!1}else if(!Kn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Wn(e,t){return(t?.queryKeyHashFn||Gn)(e)}function Gn(e){return JSON.stringify(e,(e,t)=>Zn(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Kn(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Kn(e[n],t[n])):!1}var qn=Object.prototype.hasOwnProperty;function Jn(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Xn(e)&&Xn(t);if(!r&&!(Zn(e)&&Zn(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:qn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Jn(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Yn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Xn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Zn(e){if(!Qn(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Qn(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Qn(e){return Object.prototype.toString.call(e)===`[object Object]`}function $n(e){return new Promise(t=>{Nn.setTimeout(t,e)})}function er(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Jn(e,t)}function tr(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function nr(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var rr=Symbol();function ir(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===rr?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ar(e,t){return typeof e==`function`?e(...t):!!e}function or(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var sr=(()=>{let e=()=>Fn;return{isServer(){return e()},setIsServer(t){e=t}}})();function cr(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var lr=Pn;function ur(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=lr,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var dr=ur(),fr=new class extends An{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function pr(e){return Math.min(1e3*2**e,3e4)}function mr(e){return(e??`online`)!==`online`||fr.isOnline()}var hr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function gr(e){let t=!1,n=0,r,i=cr(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new hr(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>jn.isFocused()&&(e.networkMode===`always`||fr.isOnline())&&e.canRun(),u=()=>mr(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(sr.isServer()?0:3),o=e.retryDelay??pr,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),$n(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var _r=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rn(this.gcTime)&&(this.#e=Nn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sr.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Nn.clearTimeout(this.#e),this.#e=void 0)}};function vr(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{or(e,()=>t.signal,()=>n=!0)},u=ir(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?nr:tr;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?br:yr,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:yr(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function yr(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function br(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var xr=class extends _r{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=wr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=wr(this.options);e.data!==void 0&&(this.setState(Cr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=er(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(In).catch(In):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Vn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Bn(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!zn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ir(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?vr(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=gr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof hr&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof hr){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Sr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Cr(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),dr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Sr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Cr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function wr(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Tr=class extends An{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=cr(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Dr(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Or(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Or(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Vn(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Yn(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&kr(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Vn(this.options.enabled,this.#t)!==Vn(t.enabled,this.#t)||Bn(this.options.staleTime,this.#t)!==Bn(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Vn(this.options.enabled,this.#t)!==Vn(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return jr(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(In)),t}#g(){this.#b();let e=Bn(this.options.staleTime,this.#t);if(sr.isServer()||this.#r.isStale||!Rn(e))return;let t=zn(this.#r.dataUpdatedAt,e)+1;this.#d=Nn.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(sr.isServer()||Vn(this.options.enabled,this.#t)===!1||!Rn(this.#p)||this.#p===0)&&(this.#f=Nn.setInterval(()=>{(this.options.refetchIntervalInBackground||jn.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Nn.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Nn.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Dr(e,t),o=i&&kr(e,n,t,r);(a||o)&&(l={...l,...Sr(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=er(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=er(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ar(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Vn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=cr();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Yn(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){dr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Er(e,t){return Vn(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Vn(t.retryOnMount,e)!==!1)}function Dr(e,t){return Er(e,t)||e.state.data!==void 0&&Or(e,t,t.refetchOnMount)}function Or(e,t,n){if(Vn(t.enabled,e)!==!1&&Bn(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ar(e,t)}return!1}function kr(e,t,n,r){return(e!==t||Vn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ar(e,n)}function Ar(e,t){return Vn(t.enabled,e)!==!1&&e.isStaleByTime(Bn(t.staleTime,e))}function jr(e,t){return!Yn(e.getCurrentResult(),t)}var Mr=class extends _r{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Nr(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=gr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),dr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Nr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Pr=class extends An{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Mr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Fr(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Fr(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Fr(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Fr(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){dr.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Un(t,e))}findAll(e={}){return this.getAll().filter(t=>Un(e,t))}notify(e){dr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return dr.batch(()=>Promise.all(e.map(e=>e.continue().catch(In))))}};function Fr(e){return e.options.scope?.id}var Ir=class extends An{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Yn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Gn(t.mutationKey)!==Gn(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Nr();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){dr.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Lr=class extends An{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Wn(r,t),a=this.get(i);return a||(a=new xr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){dr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Hn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Hn(e,t)):t}notify(e){dr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){dr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Rr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Lr,this.#t=e.mutationCache||new Pr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=jn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=fr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Bn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ln(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return dr.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;dr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return dr.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=dr.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(In).catch(In)}invalidateQueries(e,t={}){return dr.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=dr.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(In)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(In)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Bn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(In).catch(In)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(In).catch(In)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return fr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Gn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Kn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Gn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Kn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Wn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===rr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},zr=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),W=o(((e,t)=>{t.exports=zr()}))(),Br=S.createContext(void 0),Vr=e=>{let t=S.useContext(Br);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Hr=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,W.jsx)(Br.Provider,{value:e,children:t})),Ur=S.createContext(!1),Wr=()=>S.useContext(Ur);Ur.Provider;function Gr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Kr=S.createContext(Gr()),qr=()=>S.useContext(Kr),Jr=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ar(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Yr=e=>{S.useEffect(()=>{e.clearReset()},[e])},Xr=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ar(n,[e.error,r])),Zr=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Qr=(e,t)=>e.isLoading&&e.isFetching&&!t,$r=(e,t)=>e?.suspense&&t.isPending,ei=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ti(e,t,n){let r=Wr(),i=qr(),a=Vr(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Zr(o),Jr(o,i,s),Yr(i);let l=!a.getQueryCache().get(o.queryHash),[u]=S.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(S.useSyncExternalStore(S.useCallback(e=>{let t=f?u.subscribe(dr.batchCalls(e)):In;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),S.useEffect(()=>{u.setOptions(o)},[o,u]),$r(o,d))throw ei(o,u,i);if(Xr({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!sr.isServer()&&Qr(d,r)&&(l?ei(o,u,i):s?.promise)?.catch(In).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function ni(e,t){return ti(e,Tr,t)}function ri(e,t){let n=Vr(t),[r]=S.useState(()=>new Ir(n,e));S.useEffect(()=>{r.setOptions(e)},[r,e]);let i=S.useSyncExternalStore(S.useCallback(e=>r.subscribe(dr.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=S.useCallback((e,t)=>{r.mutate(e,t).catch(In)},[r]);if(i.error&&ar(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ii=l(_(),1);function ai(){return document.querySelector(`meta[name="0-control-token"]`)?.getAttribute(`content`)??null}var oi;function si(){return oi??=(async()=>{let e=await fetch(`/`,{credentials:`same-origin`,cache:`no-store`,redirect:`error`,signal:AbortSignal.timeout(5e3)});if(!e.ok||!e.headers.get(`content-type`)?.includes(`text/html`))return null;let t=new DOMParser().parseFromString(await e.text(),`text/html`).querySelector(`meta[name="0-control-token"]`)?.getAttribute(`content`);if(!t)return null;let n=document.querySelector(`meta[name="0-control-token"]`);return n||(n=document.createElement(`meta`),n.setAttribute(`name`,`0-control-token`),document.head.append(n)),n.setAttribute(`content`,t),t})().finally(()=>{oi=void 0})}async function ci(e,t){if(!e.startsWith(`/api/`)||e.includes(`\\`)||new URL(e,window.location.origin).origin!==window.location.origin)throw Error(`Browser controls require a same-origin API path.`);let n=new Headers(t?.headers);n.has(`Content-Type`)||n.set(`Content-Type`,`application/json`);let r=ai();r&&n.set(`X-0-Control-Token`,r);let i=()=>fetch(e,{...t,headers:n,credentials:`same-origin`,cache:`no-store`,redirect:`error`}),a=await i();if(a.status!==403||(await a.clone().json().catch(()=>null))?.error!==`Invalid or missing control token`)return a;let o=ai(),s=o&&o!==r?o:await si().catch(()=>null);return!s||t?.signal?.aborted?a:(n.set(`X-0-Control-Token`,s),i())}async function G(e,t){let n=await ci(e,t);if(!n.ok){let e=`${n.status} ${n.statusText}`;try{let t=await n.json();t.error&&(e=t.error)}catch{}throw Error(e)}let r=n.headers.get(`content-type`)??``;if(!r.includes(`json`))throw Error(`The local server returned ${r||`non-JSON content`} for ${e}. Reload this page or check connection diagnostics.`);return n.json()}function li(){return G(`/api/dashboard`)}async function ui(){return(await G(`/api/scans`)).scans}function di(e){return G(`/api/scans/${encodeURIComponent(e)}/events`)}function fi(e=20){return G(`/api/events/recent?limit=${encodeURIComponent(String(e))}`)}function pi(e){return G(`/api/scans/${encodeURIComponent(e)}/findings`)}function mi(e){return G(`/api/finding-family/${encodeURIComponent(e)}`)}function hi(e,t,n){return G(`/api/finding-family/${encodeURIComponent(e)}/triage`,{method:`POST`,body:JSON.stringify({triageStatus:t,triageNote:n})})}function gi(e,t,n){return G(`/api/finding-family/${encodeURIComponent(e)}/workflow`,{method:`POST`,body:JSON.stringify({workflowStatus:t,workflowAssignee:n})})}function _i(e=3e4){return G(`/api/control/recover-stale-workers`,{method:`POST`,body:JSON.stringify({staleAfterMs:e})})}function vi(){return G(`/api/control/prune-stopped-workers`,{method:`POST`,body:JSON.stringify({})})}function yi(e){return G(`/api/control/reset-database`,{method:`POST`,body:JSON.stringify({seed:e})})}function bi(e){return G(`/api/control/start-daemon`,{method:`POST`,body:JSON.stringify(e??{})})}function xi(){return G(`/api/control/stop-daemon`,{method:`POST`,body:JSON.stringify({})})}function Si(e){return G(`/api/control/launch-run`,{method:`POST`,body:JSON.stringify(e)})}async function Ci(e){return(await G(`/api/console/sessions`,{signal:e})).sessions}async function wi(e){return(await G(`/api/console/saved`,{signal:e})).sessions}async function Ti(e){return(await G(`/api/console/sessions`,{method:`POST`,body:JSON.stringify(e)})).session}async function Ei(e,t){return(await G(`/api/console/sessions/${encodeURIComponent(e)}`,{signal:t})).snapshot}function Di(e,t,n){return G(`/api/console/sessions/${encodeURIComponent(e)}/events?after=${t}`,{signal:n})}function Oi(e,t){return G(`/api/console/sessions/${encodeURIComponent(e)}/messages`,{method:`POST`,body:JSON.stringify(t)})}function ki(e,t){return G(`/api/console/sessions/${encodeURIComponent(e)}/queue${t?`/${encodeURIComponent(t)}`:``}`,{method:`DELETE`})}function Ai(e,t){return G(`/api/console/sessions/${encodeURIComponent(e)}/configuration`,{method:`PATCH`,body:JSON.stringify(t)})}function ji(e,t,n){return G(`/api/console/sessions/${encodeURIComponent(e)}/decisions/${encodeURIComponent(t)}`,{method:`POST`,body:JSON.stringify(n)})}function Mi(e,t){return G(`/api/console/sessions/${encodeURIComponent(e)}/${t}`,{method:`POST`,body:`{}`})}function Ni(e,t){return G(`/api/console/sessions/${encodeURIComponent(e)}/workers/${encodeURIComponent(t)}/stop`,{method:`POST`,body:`{}`})}function Pi(e){return G(`/api/console/sessions/${encodeURIComponent(e)}`,{method:`DELETE`})}function Fi(e){return G(`/api/console/sessions/${encodeURIComponent(e)}/delete`,{method:`POST`,body:`{}`})}async function Ii(e,t={}){return(await G(`/api/console/saved/${encodeURIComponent(e)}/resume`,{method:`POST`,body:JSON.stringify(t)})).session}function Li(e){return G(`/api/console/saved/${encodeURIComponent(e)}`,{method:`DELETE`})}function Ri(e,t=!1,n){if(n&&t)throw Error(`Saved root exports cannot address a live worker.`);return G(`/api/console/${t?`saved`:`sessions`}/${encodeURIComponent(e)}${n?`/workers/${encodeURIComponent(n)}`:``}/export`)}function zi(e,t=!1,n=!0){return G(`/api/console/${t?`saved`:`sessions`}/${encodeURIComponent(e)}/archive`,{method:`POST`,body:JSON.stringify({archived:n})})}var Bi=(0,S.createContext)(null);function Vi({children:e}){let[t,n]=(0,S.useState)(null),r=(0,S.useRef)(null);(0,S.useEffect)(()=>{r.current=t},[t]);let i=(0,S.useCallback)(e=>{r.current=e,n(e)},[]),a=(0,S.useCallback)(()=>{r.current=null,n(null)},[]),o=(0,S.useCallback)(()=>{let e=r.current;r.current=null,n(null),e?.onClose?.()},[]),s=(0,S.useMemo)(()=>({panel:t,openPanel:i,clearPanel:a,dismissPanel:o}),[a,o,i,t]);return(0,W.jsx)(Bi.Provider,{value:s,children:e})}function Hi(){let e=(0,S.useContext)(Bi);if(!e)throw Error(`useDashboardPanel must be used within a DashboardPanelProvider.`);return e}var Ui=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Wi=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Gi=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ki=e=>{let t=Gi(e);return t.charAt(0).toUpperCase()+t.slice(1)},qi={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ji=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Yi=(0,S.createContext)({}),Xi=()=>(0,S.useContext)(Yi),Zi=(0,S.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Xi()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,S.createElement)(`svg`,{ref:c,...qi,width:t??l??qi.width,height:t??l??qi.height,stroke:e??f,strokeWidth:m,className:Ui(`lucide`,p,i),...!a&&!Ji(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,S.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),K=(e,t)=>{let n=(0,S.forwardRef)(({className:n,...r},i)=>(0,S.createElement)(Zi,{ref:i,iconNode:t,className:Ui(`lucide-${Wi(Ki(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ki(e),n},Qi=K(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),$i=K(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),ea=K(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),ta=K(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),na=K(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),ra=K(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),ia=K(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),aa=K(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),oa=K(`beaker`,[[`path`,{d:`M4.5 3h15`,key:`c7n0jr`}],[`path`,{d:`M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3`,key:`m1uhx7`}],[`path`,{d:`M6 14h12`,key:`4cwo0f`}]]),sa=K(`blocks`,[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]),ca=K(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),la=K(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),ua=K(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),da=K(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),fa=K(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),pa=K(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ma=K(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ha=K(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),ga=K(`circle-play`,[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),_a=K(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),va=K(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),ya=K(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ba=K(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),xa=K(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Sa=K(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ca=K(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),wa=K(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Ta=K(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ea=K(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Da=K(`eraser`,[[`path`,{d:`M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21`,key:`g5wo59`}],[`path`,{d:`m5.082 11.09 8.828 8.828`,key:`1wx5vj`}]]),Oa=K(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ka=K(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Aa=K(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),ja=K(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),Ma=K(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Na=K(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Pa=K(`folder-check`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`m9 13 2 2 4-4`,key:`6343dt`}]]),Fa=K(`folder-search`,[[`path`,{d:`M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1`,key:`1bw5m7`}],[`path`,{d:`m21 21-1.9-1.9`,key:`1g2n9r`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}]]),Ia=K(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),La=K(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ra=K(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),za=K(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Ba=K(`hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),Va=K(`heart-pulse`,[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]),Ha=K(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ua=K(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Wa=K(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Ga=K(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Ka=K(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),qa=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ja=K(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Ya=K(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Xa=K(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Za=K(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),Qa=K(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),$a=K(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),eo=K(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),to=K(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),no=K(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),ro=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),io=K(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),ao=K(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),oo=K(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),so=K(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),co=K(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),lo=K(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),uo=K(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),fo=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),po=K(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),mo=K(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ho=K(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),go=K(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),_o=K(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),vo=K(`shield-question-mark`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),yo=K(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),bo=K(`siren`,[[`path`,{d:`M7 18v-6a5 5 0 1 1 10 0v6`,key:`pcx96s`}],[`path`,{d:`M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z`,key:`1b4s83`}],[`path`,{d:`M21 12h1`,key:`jtio3y`}],[`path`,{d:`M18.5 4.5 18 5`,key:`g5sp9y`}],[`path`,{d:`M2 12h1`,key:`1uaihz`}],[`path`,{d:`M12 2v1`,key:`11qlp1`}],[`path`,{d:`m4.929 4.929.707.707`,key:`1i51kw`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}]]),xo=K(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),So=K(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Co=K(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),wo=K(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),To=K(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Eo=K(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Do=K(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Oo=K(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ko=K(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Ao=K(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),jo=K(`waypoints`,[[`path`,{d:`m10.586 5.414-5.172 5.172`,key:`4mc350`}],[`path`,{d:`m18.586 13.414-5.172 5.172`,key:`8c96vv`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`circle`,{cx:`12`,cy:`20`,r:`2`,key:`144qzu`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}],[`circle`,{cx:`20`,cy:`12`,r:`2`,key:`1xzzfp`}],[`circle`,{cx:`4`,cy:`12`,r:`2`,key:`1hvhnz`}]]),Mo=K(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),No=K(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Po=K(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Fo=K(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Io=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-2%20-2%20240%2024'%20fill='none'%20role='img'%20aria-label='0.security'%3e%3cpath%20fill='%23FD802E'%20d='M12.5%202%20H17.5%20L7.5%2018%20H2.5%20Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='evenodd'%20d='M4%200%20H16%20L20%204%20V16%20L16%2020%20H4%20L0%2016%20V4%20Z%20M4%205%20V15%20L5%2016%20H15%20L16%2015%20V5%20L15%204%20H5%20Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='nonzero'%20transform='translate(28,0)'%20d='M0%200%20H20%20V4%20H0%20Z%20M0%204%20H4%20V8%20H0%20Z%20M0%208%20H20%20V12%20H0%20Z%20M16%2012%20H20%20V16%20H16%20Z%20M0%2016%20H20%20V20%20H0%20Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='nonzero'%20transform='translate(56,0)'%20d='M0%200%20H20%20V4%20H0%20Z%20M0%200%20H4%20V20%20H0%20Z%20M0%208%20H16%20V12%20H0%20Z%20M0%2016%20H20%20V20%20H0%20Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='nonzero'%20transform='translate(84,0)'%20d='M0%200%20H20%20V4%20H0%20Z%20M0%200%20H4%20V20%20H0%20Z%20M0%2016%20H20%20V20%20H0%20Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='nonzero'%20transform='translate(112,0)'%20d='M0%200H4V16H16V0H20V20H0Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='evenodd'%20transform='translate(140,0)'%20d='M0%200H20V12H12L20%2020H14.4L6.4%2012H4V20H0Z%20M4%204V8H16V4Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='nonzero'%20transform='translate(168,0)'%20d='M0%200H12V4H8V16H12V20H0V16H4V4H0Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='nonzero'%20transform='translate(188,0)'%20d='M0%200H20V4H12V20H8V4H0Z'/%3e%3cpath%20fill='%23403D39'%20fill-rule='nonzero'%20transform='translate(216,0)'%20d='M0%200H4V8H16V0H20V12H12V20H8V12H0Z'/%3e%3c/svg%3e`,Lo=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-2%20-2%20240%2024'%20fill='none'%20role='img'%20aria-label='0.security'%3e%3cpath%20fill='%23FD802E'%20d='M12.5%202%20H17.5%20L7.5%2018%20H2.5%20Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='evenodd'%20d='M4%200%20H16%20L20%204%20V16%20L16%2020%20H4%20L0%2016%20V4%20Z%20M4%205%20V15%20L5%2016%20H15%20L16%2015%20V5%20L15%204%20H5%20Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='nonzero'%20transform='translate(28,0)'%20d='M0%200%20H20%20V4%20H0%20Z%20M0%204%20H4%20V8%20H0%20Z%20M0%208%20H20%20V12%20H0%20Z%20M16%2012%20H20%20V16%20H16%20Z%20M0%2016%20H20%20V20%20H0%20Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='nonzero'%20transform='translate(56,0)'%20d='M0%200%20H20%20V4%20H0%20Z%20M0%200%20H4%20V20%20H0%20Z%20M0%208%20H16%20V12%20H0%20Z%20M0%2016%20H20%20V20%20H0%20Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='nonzero'%20transform='translate(84,0)'%20d='M0%200%20H20%20V4%20H0%20Z%20M0%200%20H4%20V20%20H0%20Z%20M0%2016%20H20%20V20%20H0%20Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='nonzero'%20transform='translate(112,0)'%20d='M0%200H4V16H16V0H20V20H0Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='evenodd'%20transform='translate(140,0)'%20d='M0%200H20V12H12L20%2020H14.4L6.4%2012H4V20H0Z%20M4%204V8H16V4Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='nonzero'%20transform='translate(168,0)'%20d='M0%200H12V4H8V16H12V20H0V16H4V4H0Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='nonzero'%20transform='translate(188,0)'%20d='M0%200H20V4H12V20H8V4H0Z'/%3e%3cpath%20fill='%23FCFAF6'%20fill-rule='nonzero'%20transform='translate(216,0)'%20d='M0%200H4V8H16V0H20V12H12V20H8V12H0Z'/%3e%3c/svg%3e`;function Ro(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ro(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function zo(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ro(e))&&(r&&(r+=` `),r+=t);return r}var Bo=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vo=(e,t)=>({classGroupId:e,validator:t}),Ho=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Uo=`-`,Wo=[],Go=`arbitrary..`,Ko=e=>{let t=Yo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Jo(e);let n=e.split(Uo);return qo(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Bo(i,t):t:i||Wo}return n[e]||Wo}}},qo=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qo(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Uo):e.slice(t).join(Uo),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Jo=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Go+r:void 0})(),Yo=e=>{let{theme:t,classGroups:n}=e;return Xo(n,t)},Xo=(e,t)=>{let n=Ho();for(let r in e){let i=e[r];Zo(i,n,r,t)}return n},Zo=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Qo(i,t,n,r)}},Qo=(e,t,n,r)=>{if(typeof e==`string`){$o(e,t,n);return}if(typeof e==`function`){es(e,t,n,r);return}ts(e,t,n,r)},$o=(e,t,n)=>{let r=e===``?t:ns(t,e);r.classGroupId=n},es=(e,t,n,r)=>{if(rs(e)){Zo(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vo(n,e))},ts=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Zo(o,ns(t,a),n,r)}},ns=(e,t)=>{let n=e,r=t.split(Uo),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ho(),n.nextPart.set(t,i)),n=i}return n},rs=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,is=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},as=`!`,os=`:`,ss=[],cs=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ls=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===os){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(as)?(c=s.slice(0,-1),l=!0):s.startsWith(as)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return cs(t,l,c,u)};if(t){let e=t+os,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):cs(ss,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},us=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ds=e=>({cache:is(e.cacheSize),parseClassName:ls(e),sortModifiers:us(e),postfixLookupClassGroupIds:fs(e),...Ko(e)}),fs=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ps=/\s+/,ms=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(ps),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+as:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},hs=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=gs(n))&&(i&&(i+=` `),i+=r);return i},gs=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=gs(e[r]))&&(n&&(n+=` `),n+=t);return n},_s=(e,...t)=>{let n,r,i,a,o=o=>(n=ds(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ms(e,n);return i(e,a),a};return a=o,(...e)=>a(hs(...e))},vs=[],ys=e=>{let t=t=>t[e]||vs;return t.isThemeGetter=!0,t},bs=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ss=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ws=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ts=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Es=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ds=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Os=e=>Ss.test(e),ks=e=>!!e&&!Number.isNaN(Number(e)),As=e=>!!e&&Number.isInteger(Number(e)),js=e=>e.endsWith(`%`)&&ks(e.slice(0,-1)),Ms=e=>Cs.test(e),Ns=()=>!0,Ps=e=>ws.test(e)&&!Ts.test(e),Fs=()=>!1,Is=e=>Es.test(e),Ls=e=>Ds.test(e),Rs=e=>!Vs(e)&&!Ys(e),zs=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Bs=e=>rc(e,sc,Fs),Vs=e=>bs.test(e),Hs=e=>rc(e,cc,Ps),Us=e=>rc(e,lc,ks),Ws=e=>rc(e,dc,Ns),Gs=e=>rc(e,uc,Fs),Ks=e=>rc(e,ac,Fs),qs=e=>rc(e,oc,Ls),Js=e=>rc(e,fc,Is),Ys=e=>xs.test(e),Xs=e=>ic(e,cc),Zs=e=>ic(e,uc),Qs=e=>ic(e,ac),$s=e=>ic(e,sc),ec=e=>ic(e,oc),tc=e=>ic(e,fc,!0),nc=e=>ic(e,dc,!0),rc=(e,t,n)=>{let r=bs.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ic=(e,t,n=!1)=>{let r=xs.exec(e);return r?r[1]?t(r[1]):n:!1},ac=e=>e===`position`||e===`percentage`,oc=e=>e===`image`||e===`url`,sc=e=>e===`length`||e===`size`||e===`bg-size`,cc=e=>e===`length`,lc=e=>e===`number`,uc=e=>e===`family-name`,dc=e=>e===`number`||e===`weight`,fc=e=>e===`shadow`,pc=_s(()=>{let e=ys(`color`),t=ys(`font`),n=ys(`text`),r=ys(`font-weight`),i=ys(`tracking`),a=ys(`leading`),o=ys(`breakpoint`),s=ys(`container`),c=ys(`spacing`),l=ys(`radius`),u=ys(`shadow`),d=ys(`inset-shadow`),f=ys(`text-shadow`),p=ys(`drop-shadow`),m=ys(`blur`),h=ys(`perspective`),g=ys(`aspect`),_=ys(`ease`),v=ys(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Ys,Vs],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Ys,Vs,c],T=()=>[Os,`full`,`auto`,...w()],E=()=>[As,`none`,`subgrid`,Ys,Vs],D=()=>[`auto`,{span:[`full`,As,Ys,Vs]},As,Ys,Vs],O=()=>[As,`auto`,Ys,Vs],k=()=>[`auto`,`min`,`max`,`fr`,Ys,Vs],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Os,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Os,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Os,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,Ys,Vs],L=()=>[...b(),Qs,Ks,{position:[Ys,Vs]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,$s,Bs,{size:[Ys,Vs]}],ee=()=>[js,Xs,Hs],B=()=>[``,`none`,`full`,l,Ys,Vs],V=()=>[``,ks,Xs,Hs],H=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[ks,js,Qs,Ks],ne=()=>[``,`none`,m,Ys,Vs],re=()=>[`none`,ks,Ys,Vs],ie=()=>[`none`,ks,Ys,Vs],ae=()=>[ks,Ys,Vs],oe=()=>[Os,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ms],breakpoint:[Ms],color:[Ns],container:[Ms],"drop-shadow":[Ms],ease:[`in`,`out`,`in-out`],font:[Rs],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ms],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ms],shadow:[Ms],spacing:[`px`,ks],text:[Ms],"text-shadow":[Ms],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Os,Vs,Ys,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Ys,Vs]}],"container-named":[zs],columns:[{columns:[ks,Vs,Ys,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[As,`auto`,Ys,Vs]}],basis:[{basis:[Os,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ks,Os,`auto`,`initial`,`none`,Vs]}],grow:[{grow:[``,ks,Ys,Vs]}],shrink:[{shrink:[``,ks,Ys,Vs]}],order:[{order:[As,`first`,`last`,`none`,Ys,Vs]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Xs,Hs]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,nc,Ws]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,js,Vs]}],"font-family":[{font:[Zs,Gs,t]}],"font-features":[{"font-features":[Vs]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Ys,Vs]}],"line-clamp":[{"line-clamp":[ks,`none`,Ys,Us]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Ys,Vs]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Ys,Vs]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...H(),`wavy`]}],"text-decoration-thickness":[{decoration:[ks,`from-font`,`auto`,Ys,Hs]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ks,`auto`,Ys,Vs]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[As,Ys,Vs]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Ys,Vs]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Ys,Vs]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},As,Ys,Vs],radial:[``,Ys,Vs],conic:[As,Ys,Vs]},ec,qs]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...H(),`hidden`,`none`]}],"divide-style":[{divide:[...H(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...H(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ks,Ys,Vs]}],"outline-w":[{outline:[``,ks,Xs,Hs]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,tc,Js]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,tc,Js]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ks,Hs]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,tc,Js]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ks,Ys,Vs]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ks]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ys,Vs]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ks]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Ys,Vs]}],filter:[{filter:[``,`none`,Ys,Vs]}],blur:[{blur:ne()}],brightness:[{brightness:[ks,Ys,Vs]}],contrast:[{contrast:[ks,Ys,Vs]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,tc,Js]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,ks,Ys,Vs]}],"hue-rotate":[{"hue-rotate":[ks,Ys,Vs]}],invert:[{invert:[``,ks,Ys,Vs]}],saturate:[{saturate:[ks,Ys,Vs]}],sepia:[{sepia:[``,ks,Ys,Vs]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Ys,Vs]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[ks,Ys,Vs]}],"backdrop-contrast":[{"backdrop-contrast":[ks,Ys,Vs]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ks,Ys,Vs]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ks,Ys,Vs]}],"backdrop-invert":[{"backdrop-invert":[``,ks,Ys,Vs]}],"backdrop-opacity":[{"backdrop-opacity":[ks,Ys,Vs]}],"backdrop-saturate":[{"backdrop-saturate":[ks,Ys,Vs]}],"backdrop-sepia":[{"backdrop-sepia":[``,ks,Ys,Vs]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Ys,Vs]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ks,`initial`,Ys,Vs]}],ease:[{ease:[`linear`,`initial`,_,Ys,Vs]}],delay:[{delay:[ks,Ys,Vs]}],animate:[{animate:[`none`,v,Ys,Vs]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Ys,Vs]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Ys,Vs,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],zoom:[{zoom:[As,Ys,Vs]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Ys,Vs]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Ys,Vs]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[ks,Xs,Hs,Us]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function q(...e){return pc(zo(e))}function mc({compact:e=!1,className:t}){return e?(0,W.jsxs)(`svg`,{role:`img`,"aria-label":`0.security`,viewBox:`-2 -2 24 24`,className:q(`size-9 text-[#403D39] dark:text-[#FCFAF6]`,t),children:[(0,W.jsx)(`path`,{fill:`#FD802E`,d:`M12.5 2 H17.5 L7.5 18 H2.5 Z`}),(0,W.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M4 0 H16 L20 4 V16 L16 20 H4 L0 16 V4 Z M4 5 V15 L5 16 H15 L16 15 V5 L15 4 H5 Z`})]}):(0,W.jsxs)(`div`,{className:q(`flex flex-col items-center gap-2`,t),children:[(0,W.jsx)(`img`,{alt:`0.security`,src:Io,width:240,height:24,className:`h-auto w-48 max-w-full dark:hidden`}),(0,W.jsx)(`img`,{alt:`0.security`,src:Lo,width:240,height:24,className:`hidden h-auto w-48 max-w-full dark:block`})]})}function hc({settingsHref:e}){let t=`flex h-9 w-full shrink-0 items-center gap-3 overflow-hidden rounded-xl text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,n=`mx-[9px] size-[18px] shrink-0`,r=`whitespace-nowrap text-sm opacity-0 transition-opacity duration-150 motion-reduce:transition-none group-focus-within:opacity-100 [@media(hover:hover)]:group-hover:opacity-100`,i=[{to:`/console?new=1`,label:`Chat`,icon:Xa},{to:`/findings`,label:`Findings`,icon:go},{to:`/workflows`,label:`Workflows`,icon:Mo},{to:`/plugins`,label:`Plugins`,icon:no}];return(0,W.jsx)(`div`,{className:`relative hidden w-14 shrink-0 lg:block`,children:(0,W.jsxs)(`nav`,{"aria-label":`Workspace navigation`,className:`group absolute inset-y-0 left-0 z-40 flex w-14 flex-col gap-2 overflow-hidden bg-background px-2 py-3 transition-[width,box-shadow] duration-150 ease-out motion-reduce:transition-none focus-within:w-56 focus-within:shadow-xl [@media(hover:hover)]:hover:w-56 [@media(hover:hover)]:hover:shadow-xl`,children:[(0,W.jsxs)(yn,{to:`/console?new=1`,"aria-label":`0.security home`,className:`relative mb-3 flex h-9 shrink-0 items-center overflow-hidden rounded-xl transition-opacity hover:opacity-75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,children:[(0,W.jsx)(mc,{compact:!0,className:`mx-1 size-7 shrink-0 transition-opacity duration-150 motion-reduce:transition-none group-focus-within:opacity-0 [@media(hover:hover)]:group-hover:opacity-0`}),(0,W.jsx)(mc,{className:q(r,`pointer-events-none absolute left-1 w-48 shrink-0`)})]}),i.map(({to:e,label:i,icon:a})=>(0,W.jsxs)(yn,{to:e,title:i,"aria-label":i,className:({isActive:e})=>q(t,e&&`bg-muted text-foreground`),children:[(0,W.jsx)(a,{className:n}),(0,W.jsx)(`span`,{className:r,children:i})]},e)),(0,W.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1`,children:[(0,W.jsxs)(`span`,{"aria-label":`Version 0.22.4`,title:`0.security v0.22.4`,className:`block text-center font-mono text-[9px] leading-4 tracking-tight text-muted-foreground/60`,children:[`v`,`0.22.4`]}),(0,W.jsxs)(yn,{to:e,title:`Settings`,"aria-label":`Settings`,className:({isActive:e})=>q(t,e&&`bg-muted text-foreground`),children:[(0,W.jsx)(mo,{className:n}),(0,W.jsx)(`span`,{className:r,children:`Settings`})]})]})]})})}var gc=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,_c=zo,vc=(e,t)=>n=>{if(t?.variants==null)return _c(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=gc(t)||gc(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return _c(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function yc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function bc(...e){return t=>{let n=!1,r=e.map(e=>{let r=yc(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():yc(e[t],null)}}}}function xc(...e){return S.useCallback(bc(...e),e)}var Sc=Symbol.for(`react.lazy`),Cc=S.use;function wc(e){return typeof e==`object`&&!!e&&`then`in e}function Tc(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Sc&&`_payload`in e&&wc(e._payload)}function Ec(e){let t=Oc(e),n=S.forwardRef((e,n)=>{let{children:r,...i}=e;Tc(r)&&typeof Cc==`function`&&(r=Cc(r._payload));let a=S.Children.toArray(r),o=a.find(Ac);if(o){let e=o.props.children,r=a.map(t=>t===o?S.Children.count(e)>1?S.Children.only(null):S.isValidElement(e)?e.props.children:null:t);return(0,W.jsx)(t,{...i,ref:n,children:S.isValidElement(e)?S.cloneElement(e,void 0,r):null})}return(0,W.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var Dc=Ec(`Slot`);function Oc(e){let t=S.forwardRef((e,t)=>{let{children:n,...r}=e;if(Tc(n)&&typeof Cc==`function`&&(n=Cc(n._payload)),S.isValidElement(n)){let e=Mc(n),i=jc(r,n.props);return n.type!==S.Fragment&&(i.ref=t?bc(t,e):e),S.cloneElement(n,i)}return S.Children.count(n)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kc=Symbol(`radix.slottable`);function Ac(e){return S.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===kc}function jc(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Mc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Nc=vc(`group/button inline-flex shrink-0 items-center justify-center rounded-full border border-transparent text-sm font-medium whitespace-nowrap transition-[background-color,border-color,color,box-shadow,transform] duration-150 ease-out motion-reduce:transition-none active:scale-[0.98] motion-reduce:active:scale-100 outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/92`,outline:`border-border bg-background hover:border-primary/20 hover:bg-muted hover:text-foreground aria-expanded:border-primary/20 aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/85 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground`,accent:`bg-primary text-primary-foreground hover:bg-primary/92`,success:`border-emerald-500/20 bg-emerald-500/10 text-emerald-700 hover:bg-emerald-500/16 dark:bg-emerald-500/18 dark:text-emerald-200 dark:hover:bg-emerald-500/24`,warning:`border-amber-500/20 bg-amber-500/10 text-amber-700 hover:bg-amber-500/16 dark:bg-amber-500/18 dark:text-amber-200 dark:hover:bg-amber-500/24`,danger:`border-destructive/20 bg-destructive/10 text-destructive hover:bg-destructive/16 dark:bg-destructive/20 dark:text-destructive`,destructive:`bg-destructive-background text-destructive-foreground hover:bg-destructive-background/92 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40`,link:`text-primary-text underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`,xs:`h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-9`,"icon-xs":`size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function J({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,W.jsx)(r?Dc:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:q(Nc({variant:t,size:n,className:e})),...i})}typeof window<`u`&&window.document&&window.document.createElement;function Pc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Fc(e,t){let n=S.createContext(t),r=e=>{let{children:t,...r}=e,i=S.useMemo(()=>r,Object.values(r));return(0,W.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=S.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Ic(e,t=[]){let n=[];function r(t,r){let i=S.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=S.useMemo(()=>o,Object.values(o));return(0,W.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=S.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>S.createContext(e));return function(n){let r=n?.[e]||t;return S.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Lc(i,...t)]}function Lc(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Rc=globalThis?.document?S.useLayoutEffect:()=>{},zc=S.useId||(()=>void 0),Bc=0;function Vc(e){let[t,n]=S.useState(zc());return Rc(()=>{e||n(e=>e??String(Bc++))},[e]),e||(t?`radix-${t}`:``)}var Hc=S.useInsertionEffect||Rc;function Uc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Wc({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=S.useRef(e!==void 0);S.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,S.useCallback(t=>{if(s){let n=Gc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Wc({defaultProp:e,onChange:t}){let[n,r]=S.useState(e),i=S.useRef(n),a=S.useRef(t);return Hc(()=>{a.current=t},[t]),S.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Gc(e){return typeof e==`function`}var Kc=l(h(),1);function qc(e){let t=Jc(e),n=S.forwardRef((e,n)=>{let{children:r,...i}=e,a=S.Children.toArray(r),o=a.find(Xc);if(o){let e=o.props.children,r=a.map(t=>t===o?S.Children.count(e)>1?S.Children.only(null):S.isValidElement(e)?e.props.children:null:t);return(0,W.jsx)(t,{...i,ref:n,children:S.isValidElement(e)?S.cloneElement(e,void 0,r):null})}return(0,W.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Jc(e){let t=S.forwardRef((e,t)=>{let{children:n,...r}=e;if(S.isValidElement(n)){let e=Qc(n),i=Zc(r,n.props);return n.type!==S.Fragment&&(i.ref=t?bc(t,e):e),S.cloneElement(n,i)}return S.Children.count(n)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yc=Symbol(`radix.slottable`);function Xc(e){return S.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Yc}function Zc(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Qc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $c=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=qc(`Primitive.${t}`),r=S.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,W.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function el(e,t){e&&Kc.flushSync(()=>e.dispatchEvent(t))}function tl(e){let t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...e)=>t.current?.(...e),[])}function nl(e,t=globalThis?.document){let n=tl(e);S.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var rl=`DismissableLayer`,il=`dismissableLayer.update`,al=`dismissableLayer.pointerDownOutside`,ol=`dismissableLayer.focusOutside`,sl,cl=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ll=S.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=S.useContext(cl),[u,d]=S.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=S.useState({}),m=xc(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=fl(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=pl(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return nl(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),S.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(sl=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),ml(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=sl)}},[u,f,n,l]),S.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),ml())},[u,l]),S.useEffect(()=>{let e=()=>p({});return document.addEventListener(il,e),()=>document.removeEventListener(il,e)},[]),(0,W.jsx)($c.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:Pc(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Pc(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Pc(e.onPointerDownCapture,x.onPointerDownCapture)})});ll.displayName=rl;var ul=`DismissableLayerBranch`,dl=S.forwardRef((e,t)=>{let n=S.useContext(cl),r=S.useRef(null),i=xc(t,r);return S.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,W.jsx)($c.div,{...e,ref:i})});dl.displayName=ul;function fl(e,t=globalThis?.document){let n=tl(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){hl(al,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pl(e,t=globalThis?.document){let n=tl(e),r=S.useRef(!1);return S.useEffect(()=>{let e=e=>{e.target&&!r.current&&hl(ol,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ml(){let e=new CustomEvent(il);document.dispatchEvent(e)}function hl(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?el(i,a):i.dispatchEvent(a)}var gl=`focusScope.autoFocusOnMount`,_l=`focusScope.autoFocusOnUnmount`,vl={bubbles:!1,cancelable:!0},yl=`FocusScope`,bl=S.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=S.useState(null),l=tl(i),u=tl(a),d=S.useRef(null),f=xc(t,e=>c(e)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Dl(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Dl(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Dl(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),S.useEffect(()=>{if(s){Ol.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(gl,vl);s.addEventListener(gl,l),s.dispatchEvent(t),t.defaultPrevented||(xl(jl(Cl(s)),{select:!0}),document.activeElement===e&&Dl(s))}return()=>{s.removeEventListener(gl,l),setTimeout(()=>{let t=new CustomEvent(_l,vl);s.addEventListener(_l,u),s.dispatchEvent(t),t.defaultPrevented||Dl(e??document.body,{select:!0}),s.removeEventListener(_l,u),Ol.remove(p)},0)}}},[s,l,u,p]);let m=S.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Sl(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Dl(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Dl(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,W.jsx)($c.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});bl.displayName=yl;function xl(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Dl(r,{select:t}),document.activeElement!==n)return}function Sl(e){let t=Cl(e);return[wl(t,e),wl(t.reverse(),e)]}function Cl(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wl(e,t){for(let n of e)if(!Tl(n,{upTo:t}))return n}function Tl(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function El(e){return e instanceof HTMLInputElement&&`select`in e}function Dl(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&El(e)&&t&&e.select()}}var Ol=kl();function kl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Al(e,t),e.unshift(t)},remove(t){e=Al(e,t),e[0]?.resume()}}}function Al(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jl(e){return e.filter(e=>e.tagName!==`A`)}var Ml=`Portal`,Nl=S.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=S.useState(!1);Rc(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Kc.createPortal((0,W.jsx)($c.div,{...r,ref:t}),o):null});Nl.displayName=Ml;function Pl(e,t){return S.useReducer((e,n)=>t[e][n]??e,e)}var Fl=e=>{let{present:t,children:n}=e,r=Il(t),i=typeof n==`function`?n({present:r.isPresent}):S.Children.only(n),a=xc(r.ref,Rl(i));return typeof n==`function`||r.isPresent?S.cloneElement(i,{ref:a}):null};Fl.displayName=`Presence`;function Il(e){let[t,n]=S.useState(),r=S.useRef(null),i=S.useRef(e),a=S.useRef(`none`),[o,s]=Pl(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return S.useEffect(()=>{let e=Ll(r.current);a.current=o===`mounted`?e:`none`},[o]),Rc(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ll(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Rc(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ll(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ll(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:S.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ll(e){return e?.animationName||`none`}function Rl(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zl=0;function Bl(){S.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Vl()),document.body.insertAdjacentElement(`beforeend`,e[1]??Vl()),zl++,()=>{zl===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),zl--}},[])}function Vl(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Hl=function(){return Hl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Hl.apply(this,arguments)};function Ul(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Wl(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Gl=`right-scroll-bar-position`,Kl=`width-before-scroll-bar`,ql=`with-scroll-bars-hidden`,Jl=`--removed-body-scroll-bar-size`;function Yl(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Xl(e,t){var n=(0,S.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Zl=typeof window<`u`?S.useLayoutEffect:S.useEffect,Ql=new WeakMap;function $l(e,t){var n=Xl(t||null,function(t){return e.forEach(function(e){return Yl(e,t)})});return Zl(function(){var t=Ql.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Yl(e,null)}),i.forEach(function(e){r.has(e)||Yl(e,a)})}Ql.set(n,e)},[e]),n}function eu(e){return e}function tu(e,t){t===void 0&&(t=eu);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function nu(e){e===void 0&&(e={});var t=tu(null);return t.options=Hl({async:!0,ssr:!1},e),t}var ru=function(e){var t=e.sideCar,n=Ul(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return S.createElement(r,Hl({},n))};ru.isSideCarExport=!0;function iu(e,t){return e.useMedium(t),ru}var au=nu(),ou=function(){},su=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:ou,onWheelCapture:ou,onTouchMoveCapture:ou}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Ul(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,C=$l([n,t]),w=Hl(Hl({},b),i);return S.createElement(S.Fragment,null,u&&S.createElement(x,{sideCar:au,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?S.cloneElement(S.Children.only(s),Hl(Hl({},w),{ref:C})):S.createElement(v,Hl({},w,{className:c,ref:C}),s))});su.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},su.classNames={fullWidth:Kl,zeroRight:Gl};var cu=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function lu(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=cu();return t&&e.setAttribute(`nonce`,t),e}function uu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function du(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var fu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lu())&&(uu(t,n),du(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pu=function(){var e=fu();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mu=function(){var e=pu();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},hu={left:0,top:0,right:0,gap:0},gu=function(e){return parseInt(e||``,10)||0},_u=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[gu(n),gu(r),gu(i)]},vu=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return hu;var t=_u(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yu=mu(),bu=`data-scroll-locked`,xu=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
12
+ .${ql} {
13
+ overflow: hidden ${r};
14
+ padding-right: ${s}px ${r};
15
+ }
16
+ body[${bu}] {
17
+ overflow: hidden ${r};
18
+ overscroll-behavior: contain;
19
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
20
+ padding-left: ${i}px;
21
+ padding-top: ${a}px;
22
+ padding-right: ${o}px;
23
+ margin-left:0;
24
+ margin-top:0;
25
+ margin-right: ${s}px ${r};
26
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
27
+ }
28
+
29
+ .${Gl} {
30
+ right: ${s}px ${r};
31
+ }
32
+
33
+ .${Kl} {
34
+ margin-right: ${s}px ${r};
35
+ }
36
+
37
+ .${Gl} .${Gl} {
38
+ right: 0 ${r};
39
+ }
40
+
41
+ .${Kl} .${Kl} {
42
+ margin-right: 0 ${r};
43
+ }
44
+
45
+ body[${bu}] {
46
+ ${Jl}: ${s}px;
47
+ }
48
+ `},Su=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Cu=function(){S.useEffect(function(){return document.body.setAttribute(bu,(Su()+1).toString()),function(){var e=Su()-1;e<=0?document.body.removeAttribute(bu):document.body.setAttribute(bu,e.toString())}},[])},wu=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Cu();var a=S.useMemo(function(){return vu(i)},[i]);return S.createElement(yu,{styles:xu(a,!t,i,n?``:`!important`)})},Tu=!1;if(typeof window<`u`)try{var Eu=Object.defineProperty({},"passive",{get:function(){return Tu=!0,!0}});window.addEventListener(`test`,Eu,Eu),window.removeEventListener(`test`,Eu,Eu)}catch{Tu=!1}var Du=Tu?{passive:!1}:!1,Ou=function(e){return e.tagName===`TEXTAREA`},ku=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ou(e)&&n[t]===`visible`)},Au=function(e){return ku(e,`overflowY`)},ju=function(e){return ku(e,`overflowX`)},Mu=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Fu(e,r)){var i=Iu(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Nu=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Pu=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Fu=function(e,t){return e===`v`?Au(t):ju(t)},Iu=function(e,t){return e===`v`?Nu(t):Pu(t)},Lu=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ru=function(e,t,n,r,i){var a=Lu(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Iu(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Fu(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},zu=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Bu=function(e){return[e.deltaX,e.deltaY]},Vu=function(e){return e&&`current`in e?e.current:e},Hu=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Uu=function(e){return`
49
+ .block-interactivity-${e} {pointer-events: none;}
50
+ .allow-interactivity-${e} {pointer-events: all;}
51
+ `},Wu=0,Gu=[];function Ku(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(Wu++)[0],a=S.useState(mu)[0],o=S.useRef(e);S.useEffect(function(){o.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Wl([e.lockRef.current],(e.shards||[]).map(Vu),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=S.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=zu(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Mu(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Mu(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ru(h,t,e,h===`h`?s:c,!0)},[]),c=S.useCallback(function(e){var n=e;if(!(!Gu.length||Gu[Gu.length-1]!==a)){var r=`deltaY`in n?Bu(n):zu(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Hu(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Vu).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=S.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:qu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=S.useCallback(function(e){n.current=zu(e),r.current=void 0},[]),d=S.useCallback(function(t){l(t.type,Bu(t),t.target,s(t,e.lockRef.current))},[]),f=S.useCallback(function(t){l(t.type,zu(t),t.target,s(t,e.lockRef.current))},[]);S.useEffect(function(){return Gu.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Du),document.addEventListener(`touchmove`,c,Du),document.addEventListener(`touchstart`,u,Du),function(){Gu=Gu.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Du),document.removeEventListener(`touchmove`,c,Du),document.removeEventListener(`touchstart`,u,Du)}},[]);var p=e.removeScrollBar,m=e.inert;return S.createElement(S.Fragment,null,m?S.createElement(a,{styles:Uu(i)}):null,p?S.createElement(wu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ju=iu(au,Ku),Yu=S.forwardRef(function(e,t){return S.createElement(su,Hl({},e,{ref:t,sideCar:Ju}))});Yu.classNames=su.classNames;var Xu=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Zu=new WeakMap,Qu=new WeakMap,$u={},ed=0,td=function(e){return e&&(e.host||td(e.parentNode))},nd=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=td(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},rd=function(e,t,n,r){var i=nd(t,Array.isArray(e)?e:[e]);$u[n]||($u[n]=new WeakMap);var a=$u[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Zu.get(e)||0)+1,l=(a.get(e)||0)+1;Zu.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Qu.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ed++,function(){o.forEach(function(e){var t=Zu.get(e)-1,i=a.get(e)-1;Zu.set(e,t),a.set(e,i),t||(Qu.has(e)||e.removeAttribute(r),Qu.delete(e)),i||e.removeAttribute(n)}),ed--,ed||(Zu=new WeakMap,Zu=new WeakMap,Qu=new WeakMap,$u={})}},id=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Xu(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),rd(r,i,n,`aria-hidden`)):function(){return null}},ad=`Dialog`,[od,sd]=Ic(ad),[cd,ld]=od(ad),ud=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=S.useRef(null),c=S.useRef(null),[l,u]=Uc({prop:r,defaultProp:i??!1,onChange:a,caller:ad});return(0,W.jsx)(cd,{scope:t,triggerRef:s,contentRef:c,contentId:Vc(),titleId:Vc(),descriptionId:Vc(),open:l,onOpenChange:u,onOpenToggle:S.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};ud.displayName=ad;var dd=`DialogTrigger`,fd=S.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ld(dd,n),a=xc(t,i.triggerRef);return(0,W.jsx)($c.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Md(i.open),...r,ref:a,onClick:Pc(e.onClick,i.onOpenToggle)})});fd.displayName=dd;var pd=`DialogPortal`,[md,hd]=od(pd,{forceMount:void 0}),gd=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ld(pd,t);return(0,W.jsx)(md,{scope:t,forceMount:n,children:S.Children.map(r,e=>(0,W.jsx)(Fl,{present:n||a.open,children:(0,W.jsx)(Nl,{asChild:!0,container:i,children:e})}))})};gd.displayName=pd;var _d=`DialogOverlay`,vd=S.forwardRef((e,t)=>{let n=hd(_d,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ld(_d,e.__scopeDialog);return a.modal?(0,W.jsx)(Fl,{present:r||a.open,children:(0,W.jsx)(bd,{...i,ref:t})}):null});vd.displayName=_d;var yd=qc(`DialogOverlay.RemoveScroll`),bd=S.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ld(_d,n);return(0,W.jsx)(Yu,{as:yd,allowPinchZoom:!0,shards:[i.contentRef],children:(0,W.jsx)($c.div,{"data-state":Md(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),xd=`DialogContent`,Sd=S.forwardRef((e,t)=>{let n=hd(xd,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ld(xd,e.__scopeDialog);return(0,W.jsx)(Fl,{present:r||a.open,children:a.modal?(0,W.jsx)(Cd,{...i,ref:t}):(0,W.jsx)(wd,{...i,ref:t})})});Sd.displayName=xd;var Cd=S.forwardRef((e,t)=>{let n=ld(xd,e.__scopeDialog),r=S.useRef(null),i=xc(t,n.contentRef,r);return S.useEffect(()=>{let e=r.current;if(e)return id(e)},[]),(0,W.jsx)(Td,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pc(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Pc(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Pc(e.onFocusOutside,e=>e.preventDefault())})}),wd=S.forwardRef((e,t)=>{let n=ld(xd,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return(0,W.jsx)(Td,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Td=S.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ld(xd,n),c=S.useRef(null),l=xc(t,c);return Bl(),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(bl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(ll,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Md(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Id,{titleId:s.titleId}),(0,W.jsx)(Rd,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Ed=`DialogTitle`,Dd=S.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ld(Ed,n);return(0,W.jsx)($c.h2,{id:i.titleId,...r,ref:t})});Dd.displayName=Ed;var Od=`DialogDescription`,kd=S.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ld(Od,n);return(0,W.jsx)($c.p,{id:i.descriptionId,...r,ref:t})});kd.displayName=Od;var Ad=`DialogClose`,jd=S.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=ld(Ad,n);return(0,W.jsx)($c.button,{type:`button`,...r,ref:t,onClick:Pc(e.onClick,()=>i.onOpenChange(!1))})});jd.displayName=Ad;function Md(e){return e?`open`:`closed`}var Nd=`DialogTitleWarning`,[Pd,Fd]=Fc(Nd,{contentName:xd,titleName:Ed,docsSlug:`dialog`}),Id=({titleId:e})=>{let t=Fd(Nd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
52
+
53
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
54
+
55
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ld=`DialogDescriptionWarning`,Rd=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fd(Ld).contentName}}.`;return S.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},zd=ud,Bd=fd,Vd=gd,Hd=vd,Ud=Sd,Wd=Dd,Gd=kd,Kd=jd;function qd({...e}){return(0,W.jsx)(zd,{"data-slot":`sheet`,...e})}function Jd({...e}){return(0,W.jsx)(Vd,{"data-slot":`sheet-portal`,...e})}function Yd({className:e,...t}){return(0,W.jsx)(Hd,{"data-slot":`sheet-overlay`,className:q(`fixed inset-0 z-50 bg-black/55 duration-180 motion-reduce:animate-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0`,e),...t})}function Xd({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,W.jsxs)(Jd,{children:[(0,W.jsx)(Yd,{}),(0,W.jsxs)(Ud,{"data-slot":`sheet-content`,"data-side":n,className:q(`fixed z-50 flex max-h-dvh flex-col overflow-y-auto overscroll-contain border-0 bg-popover text-sm text-popover-foreground shadow-xl transition duration-180 ease-out motion-reduce:transition-none motion-reduce:animate-none data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:rounded-t-3xl data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:rounded-r-3xl data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:rounded-l-3xl data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:rounded-b-3xl data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[side=bottom]:data-[state=open]:slide-in-from-bottom-10 data-[side=left]:data-[state=open]:slide-in-from-left-10 data-[side=right]:data-[state=open]:slide-in-from-right-10 data-[side=top]:data-[state=open]:slide-in-from-top-10 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[side=bottom]:data-[state=closed]:slide-out-to-bottom-10 data-[side=left]:data-[state=closed]:slide-out-to-left-10 data-[side=right]:data-[state=closed]:slide-out-to-right-10 data-[side=top]:data-[state=closed]:slide-out-to-top-10`,e),...i,children:[t,r&&(0,W.jsx)(Kd,{"data-slot":`sheet-close`,asChild:!0,children:(0,W.jsxs)(J,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`,children:[(0,W.jsx)(Po,{className:`size-4`}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function Zd({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`sheet-header`,className:q(`flex flex-col gap-1.5 p-6 pr-14`,e),...t})}function Qd({className:e,...t}){return(0,W.jsx)(Wd,{"data-slot":`sheet-title`,className:q(`font-sans text-base font-medium text-foreground`,e),...t})}function $d({className:e,...t}){return(0,W.jsx)(Gd,{"data-slot":`sheet-description`,className:q(`text-sm text-muted-foreground`,e),...t})}var ef=[{to:`/console`,label:`Chat`,icon:Xa},{to:`/findings`,label:`Findings`,icon:go},{to:`/workflows`,label:`Workflows`,icon:Mo},{to:`/plugins`,label:`Plugins`,icon:no},{to:`/settings`,label:`Settings`,icon:mo}];function tf({title:e,children:t,onNew:n,onOpenPalette:r}){let[i,a]=(0,S.useState)(!1);return(0,W.jsxs)(`div`,{className:`console-frame flex min-w-0 overflow-hidden bg-background text-foreground`,children:[(0,W.jsx)(hc,{settingsHref:`/settings`}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,W.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-2 px-3 py-3 sm:px-5`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(J,{className:`lg:hidden [@media(hover:none)]:inline-flex`,variant:`ghost`,size:`icon-sm`,"aria-label":`Open navigation`,onClick:()=>a(!0),children:(0,W.jsx)(Ja,{className:`size-4`})}),(0,W.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(J,{className:`lg:hidden`,variant:`ghost`,size:`icon-sm`,"aria-label":`New chat`,onClick:n,children:(0,W.jsx)(ro,{className:`size-4`})}),(0,W.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open commands`,onClick:r,children:(0,W.jsx)(xa,{className:`size-4`})})]})]}),(0,W.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,W.jsx)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-5 px-5 py-5 sm:px-8`,children:t})})]}),(0,W.jsx)(qd,{open:i,onOpenChange:a,children:(0,W.jsxs)(Xd,{side:`left`,className:`w-64 p-3`,children:[(0,W.jsxs)(Zd,{className:`px-3 py-4`,children:[(0,W.jsx)(mc,{compact:!0,className:`size-7`}),(0,W.jsx)(Qd,{className:`sr-only`,children:`Workspace navigation`})]}),(0,W.jsx)(`nav`,{"aria-label":`All workspace pages`,className:`flex flex-col gap-1`,children:ef.map(({to:e,label:t,icon:n})=>(0,W.jsx)(J,{variant:`ghost`,asChild:!0,className:`justify-start`,children:(0,W.jsxs)(vn,{to:e,onClick:()=>a(!1),children:[(0,W.jsx)(n,{className:`size-4`}),t]})},e))})]})})]})}function nf(e){return/^\/(?:threads|findings)(?:\/|$)/.test(e)?`Findings`:/^\/(?:runs|scans)(?:\/|$)/.test(e)?`Audit reports`:/^\/(?:workflows|audits|launcher|launch)(?:\/|$)/.test(e)?`Workflows`:e.startsWith(`/live`)?`Live activity`:e.startsWith(`/dashboard`)?`Dashboard`:e.startsWith(`/setup`)?`Set up 0`:e.startsWith(`/connections`)?`Connections`:e.startsWith(`/models`)?`Models`:e.startsWith(`/plugins`)?`Plugins`:e.startsWith(`/settings`)?`Settings`:`Workspace`}function rf({children:e,onOpenPalette:t}){let{pathname:n}=et(),r=rt(),{panel:i,dismissPanel:a}=Hi();return n.startsWith(`/console`)?(0,W.jsx)(W.Fragment,{children:e}):(0,W.jsxs)(tf,{title:nf(n),onNew:()=>r(`/console?new=1`),onOpenPalette:t,children:[e,(0,W.jsx)(qd,{open:!!i,onOpenChange:e=>{e||a()},children:(0,W.jsx)(Xd,{side:`right`,className:`w-full overflow-y-auto p-0 sm:max-w-2xl`,children:i&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Zd,{className:`pr-12`,children:[(0,W.jsx)(Qd,{children:i.title}),(0,W.jsx)($d,{children:i.description})]}),(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:i.content})]})})})]})}function af({className:e,type:t,...n}){return(0,W.jsx)(`input`,{type:t,"data-slot":`input`,className:q(`h-9 w-full min-w-0 rounded-xl border border-transparent bg-muted/60 px-3 py-1 text-base transition-[color,box-shadow,border-color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-foreground/40 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function of({...e}){return(0,W.jsx)(zd,{"data-slot":`dialog`,...e})}function sf({...e}){return(0,W.jsx)(Bd,{"data-slot":`dialog-trigger`,...e})}function cf({...e}){return(0,W.jsx)(Vd,{"data-slot":`dialog-portal`,...e})}function lf({className:e,...t}){return(0,W.jsx)(Hd,{"data-slot":`dialog-overlay`,className:q(`fixed inset-0 isolate z-50 bg-black/55 duration-180 motion-reduce:animate-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0`,e),...t})}function uf({className:e,children:t,showCloseButton:n=!0,...r}){return(0,W.jsxs)(cf,{children:[(0,W.jsx)(lf,{}),(0,W.jsxs)(Ud,{"data-slot":`dialog-content`,className:q(`fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] overflow-y-auto overscroll-contain -translate-x-1/2 -translate-y-1/2 gap-6 rounded-3xl border-0 bg-popover p-6 text-sm text-popover-foreground shadow-xl duration-180 motion-reduce:animate-none outline-none sm:max-w-md data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-[0.98] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-[0.98]`,e),...r,children:[t,n&&(0,W.jsx)(Kd,{"data-slot":`dialog-close`,asChild:!0,children:(0,W.jsxs)(J,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`,children:[(0,W.jsx)(Po,{className:`size-4`}),(0,W.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function df({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`dialog-header`,className:q(`flex flex-col gap-1.5 pr-8`,e),...t})}function ff({className:e,showCloseButton:t=!1,children:n,...r}){return(0,W.jsxs)(`div`,{"data-slot":`dialog-footer`,className:q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,W.jsx)(Kd,{asChild:!0,children:(0,W.jsx)(J,{variant:`outline`,children:`Close`})})]})}function pf({className:e,...t}){return(0,W.jsx)(Wd,{"data-slot":`dialog-title`,className:q(`font-sans text-base leading-none font-medium`,e),...t})}function mf({className:e,...t}){return(0,W.jsx)(Gd,{"data-slot":`dialog-description`,className:q(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}var hf=S.createContext(void 0);function gf(e){let t=S.useContext(hf);return e||t||`ltr`}function _f(e,[t,n]){return Math.min(n,Math.max(t,e))}function vf(e,t){return S.useReducer((e,n)=>t[e][n]??e,e)}var yf=`ScrollArea`,[bf,xf]=Ic(yf),[Sf,Cf]=bf(yf),wf=S.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=S.useState(null),[l,u]=S.useState(null),[d,f]=S.useState(null),[p,m]=S.useState(null),[h,g]=S.useState(null),[_,v]=S.useState(0),[y,b]=S.useState(0),[x,C]=S.useState(!1),[w,T]=S.useState(!1),E=xc(t,e=>c(e)),D=gf(i);return(0,W.jsx)(Sf,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,W.jsx)($c.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});wf.displayName=yf;var Tf=`ScrollAreaViewport`,Ef=S.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Cf(Tf,n),s=xc(t,S.useRef(null),o.onViewportChange);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,W.jsx)($c.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,W.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});Ef.displayName=Tf;var Df=`ScrollAreaScrollbar`,Of=S.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Cf(Df,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return S.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,W.jsx)(kf,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,W.jsx)(Af,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,W.jsx)(jf,{...r,ref:t,forceMount:n}):i.type===`always`?(0,W.jsx)(Mf,{...r,ref:t}):null});Of.displayName=Df;var kf=S.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Cf(Df,e.__scopeScrollArea),[a,o]=S.useState(!1);return S.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,W.jsx)(Fl,{present:n||a,children:(0,W.jsx)(jf,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),Af=S.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Cf(Df,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=Qf(()=>c(`SCROLL_END`),100),[s,c]=vf(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return S.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),S.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,W.jsx)(Fl,{present:n||s!==`hidden`,children:(0,W.jsx)(Mf,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Pc(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Pc(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),jf=S.forwardRef((e,t)=>{let n=Cf(Df,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=S.useState(!1),s=e.orientation===`horizontal`,c=Qf(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return $f(n.viewport,c),$f(n.content,c),(0,W.jsx)(Fl,{present:r||a,children:(0,W.jsx)(Mf,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),Mf=S.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=Cf(Df,e.__scopeScrollArea),a=S.useRef(null),o=S.useRef(0),[s,c]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Gf(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return qf(e,o.current,s,t)}return n===`horizontal`?(0,W.jsx)(Nf,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Jf(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,W.jsx)(Pf,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Jf(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),Nf=S.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=Cf(Df,e.__scopeScrollArea),[o,s]=S.useState(),c=S.useRef(null),l=xc(t,c,a.onScrollbarXChange);return S.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,W.jsx)(Lf,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":Kf(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Xf(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Wf(o.paddingLeft),paddingEnd:Wf(o.paddingRight)}})}})}),Pf=S.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=Cf(Df,e.__scopeScrollArea),[o,s]=S.useState(),c=S.useRef(null),l=xc(t,c,a.onScrollbarYChange);return S.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,W.jsx)(Lf,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":Kf(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Xf(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Wf(o.paddingTop),paddingEnd:Wf(o.paddingBottom)}})}})}),[Ff,If]=bf(Df),Lf=S.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=Cf(Df,n),[m,h]=S.useState(null),g=xc(t,e=>h(e)),_=S.useRef(null),v=S.useRef(``),y=p.viewport,b=r.content-r.viewport,x=tl(u),C=tl(c),w=Qf(d,10);function T(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return S.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),S.useEffect(C,[r,C]),$f(m,w),$f(p.content,w),(0,W.jsx)(Ff,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:tl(a),onThumbPointerUp:tl(o),onThumbPositionChange:C,onThumbPointerDown:tl(s),children:(0,W.jsx)($c.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:Pc(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:Pc(e.onPointerMove,T),onPointerUp:Pc(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),Rf=`ScrollAreaThumb`,zf=S.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=If(Rf,e.__scopeScrollArea);return(0,W.jsx)(Fl,{present:n||i.hasThumb,children:(0,W.jsx)(Bf,{ref:t,...r})})}),Bf=S.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=Cf(Rf,n),o=If(Rf,n),{onThumbPositionChange:s}=o,c=xc(t,e=>o.onThumbChange(e)),l=S.useRef(void 0),u=Qf(()=>{l.current&&=(l.current(),void 0)},100);return S.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{if(u(),!l.current){let t=Zf(e,s);l.current=t,s()}};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,W.jsx)($c.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Pc(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Pc(e.onPointerUp,o.onThumbPointerUp)})});zf.displayName=Rf;var Vf=`ScrollAreaCorner`,Hf=S.forwardRef((e,t)=>{let n=Cf(Vf,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,W.jsx)(Uf,{...e,ref:t}):null});Hf.displayName=Vf;var Uf=S.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=Cf(Vf,n),[a,o]=S.useState(0),[s,c]=S.useState(0),l=!!(a&&s);return $f(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),$f(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,W.jsx)($c.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function Wf(e){return e?parseInt(e,10):0}function Gf(e,t){let n=e/t;return isNaN(n)?0:n}function Kf(e){let t=Gf(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function qf(e,t,n,r=`ltr`){let i=Kf(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Yf([c,l],d)(e)}function Jf(e,t,n=`ltr`){let r=Kf(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=_f(e,n===`ltr`?[0,o]:[o*-1,0]);return Yf([0,o],[0,s])(c)}function Yf(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Xf(e,t){return e>0&&e<t}var Zf=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function Qf(e,t){let n=tl(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function $f(e,t){let n=tl(t);Rc(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var ep=wf,tp=Ef,np=Hf;function rp({className:e,children:t,...n}){return(0,W.jsxs)(ep,{"data-slot":`scroll-area`,className:q(`relative`,e),...n,children:[(0,W.jsx)(tp,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] duration-150 motion-reduce:transition-none outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,W.jsx)(ip,{}),(0,W.jsx)(np,{})]})}function ip({className:e,orientation:t=`vertical`,...n}){return(0,W.jsx)(Of,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:q(`flex touch-none p-px transition-colors duration-150 motion-reduce:transition-none select-none data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col data-[orientation=horizontal]:border-t data-[orientation=horizontal]:border-t-transparent data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2.5 data-[orientation=vertical]:border-l data-[orientation=vertical]:border-l-transparent`,e),...n,children:(0,W.jsx)(zf,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-muted-foreground/25 hover:bg-muted-foreground/40`})})}var ap=[`Actions`,`Pages`,`Findings`,`Audits`];function op({open:e,onOpenChange:t,dashboard:n,scans:r}){let i=rt(),a=et(),o=Vr(),[s,c]=(0,S.useState)(``),l=(0,S.useDeferredValue)(s),u=a.pathname.match(/^\/(?:threads|findings)\/([^/]+)/)?.[1]??null,d=a.pathname.match(/^\/(?:runs|scans)\/([^/]+)/)?.[1]??null,f=ni({queryKey:[`finding-family`,u],queryFn:()=>mi(u),enabled:e&&!!u}),p=ri({mutationFn:({triageStatus:e,triageNote:t})=>hi(u,e,t),onSuccess:async()=>{await Promise.all([o.invalidateQueries({queryKey:[`dashboard`]}),o.invalidateQueries({queryKey:[`finding-family`,u]})])}}),m=(0,S.useMemo)(()=>{let e=[{id:`page-console`,group:`Pages`,label:`Chat`,meta:`Chat with 0`,icon:Xa,keywords:[`chat operator workspace session scope approvals console`],run:()=>i(`/console`)},{id:`new-console`,group:`Actions`,label:`New chat`,meta:`Start a new conversation`,icon:Xa,keywords:[`new conversation chat audit session`],run:()=>i(`/console?new=1`)},...[[`setup`,`Setup`,`Connect a model and pick a project`],[`connections`,`Connections`,`API keys and accounts`],[`models`,`Models`,`Choose which models 0 uses`],[`settings`,`Settings`,`Preferences, shortcuts, appearance`],[`plugins`,`Plugins`,`Add and manage extensions`],[`doctor`,`Diagnostics`,`Check that everything works`],[`tools`,`Tools`,`What 0 can use`],[`project`,`Project`,`Target and permissions`],[`fix`,`Fix`,`Review and apply a code fix`]].map(([e,t,n])=>({id:`control-${e}`,group:`Pages`,label:t,meta:n,icon:e===`settings`?mo:xo,keywords:[e,t],run:()=>{let t=a.pathname.match(/^\/console\/([^/]+)/)?.[1];i(`/${e}${t?`?session=${encodeURIComponent(t)}&return=${encodeURIComponent(a.pathname)}`:``}`)}})),{id:`page-findings`,group:`Pages`,label:`Findings`,meta:`Issues 0 found`,icon:ja,keywords:[`findings families review evidence console handoff`],run:()=>i(`/findings`)},{id:`page-control`,group:`Pages`,label:`Overview`,meta:`What 0 is doing`,icon:Wa,keywords:[`operations dashboard overview workers queue`],run:()=>i(`/dashboard`)},{id:`page-scans`,group:`Pages`,label:`Workflows`,meta:`Create and run security workflows`,icon:ga,keywords:[`workflows automations agents audit security review scans`],run:()=>i(`/workflows`)}],t=f.data?.latest.id;t&&e.unshift({id:`finding-console`,group:`Actions`,label:`Investigate this finding`,meta:`Open it in a new chat`,icon:Xa,keywords:[`finding investigate console chat focus evidence`],run:()=>i(`/console?finding=${encodeURIComponent(t)}&intent=investigate`)},{id:`finding-impact`,group:`Actions`,label:`View impact`,meta:`See how serious this finding is`,icon:ja,keywords:[`finding impact assessment stored`],run:()=>i(`/console?finding=${encodeURIComponent(t)}&intent=impact`)}),u&&e.unshift({id:`triage-accept`,group:`Actions`,label:`Accept finding`,meta:`Mark as real`,icon:go,keywords:[`accept finding triage`],shortcut:`Enter`,run:()=>p.mutate({triageStatus:`accepted`,triageNote:f.data?.latest.triageNote??``})},{id:`triage-suppress`,group:`Actions`,label:`Dismiss finding`,meta:`Hide it from the list`,icon:_o,keywords:[`suppress finding triage`],shortcut:`Shift+S`,run:()=>p.mutate({triageStatus:`suppressed`,triageNote:f.data?.latest.triageNote??``})}),d&&e.unshift({id:`scan-detail`,group:`Actions`,label:`Open this audit`,meta:`Audit report`,icon:ga,keywords:[`scan timeline detail current`],run:()=>i(`/runs/${d}`)});for(let t of n?.groups.slice(0,14)??[])e.push({id:`finding-${t.fingerprint}`,group:`Findings`,label:t.latest.title,meta:`${t.latest.severity} · ${t.latest.triageStatus}`,icon:ja,keywords:[t.latest.title,t.latest.category,t.latest.severity,t.latest.triageStatus],run:()=>i(`/findings/${t.fingerprint}`)});for(let t of r?.slice(0,14)??[])e.push({id:`scan-${t.id}`,group:`Audits`,label:t.target,meta:t.status,icon:ga,keywords:[t.target,t.status,t.depth,t.runtime,t.mode],run:()=>i(`/runs/${t.id}`)});return e},[n?.groups,i,o,r,u,f.data?.latest.triageNote,a.pathname,f.data?.latest.id,d,p]),h=(0,S.useMemo)(()=>{let e=l.trim().toLowerCase();return e?m.filter(t=>[t.label,t.meta,...t.keywords].join(` `).toLowerCase().includes(e)):m},[l,m]);return(0,S.useEffect)(()=>{e||c(``)},[e]),(0,W.jsx)(of,{open:e,onOpenChange:t,children:(0,W.jsxs)(uf,{className:`overflow-hidden p-0 sm:max-w-2xl`,showCloseButton:!1,children:[(0,W.jsxs)(df,{className:`sr-only`,children:[(0,W.jsx)(pf,{children:`Commands`}),(0,W.jsx)(mf,{children:`Go to a page, run or finding.`})]}),(0,W.jsx)(`div`,{className:`border-b border-border px-4 py-3`,children:(0,W.jsx)(af,{autoFocus:!0,value:s,onChange:e=>c(e.target.value),placeholder:`Search pages, runs, findings…`,"aria-label":`Search commands`})}),(0,W.jsx)(rp,{className:`max-h-[60vh]`,children:(0,W.jsxs)(`div`,{className:`space-y-1 p-2`,children:[ap.map(e=>{let n=h.filter(t=>t.group===e);return n.length===0?null:(0,W.jsxs)(`section`,{className:`space-y-1`,children:[(0,W.jsx)(`div`,{className:`px-3 py-2 text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground`,children:e}),n.map(e=>(0,W.jsxs)(`button`,{type:`button`,onClick:()=>{e.run(),t(!1)},className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left transition-colors hover:bg-accent`,children:[(0,W.jsx)(`div`,{className:`inline-flex size-9 items-center justify-center rounded-md border border-border bg-muted text-primary-text`,children:(0,W.jsx)(e.icon,{className:`size-4`})}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`font-medium text-foreground`,children:e.label}),e.group!==`Pages`&&(0,W.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.meta})]}),e.shortcut?(0,W.jsx)(`div`,{className:`text-xs tracking-widest text-muted-foreground`,children:e.shortcut}):null]},e.id))]},e)}),h.length===0?(0,W.jsx)(`div`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:`No results.`}):null]})})]})})}function sp({className:e,size:t=`default`,...n}){return(0,W.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:q(`group/card flex flex-col gap-6 overflow-hidden rounded-3xl border border-border/40 bg-card py-6 text-sm text-card-foreground has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-3xl *:[img:last-child]:rounded-b-3xl`,e),...n})}function cp({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-header`,className:q(`group/card-header @container/card-header grid auto-rows-min items-start gap-1.5 rounded-t-3xl px-6 group-data-[size=sm]/card:px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4`,e),...t})}function lp({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-title`,className:q(`font-sans text-base font-medium`,e),...t})}function up({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function dp({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-content`,className:q(`px-6 group-data-[size=sm]/card:px-4`,e),...t})}function fp({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-list`,className:q(`divide-y divide-border/30`,e),...t})}var pp=vc(`px-4 py-3 text-sm transition-colors duration-150 motion-reduce:transition-none`,{variants:{interactive:{true:`hover:bg-muted/60 hover:text-foreground`,false:``},selected:{true:`bg-muted text-foreground`,false:``}},defaultVariants:{interactive:!1,selected:!1}});function mp({className:e,interactive:t,selected:n,...r}){return(0,W.jsx)(`div`,{"data-slot":`card-list-item`,className:q(pp({interactive:t,selected:n}),e),...r})}function hp({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`card-empty`,className:q(`rounded-3xl bg-muted/30 px-4 py-10 text-center text-sm text-muted-foreground`,e),...t})}function gp({label:e}){return(0,W.jsx)(sp,{className:`border border-border`,children:(0,W.jsxs)(dp,{className:`flex min-h-[10rem] flex-col items-center justify-center gap-4 text-center`,children:[(0,W.jsx)(qa,{className:`size-8 animate-spin text-primary-text`}),(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:e})})]})})}function _p({title:e,body:t,action:n}){return(0,W.jsx)(sp,{className:`border border-dashed border-border bg-muted/20`,children:(0,W.jsxs)(dp,{className:`flex min-h-[10rem] flex-col items-center justify-center gap-3 text-center`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(lp,{children:e}),t?(0,W.jsx)(up,{children:t}):null]}),n??null]})})}function vp({error:e}){return(0,W.jsx)(sp,{className:`border border-destructive/25`,children:(0,W.jsxs)(dp,{className:`flex min-h-[10rem] flex-col items-center justify-center gap-4 text-center`,children:[(0,W.jsx)(Oo,{className:`size-8 text-destructive`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(lp,{children:`Something went wrong`}),(0,W.jsx)(up,{children:e.message})]})]})})}function yp(e){let t=e+`CollectionProvider`,[n,r]=Ic(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=S.useRef(null),a=S.useRef(new Map).current;return(0,W.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=qc(s),l=S.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=xc(t,a(s,n).collectionRef);return(0,W.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=qc(u),p=S.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=S.useRef(null),s=xc(t,o),c=a(u,n);return S.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,W.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return S.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var bp=`rovingFocusGroup.onEntryFocus`,xp={bubbles:!1,cancelable:!0},Sp=`RovingFocusGroup`,[Cp,wp,Tp]=yp(Sp),[Ep,Dp]=Ic(Sp,[Tp]),[Op,kp]=Ep(Sp),Ap=S.forwardRef((e,t)=>(0,W.jsx)(Cp.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(Cp.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(jp,{...e,ref:t})})}));Ap.displayName=Sp;var jp=S.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=S.useRef(null),p=xc(t,f),m=gf(a),[h,g]=Uc({prop:o,defaultProp:s??null,onChange:c,caller:Sp}),[_,v]=S.useState(!1),y=tl(l),b=wp(n),x=S.useRef(!1),[C,w]=S.useState(0);return S.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(bp,y),()=>e.removeEventListener(bp,y)},[y]),(0,W.jsx)(Op,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:S.useCallback(e=>g(e),[g]),onItemShiftTab:S.useCallback(()=>v(!0),[]),onFocusableItemAdd:S.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:S.useCallback(()=>w(e=>e-1),[]),children:(0,W.jsx)($c.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Pc(e.onMouseDown,()=>{x.current=!0}),onFocus:Pc(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(bp,xp);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Lp([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:Pc(e.onBlur,()=>v(!1))})})}),Mp=`RovingFocusGroupItem`,Np=S.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Vc(),l=a||c,u=kp(Mp,n),d=u.currentTabStopId===l,f=wp(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return S.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,W.jsx)(Cp.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,W.jsx)($c.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Pc(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Pc(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Pc(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ip(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Rp(n,r+1):n.slice(r+1)}setTimeout(()=>Lp(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Np.displayName=Mp;var Pp={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Fp(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Ip(e,t,n){let r=Fp(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Pp[r]}function Lp(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Rp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var zp=Ap,Bp=Np,Vp=`Tabs`,[Hp,Up]=Ic(Vp,[Dp]),Wp=Dp(),[Gp,Kp]=Hp(Vp),qp=S.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=gf(s),[d,f]=Uc({prop:r,onChange:i,defaultProp:a??``,caller:Vp});return(0,W.jsx)(Gp,{scope:n,baseId:Vc(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,W.jsx)($c.div,{dir:u,"data-orientation":o,...l,ref:t})})});qp.displayName=Vp;var Jp=`TabsList`,Yp=S.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Kp(Jp,n),o=Wp(n);return(0,W.jsx)(zp,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,W.jsx)($c.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Yp.displayName=Jp;var Xp=`TabsTrigger`,Zp=S.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Kp(Xp,n),s=Wp(n),c=em(o.baseId,r),l=tm(o.baseId,r),u=r===o.value;return(0,W.jsx)(Bp,{asChild:!0,...s,focusable:!i,active:u,children:(0,W.jsx)($c.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Pc(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Pc(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Pc(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});Zp.displayName=Xp;var Qp=`TabsContent`,$p=S.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Kp(Qp,n),c=em(s.baseId,r),l=tm(s.baseId,r),u=r===s.value,d=S.useRef(u);return S.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,W.jsx)(Fl,{present:i||u,children:({present:n})=>(0,W.jsx)($c.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});$p.displayName=Qp;function em(e,t){return`${e}-trigger-${t}`}function tm(e,t){return`${e}-content-${t}`}var nm=qp,rm=Yp,im=Zp,am=$p;function om({className:e,orientation:t=`horizontal`,...n}){return(0,W.jsx)(nm,{"data-slot":`tabs`,"data-orientation":t,className:q(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var sm=vc(`group/tabs-list inline-flex w-fit items-center justify-center rounded-full bg-muted/40 p-1 text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col group-data-[orientation=vertical]/tabs:rounded-2xl data-[variant=line]:rounded-none data-[variant=line]:border-0 data-[variant=line]:bg-transparent data-[variant=line]:p-0`,{variants:{variant:{default:``,line:`gap-1`}},defaultVariants:{variant:`default`}});function cm({className:e,variant:t=`default`,...n}){return(0,W.jsx)(rm,{"data-slot":`tabs-list`,"data-variant":t,className:q(sm({variant:t}),e),...n})}function lm({className:e,...t}){return(0,W.jsx)(im,{"data-slot":`tabs-trigger`,className:q(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-2 rounded-full border border-transparent px-3 py-1 text-sm font-medium whitespace-nowrap text-foreground/70 transition-[background-color,border-color,color] duration-150 motion-reduce:transition-none group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start group-data-[orientation=vertical]/tabs:rounded-xl group-data-[orientation=vertical]/tabs:px-3 group-data-[orientation=vertical]/tabs:py-1.5 hover:text-foreground focus-visible:border-ring/50 focus-visible:ring-2 focus-visible:ring-ring/15 disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:rounded-none group-data-[variant=line]/tabs-list:px-2 group-data-[variant=line]/tabs-list:py-2 group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:border-transparent data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:bg-card`,`after:absolute after:bg-primary after:opacity-0 after:transition-opacity motion-reduce:after:transition-none group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function um({className:e,...t}){return(0,W.jsx)(am,{"data-slot":`tabs-content`,className:q(`flex-1 text-sm outline-none`,e),...t})}function dm({request:e,response:t,analysis:n}){return(0,W.jsxs)(om,{defaultValue:`request`,className:`space-y-4`,children:[(0,W.jsx)(cm,{children:[[`request`,`Request`],[`response`,`Response`],[`analysis`,`Analysis`]].map(([e,t])=>(0,W.jsx)(lm,{value:e,children:t},e))}),(0,W.jsx)(um,{value:`request`,children:(0,W.jsx)(sp,{children:(0,W.jsx)(dp,{className:`p-4`,children:(0,W.jsx)(`pre`,{className:`text-sm leading-6 text-muted-foreground`,children:e})})})}),(0,W.jsx)(um,{value:`response`,children:(0,W.jsx)(sp,{children:(0,W.jsx)(dp,{className:`p-4`,children:(0,W.jsx)(`pre`,{className:`text-sm leading-6 text-muted-foreground`,children:t})})})}),(0,W.jsx)(um,{value:`analysis`,children:(0,W.jsx)(sp,{children:(0,W.jsx)(dp,{className:`p-4`,children:(0,W.jsx)(`pre`,{className:`text-sm leading-6 text-muted-foreground`,children:n??`No analysis yet.`})})})})]})}function fm(){var e=[...arguments];return(0,S.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var pm=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function mm(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function hm(e){return`nodeType`in e}function gm(e){return e?mm(e)?e:hm(e)?e.ownerDocument?.defaultView??window:window:window}function _m(e){let{Document:t}=gm(e);return e instanceof t}function vm(e){return!mm(e)&&e instanceof gm(e).HTMLElement}function ym(e){return e instanceof gm(e).SVGElement}function bm(e){return e?mm(e)?e.document:hm(e)?_m(e)?e:vm(e)||ym(e)?e.ownerDocument:document:document:document}var xm=pm?S.useLayoutEffect:S.useEffect;function Sm(e){let t=(0,S.useRef)(e);return xm(()=>{t.current=e}),(0,S.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Cm(){let e=(0,S.useRef)(null);return[(0,S.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,S.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function wm(e,t){t===void 0&&(t=[e]);let n=(0,S.useRef)(e);return xm(()=>{n.current!==e&&(n.current=e)},t),n}function Tm(e,t){let n=(0,S.useRef)();return(0,S.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Em(e){let t=Sm(e),n=(0,S.useRef)(null);return[n,(0,S.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Dm(e){let t=(0,S.useRef)();return(0,S.useEffect)(()=>{t.current=e},[e]),t.current}var Om={};function km(e,t){return(0,S.useMemo)(()=>{if(t)return t;let n=Om[e]==null?0:Om[e]+1;return Om[e]=n,e+`-`+n},[e,t])}function Am(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var jm=Am(1),Mm=Am(-1);function Nm(e){return`clientX`in e&&`clientY`in e}function Pm(e){if(!e)return!1;let{KeyboardEvent:t}=gm(e.target);return t&&e instanceof t}function Fm(e){if(!e)return!1;let{TouchEvent:t}=gm(e.target);return t&&e instanceof t}function Im(e){if(Fm(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Nm(e)?{x:e.clientX,y:e.clientY}:null}var Lm=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[Lm.Translate.toString(e),Lm.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Rm=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function zm(e){return e.matches(Rm)?e:e.querySelector(Rm)}var Bm={display:`none`};function Vm(e){let{id:t,value:n}=e;return S.createElement(`div`,{id:t,style:Bm},n)}function Hm(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return S.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Um(){let[e,t]=(0,S.useState)(``);return{announce:(0,S.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Wm=(0,S.createContext)(null);function Gm(e){let t=(0,S.useContext)(Wm);(0,S.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Km(){let[e]=(0,S.useState)(()=>new Set),t=(0,S.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,S.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var qm={draggable:`
56
+ To pick up a draggable item, press the space bar.
57
+ While dragging, use the arrow keys to move the item.
58
+ Press space again to drop the item in its new position, or press escape to cancel.
59
+ `},Jm={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Ym(e){let{announcements:t=Jm,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=qm}=e,{announce:a,announcement:o}=Um(),s=km(`DndLiveRegion`),[c,l]=(0,S.useState)(!1);if((0,S.useEffect)(()=>{l(!0)},[]),Gm((0,S.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=S.createElement(S.Fragment,null,S.createElement(Vm,{id:r,value:i.draggable}),S.createElement(Hm,{id:s,announcement:o}));return n?(0,Kc.createPortal)(u,n):u}var Xm;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(Xm||={});function Zm(){}function Qm(e,t){return(0,S.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function $m(){var e=[...arguments];return(0,S.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var eh=Object.freeze({x:0,y:0});function th(e,t){let n=Im(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function nh(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function rh(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function ih(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var ah=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=ih(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(nh)};function oh(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function sh(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:eh}function ch(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var lh=ch(1);function uh(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function dh(e,t,n){let r=uh(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var fh={ignoreTransform:!1};function ph(e,t){t===void 0&&(t=fh);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=gm(e).getComputedStyle(e);t&&(n=dh(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function mh(e){return ph(e,{ignoreTransform:!0})}function hh(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function gh(e,t){return t===void 0&&(t=gm(e).getComputedStyle(e)),t.position===`fixed`}function _h(e,t){t===void 0&&(t=gm(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function vh(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(_m(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!vm(i)||ym(i)||n.includes(i))return n;let a=gm(e).getComputedStyle(i);return i!==e&&_h(i,a)&&n.push(i),gh(i,a)?n:r(i.parentNode)}return e?r(e):n}function yh(e){let[t]=vh(e,1);return t??null}function bh(e){return!pm||!e?null:mm(e)?e:hm(e)?_m(e)||e===bm(e).scrollingElement?window:vm(e)?e:null:null}function xh(e){return mm(e)?e.scrollX:e.scrollLeft}function Sh(e){return mm(e)?e.scrollY:e.scrollTop}function Ch(e){return{x:xh(e),y:Sh(e)}}var wh;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(wh||={});function Th(e){return!pm||!e?!1:e===document.scrollingElement}function Eh(e){let t={x:0,y:0},n=Th(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Dh={x:.2,y:.2};function Oh(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Dh);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Eh(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=wh.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=wh.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=wh.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=wh.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function kh(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ah(e){return e.reduce((e,t)=>jm(e,Ch(t)),eh)}function jh(e){return e.reduce((e,t)=>e+xh(t),0)}function Mh(e){return e.reduce((e,t)=>e+Sh(t),0)}function Nh(e,t){if(t===void 0&&(t=ph),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);yh(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Ph=[[`x`,[`left`,`right`],jh],[`y`,[`top`,`bottom`],Mh]],Fh=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=vh(t),r=Ah(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Ph)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Ih=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Lh(e){let{EventTarget:t}=gm(e);return e instanceof t?e:bm(e)}function Rh(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var zh;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(zh||={});function Bh(e){e.preventDefault()}function Vh(e){e.stopPropagation()}var Hh;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(Hh||={});var Uh={start:[Hh.Space,Hh.Enter],cancel:[Hh.Esc],end:[Hh.Space,Hh.Enter,Hh.Tab]},Wh=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Hh.Right:return{...n,x:n.x+25};case Hh.Left:return{...n,x:n.x-25};case Hh.Down:return{...n,y:n.y+25};case Hh.Up:return{...n,y:n.y-25}}},Gh=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Ih(bm(t)),this.windowListeners=new Ih(gm(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(zh.Resize,this.handleCancel),this.windowListeners.add(zh.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(zh.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Nh(n),t(eh)}handleKeyDown(e){if(Pm(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=Uh,coordinateGetter:a=Wh,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:eh;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Mm(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Eh(n),p=kh(n),m={x:Math.min(i===Hh.Right?p.right-p.width/2:p.right,Math.max(i===Hh.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Hh.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Hh.Down?p.top:p.top+p.height/2,u.y))},h=i===Hh.Right&&!s||i===Hh.Left&&!c,g=i===Hh.Down&&!l||i===Hh.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Hh.Right&&e<=d.x||i===Hh.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===Hh.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Hh.Down&&e<=d.y||i===Hh.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===Hh.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,jm(Mm(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Gh.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=Uh,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Kh(e){return!!(e&&`distance`in e)}function qh(e){return!!(e&&`delay`in e)}var Jh=class{constructor(e,t,n){n===void 0&&(n=Lh(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=bm(i),this.documentListeners=new Ih(this.document),this.listeners=new Ih(n),this.windowListeners=new Ih(gm(i)),this.initialCoordinates=Im(r)??eh,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(zh.Resize,this.handleCancel),this.windowListeners.add(zh.DragStart,Bh),this.windowListeners.add(zh.VisibilityChange,this.handleCancel),this.windowListeners.add(zh.ContextMenu,Bh),this.documentListeners.add(zh.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qh(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Kh(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(zh.Click,Vh,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(zh.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Im(e)??eh,s=Mm(n,o);if(!t&&a){if(Kh(a)){if(a.tolerance!=null&&Rh(s,a.tolerance))return this.handleCancel();if(Rh(s,a.distance))return this.handleStart()}if(qh(a)&&Rh(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Hh.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Yh={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Xh=class extends Jh{constructor(e){let{event:t}=e,n=bm(t.target);super(e,Yh,n)}};Xh.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Zh={move:{name:`mousemove`},end:{name:`mouseup`}},Qh;(function(e){e[e.RightClick=2]=`RightClick`})(Qh||={});var $h=class extends Jh{constructor(e){super(e,Zh,bm(e.event.target))}};$h.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==Qh.RightClick&&(r?.({event:n}),!0)}}];var eg={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},tg=class extends Jh{constructor(e){super(e,eg)}static setup(){return window.addEventListener(eg.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(eg.move.name,e)};function e(){}}};tg.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var ng;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(ng||={});var rg;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(rg||={});function ig(e){let{acceleration:t,activator:n=ng.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=rg.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=og({delta:d,disabled:!a}),[m,h]=Cm(),g=(0,S.useRef)({x:0,y:0}),_=(0,S.useRef)({x:0,y:0}),v=(0,S.useMemo)(()=>{switch(n){case ng.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ng.DraggableRect:return i}},[n,i,c]),y=(0,S.useRef)(null),b=(0,S.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,S.useMemo)(()=>s===rg.TreeOrder?[...l].reverse():l,[s,l]);(0,S.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=Oh(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var ag={x:{[wh.Backward]:!1,[wh.Forward]:!1},y:{[wh.Backward]:!1,[wh.Forward]:!1}};function og(e){let{delta:t,disabled:n}=e,r=Dm(t);return Tm(e=>{if(n||!r||!e)return ag;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[wh.Backward]:e.x[wh.Backward]||i.x===-1,[wh.Forward]:e.x[wh.Forward]||i.x===1},y:{[wh.Backward]:e.y[wh.Backward]||i.y===-1,[wh.Forward]:e.y[wh.Forward]||i.y===1}}},[n,t,r])}function sg(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Tm(e=>t==null?null:r??e??null,[r,t])}function cg(e,t){return(0,S.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var lg;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(lg||={});var ug;(function(e){e.Optimized=`optimized`})(ug||={});var dg=new Map;function fg(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,S.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,S.useRef)(e),d=g(),f=wm(d),p=(0,S.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,S.useRef)(null),h=Tm(t=>{if(d&&!n)return dg;if(!t||t===dg||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Fh(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,S.useEffect)(()=>{u.current=e},[e]),(0,S.useEffect)(()=>{d||p()},[n,d]),(0,S.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,S.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case lg.Always:return!1;case lg.BeforeDragging:return n;default:return!n}}}function pg(e,t){return Tm(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function mg(e,t){return pg(e,t)}function hg(e){let{callback:t,disabled:n}=e,r=Sm(t),i=(0,S.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,S.useEffect)(()=>()=>i?.disconnect(),[i]),i}function gg(e){let{callback:t,disabled:n}=e,r=Sm(t),i=(0,S.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,S.useEffect)(()=>()=>i?.disconnect(),[i]),i}function _g(e){return new Fh(ph(e),e)}function vg(e,t,n){t===void 0&&(t=_g);let[r,i]=(0,S.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=hg({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=gg({callback:a});return xm(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function yg(e){return sh(e,pg(e))}var bg=[];function xg(e){let t=(0,S.useRef)(e),n=Tm(n=>e?n&&n!==bg&&e&&t.current&&e.parentNode===t.current.parentNode?n:vh(e):bg,[e]);return(0,S.useEffect)(()=>{t.current=e},[e]),n}function Sg(e){let[t,n]=(0,S.useState)(null),r=(0,S.useRef)(e),i=(0,S.useCallback)(e=>{let t=bh(e.target);t&&n(e=>e?(e.set(t,Ch(t)),new Map(e)):null)},[]);return(0,S.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=bh(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,Ch(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{bh(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,S.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>jm(e,t),eh):Ah(e):eh,[e,t])}function Cg(e,t){t===void 0&&(t=[]);let n=(0,S.useRef)(null);return(0,S.useEffect)(()=>{n.current=null},t),(0,S.useEffect)(()=>{let t=e!==eh;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Mm(e,n.current):eh}function wg(e){(0,S.useEffect)(()=>{if(!pm)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function Tg(e,t){return(0,S.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function Eg(e){return(0,S.useMemo)(()=>e?hh(e):null,[e])}var Dg=[];function Og(e,t){t===void 0&&(t=ph);let[n]=e,r=Eg(n?gm(n):null),[i,a]=(0,S.useState)(Dg);function o(){a(()=>e.length?e.map(e=>Th(e)?r:new Fh(t(e),e)):Dg)}let s=gg({callback:o});return xm(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function kg(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return vm(t)?t:e}function Ag(e){let{measure:t}=e,[n,r]=(0,S.useState)(null),i=gg({callback:(0,S.useCallback)(e=>{for(let{target:n}of e)if(vm(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=Em((0,S.useCallback)(e=>{let n=kg(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,S.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var jg=[{sensor:Xh,options:{}},{sensor:Gh,options:{}}],Mg={current:{}},Ng={draggable:{measure:mh},droppable:{measure:mh,strategy:lg.WhileDragging,frequency:ug.Optimized},dragOverlay:{measure:ph}},Pg=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Fg={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Pg,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Zm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ng,measureDroppableContainers:Zm,windowRect:null,measuringScheduled:!1},Ig={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Zm,draggableNodes:new Map,over:null,measureDroppableContainers:Zm},Lg=(0,S.createContext)(Ig),Rg=(0,S.createContext)(Fg);function zg(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pg}}}function Bg(e,t){switch(t.type){case Xm.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Xm.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Xm.DragEnd:case Xm.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xm.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Pg(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Xm.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Pg(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Xm.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Pg(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Vg(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,S.useContext)(Lg),a=Dm(r),o=Dm(n?.id);return(0,S.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!Pm(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=zm(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Hg(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Ug(e){return(0,S.useMemo)(()=>({draggable:{...Ng.draggable,...e?.draggable},droppable:{...Ng.droppable,...e?.droppable},dragOverlay:{...Ng.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Wg(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,S.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;xm(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=sh(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=yh(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Gg=(0,S.createContext)({...eh,scaleX:1,scaleY:1}),Kg;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Kg||={});var qg=(0,S.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=jg,collisionDetection:o=ah,measuring:s,modifiers:c,...l}=e,[u,d]=(0,S.useReducer)(Bg,void 0,zg),[f,p]=Km(),[m,h]=(0,S.useState)(Kg.Uninitialized),g=m===Kg.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),C=(0,S.useRef)({initial:null,translated:null}),w=(0,S.useMemo)(()=>_==null?null:{id:_,data:x?.data??Mg,rect:C},[_,x]),T=(0,S.useRef)(null),[E,D]=(0,S.useState)(null),[O,k]=(0,S.useState)(null),A=wm(l,Object.values(l)),j=km(`DndDescribedBy`,t),M=(0,S.useMemo)(()=>b.getEnabled(),[b]),N=Ug(s),{droppableRects:P,measureDroppableContainers:F,measuringScheduled:I}=fg(M,{dragging:g,dependencies:[y.x,y.y],config:N.droppable}),L=sg(v,_),R=(0,S.useMemo)(()=>O?Im(O):null,[O]),z=Ee(),ee=mg(L,N.draggable.measure);Wg({activeNode:_==null?null:v.get(_),config:z.layoutShiftCompensation,initialRect:ee,measure:N.draggable.measure});let B=vg(L,N.draggable.measure,ee),V=vg(L?L.parentElement:null),H=(0,S.useRef)({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),te=b.getNodeFor(H.current.over?.id),U=Ag({measure:N.dragOverlay.measure}),ne=U.nodeRef.current??L,re=g?U.rect??B:null,ie=!!(U.nodeRef.current&&U.rect),ae=yg(ie?null:B),oe=Eg(ne?gm(ne):null),se=xg(g?te??L:null),ce=Og(se),le=Hg(c,{transform:{x:y.x-ae.x,y:y.y-ae.y,scaleX:1,scaleY:1},activatorEvent:O,active:w,activeNodeRect:B,containerNodeRect:V,draggingNodeRect:re,over:H.current.over,overlayNodeRect:U.rect,scrollableAncestors:se,scrollableAncestorRects:ce,windowRect:oe}),ue=R?jm(R,y):null,de=Sg(se),fe=Cg(de),pe=Cg(de,[B]),me=jm(le,fe),he=re?lh(re,le):null,ge=w&&he?o({active:w,collisionRect:he,droppableRects:P,droppableContainers:M,pointerCoordinates:ue}):null,_e=rh(ge,`id`),[ve,ye]=(0,S.useState)(null),be=oh(ie?le:jm(le,pe),ve?.rect??null,B),xe=(0,S.useRef)(null),Se=(0,S.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(T.current==null)return;let i=v.get(T.current);if(!i)return;let a=e.nativeEvent,o=new n({active:T.current,activeNode:i,event:a,options:r,context:H,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=T.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:C}};(0,Kc.unstable_batchedUpdates)(()=>{r?.(i),h(Kg.Initializing),d({type:Xm.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),D(xe.current),k(a)})},onMove(e){d({type:Xm.DragMove,coordinates:e})},onEnd:s(Xm.DragEnd),onCancel:s(Xm.DragCancel)});xe.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=H.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Xm.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Xm.DragCancel)}T.current=null,(0,Kc.unstable_batchedUpdates)(()=>{d({type:e}),h(Kg.Uninitialized),ye(null),D(null),k(null),xe.current=null;let t=e===Xm.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ce=cg(a,(0,S.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(T.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},T.current=r,Se(n,t))},[v,Se]));wg(a),xm(()=>{B&&m===Kg.Initializing&&h(Kg.Initialized)},[B,m]),(0,S.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=H.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:me.x,y:me.y},over:i};(0,Kc.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[me.x,me.y]),(0,S.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=H.current;if(!e||T.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(_e),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,Kc.unstable_batchedUpdates)(()=>{ye(s),a?.(c),f({type:`onDragOver`,event:c})})},[_e]),xm(()=>{H.current={activatorEvent:O,active:w,activeNode:L,collisionRect:he,collisions:ge,droppableRects:P,draggableNodes:v,draggingNode:ne,draggingNodeRect:re,droppableContainers:b,over:ve,scrollableAncestors:se,scrollAdjustedTranslate:me},C.current={initial:re,translated:he}},[w,L,ge,he,v,ne,re,P,b,ve,se,me]),ig({...z,delta:y,draggingRect:he,pointerCoordinates:ue,scrollableAncestors:se,scrollableAncestorRects:ce});let we=(0,S.useMemo)(()=>({active:w,activeNode:L,activeNodeRect:B,activatorEvent:O,collisions:ge,containerNodeRect:V,dragOverlay:U,draggableNodes:v,droppableContainers:b,droppableRects:P,over:ve,measureDroppableContainers:F,scrollableAncestors:se,scrollableAncestorRects:ce,measuringConfiguration:N,measuringScheduled:I,windowRect:oe}),[w,L,B,O,ge,V,U,v,b,P,ve,F,se,ce,N,I,oe]),Te=(0,S.useMemo)(()=>({activatorEvent:O,activators:Ce,active:w,activeNodeRect:B,ariaDescribedById:{draggable:j},dispatch:d,draggableNodes:v,over:ve,measureDroppableContainers:F}),[O,Ce,w,B,d,j,v,ve,F]);return S.createElement(Wm.Provider,{value:p},S.createElement(Lg.Provider,{value:Te},S.createElement(Rg.Provider,{value:we},S.createElement(Gg.Provider,{value:be},i)),S.createElement(Vg,{disabled:n?.restoreFocus===!1})),S.createElement(Ym,{...n,hiddenTextDescribedById:j}));function Ee(){let e=E?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Jg=(0,S.createContext)(null),Yg=`button`,Xg=`Draggable`;function Zg(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=km(Xg),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,S.useContext)(Lg),{role:p=Yg,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,S.useContext)(g?Gg:Jg),[v,y]=Em(),[b,x]=Em(),C=Tg(o,t),w=wm(n);return xm(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:w}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,S.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===Yg?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:C,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function Qg(){return(0,S.useContext)(Rg)}var $g=`Droppable`,e_={timeout:25};function t_(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=km($g),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,S.useContext)(Lg),u=(0,S.useRef)({disabled:n}),d=(0,S.useRef)(!1),f=(0,S.useRef)(null),p=(0,S.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...e_,...i},_=wm(h??r),v=gg({callback:(0,S.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=Em((0,S.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=wm(t);return(0,S.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,S.useEffect)(()=>(s({type:Xm.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Xm.UnregisterDroppable,key:a,id:r})),[r]),(0,S.useEffect)(()=>{n!==u.current.disabled&&(s({type:Xm.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function n_(e){let{animation:t,children:n}=e,[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null),s=Dm(n);return!n&&!r&&s&&i(s),xm(()=>{if(!a)return;let e=r?.key,n=r?.props.id;if(e==null||n==null){i(null);return}Promise.resolve(t(n,a)).then(()=>{i(null)})},[t,r,a]),S.createElement(S.Fragment,null,n,r?(0,S.cloneElement)(r,{ref:o}):null)}var r_={x:0,y:0,scaleX:1,scaleY:1};function i_(e){let{children:t}=e;return S.createElement(Lg.Provider,{value:Ig},S.createElement(Gg.Provider,{value:r_},t))}var a_={position:`fixed`,touchAction:`none`},o_=e=>Pm(e)?`transform 250ms ease`:void 0,s_=(0,S.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:u=o_}=e;if(!s)return null;let d=i?l:{...l,scaleX:1,scaleY:1},f={...a_,width:s.width,height:s.height,top:s.top,left:s.left,transform:Lm.Transform.toString(d),transformOrigin:i&&r?th(r,s):void 0,transition:typeof u==`function`?u(r):u,...c};return S.createElement(n,{className:o,style:f,ref:t},a)}),c_={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Lm.Transform.toString(t)},{transform:Lm.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function l_(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Sm((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=kg(a);if(!c)return;let{transform:l}=gm(a).getComputedStyle(a),u=uh(l);if(!u)return;let d=typeof t==`function`?t:u_(t);return Nh(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}function u_(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...c_,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var d_=0;function f_(e){return(0,S.useMemo)(()=>{if(e!=null)return d_++,d_},[e])}var p_=S.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggableNodes:m,droppableContainers:h,dragOverlay:g,over:_,measuringConfiguration:v,scrollableAncestors:y,scrollableAncestorRects:b,windowRect:x}=Qg(),C=(0,S.useContext)(Gg),w=f_(d?.id),T=Hg(o,{activatorEvent:u,active:d,activeNodeRect:f,containerNodeRect:p,draggingNodeRect:g.rect,over:_,overlayNodeRect:g.rect,scrollableAncestors:y,scrollableAncestorRects:b,transform:C,windowRect:x}),E=pg(f),D=l_({config:r,draggableNodes:m,droppableContainers:h,measuringConfiguration:v}),O=E?g.setRef:void 0;return S.createElement(i_,null,S.createElement(n_,{animation:D},d&&w?S.createElement(s_,{key:w,id:d.id,ref:O,as:s,activatorEvent:u,adjustScale:t,className:c,transition:a,rect:E,style:{zIndex:l,...i},transform:T},n):null))});function m_(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function h_(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function g_(e){return e!==null&&e>=0}function __(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function v_(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var y_=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=m_(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},b_={scaleX:1,scaleY:1},x_=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...b_}:null}let s=S_(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...b_}:r<t&&r>=a?{x:0,y:o.height+s,...b_}:{x:0,y:0,...b_}};function S_(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var C_=`Sortable`,w_=S.createContext({activeIndex:-1,containerId:C_,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:y_,disabled:{draggable:!1,droppable:!1}});function T_(e){let{children:t,id:n,items:r,strategy:i=y_,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=Qg(),d=km(C_,n),f=s.rect!==null,p=(0,S.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,S.useRef)(p),v=!__(p,_.current),y=g!==-1&&h===-1||v,b=v_(a);xm(()=>{v&&m&&u(p)},[v,p,m,u]),(0,S.useEffect)(()=>{_.current=p},[p]);let x=(0,S.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:h_(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return S.createElement(w_.Provider,{value:x},t)}var E_=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return m_(n,r,i).indexOf(t)},D_=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},O_={duration:200,easing:`ease`},k_=`transform`,A_=Lm.Transition.toString({property:k_,duration:0,easing:`linear`}),j_={roleDescription:`sortable`};function M_(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,S.useState)(null),s=(0,S.useRef)(n);return xm(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=ph(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,S.useEffect)(()=>{a&&o(null)},[a]),a}function N_(e){let{animateLayoutChanges:t=D_,attributes:n,disabled:r,data:i,getNewIndex:a=E_,id:o,strategy:s,resizeObserverConfig:c,transition:l=O_}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,S.useContext)(w_),y=P_(r,p),b=u.indexOf(o),x=(0,S.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),C=(0,S.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:w,node:T,isOver:E,setNodeRef:D}=t_({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:M,listeners:N,isDragging:P,over:F,setActivatorNodeRef:I,transform:L}=Zg({id:o,data:x,attributes:{...j_,...n},disabled:y.draggable}),R=fm(D,M),z=!!O,ee=z&&!m&&g_(f)&&g_(g),B=!_&&P,V=ee?(B&&ee?L:null)??(s??v)({rects:h,activeNodeRect:A,activeIndex:f,overIndex:g,index:b}):null,H=g_(f)&&g_(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,te=O?.id,U=(0,S.useRef)({activeId:te,items:u,newIndex:H,containerId:d}),ne=u!==U.current.items,re=t({active:O,containerId:d,isDragging:P,isSorting:z,id:o,index:b,items:u,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:l,wasDragging:U.current.activeId!=null}),ie=M_({disabled:!re,index:b,node:T,rect:w});return(0,S.useEffect)(()=>{z&&U.current.newIndex!==H&&(U.current.newIndex=H),d!==U.current.containerId&&(U.current.containerId=d),u!==U.current.items&&(U.current.items=u)},[z,H,d,u]),(0,S.useEffect)(()=>{if(te===U.current.activeId)return;if(te!=null&&U.current.activeId==null){U.current.activeId=te;return}let e=setTimeout(()=>{U.current.activeId=te},50);return()=>clearTimeout(e)},[te]),{active:O,activeIndex:f,attributes:j,data:x,rect:w,index:b,newIndex:H,items:u,isOver:E,isSorting:z,isDragging:P,listeners:N,node:T,overIndex:g,over:F,setNodeRef:R,setActivatorNodeRef:I,setDroppableNodeRef:D,setDraggableNodeRef:M,transform:ie??V,transition:ae()};function ae(){if(ie||ne&&U.current.newIndex===b)return A_;if(!(B&&!Pm(k)||!l)&&(z||re))return Lm.Transition.toString({...l,property:k_})}}function P_(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}Hh.Down,Hh.Right,Hh.Up,Hh.Left;var F_=vc(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[11px] font-medium whitespace-nowrap transition-[background-color,border-color,color,box-shadow] duration-150 motion-reduce:transition-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,neutral:`border-border/40 bg-muted text-foreground [a]:hover:bg-secondary/80`,accent:`bg-primary/12 text-primary-text dark:bg-primary/18`,success:`bg-emerald-500/12 text-emerald-700 dark:bg-emerald-500/18 dark:text-emerald-200`,warning:`bg-amber-500/12 text-amber-700 dark:bg-amber-500/18 dark:text-amber-200`,danger:`bg-destructive/12 text-destructive dark:bg-destructive/18 dark:text-destructive`,info:`bg-sky-500/12 text-sky-700 dark:bg-sky-500/18 dark:text-sky-200`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border/40 bg-background text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-foreground dark:hover:bg-muted/50`,link:`text-primary-text underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function I_({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,W.jsx)(n?Dc:`span`,{"data-slot":`badge`,"data-variant":t,className:q(F_({variant:t}),e),...r})}function L_(e){return e.replaceAll(`_`,` `)}function R_({severity:e}){let t=e.toLowerCase();return(0,W.jsx)(I_,{variant:t===`critical`||t===`high`?`danger`:t===`medium`?`warning`:t===`low`?`info`:`neutral`,children:e})}function z_({value:e}){let t=e.toLowerCase();return(0,W.jsx)(I_,{variant:t===`accepted`||t===`complete`||t===`completed`?`success`:t===`suppressed`?`warning`:t===`running`||t===`claiming`?`accent`:t===`failed`||t===`critical`||t===`error`?`danger`:t===`sleeping`?`warning`:`neutral`,children:e})}function B_({value:e}){return(0,W.jsx)(I_,{variant:e===`done`?`success`:e===`cancelled`||e===`blocked`?`danger`:e===`in_progress`?`accent`:`neutral`,children:L_(e)})}function V_({value:e}){return e===`none`?null:(0,W.jsx)(I_,{variant:e===`human_review`?`warning`:`accent`,children:L_(e)})}var H_=[{status:`backlog`,label:`Backlog`,description:`New findings.`},{status:`todo`,label:`Todo`,description:`Up next.`},{status:`in_progress`,label:`In Progress`,description:`Being worked on.`},{status:`blocked`,label:`Blocked`,description:`Stuck. Needs input.`},{status:`done`,label:`Done`,description:`Confirmed or reported.`},{status:`cancelled`,label:`Cancelled`,description:`Dismissed or false positive.`}];function U_({groups:e,selectedFingerprint:t,pendingFingerprint:n,onSelect:r,onMove:i}){let[a,o]=(0,S.useState)(null),s=$m(Qm(Xh,{activationConstraint:{distance:6}})),c=(0,S.useMemo)(()=>{let t=new Map;for(let e of H_)t.set(e.status,[]);for(let n of e)t.get(n.workflow.phase)?.push(n);return t},[e]),l=(0,S.useMemo)(()=>a?e.find(e=>e.fingerprint===a)??null:null,[a,e]);function u(e){o(String(e.active.id))}function d(t){o(null);let{active:n,over:r}=t;if(!r)return;let a=String(n.id),s=e.find(e=>e.fingerprint===a);if(!s)return;let c=null,l=String(r.id);if(H_.some(e=>e.status===l))c=l;else{let t=e.find(e=>e.fingerprint===l);t&&(c=t.workflow.phase)}c&&c!==s.workflow.phase&&i(a,c)}return(0,W.jsx)(sp,{className:`overflow-hidden`,children:(0,W.jsx)(dp,{className:`px-0 pb-0 pt-4`,children:(0,W.jsxs)(qg,{sensors:s,onDragStart:u,onDragEnd:d,children:[(0,W.jsx)(`div`,{className:`overflow-x-auto pb-4`,children:(0,W.jsx)(`div`,{className:`flex min-w-max gap-4 px-6 pb-6`,children:H_.map(e=>(0,W.jsx)(W_,{column:e,groups:c.get(e.status)??[],selectedFingerprint:t,pendingFingerprint:n??null,onSelect:r},e.status))})}),(0,W.jsx)(p_,{children:l?(0,W.jsx)(G_,{group:l,selected:t===l.fingerprint,onSelect:r,isOverlay:!0}):null})]})})})}function W_({column:e,groups:t,selectedFingerprint:n,pendingFingerprint:r,onSelect:i}){let{setNodeRef:a,isOver:o}=t_({id:e.status});return(0,W.jsxs)(`section`,{className:`flex w-[20rem] shrink-0 flex-col gap-3`,children:[(0,W.jsx)(`div`,{className:`rounded-2xl px-3 py-2`,children:(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),(0,W.jsx)(`div`,{className:`rounded-full bg-muted px-2.5 py-1 text-xs text-muted-foreground`,children:t.length})]})}),(0,W.jsxs)(`div`,{ref:a,className:q(`flex min-h-[20rem] flex-col gap-3 rounded-2xl bg-muted/20 p-2 transition-colors duration-150 motion-reduce:transition-none`,o&&`bg-primary/10 ring-1 ring-primary/30`),children:[(0,W.jsx)(T_,{items:t.map(e=>e.fingerprint),strategy:x_,children:t.map(e=>(0,W.jsx)(G_,{group:e,selected:n===e.fingerprint,saving:r===e.fingerprint,onSelect:i},e.fingerprint))}),t.length===0?(0,W.jsx)(`div`,{className:`flex flex-1 items-center justify-center rounded-2xl bg-transparent px-4 py-8 text-center text-xs text-muted-foreground`,children:`Drop a finding here.`}):null]})]})}function G_({group:e,selected:t,saving:n=!1,onSelect:r,isOverlay:i=!1}){let{attributes:a,listeners:o,setNodeRef:s,transform:c,transition:l,isDragging:u}=N_({id:e.fingerprint,data:{group:e}}),d={transform:Lm.Transform.toString(c),transition:l},f=n?`Saving...`:e.workflow.reviewGate===`human_review`?`Needs your review`:e.workflow.reviewGate===`agent_review`?`Agent reviewing`:e.workflow.phase===`in_progress`?`Running`:e.workflow.phase===`blocked`?`Blocked`:null;return(0,W.jsx)(`button`,{ref:s,type:`button`,style:d,onClick:()=>r(e.fingerprint),...a,...o,className:q(`rounded-2xl bg-muted/30 p-3 text-left transition-[background-color,box-shadow] duration-150 motion-reduce:transition-none`,`cursor-grab active:cursor-grabbing hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50`,t&&`bg-muted ring-1 ring-primary/35`,u&&!i&&`opacity-30`,i&&`shadow-lg ring-1 ring-primary/20`,n&&`bg-primary/10`),children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,W.jsx)(za,{className:`size-3.5`}),e.latest.category]}),(0,W.jsx)(`div`,{className:`line-clamp-2 text-sm font-semibold leading-5 text-foreground`,children:e.latest.title}),f?(0,W.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:f}):null]}),(0,W.jsx)(R_,{severity:e.latest.severity})]})})}function K_({title:e,description:t,actions:n,children:r,className:i}){return(0,W.jsxs)(sp,{className:q(`overflow-hidden border-0 bg-transparent`,i),children:[(0,W.jsxs)(cp,{children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(lp,{className:`font-sans text-base font-medium`,children:e}),t?(0,W.jsx)(up,{children:t}):null]}),n?(0,W.jsx)(`div`,{className:`shrink-0`,children:n}):null]}),(0,W.jsx)(dp,{className:`space-y-4`,children:r})]})}function q_({title:e,summary:t,actions:n,className:r}){return(0,W.jsxs)(`header`,{className:q(`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,r),children:[(0,W.jsx)(`div`,{className:`space-y-1.5`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`font-sans text-2xl font-medium tracking-tight text-foreground`,children:e}),t?(0,W.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-muted-foreground`,children:t}):null]})}),n?(0,W.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:n}):null]})}function J_({className:e,...t}){return(0,W.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,W.jsx)(`table`,{"data-slot":`table`,className:q(`w-full caption-bottom text-sm`,e),...t})})}function Y_({className:e,...t}){return(0,W.jsx)(`thead`,{"data-slot":`table-header`,className:q(`[&_tr]:border-b`,e),...t})}function X_({className:e,...t}){return(0,W.jsx)(`tbody`,{"data-slot":`table-body`,className:q(`[&_tr:last-child]:border-0`,e),...t})}function Z_({className:e,...t}){return(0,W.jsx)(`tr`,{"data-slot":`table-row`,className:q(`border-b border-border/40 transition-colors duration-150 motion-reduce:transition-none hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Q_({className:e,...t}){return(0,W.jsx)(`th`,{"data-slot":`table-head`,className:q(`h-12 px-3 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function $_({className:e,...t}){return(0,W.jsx)(`td`,{"data-slot":`table-cell`,className:q(`p-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}function ev({className:e,...t}){return(0,W.jsx)(`textarea`,{"data-slot":`textarea`,className:q(`flex field-sizing-content min-h-16 w-full resize-none rounded-2xl border border-transparent bg-muted/50 px-3 py-3 text-base transition-[color,box-shadow,border-color] duration-150 motion-reduce:transition-none outline-none placeholder:text-muted-foreground focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-foreground/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-sm dark:bg-muted/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function tv(e){return new Date(e).toLocaleString()}function nv(e){if(!e||e<=0)return`n/a`;if(e<1e3)return`${e}ms`;let t=Math.round(e/1e3),n=Math.floor(t/60),r=t%60;return n===0?`${t}s`:`${n}m ${r}s`}function rv(e){return!e||Object.keys(e).length===0?`No payload`:typeof e.summary==`string`&&e.summary.trim()?e.summary.trim():Array.isArray(e.tools)&&e.tools.length>0?`${typeof e.turn==`number`?`turn ${e.turn} · `:``}tools: ${e.tools.join(`, `)}`:typeof e.excerpt==`string`&&e.excerpt.trim()?`${typeof e.turn==`number`?`turn ${e.turn} · `:``}no tool calls · ${e.excerpt.trim().slice(0,120)}`:Object.entries(e).slice(0,3).map(([e,t])=>`${e}: ${iv(t)}`).join(` · `)}function iv(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?`${e.length} items`:e&&typeof e==`object`?`${Object.keys(e).length} fields`:`n/a`}function av(e,t){if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function ov(e,t){let[n,r]=(0,S.useState)(()=>av(e,t));return(0,S.useEffect)(()=>{try{window.localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}var sv=[{value:`backlog`,label:`Backlog`},{value:`todo`,label:`Todo`},{value:`in_progress`,label:`In progress`},{value:`blocked`,label:`Blocked`},{value:`done`,label:`Done`},{value:`cancelled`,label:`Cancelled`}],cv=[{value:`all`,label:`All`},{value:`pending`,label:`Pending`},{value:`verified`,label:`Verified`},{value:`disputed`,label:`Disputed`},{value:`false-positive`,label:`False positive`}],lv={search:``,workflowFilter:`all`,reviewFilter:`all`,severityFilter:`all`,consensusFilter:`all`,assigneeFilter:`all`,activeOnly:!1,viewMode:`inbox`,queueSort:`attention`};function uv(e,t){return[e.latest.title,e.latest.category,e.latest.severity,e.latest.triageStatus,e.workflow.status,e.workflow.phase,e.workflow.reviewGate,e.workflow.persistedStatus,e.workflow.recommendedStatus,e.workflow.reviewReason??``,e.workflow.consensus,e.workflow.assignee??``,e.workflow.activeAgentRoles.join(` `),e.fingerprint].join(` `).toLowerCase().includes(t)}function dv(e,t){let n=t.workflowAssignee.trim()||null,r=t.workflowStatus===`done`||t.workflowStatus===`cancelled`?t.workflowStatus:e.recommendedStatus,i=t.optimisticStatus??(t.workflowStatus===`done`||t.workflowStatus===`cancelled`?t.workflowStatus:e.status),a=Ev(t.workflowStatus);return{...e,status:i,persistedStatus:t.workflowStatus,recommendedStatus:r,phase:a,assignee:n,updatedAt:new Date().toISOString()}}function fv(e,t){return{...e,groups:e.groups.map(e=>e.fingerprint===t.fingerprint?{...e,latest:{...e.latest,workflowStatus:t.workflowStatus,workflowAssignee:t.workflowAssignee.trim()||null,workflowUpdatedAt:new Date().toISOString()},workflow:dv(e.workflow,t)}:e)}}function pv(e,t){return e.fingerprint===t.fingerprint?{...e,latest:{...e.latest,workflowStatus:t.workflowStatus,workflowAssignee:t.workflowAssignee.trim()||null,workflowUpdatedAt:new Date().toISOString()},workflow:dv(e.workflow,t)}:e}function mv({dashboard:e}){let{fingerprint:t}=at(),n=rt(),r=Vr(),{openPanel:i,clearPanel:a}=Hi(),[o,s]=(0,S.useState)(null),[c,l]=ov(`0:threads:console-state`,lv),{search:u,workflowFilter:d,reviewFilter:f,severityFilter:p,consensusFilter:m,assigneeFilter:h,activeOnly:g,viewMode:_,queueSort:v}=c,[y,b]=(0,S.useState)(!1),x=(0,S.useDeferredValue)(u),C=(0,S.useMemo)(()=>[`all`,...new Set(e.groups.map(e=>e.latest.severity.toLowerCase()))],[e.groups]),w=(0,S.useMemo)(()=>[`all`,...new Set(e.groups.map(e=>e.workflow.assignee).filter(Boolean))],[e.groups]),T=(0,S.useMemo)(()=>{let t=new Set;for(let n of e.groups){n.workflow.assignee&&t.add(n.workflow.assignee);for(let e of n.workflow.activeAgentRoles)t.add(e)}return[...t].sort((e,t)=>e.localeCompare(t))},[e.groups]),E=(0,S.useMemo)(()=>{let t=x.trim().toLowerCase();return e.groups.filter(e=>!(t&&!uv(e,t)||d!==`all`&&e.workflow.phase!==d||f!==`all`&&e.workflow.reviewGate!==f||p!==`all`&&e.latest.severity.toLowerCase()!==p||m!==`all`&&e.workflow.consensus!==m||h!==`all`&&(e.workflow.assignee??``)!==h&&!e.workflow.activeAgentRoles.includes(h)||g&&e.workflow.activeAgentRoles.length===0))},[g,h,m,e.groups,x,f,p,d]),D=(0,S.useMemo)(()=>E.filter(e=>e.workflow.reviewGate!==`none`),[E]),O=(0,S.useMemo)(()=>{let e=[...E];return e.sort((e,t)=>v===`newest`?t.latest.timestamp-e.latest.timestamp:v===`severity`?wv(t.latest.severity)-wv(e.latest.severity):Tv(t)-Tv(e)),e},[E,v]),k=(0,S.useMemo)(()=>O.filter(e=>e.workflow.reviewGate===`none`&&(e.workflow.phase===`todo`||e.workflow.phase===`backlog`)),[O]),A=(0,S.useMemo)(()=>O.filter(e=>e.workflow.phase===`in_progress`||e.workflow.activeAgentRoles.length>0),[O]),j=(0,S.useMemo)(()=>O.filter(e=>e.workflow.phase===`blocked`),[O]),M=(0,S.useMemo)(()=>D.filter(e=>e.workflow.reviewGate===`agent_review`),[D]),N=(0,S.useMemo)(()=>D.filter(e=>e.workflow.reviewGate===`human_review`),[D]),P=_===`review`?D:_===`board`?E:O,F=t??null,I=ni({queryKey:[`finding-family`,F],queryFn:()=>mi(F),enabled:!!F}),L=ri({mutationFn:({triageStatus:e,triageNote:t})=>hi(F,e,t),onSuccess:async()=>{await Promise.all([r.invalidateQueries({queryKey:[`dashboard`]}),r.invalidateQueries({queryKey:[`finding-family`,F]})])}}),R=ri({mutationFn:({fingerprint:e,workflowStatus:t,workflowAssignee:n})=>gi(e,t,n),onMutate:async e=>{await Promise.all([r.cancelQueries({queryKey:[`dashboard`]}),r.cancelQueries({queryKey:[`finding-family`,e.fingerprint]})]);let t=r.getQueryData([`dashboard`]),n=r.getQueryData([`finding-family`,e.fingerprint]);return r.setQueryData([`dashboard`],t=>t&&fv(t,e)),r.setQueryData([`finding-family`,e.fingerprint],t=>t&&pv(t,e)),{previousDashboard:t,previousFamily:n,fingerprint:e.fingerprint}},onError:(e,t,n)=>{n?.previousDashboard&&r.setQueryData([`dashboard`],n.previousDashboard),n?.previousFamily&&r.setQueryData([`finding-family`,n.fingerprint],n.previousFamily)},onSettled:async(e,t,n)=>{await Promise.all([r.invalidateQueries({queryKey:[`dashboard`]}),r.invalidateQueries({queryKey:[`finding-family`,n.fingerprint]})])}}),z=e.groups.find(e=>e.fingerprint===F)??null,ee=P.some(e=>e.fingerprint===F),B=u.trim().length>0||d!==`all`||f!==`all`||p!==`all`||m!==`all`||h!==`all`||g,V=[d===`all`?null:sv.find(e=>e.value===d)?.label??d,f===`all`?null:f.replaceAll(`_`,` `),p===`all`?null:p,m===`all`?null:m.replaceAll(`-`,` `),h===`all`?null:h,g?`active agents`:null].filter(Boolean),H=_===`review`?`${D.length} to review`:_===`board`?`${E.length} findings`:`${O.length} in queue`;function te(){l(e=>({...e,search:``,workflowFilter:`all`,reviewFilter:`all`,severityFilter:`all`,consensusFilter:`all`,assigneeFilter:`all`,activeOnly:!1}))}return(0,S.useEffect)(()=>{F!==o&&s(null)},[o,F]),(0,S.useEffect)(()=>{if(!F||F===o){a();return}let e;return e=I.isLoading?(0,W.jsx)(gp,{label:`Loading finding`}):I.error?(0,W.jsx)(vp,{error:I.error}):I.data?(0,W.jsx)(hv,{data:I.data,assigneeSuggestions:T,selectedSummary:z?.workflow??null,reviewMode:_===`review`,isSaving:L.isPending||R.isPending,onTriage:(e,t)=>L.mutate({triageStatus:e,triageNote:t}),onWorkflow:(e,t,n,r)=>R.mutate({fingerprint:e,workflowStatus:t,workflowAssignee:n,optimisticStatus:r})}):(0,W.jsx)(_p,{title:`Finding not found`,body:`It may have been removed.`}),i({title:z?.latest.title??`Finding`,description:``,content:(0,W.jsx)(`div`,{className:`p-6`,children:e}),onClose:()=>{s(F),n(`/findings`)}}),()=>{a()}},[T,a,I.data,I.error,I.isLoading,n,i,F,z?.latest.title,z?.workflow,o,L.isPending,R.isPending,_]),(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsx)(q_,{eyebrow:`Findings`,title:`Findings`,summary:``,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(J,{variant:`outline`,onClick:()=>b(!0),children:[(0,W.jsx)(xo,{className:`size-4`}),`Filters`,B?(0,W.jsx)(I_,{variant:`neutral`,children:V.length+ +!!u.trim()}):null]}),F?(0,W.jsx)(J,{variant:`outline`,onClick:()=>n(`/findings`),children:`Close finding`}):null]})}),(0,W.jsx)(`div`,{className:`flex flex-wrap items-center gap-4`,children:(0,W.jsx)(om,{value:_,onValueChange:e=>l(t=>({...t,viewMode:e})),children:(0,W.jsxs)(cm,{children:[(0,W.jsx)(lm,{value:`inbox`,children:`Queue`}),(0,W.jsx)(lm,{value:`review`,children:`Review`}),(0,W.jsx)(lm,{value:`board`,children:`Board`})]})})}),(0,W.jsx)(sp,{size:`sm`,className:`border-0 bg-transparent`,children:(0,W.jsxs)(dp,{className:`space-y-4`,children:[(0,W.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-center`,children:[(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(fo,{className:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,W.jsx)(af,{value:u,onChange:e=>l(t=>({...t,search:e.target.value})),placeholder:`Search findings`,className:`pl-9`})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:H}),F&&!ee?(0,W.jsx)(I_,{variant:`warning`,children:`Open finding is filtered out`}):null]})]}),B||u.trim()?(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[u.trim()?(0,W.jsxs)(I_,{variant:`outline`,children:[`"`,u.trim(),`"`]}):null,V.map(e=>(0,W.jsx)(I_,{variant:`outline`,children:e},e)),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:te,children:`Clear filters`})]}):null]})}),(0,W.jsx)(`div`,{className:`min-w-0 space-y-4`,children:_===`board`?(0,W.jsx)(U_,{groups:E,selectedFingerprint:F,pendingFingerprint:R.isPending?R.variables?.fingerprint??null:null,onSelect:e=>n(`/findings/${e}`),onMove:(t,r)=>{F!==t&&n(`/findings/${t}`),R.mutate({fingerprint:t,workflowStatus:r,workflowAssignee:e.groups.find(e=>e.fingerprint===t)?.workflow.assignee??``,optimisticStatus:r})}}):_===`review`?(0,W.jsx)(_v,{agentReviewGroups:M,humanReviewGroups:N,selectedFingerprint:F,pendingFingerprint:R.isPending?R.variables?.fingerprint??null:null,onSelect:e=>n(`/findings/${e}`)}):(0,W.jsx)(gv,{groups:O,readyGroups:k,activeGroups:A,blockedGroups:j,selectedFingerprint:F,queueSort:v,pendingFingerprint:R.isPending?R.variables?.fingerprint??null:null,onSortChange:e=>l(t=>({...t,queueSort:e})),onSelect:e=>n(`/findings/${e}`)})}),(0,W.jsx)(qd,{open:y,onOpenChange:b,children:(0,W.jsxs)(Xd,{side:`right`,className:`w-full overflow-y-auto p-0 sm:max-w-xl`,children:[(0,W.jsx)(Zd,{className:`border-b border-border pr-12`,children:(0,W.jsx)(Qd,{children:`Filters`})}),(0,W.jsxs)(`div`,{className:`space-y-5 p-6`,children:[(0,W.jsx)(`label`,{className:`block space-y-2`,children:(0,W.jsx)(af,{value:u,onChange:e=>l(t=>({...t,search:e.target.value})),placeholder:`Search findings`})}),(0,W.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,W.jsxs)(Dv,{label:`Status`,children:[(0,W.jsx)(Ov,{active:d===`all`,onClick:()=>l(e=>({...e,workflowFilter:`all`})),children:`All`}),sv.map(e=>(0,W.jsx)(Ov,{active:d===e.value,onClick:()=>l(t=>({...t,workflowFilter:e.value})),children:e.label},e.value))]}),(0,W.jsxs)(Dv,{label:`Review`,children:[(0,W.jsx)(Ov,{active:f===`all`,onClick:()=>l(e=>({...e,reviewFilter:`all`})),children:`All`}),(0,W.jsx)(Ov,{active:f===`agent_review`,onClick:()=>l(e=>({...e,reviewFilter:`agent_review`})),children:`Agent review`}),(0,W.jsx)(Ov,{active:f===`human_review`,onClick:()=>l(e=>({...e,reviewFilter:`human_review`})),children:`Human review`})]}),(0,W.jsx)(Dv,{label:`Severity`,children:C.map(e=>(0,W.jsx)(Ov,{active:p===e,onClick:()=>l(t=>({...t,severityFilter:e})),children:e===`all`?`All`:e[0]?.toUpperCase()+e.slice(1)},e))}),(0,W.jsx)(Dv,{label:`Verdict`,children:cv.map(e=>(0,W.jsx)(Ov,{active:m===e.value,onClick:()=>l(t=>({...t,consensusFilter:e.value})),children:e.label},e.value))}),(0,W.jsxs)(Dv,{label:`Owner`,className:`md:col-span-2`,children:[(0,W.jsx)(Ov,{active:h===`all`,onClick:()=>l(e=>({...e,assigneeFilter:`all`})),children:`Anyone`}),w.filter(e=>e!==`all`).map(e=>(0,W.jsx)(Ov,{active:h===e,onClick:()=>l(t=>({...t,assigneeFilter:e})),children:e},e)),(0,W.jsx)(Ov,{active:g,onClick:()=>l(e=>({...e,activeOnly:!e.activeOnly})),children:`Running only`})]})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border pt-4`,children:[(0,W.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[P.length,` of `,e.groups.length,` shown`]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:te,children:`Reset`}),(0,W.jsx)(J,{size:`sm`,onClick:()=>b(!1),children:`Apply`})]})]})]})]})})]})}function hv({data:e,assigneeSuggestions:t,selectedSummary:n,reviewMode:r,onTriage:i,onWorkflow:a,isSaving:o}){let[s,c]=(0,S.useState)(e.latest.triageNote??``),[l,u]=(0,S.useState)(e.workflow.assignee??``),[d,f]=(0,S.useState)(null),p=`assignee-suggestions-${e.fingerprint}`,m=(0,S.useMemo)(()=>{let n=new Set;e.workflow.assignee&&n.add(e.workflow.assignee);for(let t of e.workflow.activeAgentRoles)n.add(t);for(let e of t)n.add(e);return[...n].slice(0,8)},[t,e.workflow.activeAgentRoles,e.workflow.assignee]),h=e.workItems.find(e=>e.status===`in_progress`)??null,g=e.workItems.find(e=>e.status===`blocked`)??null,_=e.workItems.find(e=>e.status===`todo`||e.status===`backlog`)??null,v=h?.owner??e.workflow.assignee??e.workflow.activeAgentRoles[0]??g?.owner??`Unassigned`,y=g?`Blocked`:h?`Running`:_?`Queued`:e.workflow.reviewGate===`none`?`Idle`:`Waiting for review`,b=g?g.summary||e.workflow.reviewReason||`Needs your input.`:h?h.summary||e.workflow.reviewReason||`An agent is working on it.`:_?_.summary||`Next step is ready.`:e.workflow.reviewReason||`Nothing running.`,x=e.case?.targetType===`repository`&&e.workflow.consensus===`verified`?`draft_fix`:e.workflow.reviewGate===`human_review`?`verify`:`investigate`,C=e.consoleCommand.replace(`--finding-intent investigate`,`--finding-intent ${x}`),w=x===`draft_fix`?`Fix in chat`:x===`verify`?`Verify in chat`:`Investigate in chat`,T=[e.case?.target,e.latest.category].filter(Boolean).join(` · `),E=async()=>{try{if(!navigator.clipboard?.writeText)throw Error(`Clipboard access is unavailable.`);await navigator.clipboard.writeText(C),f(`Copied. Paste it in a terminal.`)}catch{f(`Couldn't copy. Select the command and copy it manually.`)}};return(0,S.useEffect)(()=>{c(e.latest.triageNote??``)},[e.fingerprint,e.latest.triageNote]),(0,S.useEffect)(()=>{u(e.workflow.assignee??``)},[e.fingerprint,e.workflow.assignee]),(0,S.useEffect)(()=>{f(null)},[e.fingerprint]),(0,W.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,W.jsxs)(K_,{className:r?`order-2`:`order-1`,title:r?e.workflow.reviewGate===`human_review`?`Your decision`:`Next step`:`Actions`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(R_,{severity:e.latest.severity}),(0,W.jsx)(B_,{value:e.workflow.phase}),(0,W.jsx)(V_,{value:e.workflow.reviewGate}),e.latest.triageStatus===`new`?null:(0,W.jsx)(z_,{value:e.latest.triageStatus})]}),T?(0,W.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:T}):null,g||e.workflow.phase===`blocked`?(0,W.jsxs)(`div`,{className:`rounded-2xl border border-destructive/25 bg-destructive/5 px-4 py-3 text-sm`,children:[(0,W.jsx)(`span`,{className:`font-medium text-foreground`,children:`Blocked: `}),(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:b})]}):null,(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsxs)(J,{variant:`success`,onClick:()=>i(`accepted`,s),disabled:o,children:[(0,W.jsx)(go,{className:`size-4`}),`Accept`]}),(0,W.jsxs)(J,{variant:`warning`,onClick:()=>i(`suppressed`,s),disabled:o,children:[(0,W.jsx)(_o,{className:`size-4`}),`Dismiss`]}),e.latest.triageStatus===`new`?null:(0,W.jsxs)(J,{variant:`ghost`,onClick:()=>i(`new`,s),disabled:o,children:[(0,W.jsx)(vo,{className:`size-4`}),`Undo`]})]}),(0,W.jsx)(ev,{value:s,onChange:e=>c(e.target.value),placeholder:`Note (optional)`}),(0,W.jsxs)(`div`,{className:`space-y-2 rounded-2xl bg-muted/30 p-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,W.jsx)(Xa,{className:`size-4 text-primary-text`}),w]}),(0,W.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>void E(),children:[(0,W.jsx)(Sa,{className:`size-4`}),`Copy`]})]}),(0,W.jsx)(`code`,{className:`block overflow-x-auto rounded-xl bg-background/80 px-3 py-2 font-mono text-sm text-foreground`,children:C}),d?(0,W.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:d}):null]}),(0,W.jsxs)(`details`,{className:`rounded-2xl bg-muted/30 px-4 py-3 text-sm`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer font-medium text-foreground`,children:`Details`}),(0,W.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,W.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,W.jsx)(xv,{label:`Status`,value:y}),(0,W.jsx)(xv,{label:`Owner`,value:v}),(0,W.jsx)(xv,{label:`Now`,value:h?h.title:g?g.title:`—`}),(0,W.jsx)(xv,{label:`Next`,value:_?_.title:e.workflow.reviewGate===`none`?`—`:`Review`}),(0,W.jsx)(xv,{label:`Verdict`,value:`${e.workflow.consensus} · ${e.workflow.evidenceSignal} signal`}),(0,W.jsx)(xv,{label:`Votes (real / false / unsure)`,value:`${e.workflow.verdictCounts.truePositive} / ${e.workflow.verdictCounts.falsePositive} / ${e.workflow.verdictCounts.unsure}`}),(0,W.jsx)(xv,{label:`Seen`,value:`${e.rows.length}×`}),(0,W.jsx)(xv,{label:`Target type`,value:e.case?Cv(e.case.targetType):`Unknown`}),(0,W.jsx)(xv,{label:`ID`,value:e.fingerprint,mono:!0})]}),e.workflow.reviewReason||n&&n.persistedStatus!==n.phase?(0,W.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[e.workflow.reviewReason??``,n&&n.persistedStatus!==n.phase?` You set it to ${n.persistedStatus}.`:``]}):null,(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(af,{list:p,value:l,onChange:e=>u(e.target.value),placeholder:`Assign to a person or agent`}),(0,W.jsx)(`datalist`,{id:p,children:m.map(e=>(0,W.jsx)(`option`,{value:e},e))}),(0,W.jsxs)(J,{variant:`outline`,onClick:()=>a(e.fingerprint,e.workflow.phase,l),disabled:o,children:[(0,W.jsx)(ko,{className:`size-4`}),`Assign`]})]})]})]})]}),(0,W.jsx)(K_,{className:r?`order-1`:`order-2`,title:`Evidence`,children:(0,W.jsxs)(om,{defaultValue:`evidence`,className:`gap-4`,children:[(0,W.jsxs)(cm,{children:[(0,W.jsx)(lm,{value:`evidence`,children:`Evidence`}),(0,W.jsx)(lm,{value:`occurrences`,children:`History`}),(0,W.jsx)(lm,{value:`runbook`,children:`Steps`})]}),(0,W.jsxs)(um,{value:`runbook`,className:`space-y-5`,children:[(0,W.jsx)(`div`,{className:`space-y-3`,children:e.workItems.length===0?(0,W.jsx)(`div`,{className:`rounded-2xl bg-muted/30 px-4 py-8 text-sm text-muted-foreground`,children:`No steps yet.`}):(0,W.jsx)(bv,{items:e.workItems,activeWorkItemId:h?.id??null,blockedWorkItemId:g?.id??null})}),(0,W.jsx)(`div`,{className:`space-y-3`,children:e.artifacts.length===0?(0,W.jsx)(`div`,{className:`rounded-2xl bg-muted/30 px-4 py-8 text-sm text-muted-foreground`,children:`No files yet.`}):(0,W.jsx)(`div`,{className:`grid gap-3`,children:e.artifacts.map(e=>(0,W.jsx)(`div`,{className:`rounded-2xl bg-muted/30 px-4 py-3`,children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.label}),(0,W.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:e.summary})]}),(0,W.jsx)(I_,{variant:`outline`,children:Sv(e.kind)})]})},e.id))})})]}),(0,W.jsx)(um,{value:`evidence`,children:(0,W.jsx)(`div`,{className:`space-y-3`,children:(0,W.jsx)(dm,{request:e.latest.evidenceRequest,response:e.latest.evidenceResponse,analysis:e.latest.evidenceAnalysis})})}),(0,W.jsx)(um,{value:`occurrences`,children:(0,W.jsx)(sp,{className:`overflow-hidden`,children:(0,W.jsx)(dp,{children:(0,W.jsxs)(J_,{children:[(0,W.jsx)(Y_,{children:(0,W.jsxs)(Z_,{className:`hover:bg-transparent`,children:[(0,W.jsx)(Q_,{children:`Scan`}),(0,W.jsx)(Q_,{children:`Time`}),(0,W.jsx)(Q_,{className:`w-[8rem]`,children:`Status`})]})}),(0,W.jsx)(X_,{children:e.rows.map(e=>(0,W.jsxs)(Z_,{children:[(0,W.jsx)($_,{className:`tabular-nums text-sm text-muted-foreground`,children:e.scanId.slice(0,8)}),(0,W.jsx)($_,{className:`text-xs text-muted-foreground`,children:tv(e.timestamp)}),(0,W.jsx)($_,{children:(0,W.jsx)(z_,{value:e.status})})]},e.id))})]})})})})]})})]})}function gv({groups:e,readyGroups:t,activeGroups:n,blockedGroups:r,selectedFingerprint:i,queueSort:a,pendingFingerprint:o,onSortChange:s,onSelect:c}){let l=[{title:`Ready`,entries:t},{title:`In progress`,entries:n},{title:`Needs input`,entries:r}];return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`mr-auto`}),(0,W.jsx)(J,{variant:a===`attention`?`default`:`ghost`,size:`sm`,onClick:()=>s(`attention`),children:`Needs attention`}),(0,W.jsx)(J,{variant:a===`newest`?`default`:`ghost`,size:`sm`,onClick:()=>s(`newest`),children:`Newest`}),(0,W.jsx)(J,{variant:a===`severity`?`default`:`ghost`,size:`sm`,onClick:()=>s(`severity`),children:`Severity`})]}),e.length===0?(0,W.jsx)(_p,{title:`No findings`}):null,l.filter(e=>e.entries.length>0).map(e=>(0,W.jsxs)(`section`,{className:`space-y-2`,children:[(0,W.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-medium`,children:[e.title,(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:e.entries.length})]}),(0,W.jsx)(fp,{className:`overflow-hidden rounded-2xl`,children:e.entries.map(t=>(0,W.jsx)(vv,{group:t,selected:i===t.fingerprint,saving:o===t.fingerprint,mode:e.title===`Needs input`?`review`:`inbox`,onSelect:c},t.fingerprint))})]},e.title))]})}function _v({agentReviewGroups:e,humanReviewGroups:t,selectedFingerprint:n,pendingFingerprint:r,onSelect:i}){return(0,W.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{className:`font-sans text-base font-medium`,children:`Agent review`})})}),(0,W.jsx)(dp,{className:`px-0 pb-0`,children:e.length===0?(0,W.jsx)(`div`,{className:`px-6 pb-6`,children:(0,W.jsx)(_p,{title:`Nothing to check`,body:``})}):(0,W.jsx)(rp,{className:`max-h-[70vh]`,children:(0,W.jsx)(fp,{children:e.map(e=>(0,W.jsx)(vv,{group:e,selected:n===e.fingerprint,saving:r===e.fingerprint,mode:`review`,onSelect:i},e.fingerprint))})})})]}),(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{className:`font-sans text-base font-medium`,children:`Your review`})})}),(0,W.jsx)(dp,{className:`px-0 pb-0`,children:t.length===0?(0,W.jsx)(`div`,{className:`px-6 pb-6`,children:(0,W.jsx)(_p,{title:`Nothing to review`,body:``})}):(0,W.jsx)(rp,{className:`max-h-[70vh]`,children:(0,W.jsx)(fp,{children:t.map(e=>(0,W.jsx)(vv,{group:e,selected:n===e.fingerprint,saving:r===e.fingerprint,mode:`review`,onSelect:i},e.fingerprint))})})})]})]})}function vv({group:e,selected:t,saving:n,mode:r,onSelect:i}){let a=e.workflow.reviewReason??null;return(0,W.jsx)(mp,{interactive:!0,selected:t,className:`p-0`,children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>i(e.fingerprint),className:`w-full px-4 py-4 text-left`,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,W.jsx)(`div`,{className:`text-sm font-semibold leading-5 text-foreground`,children:e.latest.title}),a?(0,W.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:a}):null]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-2`,children:[r===`inbox`?(0,W.jsx)(V_,{value:e.workflow.reviewGate}):null,e.latest.triageStatus===`new`?null:(0,W.jsx)(z_,{value:e.latest.triageStatus}),(0,W.jsx)(R_,{severity:e.latest.severity})]})]}),(0,W.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:n?`Saving...`:tv(e.workflow.updatedAt??e.latest.timestamp)})]})})}function yv({value:e}){return(0,W.jsx)(I_,{variant:e===`done`?`success`:e===`blocked`||e===`cancelled`?`danger`:e===`in_progress`?`accent`:e===`todo`?`warning`:`neutral`,children:e.replaceAll(`_`,` `)})}function bv({items:e,activeWorkItemId:t,blockedWorkItemId:n}){return(0,W.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:e.map(e=>{let r=t===e.id,i=n===e.id;return(0,W.jsx)(`div`,{className:`rounded-2xl border border-transparent px-4 py-3 ${i?`border-destructive/30 bg-destructive/5`:r?`border-primary/30 bg-primary/5`:`border-border bg-card`}`,children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.title}),r?(0,W.jsx)(I_,{variant:`accent`,children:`Current`}):null,i?(0,W.jsx)(I_,{variant:`danger`,children:`Blocked`}):null]}),(0,W.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:e.summary})]}),(0,W.jsx)(yv,{value:e.status})]})},e.id)})})}function xv({label:e,value:t,mono:n=!1}){return(0,W.jsxs)(`div`,{className:`rounded-2xl bg-muted/30 px-4 py-3`,children:[(0,W.jsx)(`div`,{className:`text-sm text-muted-foreground/70`,children:e}),(0,W.jsx)(`div`,{className:n?`mt-2 truncate tabular-nums text-sm text-foreground`:`mt-2 text-sm font-medium text-foreground`,children:t})]})}function Sv(e){return e.replaceAll(`_`,` `)}function Cv(e){return e.replaceAll(`-`,` `)}function wv(e){let t=e.toLowerCase();return t===`critical`?5:t===`high`?4:t===`medium`?3:t===`low`?2:1}function Tv(e){let t=0;return e.workflow.reviewGate===`human_review`?t+=100:e.workflow.reviewGate===`agent_review`?t+=90:e.workflow.phase===`blocked`?t+=80:e.workflow.phase===`in_progress`?t+=70:e.workflow.phase===`todo`?t+=60:e.workflow.phase===`backlog`&&(t+=50),e.workflow.assignee||(t+=15),e.workflow.consensus===`disputed`&&(t+=12),e.workflow.activeAgentRoles.length>0&&(t+=8),t*1e6+e.latest.timestamp+wv(e.latest.severity)*1e3}function Ev(e){return e===`done`||e===`cancelled`||e===`blocked`||e===`in_progress`||e===`todo`?e:`backlog`}function Dv({label:e,className:t,children:n}){return(0,W.jsx)(`div`,{className:`space-y-3 rounded-2xl bg-muted/30 px-4 py-4 ${t??``}`,children:(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:n})})}function Ov({active:e,onClick:t,children:n}){return(0,W.jsx)(J,{variant:e?`default`:`outline`,size:`xs`,onClick:t,children:n})}function kv(e){let t=new URL(e,window.location.href);if(t.origin!==window.location.origin||!t.pathname.startsWith(`/api/`))return new EventSource(e);let n=new AbortController,r={},i={onopen:null,onerror:null,onmessage:null,addEventListener(e,t){(r[e]??=[]).push(t)},close(){n.abort()}};async function a(){for(;!n.signal.aborted;){try{let e=await ci(`${t.pathname}${t.search}`,{signal:n.signal,headers:{Accept:`text/event-stream`}});if(!e.ok||!e.body||!e.headers.get(`content-type`)?.includes(`text/event-stream`))throw Error(`Stream unavailable`);i.onopen?.();let a=e.body.getReader(),o=new TextDecoder,s=``;try{for(;!n.signal.aborted;){let{done:e,value:t}=await a.read();if(e)break;if(s+=o.decode(t,{stream:!0}).replace(/\r\n/g,`
60
+ `),s.length>2e6)throw Error(`Stream event exceeds limit`);let n;for(;(n=s.indexOf(`
61
+
62
+ `))!==-1;){let e=s.slice(0,n);s=s.slice(n+2);let t=`message`,a=[];for(let n of e.split(`
63
+ `))n.startsWith(`event:`)&&(t=n.slice(6).trim()),n.startsWith(`data:`)&&a.push(n.slice(5).replace(/^ /,``));if(a.length){let e=new MessageEvent(t,{data:a.join(`
64
+ `)});t===`message`&&i.onmessage?.(e);for(let n of r[t]??[])n(e)}}}}finally{await a.cancel().catch(()=>{}),a.releaseLock()}}catch{if(n.signal.aborted)return}if(n.signal.aborted)return;i.onerror?.();let e=Promise.withResolvers(),a=setTimeout(e.resolve,3e3),o=()=>{clearTimeout(a),e.resolve()};n.signal.addEventListener(`abort`,o,{once:!0}),await e.promise,n.signal.removeEventListener(`abort`,o)}}return a(),i}var Av=/([A-Za-z0-9._/\\\-]+(?:\.[A-Za-z0-9]+))[:\s]+L?(\d+)/;function jv(e){if(!e)return null;let t=Av.exec(e);if(!t)return null;let n=t[1],r=Number.parseInt(t[2],10);return!Number.isFinite(r)||r<=0||!n.includes(`/`)&&!/\.(ts|tsx|js|jsx|py|go|rs|java|rb|php|c|cc|cpp|h|hpp|sh|sql)$/i.test(n)?null:{file:n,line:r}}function Mv(e){let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!=`object`)return null;let n=t;if(n.schema===`0.events/v1`&&typeof n.kind==`string`)return Nv(n);if(n.protocol===`0.presentation/v1`&&n.kind===`event`&&typeof n.eventType==`string`&&n.payload&&typeof n.payload==`object`&&!Array.isArray(n.payload)){let e={...n.payload};if(typeof e.ts!=`number`&&typeof n.at==`string`){let t=Date.parse(n.at);Number.isFinite(t)&&(e.ts=t/1e3)}return Pv(n.eventType,e)}return typeof n.type==`string`&&n.payload&&typeof n.payload==`object`?Pv(n.type,n.payload):null}function Nv(e){let t=e.kind,n=typeof e.ts==`number`?e.ts:Date.now()/1e3;if(t===`tool_use`){let t=typeof e.args_preview==`string`?e.args_preview:void 0,r=jv(t);return{schema:`0.events/v1`,kind:`tool_use`,ts:n,tool:typeof e.tool==`string`?e.tool:`?`,turn:typeof e.turn==`number`?e.turn:void 0,args_preview:t,file:typeof e.file==`string`?e.file:r?.file,line:typeof e.line==`number`?e.line:r?.line,status:e.status===`ok`||e.status===`error`||e.status===`running`?e.status:`running`,duration_ms:typeof e.duration_ms==`number`?e.duration_ms:void 0}}if(t===`finding`)return{schema:`0.events/v1`,kind:`finding`,ts:n,finding_id:typeof e.finding_id==`string`?e.finding_id:void 0,title:typeof e.title==`string`?e.title:`Finding`,severity:typeof e.severity==`string`?e.severity:void 0,category:typeof e.category==`string`?e.category:void 0,confidence:typeof e.confidence==`number`?e.confidence:void 0,file:typeof e.file==`string`?e.file:void 0,line:typeof e.line==`number`?e.line:void 0};if(t===`stage`){let t=e.transition===`completed`?`completed`:`started`;return{schema:`0.events/v1`,kind:`stage`,ts:n,stage:typeof e.stage==`string`?e.stage:`stage`,transition:t,role:typeof e.role==`string`?e.role:void 0,turn:typeof e.turn==`number`?e.turn:void 0,duration_ms:typeof e.duration_ms==`number`?e.duration_ms:void 0}}return null}function Pv(e,t){let n=typeof t.ts==`number`?t.ts:Date.now()/1e3;if(e===`tool_call_started`||e===`tool_call_completed`){let r=typeof t.args_preview==`string`?t.args_preview:void 0,i=jv(r),a=e===`tool_call_started`?`running`:t.status===`error`?`error`:`ok`;return{schema:`0.events/v1`,kind:`tool_use`,ts:n,tool:typeof t.tool==`string`?t.tool:`?`,turn:typeof t.turn==`number`?t.turn:void 0,args_preview:r,file:i?.file,line:i?.line,status:a,duration_ms:typeof t.duration_ms==`number`?t.duration_ms:void 0}}return e===`finding_ingested`?{schema:`0.events/v1`,kind:`finding`,ts:n,finding_id:typeof t.finding_id==`string`?t.finding_id:void 0,title:typeof t.title==`string`?t.title:`Finding`,severity:typeof t.severity==`string`?t.severity.toLowerCase():void 0,category:typeof t.category==`string`?t.category:void 0,confidence:typeof t.confidence==`number`?t.confidence:void 0,file:typeof t.file==`string`?t.file:void 0,line:typeof t.line==`number`?t.line:void 0}:e===`step_started`||e===`step_completed`?{schema:`0.events/v1`,kind:`stage`,ts:n,stage:typeof t.step==`string`?t.step:`stage`,transition:e===`step_started`?`started`:`completed`,duration_ms:typeof t.duration_ms==`number`?t.duration_ms:void 0}:e===`agent_turn_started`||e===`agent_turn_completed`?{schema:`0.events/v1`,kind:`stage`,ts:n,stage:`turn ${typeof t.turn==`number`?t.turn:`?`}`,transition:e===`agent_turn_started`?`started`:`completed`,role:typeof t.role==`string`?t.role:void 0,turn:typeof t.turn==`number`?t.turn:void 0,duration_ms:typeof t.duration_ms==`number`?t.duration_ms:void 0}:null}var Fv=24,Iv=60,Lv=80;function Rv(e){return e>=.9?`text-destructive`:e>=.75?`text-amber-600 dark:text-amber-400`:e>=.5?`text-sky-600 dark:text-sky-400`:`text-muted-foreground`}function zv(e){return e>=.9?`bg-destructive/12`:e>=.75?`bg-amber-500/12`:e>=.5?`bg-sky-500/12`:``}function Bv(e){return e.toFixed(2)}function Vv(e,t){if(t===null)return new Date(e*1e3).toLocaleTimeString();let n=e-t;return n<0?`${n.toFixed(1)}s`:`+${n.toFixed(1)}s`}function Hv(e){let t=(e??``).toLowerCase();return t===`critical`||t===`high`?`danger`:t===`medium`?`warning`:t===`low`||t===`info`?`info`:`neutral`}function Uv(e,t,n){let r=null;for(let i of e){if(!i.file.endsWith(t)&&!t.endsWith(i.file)||n<i.start_line-20||n>i.end_line+20)continue;if(!r){r=i;continue}let e=Math.max(0,r.start_line-n,n-r.end_line);Math.max(0,i.start_line-n,n-i.end_line)<e&&(r=i)}return r}function Wv(){let e=Date.now()/1e3,t=e=>e;return[t({schema:`gemmaforge.events/v1`,kind:`scan.start`,ts:e,repo:`examples/express-app`,model_id:`google/gemma-4-E2B-it`,layer:17,chunker:`function`}),t({schema:`gemmaforge.events/v1`,kind:`scan.file`,ts:e+.4,file:`src/router.js`,chunks:12}),t({schema:`gemmaforge.events/v1`,kind:`probe.token`,ts:e+.6,token:`app.get(`,score:.14,position:1}),t({schema:`gemmaforge.events/v1`,kind:`probe.token`,ts:e+.7,token:`'/u/:id'`,score:.31,position:2}),t({schema:`gemmaforge.events/v1`,kind:`probe.token`,ts:e+.8,token:` db.query(`,score:.72,position:12}),t({schema:`gemmaforge.events/v1`,kind:`probe.token`,ts:e+.9,token:`'SELECT * FROM users WHERE id='`,score:.84,position:18}),t({schema:`gemmaforge.events/v1`,kind:`probe.token`,ts:e+1,token:` + req.params.id`,score:.93,position:23}),t({schema:`gemmaforge.events/v1`,kind:`probe.alarm`,ts:e+1.05,window:[38,52],top_cwe:`CWE-89`,confidence:.93}),t({schema:`gemmaforge.events/v1`,kind:`scan.lead`,ts:e+1.1,file:`src/router.js`,start_line:38,end_line:52,confidence:.93,top_cwe:`CWE-89`,rank:0}),t({schema:`gemmaforge.events/v1`,kind:`scan.file`,ts:e+1.4,file:`src/exec.js`,chunks:4}),t({schema:`gemmaforge.events/v1`,kind:`probe.token`,ts:e+1.6,token:`child_process.exec(`,score:.81,position:4}),t({schema:`gemmaforge.events/v1`,kind:`probe.token`,ts:e+1.7,token:" `ping ${host}`",score:.88,position:7}),t({schema:`gemmaforge.events/v1`,kind:`probe.alarm`,ts:e+1.78,window:[12,22],top_cwe:`CWE-78`,confidence:.87}),t({schema:`gemmaforge.events/v1`,kind:`scan.lead`,ts:e+1.82,file:`src/exec.js`,start_line:12,end_line:22,confidence:.87,top_cwe:`CWE-78`,rank:1}),t({schema:`gemmaforge.events/v1`,kind:`scan.end`,ts:e+2.4,files_seen:2,chunks_scored:16,leads_emitted:2,elapsed_seconds:2.4})]}function Gv(e){return[{schema:`0.events/v1`,kind:`stage`,ts:e+1.2,stage:`audit`,transition:`started`,role:`attack`},{schema:`0.events/v1`,kind:`tool_use`,ts:e+1.3,tool:`read_file`,turn:1,args_preview:`src/router.js:38`,file:`src/router.js`,line:38,status:`ok`,duration_ms:14},{schema:`0.events/v1`,kind:`tool_use`,ts:e+1.5,tool:`shell`,turn:1,args_preview:`grep -n 'db.query' src/router.js`,status:`ok`,duration_ms:47},{schema:`0.events/v1`,kind:`finding`,ts:e+1.9,finding_id:`f-001`,title:`SQL injection via req.params.id`,severity:`high`,category:`injection`,confidence:.92,file:`src/router.js`,line:42},{schema:`0.events/v1`,kind:`tool_use`,ts:e+2,tool:`read_file`,turn:2,args_preview:`src/exec.js:12`,file:`src/exec.js`,line:12,status:`ok`,duration_ms:9},{schema:`0.events/v1`,kind:`finding`,ts:e+2.3,finding_id:`f-002`,title:`Command injection in ping handler`,severity:`critical`,category:`rce`,confidence:.88,file:`src/exec.js`,line:17},{schema:`0.events/v1`,kind:`stage`,ts:e+2.5,stage:`audit`,transition:`completed`,role:`attack`,duration_ms:1300}]}function Kv(){let[e,t]=wn(),n=e.get(`events`)??``,r=e.get(`huntEvents`)??`/api/v1/presentation/events`,i=e.get(`demo`)===`1`,[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)([]),[l,u]=(0,S.useState)([]),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(`idle`),[x,C]=(0,S.useState)(`idle`),[w,T]=(0,S.useState)(null),[E,D]=(0,S.useState)(null),[O,k]=(0,S.useState)(n),[A,j]=(0,S.useState)(r),M=(0,S.useRef)(null),N=(0,S.useRef)(null),P=(0,S.useRef)(0),F=(0,S.useRef)([]);(0,S.useEffect)(()=>{F.current=l},[l]);let I=(0,S.useCallback)(()=>(P.current+=1,`evt-${P.current}`),[]),L=(0,S.useCallback)(e=>{switch(N.current===null&&typeof e.ts==`number`&&(N.current=e.ts),e.kind){case`scan.start`:m({repo:e.repo,model_id:e.model_id,layer:e.layer}),v(null),g([]);break;case`scan.file`:g(t=>t.includes(e.file)?t:[...t,e.file].slice(-12));break;case`probe.token`:{let t={id:I(),ts:e.ts,token:e.token,score:e.score,position:e.position??null};o(e=>[...e,t].slice(-240));break}case`probe.alarm`:{let t={id:I(),ts:e.ts,window:e.window,top_cwe:e.top_cwe??null,confidence:e.confidence};M.current=t,c(e=>[t,...e].slice(0,Fv));break}case`scan.lead`:{let t={id:I(),ts:e.ts,file:e.file,start_line:e.start_line,end_line:e.end_line,confidence:e.confidence,top_cwe:e.top_cwe??null,rank:e.rank??null,originatingAlarmId:M.current?.id??null};u(e=>[t,...e].slice(0,Iv));break}case`scan.end`:v({files_seen:e.files_seen,chunks_scored:e.chunks_scored,leads_emitted:e.leads_emitted,elapsed_seconds:e.elapsed_seconds})}},[I]),R=(0,S.useCallback)(e=>{N.current===null&&typeof e.ts==`number`&&(N.current=e.ts);let t=null;if((e.kind===`tool_use`||e.kind===`finding`)&&e.file&&typeof e.line==`number`)t=Uv(F.current,e.file,e.line)?.id??null;else if(e.kind===`tool_use`&&e.args_preview){let n=jv(e.args_preview);n&&(t=Uv(F.current,n.file,n.line)?.id??null)}let n={id:I(),ts:e.ts,event:e,citedLeadId:t};f(e=>[n,...e].slice(0,Lv))},[I]),z=(0,S.useCallback)(()=>{o([]),c([]),u([]),f([]),m(null),g([]),v(null),D(null),T(null),M.current=null,N.current=null},[]);(0,S.useEffect)(()=>{if(!i)return;z(),b(`open`),C(`open`);let e=Wv(),t=e[0]?.ts??Date.now()/1e3,n=Gv(t),r=[];for(let n of e){let e=Math.max(0,(n.ts-t)*1e3);r.push(setTimeout(()=>L(n),e))}for(let e of n){let n=Math.max(0,(e.ts-t)*1e3);r.push(setTimeout(()=>R(e),n))}let a=((e.at(-1)?.ts??t)-t)*1e3+300;return r.push(setTimeout(()=>{b(`closed`),C(`closed`)},a)),()=>{for(let e of r)clearTimeout(e)}},[i,L,R,z]),(0,S.useEffect)(()=>{if(i||!n)return;o([]),c([]),u([]),m(null),g([]),v(null),D(null),M.current=null,N.current=null,b(`connecting`);let e=null;try{e=kv(n)}catch(e){b(`error`),T(e instanceof Error?e.message:String(e));return}return e.onopen=()=>b(`open`),e.onerror=()=>{b(`error`),T(`Lost connection to the probe stream.`)},e.onmessage=e=>{let t=typeof e.data==`string`?e.data.trim():``;if(t)try{let e=JSON.parse(t);if(e.schema!==`gemmaforge.events/v1`)return;L(e)}catch(e){T(e instanceof Error?e.message:String(e))}},()=>{e?.close(),b(`closed`)}},[i,n,L]),(0,S.useEffect)(()=>{if(i||!r)return;f([]),C(`connecting`);let e=null;try{e=kv(r)}catch(e){C(`error`),T(e instanceof Error?e.message:String(e));return}e.onopen=()=>C(`open`),e.onerror=()=>{C(`error`),T(`Lost connection to the 0 stream.`)};let t=e=>{let t=typeof e.data==`string`?e.data.trim():``;if(!t)return;let n=Mv(t);n&&R(n)};return e.onmessage=t,e.addEventListener(`presentation`,t),()=>{e?.close(),C(`closed`)}},[i,r,R]);let ee=(0,S.useCallback)(()=>{let n=new URLSearchParams(e);n.delete(`demo`),O.trim()?n.set(`events`,O.trim()):n.delete(`events`),A.trim()?n.set(`huntEvents`,A.trim()):n.delete(`huntEvents`),t(n,{replace:!0})},[e,t,O,A]),B=(0,S.useCallback)(()=>{let n=new URLSearchParams(e);n.delete(`events`),n.delete(`huntEvents`),n.set(`demo`,`1`),t(n,{replace:!0})},[e,t]),V=(0,S.useCallback)(()=>{let n=new URLSearchParams(e);n.delete(`events`),n.delete(`huntEvents`),n.delete(`demo`),t(n,{replace:!0}),z(),b(`idle`),C(`idle`)},[e,z,t]),H=(0,S.useMemo)(()=>l.find(e=>e.id===E)??null,[l,E]),te=H?.originatingAlarmId??null,U=(0,S.useMemo)(()=>{let e=[y,x];return e.includes(`open`)?`open`:e.includes(`connecting`)?`connecting`:e.includes(`error`)?`error`:e.includes(`closed`)?`closed`:`idle`},[y,x]),ne=(0,S.useCallback)(e=>{e.citedLeadId&&D(t=>t===e.citedLeadId?null:e.citedLeadId)},[]);return(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsx)(q_,{title:`Live`,summary:``,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(qv,{state:U}),(0,W.jsxs)(J,{variant:i?`outline`:`accent`,onClick:B,children:[(0,W.jsx)(oa,{}),`Try demo`]}),(0,W.jsx)(J,{variant:`outline`,onClick:V,disabled:U===`idle`,children:`Stop`})]})}),(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Connect`})})}),(0,W.jsxs)(dp,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-widest text-muted-foreground/70 w-24`,children:`Probe`}),(0,W.jsx)(af,{value:O,onChange:e=>k(e.target.value),placeholder:`http://localhost:8765/events`,className:`min-w-[16rem] flex-1`}),(0,W.jsx)(qv,{state:y})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-widest text-muted-foreground/70 w-24`,children:`0 agent`}),(0,W.jsx)(af,{value:A,onChange:e=>j(e.target.value),placeholder:`http://localhost:8765/hunt-events`,className:`min-w-[16rem] flex-1`}),(0,W.jsx)(qv,{state:x})]}),(0,W.jsx)(`div`,{className:`flex justify-end`,children:(0,W.jsxs)(J,{onClick:ee,disabled:!O.trim()&&!A.trim(),children:[(0,W.jsx)(oo,{}),`Connect`]})}),p?(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[p.repo?(0,W.jsxs)(I_,{variant:`neutral`,children:[`repo `,p.repo]}):null,p.model_id?(0,W.jsxs)(I_,{variant:`neutral`,children:[`model `,p.model_id]}):null,h.length>0?(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`files: `,(0,W.jsx)(`span`,{className:`font-mono`,children:h.slice(-4).join(`, `)})]}):null]}):null,_?(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs`,children:[(0,W.jsx)(I_,{variant:`success`,children:`done`}),(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[_.files_seen??`?`,` files · `,_.chunks_scored??`?`,` chunks · `,_.leads_emitted??`?`,` leads · `,_.elapsed_seconds?.toFixed(1)??`?`,`s`]})]}):null,w?(0,W.jsx)(`div`,{className:`rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:w}):null]})]}),(0,W.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-3`,children:[(0,W.jsx)(Jv,{tokens:a,alarms:s,highlightedAlarmId:te,baseTs:N.current,onClearSelection:()=>D(null),hasSelection:H!==null}),(0,W.jsx)(Yv,{leads:l,baseTs:N.current,selectedLeadId:E,onSelectLead:e=>D(t=>t===e?null:e)}),(0,W.jsx)(Xv,{cards:d,selectedLead:H,selectedLeadId:E,baseTs:N.current,onCardClick:ne})]})]})}function qv({state:e}){return e===`open`?(0,W.jsxs)(I_,{variant:`success`,className:`gap-1.5`,children:[(0,W.jsx)(oo,{className:`size-3`}),` live`]}):e===`connecting`?(0,W.jsxs)(I_,{variant:`warning`,className:`gap-1.5`,children:[(0,W.jsx)(oo,{className:`size-3`}),` connecting`]}):e===`error`?(0,W.jsxs)(I_,{variant:`danger`,className:`gap-1.5`,children:[(0,W.jsx)(oo,{className:`size-3`}),` error`]}):e===`closed`?(0,W.jsxs)(I_,{variant:`neutral`,className:`gap-1.5`,children:[(0,W.jsx)(oo,{className:`size-3`}),` closed`]}):(0,W.jsxs)(I_,{variant:`neutral`,className:`gap-1.5`,children:[(0,W.jsx)(oo,{className:`size-3`}),` idle`]})}function Jv({tokens:e,alarms:t,highlightedAlarmId:n,baseTs:r,onClearSelection:i,hasSelection:a}){let o=(0,S.useRef)(null);return(0,S.useEffect)(()=>{let e=o.current;e&&(e.scrollTop=e.scrollHeight)},[e.length]),(0,W.jsxs)(sp,{className:`flex flex-col overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsxs)(lp,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Fo,{className:`size-4 text-primary-text`}),`Suspicious code`]})})}),(0,W.jsxs)(dp,{className:`flex flex-1 flex-col gap-3`,children:[t.length===0?null:(0,W.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,W.jsxs)(`div`,{className:`text-[10px] font-medium uppercase tracking-widest text-muted-foreground/70`,children:[`Flagged `,(0,W.jsxs)(`span`,{className:`text-muted-foreground/40`,children:[`(`,t.length,`)`]})]}),(0,W.jsx)(`div`,{className:`space-y-1.5`,children:t.slice(0,4).map(e=>(0,W.jsxs)(`div`,{className:q(`rounded-md border px-3 py-2 transition-colors`,n===e.id?`border-primary/40 bg-primary/8 ring-1 ring-primary/30`:`border-destructive/20 bg-destructive/5`),children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(Oo,{className:`size-3.5 text-destructive`}),(0,W.jsxs)(`span`,{className:`font-mono`,children:[`L`,e.window[0],`–`,e.window[1]]}),e.top_cwe?(0,W.jsx)(I_,{variant:`danger`,children:e.top_cwe}):null]}),(0,W.jsx)(`span`,{className:`font-mono text-destructive`,children:Bv(e.confidence)})]}),(0,W.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:Vv(e.ts,r)})]},e.id))}),a?(0,W.jsx)(J,{variant:`ghost`,size:`xs`,onClick:i,children:`Clear selection`}):null]}),(0,W.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,W.jsxs)(`div`,{className:`text-[10px] font-medium uppercase tracking-widest text-muted-foreground/70`,children:[`Code `,(0,W.jsxs)(`span`,{className:`text-muted-foreground/40`,children:[`(`,e.length,`)`]})]}),(0,W.jsx)(`div`,{ref:o,className:`max-h-[28rem] min-h-[12rem] overflow-y-auto rounded-md border border-border bg-muted/10 px-3 py-3 font-mono text-xs leading-relaxed`,children:e.length===0?(0,W.jsx)(`div`,{className:`text-muted-foreground`,children:`Waiting for code…`}):(0,W.jsx)(`div`,{className:`flex flex-wrap gap-x-0.5 gap-y-1`,children:e.map(e=>(0,W.jsx)(`span`,{title:`score ${Bv(e.score)} · pos ${e.position??`?`}`,className:q(`rounded-sm px-1 py-0.5`,Rv(e.score),zv(e.score)),children:e.token},e.id))})}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground`,children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-muted-foreground/50`}),` <0.5`]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-sky-500`}),` 0.5–0.75`]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-amber-500`}),` 0.75–0.9`]}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:`size-2 rounded-full bg-destructive`}),` ≥0.9`]})]})]})]})]})}function Yv({leads:e,baseTs:t,selectedLeadId:n,onSelectLead:r}){return(0,W.jsxs)(sp,{className:`flex flex-col overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsxs)(lp,{className:`flex items-center gap-2`,children:[(0,W.jsx)(ja,{className:`size-4 text-primary-text`}),`Leads`]})})}),(0,W.jsx)(dp,{className:`flex flex-1 flex-col`,children:e.length===0?(0,W.jsx)(hp,{children:`No leads yet.`}):(0,W.jsx)(`div`,{className:`max-h-[36rem] space-y-2 overflow-y-auto pr-1`,children:e.map(e=>{let i=e.id===n;return(0,W.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:q(`w-full rounded-md border px-3 py-3 text-left transition-colors`,i?`border-primary/40 bg-primary/8 ring-1 ring-primary/30`:`border-border bg-background hover:border-primary/20 hover:bg-primary/4`),children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`truncate font-mono text-xs text-foreground`,children:e.file}),(0,W.jsxs)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:[`lines `,e.start_line,`–`,e.end_line,` · `,Vv(e.ts,t)]})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[(0,W.jsx)(I_,{variant:`accent`,className:`font-mono`,children:Bv(e.confidence)}),e.top_cwe?(0,W.jsx)(I_,{variant:`danger`,children:e.top_cwe}):null]})]})},e.id)})})})]})}function Xv({cards:e,selectedLead:t,selectedLeadId:n,baseTs:r,onCardClick:i}){return(0,W.jsxs)(sp,{className:`flex flex-col overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsxs)(lp,{className:`flex items-center gap-2`,children:[(0,W.jsx)(ca,{className:`size-4 text-primary-text`}),`What 0 is doing`]})})}),(0,W.jsxs)(dp,{className:`flex flex-1 flex-col gap-3`,children:[t?(0,W.jsxs)(`div`,{className:`rounded-md border border-primary/20 bg-primary/4 px-3 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-medium uppercase tracking-widest text-primary-text`,children:[(0,W.jsx)(To,{className:`size-3`}),`Checking lead`]}),(0,W.jsx)(`div`,{className:`mt-1 truncate font-mono text-xs text-foreground`,children:t.file}),(0,W.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`lines `,t.start_line,`–`,t.end_line,` · `,Bv(t.confidence),t.top_cwe?` · ${t.top_cwe}`:``]})]}):null,e.length===0?(0,W.jsx)(hp,{children:`Waiting for 0…`}):(0,W.jsx)(`div`,{className:`max-h-[36rem] space-y-2 overflow-y-auto pr-1`,children:e.map(e=>(0,W.jsx)(Zv,{card:e,baseTs:r,highlightLead:n!==null&&e.citedLeadId===n,onClick:()=>i(e)},e.id))}),(0,W.jsx)(`div`,{className:`mt-auto pt-2`,children:(0,W.jsx)(J,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,W.jsx)(yn,{to:`/findings`,children:`View findings`})})})]})]})}function Zv({card:e,baseTs:t,highlightLead:n,onClick:r}){let i=e.event,a=e.citedLeadId!==null,o=q(`block w-full rounded-md border px-3 py-3 text-left transition-colors`,n?`border-primary/40 bg-primary/8 ring-1 ring-primary/30`:a?`border-border bg-background hover:border-primary/20 hover:bg-primary/4 cursor-pointer`:`border-border bg-background`),s=i.kind===`tool_use`?(0,W.jsx)(Qv,{event:i}):i.kind===`finding`?(0,W.jsx)($v,{event:i}):(0,W.jsx)(ey,{event:i}),c=(0,W.jsxs)(`div`,{className:`mt-2 flex items-center justify-between text-[10px] text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:Vv(e.ts,t)}),a?(0,W.jsx)(ra,{className:`size-3 text-primary-text`,"aria-label":`Show lead`}):null]});return a?(0,W.jsxs)(`button`,{type:`button`,onClick:r,className:o,children:[s,c]}):(0,W.jsxs)(`div`,{className:o,children:[s,c]})}function Qv({event:e}){let t=e.status===`ok`?`success`:e.status===`error`?`danger`:`warning`;return(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(Eo,{className:`size-3.5 shrink-0 text-primary-text`}),(0,W.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.tool})]}),(0,W.jsx)(I_,{variant:t,children:e.status??`running`})]}),e.args_preview?(0,W.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,title:e.args_preview,children:e.args_preview}):null,e.file?(0,W.jsxs)(`div`,{className:`font-mono text-[11px] text-primary-text`,children:[e.file,typeof e.line==`number`?`:${e.line}`:``]}):null]})}function $v({event:e}){return(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(Oo,{className:`size-3.5 shrink-0 text-destructive`}),(0,W.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.title})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[e.severity?(0,W.jsx)(I_,{variant:Hv(e.severity),children:e.severity}):null,typeof e.confidence==`number`?(0,W.jsx)(I_,{variant:`accent`,className:`font-mono`,children:Bv(e.confidence)}):null]})]}),e.category?(0,W.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e.category}):null,e.file?(0,W.jsxs)(`div`,{className:`font-mono text-[11px] text-primary-text`,children:[e.file,typeof e.line==`number`?`:${e.line}`:``]}):null]})}function ey({event:e}){let t=e.transition===`completed`?`success`:`neutral`;return(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(da,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.stage})]}),(0,W.jsx)(I_,{variant:t,children:e.transition})]}),typeof e.duration_ms==`number`&&e.duration_ms>0?(0,W.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.duration_ms,`ms`]}):null]})}var ty=Array.isArray,ny=e=>{if(!e)return``;if(typeof e==`string`)return e;if(typeof e==`number`)return``+e;let t=``;if(ty(e)){let n=e.length;for(let r=0;r<n;r++){let n=e[r];if(!n)continue;let i=typeof n==`string`?n:ny(n);i&&(t&&(t+=` `),t+=i)}return t}if(typeof e==`object`)for(let n in e)e[n]&&(t&&(t+=` `),t+=n);return t},ry=(e,t)=>{let n=e.length,r=t.length,i=Array(n+r);for(let t=0;t<n;t++)i[t]=e[t];for(let e=0;e<r;e++)i[n+e]=t[e];return i},iy=(e,t)=>({classGroupId:e,validator:t}),ay=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),oy=`-`,sy=[],cy=`arbitrary..`,ly=e=>{let t=fy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e[0]===`[`&&e[e.length-1]===`]`)return dy(e);let n=e.split(oy);return uy(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ry(i,t):t:i||sy}return n[e]||sy}}},uy=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=uy(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(oy):e.slice(t).join(oy),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},dy=e=>{let t=e.slice(1,-1),n=t.indexOf(`:`);if(n===-1)return;let r=t.slice(0,n);return r?cy+r:void 0},fy=e=>{let{theme:t,classGroups:n}=e;return py(n,t)},py=(e,t)=>{let n=ay();for(let r in e){let i=e[r];my(i,n,r,t)}return n},my=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];hy(i,t,n,r)}},hy=(e,t,n,r)=>{if(typeof e==`string`){gy(e,t,n);return}if(typeof e==`function`){_y(e,t,n,r);return}vy(e,t,n,r)},gy=(e,t,n)=>{let r=e===``?t:yy(t,e);r.classGroupId=n},_y=(e,t,n,r)=>{if(by(e)){my(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(iy(n,e))},vy=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];my(o,yy(t,a),n,r)}},yy=(e,t)=>{let n=e,r=t.split(oy),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ay(),n.nextPart.set(t,i)),n=i}return n},by=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,xy=58,Sy=47,Cy=91,wy=93,Ty=40,Ey=41,Dy=33,Oy=(e,t,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:void 0}),ky=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e.charCodeAt(s);if(n===0&&r===0){if(o===xy){t.push(e.slice(i,s)),i=s+1;continue}if(o===Sy){a=s;continue}}o===Cy?n++:o===wy?n--:o===Ty?r++:o===Ey&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1,u=s.length-1;s.charCodeAt(u)===Dy?(c=s.slice(0,-1),l=!0):s.charCodeAt(0)===Dy&&(c=s.slice(1),l=!0);let d=a&&a>i?a-i:void 0;return Oy(t,l,c,d)},Ay=e=>{let t=new Set(e.orderSensitiveModifiers);return e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);if(o||s){if(r.length>0){r.sort();for(let e=0;e<r.length;e++)n.push(r[e]);r=[]}n.push(a)}else r.push(a)}if(r.length>0){r.sort();for(let e=0;e<r.length;e++)n.push(r[e])}return n}},jy={isExternal:!0,classId:-1,conflictIds:[]},My=4096,Ny=e=>{let t=Ay(e),n=Py(e),{getClassGroupId:r,getConflictingClassGroupIds:i}=ly(e),a=Object.create(null),o=Object.create(null),s=0,c=new Int32Array(256),l=0,u=new Uint8Array(64),d=!1,f=e=>{let t=[],n=e.length,r=-1;d=!1;for(let i=0;i<n;i++){let n=e.charCodeAt(i);n===32?r!==-1&&(t.push(e.slice(r,i)),r=-1):n>=9&&n<=13?(d=!0,r!==-1&&(t.push(e.slice(r,i)),r=-1)):r===-1&&(r=i)}return r!==-1&&t.push(e.slice(r)),t},p=new Map,m=0,h=e=>{let t=p.get(e);if(t===void 0&&(t=m++,p.set(e,t),t>=c.length)){let e=new Int32Array(c.length*2);e.set(c),c=e}return t},g=e=>{let{isExternal:a,modifiers:o,hasImportantModifier:s,baseClassName:c,maybePostfixModifierPosition:l}=ky(e);if(a)return jy;let u=!!l,d;if(u){d=r(c.substring(0,l));let e=d&&n[d]?r(c):void 0;e&&e!==d&&(d=e,u=!1)}else d=r(c);if(!d){if(!u||(d=r(c),!d))return jy;u=!1}let f=o.length===0?``:o.length===1?o[0]:t(o).join(`:`),p=s?f+`!`:f,m=i(d,u),g=[];for(let e=0;e<m.length;e++)g.push(h(p+m[e]));return{isExternal:!1,classId:h(p+d),conflictIds:g}},_=e=>{let t=a[e];return t===void 0?(t=o[e],t===void 0&&(t=g(e)),a[e]=t,++s>My&&(s=0,o=a,a=Object.create(null)),t):t};return{parseClassName:ky,sortModifiers:t,postfixLookupClassGroupIds:n,getClassGroupId:r,getConflictingClassGroupIds:i,getClassDescriptor:_,mergeClassList:e=>{let t=f(e),n=t.length;if(n===1)return t[0];l=l+1|0,l===0&&(l=1);let r=l;if(n>u.length){let e=u.length;for(;e<n;)e*=2;u=new Uint8Array(e)}let i=!1,a=0;for(let e=n-1;e>=0;--e){let n=t[e];a+=n.length;let o=_(n);if(o.isExternal){u[e]=1;continue}let s=o.classId;if(c[s]===r){u[e]=0,i=!0;continue}c[s]=r;let l=o.conflictIds;for(let e=0;e<l.length;e++)c[l[e]]=r;u[e]=1}if(!i&&!d&&e.length===a+n-1)return e;let o=``;for(let e=0;e<n;e++)u[e]===1&&(o&&(o+=` `),o+=t[e]);return o}}},Py=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Fy=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Iy(n))&&(i&&(i+=` `),i+=r);return i},Iy=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Iy(e[r]))&&(n&&(n+=` `),n+=t);return n},Ly=500,Ry=e=>{let t,n,r=Object.create(null),i=Object.create(null),a=0,o=r=>(t=Ny(e()),n=t.mergeClassList,c.mergeString=s,s(r)),s=e=>{let t=r[e];return t===void 0?(t=i[e],t===void 0&&(t=n(e)),r[e]=t,++a>Ly&&(a=0,i=r,r=Object.create(null)),t):t},c=(...e)=>c.mergeString(Fy(...e));return c.mergeString=o,c},zy=[],By=e=>{let t=t=>t[e]||zy;return t.isThemeGetter=!0,t},Vy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Uy=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Wy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gy=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ky=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yy=Number,Xy=Number.isNaN,Zy=Number.isInteger,Qy=e=>Uy.test(e),$y=e=>!!e&&!Xy(Yy(e)),eb=e=>!!e&&Zy(Yy(e)),tb=e=>e.endsWith(`%`)&&$y(e.slice(0,-1)),nb=e=>Wy.test(e),rb=()=>!0,ib=e=>Gy.test(e)&&!Ky.test(e),ab=()=>!1,ob=e=>qy.test(e),sb=e=>Jy.test(e),cb=e=>!db(e)&&!yb(e),lb=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),ub=e=>Db(e,jb,ab),db=e=>Vy.test(e),fb=e=>Db(e,Mb,ib),pb=e=>Db(e,Nb,$y),mb=e=>Db(e,Fb,rb),hb=e=>Db(e,Pb,ab),gb=e=>Db(e,kb,ab),_b=e=>Db(e,Ab,sb),vb=e=>Db(e,Ib,ob),yb=e=>Hy.test(e),bb=e=>Ob(e,Mb),xb=e=>Ob(e,Pb),Sb=e=>Ob(e,kb),Cb=e=>Ob(e,jb),wb=e=>Ob(e,Ab),Tb=e=>Ob(e,Ib,!0),Eb=e=>Ob(e,Fb,!0),Db=(e,t,n)=>{let r=Vy.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ob=(e,t,n=!1)=>{let r=Hy.exec(e);return r?r[1]?t(r[1]):n:!1},kb=e=>e===`position`||e===`percentage`,Ab=e=>e===`image`||e===`url`,jb=e=>e===`length`||e===`size`||e===`bg-size`,Mb=e=>e===`length`,Nb=e=>e===`number`,Pb=e=>e===`family-name`,Fb=e=>e===`number`||e===`weight`,Ib=e=>e===`shadow`,Lb=Ry(()=>{let e=By(`color`),t=By(`font`),n=By(`text`),r=By(`font-weight`),i=By(`tracking`),a=By(`leading`),o=By(`breakpoint`),s=By(`container`),c=By(`spacing`),l=By(`radius`),u=By(`shadow`),d=By(`inset-shadow`),f=By(`text-shadow`),p=By(`drop-shadow`),m=By(`blur`),h=By(`perspective`),g=By(`aspect`),_=By(`ease`),v=By(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),yb,db],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[yb,db,c],T=()=>[Qy,`full`,`auto`,...w()],E=()=>[eb,`none`,`subgrid`,yb,db],D=()=>[`auto`,{span:[`full`,eb,yb,db]},eb,yb,db],O=()=>[eb,`auto`,yb,db],k=()=>[`auto`,`min`,`max`,`fr`,yb,db],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Qy,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Qy,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Qy,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,yb,db],L=()=>[...b(),Sb,gb,{position:[yb,db]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,Cb,ub,{size:[yb,db]}],ee=()=>[tb,bb,fb],B=()=>[``,`none`,`full`,l,yb,db],V=()=>[``,$y,bb,fb],H=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],U=()=>[$y,tb,Sb,gb],ne=()=>[``,`none`,m,yb,db],re=()=>[`none`,$y,yb,db],ie=()=>[`none`,$y,yb,db],ae=()=>[$y,yb,db],oe=()=>[Qy,`full`,...w()];return{theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[nb],breakpoint:[nb],color:[rb],container:[nb],"drop-shadow":[nb],ease:[`in`,`out`,`in-out`],font:[cb],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[nb],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[nb],shadow:[nb],spacing:[`px`,$y],text:[nb],"text-shadow":[nb],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Qy,db,yb,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,yb,db]}],"container-named":[lb],columns:[{columns:[$y,db,yb,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[eb,`auto`,yb,db]}],basis:[{basis:[Qy,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[$y,Qy,`auto`,`initial`,`none`,db]}],grow:[{grow:[``,$y,yb,db]}],shrink:[{shrink:[``,$y,yb,db]}],order:[{order:[eb,`first`,`last`,`none`,yb,db]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,bb,fb]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Eb,mb]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,tb,db]}],"font-family":[{font:[xb,hb,t]}],"font-features":[{"font-features":[db]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,yb,db]}],"line-clamp":[{"line-clamp":[$y,`none`,yb,pb]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,yb,db]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,yb,db]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...H(),`wavy`]}],"text-decoration-thickness":[{decoration:[$y,`from-font`,`auto`,yb,fb]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[$y,`auto`,yb,db]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[eb,yb,db]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,yb,db]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,yb,db]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},eb,yb,db],radial:[``,yb,db],conic:[eb,yb,db]},wb,_b]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...H(),`hidden`,`none`]}],"divide-style":[{divide:[...H(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...H(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[$y,yb,db]}],"outline-w":[{outline:[``,$y,bb,fb]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Tb,vb]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Tb,vb]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[$y,fb]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Tb,vb]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[$y,yb,db]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[$y]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[yb,db]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[$y]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,yb,db]}],filter:[{filter:[``,`none`,yb,db]}],blur:[{blur:ne()}],brightness:[{brightness:[$y,yb,db]}],contrast:[{contrast:[$y,yb,db]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Tb,vb]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,$y,yb,db]}],"hue-rotate":[{"hue-rotate":[$y,yb,db]}],invert:[{invert:[``,$y,yb,db]}],saturate:[{saturate:[$y,yb,db]}],sepia:[{sepia:[``,$y,yb,db]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,yb,db]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[$y,yb,db]}],"backdrop-contrast":[{"backdrop-contrast":[$y,yb,db]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,$y,yb,db]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$y,yb,db]}],"backdrop-invert":[{"backdrop-invert":[``,$y,yb,db]}],"backdrop-opacity":[{"backdrop-opacity":[$y,yb,db]}],"backdrop-saturate":[{"backdrop-saturate":[$y,yb,db]}],"backdrop-sepia":[{"backdrop-sepia":[``,$y,yb,db]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,yb,db]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[$y,`initial`,yb,db]}],ease:[{ease:[`linear`,`initial`,_,yb,db]}],delay:[{delay:[$y,yb,db]}],animate:[{animate:[`none`,v,yb,db]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,yb,db]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[yb,db,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],zoom:[{zoom:[eb,yb,db]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,yb,db]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,yb,db]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[$y,bb,fb,pb]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),Rb=8,zb=new WeakMap,Bb=(e,t)=>{let n=t.length,r=!0;for(let e=0;e<n;e++){let n=t[e];if(n&&typeof n!=`string`){r=!1;break}}if(r){let r=zb.get(e);if(r!==void 0)for(let e=0;e<r.length;e++){let i=r[e],a=i.values,o=!0;for(let e=0;e<n;e++)if(a[e]!==t[e]){o=!1;break}if(o)return i.result}}let i=e[0];for(let r=0;r<n;r++){let n=t[r];n&&(i+=typeof n==`string`?n:ny(n)),i+=e[r+1]}let a=Lb.mergeString(i);if(r){let n=zb.get(e);n===void 0&&(n=[],zb.set(e,n)),n.length>=Rb&&n.shift(),n.push({values:t,result:a})}return a},Vb=(()=>{let e=Error();return!(`line`in e)&&!(`lineNumber`in e)})(),Hb=64,Ub=500,Wb=new Map,Gb=new Map,Kb=0,qb=e=>{let t=e.length,n=``,r=-1,i=0,a=!0;for(let o=0;o<t;o++){let t=e[o];if(t){if(typeof t!=`string`){a=!1;break}r===-1&&(n=t,r=o),i++}}if(a){if(i===0)return``;if(i===1)return Lb.mergeString(n);let a=Wb.get(n);if(a===void 0&&(a=Gb.get(n)),a!==void 0)for(let n=0;n<a.length;n++){let o=a[n],s=o.rest;if(s.length!==i-1)continue;let c=0,l=!0;for(let n=r+1;n<t;n++){let t=e[n];if(t&&t!==s[c++]){l=!1;break}}if(l)return o.result}let o=n,s=[];for(let n=r+1;n<t;n++){let t=e[n];t&&(o+=` `+t,s.push(t))}let c=Lb.mergeString(o),l=Wb.get(n);return l===void 0&&(l=[],Wb.set(n,l)),l.length>=Hb&&l.shift(),l.push({rest:s,result:c}),++Kb>Ub&&(Kb=0,Gb=Wb,Wb=new Map),c}let o=``;for(let n=0;n<t;n++){let t=e[n];if(!t)continue;let r=typeof t==`string`?t:ny(t);r&&(o&&(o+=` `),o+=r)}return Lb.mergeString(o)},Jb=function(){let e=arguments[0];if(Array.isArray(e)&&`raw`in e){let t=e,n=arguments.length,r=[];for(let e=1;e<n;e++)r.push(arguments[e]);return Bb(t,r)}let t=arguments.length;if(t===1)return typeof e==`string`?Lb.mergeString(e):Lb.mergeString(ny(e));if(Vb){let e=[];for(let n=0;n<t;n++)e.push(arguments[n]);return qb(e)}let n=``;for(let e=0;e<t;e++){let t=arguments[e];if(!t)continue;let r=typeof t==`string`?t:ny(t);r&&(n&&(n+=` `),n+=r)}return Lb.mergeString(n)};function Yb(e,t,n){let r=e[t];return r===void 0?(console.warn(`[kumo] Unknown variant "${t}". Expected one of: ${Object.keys(e).join(`, `)}. Falling back to "${n}".`),e[n]):r}var Xb=(0,S.forwardRef)(function({to:e,href:t,...n},r){return(0,W.jsx)(`a`,{ref:r,href:t??e??void 0,...n})}),Zb=(0,S.createContext)(Xb);function Qb(){return(0,S.useContext)(Zb)}var $b={};function ex(e,t){let n=S.useRef($b);return n.current===$b&&(n.current=e(t)),n}function tx(e,t,n,r){let i=ex(rx).current;return ix(i,e,t,n,r)&&ox(i,[e,t,n,r]),i.callback}function nx(e){let t=ex(rx).current;return ax(t,e)&&ox(t,e),t.callback}function rx(){return{callback:null,cleanup:null,refs:[]}}function ix(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function ax(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ox(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var sx=19;function cx(e){return sx>=e}function lx(e){if(!S.isValidElement(e))return null;let t=e,n=t.props;return(cx(19)?n?.ref:t.ref)??null}function ux(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var dx=new Set;function fx(e,t){return function(...n){{let r=n.join(` `),i=t?`${t}: ${r}`:r,a=`${e}:${i}`;dx.has(a)||(dx.add(a),e===`warn`?console.warn(i):console.error(i))}}}var px=fx(`warn`,`Base UI`);function mx(){}var hx=Object.freeze([]),gx=Object.freeze({});function _x(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function vx(e,t){return typeof e==`function`?e(t):e}function yx(e,t){return typeof e==`function`?e(t):e}var bx={};function xx(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Cx(t);let a=Cx(e);return t&&(a=wx(a,t)),n&&(a=wx(a,n)),r&&(a=wx(a,r)),i&&(a=wx(a,i)),a}function Sx(e){if(e.length===0)return bx;if(e.length===1)return Cx(e[0]);let t=Cx(e[0]);for(let n=1;n<e.length;n+=1)t=wx(t,e[n]);return t}function Cx(e){return Ox(e)?{...kx(e,bx)}:Tx(e)}function wx(e,t){return Ox(t)?kx(t,e):Ex(e,t)}function Tx(e){let t={...e};for(let e in t){let n=t[e];Dx(e,n)&&(t[e]=jx(n))}return t}function Ex(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ux(e.style,r);break;case`className`:e[n]=Nx(e.className,r);break;default:e[n]=Dx(n,r)?Ax(e[n],r):r}}return e}function Dx(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Ox(e){return typeof e==`function`}function kx(e,t){return Ox(e)?e(t):e??bx}function Ax(e,t){return t?e?(...n)=>{let r=n[0];if(Px(r)){let i=r;Mx(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:jx(t):e}function jx(e){return e&&((...t)=>{let n=t[0];return Px(n)&&Mx(n),e(...t)})}function Mx(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Nx(e,t){return t?e?t+` `+e:t:e}function Px(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Fx(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Vx(r));let i=Ix(t,n,r);if(n.enabled===!1)return null;let a=n.state??gx;return Hx(e,r,i,a)}function Ix(e,t,n){let{className:r,style:i}=e,{state:a=gx,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?vx(r,a):void 0,d=l?yx(i,a):void 0,f=l?_x(a,c):gx,p=l&&s?Lx(s):void 0,m=l?ux(f,p)??{}:gx;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?nx([m.ref,lx(n),...o]):tx(m.ref,lx(n),o):tx(null,null)),l?(u!==void 0&&(m.className=Nx(m.className,u)),d!==void 0&&(m.style=ux(m.style,d)),m):gx}function Lx(e){return Array.isArray(e)?Sx(e):xx(void 0,e)}var Rx=Symbol.for(`react.lazy`),zx=/^[A-Z][A-Za-z0-9$]*$/,Bx=/[a-z]/;function Vx(e){if(e?.$$typeof!==Rx)return e;let t=S.Children.toArray(e)[0];return S.isValidElement(t)?t:e}function Hx(e,t,n,r){if(t){if(typeof t==`function`)return Ux(t),t(n,r);let e=xx(n,t.props);if(e.ref=n.ref,!S.isValidElement(t))throw Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.",`https://base-ui.com/r/invalid-render-prop`].join(`
65
+ `));return S.cloneElement(t,e)}if(e&&typeof e==`string`)return Wx(e,n);throw Error(`Base UI: Render element or function are not defined.`)}function Ux(e){let t=e.name;t.length!==0&&zx.test(t)&&Bx.test(t)&&px(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.",`If this is an intentional render callback, rename it to start with a lowercase letter.`,"Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.",`https://base-ui.com/r/invalid-render-prop`)}function Wx(e,t){return e===`button`?(0,S.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,S.createElement)(`img`,{alt:``,...t,key:t.key}):S.createElement(e,t)}var Gx={size:{sm:{value:16,description:`Small loader for inline use`},base:{value:24,description:`Default loader size`},lg:{value:32,description:`Large loader for prominent loading states`}}},Kx={size:`base`};function qx({size:e=Kx.size}={}){return typeof e==`number`?e:Yb(Gx.size,e,Kx.size).value}var Jx=({className:e,size:t=Kx.size,"aria-label":n=`Loading`})=>{let r=qx({size:t});return(0,W.jsxs)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,stroke:`currentColor`,className:e,style:{height:r,width:r},role:`status`,"aria-label":n,children:[(0,W.jsxs)(`circle`,{cx:`12`,cy:`12`,r:`9.5`,fill:`none`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,W.jsx)(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 12 12`,to:`360 12 12`,dur:`2s`,repeatCount:`indefinite`}),(0,W.jsx)(`animate`,{attributeName:`stroke-dasharray`,values:`0 150;42 150;42 150`,keyTimes:`0;0.5;1`,dur:`1.5s`,repeatCount:`indefinite`}),(0,W.jsx)(`animate`,{attributeName:`stroke-dashoffset`,values:`0;-16;-59`,keyTimes:`0;0.5;1`,dur:`1.5s`,repeatCount:`indefinite`})]}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9.5`,fill:`none`,opacity:.1,strokeWidth:`2`,strokeLinecap:`round`})]})},Yx=(0,S.createContext)(null);function Xx(){return(0,S.useContext)(Yx)}var Y=typeof document<`u`?S.useLayoutEffect:()=>{},Zx={...S};function Qx(){return typeof window<`u`}function $x(e){return nS(e)?(e.nodeName||``).toLowerCase():`#document`}function eS(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tS(e){return((nS(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function nS(e){return Qx()?e instanceof Node||e instanceof eS(e).Node:!1}function rS(e){return Qx()?e instanceof Element||e instanceof eS(e).Element:!1}function iS(e){return Qx()?e instanceof HTMLElement||e instanceof eS(e).HTMLElement:!1}function aS(e){return!Qx()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof eS(e).ShadowRoot}function oS(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=_S(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function sS(e){return/^(table|td|th)$/.test($x(e))}function cS(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var lS=/transform|translate|scale|rotate|perspective|filter/,uS=/paint|layout|strict|content/,dS=e=>!!e&&e!==`none`,fS;function pS(e){let t=rS(e)?_S(e):e;return dS(t.transform)||dS(t.translate)||dS(t.scale)||dS(t.rotate)||dS(t.perspective)||!hS()&&(dS(t.backdropFilter)||dS(t.filter))||lS.test(t.willChange||``)||uS.test(t.contain||``)}function mS(e){let t=yS(e);for(;iS(t)&&!gS(t);){if(pS(t))return t;if(cS(t))return null;t=yS(t)}return null}function hS(){return fS??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),fS}function gS(e){return/^(html|body|#document)$/.test($x(e))}function _S(e){return eS(e).getComputedStyle(e)}function vS(e){return rS(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yS(e){if($x(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||aS(e)&&e.host||tS(e);return aS(t)?t.host:t}function bS(e){let t=yS(e);return gS(t)?(e.ownerDocument||e).body:iS(t)&&oS(t)?t:bS(t)}function xS(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=bS(e),i=r===e.ownerDocument?.body,a=eS(r);if(i){let e=SS(a);return t.concat(a,a.visualViewport||[],oS(r)?r:[],e&&n?xS(e):[])}return t.concat(r,xS(r,[],n))}function SS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var CS=Math.min,wS=Math.max,TS=Math.round,ES=Math.floor,DS=e=>({x:e,y:e}),OS={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function kS(e,t,n){return wS(e,CS(t,n))}function AS(e,t){return typeof e==`function`?e(t):e}function jS(e){return e.split(`-`)[0]}function MS(e){return e.split(`-`)[1]}function NS(e){return e===`x`?`y`:`x`}function PS(e){return e===`y`?`height`:`width`}function FS(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function IS(e){return NS(FS(e))}function LS(e,t,n){n===void 0&&(n=!1);let r=MS(e),i=IS(e),a=PS(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=KS(o)),[o,KS(o)]}function RS(e){let t=KS(e);return[zS(e),t,zS(t)]}function zS(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var BS=[`left`,`right`],VS=[`right`,`left`],HS=[`top`,`bottom`],US=[`bottom`,`top`];function WS(e,t,n){switch(e){case`top`:case`bottom`:return n?t?VS:BS:t?BS:VS;case`left`:case`right`:return t?HS:US;default:return[]}}function GS(e,t,n,r){let i=MS(e),a=WS(jS(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(zS)))),a}function KS(e){let t=jS(e);return OS[t]+e.slice(t.length)}function qS(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function JS(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:qS(e)}function YS(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function XS(e,t,n){let{reference:r,floating:i}=e,a=FS(t),o=IS(t),s=PS(o),c=jS(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=MS(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ZS(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=AS(t,e),p=JS(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=YS(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=YS(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var QS=50,$S=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ZS},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=XS(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<QS&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=XS(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},eC=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=AS(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=jS(r),_=FS(o),v=jS(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[KS(o)]:RS(o)),x=p!==`none`;!d&&x&&b.push(...GS(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=LS(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===FS(t)||T.every(e=>FS(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=FS(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},tC=new Set([`left`,`top`]);async function nC(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=jS(n),s=MS(n),c=FS(n)===`y`,l=tC.has(o)?-1:1,u=a&&c?-1:1,d=AS(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var rC=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await nC(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},iC=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=AS(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=FS(i),p=NS(f),m=u[p],h=u[f],g=(e,t)=>kS(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},aC=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=AS(e,t),u={x:n,y:r},d=FS(i),f=NS(d),p=u[f],m=u[d],h=AS(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=tC.has(jS(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},oC=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=AS(e,t),c=await i.detectOverflow(t,s),l=jS(n),u=MS(n),d=FS(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=CS(p-c[m],g),y=CS(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*wS(c.left,c.right):S=p-2*wS(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function sC(e){let t=_S(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=iS(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=TS(n)!==a||TS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cC(e){return rS(e)?e:e.contextElement}function lC(e){let t=cC(e);if(!iS(t))return DS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=sC(t),o=(a?TS(n.width):n.width)/r,s=(a?TS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var uC=DS(0);function dC(e){let t=eS(e);return!hS()||!t.visualViewport?uC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fC(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===eS(e)}function pC(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cC(e),o=DS(1);t&&(r?rS(r)&&(o=lC(r)):o=lC(e));let s=fC(a,n,r)?dC(a):DS(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=eS(a),t=rS(r)?eS(r):r,n=e,i=SS(n);for(;i&&t!==n;){let e=lC(i),t=i.getBoundingClientRect(),r=_S(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=eS(i),i=SS(n)}}return YS({width:u,height:d,x:c,y:l})}function mC(e,t){let n=vS(e).scrollLeft;return t?t.left+n:pC(tS(e)).left+n}function hC(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-mC(e,n),y:n.top+t.scrollTop}}function gC(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=tS(r),s=t?cS(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=DS(1),u=DS(0),d=iS(r);if((d||!a)&&(($x(r)!==`body`||oS(o))&&(c=vS(r)),d)){let e=pC(r);l=lC(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?hC(o,c):DS(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function _C(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function vC(e){let t=vS(e),n=e.ownerDocument.body,r=wS(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=wS(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+mC(e),o=-t.scrollTop;return _S(n).direction===`rtl`&&(a+=wS(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var yC=25;function bC(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=eS(e),a=tS(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!hS()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(mC(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=yC&&(s-=o)}return{width:s,height:c,x:l,y:u}}function xC(e,t){let n=pC(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=lC(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function SC(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=bC(e,n,t);else if(t===`document`)r=vC(tS(e));else if(rS(t))r=xC(t,n);else{let n=dC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return YS(r)}function CC(e,t){let n=t.get(e);if(n)return n;let r=xS(e,[],!1).filter(e=>rS(e)&&$x(e)!==`body`),i=null,a=_S(e).position===`fixed`,o=a?yS(e):e;for(;rS(o)&&!gS(o);){let e=_S(o),t=pS(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=yS(o)}return t.set(e,r),r}function wC(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?cS(t)?[]:CC(t,this._c):[].concat(n),r],o=SC(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=SC(t,a[e],i);s=wS(n.top,s),c=CS(n.right,c),l=CS(n.bottom,l),u=wS(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function TC(e){let{width:t,height:n}=sC(e);return{width:t,height:n}}function EC(e,t,n){let r=iS(t),i=tS(t),a=n===`fixed`,o=pC(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=DS(0);if((r||!a)&&(($x(t)!==`body`||oS(i))&&(s=vS(t)),r)){let e=pC(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=mC(i));let l=i&&!r&&!a?hC(i,s):DS(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function DC(e){return _S(e).position===`static`}function OC(e,t){if(!iS(e)||_S(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return tS(e)===n&&(n=n.ownerDocument.body),n}function kC(e,t){let n=eS(e);if(cS(e))return n;if(!iS(e)){let t=yS(e);for(;t&&!gS(t);){if(rS(t)&&!DC(t))return t;t=yS(t)}return n}let r=OC(e,t);for(;r&&sS(r)&&DC(r);)r=OC(r,t);return r&&gS(r)&&DC(r)&&!pS(r)?n:r||mS(e)||n}var AC=async function(e){let t=this.getOffsetParent||kC,n=this.getDimensions,r=await n(e.floating);return{reference:EC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jC(e){return _S(e).direction===`rtl`}var MC={convertOffsetParentRelativeRectToViewportRelativeRect:gC,getDocumentElement:tS,getClippingRect:wC,getOffsetParent:kC,getElementRects:AC,getClientRects:_C,getDimensions:TC,getScale:lC,isElement:rS,isRTL:jC};function NC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function PC(e,t,n){let r=null,i,a=tS(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=ES(d),h=ES(a.clientWidth-(u+f)),g=ES(a.clientHeight-(d+p)),_=ES(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:wS(0,CS(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!NC(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=eS(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function FC(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=cC(e),u=i||a?[...l?xS(l):[],...t?xS(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?PC(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?pC(e):null;c&&g();function g(){let t=pC(e);h&&!NC(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var IC=rC,LC=iC,RC=eC,zC=oC,BC=aC,VC=(e,t,n)=>{let r=new Map,i=n??{},a={...MC,...i.platform,_c:r};return $S(e,t,{...i,platform:a})},HC=typeof document<`u`?S.useLayoutEffect:function(){};function UC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!UC(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!UC(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function WC(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function GC(e,t){let n=WC(e);return Math.round(t*n)/n}function KC(e){let t=S.useRef(e);return HC(()=>{t.current=e}),t}function qC(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=S.useState(r);UC(f,r)||p(r);let[m,h]=S.useState(null),[g,_]=S.useState(null),v=S.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=S.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),b=a||m,x=o||g,C=S.useRef(null),w=S.useRef(null),T=S.useRef(u),E=c!=null,D=KC(c),O=KC(i),k=KC(l),A=S.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),VC(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!UC(T.current,t)&&(T.current=t,Kc.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);HC(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=S.useRef(!1);HC(()=>(j.current=!0,()=>{j.current=!1}),[]),HC(()=>{if(b&&(C.current=b),x&&(w.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,E]);let M=S.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=S.useMemo(()=>({reference:b,floating:x}),[b,x]),P=S.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=GC(N.floating,u.x),r=GC(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...WC(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var JC=(e,t)=>{let n=IC(e);return{name:n.name,fn:n.fn,options:[e,t]}},YC=(e,t)=>{let n=LC(e);return{name:n.name,fn:n.fn,options:[e,t]}},XC=(e,t)=>({fn:BC(e).fn,options:[e,t]}),ZC=(e,t)=>{let n=RC(e);return{name:n.name,fn:n.fn,options:[e,t]}},QC=(e,t)=>{let n=zC(e);return{name:n.name,fn:n.fn,options:[e,t]}};function $C(){if(typeof navigator>`u`)return{userAgent:``,platform:``,maxTouchPoints:0};{let e=navigator.userAgentData;if(e&&Array.isArray(e.brands))return{userAgent:e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `),platform:e.platform??navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}return{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ew,platform:tw,maxTouchPoints:nw}=$C(),rw=ew.toLowerCase(),iw=tw.toLowerCase(),aw=/^i(os$|p)/.test(iw)||iw===`macintel`&&nw>1,ow=`android`,sw=iw===ow||rw.includes(ow),cw=!aw&&iw.startsWith(`mac`);iw.startsWith(`win`),!sw&&/^(linux|chrome os)/.test(iw);var lw=cw||aw,uw=/jsdom|happydom/.test(rw);function dw(e){e.preventDefault(),e.stopPropagation()}function fw(e){return`nativeEvent`in e}function pw(e){return e.pointerType===``&&e.isTrusted?!0:sw&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function mw(e){return uw?!1:!sw&&e.width===0&&e.height===0||sw&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function hw(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function gw(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function _w(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function vw(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&aS(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function yw(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var bw=`data-base-ui-focusable`,xw=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Sw=`ArrowLeft`,Cw=`ArrowRight`,ww=`ArrowUp`,Tw=`ArrowDown`,Ew=`data-starting-style`,Dw=`data-ending-style`,Ow={[Ew]:``},kw={[Dw]:``},Aw={transitionStatus(e){return e===`starting`?Ow:e===`ending`?kw:null}},jw=`data-open`,Mw=`data-closed`,Nw=`data-anchor-hidden`,Pw=`data-popup-open`,Fw=`data-pressed`,Iw={[Pw]:``},Lw={[Pw]:``,[Fw]:``},Rw={[jw]:``},zw={[Mw]:``},Bw={[Nw]:``},Vw={open(e){return e?Iw:null}},Hw={open(e){return e?Lw:null}},Uw={open(e){return e?Rw:zw},anchorHidden(e){return e?Bw:null}},Ww={...Uw,...Aw},Gw=`data-trigger-disabled`;function Kw(e,t){if(!rS(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Gw);for(let[,e]of t.entries())if(vw(e,n))return!e.hasAttribute(Gw);return!1}function qw(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Jw(e){return e.matches(`html,body`)}function Yw(e){return iS(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Xw(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${xw}`)!=null}function Zw(e){return e?e.getAttribute(`role`)===`combobox`&&Yw(e):!1}function Qw(e){if(!e||uw)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function $w(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function eT(e){return e?.ownerDocument||document}function tT(e,t){return t<0||t>=e.length}function nT(e,t){return iT(e.current,{disabledIndices:t})}function rT(e,t){return iT(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function iT(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&aT(e,a,r));return a}function aT(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!sT(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function oT(e){return e.visibility===`hidden`||e.visibility===`collapse`}function sT(e,t=e?_S(e):null){return!e||!e.isConnected||!t||oT(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var cT=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function lT(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return aS(n)?n.host:null}function uT(e){for(let t of Array.from(e.children))if($x(t)===`summary`)return t;return null}function dT(e,t){let n=uT(t);return!!n&&(e===n||vw(n,e))}function fT(e){let t=e?$x(e):``;return e!=null&&e.matches(cT)&&(t!==`summary`||e.parentElement!=null&&$x(e.parentElement)===`details`&&uT(e.parentElement)===e)&&(t!==`details`||uT(e)==null)&&(t!==`input`||e.type!==`hidden`)}function pT(e){if(!fT(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=lT(t)){let n=t!==e,r=$x(t)===`slot`;if(t.hasAttribute(`inert`)||n&&$x(t)===`details`&&!t.open&&!dT(e,t)||t.hasAttribute(`hidden`)||!r&&!mT(t,n))return!1}return!0}function mT(e,t){let n=_S(e);return t?n.display!==`none`:sT(e,n)}function hT(e){let t=e.tabIndex;if(t<0){let t=$x(e);if(t===`details`||t===`audio`||t===`video`||iS(e)&&e.isContentEditable)return 0}return t}function gT(e){if($x(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function _T(e,t){let n=gT(e);if(!n)return!0;let r=t.find(e=>{let t=gT(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=gT(e);return t?.name===n.name&&t.form===n.form})===n}function vT(e){if(iS(e)&&$x(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return iS(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function yT(e,t){vT(e).forEach(e=>{fT(e)&&t.push(e),yT(e,t)})}function bT(e,t,n){vT(e).forEach(e=>{iS(e)&&e.matches(t)&&n.push(e),bT(e,t,n)})}function xT(e){return pT(e)&&hT(e)>=0}function ST(e){let t=[];return yT(e,t),t.filter(pT)}function CT(e){let t=ST(e);return t.filter(e=>hT(e)>=0&&_T(e,t))}function wT(e,t){let n=CT(e),r=n.length;if(r===0)return;let i=_w(eT(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function TT(e){return wT(eT(e).body,1)||e}function ET(e){return wT(eT(e).body,-1)||e}function DT(e,t){if(!e)return null;let n=CT(eT(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function OT(e){return DT(e,1)}function kT(e){return DT(e,-1)}function AT(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!vw(n,r)}function jT(e){CT(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function MT(e){let t=[];bT(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var NT=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!NT&&rw.includes(`firefox`),!NT&&rw.includes(`chrom`);var PT=`none`,FT=`trigger-press`,IT=`trigger-hover`,LT=`trigger-focus`,RT=`outside-press`,zT=`item-press`,BT=`close-press`,VT=`track-press`,HT=`input-change`,UT=`focus-out`,WT=`escape-key`,GT=`list-navigation`,KT=`keyboard`,qT=`drag`,JT=`cancel-open`,YT=`sibling-open`,XT=`disabled`,ZT=`imperative-action`,QT=`window-resize`;function $T(e,t,n,r){let i=!1,a=!1,o=r??gx;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function eE(e,t,n){let r=n??gx;return{reason:e,event:t??new Event(`base-ui`),...r}}function tE(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function nE(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var rE=Zx.useInsertionEffect,iE=rE&&rE!==Zx.useLayoutEffect?rE:e=>e();function X(e){let t=ex(aE).current;return t.next=e,iE(t.effect),t.trampoline}function aE(){let e={next:void 0,callback:oE,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function oE(){throw Error(`Base UI: Cannot call an event handler while rendering.`)}var sE={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},cE={...sE,position:`fixed`,top:0,left:0},lE={...sE,position:`absolute`},uE=0;function dE(e,t=`mui`){let[n,r]=S.useState(e),i=e||n;return S.useEffect(()=>{n??(uE+=1,r(`${t}-${uE}`))},[n,t]),i}var fE=Zx.useId;function pE(e,t){if(fE!==void 0){let n=fE();return e??(t?`${t}-${n}`:n)}return dE(e,t)}function mE(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var hE=class{nodesRef={current:[]};events=mE();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},gE=S.createContext(null);gE.displayName=`FloatingNodeContext`;var _E=S.createContext(null);_E.displayName=`FloatingTreeContext`;var vE=()=>S.useContext(gE)?.id||null,yE=e=>{let t=S.useContext(_E);return e??t};function bE(e){let t=pE(),n=yE(e),r=vE();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function xE(e){let{children:t,id:n}=e,r=vE();return(0,W.jsx)(gE.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function SE(e){let{children:t,externalTree:n}=e,r=ex(()=>n??new hE).current;return(0,W.jsx)(_E.Provider,{value:r,children:t})}var CE=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),wE=o(((e,t)=>{t.exports=CE()})),TE=o((e=>{var t=d(),n=wE();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),EE=o(((e,t)=>{t.exports=TE()})),DE=wE(),OE=EE(),kE=[],AE=void 0;function jE(){return AE}function ME(e){kE.push(e)}function NE(e){let t=(t,n)=>{let r=ex(FE).current,i;try{AE=r;for(let e of kE)e.before(r);i=e(t,n);for(let e of kE)e.after(r);r.didInitialize=!0}finally{AE=void 0}return i};return t.displayName=e.displayName||e.name,t}function PE(e){return S.forwardRef(NE(e))}function FE(){return{didInitialize:!1}}var IE=lw,LE=S.forwardRef(function(e,t){let[n,r]=S.useState();Y(()=>{IE&&NT&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,W.jsx)(`span`,{...e,ref:t,style:cE,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});LE.displayName=`FocusGuard`;function RE(e){return`data-base-ui-${e}`}var zE={style:{transition:`none`}},BE=`data-base-ui-click-trigger`,VE={fallbackAxisSide:`none`},HE={fallbackAxisSide:`end`},UE={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},WE=S.createContext(null);WE.displayName=`PortalContext`;var GE=()=>S.useContext(WE),KE=RE(`portal`);function qE(e={}){let{ref:t,container:n,componentProps:r=gx,elementProps:i}=e,a=pE(),o=GE()?.portalNode,[s,c]=S.useState(null),[l,u]=S.useState(null),d=X(e=>{e!==null&&u(e)}),f=S.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(nS(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Fx(`div`,r,{ref:[t,d],props:[{id:a,[KE]:``},i]}),m=s&&p?Kc.createPortal(p,s):null;return{node:l,nodeId:S.isValidElement(p)?p.props.id:void 0,subtree:m}}var JE=S.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=qE({container:o,ref:t,componentProps:e,elementProps:c}),f=S.useRef(null),p=S.useRef(null),m=S.useRef(null),h=S.useRef(null),[g,_]=S.useState(null),v=S.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;S.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&AT(e)&&(e.type===`focusin`?v.current&&=(MT(l),!1):(jT(l),v.current=!0))}return nE(tE(l,`focusin`,e,!0),tE(l,`focusout`,e,!0))},[l,y]),Y(()=>{!l||b!==!0||!v.current||(MT(l),v.current=!1)},[b,l]);let C=S.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,W.jsxs)(S.Fragment,{children:[d,(0,W.jsxs)(WE.Provider,{value:C,children:[x&&l&&(0,W.jsx)(LE,{"data-type":`outside`,ref:f,onFocus:e=>{AT(e,l)?m.current?.focus():ET(g?g.domReference:null)?.focus()}}),x&&l&&(0,W.jsx)(`span`,{role:s,"aria-owns":u,style:UE}),l&&Kc.createPortal(a,l),x&&l&&(0,W.jsx)(LE,{"data-type":`outside`,ref:p,onFocus:e=>{AT(e,l)?h.current?.focus():(TT(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,$T(`focus-out`,e.nativeEvent)))}})]})]})});JE.displayName=`FloatingPortal`;var YE=cx(19)?QE:$E;function XE(e,t,n,r,i){return YE(e,t,n,r,i)}function ZE(e,t,n,r,i){let a=S.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,DE.useSyncExternalStore)(e.subscribe,a,a)}ME({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,DE.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function QE(e,t,n,r,i){let a=jE();if(!a)return ZE(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function $E(e,t,n,r,i){return(0,OE.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var eD=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return XE(this,e,t,n,r)}},tD=class extends eD{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){S.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;{S.useDebugValue(e,e=>Object.keys(e));let t=S.useRef(Object.keys(e)).current,n=Object.keys(e);(t.length!==n.length||t.some((e,t)=>e!==n[t]))&&console.error(`ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.`)}Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){S.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r]);{let t=this.controlledValues??=new Map;t.has(e)||t.set(e,r);let n=t.get(e);n!==void 0&&n!==r&&console.error(`A component is changing the ${r?``:`un`}controlled state of ${e.toString()} to be ${r?`un`:``}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return S.useDebugValue(e),XE(this,this.selectors[e],t,n,r)}useContextCallback(e,t){S.useDebugValue(e);let n=X(t??mx);this.context[e]=n}useStateSetter(e){let t=S.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},nD={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},rD=class extends tD{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:mE(),nested:n,triggerElements:i},nD),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&gw(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}},iD;function aD(e){iD??=new WeakMap;let t=iD.get(e);return t||(t=new WeakMap,iD.set(e,t)),t}var oD=class{constructor(){this.idMap=new Map}add(e,t){{let n=aD(this),r=n.get(t);if(r!==void 0&&r!==e)throw Error(`Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.`);let i=this.idMap.get(e);i!==void 0&&i!==t&&n.delete(i),n.set(t,e)}this.idMap.set(e,t)}delete(e){{let t=this.idMap.get(e);t!==void 0&&iD?.get(this)?.delete(t)}this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function sD(e){S.useEffect(e,hx)}var cD=0,lD=class e{static create(){return new e}currentId=cD;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=cD,t()},e)}isStarted(){return this.currentId!==cD}clear=()=>{this.currentId!==cD&&(clearTimeout(this.currentId),this.currentId=cD)};disposeEffect=()=>this.clear};function uD(){let e=ex(lD.create).current;return sD(e.disposeEffect),e}function dD(e){let t=ex(fD,e).current;return t.next=e,Y(t.effect),t}function fD(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function pD(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...pD(e,t.id,n)])}function mD(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function hD(){return!1}function gD(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function _D(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=hD,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=yE(c),h=X(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=X(()=>a),{escapeKey:y,outsidePress:b}=gD(s),x=S.useRef(!1),C=S.useRef(!1),w=S.useRef(!1),T=S.useRef(!1),E=S.useRef(!1),D=S.useRef(``),O=S.useRef(null),k=uD(),A=uD(),j=X(()=>{A.clear(),f.current.insideReactTree=!1}),M=X(e=>{let t=f.current.floatingContext?.nodeId;return(m?pD(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=X(e=>qw(e,l.select(`floatingElement`))||qw(e,l.select(`domReferenceElement`))),P=X(e=>{o()&&l.setOpen(!1,$T(FT,e.nativeEvent))}),F=X(e=>{if(!u||!n||!r||e.key!==`Escape`||E.current||!y&&M(`__escapeKeyBubbles`))return;let t=$T(WT,fw(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=X(()=>{f.current.insideReactTree=!0,A.start(0,j)}),L=X(e=>{if(!u||!n||e.button!==0)return;let t=yw(e.nativeEvent);vw(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,C.current=!1))}),R=X(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(C.current=!0)});S.useEffect(()=>{function e(e){e.open||(T.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),S.useEffect(()=>{if(!u||!n)return u||(T.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new lD,t=new lD,i=eT(d);function a(){e.clear(),E.current=!0}function o(){e.start(NT?5:0,()=>{E.current=!1})}function s(){w.current=!0,t.start(0,()=>{w.current=!1})}function c(){x.current=!1,C.current=!1}function p(){let e=D.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function S(e){let t=f.current.floatingContext?.nodeId,n=m&&pD(m.nodesRef.current,t).some(t=>qw(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),w.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=yw(e),r=`[${RE(`inert`)}]`,i=rS(n)?n.getRootNode():null,a=Array.from((aS(i)?i:eT(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>vw(e,n))))return;let s=rS(n)?n:null;for(;s&&!gS(s);){let e=yS(s);if(gS(e)||!rS(e))break;s=e}if(!(a.length&&rS(n)&&!Jw(n)&&!vw(n,l.select(`floatingElement`))&&a.every(e=>!vw(s,e)))){if(iS(n)&&!(`touches`in e)){let t=gS(n),r=_S(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!S(e)){if(p()===`intentional`){if(e.detail!==0&&!pw(e)&&!T.current)return;if(w.current){t.clear(),w.current=!1;return}}typeof g==`function`&&!g(e)||M(`__outsidePressBubbles`)||(l.setOpen(!1,$T(RT,e)),j())}}}function P(e){p()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||N(e)||A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(O.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},k.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=yw(e);if(!n)return;let r=tE(n,e.type,()=>{t(e),r()})}function R(e){D.current=`touch`,L(e,I)}function z(e){k.clear(),e.type===`pointerdown`&&(e.button===0&&(T.current=!0),D.current=e.pointerType),!(e.type===`mousedown`&&O.current&&!O.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function ee(e){if(e.type===`pointercancel`&&(T.current=!1),!x.current)return;let n=C.current;if(c(),p()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!S(e)){if(n){s();return}typeof g==`function`&&!g(e)||(t.clear(),w.current=!0,j())}}}function B(e){if(p()!==`sloppy`||!O.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-O.current.startX),r=Math.abs(t.clientY-O.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(O.current.dismissOnTouchEnd=!0),i>10&&(A(e),k.clear(),O.current=null)}function V(e){L(e,B)}function H(e){p()!==`sloppy`||!O.current||N(e)||(O.current.dismissOnTouchEnd&&A(e),k.clear(),O.current=null)}function te(e){L(e,H)}let U=nE(r&&nE(tE(i,`keydown`,F),tE(i,`compositionstart`,a),tE(i,`compositionend`,o)),_&&nE(tE(i,`click`,z,!0),tE(i,`pointerdown`,z,!0),tE(i,`pointerup`,ee,!0),tE(i,`pointercancel`,ee,!0),tE(i,`mousedown`,z,!0),tE(i,`mouseup`,ee,!0),tE(i,`touchstart`,R,{capture:!0,passive:!0}),tE(i,`touchmove`,V,{capture:!0,passive:!0}),tE(i,`touchend`,te,{capture:!0,passive:!0})));return()=>{U(),e.clear(),t.clear(),c(),w.current=!1,j()}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,l,k]);let z=S.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ee=S.useMemo(()=>({onKeyDown:F,onPointerDown:R,onMouseDown:R,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,R]);return S.useMemo(()=>n?{reference:z,floating:ee,trigger:z}:{},[n,z,ee])}function vD(e,t){return t!=null&&!hw(t)?0:typeof e==`function`?e():e}function yD(e,t,n){let r=vD(e,n);return typeof r==`number`?r:r?.[t]}function bD(e){return typeof e==`function`?e():e}function xD(e,t){return t||e===`click`||e===`mousedown`}function SD(e){return e?.includes(`mouse`)&&e!==`mousedown`}var CD=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new lD,this.restTimeout=new lD,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},wD=new WeakMap;function TD(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&wD.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),wD.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function ED(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=wD.get(n);a&&a!==e&&TD(a),TD(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,wD.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function DD(e){let t=e.context.dataRef.current,n=ex(()=>t.hoverInteractionState??CD.create()).current;return t.hoverInteractionState||=n,sD(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function OD(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=yE(),d=vE(),f=DD(a),p=uD(),m=X(()=>xD(l.current.openEvent?.type,f.interactedInside)),h=X(()=>SD(l.current.openEvent?.type)),g=X(()=>{TD(f)});Y(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),S.useEffect(()=>g,[g]),Y(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&rS(c)&&s){let e=c,t=s,n=eT(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return ED(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),S.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&pD(u.nodesRef.current,d).length>0)}function t(e){let t=yD(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,$T(IT,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=yw(e);if(!Xw(t)){f.interactedInside=!1;return}f.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Kw(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&rS(o)&&pD(u.nodesRef.current,r,!1).some(e=>vw(e.context?.elements.floating,o)))){if(f.handler){f.handler(n);return}g(),h()&&!m()&&t(n)}}function v(t){!u||!d||e()||p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,$T(IT,t)),u.events.emit(`floating.closed`,t)})}let y=s;return nE(y&&tE(y,`mouseenter`,c),y&&tE(y,`mouseleave`,_),y&&tE(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var kD={current:null};function AD(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=kD,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=yE(l),y=DD(h),b=S.useRef(!1),x=dD(i),C=dD(r),w=dD(o),T=dD(n),E=dD(p),D=dD(f),O=X(()=>xD(g.current.openEvent?.type,y.interactedInside)),k=X(()=>E.current?.()!==!1),A=X((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!vw(e,t);if(!rS(n))return!1;let i=n;return r.hasMatchingElement(e=>vw(e,i))&&(!e||!vw(e,i))}),j=X(()=>{y.handler&&=(eT(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=X(()=>{TD(y)});return u&&(y.handleCloseOptions=i?.__options),S.useEffect(()=>j,[j]),S.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===IT,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),S.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=yD(C.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,$T(IT,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,$T(IT,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!rS(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!hw(y.pointerType))return;let t=bD(w.current),n=yD(C.current,`open`,y.pointerType),r=yw(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(rS(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(vw(e,r)){s=e;break}}rS(i)&&rS(o)&&!h.context.triggerElements.hasElement(i)&&vw(i,o)&&(s=o);let c=s!=null&&A(o,s,r),l=h.select(`open`),u=D.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&rS(s)&&rS(o)&&vw(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;if(m){k()&&h.setOpen(!0,$T(IT,e,s));return}p||(n?y.openChangeTimeout.start(n,()=>{g&&k()&&h.setOpen(!0,$T(IT,e,s))}):g&&k()&&h.setOpen(!0,$T(IT,e,s)))}function i(t){if(O()){M();return}j();let n=eT(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Kw(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),T.current&&!O()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t);return}(y.pointerType!==`touch`||!vw(h.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){vw(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?tE(t,`mouseout`,o):void 0;return s?nE(tE(t,`mousemove`,r,{once:!0}),tE(t,`mouseenter`,r),tE(t,`mouseleave`,i),l):nE(tE(t,`mouseenter`,r),tE(t,`mouseleave`,i),l)},[j,M,g,C,h,n,x,y,u,A,O,a,s,w,c,v,T,d,D,k,m]),S.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=A(r,n,e.target);if(a&&!hw(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;ED(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=bD(w.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,O())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&k()&&h.setOpen(!0,$T(IT,t,n))}y.pointerType===`touch`?Kc.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,O,A,a,h,w,k])}var jD=.1,MD=jD*jD,ND=.5;function PD(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function FD(e,t,n,r,i,a,o,s,c,l){let u=!1;return PD(e,t,n,r,i,a)&&(u=!u),PD(e,t,i,a,o,s)&&(u=!u),PD(e,t,o,s,c,l)&&(u=!u),PD(e,t,c,l,n,r)&&(u=!u),u}function ID(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function LD(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function RD(e={}){let{blockPointerEvents:t=!1}=e,n=new lD,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*MD;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=yw(r),g=r.type===`mouseleave`,_=vw(u,h),v=vw(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&rS(r.relatedTarget)&&vw(u,r.relatedTarget))return;function y(){return!!(s&&pD(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=LD(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=LD(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=LD(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=LD(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!ID(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?ND/2:ND*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+ND+1,o=C||T?S.bottom-ND:S.top,s=C?T?S.bottom-ND:S.top:S.bottom-ND;M=FD(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?ND/2:ND*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-ND,o=C||T?S.top+ND:S.bottom,s=C?T?S.top+ND:S.bottom:S.top+ND;M=FD(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?ND/2:ND*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+ND+1,o=w||E?S.right-ND:S.left,s=w?E?S.right-ND:S.left:S.right-ND;M=FD(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?ND/2:ND*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-ND,o=w||E?S.left+ND:S.right,s=w?E?S.left+ND:S.right:S.left+ND;M=FD(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var zD=null,BD=globalThis.requestAnimationFrame,VD=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1;let n=BD!==requestAnimationFrame&&(BD=requestAnimationFrame,!0);return(!this.isScheduled||n)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},HD=class e{static create(){return new e}static request(e){return VD.request(e)}static cancel(e){return VD.cancel(e)}currentId=zD;request(e){this.cancel(),this.currentId=VD.request(()=>{this.currentId=zD,e()})}cancel=()=>{this.currentId!==zD&&(VD.cancel(this.currentId),this.currentId=zD)};disposeEffect=()=>this.cancel};function UD(){let e=ex(HD.create).current;return sD(e.disposeEffect),e}function WD(e){return e==null?e:`current`in e?e.current:e}var GD=null;function KD(e){if(!GD){let e=[];GD=e,queueMicrotask(()=>{GD=null,Kc.flushSync(()=>{for(let t of e)t()})})}GD.push(e)}function qD(e,t=!1,n=!1){let r=UD();return X((i,a=null)=>{r.cancel();let o=WD(e);if(o==null)return;let s=o,c=()=>{if(!n){Kc.flushSync(i);return}KD(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Ew;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function JD(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=X(a),s=qD(r,n,i);S.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function YD(e,t=!1,n=!1,r=!1){let[i,a]=S.useState(e&&t?`idle`:void 0),[o,s]=S.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Y(()=>{if(!e&&o&&i!==`ending`&&n){let e=HD.request(()=>{a(`ending`)});return()=>{HD.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t)return;let n=HD.request(()=>{a(void 0)});return()=>{HD.cancel(n)}},[t,e]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=HD.request(()=>{a(`idle`)});return()=>{HD.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function XD(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=S.useRef(null);r===void 0&&f.current===null&&(f.current=new rD({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};rS(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var ZD={tabIndex:-1,[bw]:``};function QD(e){return t=>t!==`touch`||e.current}function $D(e,t=!1){let n=pE(),r=vE()!=null,i=ex(()=>e(n,r)).current;return XD({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function eO({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function tO(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function nO(e,t){let n=S.useRef(null);return X(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),tO(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),tO(t))})}function rO(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function iO(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function aO(e,t,n,r={}){let i=n.reason,a=i===IT,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=iO(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=rO(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Kc.flushSync(l):l()}function oO(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=nO(e,n),o=X(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=X(e=>{a(e),e&&o(e)});return Y(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Y(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function sO(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=S.useRef(null),i=e.useState(`open`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=$T(PT);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function cO(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=YD(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=X(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return JD({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function lO(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:gx,inactiveTriggerProps:gx,popupProps:gx})},[e])}function uO(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}function dO(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new rD({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:gx,inactiveTriggerProps:gx,popupProps:gx}}var fO=e=>e.triggerIdProp??e.activeTriggerId,pO=e=>e.openProp??e.open,mO=e=>(e.popupElement?.id??e.floatingId)||void 0;function hO(e,t){return t!==void 0&&pO(e)&&fO(e)===t}function gO(e,t){return hO(e,t)?!0:t!==void 0&&pO(e)&&fO(e)==null&&e.triggerCount===1}var _O={open:pO,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:fO,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:mO,isTriggerActive:(e,t)=>t!==void 0&&fO(e)===t,isOpenedByTrigger:(e,t)=>hO(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&fO(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>gO(e,t)?mO(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function vO(e){let t=S.useCallback(t=>e===void 0?mx:e.subscribeStore(t),[e]),n=S.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,DE.useSyncExternalStore)(t,n,()=>e?.serverStore)}function yO(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=pE(),a=vE()!=null;{let e=r.reference;e&&!rS(e)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`",`instead.`)}let o=ex(()=>new rD({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new oD,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=rS(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var bO=S.createContext(void 0);bO.displayName=`DirectionContext`;function xO(){return S.useContext(bO)?.direction??`ltr`}function SO(e){return CO(e,e.rootContext)}function CO(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=S.useState(null),[d,f]=S.useState(void 0),[p,m]=S.useState(void 0),h=S.useRef(null),g=yE(r),_=S.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=qC({...e,elements:{..._,...l&&{reference:l}}}),y=rS(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=S.useCallback(e=>{let t=rS(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),C=S.useCallback(e=>{(rS(e)||e===null)&&(h.current=e,f(e)),(rS(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!rS(e))&&v.refs.setReference(e)},[v.refs,f]),w=S.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),T=S.useMemo(()=>({...v.refs,setReference:C,setFloating:w,setPositionReference:x,domReference:h}),[v.refs,C,w,x]),E=S.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),D=S.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[v,T,E,n,t,s,c]);return Y(()=>{o&&(h.current=o)},[o]),Y(()=>{t.context.dataRef.current.floatingContext=D;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=D)}),S.useMemo(()=>({...v,context:D,refs:T,elements:E,rootStore:t}),[v,T,E,D,t])}var wO=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=AS(e,t)||{};if(l==null)return{};let f=JS(u),p={x:n,y:r},m=IS(i),h=PS(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=kS(k,j,A),N=!c.arrow&&MS(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),TO=(e,t)=>{let{name:n,fn:r}=wO(e);return{name:n,fn:r,options:[e,t]}},EO={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},DO={sideX:`left`,sideY:`top`},OO=`--available-width`,kO=`--available-height`,AO=`--anchor-width`,jO=`--anchor-height`,MO=`--transform-origin`,NO=OO,PO=kO;function FO(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function IO(e,t,n){let{rects:r,placement:i}=e;return{side:FO(t,jS(i),n),align:MS(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function LO(e){return RO(e,SO)}function RO(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:C}=e,[w,T]=S.useState(null);!g&&w!==null&&T(null);let E=_.side||`flip`,D=_.align||`flip`,O=_.fallbackAxisSide||`end`,k=v?.crossAxis??!1,A=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=X(j),N=j?M:n,P=dD(n),F=dD(g),I=xO()===`rtl`,L=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],R=o===`center`?L:`${L}-${o}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let ee=+(i===`bottom`),B=+(i===`top`),V=+(i===`right`),H=+(i===`left`),te={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},U=S.useRef(null),ne=dD(a),re=dD(s),ie=typeof a==`function`?0:a,ae=typeof s==`function`?0:s,oe=[];p&&oe.push(p),oe.push(JC(e=>{let t=IO(e,i,I),n=typeof ne.current==`function`?ne.current(t):ne.current,r=typeof re.current==`function`?re.current(t):re.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ie,ae,I,i]));let se=D===`none`&&E!==`shift`,ce=!se&&(u||k||E===`shift`),le=E===`none`?null:ZC({...te,padding:{top:z.top+1+ee,right:z.right+1+H,bottom:z.bottom+1+B,left:z.left+1+V},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),ue=se?null:YC({...te,rootBoundary:A,mainAxis:D!==`none`,crossAxis:ce,limiter:u||k?void 0:XC(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=FS(jS(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[te,u,k,A,z,D]);E===`shift`||D===`shift`||o===`center`?oe.push(ue,le):oe.push(le,ue),oe.push(QC({...te,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(NO,`${t}px`),i.setProperty(PO,`${n}px`);let a=eS(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(AO,`${u}px`),i.setProperty(jO,`${d}px`)}}),TO(e=>({element:U.current||eT(e.elements.floating).createElement(`div`),padding:U.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=jS(r),u=MS(r),d=FS(l)===`y`,f=U.current,p=typeof a==`function`?a(IO(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return ce&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(MO,d?`${m} ${h}`:`${h} ${m}`),{}}},EO,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let de=S.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:fe,elements:pe,x:me,y:he,middlewareData:ge,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:R,middleware:oe,strategy:r,whileElementsMounted:m?void 0:(...e)=>FC(...e,de),nodeId:y,externalTree:C}),{sideX:Se,sideY:Ce}=ge.adaptiveOrigin||DO,we=be?r:`fixed`,Te=S.useMemo(()=>{let e;return e=be?b?{position:we,[Se]:me,[Ce]:he}:{...xe,position:we}:{position:we,top:0,left:0},e[NO]=`100vw`,e[PO]=`100vh`,be||(e.opacity=0),e},[b,we,Se,me,Ce,he,xe,be]),Ee=S.useRef(null);Y(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(zO(t)?t.current:t)||null;n!==Ee.current&&(fe.setPositionReference(n),Ee.current=n)},[g,fe,N,P]),S.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&zO(e)&&e.current!==Ee.current&&(fe.setPositionReference(e.current),Ee.current=e.current)},[g,fe,N,P]),S.useEffect(()=>{if(m&&g&&pe.reference&&pe.floating)return FC(pe.reference,pe.floating,_e,de)},[m,g,pe,_e,de]);let De=jS(ve),Oe=FO(i,De,I),ke=MS(ve)||`center`,Ae=!!ge.hide?.referenceHidden;Y(()=>{x&&g&&be&&De!==L&&T(De)},[x,g,be,De,L]);let je=S.useMemo(()=>({position:`absolute`,top:ge.arrow?.y,left:ge.arrow?.x}),[ge.arrow]),Me=ge.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:U,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:fe,context:ye,isPositioned:be,update:_e}),[Te,je,U,Me,Oe,ke,De,Ae,fe,ye,be,_e])}function zO(e){return e!=null&&`current`in e}function BO(e){return e===`starting`?zE:gx}function VO(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Fx(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},BO(r),i],stateAttributesMapping:Uw})}var HO=cw&&NT;function UO(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=S.useRef(!1),c=S.useRef(null),l=S.useRef(!0),u=uD();S.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=eS(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&iS(e)&&e===_w(eT(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return nE(tE(t,`blur`,r),HO&&tE(t,`keydown`,a,!0),HO&&tE(t,`pointerdown`,o,!0))},[i,n]),S.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);rS(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=S.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=yw(t.nativeEvent);if(rS(a)){if(HO&&!t.relatedTarget){if(!l.current&&!Yw(a))return}else if(!Qw(a))return}let o=Kw(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,$T(LT,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,$T(LT,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=rS(n)&&n.hasAttribute(RE(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=_w(eT(e));!n&&t===e||vw(o.current.floatingContext?.refs.floating.current,t)||vw(e,t)||a||Kw(n??t,i.context.triggerElements)||i.setOpen(!1,$T(LT,r))})}}},[o,r,i,u]);return S.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}function WO(e){return pE(e,`base-ui`)}var GO=S.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=qE({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,W.jsxs)(S.Fragment,{children:[l,c&&Kc.createPortal(n,c)]})});GO.displayName=`FloatingPortalLite`;var KO=S.createContext(void 0);KO.displayName=`TooltipRootContext`;function qO(e){let t=S.useContext(KO);if(t===void 0&&!e)throw Error(`Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.`);return t}var JO=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new lD,currentIdRef:{current:null},currentContextRef:{current:null}});JO.displayName=`FloatingDelayGroupContext`;function YO(e,t){e.current=t.current}function XO(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=S.useContext(JO),[f,p]=S.useState(!1),m=S.useRef(n);return Y(()=>{m.current=n},[n]),Y(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),Y(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:yD(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,$T(PT))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),Y(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,YO(o,c),d.clear()}},[l,a,o,i,c,d]),S.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}function ZO(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function QO(e){return e!=null&&e.clientX!=null}function $O(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=S.useRef(!1),u=S.useRef(null),[d,f]=S.useState(),[p,m]=S.useState([]),h=X(e=>{i.set(`positionReference`,e)}),g=X((e,t,n)=>{l.current||c.current.openEvent&&!QO(c.current.openEvent)||i.set(`positionReference`,ZO(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=X(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=hw(d)?o:a;S.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=eS(o);function r(t){let n=yw(t);vw(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||QO(c.current.openEvent)?u.current=tE(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),S.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),S.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),S.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=S.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return S.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}var ek={..._O,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},tk=class extends tD{constructor(e,t,n){let r=new oD;super(nk(e,r,t,n),rk(r),ek)}setOpen=(e,t)=>{aO(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,$T(FT,e))}};function nk(e,t,n,r=!1){return{...dO(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function rk(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var ik=NE(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=$D((e,t)=>new tk({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),sO(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=cO(h,p),x=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=S.useRef(null);Y(()=>{m&&t&&p.setOpen(!1,$T(XT))},[m,t,p]),Y(()=>{b===`ending`&&w===`none`||b!==`ending`&&x?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[b,x,w,C,p]),Y(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),S.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,$T(ZT))}),[y,p]);let E=h||_||!t&&a!==`none`;return(0,W.jsxs)(KO.Provider,{value:p,children:[l&&(0,W.jsx)(eO,{handle:l,store:p}),E&&(0,W.jsx)(ak,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});ik.displayName=`TooltipRoot`;function ak({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=_D(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=$O(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=S.useMemo(()=>xx(a.reference,i.reference),[a.reference,i.reference]);return lO(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??gx}),null}var ok=S.createContext(void 0);ok.displayName=`TooltipProviderContext`;function sk(){return S.useContext(ok)}var ck=`data-base-ui-tooltip-trigger`;function lk(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(rS(n))return n}}let t=e.target;return rS(t)?t:null}function uk(e){let t=e;for(;t;){let e=t.closest(`[${ck}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&rS(n.host)?n.host:null}return null}var dk=PE(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=qO(!0),m=vO(a)??p;if(!m)throw Error(`Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.`);let h=WO(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=S.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:C}=oO(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),w=sk(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=XO(v,{open:_}),k=DD(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=dD(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=S.useRef(!1),I=uD(),L=S.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=y.current;if(!t||!e)return!1;let n=uk(e);return n!==null&&n!==t&&vw(t,n)}function ee(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let B=AD(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?RD():null,restMs:R,delay(){return u==null&&O?{close:yD(E.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),V=UO(v,{enabled:!j}).reference,H=e=>{let t=F.current,n=lk(e),r=ee(n),i=y.current,a=i&&n&&vw(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,$T(IT,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&hw(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,$T(IT,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},te=m.useState(`triggerProps`,C);return Fx(`button`,e,{state:{open:_},ref:[t,x,y],props:[B,V,C||N!==`none`?te:void 0,{onMouseOver(e){H(e.nativeEvent)},onFocus(e){z(lk(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Gw]:j?``:void 0,[ck]:j?void 0:``},f],stateAttributesMapping:Vw})});dk.displayName=`TooltipTrigger`;var fk=S.createContext(void 0);fk.displayName=`TooltipPortalContext`;function pk(){let e=S.useContext(fk);if(e===void 0)throw Error(`Base UI: <Tooltip.Portal> is missing.`);return e}var mk=S.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return qO().useState(`mounted`)||n?(0,W.jsx)(fk.Provider,{value:n,children:(0,W.jsx)(GO,{ref:t,...r})}):null});mk.displayName=`TooltipPortal`;var hk=S.createContext(void 0);hk.displayName=`TooltipPositionerContext`;function gk(){let e=S.useContext(hk);if(e===void 0)throw Error(`Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.`);return e}var _k=S.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=HE,style:g,..._}=e,v=qO(),y=pk(),b=v.useState(`open`),x=v.useState(`mounted`),C=v.useState(`trackCursorAxis`),w=v.useState(`disableHoverablePopup`),T=v.useState(`floatingRootContext`),E=v.useState(`instantType`),D=v.useState(`transitionStatus`),O=LO({anchor:i,positionMethod:a,floatingRootContext:T,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),k=VO(e,S.useMemo(()=>({open:b,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[b,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||C===`both`||w});return(0,W.jsx)(hk.Provider,{value:O,children:k})});_k.displayName=`TooltipPositioner`;var vk=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=qO(),{side:s,align:c}=gk(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);JD({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),OD(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Fx(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[ZD,f,BO(d),a],stateAttributesMapping:Ww})});vk.displayName=`TooltipPopup`;var yk=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=qO(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=gk();return Fx(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Uw})});yk.displayName=`TooltipArrow`;function bk({content:e,children:t,align:n,asChild:r,render:i,side:a,className:o,container:s,closeDelay:c,delay:l,...u}){let d=Xx(),f=s??d??void 0,p=i??(r?t:void 0),m=p!==void 0;return(0,W.jsxs)(ik,{...u,children:[(0,W.jsx)(dk,{closeDelay:c,delay:l,className:Jb(!m&&`m-0 inline-flex h-auto min-h-0 items-center border-none bg-transparent p-0 shadow-none`,`cursor-default`,o),render:p,children:r?void 0:t}),(0,W.jsx)(mk,{container:f,children:(0,W.jsx)(_k,{align:n,side:a,sideOffset:10,className:`max-w-[var(--available-width)]`,children:(0,W.jsxs)(vk,{className:Jb(`flex origin-[var(--transform-origin)] flex-col rounded-md bg-kumo-base px-2.5 py-1.5 text-sm text-kumo-default`,`shadow-md outline outline-kumo-line`,`transition-[transform,scale,opacity] duration-150`,`data-[starting-style]:scale-90 data-[starting-style]:opacity-0`,`data-[ending-style]:scale-90 data-[ending-style]:opacity-0`,`data-[instant]:duration-0`,`kumo-tooltip-popup`),children:[(0,W.jsx)(yk,{className:Jb(`flex`,`data-[side=bottom]:top-[-8px]`,`data-[side=left]:right-[-13px] data-[side=left]:rotate-90`,`data-[side=right]:left-[-13px] data-[side=right]:-rotate-90`,`data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180`),children:(0,W.jsx)(xk,{})}),e]})})})]})}function xk(e){return(0,W.jsxs)(`svg`,{width:`20`,height:`10`,viewBox:`0 0 20 10`,fill:`none`,...e,children:[(0,W.jsx)(`path`,{d:`M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z`,className:`fill-kumo-base`}),(0,W.jsx)(`path`,{d:`M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z`,className:`fill-kumo-arrow-edge`}),(0,W.jsx)(`path`,{d:`M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z`,className:`fill-kumo-arrow-stroke`})]})}var Sk=new Map([[`bold`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),S.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),Ck=new Map([[`bold`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M184.49,167.51a12,12,0,0,1,0,17l-48,48a12,12,0,0,1-17,0l-48-48a12,12,0,0,1,17-17L128,207l39.51-39.52A12,12,0,0,1,184.49,167.51Zm-96-79L128,49l39.51,39.52a12,12,0,0,0,17-17l-48-48a12,12,0,0,0-17,0l-48,48a12,12,0,0,0,17,17Z`}))],[`duotone`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M80,176h96l-48,48ZM128,32,80,80h96Z`,opacity:`0.2`}),S.createElement(`path`,{d:`M176,168H80a8,8,0,0,0-5.66,13.66l48,48a8,8,0,0,0,11.32,0l48-48A8,8,0,0,0,176,168Zm-48,44.69L99.31,184h57.38ZM80,88h96a8,8,0,0,0,5.66-13.66l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,80,88Zm48-44.69L156.69,72H99.31Z`}))],[`fill`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M72.61,83.06a8,8,0,0,1,1.73-8.72l48-48a8,8,0,0,1,11.32,0l48,48A8,8,0,0,1,176,88H80A8,8,0,0,1,72.61,83.06ZM176,168H80a8,8,0,0,0-5.66,13.66l48,48a8,8,0,0,0,11.32,0l48-48A8,8,0,0,0,176,168Z`}))],[`light`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M180.24,171.76a6,6,0,0,1,0,8.48l-48,48a6,6,0,0,1-8.48,0l-48-48a6,6,0,0,1,8.48-8.48L128,215.51l43.76-43.75A6,6,0,0,1,180.24,171.76Zm-96-87.52L128,40.49l43.76,43.75a6,6,0,0,0,8.48-8.48l-48-48a6,6,0,0,0-8.48,0l-48,48a6,6,0,0,0,8.48,8.48Z`}))],[`regular`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M181.66,170.34a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32,0l-48-48a8,8,0,0,1,11.32-11.32L128,212.69l42.34-42.35A8,8,0,0,1,181.66,170.34Zm-96-84.68L128,43.31l42.34,42.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,85.66Z`}))],[`thin`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M178.83,173.17a4,4,0,0,1,0,5.66l-48,48a4,4,0,0,1-5.66,0l-48-48a4,4,0,0,1,5.66-5.66L128,218.34l45.17-45.17A4,4,0,0,1,178.83,173.17Zm-96-90.34L128,37.66l45.17,45.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66Z`}))]]),wk=new Map([[`bold`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),S.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),Tk=new Map([[`bold`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),S.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),Ek=new Map([[`bold`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),S.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),Dk=new Map([[`bold`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M116,104a12,12,0,0,1-12,12h-4v36a12,12,0,0,1-24,0V116H72a12,12,0,0,1,0-24h32A12,12,0,0,1,116,104ZM240,92.74V152A44,44,0,0,1,198,196,68,68,0,0,1,76,200H36a20,20,0,0,1-20-20V76A20,20,0,0,1,36,56H92a44,44,0,0,1,80.51-24.53A36,36,0,0,1,221.94,76h1.32A16.76,16.76,0,0,1,240,92.74ZM180,55.09c0,.3,0,.6,0,.91a44.14,44.14,0,0,1-4.77,20H188a12,12,0,1,0-8-20.91ZM116,56h24a19.93,19.93,0,0,1,14.86,6.66A20.25,20.25,0,0,0,156,56a20,20,0,0,0-40,0ZM40,176h96V80H40Zm140-8V100H160v80a20,20,0,0,1-20,20H105.86A44,44,0,0,0,180,168Zm36-68H204v68c0,.79,0,1.57-.06,2.35A20,20,0,0,0,216,152Z`}))],[`duotone`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M144,80v96a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8h96A8,8,0,0,1,144,80Z`,opacity:`0.2`}),S.createElement(`path`,{d:`M80,152V112H72a8,8,0,0,1,0-16h32a8,8,0,0,1,0,16H96v40a8,8,0,0,1-16,0ZM232,92.74V152a40,40,0,0,1-36.63,39.85,64,64,0,0,1-118.7.15H40a16,16,0,0,1-16-16V80A16,16,0,0,1,40,64H96.81a40,40,0,0,1,73.31-28.85A32,32,0,0,1,211.69,80h7.57A12.76,12.76,0,0,1,232,92.74ZM175.6,50.4A39.89,39.89,0,0,1,168,80h16a16,16,0,1,0-8.4-29.6ZM113.38,64H136a16,16,0,0,1,15.07,10.68A24,24,0,1,0,113.38,64ZM40,176h96V80H40Zm144-8V96H152v80a16,16,0,0,1-16,16H94.44A48,48,0,0,0,184,168Zm32-72H200v72a62.76,62.76,0,0,1-.36,6.75A24,24,0,0,0,216,152Z`}))],[`fill`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M219.26,80h-7.57A31.71,31.71,0,0,0,216,64a32,32,0,0,0-45.88-28.85A40,40,0,0,0,96.81,64H40A16,16,0,0,0,24,80v96a16,16,0,0,0,16,16H76.67a64,64,0,0,0,118.7-.15A40,40,0,0,0,232,152V92.74A12.76,12.76,0,0,0,219.26,80ZM136,32a24,24,0,0,1,15.07,42.68A16,16,0,0,0,136,64H113.38A24,24,0,0,1,136,32ZM88,160a8,8,0,0,1-8-8V112H72a8,8,0,0,1,0-16h32a8,8,0,0,1,0,16H96v40A8,8,0,0,1,88,160Zm96,8a48,48,0,0,1-89.56,24H136a16,16,0,0,0,16-16V96h32Zm0-88H168a39.89,39.89,0,0,0,7.6-29.6A16,16,0,1,1,184,80Zm32,72a24,24,0,0,1-16.36,22.75A62.76,62.76,0,0,0,200,168V96h16Z`}))],[`light`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M82,110H72a6,6,0,0,1,0-12h32a6,6,0,0,1,0,12H94v42a6,6,0,0,1-12,0ZM230,92.74V152A38.05,38.05,0,0,1,194,190,62,62,0,0,1,78,190H40a14,14,0,0,1-14-14V80A14,14,0,0,1,40,66H99.34a38,38,0,0,1,70-28.19A30,30,0,0,1,208,82h11.28A10.75,10.75,0,0,1,230,92.74ZM173.42,49.45A37.28,37.28,0,0,1,174,56a38,38,0,0,1-10.28,26H184a18,18,0,1,0-10.58-32.55ZM112,66h24a14,14,0,0,1,13.84,12A26,26,0,1,0,112,66ZM40,178h96a2,2,0,0,0,2-2V80a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2v96A2,2,0,0,0,40,178Zm146-10V96a2,2,0,0,0-2-2H150v82a14,14,0,0,1-14,14H91.1A50,50,0,0,0,186,168Zm32-74H197.84a14.71,14.71,0,0,1,.16,2v72a62.69,62.69,0,0,1-.72,9.46A26,26,0,0,0,218,152Z`}))],[`regular`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M112,104a8,8,0,0,1-8,8H96v40a8,8,0,0,1-16,0V112H72a8,8,0,0,1,0-16h32A8,8,0,0,1,112,104ZM232,92.74V152a40,40,0,0,1-36.63,39.85,64,64,0,0,1-118.7.15H40a16,16,0,0,1-16-16V80A16,16,0,0,1,40,64H96.81a40,40,0,0,1,73.31-28.85A32,32,0,0,1,211.69,80h7.57A12.76,12.76,0,0,1,232,92.74ZM112,56a23.82,23.82,0,0,0,1.38,8H136a16,16,0,0,1,15.07,10.68A24,24,0,1,0,112,56Zm24,120h0V80H40v96h96Zm48-80H152v80a16,16,0,0,1-16,16H94.44A48,48,0,0,0,184,168Zm16-32a16,16,0,0,0-24.4-13.6A39.89,39.89,0,0,1,168,80h16A16,16,0,0,0,200,64Zm16,32H200v72a62.76,62.76,0,0,1-.36,6.75A24,24,0,0,0,216,152Z`}))],[`thin`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M108,104a4,4,0,0,1-4,4H92v44a4,4,0,0,1-8,0V108H72a4,4,0,0,1,0-8h32A4,4,0,0,1,108,104ZM228,92.74V152a36,36,0,0,1-35.44,36,60,60,0,0,1-113.13,0H40a12,12,0,0,1-12-12V80A12,12,0,0,1,40,68h62.07a36,36,0,0,1,66.48-27.36,28,28,0,0,1,35,43.36h15.69A8.75,8.75,0,0,1,228,92.74ZM171.23,48.61A36,36,0,0,1,158.64,84H184a20,20,0,1,0-12.77-35.39ZM110.71,68H136a12,12,0,0,1,12,12v1.29A28,28,0,1,0,110.71,68ZM40,180h96a4,4,0,0,0,4-4V80a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4v96A4,4,0,0,0,40,180Zm148-12V96a4,4,0,0,0-4-4H148v84a12,12,0,0,1-12,12H88a52,52,0,0,0,100-20Zm32-75.26a.74.74,0,0,0-.74-.74h-24a11.8,11.8,0,0,1,.7,4v72a60.23,60.23,0,0,1-1.18,11.86A28,28,0,0,0,220,152Z`}))]]),Ok=new Map([[`bold`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M236,104a36,36,0,0,0-48-33.94V56a36,36,0,0,0-60-26.8A36,36,0,0,0,70.06,68H56a36,36,0,0,0-26.8,60A36,36,0,0,0,68,185.94V200a36,36,0,0,0,60,26.8A36,36,0,0,0,185.94,188H200a36,36,0,0,0,26.8-60A35.82,35.82,0,0,0,236,104ZM200,92a12,12,0,0,1,0,24H188V104A12,12,0,0,1,200,92ZM152,44a12,12,0,0,1,12,12v48a12,12,0,0,1-12,12H140V56A12,12,0,0,1,152,44ZM92,56a12,12,0,0,1,24,0V68H104A12,12,0,0,1,92,56ZM56,92h48a12,12,0,0,1,12,12v12H56a12,12,0,0,1,0-24Zm0,72a12,12,0,0,1,0-24H68v12A12,12,0,0,1,56,164Zm48,48a12,12,0,0,1-12-12V152a12,12,0,0,1,12-12h12v60A12,12,0,0,1,104,212Zm60-12a12,12,0,0,1-24,0V188h12A12,12,0,0,1,164,200Zm36-36H152a12,12,0,0,1-12-12V140h60a12,12,0,0,1,0,24Z`}))],[`duotone`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M224,152h0a24,24,0,0,1-24,24H152a24,24,0,0,1,24,24h0a24,24,0,0,1-24,24h0a24,24,0,0,1-24-24V176h24a24,24,0,0,1-24-24V128h72A24,24,0,0,1,224,152ZM104,80h24V56a24,24,0,0,0-24-24h0A24,24,0,0,0,80,56h0a24,24,0,0,0,24,24H56a24,24,0,0,0-24,24h0a24,24,0,0,0,24,24h72V104A24,24,0,0,0,104,80Z`,opacity:`0.2`}),S.createElement(`path`,{d:`M221.13,128A32,32,0,0,0,184,76.31V56a32,32,0,0,0-56-21.13A32,32,0,0,0,76.31,72H56a32,32,0,0,0-21.13,56A32,32,0,0,0,72,179.69V200a32,32,0,0,0,56,21.13A32,32,0,0,0,179.69,184H200a32,32,0,0,0,21.13-56ZM200,88a16,16,0,0,1,0,32H184V104A16,16,0,0,1,200,88ZM152,40a16,16,0,0,1,16,16v48a16,16,0,0,1-16,16H136V56A16,16,0,0,1,152,40ZM88,56a16,16,0,0,1,32,0V72H104A16,16,0,0,1,88,56ZM40,104A16,16,0,0,1,56,88h48a16,16,0,0,1,16,16v16H56A16,16,0,0,1,40,104Zm16,64a16,16,0,0,1,0-32H72v16A16,16,0,0,1,56,168Zm48,48a16,16,0,0,1-16-16V152a16,16,0,0,1,16-16h16v64A16,16,0,0,1,104,216Zm64-16a16,16,0,0,1-32,0V184h16A16,16,0,0,1,168,200Zm32-32H152a16,16,0,0,1-16-16V136h64a16,16,0,0,1,0,32Z`}))],[`fill`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M221.13,128A32,32,0,0,0,184,76.31V56a32,32,0,0,0-56-21.13A32,32,0,0,0,76.31,72H56a32,32,0,0,0-21.13,56A32,32,0,0,0,72,179.69V200a32,32,0,0,0,56,21.13A32,32,0,0,0,179.69,184H200a32,32,0,0,0,21.13-56ZM88,56a16,16,0,0,1,32,0V72H104A16,16,0,0,1,88,56ZM40,104A16,16,0,0,1,56,88h48a16,16,0,0,1,16,16v16H56A16,16,0,0,1,40,104Zm128,96a16,16,0,0,1-32,0V184h16A16,16,0,0,1,168,200Zm32-32H152a16,16,0,0,1-16-16V136h64a16,16,0,0,1,0,32Z`}))],[`light`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M218,128a30,30,0,1,0-36-48V56a30,30,0,0,0-54-18A30,30,0,1,0,80,74H56a30,30,0,0,0-18,54,30,30,0,1,0,36,48v24a30,30,0,0,0,54,18,30,30,0,1,0,48-36h24a30,30,0,0,0,18-54ZM200,86a18,18,0,0,1,0,36H182V104A18,18,0,0,1,200,86ZM152,38a18,18,0,0,1,18,18v48a18,18,0,0,1-18,18H134V56A18,18,0,0,1,152,38ZM86,56a18,18,0,0,1,36,0V74H104A18,18,0,0,1,86,56ZM38,104A18,18,0,0,1,56,86h48a18,18,0,0,1,18,18v18H56A18,18,0,0,1,38,104Zm18,66a18,18,0,0,1,0-36H74v18A18,18,0,0,1,56,170Zm48,48a18,18,0,0,1-18-18V152a18,18,0,0,1,18-18h18v66A18,18,0,0,1,104,218Zm66-18a18,18,0,0,1-36,0V182h18A18,18,0,0,1,170,200Zm30-30H152a18,18,0,0,1-18-18V134h66a18,18,0,0,1,0,36Z`}))],[`regular`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M221.13,128A32,32,0,0,0,184,76.31V56a32,32,0,0,0-56-21.13A32,32,0,0,0,76.31,72H56a32,32,0,0,0-21.13,56A32,32,0,0,0,72,179.69V200a32,32,0,0,0,56,21.13A32,32,0,0,0,179.69,184H200a32,32,0,0,0,21.13-56ZM72,152a16,16,0,1,1-16-16H72Zm48,48a16,16,0,0,1-32,0V152a16,16,0,0,1,16-16h16Zm0-80H56a16,16,0,0,1,0-32h48a16,16,0,0,1,16,16Zm0-48H104a16,16,0,1,1,16-16Zm16-16a16,16,0,0,1,32,0v48a16,16,0,0,1-16,16H136Zm16,160a16,16,0,0,1-16-16V184h16a16,16,0,0,1,0,32Zm48-48H152a16,16,0,0,1-16-16V136h64a16,16,0,0,1,0,32Zm0-48H184V104a16,16,0,1,1,16,16Z`}))],[`thin`,S.createElement(S.Fragment,null,S.createElement(`path`,{d:`M214.4,128A28,28,0,1,0,180,84.43V56a28,28,0,0,0-52-14.4A28,28,0,1,0,84.43,76H56a28,28,0,0,0-14.4,52A28,28,0,1,0,76,171.57V200a28,28,0,0,0,52,14.41A28,28,0,1,0,171.57,180H200a28,28,0,0,0,14.4-52ZM76,152a20,20,0,1,1-20-20H76Zm48,48a20,20,0,0,1-40,0V152a20,20,0,0,1,20-20h20Zm0-76H56a20,20,0,0,1,0-40h48a20,20,0,0,1,20,20Zm0-48H104a20,20,0,1,1,20-20Zm56,28a20,20,0,1,1,20,20H180ZM132,56a20,20,0,0,1,40,0v48a20,20,0,0,1-20,20H132Zm40,144a20,20,0,0,1-40,0V180h20A20,20,0,0,1,172,200Zm28-28H152a20,20,0,0,1-20-20V132h68a20,20,0,0,1,0,40Z`}))]]),kk=(0,S.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Ak=S.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:s,weights:c,...l}=e,{color:u=`currentColor`,size:d,weight:f=`regular`,mirrored:p=!1,...m}=S.useContext(kk);return S.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??d,height:i??d,fill:r??u,viewBox:`0 0 256 256`,transform:o||p?`scale(-1, 1)`:void 0,...m,...l},!!n&&S.createElement(`title`,null,n),s,c.get(a??f))});Ak.displayName=`IconBase`;var jk=S.forwardRef((e,t)=>S.createElement(Ak,{ref:t,...e,weights:Sk}));jk.displayName=`CaretRightIcon`;var Mk=S.forwardRef((e,t)=>S.createElement(Ak,{ref:t,...e,weights:Ck}));Mk.displayName=`CaretUpDownIcon`;var Nk=S.forwardRef((e,t)=>S.createElement(Ak,{ref:t,...e,weights:wk}));Nk.displayName=`CheckIcon`;var Pk=S.forwardRef((e,t)=>S.createElement(Ak,{ref:t,...e,weights:Tk}));Pk.displayName=`GithubLogoIcon`;var Fk=Pk,Ik=S.forwardRef((e,t)=>S.createElement(Ak,{ref:t,...e,weights:Ek}));Ik.displayName=`InfoIcon`;var Lk=Ik,Rk=S.forwardRef((e,t)=>S.createElement(Ak,{ref:t,...e,weights:Dk}));Rk.displayName=`MicrosoftTeamsLogoIcon`;var zk=Rk,Bk=S.forwardRef((e,t)=>S.createElement(Ak,{ref:t,...e,weights:Ok}));Bk.displayName=`SlackLogoIcon`;var Vk=Bk,Hk={shape:{base:{classes:``,description:`Default rectangular button shape`},square:{classes:`items-center justify-center p-0`,description:`Square button for icon-only actions`},circle:{classes:`items-center justify-center p-0 rounded-full`,description:`Circular button for icon-only actions`}},size:{xs:{classes:`h-5 gap-1 rounded-sm px-1.5 text-xs`,description:`Extra small button for compact UIs`},sm:{classes:`h-6.5 gap-1 rounded-md px-2 text-xs`,description:`Small button for secondary actions`},base:{classes:`h-9 gap-1.5 rounded-lg px-3 text-base`,description:`Default button size`},lg:{classes:`h-10 gap-2 rounded-lg px-4 text-base`,description:`Large button for primary CTAs`}},compactSize:{xs:{classes:`size-3.5`},sm:{classes:`size-6.5`},base:{classes:`size-9`},lg:{classes:`size-10`}},variant:{primary:{classes:`relative overflow-hidden bg-(--kumo-button-emphasis-bg) !text-white ring ring-(--kumo-button-emphasis-ring) focus:ring-(--kumo-button-emphasis-ring) focus-visible:ring-(--kumo-button-emphasis-ring) active:ring-(--kumo-button-emphasis-ring) disabled:opacity-50`,description:`High-emphasis button for primary actions`},secondary:{classes:`bg-kumo-base !text-kumo-default ring not-disabled:hover:bg-kumo-tint disabled:bg-kumo-base/50 disabled:!text-kumo-default/70 ring-kumo-line data-[state=open]:bg-kumo-base`,description:`Default button style for most actions`},ghost:{classes:`text-kumo-default hover:bg-kumo-tint shadow-none bg-inherit`,description:`Minimal button with no background`},destructive:{classes:`relative overflow-hidden bg-(--kumo-button-emphasis-bg) !text-white ring ring-(--kumo-button-emphasis-ring) focus:ring-(--kumo-button-emphasis-ring) focus-visible:ring-(--kumo-button-emphasis-ring) active:ring-(--kumo-button-emphasis-ring) disabled:opacity-50`,description:`Danger button for destructive actions like delete`},"secondary-destructive":{classes:`bg-kumo-base !text-kumo-danger ring not-disabled:hover:!text-kumo-danger not-disabled:hover:ring-kumo-danger/30 disabled:bg-kumo-base/50 disabled:!text-kumo-danger/70 ring-kumo-line data-[state=open]:bg-kumo-base`,description:`Secondary button with destructive text for less prominent dangerous actions`},outline:{classes:`bg-transparent text-kumo-default ring ring-kumo-line transition-colors not-disabled:hover:text-kumo-strong not-disabled:hover:ring-kumo-focus/25`,description:`Bordered button with transparent background`}}},Uk={shape:`base`,size:`base`,variant:`secondary`};function Wk({variant:e=Uk.variant,size:t=Uk.size,shape:n=Uk.shape}={}){let r=n===`square`||n===`circle`;return Jb(`group flex w-max shrink-0 items-center font-medium select-none`,`border-0 shadow-xs`,`focus:ring-kumo-focus/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-kumo-brand`,`cursor-pointer`,`disabled:cursor-not-allowed disabled:text-kumo-subtle`,Yb(Hk.size,t,Uk.size).classes,Yb(Hk.shape,n,Uk.shape).classes,r&&Yb(Hk.compactSize,t,Uk.size).classes,Yb(Hk.variant,e,Uk.variant).classes)}var Gk=e=>e?S.isValidElement(e)?e:(0,W.jsx)(e,{}):null,Kk=e=>{if(e===`primary`)return`var(--color-kumo-brand)`;if(e===`destructive`)return`var(--color-kumo-danger)`},qk=e=>{let t=Kk(e);if(t)return{"--kumo-button-emphasis-ring":`color-mix(in oklch, ${t}, black 10%)`,"--kumo-button-emphasis-bg":`color-mix(in oklch, ${t}, white 30%)`,"--kumo-button-emphasis-gradient-start":`color-mix(in oklch, ${t}, white 15%)`,"--kumo-button-emphasis-gradient-end":t}},Jk=new Set([`href`,`target`,`rel`,`download`,`hrefLang`,`media`,`ping`,`referrerPolicy`,`linksExternal`]),Yk=e=>{let t={...e};for(let e of Object.keys(t))(e.startsWith(`on`)||Jk.has(e))&&delete t[e];return t},Xk=(e,t,n)=>{let r=n==null?null:(0,W.jsx)(`span`,{className:`contents`,children:n});return Kk(e)?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-0 rounded-[inherit] bg-linear-to-b from-(--kumo-button-emphasis-gradient-start) to-(--kumo-button-emphasis-gradient-end) shadow-[inset_0_1px_0_0_var(--kumo-button-emphasis-bg)] group-hover:from-(--kumo-button-emphasis-bg)`}),(0,W.jsxs)(`span`,{className:`relative flex items-center gap-1.5`,children:[t,r]})]}):(0,W.jsxs)(W.Fragment,{children:[t,r]})},Zk=e=>{if(typeof e==`string`)return e;if(typeof e==`number`)return String(e)},Qk=S.forwardRef(({children:e,className:t,disabled:n,loading:r,shape:i=`base`,size:a=`base`,variant:o=`secondary`,icon:s,style:c,title:l,...u},d)=>{let{type:f,...p}=u,m=qk(o),h=Zk(l),g={...p,...!S.Children.count(e)&&!p[`aria-label`]&&!p[`aria-labelledby`]&&h&&{"aria-label":h}},_=r?(0,W.jsx)(Jx,{size:a===`lg`?16:14}):Gk(s),v=(0,W.jsx)(`button`,{ref:d,"data-kumo-component":`Button`,className:Jb(Wk({variant:o,size:a,shape:i}),n&&`cursor-not-allowed opacity-50`,t),disabled:r||n,style:m?{...m,...c}:c,type:f??`button`,...g,children:Xk(o,_,e)});return l&&(n||r)?(0,W.jsx)(bk,{content:l,render:(0,W.jsx)(`span`,{className:`inline-flex`}),children:v}):l?(0,W.jsx)(bk,{content:l,render:v}):v});Qk.displayName=`Button`;var $k=S.forwardRef(({children:e,className:t,disabled:n=!1,external:r,href:i,shape:a=`base`,size:o=`base`,variant:s=`ghost`,icon:c,style:l,title:u,...d},f)=>{let p=Qb(),m=qk(s),h=r?{target:`_blank`,rel:`noopener noreferrer`}:{};if(n)return(0,W.jsx)(Qk,{...Yk(d),className:Jb(`select-text`,t),"data-kumo-component":`LinkButton`,disabled:!0,icon:c,shape:a,size:o,style:l,title:u,variant:s,children:e});let g=(0,W.jsx)(p,{ref:f,"data-kumo-component":`LinkButton`,className:Jb(Wk({variant:s,size:o,shape:a}),`flex items-center no-underline! select-text`,t),href:i,style:m?{...m,...l}:l,to:typeof i==`string`?i:void 0,...h,...d,children:Xk(s,Gk(c),e)});return u?(0,W.jsx)(bk,{content:u,render:g}):g});$k.displayName=`LinkButton`;function eA(e={}){return Jb(`m-0 text-base font-medium text-kumo-default`)}function tA(){return Jb(`inline-flex items-center gap-1`)}function nA({children:e,showOptional:t=!1,tooltip:n,className:r,htmlFor:i,asContent:a=!1}){let o=(0,W.jsxs)(W.Fragment,{children:[e,t&&(0,W.jsx)(`span`,{className:`font-normal text-kumo-subtle`,children:`(optional)`}),n&&(0,W.jsx)(bk,{content:n,render:(0,W.jsx)(Qk,{variant:`ghost`,size:`xs`,shape:`square`,"aria-label":`More information`,children:(0,W.jsx)(Lk,{className:`size-4`})})})]});return a?(0,W.jsx)(`span`,{className:Jb(tA(),r),children:o}):(0,W.jsx)(`label`,{htmlFor:i,className:Jb(eA(),tA(),r),children:o})}nA.displayName=`Label`;var rA=S.createContext(void 0);rA.displayName=`FieldsetRootContext`;function iA(e=!1){let t=S.useContext(rA);if(!t&&!e)throw Error(`Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.`);return t}function aA(e,t){let n=WO(e);return Y(()=>(t(n),()=>{t(e=>e===n?void 0:e)}),[n,t]),n}var oA=`data-valid`,sA=`data-invalid`,cA={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},lA={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},uA={valid(e){return e===null?null:e?{[oA]:``}:{[sA]:``}}},dA={invalid:void 0,name:void 0,validityData:{state:cA,errors:[],error:``,value:``,initialValue:null},setValidityData:mx,disabled:void 0,setTouched:mx,setDirty:mx,setFilled:mx,setFocused:mx,validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:lA,registerFieldControl:mx,validation:{getValidationProps:(e,t=gx)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:mx,getInputControl:()=>null,commit:async()=>{},change:mx}},fA=S.createContext(dA);fA.displayName=`FieldRootContext`;function pA(e=!0){let t=S.useContext(fA);if(t.setValidityData===mx&&!e)throw Error(`Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.`);return t}var mA=S.createContext({controlId:void 0,registerControlId:mx,resetControlId:mx,labelId:void 0,setLabelId:mx,messageIds:[],setMessageIds:mx,getDescriptionProps:e=>e});mA.displayName=`LabelableContext`;function hA(){return S.useContext(mA)}var gA=S.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:mx,validationMode:`onSubmit`,submitCountRef:{current:0}});gA.displayName=`FormContext`;function _A(){return S.useContext(gA)}function vA(e={}){let{id:t,fallbackControlId:n,native:r=!1,setLabelId:i,focusControl:a}=e,{controlId:o,setLabelId:s}=hA(),c=aA(t,X(e=>{s(e),i?.(e)})),l=o??n;function u(e){if(a){a(e,l);return}if(!l)return;let t=eT(e.currentTarget).getElementById(l);iS(t)&&yA(t)}function d(e){yw(e.nativeEvent)?.closest(`button,input,select,textarea`)||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),!r&&u(e))}return r?{id:c,htmlFor:l,onMouseDown:d}:{id:c,onClick:d,onPointerDown(e){e.preventDefault()}}}function yA(e){e.focus({focusVisible:!0})}function bA(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var xA=Object.keys(cA);function SA(e,t){return e.matches(`:disabled`)?!1:!t||e.form===t||e.form===null&&!e.hasAttribute(`form`)}function CA(e,t){let n=null;for(let r of e.keys())if(SA(r,t)){if(!r.validity.valid)return r;n??=r}return n}function wA(e){return{...cA,valid:!e,customError:e}}function TA(e){return e&&e.validationMessage?[e.validationMessage]:[]}function EA(e){let{elementRef:t,formRef:n}=_A(),{setValidityData:r,validate:i,validityData:a,validationDebounceTime:o,invalid:s,markedDirtyRef:c,state:l,shouldValidateOnChange:u,validationMode:d,registeredFieldIdRef:f}=e,{controlId:p,getDescriptionProps:m}=hA(),h=uD(),g=S.useRef(null),_=ex(()=>new Map).current,v=S.useRef(0),y=S.useRef(null),b=S.useCallback((e,t)=>(_.set(e,t),()=>{_.delete(e)}),[_]),x=X(()=>{let e=CA(_,t.current);return e&&_.get(e)?.controlRef.current||null}),C=X(async(e,o=!1)=>{v.current+=1;let m=v.current;function b(e,t=s){let r=f.current??p;if(r==null)return;let i=n.current.fields.get(r);if(!i)return;let a=bA(e,t);n.current.fields.set(r,{...i,validityData:a})}function x(t,n){let r=t.valid===!1?n:[];return{value:e,state:t,error:r[0]??``,errors:r,initialValue:a.initialValue}}function S(e,t){let n=e.validity.customError?e.validationMessage:``,r=t.replace(/\r\n?/g,`
66
+ `);e.setCustomValidity(r),y.current=[e,r,n]}function C(){let e=y.current;y.current=null,e&&(!e[0].willValidate||e[0].validationMessage===e[1])&&e[0].setCustomValidity(e[2])}function w(e,t,n){let i=x(e,t);b(i,n),r(i)}function T(e){let t=xA.reduce((t,n)=>(t[n]=e.validity[n],t),{}),n=!1;for(let e of xA)if(e!==`valid`){if(e===`valueMissing`&&t[e])n=!0;else if(t[e])return t}return n&&!c.current&&(t.valid=!0,t.valueMissing=!1),t}function E(){return _.size>0?CA(_,t.current):g.current}let D=E();function O(){return D=E(),D?.willValidate?T(D):wA(!1)}if(o){if(l.valid!==!1||!D)return;if(!D.validity.valueMissing){C();let e=E(),t=e?.validity.customError?TA(e):[];w(wA(t.length>0),t,!1);return}for(let e of xA)if(e!==`valid`&&e!==`valueMissing`&&e!==`customError`&&D.validity[e])return}h.clear(),C();let k=O(),A=TA(D),j=u();if(A.length===0||j){let t=Array.from(n.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}),r=i(e,t),o;if(typeof r==`object`&&r&&`then`in r){if(k.valid===!1?w(k,A):(d===`onSubmit`||!a.state.customError)&&(k.valid=null,w(k,A)),o=await r,m!==v.current)return;k=O()}else o=r;A=o?[].concat(o).filter(Boolean):[],A.length>0?(k.valid=!1,k.customError=!0,D?.willValidate&&S(D,A.join(`
67
+ `))):A=TA(D)}w(k,A)}),w=X((e,t=!1)=>{if(h.clear(),v.current+=1,t)return;let n=u();n&&e!==``&&o?h.start(o,()=>{C(e)}):C(e,!n)}),T=S.useCallback((e,t={})=>xx(m(t),l.valid===!1&&!l.disabled&&!e?{"aria-invalid":!0}:gx),[m,l.disabled,l.valid]);return S.useMemo(()=>({getValidationProps:T,inputRef:g,registeredInputs:_,registerInput:b,getInputControl:x,commit:C,change:w}),[T,_,b,x,C,w])}var DA=fx(`error`,`Base UI`),OA=S.createContext({disabled:!1});OA.displayName=`FieldItemContext`;function kA(){return S.useContext(OA)}var AA=function(e){let t=WO(),[n,r]=S.useState(t),[i,a]=S.useState(),[o,s]=S.useState([]),c=n===void 0?t:n,l=ex(()=>new Map),{messageIds:u}=hA(),d=X((e,t)=>{let n=l.current;t===void 0?n.delete(e):n.set(e,t),r(e=>{if(n.size===0)return e;let t;for(let r of n.values()){if(r===e)return e;t===void 0&&(t=r)}return t})}),f=X(()=>{l.current.size===0&&r(t)}),p=S.useCallback(e=>{let t=e[`aria-describedby`]?e[`aria-describedby`].split(` `):[];return t.push(...u,...o),{...e,"aria-describedby":Array.from(new Set(t)).join(` `)||void 0}},[u,o]),m=S.useMemo(()=>({controlId:c,registerControlId:d,resetControlId:f,labelId:i,setLabelId:a,messageIds:o,setMessageIds:s,getDescriptionProps:p}),[c,d,f,i,a,o,s,p]);return(0,W.jsx)(mA.Provider,{value:m,children:e.children})};AA.displayName=`LabelableProvider`;function jA(e){let{change:t,commit:n,invalid:r,markedDirtyRef:i,name:a,setRegisteredFieldName:o,registeredFieldIdRef:s,setValidityData:c,validityData:l}=e,{formRef:u}=_A(),d=S.useRef(null),f=S.useRef(null),p=S.useRef(!1),m=X(()=>{let e=f.current;if(e)return e.getValue?e.getValue():e.value});function h(e){return e.value===void 0?m():e.value}let g=X(()=>{let e=f.current;if(i.current=!0,!e){n(l.value);return}n(h(e))});function _(){let e=f.current;!e||!e.id||u.current.fields.set(e.id,{getValue:m,name:a??e.name,controlRef:e.controlRef,validityData:bA(l,r),validate:g})}function v(e=f.current?.id){e&&u.current.fields.delete(e)}function y(e){if(p.current)return;p.current=!0;let t=h(e);c(e=>e.initialValue===t?e:{...e,initialValue:t})}return Y(()=>{let e=f.current;!e||!e.id||(o(a?void 0:e.name),u.current.fields.set(e.id,{getValue:m,name:a??e.name,controlRef:e.controlRef,validityData:bA(l,r),validate:g}))},[u,m,r,a,o,g,l]),Y(()=>{let e=u.current.fields;return()=>{let t=f.current?.id;t&&e.delete(t)}},[u]),[g,X((e,n)=>{if(!n){d.current===e&&(d.current=null,t(void 0,!0),v(),f.current=null,o(void 0),s.current=void 0);return}let r=f.current?.id,i=d.current;i&&i!==e&&t(void 0,!0),d.current=e,f.current=n,a||o(n.name),s.current=n.id,r&&r!==n.id&&v(r),y(n),_()})]}var MA=S.forwardRef(function(e,t){let{errors:n,validationMode:r,submitCountRef:i}=_A(),{render:a,className:o,validate:s,validationDebounceTime:c=0,validationMode:l=r,name:u,disabled:d=!1,invalid:f,dirty:p,touched:m,actionsRef:h,style:g,..._}=e,v=iA(!0)?.disabled,y=X(s||(()=>null)),b=v||d,[x,C]=S.useState(!1),[w,T]=S.useState(!1),[E,D]=S.useState(!1),[O,k]=S.useState(!1),A=p??w,j=m??x,M=S.useRef(A),N=S.useRef(void 0),[P,F]=S.useState(),I=u??P;Y(()=>{p!==void 0&&(M.current=p)},[p]);let L=X(e=>{p===void 0&&(e&&(M.current=!0),T(e))}),R=X(e=>{m===void 0&&C(e)}),z=X(()=>l===`onChange`||l===`onSubmit`&&i.current>0),ee=I&&Object.hasOwn(n,I)?n[I]:null,B=!!(Array.isArray(ee)?ee.length:ee),V=f===!0||B,[H,te]=S.useState({state:cA,error:``,errors:[],value:null,initialValue:null}),U=!V&&(b?null:H.state.valid),ne=S.useMemo(()=>({disabled:b,touched:j,dirty:A,valid:U,filled:E,focused:O}),[b,j,A,U,E,O]),re=EA({setValidityData:te,validate:y,validityData:H,validationDebounceTime:c,invalid:V,markedDirtyRef:M,state:ne,shouldValidateOnChange:z,validationMode:l,registeredFieldIdRef:N}),[ie,ae]=jA({change:re.change,commit:re.commit,invalid:V,markedDirtyRef:M,name:u,setRegisteredFieldName:F,registeredFieldIdRef:N,setValidityData:te,validityData:H});S.useImperativeHandle(h,()=>({validate:ie}),[ie]);let oe=S.useMemo(()=>({invalid:V,name:I,validityData:H,setValidityData:te,disabled:b,setTouched:R,setDirty:L,setFilled:D,setFocused:k,validationMode:l,shouldValidateOnChange:z,state:ne,registerFieldControl:ae,validation:re}),[V,I,H,b,R,L,D,k,l,z,ne,ae,re]),se=Fx(`div`,e,{ref:t,state:ne,props:_,stateAttributesMapping:uA});return(0,W.jsx)(fA.Provider,{value:oe,children:se})});MA.displayName=`FieldRootInner`;var NA=S.forwardRef(function(e,t){return(0,W.jsx)(AA,{children:(0,W.jsx)(MA,{...e,ref:t})})});NA.displayName=`FieldRoot`;var PA=S.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,nativeLabel:o=!0,...s}=e,c=pA(!1),l=kA(),{labelId:u}=hA(),d={...c.state,disabled:c.disabled||l.disabled},f=S.useRef(null),p=vA({id:u??a,native:o});return S.useEffect(()=>{if(!f.current)return;let e=f.current.tagName===`LABEL`;o?e||DA(`<Field.Label> expected a <label> element because the \`nativeLabel\` prop is true. Rendering a non-<label> disables native label association, so \`htmlFor\` will not work. Use a real <label> in the \`render\` prop, or set \`nativeLabel\` to \`false\`.${Zx.captureOwnerStack?.()||``}`):e&&DA(`<Field.Label> expected a non-<label> element because the \`nativeLabel\` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the \`render\` prop, or set \`nativeLabel\` to \`true\`.${Zx.captureOwnerStack?.()||``}`)},[o]),Fx(`label`,e,{ref:[t,f],state:d,props:[p,s],stateAttributesMapping:uA})});PA.displayName=`FieldLabel`;function FA(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=hA(),o=WO(),s=ex(()=>Symbol()),c=S.useRef(!1),l=S.useRef(!1),u=X(()=>{!c.current||i===mx||(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===mx){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),Y(()=>u,[u]),(n?r:void 0)??t??o}function IA({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=S.useRef(e!==void 0),[a,o]=S.useState(t),s=i&&e!==void 0?e:a;{S.useEffect(()=>{i!==(e!==void 0)&&DA([`A component is changing the ${i?``:`un`}controlled ${r} state of ${n} to be ${i?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
68
+ `))},[r,n,e]);let{current:a}=S.useRef(t);S.useEffect(()=>{!i&&LA(a)!==LA(t)&&DA([`A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
69
+ `))},[t])}return[s,S.useCallback(e=>{i||o(e)},[])]}function LA(e){let t=0,n=new WeakMap;try{return JSON.stringify(e,function(e,r){if(!(e===`_owner`&&this!=null&&typeof this==`object`&&`$$typeof`in this)){if(typeof r==`bigint`)return`__bigint__:${r}`;if(typeof r==`object`&&r){let e=n.get(r);if(e!==void 0)return`__object__:${e}`;n.set(r,t),t+=1}return r}})??`__top__:${typeof e}`}catch{return`__unserializable__`}}function RA(e,t,n,r,i=!0,a){let{registerFieldControl:o}=pA(),s=ex(()=>Symbol());Y(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function zA(e,t){let n=S.useRef(e),r=X(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function BA(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var VA=S.createContext(void 0);VA.displayName=`CompositeRootContext`;function HA(e=!1){let t=S.useContext(VA);if(t===void 0&&!e)throw Error(`Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.`);return t}function UA(e,t,{detail:n=0}={}){e.dispatchEvent(new(eS(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function WA(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:S.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function GA(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=S.useRef(null),s=HA(!0),c=a??s!==void 0,{props:l}=WA({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i});S.useEffect(()=>{if(!o.current)return;let e=KA(o.current);i?e||DA(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${Zx.captureOwnerStack?.()||``}`):e&&DA(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${Zx.captureOwnerStack?.()||``}`)},[i]);let u=S.useCallback(()=>{let e=o.current;KA(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Y(u,[u]),{getButtonProps:S.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return xx({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(Mx(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=KA(r),s=!i&&qA(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),UA(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),UA(r,e)))},onKeyUp(e){if(!t){if(Mx(e),a?.(e),e.target===e.currentTarget&&i&&c&&KA(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),UA(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:X(e=>{o.current=e,u()})}}function KA(e){return iS(e)&&e.tagName===`BUTTON`}function qA(e){return iS(e)&&e.tagName===`A`&&!!e.href}var JA=Object.defineProperty,YA=(e,t)=>{let n={};for(var r in e)JA(n,r,{get:e[r],enumerable:!0});return t||JA(n,Symbol.toStringTag,{value:`Module`}),n};function XA(e){return cx(19)?e:e?`true`:void 0}function ZA(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var QA={...uA,...Aw},$A=S.forwardRef(function(e,t){let{render:n,id:r,className:i,match:a,style:o,...s}=e,c=WO(r),{validityData:l,state:u,name:d}=pA(!1),{setMessageIds:f}=hA(),{errors:p}=_A(),m=d&&Object.hasOwn(p,d)?p[d]:null,h=!!(Array.isArray(m)?m.length:m),g=typeof a==`string`,_=!1;_=a===!0?!0:u.disabled?!1:g?!!l.state[a]:h||l.state.valid===!1;let{mounted:v,transitionStatus:y,setMounted:b}=YD(_);Y(()=>{if(!(!_||!c))return f(e=>e.concat(c)),()=>{f(e=>e.filter(e=>e!==c))}},[_,c,f]);let x=S.useRef(null),[C,w]=S.useState(null),[T,E]=S.useState(null),D=l.error;!g&&h?D=m:l.errors.length>1&&(D=l.errors);let O=D;Array.isArray(D)&&(O=D.length>1?(0,W.jsx)(`ul`,{children:D.map(e=>(0,W.jsx)(`li`,{children:e},e))}):D[0]);let k=Array.isArray(D)?JSON.stringify(D):D;_&&k!==T&&(E(k),w(O)),JD({open:_,ref:x,onComplete(){_||b(!1)}});let A={...u,transitionStatus:y},j=Fx(`div`,e,{ref:[t,x],state:A,props:[{id:c,children:_?O:C},s],stateAttributesMapping:QA,enabled:v});return v?j:null});$A.displayName=`FieldError`;var ej=S.forwardRef(function(e,t){let{render:n,id:r,className:i,style:a,...o}=e,s=WO(r),c=pA(!1),l=kA(),{setMessageIds:u}=hA(),d={...c.state,disabled:c.disabled||l.disabled};return Y(()=>{if(s)return u(e=>e.concat(s)),()=>{u(e=>e.filter(e=>e!==s))}},[s,u]),Fx(`p`,e,{ref:t,state:d,props:[{id:s},o],stateAttributesMapping:uA})});ej.displayName=`FieldDescription`;function tj(e){if(e)return typeof e==`string`?{message:e,match:!0}:e}function nj({controlFirst:e=!1}={}){return Jb(`grid gap-2`,`has-[input[type=checkbox]]:grid-cols-[auto_1fr] has-[input[type=checkbox]]:items-center`,`has-[[role=switch]]:grid-cols-[auto_1fr] has-[[role=switch]]:items-center`,e&&[`has-[input[type=checkbox]]:flex has-[input[type=checkbox]]:flex-row-reverse has-[input[type=checkbox]]:flex-wrap has-[input[type=checkbox]]:items-center`,`has-[[role=switch]]:flex has-[[role=switch]]:flex-row-reverse has-[[role=switch]]:flex-wrap has-[[role=switch]]:items-center`,`[&>label]:flex-1`])}function rj({children:e,label:t,required:n,labelTooltip:r,error:i,description:a,controlFirst:o=!1,hideLabel:s=!1}){let c=n===!1;return(0,W.jsxs)(NA,{className:nj({controlFirst:o}),children:[!s&&(0,W.jsx)(PA,{className:`m-0 text-base font-medium text-kumo-default select-none`,children:(0,W.jsx)(nA,{showOptional:c,tooltip:r,asContent:!0,children:t})}),e,i?(0,W.jsx)($A,{className:Jb(`text-sm leading-snug text-kumo-danger`,`col-span-full`),match:i.match,children:i.message}):a&&(0,W.jsx)(ej,{className:Jb(`text-sm leading-snug text-kumo-subtle`,`col-span-full`),children:a})]})}var ij=S.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:C}=pA(),{clearErrors:w,elementRef:T,submitCountRef:E}=_A(),D=h||s,O=m??a,k={...p,disabled:D},{labelId:A}=hA(),j=FA({id:i}),[M]=IA({controlled:o,default:l,name:`FieldControl`,state:`value`}),N=o!==void 0,P=N?M:void 0,F=P==null?void 0:String(P),I=X(()=>C.inputRef.current?.value);RA(C.inputRef,j,F,I,!D,a),Y(()=>{let e=F??C.inputRef.current?.value;e!==void 0&&b(e!==``)},[F,C.inputRef,b]),zA(F,()=>{F!==void 0&&(w(O),_(F!==(v.initialValue??``)),C.change(F))});let L=S.useRef(null),R=uD();return Y(()=>{u&&L.current===_w(eT(L.current))&&y(!0)},[u,y]),Fx(`input`,e,{ref:[t,L],state:k,props:[{id:j,disabled:D,name:O,ref:C.inputRef,"aria-labelledby":A,autoFocus:u,...N?{value:P}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=$T(PT,e.nativeEvent);c?.(t,n),!N&&(_(t!==(v.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(w(O),C.change(t)))},onFocus(){y(!0)},onBlur(e){if(g(!0),y(!1),x===`onBlur`){let t=e.currentTarget.value;C.commit(t),N&&queueMicrotask(()=>{let e=C.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&C.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===T.current&&!e.defaultPrevented){let t=e.currentTarget,n=E.current;R.start(0,()=>{E.current===n&&C.commit(t.value)})}else C.commit(t)}}},f,e=>C.getValidationProps(D,e)],stateAttributesMapping:uA})});ij.displayName=`FieldControl`;var aj=S.forwardRef(function(e,t){return(0,W.jsx)(ij,{ref:t,...e})});aj.displayName=`Input`;var oj={size:{xs:{classes:`h-5 gap-1 rounded-sm px-1.5 text-xs`,description:`Extra small input for compact UIs`},sm:{classes:`h-6.5 gap-1 rounded-md px-2 text-xs`,description:`Small input for secondary fields`},base:{classes:`h-9 gap-1.5 rounded-lg px-3 text-base`,description:`Default input size`},lg:{classes:`h-10 gap-2 rounded-lg px-4 text-base`,description:`Large input for prominent fields`}},variant:{default:{classes:`focus:ring-kumo-focus/50 focus:ring-[1.5px]`,description:`Default input appearance`},error:{classes:`!ring-kumo-danger focus:ring-kumo-danger/50 focus:ring-[1.5px]`,description:`Error state for validation failures`}}},sj={size:`base`,variant:`default`};function cj({variant:e=sj.variant,size:t=sj.size,parentFocusIndicator:n=!1,focusIndicator:r=!1}={}){return Jb(`border-0 bg-kumo-control text-kumo-default ring ring-kumo-line outline-none focus:outline-none`,`kumo-input-placeholder disabled:text-kumo-disabled`,Yb(oj.size,t,sj.size).classes,Yb(oj.variant,e,sj.variant).classes,n&&(e===`error`?`focus-within:ring-[1.5px] focus-within:ring-kumo-danger/50`:`focus-within:ring-[1.5px] focus-within:ring-kumo-focus/50`),r&&(e===`error`?`focus:ring-[1.5px] focus:ring-kumo-danger/50`:`focus:ring-[1.5px] focus:ring-kumo-focus/50`))}var lj=(0,S.forwardRef)((e,t)=>{let{className:n,size:r=`base`,variant:i,label:a,labelTooltip:o,description:s,error:c,passwordManagerIgnore:l=!1,...u}=e;i===`error`&&console.warn('[Kumo Input]: variant="error" is deprecated. Error styling is now automatically applied when the `error` prop is truthy. Simply remove the variant prop and pass an error message instead.');let d=i??(c?`error`:`default`),{required:f}=u;{let e=!!a,t=!!u[`aria-label`],n=!!u[`aria-labelledby`];!e&&!t&&!n&&console.warn(`[Kumo Input]: Input must have an accessible name. Provide either:
70
+ - label prop: <Input label='Email' />
71
+ - aria-label: <Input aria-label='Email address' />
72
+ - aria-labelledby for custom label association`)}let p=(0,W.jsx)(aj,{ref:t,className:Jb(cj({size:r,variant:d,focusIndicator:!0}),l&&`keeper-ignore`,n),...l?{"data-1p-ignore":`true`,"data-bwignore":`true`,"data-form-type":`other`,"data-lpignore":`true`}:{},...u});return a||c||s?(0,W.jsx)(rj,{label:a,required:f,labelTooltip:o,description:s,error:tj(c),children:p}):p});lj.displayName=`Input`;var uj=0;function dj(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(uj);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),mx;let o=requestAnimationFrame(a);return uj=o,()=>{uj===o&&(cancelAnimationFrame(o),uj=0)}}var fj={inert:new WeakMap,"aria-hidden":new WeakMap},pj=`data-base-ui-inert`,mj={inert:new WeakSet,"aria-hidden":new WeakSet},hj=new WeakMap,gj=0;function _j(e){return mj[e]}function vj(e){return e?aS(e)?e.host:vj(e.parentNode):null}var yj=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=vj(t);return e.contains(n)?n:null}).filter(e=>e!=null),bj=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},xj=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{$x(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Sj(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=yj(t,e),l=i?xj(t,bj(c),new Set(c)):[],u=[],d=[];if(a){let e=fj[a],n=_j(a);s=n,o=e;let r=yj(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);xj(t,bj(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(hj.get(e)||0)+1;hj.set(e,t),d.push(e),t===1&&e.setAttribute(pj,``)}),gj+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(hj.get(e)||0)-1;hj.set(e,t),t||e.removeAttribute(pj)}),--gj,gj||(fj.inert=new WeakMap,fj[`aria-hidden`]=new WeakMap,mj.inert=new WeakSet,mj[`aria-hidden`]=new WeakSet,hj=new WeakMap)}}function Cj(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=eT(e[0]).body;return Sj(e,a,n,r,{mark:i})}function wj(e,t){let n=eS(yw(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Tj=20,Ej=[];function Dj(){Ej=Ej.filter(e=>e.deref()?.isConnected)}function Oj(e){Dj(),e&&$x(e)!==`body`&&(Ej.push(new WeakRef(e)),Ej.length>Tj&&(Ej=Ej.slice(-20)))}function kj(){return Dj(),Ej[Ej.length-1]?.deref()}function Aj(e){return e?xT(e)?e:CT(e)[0]||e:null}function jj(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=ST(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return xT(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Mj(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=X(()=>b.current.floatingContext?.nodeId),C=i===!1,w=Zw(_)&&C,T=dD(i),E=dD(a),D=dD(l),O=dD(g),k=yE(p),A=GE(),j=S.useRef(!1),M=S.useRef(!1),N=S.useRef(!1),P=S.useRef(null),F=S.useRef(``),I=S.useRef(``),L=S.useRef(null),R=S.useRef(null),z=tx(L,f,A?.beforeInsideRef),ee=tx(R,A?.afterInsideRef),B=uD(),V=uD(),H=UD(),te=A!=null,U=$w(v),ne=X((e=U)=>e?CT(e):[]),re=X(()=>m?.().filter(e=>e!=null)??[]);S.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&vw(U,_w(eT(U)))&&ne().length===0&&!w&&dw(e)}return tE(eT(U),`keydown`,e)},[r,U,s,w,ne]),S.useEffect(()=>{if(r||!g)return;let e=eT(U);function t(){N.current=!1}function n(e){let t=yw(e),n=re(),r=vw(v,t)||vw(_,t)||vw(A?.portalNode,t)||n.some(e=>e===t||vw(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(M.current=!0,V.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return nE(tE(e,`pointerdown`,n,!0),tE(e,`pointerup`,t,!0),tE(e,`pointercancel`,t,!0),tE(e,`keydown`,i,!0),t)},[r,v,_,U,g,A,V,re]),S.useEffect(()=>{if(r||!c)return;let e=eT(U);function t(){M.current=!0,V.start(0,()=>{M.current=!1})}function n(e){let t=yw(e);xT(t)&&(P.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=yw(t);s&&n==null&&i!=null&&vw(v,i)&&Oj(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=re(),f=n?.hasAttribute(RE(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,WD(d),WD(u)].includes(n),p=!(vw(_,n)||vw(v,n)||vw(n,v)||vw(A?.portalNode,n)||l.some(e=>e===n||vw(e,n))||c.hasMatchingElement(e=>vw(e,n))||f||k&&(pD(k.nodesRef.current,a).find(e=>vw(e.context?.elements.floating,n)||vw(e.context?.elements.domReference,n))||mD(k.nodesRef.current,a).find(e=>[e.context?.elements.floating,$w(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&U&&jj(U),o&&r!==_&&!sT(i)&&_w(e)===e.body){if(iS(U)&&(U.focus(),o===`popup`)){H.request(()=>{U.focus()});return}let e=ne(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;iS(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!M.current&&(w||n!==kj())&&(j.current=!0,h.setOpen(!1,$T(UT,t)))})}function a(){N.current||(b.current.insideReactTree=!0,B.start(0,()=>{b.current.insideReactTree=!1}))}let l=iS(_)?_:null;if(!(!v&&!l))return nE(l&&tE(l,`focusout`,i),l&&tE(l,`pointerdown`,t),v&&tE(v,`focusin`,n),v&&tE(v,`focusout`,i),v&&A&&tE(v,`focusout`,a,!0))},[r,_,v,U,s,k,A,h,c,o,ne,w,x,b,B,V,H,u,d,re]),S.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${RE(`portal`)}]`)||[]),t=(k?mD(k.nodesRef.current,x()):[]).find(e=>Zw(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Cj([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...re(),t,WD(d),WD(u),w?_:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=Cj([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,A,w,k,x,u,d,re]),Y(()=>{if(!g||r||!iS(U))return;F.current=``,I.current=``;let e=eT(U),t=_w(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||vw(U,t))return;let i=null,a=()=>(i??=ne(U),i[0]||U),o;o=r===!0||r===null?a():WD(r),o||=a();let s=vw(U,_w(e));dj(o,{preventScroll:o===U,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=_w(e);return!(t!==o&&vw(U,t))}})})},[r,g,U,ne,T,D,O]),Y(()=>{if(r||!U)return;let e=eT(U),t=_w(e),n=D.current==null;Oj(t);function i(e){if(e.open||(F.current=wj(e.nativeEvent,I.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(pw(e.nativeEvent)||mw(e.nativeEvent))j.current=!1;else{let e=!1;eT(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&$x(t)!==`body`?t:null,s=n?o||a:a||o;return s||=kj()||null,typeof i==`boolean`?s:WD(i)||s||null}return()=>{y.off(`openchange`,i);let t=_w(e),n=re(),r=vw(v,t)||n.some(e=>e===t||vw(e,t))||k&&pD(k.nodesRef.current,x(),!1).some(e=>vw(e.context?.elements.floating,t)),o=E.current,s=F.current,c=a(s);queueMicrotask(()=>{let n=Aj(c),i=typeof o!=`boolean`;if(o&&!j.current&&iS(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,U,E,D,y,k,_,x,re]),Y(()=>{if(!NT||g||!v)return;let e=_w(eT(v));!iS(e)||!Yw(e)||vw(v,e)&&e.blur()},[g,v]),Y(()=>{if(!(r||!A))return A.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,s,g,h,c,_]),Y(()=>{if(!(r||!U))return jj(U),()=>{queueMicrotask(Dj)}},[r,U]);let ie=!r&&(!s||!w)&&(te||s);return(0,W.jsxs)(S.Fragment,{children:[ie&&(0,W.jsx)(LE,{"data-type":`inside`,ref:z,onFocus:e=>{if(s){let e=ne();dj(e[e.length-1])}else A?.portalNode&&(j.current=!1,AT(e,A.portalNode)?TT(_)?.focus():WD(d??A.beforeOutsideRef)?.focus())}}),n,ie&&(0,W.jsx)(LE,{"data-type":`inside`,ref:ee,onFocus:e=>{s?dj(ne()[0]):A?.portalNode&&(c&&(j.current=!0),AT(e,A.portalNode)?ET(_)?.focus():WD(u??A.afterOutsideRef)?.focus())}})]})}function Nj(e){let t=S.useRef(``),n=S.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:S.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Pj(e,t){let{onClick:n,onPointerDown:r}=Nj(X((n,r)=>{(typeof e==`function`?e():e)||t(r||(aw?`touch`:``))}));return S.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Fj(e){let[t,n]=S.useState(null),r=Pj(e,n);return zA(e,t=>{t&&!e&&n(null)}),S.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Ij=S.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,W.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});Ij.displayName=`InternalBackdrop`;var Lj={},Rj={},zj=``;function Bj(e,t){return oS(e)?e:t}function Vj(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Bj(t,n)).overflowY)}function Hj(e){if(typeof document>`u`)return!1;let t=eT(e);return eS(t).innerWidth-t.documentElement.clientWidth>0}function Uj(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=eT(e),n=t.documentElement,r=t.body,i=Bj(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Wj(e){let t=eT(e),n=t.documentElement,r=t.body,i=Bj(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Gj(e){let t=eT(e),n=t.documentElement,r=t.body,i=eS(n),a=0,o=0,s=!1,c=HD.create();if(NT&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Lj={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},zj=n.style.scrollBehavior,Rj={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Bj(n,r);if(s=Uj(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Lj),Object.assign(r.style,Rj),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=zj)}function d(){u(),c.request(l)}l();let f=tE(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var Kj=new class{lockCount=0;restore=null;timeoutLock=lD.create();timeoutUnlock=lD.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=eT(e),n=t.documentElement,r=t.body,i=eS(n);if(Vj(i,n,r)){let t=new i.MutationObserver(()=>{Vj(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=aw||!Hj(e);this.restore=a?Wj(e):Gj(e)}};function qj(e=!0,t=null){Y(()=>{if(e)return Kj.acquire(t)},[e,t])}function Jj(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=FT}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=S.useRef(void 0),f=UD(),p=uD(),m=S.useMemo(()=>{function e(e,t,n,r){let i=$T(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=hw(e.pointerType,!0)&&mw(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||hw(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=yw(o);if(Yw(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}hw(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return S.useMemo(()=>n?{reference:m}:gx,[n,m])}var Yj=`Escape`;function Xj(e){return NT&&e.movementX===0&&e.movementY===0}function Zj(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Qj(e,t){return Zj(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function $j(e,t,n){return Zj(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function eM(e,t,n){return Zj(t,n?e===Sw:e===Cw,e===Tw)}function tM(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===Yj:Zj(t,n?e===Cw:e===Sw,e===ww)}function nM(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,C=x!=null;s&&(c||console.warn("`useListNavigation` looping must be enabled to allow escaping."),d||console.warn("`useListNavigation` must be virtual to allow escaping.")),g===`vertical`&&C&&console.warn("In grid list navigation mode, the `orientation` should",`be either "horizontal" or "both".`);let w=`rootStore`in e?e.rootStore:e,T=w.useState(`open`),E=w.useState(`floatingElement`),D=w.useState(`domReferenceElement`),O=w.context.dataRef,k=$w(E),A=Zw(D),j=dD(k),M=vE(),N=yE(b),P=S.useRef(f),F=S.useRef(o??-1),I=S.useRef(null),L=S.useRef(!0),R=X(e=>{i(F.current===-1?null:F.current,e)}),z=S.useRef(!!E),ee=S.useRef(T),B=S.useRef(!1),V=S.useRef(!1),H=S.useRef(null),te=dD(h),U=dD(T),ne=dD(o),re=dD(y),ie=UD(),ae=UD(),oe=X(()=>{function e(e){d?N?.events.emit(`virtualfocus`,e):H.current=dj(e,{sync:B.current,preventScroll:!0})}let t=n.current[F.current],r=V.current;t&&e(t),(B.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),fe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{O.current.orientation=g},[O,g]),Y(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(V.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),Y(()=>{if(a){if(!T){B.current=!1;return}if(E){if(r==null){if(B.current=!1,ne.current!=null)return;if(z.current&&(F.current=-1,oe()),(!ee.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||$j(I.current,g,u)||l?nT(n):rT(n),I.current=null,R())};t()}}else tT(n.current,r)||(F.current=r,oe(),V.current=!1)}}},[a,T,E,r,ne,l,n,g,u,R,oe,ae]),Y(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=_w(eT(D??t??null)),r=e.some(e=>e.context&&vw(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Y(()=>{ee.current=T,z.current=!!E}),Y(()=>{T||(I.current=null,P.current=f)},[T,f]);let se=r!=null,ce=X(e=>{if(!U.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),le=X(()=>_??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),ue=X(()=>nT(n,te.current)),de=X(e=>{if(L.current=!1,B.current=!0,e.which===229||!U.current&&e.currentTarget===j.current)return;if(l&&tM(e.key,g,u,C)){Qj(e.key,le())||dw(e),w.setOpen(!1,$T(GT,e.nativeEvent)),iS(D)&&(d?N?.events.emit(`virtualfocus`,D):D.focus());return}let t=F.current,r=nT(n,h),i=rT(n,h);if(A||(e.key===`Home`&&(dw(e),F.current=r,R(e)),e.key===`End`&&(dw(e),F.current=i,R(e))),x!=null){let t=x(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,R(e)),g===`both`)return}if(Qj(e.key,g)){if(dw(e),T&&!d&&_w(e.currentTarget.ownerDocument)===e.currentTarget){F.current=$j(e.key,g,u)?r:i,R(e);return}$j(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(B.current=!1,F.current=r):F.current=iT(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,iT(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(B.current=!1,F.current=i):F.current=iT(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,iT(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),tT(n.current,F.current)&&(F.current=-1),R(e)}}),fe=S.useMemo(()=>({onFocus(e){B.current=!0,ce(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){Xj(e)||(B.current=!0,V.current=!1,p&&ce(e))},onPointerLeave(e){if(!U.current||!L.current||e.pointerType===`touch`)return;B.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&re.current&&(H.current?.(),H.current=null,F.current=-1,R(e),!d)){let e=j.current,t=_w(eT(e));e&&vw(e,t)&&e.focus({preventScroll:!0})}}}),[ce,U,j,p,n,R,re,d]),pe=S.useMemo(()=>d&&T&&se&&{"aria-activedescendant":`${v}-${r}`},[d,T,se,v,r]),me=S.useMemo(()=>({...A?{}:pe,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&T&&!d){let t=yw(e.nativeEvent);if(t&&!vw(j.current,t))return;dw(e),w.setOpen(!1,$T(UT,e.nativeEvent)),iS(D)&&D.focus();return}de(e)},onPointerMove(e){Xj(e)||(L.current=!0)}}),[pe,de,j,A,w,T,d,D]),he=S.useMemo(()=>{function e(e){w.setOpen(!0,$T(GT,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&pw(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&mw(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=w.select(`open`);L.current=!1;let r=t.key.startsWith(`Arrow`),i=eM(t.key,le(),u),a=Qj(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return de(t);if(!(!n&&!m&&r)){if(o){let e=Qj(t.key,le());I.current=l&&e?null:t.key}if(l){i&&(dw(t),n?(F.current=ue(),R(t)):e(t));return}a&&(ne.current!=null&&(F.current=ne.current),dw(t),!n&&m?e(t):de(t),n&&R(t))}},onFocus(e){w.select(`open`)&&!d&&(F.current=-1,R(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[de,f,ue,l,R,w,m,g,le,u,ne,d]),ge=S.useMemo(()=>({...pe,...he}),[pe,he]);return S.useMemo(()=>a?{reference:ge,floating:me,item:fe,trigger:he}:{},[a,ge,me,he,fe])}function rM(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function iM(e){let t=S.useRef(!0);t.current&&(t.current=!1,e())}var aM=(e,t)=>Object.is(e,t);function oM(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function sM(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!BA(e,t,(e,t)=>oM(e,t,n)):e!==t}function cM(e,t,n){return e?e.some(e=>e!==void 0&&oM(t,e,n)):!1}function lM(e,t,n){return e?e.findIndex(e=>e!==void 0&&oM(e,t,n)):-1}function uM(e,t){if(t!==aM)return n=>cM(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function dM(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(uM(t,n)):lM(e,t,n);return i===-1?null:i}function fM(e,t,n,r,i,a){return cM(r,t,i)?a!=null&&e>a&&cM(r,n[a],i)?a:e:e===a?dM(n,r,i,!0):a}function pM(e,t,n){return e.filter(e=>!oM(t,e,n))}function mM(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function hM(e){return mM(e?.[0])}function gM(e){return hM(e)?e.flatMap(e=>e.items):e}function _M(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(hM(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function vM(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return rM(e)}function yM(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?rM(e.value):rM(e)}function bM(e,t,n){function r(){return vM(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=gM(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function xM(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,W.jsx)(S.Fragment,{children:bM(r,t,n)},i)),e),[])}function SM(e){return Array.isArray(e)?e.map(e=>SM(e)).join(`,`):e==null?``:String(e)}var CM=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});CM.displayName=`CompositeListContext`;function wM(){return S.useContext(CM)}function TM(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),[,o]=S.useState(!1),s=ex(DM).current,c=ex(EM).current,l=S.useRef(0),u=S.useRef(!0),d=S.useRef(null),f=S.useRef(null),p=X(()=>{u.current||(u.current=!0,o(e=>!e))}),m=X((e,t)=>{c.set(e,t),p()}),h=X(e=>{c.delete(e),p()}),g=X(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!AM(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&jM(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=kM(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=X(()=>{let[e,t]=OM(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Y(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=X(e=>(s.add(e),()=>{s.delete(e)})),b=S.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,W.jsx)(CM.Provider,{value:b,children:t})}function EM(){return new Map}function DM(){return new Set}function OM(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>jM(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function kM(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function AM(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function jM(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function MM(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=wM(),u=S.useRef(-1),[d,f]=S.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=S.useRef(null),h=S.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function NM(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=uD(),m=S.useRef(``),h=S.useRef(u??i??-1),g=S.useRef(null),_=X(e=>{function t(e){return r?.current[e]}function c(e){let n=t(e);return n&&!sT(n)||n?.matches(`:disabled`)?!1:o==null||!aT(hx,e,o)}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!c(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(dw(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(_,m.current)===-1&&e.key!==` `&&s?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(dw(e),s?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,s?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=d(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(b),g.current=b)}),v=X(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);vw(n,t)||vw(r,t)||(p.clear(),m.current=``,h.current=g.current,s?.(!1))});Y(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[f,u,p]);let y=S.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return S.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}function PM(e){return e==null?void 0:`${e}-label`}function FM(e,t){return e??t}var IM=5;function LM(e,t){let n=RM(t);return e.clientX>=n.left-IM&&e.clientX<=n.right+IM&&e.clientY>=n.top-IM&&e.clientY<=n.bottom+IM}function RM(e){let t=e.getBoundingClientRect(),n=eS(e);if(uw)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}var zM=20;function BM(e,t,n,r){let[i,a]=S.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=eT(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-zM)},[e,t,n]),qj(e&&(!t||i),r)}var VM=S.createContext(void 0);VM.displayName=`ToolbarRootContext`;function HM(e){let t=S.useContext(VM);if(t===void 0&&!e)throw Error(`Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.`);return t}function UM(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var WM=`ArrowUp`,GM=`ArrowDown`,KM=`ArrowLeft`,qM=`ArrowRight`,JM=`Home`,YM=`PageUp`,XM=`PageDown`,ZM=new Set([WM,GM,KM,qM,JM,`End`]);function QM(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=HA(),{ref:i,index:a}=MM(e),o=n===a,s=S.useRef(null),c=tx(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function $M(e){let{render:t,className:n,style:r,state:i=gx,props:a=hx,refs:o=hx,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=QM({metadata:s});return Fx(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var eN=S.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Fx(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});eN.displayName=`Separator`;var tN=S.createContext(null);tN.displayName=`MenubarContext`;function nN(e){let t=S.useContext(tN);if(t===null&&!e)throw Error(`Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.`);return t}var rN=S.createContext(void 0);rN.displayName=`MenuPositionerContext`;function iN(e){let t=S.useContext(rN);if(t===void 0&&!e)throw Error(`Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.`);return t}var aN=S.createContext(void 0);aN.displayName=`MenuRootContext`;function oN(e){let t=S.useContext(aN);if(t===void 0&&!e)throw Error(`Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.`);return t}var sN=S.createContext(void 0);sN.displayName=`ContextMenuRootContext`;function cN(e=!0){let t=S.useContext(sN);if(t===void 0&&!e)throw Error(`Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.`);return t}var lN=S.createContext(void 0);lN.displayName=`MenuCheckboxItemContext`;function uN(){let e=S.useContext(lN);if(e===void 0)throw Error(`Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.`);return e}function dN(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=cN(!0),f=d!==void 0;return S.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:zT})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!cw&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&UA(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var fN={type:`regular-item`};function pN(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=S.useRef(null),{getButtonProps:d,buttonRef:f}=GA({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=dN({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=S.useCallback(e=>xx(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=tx(u,f);return S.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var mN=`data-checked`,hN=`data-unchecked`,gN={checked(e){return e?{[mN]:``}:{[hN]:``}},...Aw},_N=S.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:u,onCheckedChange:d,style:f,...p}=e,m=MM({guess:!0,label:a}),h=iN(!0),g=WO(i),{store:_}=oN(),v=_.useState(`disabled`),y=s||v,b=_.useState(`isActive`,m.index),x=_.useState(`itemProps`),[C,w]=IA({controlled:l,default:u??!1,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:T,itemRef:E}=pN({closeOnClick:c,disabled:y,highlighted:b,id:g,store:_,nativeButton:o,nodeId:h?.context.nodeId,itemMetadata:fN}),D=S.useMemo(()=>({disabled:y,highlighted:b,checked:C}),[y,b,C]);function O(e){let t=$T(zT,e.nativeEvent,void 0,{preventUnmountOnClose:mx});d?.(!C,t),!t.isCanceled&&w(e=>!e)}let k=Fx(`div`,e,{state:D,stateAttributesMapping:gN,props:[x,{role:`menuitemcheckbox`,"aria-checked":C,onClick:O},p,T],ref:[E,t,m.ref]});return(0,W.jsx)(lN.Provider,{value:D,children:k})});_N.displayName=`MenuCheckboxItem`;var vN=S.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=uN(),c=S.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=YD(s.checked);return JD({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),Fx(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},ref:[t,c],stateAttributesMapping:gN,props:{"aria-hidden":!0,...o},enabled:a||u})});vN.displayName=`MenuCheckboxItemIndicator`;var yN=S.createContext(void 0);yN.displayName=`MenuGroupContext`;function bN(){let e=S.useContext(yN);if(e===void 0)throw Error(`Base UI: MenuGroupContext is missing. Menu group parts must be used within <Menu.Group> or <Menu.RadioGroup>.`);return e}var xN=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=S.useState(void 0),c=Fx(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,W.jsx)(yN.Provider,{value:s,children:c})});xN.displayName=`MenuGroup`;var SN=S.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=WO(a),c=bN();return Y(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),Fx(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})});SN.displayName=`MenuGroupLabel`;var CN=S.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=MM({guess:!0,label:a}),f=iN(!0),p=WO(i),{store:m}=oN(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=pN({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:fN});return Fx(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})});CN.displayName=`MenuItem`;var wN=S.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,closeOnClick:o=!1,style:s,...c}=e,l=S.useRef(null),u=MM({guess:!0,label:a}),d=iN(!0)?.context.nodeId,f=WO(i),{store:p}=oN(),m=p.useState(`isActive`,u.index),h=p.useState(`itemProps`),g=p.context.typingRef,{getButtonProps:_,buttonRef:v}=GA({native:!1,composite:!0}),y=dN({closeOnClick:o,highlighted:m,id:f,nodeId:d,store:p,typingRef:g,itemRef:l,itemMetadata:fN});function b(e){return xx(y,e,_)}return Fx(`a`,e,{state:{highlighted:m},props:[h,c,b],ref:[l,v,t,u.ref]})});wN.displayName=`MenuLinkItem`;var TN=S.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=oN(),{side:c,align:l}=iN(),u=HM(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),C=s.useState(`closeDelay`),w=s.useState(`hoverEnabled`),T=s.useState(`disabled`),E=s.useState(`openMethod`),D=_.type===`context-menu`;JD({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),S.useEffect(()=>{function e(e){s.setOpen(!1,$T(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),OD(b,{enabled:w&&!T&&!D&&_.type!==`menubar`,closeDelay:C});let O=s.useStateSetter(`popupElement`),k=Fx(`div`,e,{state:{transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},ref:[t,s.context.popupRef,O],stateAttributesMapping:Ww,props:[p,{onKeyDown(e){u&&ZM.has(e.key)&&e.stopPropagation()}},BO(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||D;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,W.jsx)(Mj,{context:b,openInteractionType:E,modal:D,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})});TN.displayName=`MenuPopup`;var EN=S.createContext(void 0);EN.displayName=`MenuPortalContext`;function DN(){let e=S.useContext(EN);if(e===void 0)throw Error(`Base UI: <Menu.Portal> is missing.`);return e}var ON=S.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=oN();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,W.jsx)(EN.Provider,{value:n,children:(0,W.jsx)(JE,{ref:t,...r,portalOwnerRole:o})})});ON.displayName=`MenuPortal`;var kN=S.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=VE,style:g,..._}=e,{store:v}=oN(),y=DN(),b=cN(!0),x=v.useState(`parent`),C=v.useState(`floatingRootContext`),w=v.useState(`floatingTreeRoot`),T=v.useState(`mounted`),E=v.useState(`open`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`activeTriggerElement`),A=v.useState(`transitionStatus`),j=v.useState(`positionerElement`),M=v.useState(`instantType`),N=v.useState(`adaptiveOrigin`),P=v.useState(`lastOpenChangeReason`),F=v.useState(`floatingNodeId`),I=v.useState(`floatingParentNodeId`),L=C.useState(`domReferenceElement`),R=S.useRef(null),z=qD(j),ee=n,B=c,V=l,H=s,te=h;x.type===`context-menu`&&(ee=n??x.context?.anchor,H??=`start`,!o&&H!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let U=o,ne=H;x.type===`menu`?(U??=`inline-end`,ne??=`start`,te=e.collisionAvoidance??HE):x.type===`menubar`&&(U??=x.context.orientation===`vertical`?`inline-end`:`bottom`,ne??=`start`);let re=x.type===`context-menu`,ie=LO({anchor:ee,floatingRootContext:C,positionMethod:b?`fixed`:r,mounted:T,side:U,sideOffset:B,align:ne,alignOffset:V,arrowPadding:re?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:F,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:te,shift:re?{crossAxis:!(`side`in te&&te.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:w,adaptiveOrigin:N});S.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===F&&v.set(`hoverEnabled`,!1),e.nodeId!==F&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,$T(YT)))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[v,w.events,F]),S.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,$T(t))}return w.events.on(`menuopenchange`,e),()=>{w.events.off(`menuopenchange`,e)}},[w.events,v]);let ae=uD();S.useEffect(()=>{E||ae.clear()},[E,ae]),S.useEffect(()=>{function e(e){if(!(!E||e.nodeId!==v.select(`floatingParentNodeId`))){if(e.target&&k&&k!==e.target){let e=v.select(`closeDelay`);e>0?ae.isStarted()||ae.start(e,()=>{v.setOpen(!1,$T(YT))}):v.setOpen(!1,$T(YT))}else ae.clear()}}return w.events.on(`itemhover`,e),()=>{w.events.off(`itemhover`,e)}},[w.events,E,k,v,ae]),S.useEffect(()=>{let e={open:E,nodeId:F,parentNodeId:I,reason:v.select(`lastOpenChangeReason`)};w.events.emit(`menuopenchange`,e)},[w.events,E,v,F,I]),Y(()=>{let e=L,t=R.current;if(e&&(R.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return z(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,z,v]);let oe={open:E,side:ie.side,align:ie.align,anchorHidden:ie.anchorHidden,nested:x.type===`menu`,instant:M},se=x.type===`menubar`&&x.context.modal;BM(E&&(se||D&&P!==`trigger-hover`),O===`touch`,j,k);let ce=VO(e,oe,{styles:ie.positionerStyles,transitionStatus:A,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!T,inert:!E}),le=T&&x.type!==`menu`&&(x.type!==`menubar`&&D&&P!==`trigger-hover`||x.type===`menubar`&&x.context.modal),ue=null;return x.type===`menubar`?ue=x.context.contentElement:x.type===void 0&&(ue=k),(0,W.jsxs)(rN.Provider,{value:ie,children:[le&&(0,W.jsx)(Ij,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:XA(!E),cutout:ue}),(0,W.jsx)(xE,{id:F,children:(0,W.jsx)(TM,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:ce})})]})});kN.displayName=`MenuPositioner`;var AN=S.createContext(void 0);AN.displayName=`MenuRadioGroupContext`;function jN(){let e=S.useContext(AN);if(e===void 0)throw Error(`Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.`);return e}var MN=S.memo(S.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=S.useState(void 0),[p,m]=IA({controlled:i,default:a,name:`MenuRadioGroup`}),h=X((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=Fx(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),_=S.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,W.jsx)(yN.Provider,{value:f,children:(0,W.jsx)(AN.Provider,{value:_,children:g})})}));MN.displayName=`MenuRadioGroup`;var NN=S.createContext(void 0);NN.displayName=`MenuRadioItemContext`;function PN(){let e=S.useContext(NN);if(e===void 0)throw Error(`Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.`);return e}var FN=S.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,f=MM({guess:!0,label:a}),p=iN(!0),m=WO(i),{store:h}=oN(),g=h.useState(`isActive`,f.index),_=h.useState(`itemProps`),{value:v,setValue:y,disabled:b}=jN(),x=h.useState(`disabled`),C=s||b||x,w=v===l,{getItemProps:T,itemRef:E}=pN({closeOnClick:c,disabled:C,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p?.context.nodeId,itemMetadata:fN}),D=S.useMemo(()=>({disabled:C,highlighted:g,checked:w}),[C,g,w]);function O(e){let t=$T(zT,e.nativeEvent,void 0,{preventUnmountOnClose:mx});y(l,t)}let k=Fx(`div`,e,{state:D,stateAttributesMapping:gN,props:[_,{role:`menuitemradio`,"aria-checked":w,onClick:O},d,T],ref:[E,t,f.ref]});return(0,W.jsx)(NN.Provider,{value:D,children:k})});FN.displayName=`MenuRadioItem`;var IN=S.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=PN(),c=S.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=YD(s.checked);return JD({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),Fx(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},stateAttributesMapping:gN,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||u})});IN.displayName=`MenuRadioItemIndicator`;var LN={..._O,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},RN=class extends tD{constructor(e,t,n=!1){let r=new oD,i=BN(r,t,n,e);super(i,zN(r),LN),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function zN(e){return{positionerRef:S.createRef(),popupRef:S.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function BN(e,t,n=!1,r){return{...dO(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new hE,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:gx,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var VN=S.createContext(void 0);VN.displayName=`MenuSubmenuRootContext`;function HN(){return S.useContext(VN)}var UN=NE(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=cN(!0),_=oN(!0),v=nN(!0),y=HN(),b=S.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=pE(),C=pE(),w=vE(),T=b.type===`menu`?b.store:void 0,E=(n??a)&&T?.state.transitionStatus===`starting`,D=ex(()=>E?T?.state.instantType:void 0).current,O=WN({open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b,disabled:o,highlightItemOnHover:h,modal:b.type===void 0?s:void 0,rootId:x,instantType:D},C,w!=null);O.useControlledProp(`openProp`,n),O.useControlledProp(`triggerIdProp`,p),O.useContextCallback(`onOpenChangeComplete`,i);let k=O.useState(`floatingTreeRoot`),A=bE(k),j=O.useState(`open`),M=O.useState(`activeTriggerElement`),N=O.useState(`positionerElement`),P=O.useState(`hoverEnabled`),F=O.useState(`disabled`),I=O.useState(`lastOpenChangeReason`),L=O.useState(`parent`),R=O.useState(`activeIndex`),z=O.useState(`payload`),ee=O.useState(`floatingParentNodeId`),B=S.useRef(null),V=S.useRef(L.type!==`context-menu`),H=uD(),te=S.useRef(!0),U=uD(),ne=ee!=null;L.type!==void 0&&s!==void 0&&console.warn("Base UI: The `modal` prop is not supported on nested menus. It will be ignored.");let{openMethod:re,triggerProps:ie}=Fj(j);O.useSyncedValues({disabled:o,highlightItemOnHover:h,modal:L.type===void 0?s:void 0,openMethod:re,rootId:x}),sO(O);let{forceUnmount:ae,transitionStatus:oe}=cO(j,O,()=>{O.set(`allowMouseEnter`,!1)},E),se=qD(O.context.popupRef);S.useEffect(()=>{if(D===void 0)return;let e=()=>{O.state.instantType===D&&O.set(`instantType`,void 0)};if(!j){e();return}if(oe!==void 0)return;if(O.context.popupRef.current==null){e();return}let t=new AbortController;return se(e,t.signal),()=>{t.abort()}},[D,j,oe,se,O]),Y(()=>{g&&!_?O.update({parent:{type:`context-menu`,context:g},floatingNodeId:A,floatingParentNodeId:w}):_&&O.update({floatingNodeId:A,floatingParentNodeId:w})},[g,_,A,w,O]),S.useEffect(()=>{if(j||(B.current=null),L.type===`context-menu`){if(!j){H.clear(),V.current=!1;return}H.start(500,()=>{V.current=!0})}},[H,j,L.type]),Y(()=>{!j&&!P&&O.set(`hoverEnabled`,!0)},[j,P,O]);let ce=X((e,t)=>{let n=t.reason;if(!e&&!O.select(`open`)||j===e&&t.trigger===M&&I===n)return;let i=iO(t);if(!e&&t.trigger==null&&(t.trigger=M??void 0),r?.(e,t),t.isCanceled)return;O.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!te.current)return;e&&n===`trigger-focus`?(te.current=!1,U.start(300,()=>{te.current=!0})):(te.current=!0,U.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);B.current=t.event;let c=rO(O.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=L.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,O.update(c)}),le=XD({popupStore:O,floatingRootContext:O.state.floatingRootContext,floatingId:C,nested:w!=null,onOpenChange:ce}),ue=le.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>ce(e,t);return ue.on(`setOpen`,e),()=>{ue?.off(`setOpen`,e)}},[ue,ce]);let de=S.useCallback(()=>{O.setOpen(!1,$T(ZT))},[O]);S.useImperativeHandle(u,()=>({unmount:ae,close:de}),[ae,de]);let fe;L.type===`context-menu`&&(fe=L.context),S.useImperativeHandle(fe?.positionerRef,()=>N,[N]),S.useImperativeHandle(fe?.actionsRef,()=>({setOpen:ce}),[ce]);let pe=_D(le,{enabled:!F,bubbles:{escapeKey:d&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||B.current?.type===`contextmenu`||V.current},externalTree:ne?k:void 0}),me=xO(),he=S.useCallback(e=>{O.select(`activeIndex`)!==e&&O.set(`activeIndex`,e)},[O]),ge=nM(le,{enabled:!F,listRef:O.context.itemDomElements,activeIndex:R,nested:L.type!==void 0,loopFocus:c,orientation:l,parentOrientation:L.type===`menubar`?L.context.orientation:void 0,rtl:me===`rtl`,disabledIndices:hx,onNavigate:he,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:ne?k:void 0,focusItemOnHover:h}),_e=S.useCallback(e=>{O.context.typingRef.current=e},[O]),ve=NM(le,{enabled:!F,listRef:O.context.itemLabels,elementsRef:O.context.itemDomElements,activeIndex:R,resetMs:500,onMatch:e=>{j&&e!==R&&O.set(`activeIndex`,e)},onTyping:_e}),ye=S.useMemo(()=>{let e=xx(ve.reference,ge.reference,pe.reference,{onMouseMove(){O.set(`allowMouseEnter`,!0)}},ie);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=j,e},[O,ve.reference,ge.reference,pe.reference,ie,j]),be=S.useMemo(()=>{let e=xx(ge.trigger,pe.trigger,ie);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ge.trigger,pe.trigger,ie]);ex(()=>(O.update({inactiveTriggerProps:be}),null)),lO(O,{floatingRootContext:le,activeTriggerProps:ye,inactiveTriggerProps:be,popupProps:S.useMemo(()=>xx(ZD,{id:C,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":M?.id,onMouseMove(){O.set(`allowMouseEnter`,!0),L.type===`menu`&&O.set(`hoverEnabled`,!1)},onClick(){O.select(`hoverEnabled`)&&O.set(`hoverEnabled`,!1)},onKeyDown(e){let t=O.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},ve.floating,ge.floating,pe.floating),[M,C,l,L.type,O,ve.floating,ge.floating,pe.floating]),itemProps:ge.item??gx});let xe=S.useMemo(()=>({store:O,parent:b}),[O,b]),Se=(0,W.jsxs)(aN.Provider,{value:xe,children:[f&&(0,W.jsx)(eO,{handle:f,store:O}),typeof t==`function`?t({payload:z}):t]});return L.type===void 0||L.type===`context-menu`?(0,W.jsx)(SE,{externalTree:k,children:Se}):Se});UN.displayName=`MenuRoot`;function WN(e,t,n){return ex(()=>new RN(e,t,n)).current}function GN(e){let t=oN().store,n=S.useMemo(()=>({parentMenu:t}),[t]);return(0,W.jsx)(VN.Provider,{value:n,children:(0,W.jsx)(UN,{...e})})}function KN(e){if(iS(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!gS(e))return KN(yS(e))}var qN={"aria-expanded":void 0},JN=S.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=HN();if(!p?.parentMenu)throw Error(`Base UI: <Menu.SubmenuTrigger> must be placed in <Menu.SubmenuRoot>.`);let m=MM({guess:!0,label:a}),h=iN(),{store:g}=oN(),_=WO(o),v=g.useState(`open`),y=g.useState(`floatingRootContext`),b=g.useState(`floatingTreeRoot`),x=g.useState(`triggerPopupId`,_),C=nO(_,g),w=X(e=>{C(e),e!==null&&g.select(`open`)&&g.select(`activeTriggerId`)==null&&g.update({activeTriggerId:_??null,activeTriggerElement:e,closeDelay:u})}),T=S.useRef(null),E=S.useCallback(e=>{T.current=e,g.set(`activeTriggerElement`,e)},[g]);Y(()=>(w(T.current),()=>w(null)),[w,_,g]),g.useSyncedValue(`closeDelay`,u);let D=p.parentMenu,O=g.useState(`disabled`),k=D.useState(`disabled`),A=d||O||k;S.useEffect(()=>{let e=T.current;e&&UM(e)&&!A&&px(`A disabled element was detected on <Menu.SubmenuTrigger>. To properly disable the trigger, use the \`disabled\` prop on the component instead of setting it on the rendered element.${Zx.captureOwnerStack?.()||``}`)});let j=D.useState(`itemProps`),M=D.useState(`isActive`,m.index),N=S.useMemo(()=>({type:`submenu-trigger`,setActive(){D.select(`highlightItemOnHover`)&&D.set(`activeIndex`,m.index)}}),[D,m.index]),{getItemProps:P,itemRef:F}=pN({closeOnClick:!1,disabled:A,highlighted:M,id:_,store:g,typingRef:D.context.typingRef,nativeButton:s,itemMetadata:N,nodeId:h?.context.nodeId}),I=AD(y,{enabled:g.useState(`hoverEnabled`)&&c&&!A,handleClose:RD({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>D.select(`allowMouseEnter`):void 0,triggerElementRef:T,externalTree:b,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),L=Jj(y,{enabled:!A,event:`mousedown`,toggle:!c,ignoreMouse:c,stickIfOpen:!1}).reference??gx,R=g.useState(`triggerProps`,!0);delete R.id;let z={disabled:A,highlighted:M,open:v},ee=g.useState(`openMethod`),B=g.useState(`lastOpenChangeReason`)===`list-navigation`||ee===`keyboard`;return Fx(`div`,e,{state:z,stateAttributesMapping:Vw,props:[L,I,R,j,v&&B&&IE?qN:void 0,{"aria-controls":x,tabIndex:v||M?0:-1,onBlur(){M&&D.set(`activeIndex`,null)}},f,P],ref:[t,m.ref,F,w,E]})});JN.displayName=`MenuSubmenuTrigger`;function YN(e,t){let n=S.useRef(null);function r(t){Kc.flushSync(()=>{e.setOpen(!1,$T(UT,t.nativeEvent,t.currentTarget))}),kT(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&AT(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Kc.flushSync(()=>{e.setOpen(!1,$T(UT,n.nativeEvent,n.currentTarget))});let i=OT(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&vw(r,i);){let e=i;if(i=TT(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function XN(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=S.useRef(!1);return S.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,eT(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:gx,[t,n,r])}var ZN=PE(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=oN(!0),h=vO(d)??m?.store;if(!h)throw Error(`Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.`);let g=WO(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=S.useRef(null),C=$N(),w=HA(!0),T=yE(),E=S.useMemo(()=>T??new hE,[T]),{registerTrigger:D,isMountedByThisTrigger:O}=oO(g,x,h,{payload:f,closeDelay:u,parent:C,floatingTreeRoot:E,floatingNodeId:bE(E),floatingParentNodeId:vE(),keyboardEventRelay:w?.relayKeyboardEvent}),k=C.type===`menubar`,A=h.useState(`disabled`),j=a||A||k&&C.context.disabled,{getButtonProps:M,buttonRef:N}=GA({disabled:j,native:o});S.useEffect(()=>{!y&&C.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,C.type]);let P=S.useRef(null),F=uD(),I=X(e=>{if(!P.current)return;F.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;vw(P.current,t)||vw(h.select(`positionerElement`),t)||t===P.current||(t==null||KN(t)!==h.select(`rootId`))&&(LM(e,P.current)||E.events.emit(`close`,{domEvent:e,reason:JT}))});S.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&eT(P.current).addEventListener(`mouseup`,I,{once:!0})},[y,I,h]);let L=k&&C.context.hasSubmenuOpen,R=AD(v,{enabled:(c??L)&&!j&&(!k||L&&!O),handleClose:RD({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:C.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:E,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),z=QN(y,h.select(`lastOpenChangeReason`)),ee=Jj(v,{enabled:!j,event:y&&k?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:C.type===void 0&&z}),B=UO(v,{enabled:!j&&L}),V=XN({open:y,enabled:k,mouseDownAction:`open`}),H=S.useMemo(()=>xx(B.reference,ee.reference),[B.reference,ee.reference]),te=h.useState(`triggerProps`,O),{preFocusGuardRef:U,handlePreFocusGuardFocus:ne,handleFocusTargetFocus:re}=YN(h,x),ie={disabled:j,open:y},ae=[P,t,N,D,x],oe=[H,R??gx,te,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(F.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),eT(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},k?{role:`menuitem`}:{},V,p,M],se=Fx(`button`,e,{enabled:!k,stateAttributesMapping:Hw,state:ie,ref:ae,props:oe});return k?(0,W.jsx)($M,{tag:`button`,render:n,className:r,style:i,state:ie,refs:ae,props:oe,stateAttributesMapping:Hw}):y?(0,W.jsxs)(S.Fragment,{children:[(0,W.jsx)(LE,{ref:U,onFocus:ne},`${g}-pre-focus-guard`),(0,W.jsx)(S.Fragment,{children:se},g),(0,W.jsx)(LE,{ref:h.context.triggerFocusTargetRef,onFocus:re},`${g}-post-focus-guard`)]}):(0,W.jsx)(S.Fragment,{children:se},g)});ZN.displayName=`MenuTrigger`;function QN(e,t){let n=uD(),[r,i]=S.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function $N(){let e=nN(!0);return S.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var eP={variant:{default:{classes:``,description:`Default dropdown item appearance`},danger:{classes:`text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger`,description:`Destructive action item`}}},tP={variant:`default`};function nP({variant:e=tP.variant}={}){return Jb(Yb(eP.variant,e,tP.variant).classes)}var rP=S.forwardRef(({className:e,inset:t,children:n,icon:r,...i},a)=>(0,W.jsxs)(JN,{ref:a,"data-kumo-component":`DropdownMenu`,"data-kumo-part":`submenu-trigger`,className:Jb(`flex cursor-default items-center rounded-sm text-base outline-hidden select-none`,`px-2 py-1.5`,`focus:bg-kumo-tint focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand`,`data-[state=open]:bg-kumo-tint`,t&&`pl-8`,e),...i,children:[r&&(0,W.jsx)(r,{className:`mr-2 h-4 w-4`}),n,(0,W.jsx)(jk,{className:`ml-auto h-4 w-4`})]}));rP.displayName=JN.displayName;var iP=S.forwardRef(({className:e,sideOffset:t=8,children:n,container:r,...i},a)=>{let o=Xx();return(0,W.jsx)(ON,{container:r??o??void 0,children:(0,W.jsx)(kN,{ref:a,sideOffset:t,...i,children:(0,W.jsx)(TN,{className:Jb(`overflow-hidden bg-kumo-control text-kumo-default`,`max-h-[var(--available-height)] overflow-y-auto`,`rounded-lg shadow-lg ring ring-kumo-line`,`min-w-36 p-1.5`,`data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2`,`data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2`,`data-[side=top]:slide-in-from-bottom-2`,`data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),children:n})})})}),aP=e=>e?S.isValidElement(e)?e:(0,W.jsx)(e,{className:`mr-2 h-4 w-4`}):null,oP=S.forwardRef(({className:e,inset:t,icon:n,children:r,selected:i,render:a,href:o,variant:s=`default`,...c},l)=>{let u=Qb(),d=S.useMemo(()=>(0,W.jsxs)(W.Fragment,{children:[n&&aP(n),r,i&&(0,W.jsx)(`span`,{className:`inline-flex`,children:(0,W.jsx)(Nk,{})})]}),[n,r,i]),f=S.useMemo(()=>{if(!o)return;let e=/^(https?:)?\/\//.test(o),t=Jb(`flex items-center`,s===`danger`&&`text-kumo-danger data-highlighted:bg-kumo-danger/5 data-highlighted:text-kumo-danger`);return e?(0,W.jsx)(`a`,{className:Jb(t,`w-full text-inherit! no-underline!`),href:o,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),children:d}):(0,W.jsx)(u,{className:Jb(t,`w-full text-inherit! no-underline!`),href:o,to:o,onClick:e=>e.stopPropagation(),children:d})},[o,d,s,u]),p=o||a;return(0,W.jsx)(CN,{ref:l,"data-kumo-component":`DropdownMenu`,"data-kumo-part":`item`,className:Jb(`relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none focus:text-kumo-default focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay`,t&&`pl-8`,nP({variant:s}),e),render:o?f:a,...c,children:p?void 0:d})});oP.displayName=CN.displayName;var sP=S.forwardRef(({className:e,inset:t,icon:n,children:r,variant:i=`default`,...a},o)=>(0,W.jsxs)(wN,{ref:o,"data-kumo-component":`DropdownMenu`,"data-kumo-part":`link-item`,className:Jb(`relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none`,`focus:text-kumo-default focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-overlay`,`text-inherit no-underline`,t&&`pl-8`,nP({variant:i}),e),...a,children:[n&&aP(n),r]}));sP.displayName=`DropdownMenuLinkItem`;var cP=S.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,W.jsxs)(_N,{ref:i,"data-kumo-component":`DropdownMenu`,"data-kumo-part":`checkbox-item`,className:Jb(`relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-base outline-hidden transition-colors select-none focus:bg-kumo-tint focus:text-kumo-default focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand data-disabled:pointer-events-none data-disabled:opacity-50`,e),checked:n,...r,children:[(0,W.jsx)(vN,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center text-inherit`,children:(0,W.jsx)(Nk,{weight:`bold`,size:12})}),t]}));cP.displayName=_N.displayName;var lP=S.forwardRef(({className:e,inset:t,...n},r)=>(0,W.jsx)(SN,{ref:r,className:Jb(`px-2 py-1.5 text-base font-semibold`,t&&`pl-8`,e),...n}));lP.displayName=SN.displayName;var uP=S.forwardRef(({className:e,...t},n)=>(0,W.jsx)(eN,{ref:n,className:Jb(`-mx-1 my-1 h-px bg-kumo-hairline`,e),...t}));uP.displayName=eN.displayName;var dP=({className:e,...t})=>(0,W.jsx)(`span`,{className:Jb(`ml-auto text-xs tracking-widest opacity-60`,e),...t});dP.displayName=`DropdownMenuShortcut`;var fP=S.forwardRef(({className:e,children:t,inset:n,icon:r,...i},a)=>(0,W.jsxs)(FN,{ref:a,"data-kumo-component":`DropdownMenu`,"data-kumo-part":`radio-item`,className:Jb(`relative flex cursor-default items-center rounded-md px-2 py-1.5 text-base outline-hidden select-none`,`data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-kumo-tint`,n&&`pl-8`,e),...i,children:[r&&aP(r),t]}));fP.displayName=`DropdownMenuRadioItem`;var pP=S.forwardRef(({className:e,children:t,...n},r)=>(0,W.jsx)(IN,{ref:r,className:Jb(`ml-auto`,e),...n,children:t??(0,W.jsx)(Nk,{className:`h-4 w-4`})}));pP.displayName=`DropdownMenuRadioItemIndicator`;var mP=S.forwardRef(({children:e,render:t,...n},r)=>{if(t)return(0,W.jsx)(ZN,{ref:r,...n,render:t,children:e});let i=S.isValidElement(e)?e:null;return(0,W.jsx)(ZN,{ref:r,...n,...i&&{render:i},children:i?void 0:e})});mP.displayName=`DropdownMenuTrigger`;var hP=Object.assign(UN,{Trigger:mP,Portal:ON,Sub:GN,SubTrigger:rP,SubContent:iP,Content:iP,Item:oP,LinkItem:sP,CheckboxItem:cP,RadioGroup:MN,RadioItem:fP,RadioItemIndicator:pP,Label:lP,Separator:uP,Shortcut:dP,Group:xN}),gP=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),_P=(e,t)=>(Math.random()*(t-e)+e).toFixed(2),vP=({minWidth:e=30,maxWidth:t=100,minDuration:n=1.3,maxDuration:r=1.7,minDelay:i=0,maxDelay:a=.5,blockHeight:o,className:s})=>{let{width:c,duration:l,delay:u}=(0,S.useMemo)(()=>({width:gP(e,t),duration:_P(n,r),delay:_P(i,a)}),[e,t,n,r,i,a]),d={"--skeleton-width":`${c}%`,"--shimmer-duration":`${l}s`,"--shimmer-delay":`${u}s`},f=(0,W.jsx)(`div`,{className:Jb(`skeleton-line`,s),style:d});if(o!==void 0){let e=typeof o==`number`?`${o}px`:o;return(0,W.jsx)(`div`,{className:`flex items-center`,style:{height:e},children:f})}return f},yP=new Map;function bP(e,t){let n=JSON.stringify({locale:SM(e),options:t}),r=yP.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return yP.set(n,i),i}function xP(e,t,n){return e==null?``:bP(t,n).format(e)}function SP(e,t,n){return(e-t)*100/(n-t)}function CP(e){let[t,n]=S.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var wP=S.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Fx(`div`,e,{state:{orientation:i},ref:t,props:[{role:`presentation`},o]})});wP.displayName=`ListboxSeparator`;function TP(e,t){return Math.max(0,e-t)}function EP(e,t){if(t<=0)return 0;let n=ZA(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var DP=`base-ui-disable-scrollbar`,OP={className:DP,getElement(e){return(0,W.jsx)(`style`,{nonce:e,href:DP,precedence:`base-ui:low`,children:`.${DP}{scrollbar-width:none}.${DP}::-webkit-scrollbar{display:none}`})}};OP.getElement.displayName=`styleDisableScrollbar.getElement`;var kP=S.createContext(void 0);kP.displayName=`CSPContext`;var AP={disableStyleElements:!1};function jP(){return S.useContext(kP)??AP}var MP=S.createContext(void 0);MP.displayName=`SelectRootContext`;var NP=S.createContext(void 0);NP.displayName=`SelectRootPropsContext`;var PP=S.createContext(void 0);PP.displayName=`SelectFloatingContext`;function FP(){let e=S.useContext(MP);if(e===void 0)throw Error(`Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.`);return e}function IP(){let e=S.useContext(NP);if(e===void 0)throw Error(`Base UI: SelectRootPropsContext is missing. Select parts must be placed within <Select.Root>.`);return e}function LP(){let e=S.useContext(PP);if(e===void 0)throw Error(`Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.`);return e}var RP={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:yM(t,r)!==``},hasNullItemLabel:(e,t)=>t?_M(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>oM(t,e,n)):oM(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function zP(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:C=aM,highlightItemOnHover:w=!0,children:T}=e,{clearErrors:E}=_A(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=pA(),I=FA({id:t}),L=N||d,R=M??c,[z,ee]=IA({controlled:n,default:y?r??hx:r,name:`Select`,state:`value`}),[B,V]=IA({controlled:a,default:o,name:`Select`,state:`open`}),H=S.useRef([]),te=S.useRef([]),U=S.useRef(null),ne=S.useRef(null),re=S.useRef(0),ie=S.useRef(null),ae=S.useRef([]),oe=S.useRef(!1),se=S.useRef(null),ce=S.useRef(null),le=S.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),ue=S.useRef(!1),de=S.useRef(z),{mounted:fe,setMounted:pe,transitionStatus:me}=YD(B),{openMethod:he,triggerProps:ge}=Fj(B),_e=ex(()=>new tD({id:I,labelId:void 0,modal:m,multiple:y,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:C,value:z,open:B,mounted:fe,transitionStatus:me,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:gx,triggerProps:gx,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:mx,setOpen:mx,handleScrollArrowVisibility:mx,onOpenChangeComplete:mx,listRef:H,popupRef:U,scrollHandlerRef:ne,scrollArrowsMountedCountRef:re,valueRef:ie,valuesRef:ae,labelsRef:te,typingRef:oe,selectionRef:le,firstItemTextRef:se,selectedItemTextRef:ce,alignItemWithTriggerActiveRef:ue,initialValueRef:de},RP)).current,ve=_e.useState(`activeIndex`),ye=_e.useState(`selectedIndex`),be=_e.useState(`triggerElement`),xe=_e.useState(`positionerElement`),Se=CP(he),Ce=he??Se,we=S.useMemo(()=>y?``:yM(z,x),[y,z,x]),Te=S.useMemo(()=>y&&Array.isArray(z)?z.map(e=>yM(e,x)):yM(z,x),[y,z,x]);RA(dD(be),I,z,X(()=>Te),!L,c);let Ee=y?Array.isArray(z)&&z.length>0:z!=null&&we!==``;Y(()=>{j(Ee)},[Ee,j]),Y(function(){let e=dM(ae.current,z,C,y);e===null&&(ce.current=null),!B&&_e.set(`selectedIndex`,e)},[y,B,z,C,_e]),zA(z,()=>{E(R),D(sM(z,A.initialValue,C)),P.change(z)});let De=X((e,t)=>{s?.(e,t),!t.isCanceled&&(V(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(z)))}),Oe=X(()=>{pe(!1),_e.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)});JD({enabled:!h,open:B,ref:U,onComplete(){B||Oe()}}),S.useImperativeHandle(h,()=>({unmount:Oe}),[Oe]);let ke=X((e,t)=>{i?.(e,t),!t.isCanceled&&ee(e)}),Ae=X(e=>{let t=TP(e.scrollHeight,e.clientHeight),n=EP(e.scrollTop,t),r=n>0,i=n<t;_e.set(`scrollUpArrowVisible`,r),_e.set(`scrollDownArrowVisible`,i)}),je=yO({open:B,onOpenChange:De,elements:{reference:be,floating:xe}}),Me=Jj(je,{enabled:!L,event:`mousedown`}),Ne=_D(je),Pe=nM(je,{enabled:!L,listRef:H,activeIndex:ve,selectedIndex:ye,disabledIndices:hx,onNavigate(e){e===null&&!B||_e.set(`activeIndex`,e)},focusItemOnHover:w}),Fe=NM(je,{enabled:!L&&(B||!f&&!y),listRef:te,activeIndex:ve,selectedIndex:ye,disabledIndices:e=>UM(H.current[e]),onMatch(e){B?_e.set(`activeIndex`,e):ke(ae.current[e],$T(PT))},onTyping(e){oe.current=e}}),Ie=S.useMemo(()=>xx(Fe.reference,Pe.reference,Ne.reference,Me.reference,ge),[Me.reference,Fe.reference,Pe.reference,Ne.reference,ge]),Le=S.useMemo(()=>xx(ZD,Fe.floating,Pe.floating,Ne.floating),[Fe.floating,Pe.floating,Ne.floating]),Re=Pe.item??gx;_e.useContextCallback(`setValue`,ke),_e.useContextCallback(`setOpen`,De),_e.useContextCallback(`handleScrollArrowVisibility`,Ae),_e.useContextCallback(`onOpenChangeComplete`,_),iM(()=>{_e.update({popupProps:Le,triggerProps:Ie})}),_e.useSyncedValues({id:I,modal:m,multiple:y,value:z,open:B,mounted:fe,transitionStatus:me,popupProps:Le,triggerProps:Ie,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:C,openMethod:Ce});let ze=S.useMemo(()=>({disabled:L,readOnly:f,required:p,multiple:y,highlightItemOnHover:w,itemProps:Re}),[L,f,p,y,w,Re]),Be=tx(g,P.inputRef),Ve=y?void 0:R,He=S.useMemo(()=>!y||!Array.isArray(z)||!R?null:z.map(e=>{let t=yM(e,x);return(0,W.jsx)(`input`,{type:`hidden`,form:l,name:R,value:t,disabled:L},t)}),[y,z,l,R,x,L]);return(0,W.jsxs)(MP.Provider,{value:_e,children:[(0,W.jsx)(NP.Provider,{value:ze,children:(0,W.jsx)(PP.Provider,{value:je,children:T})}),(0,W.jsx)(`input`,{...P.getValidationProps(L,{onFocus(){_e.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||f)return;let t=e.currentTarget.value,n=$T(PT,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=ae.current.findIndex(t=>yM(t,x).toLowerCase()===e||vM(t,b).toLowerCase()===e);r===-1&&(r=ae.current.findIndex((t,n)=>{let r=te.current[n];return r!=null&&r.toLowerCase()===e}));let i=ae.current[r];i!=null&&ke(i,n)}_e.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&Ve==null?`${I}-hidden-input`:void 0,form:l,name:Ve,autoComplete:u,value:we,disabled:L,required:p&&!(y&&Ee),readOnly:f,ref:Be,style:R?lE:cE,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),He]})}var BP=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=a;delete o.id;let s=pA(),c=FP(),l=c.useState(`triggerElement`),u=c.useState(`id`),d=vA({id:PM(u),fallbackControlId:l?.id??u,setLabelId(e){let t=typeof e==`function`?e(c.state.labelId):e;c.set(`labelId`,t)}});return Fx(`div`,e,{ref:t,state:s.state,props:[d,a],stateAttributesMapping:uA})});BP.displayName=`SelectLabel`;var VP=`data-popup-side`,HP=400,UP={...Hw,...uA,popupSide:e=>e?{[VP]:e}:null,value:()=>null},WP=S.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,validation:f,state:p,disabled:m}=pA(),{labelId:h}=hA(),g=FP(),{readOnly:_,required:v,disabled:y}=IP(),b=m||y||a,x=g.useState(`open`),C=g.useState(`mounted`),w=g.useState(`value`),T=g.useState(`triggerProps`),E=g.useState(`positionerElement`),D=g.useState(`listElement`),O=g.useState(`popupSide`),k=g.useState(`id`),A=g.useState(`labelId`),j=g.useState(`hasSelectedValue`),M=C&&E?O:null,N=i??k,P=FM(h,A);FA({id:i});let F=dD(E),I=S.useRef(null),{getButtonProps:L,buttonRef:R}=GA({disabled:b,native:o}),z=g.useStateSetter(`triggerElement`),ee=uD(),B=uD(),V=uD();S.useEffect(()=>{if(x)return V.start(HP,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{V.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[x,g,B,V]);let H=xx(T,{id:N,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?D?.id??$w(E)?.id:void 0,"aria-labelledby":P,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){u(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,$T(PT,e.nativeEvent)),ee.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){vw(E,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&f.commit(w))},onMouseDown(e){if(x)return;let t=eT(e.currentTarget);function n(e){if(!I.current)return;let t=e.target;vw(I.current,t)||vw(F.current,t)||LM(e,I.current)||g.context.setOpen(!1,$T(JT,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,L),te=f.getValidationProps(b,H);te.role=`combobox`;let U={...p,open:x,disabled:b,value:w,readOnly:_,popupSide:M,placeholder:!j};return Fx(`button`,e,{ref:[t,I,R,z],state:U,stateAttributesMapping:UP,props:te})});WP.displayName=`SelectTrigger`;var GP={value:()=>null},KP=S.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=FP(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?xM(l,u,d):bM(l,u,d)),Fx(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:GP})});KP.displayName=`SelectValue`;var qP=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Fx(`span`,e,{state:{open:FP().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Vw})});qP.displayName=`SelectIcon`;var JP=S.forwardRef(function(e,t){let n=FP(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,W.jsx)(JE,{ref:t,...e}):null});JP.displayName=`SelectPortal`;var YP=S.createContext(void 0);YP.displayName=`SelectPositionerContext`;function XP(){let e=S.useContext(YP);if(!e)throw Error(`Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.`);return e}function ZP(e,t){e&&Object.assign(e.style,t)}var QP={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},$P={position:`fixed`},eF=S.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=VE,style:_,...v}=e,y=FP(),b=LP(),x=y.useState(`open`),C=y.useState(`mounted`),w=y.useState(`modal`),T=y.useState(`value`),E=y.useState(`openMethod`),D=y.useState(`positionerElement`),O=y.useState(`triggerElement`),k=y.useState(`isItemEqualToValue`),A=y.useState(`transitionStatus`),j=S.useRef(null),M=S.useRef(null),[N,P]=S.useState(h),F=C&&N&&E!==`touch`;!C&&N!==h&&P(h),S.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>F),BM((F||w)&&x,E===`touch`,D,O);let I=LO({anchor:n,floatingRootContext:b,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??F,collisionAvoidance:g,keepMounted:!0}),L=F?`none`:I.side,R=F?$P:I.positionerStyles,z={open:x,side:L,align:I.align,anchorHidden:I.anchorHidden};Y(()=>{y.set(`popupSide`,I.side)},[y,I.side]);let ee=VO(e,z,{styles:R,transitionStatus:A,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!C,inert:!x}),B=S.useRef(0),V=X(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=$T(PT);if(t!==0&&!y.state.multiple&&T!==null&&lM(y.context.valuesRef.current,T,k)===-1){let e=y.context.initialValueRef.current,t=e!=null&&lM(y.context.valuesRef.current,e,k)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(T)){let e=T.filter(e=>lM(y.context.valuesRef.current,e,k)!==-1);e.length!==T.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&F){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};ZP(D,e),ZP(y.context.popupRef.current,e)}}),H=S.useMemo(()=>({...I,side:L,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:P,scrollUpArrowRef:j,scrollDownArrowRef:M}),[I,L,F,P]);return(0,W.jsx)(TM,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:V,children:(0,W.jsxs)(YP.Provider,{value:H,children:[C&&w&&(0,W.jsx)(Ij,{inert:XA(!x),cutout:O}),ee]})})});eF.displayName=`SelectPositioner`;var tF=`--transform-origin`,nF={...Uw,...Aw},rF=S.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=FP(),{multiple:c,readOnly:l,highlightItemOnHover:u}=IP(),d=LP(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=XP(),_=HM(!0)!=null,v=xO(),{nonce:y,disableStyleElements:b}=jP(),x=s.useState(`id`),C=s.useState(`open`),w=s.useState(`openMethod`),T=s.useState(`mounted`),E=s.useState(`popupProps`),D=s.useState(`transitionStatus`),O=s.useState(`triggerElement`),k=s.useState(`positionerElement`),A=s.useState(`listElement`),j=S.useRef(!1),M=S.useRef(!1),N=S.useRef({}),P=UD(),F=X(e=>{if(!k||!s.context.popupRef.current||!M.current)return;let t=k.style.top===`0px`,n=k.style.bottom===`0px`;if(j.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=oF(k),i=sF(k.getBoundingClientRect().height,`y`,r),a=eT(k),o=eS(k),c=o.getComputedStyle(k),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=iF(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=aF(e),g=null,_=e=>{k.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=ZA(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(j.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=ZA(g,0,aF(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(j.current=!0),s.context.handleScrollArrowVisibility(e)});S.useImperativeHandle(s.context.scrollHandlerRef,()=>F,[F]),JD({open:C,ref:s.context.popupRef,onComplete(){C&&s.context.onOpenChangeComplete(!0)}});let I={open:C,transitionStatus:D,side:f,align:p};Y(()=>{!k||!s.context.popupRef.current||Object.keys(N.current).length||(N.current={top:k.style.top||`0`,left:k.style.left||`0`,right:k.style.right,height:k.style.height,bottom:k.style.bottom,minHeight:k.style.minHeight,maxHeight:k.style.maxHeight,marginTop:k.style.marginTop,marginBottom:k.style.marginBottom})},[s,k]),Y(()=>{C||m||(M.current=!1,j.current=!1,ZP(k,N.current))},[C,m,k]),Y(()=>{let e=s.context.popupRef.current;if(!C||!O||!k||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(M.current=!0,e.style.removeProperty(tF),!m){P.request(()=>s.context.handleScrollArrowVisibility(A||e));return}let t=uF(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=eS(k),i=r.getComputedStyle(k),a=r.getComputedStyle(e),o=eT(O),c=oF(O),l=cF(O.getBoundingClientRect(),c),d=cF(k.getBoundingClientRect(),c),f=l.height,p=A||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=iF(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=cF(n.getBoundingClientRect(),c);T=cF(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let M=w+D+y+h,P=Math.min(S,M),F=S-_-y,I=M-P,L=C-5;k.style.left=`${ZA(E,5,L-d.width)}px`,k.style.height=`${P}px`,k.style.maxHeight=`none`,k.style.marginTop=`${_}px`,k.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=aF(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let ee=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),B=(r.visualViewport?.scale??1)!==1&&NT;if(ee||B){ZP(k,N.current),g(!1);return}let V=Math.max(b,P);if(z){let e=Math.max(0,S-M);k.style.top=d.height>=F?`0`:`${e}px`,k.style.height=`${P}px`,p.scrollTop=aF(p)}else k.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=ZA(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(tF,`50% ${i}%`)}(V===S||P>=x)&&(j.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,C,k,O,m,g,P,A,u,v,h]),S.useEffect(()=>{if(!m||!k||!C)return;let e=eS(k);function t(e){s.context.setOpen(!1,$T(QT,e))}return tE(e,`resize`,t)},[s,m,k,C]);let L={...A?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&ZM.has(e.key)&&e.stopPropagation()},onScroll(e){A||F(e.currentTarget)},...m&&{style:A?{height:`100%`}:QP},className:!A&&m?OP.className:void 0},R=Fx(`div`,e,{ref:[t,s.context.popupRef],state:I,stateAttributesMapping:nF,props:[E,L,BO(D),o]});return(0,W.jsxs)(S.Fragment,{children:[!b&&OP.getElement(y),(0,W.jsx)(Mj,{context:d,modal:!1,disabled:!T,openInteractionType:w,returnFocus:a,restoreFocus:!0,children:R})]})});rF.displayName=`SelectPopup`;function iF(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function aF(e){return TP(e.scrollHeight,e.clientHeight)}function oF(e){return MC.getScale(e)}function sF(e,t,n){return e/n[t]}function cF(e,t){return YS({x:sF(e.x,`x`,t),y:sF(e.y,`y`,t),width:sF(e.width,`x`,t),height:sF(e.height,`y`,t)})}var lF=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function uF(e){let{style:t}=e,n={};for(let[e,r]of lF)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of lF){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var dF=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=FP(),{multiple:s,readOnly:c}=IP(),{alignItemWithTriggerActive:l}=XP(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:QP},className:u&&d!==`touch`?OP.className:void 0};return Fx(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})});dF.displayName=`SelectList`;var fF=S.createContext(void 0);fF.displayName=`SelectItemContext`;function pF(){let e=S.useContext(fF);if(!e)throw Error(`Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.`);return e}var mF=S.memo(S.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=S.useRef(null),d=MM({guess:!0,label:o,textRef:u}),f=FP(),{itemProps:p,multiple:m,disabled:h,readOnly:g}=IP(),_=h||s,v=f.useState(`isActive`,d.index),y=f.useState(`open`),b=f.useState(`isSelected`,a),x=f.useState(`isSelectedByFocus`,d.index),C=f.useState(`isItemEqualToValue`),w=d.index,T=S.useRef(null);Y(()=>{let e=f.context.valuesRef.current;return e[w]=a,()=>{delete e[w]}},[w,a,f]),Y(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=fM(w,a,f.context.valuesRef.current,e,C,t),r=n===w,w===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&oM(a,e,C),r&&(n=w)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[w,m,C,f,a]);let E=S.useRef(`mouse`),D=S.useRef(!1),{getButtonProps:O,buttonRef:k}=GA({disabled:_,focusableWhenDisabled:!0,native:c,composite:!0}),A={disabled:_,selected:b,highlighted:v};function j(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=b?pM(n,a,C):[...n,a];f.context.setValue(r,$T(zT,e))}else f.context.setValue(a,$T(zT,e)),f.context.setOpen(!1,$T(zT,e))}function M(){f.context.selectionRef.current.dragY=0}let N={role:`option`,"aria-selected":b,tabIndex:y&&v?0:-1,onKeyDown(e){f.set(`activeIndex`,w),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&pw(e.nativeEvent)&&(n!==void 0||v),i=t&&!r&&!D.current;D.current=!1,!(_||i)&&j(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,M()},onMouseUp(){if(M(),_||E.current===`touch`||D.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&b,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!b;e||t||(D.current=!0,T.current?.click(),D.current=!1)}},P=Fx(`div`,e,{ref:[k,t,d.ref,T],state:A,props:[p,N,l,O]}),F=S.useMemo(()=>({selected:b,index:w,textRef:u,selectedByFocus:x}),[b,w,u,x]);return(0,W.jsx)(fF.Provider,{value:F,children:P})}));mF.displayName=`SelectItem`;var hF=S.forwardRef(function(e,t){let{selected:n}=pF();return e.keepMounted||n?(0,W.jsx)(gF,{...e,ref:t}):null});hF.displayName=`SelectItemIndicator`;var gF=S.memo(S.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=pF(),c=S.useRef(null),{transitionStatus:l,setMounted:u}=YD(s),d=Fx(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:Aw});return JD({batch:!0,enabled:!s,open:s,ref:c,onComplete(){s||u(!1)}}),d}));gF.displayName=`Inner`;var _F=S.memo(S.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=pF(),a=FP(),{render:o,className:s,style:c,...l}=e;return Fx(`div`,e,{ref:[S.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})}));_F.displayName=`SelectItemText`;var vF=S.createContext(void 0);vF.displayName=`SelectGroupContext`;function yF(){let e=S.useContext(vF);if(e===void 0)throw Error(`Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.`);return e}var bF=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=S.useState(),c=S.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=Fx(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,W.jsx)(vF.Provider,{value:c,children:l})});bF.displayName=`SelectGroup`;var xF=S.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=yF(),c=WO(a);return Y(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),Fx(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})});xF.displayName=`SelectGroupLabel`;var SF=wP;oj.size;var CF={size:`base`};function wF({size:e=CF.size}={}){return Jb(Wk({size:e}),`bg-kumo-control disabled:bg-kumo-control/50 data-[state=open]:bg-kumo-control`,`justify-between font-normal`,`focus:opacity-100 focus:ring-kumo-focus/50 focus-visible:ring-inset *:in-focus:opacity-100`)}var TF={xs:{iconSize:12,className:`text-kumo-subtle`},sm:{iconSize:14,className:`text-kumo-subtle`},base:{iconSize:16,className:`text-kumo-subtle`},lg:{iconSize:18,className:`text-kumo-subtle`}};function EF(e){if(typeof e!=`object`||!e||Array.isArray(e)||`$$typeof`in e||e instanceof Promise)return!1;let t=e;return`label`in t&&t.label!==void 0}function DF(e){return Array.isArray(e)?e:Object.entries(e).map(([e,t])=>({value:e,label:EF(t)?t.label:t}))}function OF(e){let t=DF(e),n=new Map;if(!Array.isArray(e))for(let[t,r]of Object.entries(e))EF(r)&&n.set(t,{disabled:r.disabled});return t.filter(e=>e.value!==null).map((e,t)=>{let r=typeof e.value==`string`?e.value:`option-${t}`,i=typeof e.value==`string`?n.get(e.value):void 0;return(0,W.jsx)(AF,{value:e.value,disabled:i?.disabled,children:e.label},r)})}function kF({children:e,className:t,render:n,renderValue:r,label:i,hideLabel:a,placeholder:o,loading:s,size:c=CF.size,labelTooltip:l,description:u,error:d,required:f,container:p,side:m=`bottom`,sideOffset:h=4,align:g=`start`,alignOffset:_,alignItemWithTrigger:v=!1,anchor:y,arrowPadding:b,positionMethod:x,collisionAvoidance:C,collisionBoundary:w,collisionPadding:T,sticky:E,disableAnchorTracking:D,...O}){let k=(0,S.useId)(),A=Xx(),j=p??A??void 0,M=O,N=M[`aria-label`],P=M[`aria-labelledby`],F=typeof i==`string`?i:o;a!==void 0&&console.warn('[Kumo Select]: `hideLabel` is deprecated. For hidden labels, use `aria-label` instead of `label` + `hideLabel={true}`.\n Migration:\n - For visible labels: <Select label="Country" /> (hideLabel no longer needed)\n - For hidden labels: <Select aria-label="Select a country" /> (remove label and hideLabel)');let I=i&&a!==!0,L=I?void 0:P??(i?k:void 0),R=N??(L?void 0:F),z=O.items?DF(O.items):void 0,ee=e||(O.items?OF(O.items):null),B=r?e=>{let t=o==null?null:(0,W.jsx)(`span`,{className:`text-kumo-placeholder`,children:o});return e==null||e===``?t:r(e)??t}:void 0,{items:V,...H}=O,te=i?(0,W.jsx)(BP,{className:`m-0 text-base font-medium text-kumo-default select-none`,children:(0,W.jsx)(nA,{showOptional:f===!1,tooltip:a?void 0:l,asContent:!0,children:i})}):null,U=(0,W.jsxs)(WP,{"data-kumo-component":`Select`,"data-kumo-part":`trigger`,render:n,className:Jb(wF({size:c}),O.disabled&&`cursor-not-allowed opacity-50`,d&&`!ring-kumo-danger focus:ring-[1.5px] focus:ring-kumo-danger/50`,t),"aria-label":R,"aria-labelledby":L,children:[s?(0,W.jsx)(vP,{className:`w-32`}):(0,W.jsx)(KP,{placeholder:o,className:`min-w-0 truncate data-[placeholder]:text-kumo-placeholder`,children:B}),(0,W.jsx)(qP,{className:Jb(`flex shrink-0 items-center`,TF[c].className),children:(0,W.jsx)(Mk,{size:TF[c].iconSize,className:`fill-current`})})]}),ne=(0,W.jsxs)(zP,{...H,items:z,disabled:s||O.disabled,required:f,children:[te,U,(0,W.jsx)(JP,{container:j,children:(0,W.jsx)(eF,{side:m,sideOffset:h,align:g,alignOffset:_,alignItemWithTrigger:v,anchor:y,arrowPadding:b,positionMethod:x,collisionAvoidance:C,collisionBoundary:w,collisionPadding:T,sticky:E,disableAnchorTracking:D,children:(0,W.jsx)(rF,{className:Jb(`flex flex-col`,`max-h-[var(--available-height)] bg-kumo-base text-kumo-default`,`rounded-lg shadow-lg ring ring-kumo-line`,`max-w-(--available-width) min-w-(--anchor-width) py-1.5`),children:(0,W.jsx)(dF,{className:Jb(`min-h-0 flex-1 scroll-pt-2 scroll-pb-2 overflow-y-auto overscroll-none`),children:ee})})})})]});if(I)return(0,W.jsx)(rj,{label:i,required:f,labelTooltip:l,description:u,error:d?typeof d==`string`?{message:d,match:!0}:d:void 0,hideLabel:!0,children:ne});let re=d?typeof d==`string`?{message:d,match:!0}:d:void 0;return(0,W.jsxs)(`div`,{className:`grid gap-2`,children:[i&&(0,W.jsx)(`span`,{id:k,className:`sr-only`,children:i}),ne,re?(0,W.jsx)(`span`,{className:`text-sm text-kumo-danger`,children:re.message}):u&&(0,W.jsx)(`span`,{className:`text-sm leading-snug text-kumo-subtle`,children:u})]})}function AF({children:e,value:t,disabled:n,className:r}){return(0,W.jsxs)(mF,{"data-kumo-component":`Select`,"data-kumo-part":`option`,value:t,disabled:n,className:Jb(`group mx-1.5 flex cursor-pointer items-center justify-between gap-2 rounded px-2 py-1.5 text-base outline-none`,`focus-visible:z-50 focus-visible:ring-2 focus-visible:ring-kumo-brand focus-visible:ring-inset`,`data-highlighted:bg-kumo-tint`,`data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,r),children:[(0,W.jsx)(_F,{children:e}),(0,W.jsx)(hF,{children:(0,W.jsx)(Nk,{})})]})}var jF=(0,S.forwardRef)(({children:e,className:t},n)=>(0,W.jsx)(bF,{ref:n,className:Jb(t),children:e}));jF.displayName=`Select.Group`;var MF=(0,S.forwardRef)(({children:e,className:t},n)=>(0,W.jsx)(xF,{ref:n,className:Jb(`px-3.5 py-1.5 text-sm font-semibold text-kumo-subtle`,t),children:e}));MF.displayName=`Select.GroupLabel`;var NF=(0,S.forwardRef)(({className:e},t)=>(0,W.jsx)(SF,{ref:t,className:Jb(`-mx-1 my-1 h-px bg-kumo-hairline`,e)}));NF.displayName=`Select.Separator`,kF.Option=AF,kF.Group=jF,kF.GroupLabel=MF,kF.Separator=NF,kF.Option.displayName=`Select.Option`;function PF(){return mx}function FF(){return!1}function IF(){return!0}function LF(){return(0,DE.useSyncExternalStore)(PF,FF,IF)}function RF(e){let{script:t}=e,{nonce:n}=jP();return LF()?(0,W.jsx)(`script`,{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var zF=S.createContext(void 0);zF.displayName=`PopoverRootContext`;function BF(e){let t=S.useContext(zF);if(t===void 0&&!e)throw Error(`Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.`);return t}var VF={..._O,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},HF=class extends tD{constructor(e,t,n){let r=new oD;super(UF(e,r,t,n),WF(r),VF)}setOpen=(e,t)=>{let n=t.reason===IT,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=iO(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=rO(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),Kc.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function UF(e,t,n,r=!1){let i={...dO(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function WF(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new lD,triggerElements:e}}var GF=NE(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=qF(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),uO(u,d),sO(u);let{forceUnmount:m}=cO(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});u.useSyncedValues({modal:o}),S.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),S.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,$T(ZT))}),[m,u]);let h=d||f;return(0,W.jsxs)(zF.Provider,{value:u,children:[s&&(0,W.jsx)(eO,{handle:s,store:u}),h&&(0,W.jsx)(JF,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});GF.displayName=`PopoverRootComponent`;function KF(e){return BF(!0)?(0,W.jsx)(GF,{props:e}):(0,W.jsx)(SE,{children:(0,W.jsx)(GF,{props:e})})}function qF(e,t){let n=$D((e,n)=>new HF(t,e,n));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function JF({store:e,modal:t}){let n=_D(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return lO(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var YF=PE(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=BF(!0),h=vO(s)??m;if(!h)throw Error(`Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.`);let g=WO(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=S.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=oO(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),T=h.useState(`openChangeReason`),E=h.useState(`stickIfOpen`),D=h.useState(`openMethod`),O=h.useState(`focusManagerModal`),k=AD(v,{enabled:!a&&l&&(D!==`touch`||T!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:RD(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),A=Jj(v,{stickIfOpen:E}),j=Pj(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),M=h.useState(`triggerProps`,w),{getButtonProps:N,buttonRef:P}=GA({disabled:a,native:o}),F={open(e){return e&&T===`trigger-press`?Hw.open(e):Vw.open(e)}},{preFocusGuardRef:I,handlePreFocusGuardFocus:L,handleFocusTargetFocus:R}=YN(h,x),z=Fx(`button`,e,{state:{disabled:a,open:y},ref:[P,t,C,x],props:[A.reference,k,M,j,{[BE]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,N],stateAttributesMapping:F}),ee=(0,W.jsx)(S.Fragment,{children:z},g);return w&&!O?(0,W.jsxs)(S.Fragment,{children:[(0,W.jsx)(LE,{ref:I,onFocus:L}),ee,(0,W.jsx)(LE,{ref:h.context.triggerFocusTargetRef,onFocus:R})]}):ee});YF.displayName=`PopoverTrigger`;var XF=S.createContext(void 0);XF.displayName=`PopoverPortalContext`;function ZF(){let e=S.useContext(XF);if(e===void 0)throw Error(`Base UI: <Popover.Portal> is missing.`);return e}var QF=S.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return BF().useState(`mounted`)||n?(0,W.jsx)(XF.Provider,{value:n,children:(0,W.jsx)(JE,{ref:t,...r})}):null});QF.displayName=`PopoverPortal`;var $F=S.createContext(void 0);$F.displayName=`PopoverPositionerContext`;function eI(){let e=S.useContext($F);if(!e)throw Error(`Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.`);return e}var tI=S.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=HE,..._}=e,v=BF(),y=ZF(),b=bE(),x=v.useState(`floatingRootContext`),C=v.useState(`mounted`),w=v.useState(`open`),T=v.useState(`openChangeReason`),E=v.useState(`activeTriggerElement`),D=v.useState(`modal`),O=v.useState(`openMethod`),k=v.useState(`positionerElement`),A=v.useState(`instantType`),j=v.useState(`transitionStatus`),M=v.useState(`adaptiveOrigin`),N=S.useRef(null),P=qD(k),F=LO({anchor:a,floatingRootContext:x,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:M}),I=x.useState(`domReferenceElement`);Y(()=>{let e=I,t=N.current;if(e&&(N.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return P(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[I,P,v]);let L=D===!0&&T!==`trigger-hover`;BM(w&&L,O===`touch`,k,E);let R=v.useStateSetter(`positionerElement`),z=VO(e,{open:w,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:A},{styles:F.positionerStyles,transitionStatus:j,props:_,refs:[t,R],hidden:!C,inert:!w});return(0,W.jsxs)($F.Provider,{value:F,children:[C&&L&&(0,W.jsx)(Ij,{inert:XA(!w),cutout:E}),(0,W.jsx)(xE,{id:b,children:z})]})});tI.displayName=`PopoverPositioner`;var nI=S.createContext(void 0);nI.displayName=`ClosePartContext`;function rI(){let[e,t]=S.useState(0),n=X(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:S.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function iI(){let e=S.useContext(nI);Y(()=>e?.register(),[e])}var aI=S.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=BF(),l=eI(),u=HM(!0)!=null,{context:d,hasClosePart:f}=rI(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),T=w.useState(`floatingId`),E=c.useState(`disabled`),D=c.useState(`openOnHover`),O=c.useState(`closeDelay`);JD({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),OD(w,{enabled:D&&!E,closeDelay:O});let k=a===void 0?QD(c.context.popupRef):a,A=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,A);let j=c.useStateSetter(`popupElement`),M=Fx(`div`,e,{state:{open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},ref:[t,c.context.popupRef,j],props:[_,{id:T,role:`dialog`,...ZD,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&ZM.has(e.key)&&e.stopPropagation()}},BO(g),s],stateAttributesMapping:Ww});return(0,W.jsx)(Mj,{context:w,openInteractionType:m,modal:A,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:iS(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,W.jsx)(nI.Provider,{value:d,children:M})})});aI.displayName=`PopoverPopup`;var oI=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=BF().useState(`open`),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=eI();return Fx(`div`,e,{state:{open:o,side:c,align:l,uncentered:u},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Uw})});oI.displayName=`PopoverArrow`;var sI=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=BF(),s=WO(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),Fx(`h2`,e,{ref:t,props:[{id:s},a]})});sI.displayName=`PopoverTitle`;var cI=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=BF(),s=WO(a.id);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),Fx(`p`,e,{ref:t,props:[{id:s},a]})});cI.displayName=`PopoverDescription`;var lI=S.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{buttonRef:c,getButtonProps:l}=GA({disabled:a,focusableWhenDisabled:!1,native:o}),u=BF();return iI(),Fx(`button`,e,{ref:[t,c],props:[{onClick(e){u.setOpen(!1,$T(BT,e.nativeEvent))}},s,l]})});lI.displayName=`PopoverClose`;var uI={side:`bottom`};function dI({children:e,...t}){return(0,W.jsx)(KF,{...t,children:e})}dI.displayName=`Popover`;function fI({children:e,className:t,asChild:n,render:r,...i}){return(0,W.jsx)(YF,{"data-kumo-component":`Popover`,"data-kumo-part":`trigger`,className:t,render:r??(n?e:void 0),...i,children:n?void 0:e})}fI.displayName=`Popover.Trigger`;function pI({children:e,side:t=uI.side,align:n=`center`,sideOffset:r=8,alignOffset:i=0,positionMethod:a=`absolute`,anchor:o,className:s,container:c}){let l=Xx();return(0,W.jsx)(QF,{container:c??l??void 0,children:(0,W.jsx)(tI,{anchor:o,align:n,alignOffset:i,side:t,sideOffset:r,positionMethod:a,children:(0,W.jsxs)(aI,{className:Jb(`flex origin-(--transform-origin) flex-col rounded-lg bg-kumo-base px-4 py-3 text-sm text-kumo-default`,`shadow-md outline outline-kumo-line`,`transition-[transform,scale,opacity] duration-150`,`data-starting-style:scale-90 data-starting-style:opacity-0`,`data-ending-style:scale-90 data-ending-style:opacity-0`,`data-instant:duration-0`,`kumo-popover-popup`,s),children:[(0,W.jsx)(oI,{className:Jb(`flex`,`data-[side=bottom]:-top-2`,`data-[side=left]:right-[-13px] data-[side=left]:rotate-90`,`data-[side=right]:left-[-13px] data-[side=right]:-rotate-90`,`data-[side=top]:-bottom-2 data-[side=top]:rotate-180`),children:(0,W.jsx)(_I,{})}),e]})})})}pI.displayName=`Popover.Content`;function mI({className:e,...t}){return(0,W.jsx)(sI,{className:Jb(`m-0 text-base leading-6 font-medium`,e),...t})}mI.displayName=`Popover.Title`;function hI({className:e,...t}){return(0,W.jsx)(cI,{className:Jb(`m-0 text-base leading-6 text-kumo-subtle`,e),...t})}hI.displayName=`Popover.Description`;function gI({children:e,className:t,asChild:n,render:r,...i}){return(0,W.jsx)(lI,{className:t,render:r??(n?e:void 0),...i,children:n?void 0:e})}gI.displayName=`Popover.Close`;function _I(e){return(0,W.jsxs)(`svg`,{width:`20`,height:`10`,viewBox:`0 0 20 10`,fill:`none`,...e,children:[(0,W.jsx)(`path`,{d:`M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z`,className:`fill-kumo-base`}),(0,W.jsx)(`path`,{d:`M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z`,className:`fill-kumo-arrow-edge`}),(0,W.jsx)(`path`,{d:`M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z`,className:`fill-kumo-arrow-stroke`})]})}var vI=Object.assign(dI,{Trigger:fI,Content:pI,Title:mI,Description:hI,Close:gI});function yI({value:e,onValueChange:t,options:n,className:r,label:i,...a}){return(0,W.jsxs)(`div`,{className:q(`relative min-w-0`,r),children:[i&&(0,W.jsx)(`span`,{className:`mb-2 block text-sm font-medium`,children:i}),(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(kF,{...a,"aria-label":a[`aria-label`]??i,value:e,onValueChange:e=>{e!==null&&t(e)},items:n.map(e=>({value:e.value,label:e.label})),renderValue:e=>n.find(t=>t.value===e)?.label??e,alignItemWithTrigger:!1,sideOffset:6,className:`!h-10 !w-full !min-w-0 !justify-between !rounded-xl !border !border-transparent !bg-muted/60 !px-3 !pr-9 !text-sm !font-normal !text-foreground !shadow-none !ring-0 hover:!bg-muted focus-visible:!outline focus-visible:!outline-1 focus-visible:!outline-offset-2 focus-visible:!outline-foreground/40 [&>span:last-child]:hidden`,children:n.map(e=>(0,W.jsx)(kF.Option,{value:e.value,disabled:e.disabled,className:`!mx-1.5 !min-h-9 !gap-3 !rounded-xl !px-3 !py-2 !text-sm !leading-5 !text-foreground data-highlighted:!bg-muted !ring-0 [&_svg]:size-4`,children:e.label},e.value))}),(0,W.jsx)(da,{"aria-hidden":`true`,className:`pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`})]})]})}function bI({data:e}){let t=Vr(),[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(`deep`),[c,l]=(0,S.useState)(`default`),[u,d]=(0,S.useState)(`auto`),f=ni({queryKey:[`recent-events`],queryFn:()=>fi(12),refetchInterval:5e3}),p=e.groups.filter(e=>e.workflow.reviewGate!==`none`),m=e.groups.filter(e=>e.workflow.phase===`blocked`),h=e.scans.filter(e=>e.status===`running`),g=e.workers.filter(e=>e.isActive&&e.status!==`stopped`),_=g.length>0,v=e.scans.length===0&&e.groups.length===0&&e.workers.length===0,y=async()=>{await Promise.all([t.invalidateQueries({queryKey:[`dashboard`]}),t.invalidateQueries({queryKey:[`scans`]}),t.invalidateQueries({queryKey:[`recent-events`]})])},b=ri({mutationFn:()=>_i(),onSuccess:async e=>{r(e.recovered>0?`Restarted ${e.recovered} stuck task${e.recovered===1?``:`s`}.`:`No stuck tasks.`),await y()},onError:e=>{r(e instanceof Error?e.message:String(e))}}),x=ri({mutationFn:()=>vi(),onSuccess:async e=>{r(e.deleted>0?`Cleared ${e.deleted} stopped worker${e.deleted===1?``:`s`}.`:`Nothing to clear.`),await y()},onError:e=>{r(e instanceof Error?e.message:String(e))}}),C=ri({mutationFn:()=>yi(`empty`),onSuccess:async e=>{r(`All data reset.`),await y()},onError:e=>{r(e instanceof Error?e.message:String(e))}}),w=ri({mutationFn:()=>bi({label:`control-plane-1`,pollIntervalMs:2e3}),onSuccess:async()=>{r(`Worker started.`),await y()},onError:e=>{r(e instanceof Error?e.message:String(e))}}),T=ri({mutationFn:()=>xi(),onSuccess:async e=>{r(e.stopped>0?`Stopped ${e.stopped} worker${e.stopped===1?``:`s`}.`:`No worker was running.`),await y()},onError:e=>{r(e instanceof Error?e.message:String(e))}}),E=ri({mutationFn:()=>Si({target:i.trim(),depth:c,mode:o,runtime:u,ensureDaemon:!0}),onSuccess:async()=>{r(`Scan started for ${i.trim()}.`),a(``),await y()},onError:e=>{r(e instanceof Error?e.message:String(e))}}),D=b.isPending||x.isPending||C.isPending||w.isPending||T.isPending||E.isPending,O=[...e.groups].filter(e=>e.workflow.reviewGate!==`none`||e.workflow.phase===`blocked`||!e.workflow.assignee).sort((e,t)=>t.latest.timestamp-e.latest.timestamp).slice(0,8),k=[...e.groups].filter(e=>e.workflow.phase===`in_progress`||e.workflow.activeAgentRoles.length>0).sort((e,t)=>t.latest.timestamp-e.latest.timestamp).slice(0,8),A=[...e.scans].sort((e,t)=>t.startedAt.localeCompare(e.startedAt)).slice(0,8),j=(0,S.useMemo)(()=>{let e=f.data?.events??[],t=new Map;for(let n of e){let e=n.payload??{},r=typeof e.summary==`string`&&e.summary.trim()?e.summary.trim():n.summary,i=[`stage_complete`,`agent_complete`,`runtime_incompatible`].includes(n.eventType)&&/max turns|did not emit required tool_call/i.test(r);if(![`agent_error`,`scan_error`,`worker_failed`].includes(n.eventType)&&!i||t.has(n.scanId))continue;let a=typeof e.error==`string`&&e.error.trim()?e.error.trim():typeof e.summary==`string`&&e.summary.trim()?e.summary.trim():n.summary;t.set(n.scanId,{scanId:n.scanId,scanTarget:n.scanTarget,stage:n.stage,actor:n.agentRole??null,headline:a,timestamp:n.timestamp})}return[...t.values()].slice(0,4)},[f.data?.events]),M=[...e.groups].sort((e,t)=>Number(new Date(t.workflow.updatedAt??t.latest.timestamp))-Number(new Date(e.workflow.updatedAt??e.latest.timestamp))).slice(0,8);return(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsx)(q_,{title:`Dashboard`,summary:``,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(J,{asChild:!0,variant:`outline`,children:(0,W.jsx)(yn,{to:`/runs`,children:`Activity`})}),(0,W.jsx)(J,{asChild:!0,variant:`accent`,children:(0,W.jsx)(yn,{to:`/findings`,children:`Findings`})})]})}),v?(0,W.jsx)(`section`,{className:`grid gap-4`,children:(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Start your first scan`})})}),(0,W.jsxs)(dp,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Target`}),(0,W.jsx)(af,{value:i,onChange:e=>a(e.target.value),placeholder:o===`mcp`?`mcp://assistant-endpoint`:o===`web`?`https://app.example.com`:`https://api.example.com`})]}),(0,W.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,W.jsx)(SI,{label:`Mode`,value:o,onValueChange:e=>s(e),options:[{value:`deep`,label:`API/URL`},{value:`web`,label:`Web app`},{value:`mcp`,label:`MCP`}]}),(0,W.jsx)(SI,{label:`Depth`,value:c,onValueChange:e=>l(e),options:[{value:`quick`,label:`Quick`},{value:`default`,label:`Default`},{value:`deep`,label:`Deep`}]}),(0,W.jsx)(SI,{label:`Engine`,value:u,onValueChange:e=>d(e),options:[{value:`auto`,label:`Auto`},{value:`api`,label:`API`},{value:`codex`,label:`Codex`},{value:`claude`,label:`Claude`},{value:`gemini`,label:`Gemini`}]})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,W.jsxs)(J,{variant:`accent`,onClick:()=>E.mutate(),disabled:!i.trim()||D,children:[(0,W.jsx)(to,{}),`Start audit`]}),(0,W.jsxs)(J,{variant:`outline`,onClick:()=>w.mutate(),disabled:_||D,children:[(0,W.jsx)(io,{}),`Start worker`]}),(0,W.jsxs)(J,{variant:`outline`,onClick:()=>T.mutate(),disabled:!_||D,children:[(0,W.jsx)(io,{}),`Stop worker`]})]})]})]})}):null,v?null:(0,W.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-[1.15fr_0.85fr]`,children:[(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`New scan`})})}),(0,W.jsxs)(dp,{className:`space-y-5`,children:[(0,W.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,W.jsxs)(`label`,{className:`min-w-0 space-y-2 sm:col-span-3`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Target`}),(0,W.jsx)(af,{value:i,onChange:e=>a(e.target.value),placeholder:o===`mcp`?`mcp://assistant-endpoint`:o===`web`?`https://app.example.com`:`https://api.example.com`})]}),(0,W.jsx)(SI,{label:`Mode`,value:o,onValueChange:e=>s(e),options:[{value:`deep`,label:`API/URL`},{value:`web`,label:`Web app`},{value:`mcp`,label:`MCP`}]}),(0,W.jsx)(SI,{label:`Depth`,value:c,onValueChange:e=>l(e),options:[{value:`quick`,label:`Quick`},{value:`default`,label:`Default`},{value:`deep`,label:`Deep`}]}),(0,W.jsx)(SI,{label:`Engine`,value:u,onValueChange:e=>d(e),options:[{value:`auto`,label:`Auto`},{value:`api`,label:`API`},{value:`codex`,label:`Codex`},{value:`claude`,label:`Claude`},{value:`gemini`,label:`Gemini`}]})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,W.jsxs)(J,{variant:`accent`,onClick:()=>E.mutate(),disabled:!i.trim()||D,children:[(0,W.jsx)(to,{}),`Start audit`]}),(0,W.jsxs)(J,{variant:_?`outline`:`default`,onClick:()=>_?T.mutate():w.mutate(),disabled:D,children:[(0,W.jsx)(io,{}),_?`Stop worker`:`Start worker`]}),(0,W.jsxs)(J,{variant:`outline`,onClick:()=>b.mutate(),disabled:D,children:[(0,W.jsx)(so,{}),`Retry stuck`]}),(0,W.jsxs)(J,{variant:`outline`,onClick:()=>x.mutate(),disabled:D,children:[(0,W.jsx)(Do,{}),`Clear stopped`]}),(0,W.jsxs)(J,{variant:`warning`,onClick:()=>C.mutate(),disabled:D||_,title:_?`Stop the worker first`:void 0,children:[(0,W.jsx)(wa,{}),`Reset data`]})]}),n?(0,W.jsx)(`div`,{className:`rounded-md border border-border bg-muted/20 px-4 py-3 text-sm text-muted-foreground`,children:n}):null]})]}),(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Status`})})}),(0,W.jsxs)(dp,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,W.jsx)(xI,{icon:pa,label:`To review`,value:p.length}),(0,W.jsx)(xI,{icon:bo,label:`Blocked`,value:m.length}),(0,W.jsx)(xI,{icon:to,label:`Active runs`,value:h.length}),(0,W.jsx)(xI,{icon:Qi,label:`Workers`,value:g.length})]})]})]}),(0,W.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-[1.05fr_0.95fr]`,children:[(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsxs)(cp,{children:[(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Needs your attention`})}),(0,W.jsx)(J,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,W.jsx)(yn,{to:`/findings`,children:`View all`})})]}),(0,W.jsx)(dp,{children:O.length===0?(0,W.jsx)(hp,{className:`text-left`,children:`Nothing needs you right now.`}):(0,W.jsxs)(J_,{children:[(0,W.jsx)(Y_,{children:(0,W.jsxs)(Z_,{className:`hover:bg-transparent`,children:[(0,W.jsx)(Q_,{children:`Finding`}),(0,W.jsx)(Q_,{children:`Severity`}),(0,W.jsx)(Q_,{className:`w-[14rem]`,children:`State`})]})}),(0,W.jsx)(X_,{children:O.map(e=>(0,W.jsxs)(Z_,{children:[(0,W.jsx)($_,{className:`font-medium`,children:(0,W.jsx)(yn,{to:`/findings/${e.fingerprint}`,className:`text-foreground hover:text-primary-text`,children:e.latest.title})}),(0,W.jsx)($_,{children:(0,W.jsx)(R_,{severity:e.latest.severity})}),(0,W.jsx)($_,{children:(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(B_,{value:e.workflow.phase}),e.workflow.reviewGate===`none`?null:(0,W.jsx)(V_,{value:e.workflow.reviewGate})]})})]},e.fingerprint))})]})})]}),(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Activity`})})}),(0,W.jsxs)(dp,{className:`space-y-6`,children:[k.length===0?(0,W.jsx)(hp,{className:`text-left`,children:`Nothing running right now.`}):(0,W.jsx)(`div`,{className:`space-y-3`,children:k.map(e=>(0,W.jsx)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-3`,children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(yn,{to:`/findings/${e.fingerprint}`,className:`text-sm font-medium text-foreground hover:text-primary-text`,children:e.latest.title}),(0,W.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:e.workflow.activeAgentRoles.length>0?e.workflow.activeAgentRoles.join(`, `):`Waiting`})]}),(0,W.jsx)(B_,{value:e.workflow.phase})]})},e.fingerprint))}),(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Workers`})}),g.length===0?(0,W.jsx)(hp,{className:`text-left`,children:`No workers running.`}):(0,W.jsx)(`div`,{className:`space-y-3`,children:g.slice(0,4).map(e=>(0,W.jsx)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-3`,children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.label}),(0,W.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.currentWorkItemTitle??e.currentWorkItemId??`Idle`,e.currentCaseTarget?` · ${e.currentCaseTarget}`:``,` · last seen ${tv(e.heartbeatAt)}`]}),e.lastError?(0,W.jsx)(`div`,{className:`mt-1 text-xs text-destructive`,children:e.lastError}):null]}),(0,W.jsx)(z_,{value:e.status})]})},e.id))})]})]})]})]}),(0,W.jsxs)(`section`,{className:`grid gap-4 xl:grid-cols-[0.95fr_1.05fr]`,children:[(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsxs)(cp,{children:[(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Recent runs`})}),(0,W.jsx)(J,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,W.jsx)(yn,{to:`/runs`,children:`View all`})})]}),(0,W.jsx)(dp,{children:A.length===0?(0,W.jsx)(hp,{className:`text-left`,children:`No runs yet.`}):(0,W.jsxs)(J_,{children:[(0,W.jsx)(Y_,{children:(0,W.jsxs)(Z_,{className:`hover:bg-transparent`,children:[(0,W.jsx)(Q_,{children:`Target`}),(0,W.jsx)(Q_,{children:`Started`}),(0,W.jsx)(Q_,{className:`w-[12rem]`,children:`State`})]})}),(0,W.jsx)(X_,{children:A.map(e=>(0,W.jsxs)(Z_,{children:[(0,W.jsx)($_,{className:`font-medium`,children:(0,W.jsx)(yn,{to:`/runs/${e.id}`,className:`text-foreground hover:text-primary-text`,children:e.target})}),(0,W.jsx)($_,{className:`text-muted-foreground`,children:tv(e.startedAt)}),(0,W.jsx)($_,{children:(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(z_,{value:e.status}),(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:nv(e.durationMs)})]})})]},e.id))})]})})]}),(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsxs)(cp,{children:[(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Recent findings`})}),(0,W.jsx)(J,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,W.jsx)(yn,{to:`/findings`,children:`View all`})})]}),(0,W.jsx)(dp,{children:M.length===0?(0,W.jsx)(hp,{className:`text-left`,children:`No findings yet.`}):(0,W.jsxs)(J_,{children:[(0,W.jsx)(Y_,{children:(0,W.jsxs)(Z_,{className:`hover:bg-transparent`,children:[(0,W.jsx)(Q_,{children:`Finding`}),(0,W.jsx)(Q_,{children:`Updated`}),(0,W.jsx)(Q_,{className:`w-[12rem]`,children:`State`})]})}),(0,W.jsx)(X_,{children:M.map(e=>(0,W.jsxs)(Z_,{children:[(0,W.jsx)($_,{className:`font-medium`,children:(0,W.jsx)(yn,{to:`/findings/${e.fingerprint}`,className:`text-foreground hover:text-primary-text`,children:e.latest.title})}),(0,W.jsx)($_,{className:`text-muted-foreground`,children:tv(e.workflow.updatedAt??e.latest.timestamp)}),(0,W.jsx)($_,{children:(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(R_,{severity:e.latest.severity}),(0,W.jsx)(B_,{value:e.workflow.phase})]})})]},e.fingerprint))})]})})]})]}),j.length>0?(0,W.jsxs)(sp,{className:`overflow-hidden border-destructive/20`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Errors`})})}),(0,W.jsx)(dp,{className:`space-y-3`,children:j.map(e=>(0,W.jsx)(`div`,{className:`rounded-md border border-destructive/20 bg-destructive/5 px-4 py-3`,children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(yn,{to:`/runs/${e.scanId}`,className:`text-sm font-medium text-foreground hover:text-primary-text`,children:e.scanTarget}),(0,W.jsx)(`div`,{className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.headline}),(0,W.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:tv(e.timestamp)})]}),(0,W.jsx)(pa,{className:`mt-0.5 size-5 shrink-0 text-destructive`})]})},`${e.scanId}:${e.timestamp}`))})]}):null,(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{children:`Recent activity`})})}),(0,W.jsx)(dp,{children:f.isLoading?(0,W.jsx)(hp,{children:`Loading…`}):f.error?(0,W.jsx)(hp,{children:f.error instanceof Error?f.error.message:`Couldn't load activity.`}):(f.data?.events.length??0)===0?(0,W.jsx)(hp,{children:`No activity yet.`}):(0,W.jsxs)(J_,{children:[(0,W.jsx)(Y_,{children:(0,W.jsxs)(Z_,{className:`hover:bg-transparent`,children:[(0,W.jsx)(Q_,{children:`Target`}),(0,W.jsx)(Q_,{children:`Summary`}),(0,W.jsx)(Q_,{className:`w-[12rem]`,children:`Time`})]})}),(0,W.jsx)(X_,{children:f.data?.events.map(e=>(0,W.jsxs)(Z_,{children:[(0,W.jsx)($_,{className:`font-medium`,children:(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(yn,{to:`/runs/${e.scanId}`,className:`text-foreground hover:text-primary-text`,children:e.scanTarget}),e.findingFingerprint?(0,W.jsx)(`div`,{children:(0,W.jsx)(yn,{to:`/findings/${e.findingFingerprint}`,className:`text-xs text-muted-foreground hover:text-primary-text`,children:`Open finding`})}):null]})}),(0,W.jsx)($_,{className:`text-muted-foreground`,children:e.summary}),(0,W.jsx)($_,{className:`text-muted-foreground`,children:tv(e.timestamp)})]},e.id))})]})})]})]})}function xI({icon:e,label:t,value:n}){return(0,W.jsxs)(`div`,{className:`rounded-lg border border-border bg-background px-4 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,W.jsx)(e,{className:`size-3.5`}),t]}),(0,W.jsx)(`div`,{className:`mt-2 text-2xl font-semibold text-foreground`,children:n})]})}function SI({label:e,value:t,onValueChange:n,options:r}){let i=(0,S.useId)();return(0,W.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,W.jsx)(`label`,{htmlFor:i,className:`text-xs font-medium text-muted-foreground`,children:e}),(0,W.jsx)(yI,{id:i,"aria-label":e,value:t,onValueChange:n,options:r})]})}function CI({title:e,description:t,searchValue:n,onSearchChange:r,searchPlaceholder:i,children:a}){return(0,W.jsxs)(sp,{className:`flex h-[36rem] min-h-0 max-h-[calc(100vh-8rem)] flex-col overflow-hidden`,children:[(0,W.jsxs)(cp,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(lp,{className:`mt-2`,children:e}),t?(0,W.jsx)(up,{children:t}):null]}),(0,W.jsxs)(`label`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(fo,{className:`size-4 text-muted-foreground`}),(0,W.jsx)(af,{value:n,onChange:e=>r(e.target.value),placeholder:i,className:`h-9`})]})]}),(0,W.jsx)(dp,{className:`flex min-h-0 flex-1 flex-col pt-3`,children:(0,W.jsx)(rp,{className:`min-h-0 flex-1`,children:(0,W.jsx)(fp,{children:a})})})]})}function wI({title:e,description:t,meta:n,badges:r,selected:i=!1}){return(0,W.jsx)(mp,{interactive:!0,selected:i,children:(0,W.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,W.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,W.jsx)(`div`,{className:`text-sm font-semibold leading-5 text-foreground`,children:e}),t?(0,W.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:t}):null,n?(0,W.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:n}):null]}),r?(0,W.jsx)(`div`,{className:`flex max-w-[12rem] flex-wrap justify-end gap-2`,children:r}):null]})})}function TI({events:e}){return(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{className:`mt-2`,children:`Activity`})})}),(0,W.jsx)(dp,{className:`space-y-4`,children:e.length===0?(0,W.jsx)(hp,{children:`No activity yet.`}):(0,W.jsxs)(J_,{children:[(0,W.jsx)(Y_,{children:(0,W.jsxs)(Z_,{className:`hover:bg-transparent`,children:[(0,W.jsx)(Q_,{children:`Event`}),(0,W.jsx)(Q_,{children:`Summary`}),(0,W.jsx)(Q_,{className:`w-[10rem]`,children:`Time`}),(0,W.jsx)(Q_,{className:`w-[8rem]`,children:`Details`})]})}),(0,W.jsx)(X_,{children:e.map(e=>{let t=EI(e.stage,e.eventType);return(0,W.jsxs)(Z_,{children:[(0,W.jsx)($_,{children:(0,W.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,W.jsx)(`div`,{className:`mt-0.5 inline-flex size-8 items-center justify-center rounded-md border border-border bg-muted text-primary-text`,children:(0,W.jsx)(t,{className:`size-4`})}),(0,W.jsxs)(`div`,{className:`font-medium text-foreground`,children:[e.stage,` · `,e.eventType]})]})}),(0,W.jsx)($_,{className:`text-muted-foreground`,children:rv(e.payload)}),(0,W.jsx)($_,{className:`text-xs text-muted-foreground`,children:tv(e.timestamp)}),(0,W.jsx)($_,{children:e.payload?(0,W.jsxs)(`details`,{className:`rounded-md border border-border bg-muted/50 p-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer list-none font-medium text-foreground`,children:`Show`}),(0,W.jsx)(`pre`,{className:`mt-3 text-xs text-muted-foreground`,children:JSON.stringify(e.payload,null,2)})]}):(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})})]},e.id)})})]})})]})}function EI(e,t){let n=`${e}:${t}`.toLowerCase();return n.includes(`attack`)?ho:n.includes(`agent`)?ca:n.includes(`verify`)?ma:n.includes(`finding`)?pa:n.includes(`scan`)?ao:n.includes(`analysis`)?So:Qi}function DI({label:e,value:t,mono:n=!1}){return(0,W.jsxs)(mp,{className:`px-0 py-3 first:pt-0 last:pb-0`,children:[(0,W.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`mt-1 text-sm text-foreground ${n?`break-all tabular-nums`:``}`,children:t})]})}function OI({icon:e,label:t,value:n,hint:r,tone:i=`neutral`}){return(0,W.jsx)(sp,{className:`overflow-hidden`,children:(0,W.jsxs)(dp,{className:`space-y-4 p-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.2em] text-muted-foreground`,children:t}),(0,W.jsx)(`div`,{className:q(`inline-flex size-9 items-center justify-center rounded-md border border-border bg-muted text-muted-foreground`,i===`danger`&&`border-destructive/20 bg-destructive/10 text-destructive`,i===`warning`&&`border-amber-500/20 bg-amber-500/10 text-amber-300`,i===`success`&&`border-emerald-500/20 bg-emerald-500/10 text-emerald-300`,i===`accent`&&`border-primary/20 bg-primary/12 text-primary-text`),children:(0,W.jsx)(e,{className:`size-5`})})]}),(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(`div`,{className:`text-3xl font-bold tracking-tight text-foreground`,children:n}),r?(0,W.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:r}):null]})]})})}function kI({children:e,className:t}){return(0,W.jsx)(`section`,{className:q(`grid gap-4 xl:grid-cols-[22rem_minmax(0,1fr)_20rem]`,t),children:e})}function AI({children:e,className:t}){return(0,W.jsx)(`div`,{className:q(`min-w-0 min-h-0`,t),children:e})}function jI({children:e,className:t,span:n=!1}){return(0,W.jsx)(`div`,{className:q(`min-w-0 min-h-0`,n&&`xl:col-span-2`,t),children:e})}function MI({scans:e}){let{scanId:t}=at(),n=rt(),[r,i]=(0,S.useState)(``),a=(0,S.useDeferredValue)(r),o=ni({queryKey:[`console-sessions`],queryFn:({signal:e})=>Ci(e),refetchInterval:2e3}),s=ni({queryKey:[`console-saved`],queryFn:({signal:e})=>wi(e),refetchInterval:5e3}),c=(0,S.useMemo)(()=>new Set([...(o.data??[]).flatMap(e=>[e.id,...e.savedId?[e.savedId]:[]]),...(s.data??[]).map(e=>e.id)]),[o.data,s.data]),l=(0,S.useMemo)(()=>e.filter(e=>!!e.target.trim()&&!e.id.startsWith(`console-`)&&!c.has(e.id)),[e,c]),u=(0,S.useMemo)(()=>{let e=new Map;for(let t of l){let n=e.get(t.target)??[];n.push(t),e.set(t.target,n)}return[...e.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.startedAt.localeCompare(e.startedAt));return{target:e,scans:n,latestScan:n[0],activeRunCount:n.filter(e=>e.status===`running`).length,totalFindings:n.reduce((e,t)=>e+t.summary.totalFindings,0)}}).sort((e,t)=>t.latestScan.startedAt.localeCompare(e.latestScan.startedAt))},[l]),d=(0,S.useMemo)(()=>{let e=a.trim().toLowerCase();return e?u.filter(t=>[t.target,...t.scans.flatMap(e=>[e.depth,e.runtime,e.mode,e.status,e.id])].join(` `).toLowerCase().includes(e)):u},[a,u]),f=(0,S.useMemo)(()=>e.find(e=>e.id===t)??d[0]?.latestScan??null,[d,t,e]),p=f?.id??null,m=!!(f&&(f.id.startsWith(`console-`)||c.has(f.id))),h=o.data?.find(e=>e.id===p||e.savedId===p),g=(0,S.useMemo)(()=>f?u.find(e=>e.target===f.target)??null:null,[u,f]);(0,S.useEffect)(()=>{!t&&p&&!o.isPending&&!s.isPending&&n(`/runs/${p}`,{replace:!0})},[n,t,p,o.isPending,s.isPending]);let _=ni({queryKey:[`scan-events`,p],queryFn:()=>di(p),enabled:!!p}),v=ni({queryKey:[`scan-findings`,p],queryFn:()=>pi(p),enabled:!!p});return(0,W.jsx)(`div`,{className:`space-y-6`,children:(0,W.jsxs)(kI,{className:`xl:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(CI,{title:`Audit reports`,description:`Past audits by target`,searchValue:r,onSearchChange:i,searchPlaceholder:`Search audits`,children:d.length===0?(0,W.jsx)(hp,{className:`py-8`,children:`No matches.`}):d.map(e=>(0,W.jsx)(yn,{to:`/runs/${e.latestScan.id}`,children:({isActive:t})=>(0,W.jsx)(wI,{selected:t,title:e.target,description:`${e.scans.length} audit${e.scans.length===1?``:`s`}`,meta:tv(e.latestScan.startedAt),badges:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(z_,{value:e.latestScan.status}),(0,W.jsxs)(I_,{children:[e.totalFindings,` findings`]})]})})},e.target))})}),p?m?(0,W.jsxs)(jI,{span:!0,children:[(0,W.jsx)(_p,{title:`Chat activity`,body:`This record belongs to a conversation, not a separate audit. Open chats to continue the work and view its agents.`,action:(0,W.jsx)(J,{asChild:!0,children:(0,W.jsx)(yn,{to:h?`/console/${h.id}`:`/console`,children:`Open chat`})})}),v.data&&v.data.groups.length>0?(0,W.jsxs)(`div`,{className:`mt-4 text-sm text-muted-foreground`,children:[v.data.groups.length,` findings recorded. `,(0,W.jsx)(yn,{to:`/findings`,className:`text-primary-text hover:underline`,children:`View findings`})]}):null]}):_.isLoading||v.isLoading?(0,W.jsx)(jI,{span:!0,children:(0,W.jsx)(gp,{label:`Audit`})}):_.error?(0,W.jsx)(jI,{span:!0,children:(0,W.jsx)(vp,{error:_.error})}):v.error?(0,W.jsx)(jI,{span:!0,children:(0,W.jsx)(vp,{error:v.error})}):_.data&&v.data?(0,W.jsx)(NI,{events:_.data,findings:v.data,targetRuns:g?.scans??[]}):(0,W.jsx)(jI,{span:!0,children:(0,W.jsx)(_p,{title:`Audit not found`,body:`This audit couldn't be loaded.`})}):(0,W.jsx)(jI,{span:!0,children:(0,W.jsx)(_p,{title:l.length?`Select an audit`:`No audits yet`,body:l.length?`Select a target to view its audit activity and findings.`:`Start an audit in a chat. Its results will appear here.`,action:(0,W.jsx)(J,{asChild:!0,children:(0,W.jsx)(yn,{to:`/console`,children:`Open chats`})})})})]})})}function NI({events:e,findings:t,targetRuns:n}){let r=e.scan,{openPanel:i,clearPanel:a}=Hi(),o=(0,S.useMemo)(()=>PI(e.events),[e.events]),s=(0,S.useMemo)(()=>(0,W.jsx)(`div`,{className:`space-y-4 p-6`,children:(0,W.jsx)(K_,{title:`Target`,children:(0,W.jsxs)(fp,{children:[(0,W.jsx)(DI,{label:`Started`,value:tv(r.startedAt)}),(0,W.jsx)(DI,{label:`Completed`,value:r.completedAt?tv(r.completedAt):`In progress`}),(0,W.jsx)(DI,{label:`Mode`,value:`${r.mode} / ${r.depth}`}),(0,W.jsx)(DI,{label:`Engine`,value:r.runtime}),(0,W.jsx)(DI,{label:`Duration`,value:nv(r.durationMs)}),(0,W.jsx)(DI,{label:`Audit ID`,value:r.id,mono:!0})]})})}),[r.completedAt,r.depth,r.durationMs,r.id,r.mode,r.runtime,r.startedAt]);(0,S.useEffect)(()=>(a(),()=>a()),[a,r.id]);let c=(0,S.useCallback)(()=>{i({title:r.target,description:``,content:s})},[i,s,r.target]);return(0,W.jsx)(jI,{span:!0,className:`space-y-4`,children:(0,W.jsxs)(K_,{title:r.target,actions:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(z_,{value:r.status}),(0,W.jsx)(J,{variant:`outline`,size:`sm`,onClick:c,children:`Details`})]}),children:[o?(0,W.jsx)(sp,{className:`border-destructive/25 bg-destructive/5`,children:(0,W.jsx)(dp,{className:`space-y-3 p-4`,children:(0,W.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,W.jsx)(pa,{className:`mt-0.5 size-5 text-destructive`}),(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Error`}),(0,W.jsx)(`div`,{className:`mt-1 text-sm leading-6 text-muted-foreground`,children:o.headline}),(0,W.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:tv(o.timestamp)})]})]})})}):null,(0,W.jsxs)(`section`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,W.jsx)(OI,{icon:Qi,label:`Findings`,value:r.summary.totalFindings,hint:``,tone:`accent`}),(0,W.jsx)(OI,{icon:bo,label:`Critical`,value:r.summary.critical,hint:``,tone:`danger`}),(0,W.jsx)(OI,{icon:pa,label:`High`,value:r.summary.high,hint:``,tone:`warning`})]}),(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{className:`font-sans text-base font-medium`,children:`Findings`})})}),(0,W.jsx)(dp,{children:t.groups.length===0?(0,W.jsx)(hp,{children:`No findings in this audit.`}):(0,W.jsxs)(J_,{children:[(0,W.jsx)(Y_,{children:(0,W.jsxs)(Z_,{className:`hover:bg-transparent`,children:[(0,W.jsx)(Q_,{children:`Finding`}),(0,W.jsx)(Q_,{children:`Category`}),(0,W.jsx)(Q_,{className:`w-[12rem]`,children:`Status`})]})}),(0,W.jsx)(X_,{children:t.groups.map(e=>(0,W.jsxs)(Z_,{children:[(0,W.jsx)($_,{className:`font-medium text-foreground`,children:e.latest.title}),(0,W.jsx)($_,{className:`text-muted-foreground`,children:e.latest.category}),(0,W.jsx)($_,{children:(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(R_,{severity:e.latest.severity}),(0,W.jsx)(B_,{value:e.workflow.phase}),e.workflow.reviewGate===`none`?null:(0,W.jsx)(V_,{value:e.workflow.reviewGate})]})})]},e.fingerprint))})]})})]}),(0,W.jsxs)(sp,{className:`overflow-hidden`,children:[(0,W.jsx)(cp,{children:(0,W.jsx)(`div`,{children:(0,W.jsx)(lp,{className:`font-sans text-base font-medium`,children:`Previous audits`})})}),(0,W.jsx)(dp,{children:n.filter(e=>e.id!==r.id).length===0?(0,W.jsx)(hp,{children:`No previous audits yet.`}):(0,W.jsxs)(J_,{children:[(0,W.jsx)(Y_,{children:(0,W.jsxs)(Z_,{className:`hover:bg-transparent`,children:[(0,W.jsx)(Q_,{children:`Started`}),(0,W.jsx)(Q_,{children:`Findings`}),(0,W.jsx)(Q_,{className:`w-[10rem]`,children:`Status`})]})}),(0,W.jsx)(X_,{children:n.filter(e=>e.id!==r.id).slice(0,6).map(e=>(0,W.jsxs)(Z_,{children:[(0,W.jsx)($_,{className:`font-medium`,children:(0,W.jsx)(yn,{to:`/runs/${e.id}`,className:`text-foreground hover:text-primary-text`,children:tv(e.startedAt)})}),(0,W.jsx)($_,{className:`text-muted-foreground`,children:e.summary.totalFindings}),(0,W.jsx)($_,{children:(0,W.jsx)(z_,{value:e.status})})]},e.id))})]})})]}),(0,W.jsx)(TI,{events:e.events})]})})}function PI(e){let t=e=>{let t=e.payload??{},n=typeof t.summary==`string`&&t.summary.trim()?t.summary.trim():e.eventType;return/max turns|did not emit required tool_call/i.test(n)},n=[...e].reverse().find(e=>[`agent_error`,`scan_error`,`worker_failed`].includes(e.eventType)||(e.eventType===`stage_complete`||e.eventType===`agent_complete`)&&t(e));if(!n)return null;let r=n.payload??{},i=typeof r.error==`string`&&r.error.trim()?r.error.trim():typeof r.summary==`string`&&r.summary.trim()?r.summary.trim():`${n.stage} ${n.eventType}`.replaceAll(`_`,` `);return{stage:n.stage,actor:n.agentRole??null,headline:i,timestamp:n.timestamp}}var FI=[{name:`help`,aliases:[`?`,`commands`],category:`info`,description:`List commands`,usage:`/help [command]`},{name:`capabilities`,aliases:[`caps`],category:`info`,description:`What 0 can do and what needs approval`,usage:`/capabilities`,tuiOnly:!0},{name:`status`,aliases:[],category:`info`,description:`Session status`},{name:`tools`,aliases:[],category:`info`,description:`List available tools`},{name:`new-chat`,aliases:[`new`],category:`navigation`,description:`Start a fresh audit`,tuiOnly:!0},{name:`onboard`,aliases:[],category:`navigation`,description:`Run setup again`,tuiOnly:!0},{name:`clear`,aliases:[],category:`session`,description:`Clear the conversation`},{name:`history`,aliases:[],category:`session`,description:`Past scans`,tuiOnly:!0},{name:`findings`,aliases:[`finds`],category:`session`,description:`Show findings`,tuiOnly:!0},{name:`fix`,aliases:[],category:`session`,description:`Write and test a fix; you approve any PR`,usage:`/fix [finding-id] | /fix publish <finding-id> | /fix cancel`,tuiOnly:!0},{name:`copy`,aliases:[`export`,`dump`],category:`session`,description:`Copy the conversation`,usage:`/copy`,tuiOnly:!0},{name:`sessions`,aliases:[],category:`session`,description:`Switch or resume a conversation`,usage:`/sessions`,tuiOnly:!0},{name:`explain`,aliases:[`eli5`],category:`session`,description:`Explain simply`,usage:`/explain [topic]`,tuiOnly:!0},{name:`feedback`,aliases:[],category:`system`,description:`Send feedback`,usage:`/feedback <message> | /feedback submit <message> | /feedback send | /feedback cancel`,tuiOnly:!0},{name:`settings`,aliases:[`config`,`prefs`],category:`system`,description:`Open settings`,usage:`/settings`,tuiOnly:!0},{name:`keybindings`,aliases:[`keys`,`keymap`],category:`system`,description:`Keyboard shortcuts`,usage:`/keybindings`,tuiOnly:!0},{name:`theme`,aliases:[`themes`],category:`system`,description:`Change the colour theme`,usage:`/theme [name]`,tuiOnly:!0},{name:`model`,aliases:[`models`],category:`session`,description:`Choose a model`,usage:`/model [id]`,tuiOnly:!0},{name:`chat`,aliases:[],category:`navigation`,description:`Back to the conversation`,tuiOnly:!0},{name:`launcher`,aliases:[`run`,`home`],category:`navigation`,description:`Scan one target`,tuiOnly:!0},{name:`ops`,aliases:[`runs`],category:`navigation`,description:`Running and recent scans`,tuiOnly:!0},{name:`hackstore`,aliases:[`store`,`market`,`marketplace`],category:`navigation`,description:`Install extensions and themes`,tuiOnly:!0},{name:`connect`,aliases:[],category:`navigation`,description:`Add an API key or sign in`,usage:`/connect`,tuiOnly:!0},{name:`usage`,aliases:[`cost`,`tokens`],category:`navigation`,description:`Tokens, cost and context`,usage:`/usage`,tuiOnly:!0},{name:`back`,aliases:[],category:`navigation`,description:`Previous screen`,tuiOnly:!0},{name:`scope`,aliases:[],category:`navigation`,description:`What 0 is allowed to test`,tuiOnly:!0},{name:`doctor`,aliases:[],category:`system`,description:`Check your setup`,tuiOnly:!0},{name:`exit`,aliases:[`quit`],category:`system`,description:`Quit`}],II={};for(let e of FI){II[e.name]=e.name;for(let t of e.aliases)II[t]=e.name}function LI(e){let t=e.trimStart();if(!t.startsWith(`/`))return{isSlash:!1,command:void 0,rawName:``,args:``,isKnown:!1,isUnknown:!1};let n=t.slice(1),r=n.indexOf(` `),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1).trim():``,o=II[i];return o?{isSlash:!0,command:o,rawName:i,args:a,isKnown:!0,isUnknown:!1}:{isSlash:!0,command:void 0,rawName:i,args:a,isKnown:!1,isUnknown:!0}}function RI({className:e=``}){return(0,W.jsxs)(`span`,{"aria-hidden":`true`,className:`console-loading-dots ${e}`,children:[(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{})]})}function zI(){return(0,W.jsxs)(`div`,{role:`status`,"aria-label":`Loading conversation`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,W.jsx)(`span`,{className:`sr-only`,children:`Loading your conversation…`}),(0,W.jsxs)(`div`,{"aria-hidden":`true`,className:`mx-auto w-full max-w-3xl flex-1 space-y-8 px-6 py-8`,children:[(0,W.jsx)(`div`,{className:`ml-auto h-14 w-2/3 rounded-2xl console-skeleton`}),(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(`div`,{className:`h-3 w-28 rounded console-skeleton`}),(0,W.jsx)(`div`,{className:`h-3 w-full rounded console-skeleton`}),(0,W.jsx)(`div`,{className:`h-3 w-5/6 rounded console-skeleton`}),(0,W.jsx)(`div`,{className:`h-3 w-3/5 rounded console-skeleton`})]})]}),(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`p-6`,children:(0,W.jsx)(`div`,{className:`console-skeleton mx-auto h-14 max-w-3xl rounded-3xl`})})]})}function BI({label:e,waiting:t=!1}){return(0,W.jsxs)(`div`,{role:`status`,className:`console-activity flex items-center gap-2.5 py-1 text-xs text-muted-foreground`,children:[t?(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-amber-500`}):(0,W.jsx)(RI,{}),(0,W.jsx)(`span`,{className:t?void 0:`console-working-label`,children:e})]})}function VI(e){return/(?:HTTP|API error|status(?: code)?)\s*[:=]?\s*401\b|unauthorized|authentication[_ ](?:error|fail)|invalid[_ ]api[_ ]key|(?:Codex|ChatGPT).*(?:sign in|expired)/i.test(e)}function HI(e){if(!VI(e))return e;if(/Codex|ChatGPT/i.test(e))return`Your ChatGPT connection needs attention. Sign in again in Connections, then retry your message.`;let t=/DeepSeek|Anthropic|OpenAI|OpenRouter|Gemini|Google/i.exec(e)?.[0];return`Your ${t?`${t} `:``}connection needs attention. Update the connection in Settings, then retry your message.`}var UI={opencode:`M22 24H2V0h20zM17 4.8H7v14.4h10z`,cursor:`M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23`,claude:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`,openai:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,anthropic:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`,google:`M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z`,github:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`,deepseek:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`,openrouter:`M16.778 1.844v1.919q-.569-.026-1.138-.032-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.396.223-1.342.574-2.185.798-.841.225-1.753.333-1.751.333v4.229s.768.108 1.61.333c.842.224 1.789.575 2.185.799 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918l7.222-4.168-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z`},WI={"chatgpt-codex":`openai`,codex:`openai`,copilot:`github`,gemini:`google`},GI={"chatgpt-codex":`O`,codex:`O`,openai:`O`,azure:`Az`,"z-ai":`Z`,kimi:`K`,qwen:`Q`,xai:`x`,opencode:`OC`};function KI({providerId:e,className:t}){let n=e.toLowerCase(),r=UI[WI[n]??n];return r?(0,W.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,fill:`currentColor`,className:q(`size-4 shrink-0`,t),children:(0,W.jsx)(`path`,{d:r})}):(0,W.jsx)(`span`,{"aria-hidden":`true`,className:q(`inline-flex size-4 shrink-0 items-center justify-center text-[10px] font-semibold leading-none`,t),children:GI[n]??n.slice(0,2).toUpperCase()})}function qI(e,t){return e-t}function JI(e,t,n,r,i,a){let o=ZA(e,n,r);if(!i)return o;let s=a.slice();return s[t]=ZA(o,a[t-1]??-1/0,a[t+1]??1/0),s.sort(qI)}function YI(e,t,n){if(!Array.isArray(e))return!0;let r=t*n;for(let t=0;t<e.length-1;t+=1)if(!(Math.abs(e[t]-e[t+1])>=r))return!1;return!0}var XI=()=>null,ZI={activeThumbIndex:XI,max:XI,min:XI,minStepsBetweenValues:XI,step:XI,values:XI,...uA},QI=S.createContext(void 0);QI.displayName=`SliderRootContext`;function $I(){let e=S.useContext(QI);if(e===void 0)throw Error(`Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>.`);return e}function eL(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&BA(e,t)}var tL=S.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:i,disabled:a=!1,id:o,format:s,largeStep:c=10,locale:l,render:u,max:d=100,min:f=0,minStepsBetweenValues:p=0,form:m,name:h,onValueChange:g,onValueCommitted:_,orientation:v=`horizontal`,step:y=1,thumbCollisionBehavior:b=`push`,thumbAlignment:x=`center`,value:C,style:w,...T}=e,E=WO(o),D=PM(E),O=X(g),k=X(_),{clearErrors:A}=_A(),{state:j,disabled:M,name:N,setTouched:P,setDirty:F,validityData:I,validation:L}=pA(),{labelId:R}=hA(),[z,ee]=S.useState(),B=n??FM(R,z),V=M||a,H=N??h,[te,U]=IA({controlled:C,default:i??f,name:`Slider`}),ne=S.useRef(null),re=S.useRef(null),ie=S.useRef([]),ae=S.useRef(null),oe=S.useRef(-1),se=S.useRef(null),ce=S.useRef(PT),[le,ue]=S.useState(-1),[de,fe]=S.useState(-1),[pe,me]=S.useState(!1),[he,ge]=S.useState(()=>new Map),[_e,ve]=S.useState([void 0,void 0]),ye=X(e=>{ue(e),e!==-1&&fe(e)}),be=X(e=>{e&&(re.current=e)}),xe=Array.isArray(te),Se=S.useMemo(()=>xe?te.map(e=>ZA(e,f,d)).sort(qI):[ZA(te,f,d)],[d,f,xe,te]),Ce=xe?Se:Se[0];RA(L.inputRef,E,Ce,void 0,!V,h),zA(Ce,()=>{A(H),L.change(Ce);let e=I.initialValue,t;t=Array.isArray(Ce)&&Array.isArray(e)?!BA(Ce,e):Ce!==e,F(t)});let we=X((e,t)=>{if(Number.isNaN(e)||eL(e,te))return!1;let n=t.event,r=n.constructor,i=new r(n.type,n);return Object.defineProperty(i,"target",{writable:!0,value:{value:e,name:H}}),t.event=i,O(e,t),!t.isCanceled&&(ce.current=t.reason,U(e),!0)}),Te=X((e,t,n)=>{let r=JI(e,t,f,d,xe,Se);if(YI(r,y,p)){let e=`key`in n?KT:HT,i=we(r,$T(e,n.nativeEvent,void 0,{activeThumbIndex:t}));P(!0),i&&k(r,eE(e,n.nativeEvent))}});f>=d&&px("Slider `max` must be greater than `min`."),Y(()=>{if(!V)return;let e=_w(eT(ne.current));vw(ne.current,e)&&e.blur(),le!==-1&&ye(-1)},[le,V,ye]);let Ee=S.useMemo(()=>({...j,activeThumbIndex:le,disabled:V,dragging:pe,orientation:v,max:d,min:f,minStepsBetweenValues:p,step:y,values:Se}),[j,le,V,pe,d,f,p,v,y,Se]),De=S.useMemo(()=>({active:le,controlRef:re,disabled:V,dragging:pe,validation:L,format:s,handleInputChange:Te,indicatorPosition:_e,inset:x!==`center`,labelId:B,rootLabelId:D,largeStep:c,lastUsedThumbIndex:de,lastChangeReasonRef:ce,form:m,locale:l,max:d,min:f,minStepsBetweenValues:p,name:H,onValueCommitted:k,orientation:v,pressedThumbCenterOffsetRef:ae,pressedThumbIndexRef:oe,pressedValuesRef:se,registerFieldControlRef:be,renderBeforeHydration:x===`edge`,setActive:ye,setDragging:me,setIndicatorPosition:ve,setLabelId:ee,setValue:we,state:Ee,step:y,thumbCollisionBehavior:b,thumbMap:he,thumbRefs:ie,values:Se}),[le,B,D,V,pe,L,s,Te,_e,c,de,m,l,d,f,p,H,k,v,be,ye,we,Ee,y,b,x,he,Se]),Oe=Fx(`div`,e,{state:Ee,ref:[t,ne],props:[{"aria-labelledby":B,id:E,role:`group`},T,e=>L.getValidationProps(V,e)],stateAttributesMapping:ZI});return(0,W.jsx)(QI.Provider,{value:De,children:(0,W.jsx)(TM,{elementsRef:ie,onMapChange:ge,children:Oe})})});tL.displayName=`SliderRoot`;var nL=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=a;delete o.id;let{state:s,setLabelId:c,controlRef:l,rootLabelId:u}=$I();function d(e,t){if(t){let n=eT(e.currentTarget).getElementById(t);if(iS(n)){yA(n);return}}let n=l.current?.querySelectorAll(`input[type="range"]`),r=n?.length===1?n[0]:null;iS(r)&&yA(r)}return Fx(`div`,e,{ref:t,state:s,props:[vA({id:u,setLabelId:c,focusControl:d}),a],stateAttributesMapping:ZI})});nL.displayName=`SliderLabel`;var rL=S.forwardRef(function(e,t){let{"aria-live":n=`off`,render:r,className:i,children:a,style:o,...s}=e,{thumbMap:c,state:l,values:u,format:d,locale:f}=$I(),p=Array.from(c.values(),({inputId:e})=>e).join(` `).trim()||void 0,m=S.useMemo(()=>u.map(e=>xP(e,f,d)),[d,f,u]),h=m.join(` – `);return Fx(`output`,e,{state:l,ref:t,props:[{"aria-live":n,children:typeof a==`function`?a(m,u):h,htmlFor:p},s],stateAttributesMapping:ZI})});rL.displayName=`SliderValue`;function iL(e,t){let n=e.getBoundingClientRect();return t?(n.top+n.bottom)/2:(n.left+n.right)/2}function aL(e){if(e===0)return 0;if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function oL(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Math.max(aL(t),aL(n))))}function sL(e,t,n,r,i,a,o,s){let c=e.slice(),l=a*o,u=c.length-1,d=s??e;c[t]=ZA(n,r+t*l,i-(u-t)*l);for(let e=t+1;e<=u;e+=1){let t=c[e-1]+l,n=i-(u-e)*l,r=d[e],a=Math.max(c[e],t);r<a&&(a=Math.max(r,t)),c[e]=ZA(a,t,n)}for(let e=t-1;e>=0;--e){let t=c[e+1]-l,n=r+e*l,i=d[e],a=Math.min(c[e],t);i>a&&(a=Math.min(i,t)),c[e]=ZA(a,n,t)}for(let e=0;e<=u;e+=1)c[e]=Number(c[e].toFixed(12));return c}function cL(e,t,n,r,i,a,o,s,c,l){let u=n??t,d=r??t;if(!(u.length>1))return{value:a,thumbIndex:0,didSwap:!1};let f=c*l;if(e===`push`)return{value:sL(u,i,a,o,s,c,l),thumbIndex:i,didSwap:!1};let p=u.slice(),m=p[i-1],h=p[i+1],g=m==null?o:m+f,_=h==null?s:h-f,v=Number(ZA(a,g,_).toFixed(12));switch(p[i]=v,e){case`swap`:{let e=u[i],t=1e-7,n=a>e,r=a<e,g=n&&h!=null&&a>=h-t,_=r&&m!=null&&a<=m+t;if(!g&&!_)return{value:p,thumbIndex:i,didSwap:!1};let y=g?i+1:i-1,b=p.map((e,t)=>t===i?v:d[t]??u[t]),x=a;x=g?Math.max(a,p[y]):Math.min(a,p[y]);let S=sL(p,y,x,o,s,c,l,b),C=g?y-1:y+1,w=S[C-1],T=S[C+1],E=w==null?o:w+f;E=Math.max(E,o+C*f);let D=T==null?s:T-f;D=Math.min(D,s-(S.length-1-C)*f);let O=ZA(v,E,D);return S[C]=Number(O.toFixed(12)),{value:S,thumbIndex:y,didSwap:!0}}default:return{value:p,thumbIndex:i,didSwap:!1}}}var lL=2;function uL(e,t){if(!e)return{start:0,end:0};function n(e){let t=e==null?0:parseFloat(e);return Number.isNaN(t)?0:t}let r=t?`Top`:`InlineStart`,i=t?`Bottom`:`InlineEnd`;return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}function dL(e,t){if(t.current!=null&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}var fL=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{disabled:o,dragging:s,inset:c,lastChangeReasonRef:l,max:u,min:d,minStepsBetweenValues:f,onValueCommitted:p,orientation:m,pressedThumbCenterOffsetRef:h,pressedThumbIndexRef:g,pressedValuesRef:_,registerFieldControlRef:v,renderBeforeHydration:y,setActive:b,setDragging:x,setValue:C,state:w,step:T,thumbCollisionBehavior:E,thumbRefs:D,values:O}=$I(),k=xO(),A=O.length>1,j=m===`vertical`,M=S.useRef(null),N=S.useRef(null),P=X(e=>{e&&N.current==null&&(N.current=eS(e).getComputedStyle(e))}),F=S.useRef(null),I=S.useRef(0),L=S.useRef(0),R=S.useRef(null),z=dD(O);function ee(e){return e?.querySelector(`input[type="range"]`)}function B(e){g.current=e,D.current[e]||(h.current=null)}function V(){g.current=-1,h.current=null}function H(e){return rS(e)?D.current.some(t=>!rS(t)||!vw(t,e)?!1:ee(t)?.disabled===!0):!1}function te(e){let t=M.current,n=g.current;if(!t||n<0||n>=O.length)return n>=O.length&&(R.current=null),null;let{width:r,height:i,bottom:a,left:o,right:s}=t.getBoundingClientRect(),c=uL(N.current,j),l=L.current,p=(j?i:r)-c.start-c.end-l*2,m=h.current??0,v=e.x-m,y=e.y-m,b=ZA(((j?a-y-c.end:(k===`rtl`?s-v:v-o)-c.start)-l)/p,0,1),x=(u-d)*b+d;return x=oL(x,T,d),x=ZA(x,d,u),A?cL(E,O,z.current,_.current,n,x,d,u,T,f):{value:x,thumbIndex:n,didSwap:!1}}function U(e){_.current=A?O.slice():null,R.current=null,z.current=O;let t=g.current,n=t;if(t>-1&&t<O.length){if(O[t]===u){let e=t;for(;e>0&&O[e-1]===u;)--e;n=e}}else{let t=j?`y`:`x`,r;n=-1;for(let i=0;i<D.current.length;i+=1){let a=D.current[i];if(rS(a)&&!ee(a)?.disabled){let o=iL(a,j),s=Math.abs(e[t]-o);(r===void 0||s<=r)&&(n=i,r=s)}}}if(n>-1&&n!==t&&B(n),c){let e=D.current[n];if(rS(e)){let t=e.getBoundingClientRect();L.current=t[j?`height`:`width`]/2}}}function ne(e){let t=ee(D.current?.[e]);t&&t.focus({preventScroll:!0,focusVisible:!1})}function re(e,t,n){let r=C(e.value,$T(t,n,void 0,{activeThumbIndex:e.thumbIndex}));return r&&(R.current=e.value,z.current=Array.isArray(e.value)?e.value:[e.value],e.didSwap&&(B(e.thumbIndex),ne(e.thumbIndex))),r}let ie=X(e=>{let t=dL(e,F);if(t==null)return;if(I.current+=1,e.type===`pointermove`&&e.buttons===0){ae(e);return}let n=te(t);n!=null&&YI(n.value,T,f)&&(!s&&I.current>lL&&x(!0),re(n,qT,e))}),ae=X(e=>{b(-1),x(!1),h.current=null;let t=R.current;if(Array.isArray(t)&&t.length!==O.length&&(R.current=null),R.current!=null){let t=l.current;p(R.current,eE(t,e))}`pointerType`in e&&M.current?.hasPointerCapture(e.pointerId)&&M.current?.releasePointerCapture(e.pointerId),g.current=-1,F.current=null,se()}),oe=X(e=>{if(o)return;if(H(yw(e))){V();return}let t=e.changedTouches[0];if(t==null)return;F.current=t.identifier;let n={x:t.clientX,y:t.clientY};U(n);let r=te(n);if(r==null)return;ne(r.thumbIndex),re(r,VT,e),I.current=0;let i=eT(M.current);i.addEventListener(`touchmove`,ie,{passive:!0}),i.addEventListener(`touchend`,ae,{passive:!0})}),se=X(()=>{let e=eT(M.current);e.removeEventListener(`pointermove`,ie),e.removeEventListener(`pointerup`,ae),e.removeEventListener(`touchmove`,ie),e.removeEventListener(`touchend`,ae),_.current=null,R.current=null}),ce=UD();return S.useEffect(()=>{let e=M.current;if(!e)return()=>se();let t=tE(e,`touchstart`,oe,{passive:!0});return()=>{t(),ce.cancel(),se()}},[se,oe,M,ce]),S.useEffect(()=>{o&&se()},[o,se]),Fx(`div`,e,{state:w,ref:[t,v,M,P],props:[{"data-base-ui-slider-control":y?``:void 0,onPointerDown(e){let t=M.current,n=yw(e.nativeEvent);if(!t||o||e.defaultPrevented||!rS(n)||e.button!==0)return;if(H(n)){V();return}let r={x:e.clientX,y:e.clientY};U(r);let i=te(r);if(i==null)return;vw(D.current[i.thumbIndex],_w(eT(t)))?e.preventDefault():ce.request(()=>{ne(i.thumbIndex)}),x(!0),h.current??re(i,VT,e.nativeEvent),e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),I.current=0;let a=eT(t);a.addEventListener(`pointermove`,ie,{passive:!0}),a.addEventListener(`pointerup`,ae,{once:!0})}},a],stateAttributesMapping:ZI})});fL.displayName=`SliderControl`;var pL=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=$I();return Fx(`div`,e,{state:o,ref:t,props:[{style:{position:`relative`}},a],stateAttributesMapping:ZI})});pL.displayName=`SliderTrack`;var mL=`data-index`,hL,gL=new Set([...ZM,YM,XM]);function _L(e,t,n,r){if(!(t<0))return e.length===2?`${xP(e[t],r,n)} ${t===0?`start`:`end`} range`:n?xP(e[t],r,n):void 0}function vL(e,t,n,r,i){let a=e+t*n;return ZA(Number(a.toFixed(Math.max(aL(e),aL(t),aL(r)))),r,i)}var yL=S.forwardRef(function(e,t){let{render:n,children:r,className:i,"aria-describedby":a,"aria-label":o,"aria-labelledby":s,"aria-valuetext":c,disabled:l=!1,getAriaLabel:u,getAriaValueText:d,id:f,index:p,inputRef:m,onBlur:h,onFocus:g,onKeyDown:_,tabIndex:v,style:y,...b}=e,x=WO(f),{active:C,lastUsedThumbIndex:w,controlRef:T,disabled:E,validation:D,format:O,handleInputChange:k,inset:A,labelId:j,largeStep:M,locale:N,max:P,min:F,minStepsBetweenValues:I,form:L,name:R,orientation:z,pressedThumbCenterOffsetRef:ee,pressedThumbIndexRef:B,renderBeforeHydration:V,setActive:H,setIndicatorPosition:te,state:U,step:ne,thumbRefs:re,values:ie}=$I(),ae=xO(),oe=l||E,se=ie.length>1,ce=z===`vertical`,le=ae===`rtl`,{setTouched:ue,setFocused:de,validationMode:fe}=pA(),pe=S.useRef(null),me=S.useRef(null),he=S.useRef(!1),ge=X(e=>{he.current||g?.(e)}),_e=X(e=>{he.current||h?.(e)}),ve=WO(),ye=FA(),be=se?ve:ye,{ref:xe,index:Se}=MM({metadata:S.useMemo(()=>({inputId:be}),[be])}),Ce=se?p??Se:0,we=Ce===ie.length-1,Te=ie[Ce],Ee=SP(Te,F,P),[De,Oe]=S.useState(),ke=LF(),Ae=w>=0&&w<ie.length?w:-1,je=X(()=>{let e=T.current,t=pe.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=ce?`height`:`width`,a=r[i]-n[i],o=(n[i]/2+a*Ee/100)/r[i]*100,s=Number.isFinite(o)?o:void 0;Oe(s),Ce===0?te(e=>[s,e[1]]):we&&te(e=>[e[0],s])});Y(()=>{A&&queueMicrotask(je)},[je,A]),Y(()=>{A&&je()},[je,A,Ee]),Y(()=>{if(!A)return;let e=T.current,t=pe.current;if(!e||!t)return;let n=eS(e).ResizeObserver;if(typeof n!=`function`)return;let r=new n(je);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[T,je,A]);let Me=ce?`bottom`:`insetInlineStart`,Ne=ce?`left`:`top`,Pe;se?C===Ce?Pe=2:Ae===Ce&&(Pe=1):C===Ce&&(Pe=1);let Fe;Fe=!A&&!Number.isFinite(Ee)?cE:{position:`absolute`,[Me]:A?`var(--position)`:`${Ee}%`,[Ne]:`50%`,translate:`${(ce||!le?-1:1)*50}% ${(ce?1:-1)*50}%`,zIndex:Pe,...A&&{"--position":`${De??0}%`,visibility:V&&ke||De===void 0?`hidden`:void 0}};let Ie;ce&&(Ie=le?`vertical-rl`:`vertical-lr`);let Le=typeof u==`function`?u(Ce):o,Re=xx({"aria-label":Le,"aria-labelledby":s??(Le==null?j:void 0),"aria-describedby":a,"aria-orientation":z,"aria-valuenow":Te,"aria-valuetext":typeof d==`function`?d(xP(Te,N,O),Te,Ce):c??_L(ie,Ce,O,N),disabled:oe,form:L,id:be,max:P,min:F,name:R,onChange(e){k(e.currentTarget.valueAsNumber,Ce,e)},onFocus(e){let t=he.current;he.current=!1,H(Ce),de(!0),t&&e.stopPropagation()},onBlur(e){if(he.current){e.stopPropagation();return}H(-1),!re.current.some(t=>vw(t,e.relatedTarget))&&(ue(!0),de(!1),fe===`onBlur`&&D.commit(JI(Te,Ce,F,P,se,ie)))},onKeyDown(e){if(e.defaultPrevented||!gL.has(e.key))return;ZM.has(e.key)&&e.stopPropagation();let t=null,n=0,r=e.shiftKey?M:ne,i=oL(Te,ne,F);switch(e.key){case WM:n=1;break;case qM:n=le?-1:1;break;case GM:n=-1;break;case KM:n=le?1:-1;break;case YM:r=M,n=1;break;case XM:r=M,n=-1;break;case`End`:t=se&&Number.isFinite(ie[Ce+1])?ie[Ce+1]-ne*I:P;break;case JM:t=se&&Number.isFinite(ie[Ce-1])?ie[Ce-1]+ne*I:F}if(n!==0&&(t=vL(i,r,n,F,P)),t!==null){let n=e.currentTarget;Qw(n)||(he.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),k(t,Ce,e),e.preventDefault()}},step:ne,style:{...cE,width:`100%`,height:`100%`,writingMode:Ie},tabIndex:v,type:`range`,value:Te??``},e=>D.getValidationProps(oe,e),{onFocus:ge,onBlur:_e,onKeyDown:_}),ze=tx(me,D.inputRef,m);return Fx(`div`,e,{state:U,ref:[t,xe,pe],props:[{[mL]:Ce,children:(0,W.jsxs)(S.Fragment,{children:[r,(0,W.jsx)(`input`,{ref:ze,...Re,suppressHydrationWarning:!0}),A&&we&&V&&(hL||=(0,W.jsx)(RF,{script:``}))]}),id:x,onPointerDown(e){if(oe)return;B.current=Ce;let t=iL(e.currentTarget,ce);ee.current=(ce?e.clientY:e.clientX)-t},style:Fe,suppressHydrationWarning:V||void 0},b],stateAttributesMapping:ZI})});yL.displayName=`SliderThumb`;function bL(e,t,n,r,i,a){let o={visibility:a||n&&(r===void 0||t&&i===void 0)?`hidden`:void 0,position:e?`absolute`:`relative`,[e?`width`:`height`]:`inherit`},s=`${r??0}%`,c=`${(i??0)-(r??0)}%`;return n&&(o[`--start-position`]=s,s=`var(--start-position)`,t&&(o[`--relative-size`]=c,c=`var(--relative-size)`)),o[e?`bottom`:`insetInlineStart`]=t?s:0,o[e?`height`:`width`]=t?c:s,o}var xL=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{indicatorPosition:o,inset:s,max:c,min:l,orientation:u,renderBeforeHydration:d,state:f,values:p}=$I(),m=LF(),h=bL(u===`vertical`,p.length>1,s,s?o[0]:SP(p[0],l,c),s?o[1]:SP(p[p.length-1],l,c),s&&d&&m);return Fx(`div`,e,{state:f,ref:t,props:[{"data-base-ui-slider-indicator":d?``:void 0,style:h,suppressHydrationWarning:d||void 0},a],stateAttributesMapping:ZI})});xL.displayName=`SliderIndicator`;var SL=YA({Control:()=>fL,Indicator:()=>xL,Label:()=>nL,Root:()=>tL,Thumb:()=>yL,Track:()=>pL,Value:()=>rL});function CL({className:e,label:t,valueText:n,step:r=1,largeStep:i=r,...a}){return(0,W.jsx)(SL.Root,{...a,step:r,largeStep:i,orientation:`horizontal`,className:q(`w-full px-2 data-disabled:opacity-50`,e),children:(0,W.jsx)(SL.Control,{className:`relative flex h-8 w-full touch-none select-none items-center cursor-pointer data-disabled:cursor-not-allowed`,children:(0,W.jsxs)(SL.Track,{className:`relative h-1 w-full rounded-full bg-muted-foreground/25`,children:[(0,W.jsx)(SL.Indicator,{className:`h-full rounded-full bg-primary`}),(0,W.jsx)(SL.Thumb,{getAriaLabel:()=>t,getAriaValueText:n?(e,t)=>n(t):void 0,className:`size-4 rounded-full bg-white shadow-sm outline-none transition-[box-shadow,scale] duration-150 ease-out motion-reduce:transition-none data-dragging:scale-110 hover:shadow-md has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-primary/50 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-popover`})]})})})}var wL={none:`None`,low:`Low`,medium:`Medium`,high:`High`,xhigh:`Very high`,max:`Maximum`};function TL({workspace:e,sessionId:t,reasoning:n,disabled:r}){let[i,a]=(0,S.useState)(n?.effort??`medium`),[o,s]=(0,S.useState)(!1);if((0,S.useEffect)(()=>{a(n?.effort??`medium`)},[n?.effort,t]),!n||n.options.length<2)return null;let c=Math.max(0,n.options.indexOf(i));return(0,W.jsxs)(vI,{open:o,onOpenChange:s,children:[(0,W.jsxs)(vI.Trigger,{render:(0,W.jsx)(J,{variant:`ghost`,size:`sm`}),disabled:r,"aria-label":`Thinking effort: ${wL[n.effort]??n.effort}`,className:`gap-1 rounded-full px-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:wL[n.effort]??n.effort}),(0,W.jsx)(da,{className:`size-3`})]}),(0,W.jsxs)(vI.Content,{side:`top`,align:`end`,sideOffset:10,positionMethod:`fixed`,className:`w-64 rounded-2xl p-4 font-sans`,children:[(0,W.jsx)(vI.Title,{className:`text-sm font-medium`,children:`Thinking effort`}),(0,W.jsx)(`div`,{className:`mt-3 text-sm`,children:wL[i]??i}),(0,W.jsx)(CL,{min:0,max:n.options.length-1,step:1,value:c,label:`Thinking effort`,valueText:e=>`${wL[n.options[e]]??n.options[e]}, ${e+1} of ${n.options.length}`,disabled:r||e.busy,className:`mt-2`,onValueChange:e=>a(n.options[e]??n.effort),onValueCommitted:i=>{let o=n.options[i];!o||o===n.effort||r||e.busy||e.perform(async()=>{try{await Ai(t,{runtime:{reasoningEffort:o}})}catch(e){throw a(n.effort),e}},t)}}),(0,W.jsxs)(`div`,{className:`mt-1 flex justify-between text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:wL[n.options[0]]??n.options[0]}),(0,W.jsx)(`span`,{children:wL[n.options.at(-1)]??n.options.at(-1)})]}),(0,W.jsx)(vI.Description,{className:`mt-3 text-xs leading-5 text-muted-foreground`,children:`More thinking can improve difficult answers and uses more time and tokens.`})]})]})}function EL({workspace:e,sessionId:t,cwd:n,workspaceDisabled:r,onAdd:i,disabled:a,className:o}){let[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(`menu`),[d,f]=(0,S.useState)(``),p=(0,S.useId)(),m=(0,S.useId)(),h=n?.split(`/`).filter(Boolean).at(-1)||`Choose a workspace`;return(0,W.jsxs)(vI,{open:s&&!a,onOpenChange:e=>{c(e),u(`menu`),f(``)},children:[(0,W.jsx)(vI.Trigger,{render:(0,W.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`}),className:o,disabled:a,"aria-label":`Add context`,title:`Add context`,children:(0,W.jsx)(ro,{className:`size-5`})}),(0,W.jsx)(vI.Content,{side:`top`,align:`start`,sideOffset:12,positionMethod:`fixed`,className:`w-80 max-w-[calc(100vw-24px)] rounded-2xl bg-popover p-2 text-popover-foreground shadow-lg outline-border motion-reduce:transition-none [&>[data-side]]:hidden [[data-reduced-motion=true]_&]:transition-none`,children:l===`menu`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(vI.Title,{className:`sr-only`,children:`Workspace and context`}),(0,W.jsx)(vI.Description,{className:`sr-only`,children:`Choose a working folder or reference a file in your message.`}),(0,W.jsxs)(`button`,{type:`button`,disabled:r,title:n,onClick:()=>{f(n??``),u(`workspace`)},className:`flex w-full items-center gap-3 rounded-xl p-3 text-left hover:bg-muted disabled:opacity-50`,children:[(0,W.jsx)(Ia,{className:`size-4 shrink-0`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`span`,{className:`block truncate text-sm`,children:h}),(0,W.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Change workspace`})]}),(0,W.jsx)(fa,{className:`size-4 text-muted-foreground`})]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>{f(``),u(`reference`)},className:`flex w-full items-center gap-3 rounded-xl p-3 text-left text-sm hover:bg-muted`,children:[(0,W.jsx)(Aa,{className:`size-4`}),`Add a file reference`]})]}):(0,W.jsxs)(`div`,{className:`p-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Back to context menu`,onClick:()=>u(`menu`),children:(0,W.jsx)(na,{className:`size-4`})}),(0,W.jsx)(vI.Title,{className:`text-sm font-medium`,children:l===`workspace`?`Change workspace`:`Add a file reference`})]}),(0,W.jsx)(vI.Description,{id:m,className:`mt-2 text-xs leading-5 text-muted-foreground`,children:l===`workspace`?`Choose where 0 works. Confirm folder access before it changes.`:`Reference a file or folder on this computer.`}),(0,W.jsxs)(`form`,{className:`mt-3 space-y-3`,onSubmit:n=>{n.preventDefault();let o=d.trim();if(!(!o||a)){if(l===`workspace`){if(r)return;e.perform(()=>Ai(t,{workspacePath:o})).then(e=>{e&&c(!1)})}else i(o),c(!1),f(``)}},children:[(0,W.jsx)(`label`,{htmlFor:p,className:`sr-only`,children:l===`workspace`?`Workspace folder path`:`File or folder path`}),(0,W.jsx)(af,{id:p,autoFocus:!0,autoComplete:`off`,"data-1p-ignore":!0,"data-lpignore":`true`,"aria-describedby":m,placeholder:l===`workspace`?`/path/to/project`:`/path/to/file-or-folder`,value:d,disabled:e.busy,onChange:e=>f(e.target.value)},l),(0,W.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,W.jsx)(vI.Close,{render:(0,W.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`}),children:`Cancel`}),(0,W.jsx)(J,{type:`submit`,size:`sm`,disabled:e.busy||!d.trim()||l===`workspace`&&(r||d.trim()===n),children:l===`workspace`?`Use folder`:`Add reference`})]})]})]})})]})}function DL(){let e=ni({queryKey:[`dashboard`],queryFn:li,refetchInterval:5e3}),t=ni({queryKey:[`console-sessions`],queryFn:({signal:e})=>Ci(e),refetchInterval:2e3}),n=ni({queryKey:[`console-saved`],queryFn:({signal:e})=>wi(e),refetchInterval:5e3}),r=new Set([...(t.data??[]).flatMap(e=>[e.id,...e.savedId?[e.savedId]:[]]),...(n.data??[]).map(e=>e.id)]),i=(e.data?.scans??[]).filter(e=>!!e.target.trim()&&!e.id.startsWith(`console-`)&&!r.has(e.id)).sort((e,t)=>t.startedAt.localeCompare(e.startedAt)),a=[...e.data?.groups??[]].sort((e,t)=>t.latest.timestamp-e.latest.timestamp),o=(t.data??[]).filter(e=>[`working`,`waiting`].includes(e.status)),s=a.filter(e=>e.workflow.phase===`in_progress`||e.workflow.activeAgentRoles.length>0),c=(e.data?.workers??[]).filter(e=>e.isActive&&e.status!==`stopped`),l=e.error??t.error??n.error,u=e.isPending||t.isPending||n.isPending,d=e.isFetching||t.isFetching||n.isFetching,f=()=>void Promise.all([e.refetch(),t.refetch(),n.refetch()]),p=`group flex min-w-0 items-start justify-between gap-3 rounded-xl px-3 py-3 transition-colors hover:bg-muted/60 focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-foreground/40 motion-reduce:transition-none`;return(0,W.jsxs)(`section`,{"aria-labelledby":`home-activity-heading`,className:`mx-auto w-full max-w-3xl space-y-8 px-6 py-12`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`h2`,{id:`home-activity-heading`,className:`text-lg font-medium`,children:`Workspace activity`}),(0,W.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh workspace activity`,title:`Refresh workspace activity`,disabled:d,onClick:f,children:(0,W.jsx)(so,{className:`size-4`})})]}),u&&(0,W.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(RI,{}),`Loading workspace activity…`]}),l&&(0,W.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm`,children:[(0,W.jsxs)(`p`,{className:`text-destructive`,children:[`Couldn't load workspace activity. `,l instanceof Error?l.message:`Try refreshing.`]}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,disabled:d,onClick:f,children:`Try again`})]}),!u&&!l&&e.data&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dl`,{className:`grid grid-cols-3 gap-6`,children:[{label:`Audits`,value:i.length},{label:`Findings`,value:a.length},{label:`Active chats`,value:o.length}].map(e=>(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e.label}),(0,W.jsx)(`dd`,{className:`mt-2 text-2xl font-medium`,children:e.value})]},e.label))}),o.length>0&&(0,W.jsxs)(`section`,{className:`space-y-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Live chats`}),o.slice(0,4).map(e=>(0,W.jsxs)(vn,{to:`/console/${encodeURIComponent(e.id)}`,className:p,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate text-sm`,children:e.title}),(0,W.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(RI,{className:`console-loading-dots-compact`}),e.status===`waiting`?`Waiting for you`:`Working`]})]},e.id))]}),(0,W.jsxs)(`div`,{className:`grid gap-8 sm:grid-cols-2`,children:[(0,W.jsxs)(`section`,{className:`min-w-0 space-y-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Recent audits`}),(0,W.jsxs)(vn,{to:`/runs`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground`,children:[`Reports`,(0,W.jsx)(ia,{className:`size-3`})]})]}),i.length?(0,W.jsx)(`ul`,{className:`-mx-3`,children:i.slice(0,4).map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(vn,{to:`/runs/${encodeURIComponent(e.id)}`,className:p,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`p`,{className:`truncate text-sm`,children:e.target}),(0,W.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[tv(e.startedAt),` · `,e.summary.totalFindings,` finding`,e.summary.totalFindings===1?``:`s`]})]}),(0,W.jsx)(`span`,{className:`shrink-0 text-xs capitalize text-muted-foreground`,children:e.status})]})},e.id))}):(0,W.jsx)(`p`,{className:`py-3 text-sm text-muted-foreground`,children:`No audits yet. Ask 0 to plan a review above.`})]}),(0,W.jsxs)(`section`,{className:`min-w-0 space-y-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Recent findings`}),(0,W.jsxs)(vn,{to:`/findings`,className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[`View all`,(0,W.jsx)(ia,{className:`size-3`})]})]}),a.length?(0,W.jsx)(`ul`,{className:`-mx-3`,children:a.slice(0,4).map(e=>(0,W.jsx)(`li`,{children:(0,W.jsxs)(vn,{to:`/findings/${encodeURIComponent(e.fingerprint)}`,className:p,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`p`,{className:`truncate text-sm`,children:e.latest.title}),(0,W.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.workflow.phase.replaceAll(`_`,` `),e.workflow.reviewGate===`none`?``:` · Awaiting review`]})]}),(0,W.jsx)(`span`,{className:`shrink-0 text-xs capitalize text-muted-foreground`,children:e.latest.severity})]})},e.fingerprint))}):(0,W.jsxs)(`p`,{className:`flex items-center gap-2 py-3 text-sm text-muted-foreground`,children:[(0,W.jsx)(go,{className:`size-4 shrink-0`}),`No findings recorded yet.`]})]})]}),(0,W.jsxs)(`section`,{className:`space-y-3`,children:[(0,W.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,W.jsx)(Qi,{className:`size-4 text-muted-foreground`}),`Agents and tasks`]}),s.length===0&&c.length===0?(0,W.jsx)(`p`,{className:`py-3 text-sm text-muted-foreground`,children:`No audit tasks running right now.`}):(0,W.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[s.slice(0,4).map(e=>(0,W.jsxs)(vn,{to:`/findings/${encodeURIComponent(e.fingerprint)}`,className:p,children:[(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`p`,{className:`truncate text-sm`,children:e.latest.title}),(0,W.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.workflow.activeAgentRoles.length?e.workflow.activeAgentRoles.join(`, `):`In progress`})]}),(0,W.jsx)(RI,{className:`console-loading-dots-compact`})]},e.fingerprint)),c.slice(0,4).map(e=>(0,W.jsxs)(`div`,{className:`rounded-xl px-3 py-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`p`,{className:`truncate text-sm`,children:e.label}),(0,W.jsx)(`span`,{className:`text-xs capitalize text-muted-foreground`,children:e.status})]}),(0,W.jsx)(`p`,{className:`mt-1 truncate text-xs text-muted-foreground`,children:e.currentWorkItemTitle??(e.currentWorkItemId?`Working on an audit task`:`Worker is idle`)}),e.lastError&&(0,W.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,children:e.lastError})]},e.id))]})]})]})]})}function OL({workspace:e,snapshot:t}){let n=t.queuedMessages.length,r=n=>void e.perform(()=>ki(t.session.id,n),t.session.id);return(0,W.jsxs)(vI,{children:[(0,W.jsxs)(vI.Trigger,{render:(0,W.jsx)(J,{variant:`ghost`,size:`sm`}),"aria-label":`Queued messages ${n}`,title:`${n} queued message${n===1?``:`s`}`,className:`gap-1.5 px-2 text-muted-foreground`,children:[(0,W.jsx)(Ka,{className:`size-4`}),(0,W.jsx)(`span`,{className:`text-xs tabular-nums`,children:n})]}),(0,W.jsxs)(vI.Content,{side:`top`,align:`end`,sideOffset:10,positionMethod:`fixed`,className:`flex w-80 max-w-[calc(100vw-24px)] flex-col rounded-2xl border border-border bg-popover p-3 text-popover-foreground shadow-lg`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(vI.Title,{className:`text-sm font-medium`,children:[`Queued messages · `,n]}),(0,W.jsx)(vI.Close,{render:(0,W.jsx)(J,{variant:`ghost`,size:`icon-xs`}),"aria-label":`Close queued messages`,children:(0,W.jsx)(Po,{className:`size-3.5`})})]}),(0,W.jsx)(vI.Description,{className:`mt-1 text-xs text-muted-foreground`,children:`Messages to send after the current response.`}),n>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`ol`,{className:`mt-3 max-h-56 min-h-0 space-y-1 overflow-y-auto overscroll-contain`,children:t.queuedMessages.map((t,n)=>(0,W.jsxs)(`li`,{className:`flex items-start gap-2 rounded-xl px-2 py-2 hover:bg-muted/60`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 shrink-0 text-xs tabular-nums text-muted-foreground`,"aria-hidden":`true`,children:n+1}),(0,W.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-sm`,children:t.text}),(0,W.jsx)(J,{variant:`ghost`,size:`icon-xs`,disabled:e.busy,"aria-label":`Remove queued message ${n+1}`,title:`Remove message`,onClick:()=>r(t.id),children:(0,W.jsx)(Po,{className:`size-3.5`})})]},t.id))}),(0,W.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,W.jsx)(J,{variant:`ghost`,size:`sm`,disabled:e.busy,onClick:()=>r(),children:`Clear queue`})})]}):(0,W.jsx)(`p`,{className:`py-4 text-sm text-muted-foreground`,children:`No queued messages.`})]})]})}var kL={standard:{label:`Standard`,description:`Ask before each action`,icon:go},recon:{label:`Recon`,description:`Read-only exploration`,icon:fo},copilot:{label:`Copilot`,description:`Act within scope; ask before new targets`,icon:Ba},yolo:{label:`YOLO`,description:`Act without per-action prompts`,icon:Fo}};function AL({workspace:e,sessionId:t,mode:n,disabled:r}){let[i,a]=(0,S.useState)(null),o=kL[n],s=o.icon,c=n=>void e.perform(async()=>{await Ai(t,{autonomyMode:n}),a(null)});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(hP,{children:[(0,W.jsx)(hP.Trigger,{"aria-label":`Mode: ${o.label}`,title:`${o.label}: ${o.description}`,disabled:r,className:`flex items-center gap-1 rounded-full px-2 py-2 text-xs text-muted-foreground hover:bg-muted disabled:opacity-50`,children:(0,W.jsxs)(`button`,{type:`button`,children:[(0,W.jsx)(s,{className:`size-3.5`}),(0,W.jsx)(`span`,{className:`hidden sm:inline`,children:o.label}),(0,W.jsx)(da,{className:`hidden size-3 sm:block`})]})}),(0,W.jsx)(hP.Content,{side:`top`,align:`end`,sideOffset:10,collisionPadding:12,className:`w-64 rounded-lg p-2 font-sans`,children:Object.keys(kL).map(e=>{let t=kL[e],r=t.icon;return(0,W.jsx)(hP.Item,{icon:(0,W.jsx)(r,{className:`size-4`}),selected:n===e,className:`gap-3 rounded-xl px-3 py-2 text-sm focus-visible:ring-0 data-highlighted:bg-muted`,onClick:()=>{e!==n&&(e===`copilot`||e===`yolo`?a(e):c(e))},children:(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,W.jsx)(`span`,{children:t.label}),(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.description})]})},e)})})]}),(0,W.jsx)(of,{open:i!==null,onOpenChange:e=>{e||a(null)},children:(0,W.jsxs)(uf,{className:`sm:max-w-sm`,children:[(0,W.jsxs)(df,{children:[(0,W.jsxs)(pf,{children:[`Use `,i?kL[i].label:`this mode`,`?`]}),(0,W.jsx)(mf,{children:i===`copilot`?`0 will run actions within your scope without asking each time. It will still ask before adding new targets.`:`0 will run actions without asking each time. Your configured exclusions and credential boundaries still apply.`})]}),(0,W.jsxs)(ff,{children:[(0,W.jsx)(J,{variant:`ghost`,onClick:()=>a(null),disabled:e.busy,children:`Cancel`}),(0,W.jsxs)(J,{onClick:()=>{i&&c(i)},disabled:e.busy,children:[`Use `,i?kL[i].label:`mode`]})]})]})})]})}var jL=`Help me connect this coding agent to 0.security's local MCP server.
73
+ First check whether the 0 CLI is installed and whether this agent supports local stdio MCP servers. Inspect the client's current configuration and preserve existing integrations.
74
+ Ask me for the authorized target URL and an absolute path to its scope JSON file before configuring target tools. Do not infer authorization from conversation history.
75
+ The server command is: 0 mcp-server --target <authorized-url> --scan-id <unique-session-id> --scope <absolute-scope-json> --tools http_request,crawl,query_findings
76
+ Use an absolute executable path if the client cannot resolve 0. Apply the client's actual MCP configuration format, show me the proposed change, and wait for approval before writing it.
77
+ Verify that the server exposes the selected tools. This is a scoped tool integration, not a replacement for the 0 browser chat, and does not automatically start an audit.`;function ML(e){let[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(``),s=()=>{navigator.clipboard.writeText(jL).then(()=>{i(!0),o(``)}).catch(()=>{i(!1),o(`Couldn't copy. Open the setup prompt below and copy it manually.`)})},c=[{id:`claude`,label:`Claude`,color:`text-[#D97757]`},{id:`codex`,label:`Codex`,color:``},{id:`cursor`,label:`Cursor`,color:``},{id:`opencode`,label:`OpenCode`,color:``}];return(0,W.jsxs)(of,{open:t,onOpenChange:e=>{n(e),i(!1),o(``)},children:[(0,W.jsx)(sf,{asChild:!0,children:(0,W.jsxs)(J,{variant:`secondary`,size:`sm`,className:`inline-flex gap-4 px-4`,children:[(0,W.jsx)(`span`,{children:`Onboard your agent`}),(0,W.jsx)(`span`,{className:`flex gap-1.5`,"aria-hidden":`true`,children:c.map(e=>(0,W.jsx)(KI,{providerId:e.id,className:`size-4 ${e.color}`},e.id))})]})}),(0,W.jsxs)(uf,{"aria-describedby":void 0,className:`gap-5 sm:max-w-sm`,children:[(0,W.jsx)(df,{children:(0,W.jsx)(pf,{children:`Connect your agent`})}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-3`,children:c.map(e=>(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(KI,{providerId:e.id,className:`size-4 ${e.color}`}),e.label]},e.id))}),(0,W.jsxs)(J,{onClick:s,className:`w-full`,"aria-live":`polite`,children:[r?(0,W.jsx)(ua,{className:`size-4`}):(0,W.jsx)(Sa,{className:`size-4`}),r?`Copied`:`Copy setup prompt`]}),a&&(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:a}),(0,W.jsxs)(`details`,{className:`group`,children:[(0,W.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 text-xs text-muted-foreground [&::-webkit-details-marker]:hidden`,children:[(0,W.jsx)(da,{className:`size-3.5 transition-transform group-open:rotate-180 motion-reduce:transition-none`}),`View prompt`]}),(0,W.jsx)(`pre`,{tabIndex:0,"aria-label":`Setup prompt`,className:`mt-3 max-h-52 overflow-y-auto whitespace-pre-wrap break-words rounded-xl bg-muted/35 p-3 font-sans text-xs leading-6 focus-visible:outline-1 focus-visible:outline-foreground/40`,children:jL})]})]})]})}var NL=`/assets/zero-peek-Dzm3MT3X.png`;function PL(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var FL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LL={};function RL(e,t){return((t||LL).jsx?IL:FL).test(e)}var zL=/[ \t\n\f\r]/g;function BL(e){return typeof e==`object`?e.type===`text`&&VL(e.value):VL(e)}function VL(e){return e.replace(zL,``)===``}var HL=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};HL.prototype.normal={},HL.prototype.property={},HL.prototype.space=void 0;function UL(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new HL(n,r,t)}function WL(e){return e.toLowerCase()}var GL=class{constructor(e,t){this.attribute=t,this.property=e}};GL.prototype.attribute=``,GL.prototype.booleanish=!1,GL.prototype.boolean=!1,GL.prototype.commaOrSpaceSeparated=!1,GL.prototype.commaSeparated=!1,GL.prototype.defined=!1,GL.prototype.mustUseProperty=!1,GL.prototype.number=!1,GL.prototype.overloadedBoolean=!1,GL.prototype.property=``,GL.prototype.spaceSeparated=!1,GL.prototype.space=void 0;var KL=s({boolean:()=>JL,booleanish:()=>YL,commaOrSpaceSeparated:()=>$L,commaSeparated:()=>QL,number:()=>Z,overloadedBoolean:()=>XL,spaceSeparated:()=>ZL}),qL=0,JL=eR(),YL=eR(),XL=eR(),Z=eR(),ZL=eR(),QL=eR(),$L=eR();function eR(){return 2**++qL}var tR=Object.keys(KL),nR=class extends GL{constructor(e,t,n,r){let i=-1;if(super(e,t),rR(this,`space`,r),typeof n==`number`)for(;++i<tR.length;){let e=tR[i];rR(this,tR[i],(n&KL[e])===KL[e])}}};nR.prototype.defined=!0;function rR(e,t,n){n&&(e[t]=n)}function iR(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new nR(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[WL(r)]=r,n[WL(a.attribute)]=r}return new HL(t,n,e.space)}var aR=iR({properties:{ariaActiveDescendant:null,ariaAtomic:YL,ariaAutoComplete:null,ariaBusy:YL,ariaChecked:YL,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:ZL,ariaCurrent:null,ariaDescribedBy:ZL,ariaDetails:null,ariaDisabled:YL,ariaDropEffect:ZL,ariaErrorMessage:null,ariaExpanded:YL,ariaFlowTo:ZL,ariaGrabbed:YL,ariaHasPopup:null,ariaHidden:YL,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ZL,ariaLevel:Z,ariaLive:null,ariaModal:YL,ariaMultiLine:YL,ariaMultiSelectable:YL,ariaOrientation:null,ariaOwns:ZL,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:YL,ariaReadOnly:YL,ariaRelevant:null,ariaRequired:YL,ariaRoleDescription:ZL,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:YL,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function oR(e,t){return t in e?e[t]:t}function sR(e,t){return oR(e,t.toLowerCase())}var cR=iR({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:QL,acceptCharset:ZL,accessKey:ZL,action:null,allow:null,allowFullScreen:JL,allowPaymentRequest:JL,allowUserMedia:JL,alt:null,as:null,async:JL,autoCapitalize:null,autoComplete:ZL,autoFocus:JL,autoPlay:JL,blocking:ZL,capture:null,charSet:null,checked:JL,cite:null,className:ZL,cols:Z,colSpan:null,content:null,contentEditable:YL,controls:JL,controlsList:ZL,coords:Z|QL,crossOrigin:null,data:null,dateTime:null,decoding:null,default:JL,defer:JL,dir:null,dirName:null,disabled:JL,download:XL,draggable:YL,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:JL,formTarget:null,headers:ZL,height:Z,hidden:XL,high:Z,href:null,hrefLang:null,htmlFor:ZL,httpEquiv:ZL,id:null,imageSizes:null,imageSrcSet:null,inert:JL,inputMode:null,integrity:null,is:null,isMap:JL,itemId:null,itemProp:ZL,itemRef:ZL,itemScope:JL,itemType:ZL,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:JL,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:JL,muted:JL,name:null,nonce:null,noModule:JL,noValidate:JL,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:JL,optimum:Z,pattern:null,ping:ZL,placeholder:null,playsInline:JL,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:JL,referrerPolicy:null,rel:ZL,required:JL,reversed:JL,rows:Z,rowSpan:Z,sandbox:ZL,scope:null,scoped:JL,seamless:JL,selected:JL,shadowRootClonable:JL,shadowRootDelegatesFocus:JL,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:YL,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:JL,useMap:null,value:YL,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ZL,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:JL,declare:JL,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:JL,noHref:JL,noShade:JL,noWrap:JL,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:YL,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:JL,disableRemotePlayback:JL,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:sR}),lR=iR({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:$L,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:ZL,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:JL,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:QL,g2:QL,glyphName:QL,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:$L,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ZL,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$L,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$L,rev:$L,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$L,requiredFeatures:$L,requiredFonts:$L,requiredFormats:$L,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:$L,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$L,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$L,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:oR}),uR=iR({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),dR=iR({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:sR}),fR=iR({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),pR={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},mR=/[A-Z]/g,hR=/-[a-z]/g,gR=/^data[-\w.:]+$/i;function _R(e,t){let n=WL(t),r=t,i=GL;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&gR.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(hR,yR);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!hR.test(e)){let n=e.replace(mR,vR);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=nR}return new i(r,t)}function vR(e){return`-`+e.toLowerCase()}function yR(e){return e.charAt(1).toUpperCase()}var bR=UL([aR,cR,uR,dR,fR],`html`),xR=UL([aR,lR,uR,dR,fR],`svg`);function SR(e){return e.join(` `).trim()}var CR=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
78
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),wR=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(CR());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),TR=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ER=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(wR()),r=TR();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),DR=kR(`end`),OR=kR(`start`);function kR(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function AR(e){let t=OR(e),n=DR(e);if(t&&n)return{start:t,end:n}}function jR(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?NR(e.position):`start`in e||`end`in e?NR(e):`line`in e||`column`in e?MR(e):``}function MR(e){return PR(e&&e.line)+`:`+PR(e&&e.column)}function NR(e){return MR(e&&e.start)+`-`+MR(e&&e.end)}function PR(e){return e&&typeof e==`number`?e:1}var FR=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=jR(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};FR.prototype.file=``,FR.prototype.name=``,FR.prototype.reason=``,FR.prototype.message=``,FR.prototype.stack=``,FR.prototype.column=void 0,FR.prototype.line=void 0,FR.prototype.ancestors=void 0,FR.prototype.cause=void 0,FR.prototype.fatal=void 0,FR.prototype.place=void 0,FR.prototype.ruleId=void 0,FR.prototype.source=void 0;var IR=l(ER(),1),LR={}.hasOwnProperty,RR=new Map,zR=/[A-Z]/g,BR=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),VR=new Set([`td`,`th`]),HR=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function UR(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=ez(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=$R(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?xR:bR,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=WR(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function WR(e,t,n){if(t.type===`element`)return GR(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return KR(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return JR(e,t,n);if(t.type===`mdxjsEsm`)return qR(e,t);if(t.type===`root`)return YR(e,t,n);if(t.type===`text`)return XR(e,t)}function GR(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=xR,e.schema=i),e.ancestors.push(t);let a=oz(e,t.tagName,!1),o=tz(e,t),s=rz(e,t);return BR.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!BL(e)})),ZR(e,o,a,t),QR(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function KR(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}sz(e,t.position)}function qR(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sz(e,t.position)}function JR(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=xR,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:oz(e,t.name,!0),o=nz(e,t),s=rz(e,t);return ZR(e,o,a,t),QR(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function YR(e,t,n){let r={};return QR(r,rz(e,t)),e.create(t,e.Fragment,r,n)}function XR(e,t){return t.value}function ZR(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function QR(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function $R(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function ez(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=OR(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function tz(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&LR.call(t.properties,i)){let a=iz(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&VR.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function nz(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else sz(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else sz(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function rz(e,t){let n=[],r=-1,i=e.passKeys?new Map:RR;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=WR(e,a,o);s!==void 0&&n.push(s)}return n}function iz(e,t,n){let r=_R(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?PL(n):SR(n)),r.property===`style`){let t=typeof n==`object`?n:az(e,String(n));return e.stylePropertyNameCase===`css`&&(t=cz(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?pR[r.property]||r.property:r.attribute,n]}}function az(e,t){try{return(0,IR.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new FR("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=HR+`#cannot-parse-style-attribute`,r}}function oz(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=RL(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=RL(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return LR.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);sz(e)}function sz(e,t){let n=new FR("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=HR+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function cz(e){let t={},n;for(n in e)LR.call(e,n)&&(t[lz(n)]=e[n]);return t}function lz(e){let t=e.replace(zR,uz);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function uz(e){return`-`+e.toLowerCase()}var dz={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},fz={};function pz(e,t){let n=t||fz;return mz(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function mz(e,t,n){if(gz(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return hz(e.children,t,n)}return Array.isArray(e)?hz(e,t,n):``}function hz(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=mz(e[i],t,n);return r.join(``)}function gz(e){return!!(e&&typeof e==`object`)}var _z=document.createElement(`i`);function vz(e){let t=`&`+e+`;`;_z.innerHTML=t;let n=_z.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function yz(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function bz(e,t){return e.length>0?(yz(e,e.length,0,t),e):t}var xz={}.hasOwnProperty;function Sz(e){let t={},n=-1;for(;++n<e.length;)Cz(t,e[n]);return t}function Cz(e,t){let n;for(n in t){let r=(xz.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){xz.call(r,a)||(r[a]=[]);let e=i[a];wz(r[a],Array.isArray(e)?e:e?[e]:[])}}}function wz(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);yz(e,0,0,r)}function Tz(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Ez(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Dz=zz(/[A-Za-z]/),Oz=zz(/[\dA-Za-z]/),kz=zz(/[#-'*+\--9=?A-Z^-~]/);function Az(e){return e!==null&&(e<32||e===127)}var jz=zz(/\d/),Mz=zz(/[\dA-Fa-f]/),Nz=zz(/[!-/:-@[-`{-~]/);function Pz(e){return e!==null&&e<-2}function Fz(e){return e!==null&&(e<0||e===32)}function Iz(e){return e===-2||e===-1||e===32}var Lz=zz(/\p{P}|\p{S}/u),Rz=zz(/\s/);function zz(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Bz(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Oz(e.charCodeAt(n+1))&&Oz(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Vz(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Iz(r)?(e.enter(n),s(r)):t(r)}function s(r){return Iz(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Hz={tokenize:Uz};function Uz(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Vz(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Pz(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Wz={tokenize:Kz},Gz={tokenize:qz};function Kz(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return yz(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gz,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Gz,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Pz(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;yz(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function qz(e,t,n){return Vz(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Jz(e){if(e===null||Fz(e)||Rz(e))return 1;if(Lz(e))return 2}function Yz(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Xz={name:`attention`,resolveAll:Zz,tokenize:Qz};function Zz(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};$z(d,-c),$z(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=bz(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=bz(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=bz(l,Yz(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=bz(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=bz(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,yz(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Qz(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Jz(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Jz(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function $z(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var eB={name:`autolink`,tokenize:tB};function tB(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Dz(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Oz(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Oz(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Az(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):kz(t)?(e.consume(t),l):n(t)}function u(e){return Oz(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Oz(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var nB={partial:!0,tokenize:rB};function rB(e,t,n){return r;function r(t){return Iz(t)?Vz(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Pz(e)?t(e):n(e)}}var iB={continuation:{tokenize:oB},exit:sB,name:`blockQuote`,tokenize:aB};function aB(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Iz(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function oB(e,t,n){let r=this;return i;function i(t){return Iz(t)?Vz(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(iB,t,n)(r)}}function sB(e){e.exit(`blockQuote`)}var cB={name:`characterEscape`,tokenize:lB};function lB(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Nz(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var uB={name:`characterReference`,tokenize:dB};function dB(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Oz,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Mz,u):(e.enter(`characterReferenceValue`),a=7,o=jz,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Oz&&!vz(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var fB={partial:!0,tokenize:hB},pB={concrete:!0,name:`codeFenced`,tokenize:mB};function mB(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Iz(t)?Vz(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Pz(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(fB,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Pz(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Iz(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Vz(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Pz(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Pz(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Iz(t)?Vz(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Pz(t)?e.check(fB,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Pz(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Iz(t)?Vz(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Iz(t)?Vz(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Pz(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function hB(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var gB={name:`codeIndented`,tokenize:vB},_B={partial:!0,tokenize:yB};function vB(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Vz(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Pz(t)?e.attempt(_B,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Pz(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function yB(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Pz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Vz(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Pz(e)?i(e):n(e)}}var bB={name:`codeText`,previous:SB,resolve:xB,tokenize:CB};function xB(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function SB(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function CB(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Pz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Pz(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var wB=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&TB(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),TB(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),TB(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);TB(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);TB(this.left,t.reverse())}}}};function TB(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function EB(e){let t={},n=-1,r,i,a,o,s,c,l,u=new wB(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,DB(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return yz(e,0,1/0,u.slice(0)),!l}function DB(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var OB={resolve:AB,tokenize:jB},kB={partial:!0,tokenize:MB};function AB(e){return EB(e),e}function jB(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Pz(t)?e.check(kB,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function MB(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Vz(e,a,`linePrefix`)}function a(i){if(i===null||Pz(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function NB(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Az(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Pz(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Fz(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Az(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function PB(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Pz(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Pz(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Iz(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function FB(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Pz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Vz(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Pz(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function IB(e,t){let n;return r;function r(i){return Pz(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Iz(i)?Vz(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var LB={name:`definition`,tokenize:zB},RB={partial:!0,tokenize:BB};function zB(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return PB.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ez(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Fz(t)?IB(e,l)(t):l(t)}function l(t){return NB(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(RB,d,d)(t)}function d(t){return Iz(t)?Vz(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Pz(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function BB(e,t,n){return r;function r(t){return Fz(t)?IB(e,i)(t):n(t)}function i(t){return FB(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Iz(t)?Vz(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Pz(e)?t(e):n(e)}}var VB={name:`hardBreakEscape`,tokenize:HB};function HB(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Pz(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var UB={name:`headingAtx`,resolve:WB,tokenize:GB};function WB(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},yz(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function GB(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Fz(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Pz(n)?(e.exit(`atxHeading`),t(n)):Iz(n)?Vz(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Fz(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var KB=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),qB=[`pre`,`script`,`style`,`textarea`],JB={concrete:!0,name:`htmlFlow`,resolveTo:ZB,tokenize:QB},YB={partial:!0,tokenize:eV},XB={partial:!0,tokenize:$B};function ZB(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function QB(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):Dz(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Dz(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Dz(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Fz(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&qB.includes(l)?(i=1,r.interrupt?t(s):O(s)):KB.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Oz(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Iz(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Dz(t)?(e.consume(t),b):Iz(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Oz(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Iz(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Iz(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Pz(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Fz(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Iz(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Pz(t)?O(t):Iz(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):Pz(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(YB,R,k)(t)):t===null||Pz(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(XB,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||Pz(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return qB.includes(n)?(e.consume(t),L):O(t)}return Dz(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||Pz(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function $B(e,t,n){let r=this;return i;function i(t){return Pz(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function eV(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(nB,t,n)}}var tV={name:`htmlText`,tokenize:nV};function nV(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Dz(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Dz(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Pz(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Pz(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):Pz(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Pz(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Dz(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Oz(t)?(e.consume(t),S):C(t)}function C(t){return Pz(t)?(o=C,N(t)):Iz(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Oz(t)?(e.consume(t),w):t===47||t===62||Fz(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Dz(t)?(e.consume(t),E):Pz(t)?(o=T,N(t)):Iz(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Oz(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Pz(t)?(o=D,N(t)):Iz(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Pz(t)?(o=O,N(t)):Iz(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):Pz(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Fz(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Fz(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return Iz(t)?Vz(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var rV={name:`labelEnd`,resolveAll:sV,resolveTo:cV,tokenize:lV},iV={tokenize:uV},aV={tokenize:dV},oV={tokenize:fV};function sV(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&yz(e,0,e.length,n),e}function cV(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=bz(s,e.slice(a+1,a+r+3)),s=bz(s,[[`enter`,u,t]]),s=bz(s,Yz(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=bz(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=bz(s,e.slice(o+1)),s=bz(s,[[`exit`,c,t]]),yz(e,a,e.length,s),e}function lV(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Ez(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(iV,u,o?u:d)(t):t===91?e.attempt(aV,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(oV,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function uV(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Fz(t)?IB(e,a)(t):a(t)}function a(t){return t===41?u(t):NB(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Fz(t)?IB(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?FB(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Fz(t)?IB(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function dV(e,t,n){let r=this;return i;function i(t){return PB.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ez(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function fV(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var pV={name:`labelStartImage`,resolveAll:rV.resolveAll,tokenize:mV};function mV(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var hV={name:`labelStartLink`,resolveAll:rV.resolveAll,tokenize:gV};function gV(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var _V={name:`lineEnding`,tokenize:vV};function vV(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Vz(e,t,`linePrefix`)}}var yV={name:`thematicBreak`,tokenize:bV};function bV(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Pz(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Iz(t)?Vz(e,s,`whitespace`)(t):s(t))}}var xV={continuation:{tokenize:TV},exit:DV,name:`list`,tokenize:wV},SV={partial:!0,tokenize:OV},CV={partial:!0,tokenize:EV};function wV(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:jz(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(yV,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return jz(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(nB,r.interrupt?n:u,e.attempt(SV,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Iz(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function TV(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(nB,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Vz(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Iz(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(CV,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Vz(e,e.attempt(xV,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function EV(e,t,n){let r=this;return Vz(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function DV(e){e.exit(this.containerState.type)}function OV(e,t,n){let r=this;return Vz(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Iz(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var kV={name:`setextUnderline`,resolveTo:AV,tokenize:jV};function AV(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function jV(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Iz(t)?Vz(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Pz(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var MV={tokenize:NV};function NV(e){let t=this,n=e.attempt(nB,r,e.attempt(this.parser.constructs.flowInitial,i,Vz(e,e.attempt(this.parser.constructs.flow,i,e.attempt(OB,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var PV={resolveAll:RV()},FV=LV(`string`),IV=LV(`text`);function LV(e){return{resolveAll:RV(e===`text`?zV:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function RV(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function zV(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var BV=s({attentionMarkers:()=>JV,contentInitial:()=>HV,disable:()=>YV,document:()=>VV,flow:()=>WV,flowInitial:()=>UV,insideSpan:()=>qV,string:()=>GV,text:()=>KV}),VV={42:xV,43:xV,45:xV,48:xV,49:xV,50:xV,51:xV,52:xV,53:xV,54:xV,55:xV,56:xV,57:xV,62:iB},HV={91:LB},UV={[-2]:gB,[-1]:gB,32:gB},WV={35:UB,42:yV,45:[kV,yV],60:JB,61:kV,95:yV,96:pB,126:pB},GV={38:uB,92:cB},KV={[-5]:_V,[-4]:_V,[-3]:_V,33:pV,38:uB,42:Xz,60:[eB,tV],91:hV,92:[VB,cB],93:rV,95:Xz,96:bB},qV={null:[Xz,PV]},JV={null:[42,95]},YV={null:[]};function XV(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=bz(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Yz(a,l.events,l),l.events):[]}function f(e,t){return QV(p(e),t)}function p(e){return ZV(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Pz(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&yz(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ZV(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function QV(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
79
+ `;break;case-3:o=`\r
80
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function $V(e){let t={constructs:Sz([BV,...(e||{}).extensions||[]]),content:n(Hz),defined:[],document:n(Wz),flow:n(MV),lazy:{},string:n(FV),text:n(IV)};return t;function n(e){return n;function n(n){return XV(t,e,n)}}}function eH(e){for(;!EB(e););return e}var tH=/[\0\t\n\r]/g;function nH(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(tH.lastIndex=u,c=tH.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var rH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iH(e){return e.replace(rH,aH)}function aH(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Tz(n.slice(t?2:1),t?16:10)}return vz(n)||e}var oH={}.hasOwnProperty;function sH(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),cH(n)(eH($V(n).document().write(nH()(e,t,!0))))}function cH(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(de),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(se),blockQuote:a(ne),characterEscape:T,characterReference:T,codeFenced:a(re),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(re,o),codeText:a(ie,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ae),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(oe),hardBreakEscape:a(ce),hardBreakTrailing:a(ce),htmlFlow:a(le,o),htmlFlowData:T,htmlText:a(le,o),htmlTextData:T,image:a(ue),label:o,link:a(de),listItem:a(pe),listItemValue:f,listOrdered:a(fe,d),listUnordered:a(fe),paragraph:a(me),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(se),strong:a(he),thematicBreak:a(_e)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:U,autolinkProtocol:te,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:B,characterReferenceMarkerNumeric:B,characterReferenceValue:V,characterReference:H,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ee,resourceDestinationString:I,resourceTitleString:L,resource:R,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};uH(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];oH.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||fH).call(a,void 0,e[0])}for(r.position={start:lH(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:lH(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:lH(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||fH).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+jR({start:e.start,end:e.end})+`): it’s not open`);n.position.end=lH(e.end)}function u(){return pz(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ez(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ge(),n.position={start:lH(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=lH(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=lH(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=iH(t),n.identifier=Ez(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function R(){this.data.inReference=void 0}function z(){this.data.referenceType=`collapsed`}function ee(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ez(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function B(e){this.data.characterReferenceType=e.type}function V(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Tz(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=vz(t);let i=this.stack[this.stack.length-1];i.value+=r}function H(e){let t=this.stack.pop();t.position.end=lH(e.end)}function te(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function U(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ne(){return{type:`blockquote`,children:[]}}function re(){return{type:`code`,lang:null,meta:null,value:``}}function ie(){return{type:`inlineCode`,value:``}}function ae(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function oe(){return{type:`emphasis`,children:[]}}function se(){return{type:`heading`,depth:0,children:[]}}function ce(){return{type:`break`}}function le(){return{type:`html`,value:``}}function ue(){return{type:`image`,title:null,url:``,alt:null}}function de(){return{type:`link`,title:null,url:``,children:[]}}function fe(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function pe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function me(){return{type:`paragraph`,children:[]}}function he(){return{type:`strong`,children:[]}}function ge(){return{type:`text`,value:``}}function _e(){return{type:`thematicBreak`}}}function lH(e){return{line:e.line,column:e.column,offset:e.offset}}function uH(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?uH(e,r):dH(e,r)}}function dH(e,t){let n;for(n in t)if(oH.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function fH(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+jR({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jR({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+jR({start:t.start,end:t.end})+`) is still open`)}function pH(e){let t=this;t.parser=n;function n(n){return sH(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function mH(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function hH(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
81
+ `}]}function gH(e,t){let n=t.value?t.value+`
82
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function _H(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vH(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yH(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Bz(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function bH(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xH(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function SH(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function CH(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return SH(e,t);let i={src:Bz(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function wH(e,t){let n={src:Bz(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function TH(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function EH(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return SH(e,t);let i={href:Bz(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function DH(e,t){let n={href:Bz(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function OH(e,t,n){let r=e.all(t),i=n?kH(n):AH(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
83
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
84
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function kH(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=AH(n[r])}return t}function AH(e){return e.spread??e.children.length>1}function jH(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function MH(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NH(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function PH(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FH(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=OR(t.children[1]),o=DR(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function IH(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function LH(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var RH=9,zH=32;function BH(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(VH(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(VH(t.slice(i),i>0,!1)),a.join(``)}function VH(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===RH||t===zH;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===RH||t===zH;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function HH(e,t){let n={type:`text`,value:BH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function UH(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var WH={blockquote:mH,break:hH,code:gH,delete:_H,emphasis:vH,footnoteReference:yH,heading:bH,html:xH,imageReference:CH,image:wH,inlineCode:TH,linkReference:EH,link:DH,listItem:OH,list:jH,paragraph:MH,root:NH,strong:PH,table:FH,tableCell:LH,tableRow:IH,text:HH,thematicBreak:UH,toml:GH,yaml:GH,definition:GH,footnoteDefinition:GH};function GH(){}var KH=typeof self==`object`?self:globalThis,qH=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new KH[e](t)},JH=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(qH(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(qH(a,o),i)};return r},YH=e=>JH(new Map,e)(0),XH=``,{toString:ZH}={},{keys:QH}=Object,$H=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=ZH.call(e).slice(8,-1);switch(n){case`Array`:return[1,XH];case`Object`:return[2,XH];case`Date`:return[3,XH];case`RegExp`:return[4,XH];case`Map`:return[5,XH];case`Set`:return[6,XH];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},eU=([e,t])=>e===0&&(t===`function`||t===`symbol`),tU=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=$H(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of QH(r))(e||!eU($H(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(eU($H(n))||eU($H(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!eU($H(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},nU=(e,{json:t,lossy:n}={})=>{let r=[];return tU(!(t||n),!!t,new Map,r)(e),r},rU=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?YH(nU(e,t)):structuredClone(e):(e,t)=>YH(nU(e,t));function iU(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function aU(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function oU(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||iU,r=e.options.footnoteBackLabel||aU,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Bz(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...rU(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
85
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
86
+ `}]}}var sU=(function(e){if(e==null)return fU;if(typeof e==`function`)return dU(e);if(typeof e==`object`)return Array.isArray(e)?cU(e):lU(e);if(typeof e==`string`)return uU(e);throw Error(`Expected function, string, or object as test`)});function cU(e){let t=[],n=-1;for(;++n<e.length;)t[n]=sU(e[n]);return dU(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function lU(e){let t=e;return dU(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function uU(e){return dU(t);function t(t){return t&&t.type===e}}function dU(e){return t;function t(t,n,r){return!!(pU(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function fU(){return!0}function pU(e){return typeof e==`object`&&!!e&&`type`in e}function mU(e){return e}var hU=[];function gU(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=sU(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+mU(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=hU,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=_U(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function _U(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?hU:[e]}function vU(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),gU(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var yU={}.hasOwnProperty,bU={};function xU(e,t){let n=t||bU,r=new Map,i=new Map,a={all:s,applyData:CU,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...WH,...n.handlers},one:o,options:n,patch:SU,wrap:TU};return vU(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(yU.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=rU(n);return r.children=a.all(e),r}return rU(e)}return(a.options.unknownHandler||wU)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=EU(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=EU(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function SU(e,t){e.position&&(t.position=AR(e))}function CU(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,rU(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function wU(e,t){let n=t.data||{},r=`value`in t&&!(yU.call(n,`hProperties`)||yU.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function TU(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
87
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
88
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
89
+ `}),n}function EU(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function DU(e,t){let n=xU(e,t),r=n.one(e,void 0),i=oU(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
90
+ `},i)),a}function OU(e,t){return e&&`run`in e?async function(n,r){let i=DU(n,{file:r,...t});await e.run(i,r)}:function(n,r){return DU(n,{file:r,...e||t})}}function kU(e){if(e)throw e}var AU=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function jU(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function MU(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?NU(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function NU(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var PU={basename:FU,dirname:IU,extname:LU,join:RU,sep:`/`};function FU(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);VU(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function IU(e){if(VU(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function LU(e){VU(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function RU(...e){let t=-1,n;for(;++t<e.length;)VU(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:zU(n)}function zU(e){VU(e);let t=e.codePointAt(0)===47,n=BU(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function BU(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function VU(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var HU={cwd:UU};function UU(){return`/`}function WU(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function GU(e){if(typeof e==`string`)e=new URL(e);else if(!WU(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return KU(e)}function KU(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var qU=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],JU=class{constructor(e){let t;t=e?WU(e)?{path:e}:typeof e==`string`||QU(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:HU.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<qU.length;){let e=qU[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)qU.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?PU.basename(this.path):void 0}set basename(e){XU(e,`basename`),YU(e,`basename`),this.path=PU.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?PU.dirname(this.path):void 0}set dirname(e){ZU(this.basename,`dirname`),this.path=PU.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?PU.extname(this.path):void 0}set extname(e){if(YU(e,`extname`),ZU(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=PU.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){WU(e)&&(e=GU(e)),XU(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?PU.basename(this.path,this.extname):void 0}set stem(e){XU(e,`stem`),YU(e,`stem`),this.path=PU.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new FR(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function YU(e,t){if(e&&e.includes(PU.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+PU.sep+"`")}function XU(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function ZU(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function QU(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var $U=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),eW=l(AU(),1),tW={}.hasOwnProperty,nW=new class e extends $U{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=MU()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,eW.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(aW(`data`,this.frozen),this.namespace[e]=t,this):tW.call(this.namespace,e)&&this.namespace[e]||void 0:e?(aW(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=cW(e),n=this.parser||this.Parser;return rW(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rW(`process`,this.parser||this.Parser),iW(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=cW(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);uW(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),rW(`processSync`,this.parser||this.Parser),iW(`processSync`,this.compiler||this.Compiler),this.process(e,r),sW(`processSync`,`process`,t),n;function r(e,r){t=!0,kU(e),n=r}}run(e,t,n){oW(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=cW(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),sW(`runSync`,`run`,n),r;function i(e,t){kU(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=cW(t),r=this.compiler||this.Compiler;return iW(`stringify`,r),oW(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(aW(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,eW.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];jU(o)&&jU(r)&&(r=(0,eW.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function rW(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function iW(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function aW(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function oW(e){if(!jU(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function sW(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function cW(e){return lW(e)?e:new JU(e)}function lW(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function uW(e){return typeof e==`string`||dW(e)}function dW(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var fW=[],pW={allowDangerousHtml:!0},mW=/^(https?|ircs?|mailto|xmpp)$/i,hW=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function gW(e){let t=_W(e),n=vW(e);return yW(t.runSync(t.parse(n),n),e)}function _W(e){let t=e.rehypePlugins||fW,n=e.remarkPlugins||fW,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...pW}:pW;return nW().use(pH).use(n).use(OU,r).use(t)}function vW(e){let t=e.children||``,n=new JU;return typeof t==`string`?n.value=t:``+t,n}function yW(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||bW;for(let e of hW)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return vU(e,l),UR(e,{Fragment:W.Fragment,components:i,ignoreInvalidStyle:!0,jsx:W.jsx,jsxs:W.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in dz)if(Object.hasOwn(dz,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=dz[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function bW(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||mW.test(e.slice(0,t))?e:``}function xW(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function SW(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function CW(e,t,n){let r=sU((n||{}).ignore||[]),i=wW(t),a=-1;for(;++a<i.length;)gU(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function wW(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([TW(e[0]),EW(e[1])])}return t}function TW(e){return typeof e==`string`?new RegExp(SW(e),`g`):e}function EW(e){return typeof e==`function`?e:function(){return e}}var DW=`phrasing`,OW=[`autolink`,`link`,`image`,`label`];function kW(){return{transforms:[LW],enter:{literalAutolink:jW,literalAutolinkEmail:MW,literalAutolinkHttp:MW,literalAutolinkWww:MW},exit:{literalAutolink:IW,literalAutolinkEmail:FW,literalAutolinkHttp:NW,literalAutolinkWww:PW}}}function AW(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:DW,notInConstruct:OW},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:DW,notInConstruct:OW},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:DW,notInConstruct:OW}]}}function jW(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function MW(e){this.config.enter.autolinkProtocol.call(this,e)}function NW(e){this.config.exit.autolinkProtocol.call(this,e)}function PW(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function FW(e){this.config.exit.autolinkEmail.call(this,e)}function IW(e){this.exit(e)}function LW(e){CW(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,RW],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,zW]],{ignore:[`link`,`linkReference`]})}function RW(e,t,n,r,i){let a=``;if(!HW(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!BW(n)))return!1;let o=VW(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function zW(e,t,n,r){return!HW(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function BW(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function VW(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=xW(e,`(`),a=xW(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function HW(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Rz(n)||Lz(n))&&(!t||n!==47)}QW.peek=ZW;function UW(){this.buffer()}function WW(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function GW(){this.buffer()}function KW(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function qW(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ez(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JW(e){this.exit(e)}function YW(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ez(this.sliceSerialize(e)).toLowerCase(),n.label=t}function XW(e){this.exit(e)}function ZW(){return`[`}function QW(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function $W(){return{enter:{gfmFootnoteCallString:UW,gfmFootnoteCall:WW,gfmFootnoteDefinitionLabelString:GW,gfmFootnoteDefinition:KW},exit:{gfmFootnoteCallString:qW,gfmFootnoteCall:JW,gfmFootnoteDefinitionLabelString:YW,gfmFootnoteDefinition:XW}}}function eG(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:QW},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
91
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?nG:tG))),s(),o}}function tG(e,t,n){return t===0?e:nG(e,t,n)}function nG(e,t,n){return(n?``:` `)+e}var rG=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];cG.peek=lG;function iG(){return{canContainEols:[`delete`],enter:{strikethrough:oG},exit:{strikethrough:sG}}}function aG(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:rG}],handlers:{delete:cG}}}function oG(e){this.enter({type:`delete`,children:[]},e)}function sG(e){this.exit(e)}function cG(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function lG(){return`~`}function uG(e){return e.length}function dG(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||uG,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=fG(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=pG(r[d]);else{let e=pG(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
92
+ `)}function fG(e){return e==null?``:String(e)}function pG(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function mG(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),hG);return i(),o}function hG(e,t,n){return`>`+(n?``:` `)+e}function gG(e,t){return _G(e,t.inConstruct,!0)&&!_G(e,t.notInConstruct,!1)}function _G(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function vG(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
93
+ `&&gG(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
94
+ `}function yG(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function bG(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function xG(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function SG(e,t,n,r){let i=xG(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(bG(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,CG);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(yG(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
95
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
96
+ `),a&&(u+=s.move(a+`
97
+ `)),u+=s.move(c),l(),u}function CG(e,t,n){return(n?``:` `)+e}function wG(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function TG(e,t,n,r){let i=wG(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
98
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function EG(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function DG(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function OG(e,t,n){let r=Jz(e),i=Jz(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kG.peek=AG;function kG(e,t,n,r){let i=EG(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=OG(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=DG(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=OG(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+DG(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function AG(e,t,n){return n.options.emphasis||`*`}function jG(e,t){let n=!1;return vU(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&pz(e)&&(t.options.setext||n))}function MG(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(jG(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
99
+ `,after:`
100
+ `});return r(),t(),o+`
101
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
102
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
103
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=DG(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}NG.peek=PG;function NG(e){return e.value||``}function PG(){return`<`}FG.peek=IG;function FG(e,t,n,r){let i=wG(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function IG(){return`!`}LG.peek=RG;function LG(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function RG(){return`!`}zG.peek=BG;function zG(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function BG(){return"`"}function VG(e,t){let n=pz(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}HG.peek=UG;function HG(e,t,n,r){let i=wG(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(VG(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function UG(e,t,n){return VG(e,n)?`<`:`[`}WG.peek=GG;function WG(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function GG(){return`[`}function KG(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function qG(e){let t=KG(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function JG(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function YG(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function XG(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?JG(n):KG(n),s=e.ordered?o===`.`?`)`:`.`:qG(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),YG(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function ZG(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function QG(e,t,n,r){let i=ZG(n),a=n.bulletCurrent||KG(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function $G(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var eK=sU([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function tK(e,t,n,r){return(e.children.some(function(e){return eK(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nK(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rK.peek=iK;function rK(e,t,n,r){let i=nK(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=OG(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=DG(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=OG(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+DG(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function iK(e,t,n){return n.options.strong||`*`}function aK(e,t,n,r){return n.safe(e.value,r)}function oK(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sK(e,t,n){let r=(YG(n)+(n.options.ruleSpaces?` `:``)).repeat(oK(n));return n.options.ruleSpaces?r.slice(0,-1):r}var cK={blockquote:mG,break:vG,code:SG,definition:TG,emphasis:kG,hardBreak:vG,heading:MG,html:NG,image:FG,imageReference:LG,inlineCode:zG,link:HG,linkReference:WG,list:XG,listItem:QG,paragraph:$G,root:tK,strong:rK,text:aK,thematicBreak:sK};function lK(){return{enter:{table:uK,tableData:mK,tableHeader:mK,tableRow:fK},exit:{codeText:hK,table:dK,tableData:pK,tableHeader:pK,tableRow:pK}}}function uK(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function dK(e){this.exit(e),this.data.inTable=void 0}function fK(e){this.enter({type:`tableRow`,children:[]},e)}function pK(e){this.exit(e)}function mK(e){this.enter({type:`tableCell`,children:[]},e)}function hK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gK));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gK(e,t){return t===`|`?t:e}function _K(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
104
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
105
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return dG(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=cK.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function vK(){return{exit:{taskListCheckValueChecked:bK,taskListCheckValueUnchecked:bK,paragraph:xK}}}function yK(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:SK}}}function bK(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function xK(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function SK(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=cK.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function CK(){return[kW(),$W(),iG(),lK(),vK()]}function wK(e){return{extensions:[AW(),eG(e),aG(),_K(e),yK()]}}var TK={tokenize:zK,partial:!0},EK={tokenize:BK,partial:!0},DK={tokenize:VK,partial:!0},OK={tokenize:HK,partial:!0},kK={tokenize:UK,partial:!0},AK={name:`wwwAutolink`,tokenize:LK,previous:WK},jK={name:`protocolAutolink`,tokenize:RK,previous:GK},MK={name:`emailAutolink`,tokenize:IK,previous:KK},NK={};function PK(){return{text:NK}}for(var FK=48;FK<123;)NK[FK]=MK,FK++,FK===58?FK=65:FK===91&&(FK=97);NK[43]=MK,NK[45]=MK,NK[46]=MK,NK[95]=MK,NK[72]=[MK,jK],NK[104]=[MK,jK],NK[87]=[MK,AK],NK[119]=[MK,AK];function IK(e,t,n){let r=this,i,a;return o;function o(t){return!qK(t)||!KK.call(r,r.previous)||JK(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return qK(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(kK,u,l)(t):t===45||t===95||Oz(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Dz(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function LK(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!WK.call(r,r.previous)||JK(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(TK,e.attempt(EK,e.attempt(DK,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function RK(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&GK.call(r,r.previous)&&!JK(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Dz(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Az(t)||Fz(t)||Rz(t)||Lz(t)?n(t):e.attempt(EK,e.attempt(DK,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function zK(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function BK(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(OK,c,s)(t):t===null||Fz(t)||Rz(t)||t!==45&&Lz(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function VK(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(OK,t,a)(o):o===null||Fz(o)||Rz(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function HK(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Fz(o)||Rz(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Fz(e)||Rz(e)?t(e):r(e)}function a(e){return Dz(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Dz(t)?(e.consume(t),o):n(t)}}function UK(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Oz(e)?n(e):t(e)}}function WK(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Fz(e)}function GK(e){return!Dz(e)}function KK(e){return!(e===47||qK(e))}function qK(e){return e===43||e===45||e===46||e===95||Oz(e)}function JK(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var YK={tokenize:rq,partial:!0};function XK(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:eq,continuation:{tokenize:tq},exit:nq}},text:{91:{name:`gfmFootnoteCall`,tokenize:$K},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:ZK,resolveTo:QK}}}}function ZK(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Ez(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function QK(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function $K(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Fz(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Ez(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Fz(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function eq(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Fz(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Ez(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Fz(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Vz(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function tq(e,t,n){return e.check(nB,t,e.attempt(YK,t,n))}function nq(e){e.exit(`gfmFootnoteDefinition`)}function rq(e,t,n){let r=this;return Vz(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function iq(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&yz(o,o.length,0,Yz(s,e.slice(r+1,n),t)),yz(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),yz(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Jz(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Jz(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var aq=class{constructor(){this.map=[]}add(e,t,n){oq(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function oq(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function sq(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function cq(){return{flow:{null:{name:`table`,tokenize:lq,resolveAll:uq}}}}function lq(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Pz(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Iz(t)?Vz(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Fz(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Iz(t)?Vz(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Iz(t)?Vz(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Pz(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Iz(t)?Vz(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Pz(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Pz(n)?(e.exit(`tableRow`),t(n)):Iz(n)?Vz(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Fz(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function uq(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new aq;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(fq(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=dq(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=dq(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=dq(f,t,o,i,n,d)):(o[0]=o[1],d=dq(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&fq(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=sq(t.events,n))}return e}function dq(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},pq(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=pq(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=pq(t.events,n[2]),a=pq(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},pq(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function fq(e,t,n,r,i){let a=[],o=pq(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function pq(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var mq={name:`tasklistCheck`,tokenize:gq};function hq(){return{text:{91:mq}}}function gq(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Fz(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Pz(r)?t(r):Iz(r)?e.check({tokenize:_q},t,n)(r):n(r)}}function _q(e,t,n){return Vz(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function vq(e){return Sz([PK(),XK(),iq(e),cq(),hq()])}var yq={};function bq(e){let t=this,n=e||yq,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(vq(n)),a.push(CK()),o.push(wK(n))}function xq(e){let t=e.split(`
106
+ `),n;for(let e=0;e<t.length;e+=1){let r=t[e],i=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(r);if(!i)continue;let a=i[1],o=i[2];if(n)a[0]===n.character&&a.length>=n.length&&/^\s*$/.test(o)&&(n=void 0);else if(a[0]!=="`"||!o.includes("`")){if(e===t.length-1)return t.slice(0,-1).join(`
107
+ `);n={character:a[0],length:a.length}}}return e}function Sq(e){let t=``;return S.Children.forEach(e,e=>{typeof e==`string`||typeof e==`number`?t+=e:(0,S.isValidElement)(e)&&(t+=Sq(e.props.children))}),t}function Cq({children:e}){let[t,n]=(0,S.useState)(`idle`),r=(0,S.useRef)(void 0);(0,S.useEffect)(()=>()=>clearTimeout(r.current),[]);let i=async()=>{clearTimeout(r.current);try{await navigator.clipboard.writeText(Sq(e)),n(`copied`),r.current=window.setTimeout(()=>n(`idle`),1800)}catch{n(`failed`)}};return(0,W.jsxs)(`div`,{className:`my-3 overflow-hidden rounded-md border border-border bg-muted/30`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border bg-muted/40 px-3 py-1 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Code`}),(0,W.jsxs)(J,{type:`button`,variant:`outline`,size:`xs`,className:t===`copied`?`text-primary-text`:void 0,onClick:()=>void i(),"aria-label":t===`failed`?`Copy failed; try again`:`Copy code`,children:[t===`copied`?(0,W.jsx)(ua,{}):(0,W.jsx)(Sa,{}),(0,W.jsx)(`span`,{"aria-live":`polite`,children:t===`copied`?`Copied`:t===`failed`?`Copy failed`:`Copy`})]})]}),t===`failed`&&(0,W.jsx)(`p`,{role:`alert`,className:`px-3 py-2 text-xs text-destructive`,children:`Could not copy code. Select the code below to copy it manually, or try again.`}),(0,W.jsx)(`pre`,{className:`m-0 overflow-x-auto whitespace-pre p-3 font-mono text-xs leading-relaxed text-foreground select-text [&_code]:bg-transparent [&_code]:p-0 [&_code]:text-inherit`,children:e})]})}function wq({href:e,children:t}){let n;try{if(e&&/^https:\/\//i.test(e)){let t=new URL(e);t.protocol===`https:`&&!t.username&&!t.password&&(n=t.href)}}catch{}return n?(0,W.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary-text underline-offset-4 hover:underline focus-visible:rounded-sm focus-visible:outline-2 focus-visible:outline-ring`,children:t}):(0,W.jsx)(`span`,{children:t})}var Tq={img:({alt:e})=>(0,W.jsx)(`span`,{children:e?`[Image: ${e}]`:`[Image]`}),a:({href:e,children:t})=>(0,W.jsx)(wq,{href:e,children:t}),pre:({children:e})=>(0,W.jsx)(Cq,{children:e}),code:({children:e,className:t})=>(0,W.jsx)(`code`,{className:`rounded-sm bg-muted px-1 py-0.5 font-mono text-[0.85em] ${t??``}`,children:e}),table:({children:e})=>(0,W.jsx)(`div`,{className:`my-2 overflow-x-auto`,children:(0,W.jsx)(`table`,{className:`w-full border-collapse text-sm [&_td]:border [&_td]:border-border [&_td]:px-2.5 [&_td]:py-1.5 [&_td]:text-left [&_th]:border [&_th]:border-border [&_th]:bg-muted/40 [&_th]:px-2.5 [&_th]:py-1.5 [&_th]:text-left [&_th]:font-medium`,children:e})})},Eq=[bq],Dq=(0,S.memo)(function({text:e,streaming:t=!1}){return(0,W.jsx)(`div`,{"data-streaming":t||void 0,className:`console-markdown min-w-0 break-words text-sm leading-relaxed text-foreground [&_p]:my-1.5 [&_p:first-child]:mt-0 [&_p:last-child]:mb-0 [&_ul]:my-1.5 [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:my-1.5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:my-0.5 [&_blockquote]:my-2 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:px-3 [&_blockquote]:py-1 [&_blockquote]:text-muted-foreground [&_h1]:my-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h2]:my-3 [&_h2]:text-lg [&_h2]:font-semibold [&_h3]:my-2 [&_h3]:text-base [&_h3]:font-semibold [&_h4]:my-2 [&_h4]:font-semibold [&_h5]:my-2 [&_h5]:font-semibold [&_h6]:my-2 [&_h6]:font-semibold [&_hr]:my-4 [&_hr]:border-border`,children:(0,W.jsx)(gW,{remarkPlugins:Eq,components:Tq,skipHtml:!0,children:t?xq(e):e})})});function Oq(e,t){let n=Math.max(0,Math.min(e.length,t)),r=/(?:^|\s)@([^\s@]*)$/.exec(e.slice(0,n)),i=/^[^\s@]*/.exec(e.slice(n))?.[0]??``;return r?{start:n-r[1].length-1,end:n+i.length,query:r[1]}:null}function kq({draft:e,caret:t,onSelect:n}){let r=(0,S.useId)(),i=Oq(e,t),a=i?`${i.start}:${i.end}:${i.query}`:``,[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)({key:``,index:0}),u=!!i&&o!==a,d=ni({queryKey:[`console-plugins`],queryFn:({signal:e})=>G(`/api/console/plugins`,{signal:e}),enabled:u,staleTime:1e4}),f=(d.data?.items??[]).filter(e=>e.kind===`plugin`&&e.state===`enabled`&&e.loaded&&!e.error&&`${e.name} ${e.id}`.toLowerCase().includes(i?.query.toLowerCase()??``)),p=Math.min(c.key===a?c.index:0,Math.max(0,f.length-1));function m(e){i&&(n(e,{start:i.start,end:i.end,text:`@${e.id} `}),s(a))}function h(e){return u?e.key===`Escape`?(e.preventDefault(),s(a),!0):(e.key===`ArrowDown`||e.key===`ArrowUp`)&&f.length?(e.preventDefault(),l({key:a,index:(p+(e.key===`ArrowDown`?1:-1)+f.length)%f.length}),!0):(e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey&&!e.nativeEvent.isComposing&&f[p]?(e.preventDefault(),m(f[p]),!0):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),!0):!1}return{open:u,items:f,index:p,select:m,onKeyDown:h,id:r,loading:d.isPending,error:d.error,textareaProps:{"aria-controls":u?r:void 0,"aria-autocomplete":`list`,"aria-activedescendant":u&&f[p]?`${r}-${p}`:void 0}}}function Aq({open:e,children:t,className:n=``,label:r}){let[i,a]=(0,S.useState)(e),o=(0,S.useRef)(null);return(0,S.useEffect)(()=>{e&&a(!0)},[e]),(0,S.useLayoutEffect)(()=>{let t=o.current;if(!t)return;if(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||t.closest(`[data-reduced-motion="true"]`)){e||a(!1);return}let n=t.animate(e?[{opacity:0,transform:`translateY(4px) scale(.99)`},{opacity:1,transform:`translateY(0) scale(1)`}]:[{opacity:1},{opacity:0}],{duration:e?150:100,easing:`ease-out`,fill:`both`});return n.onfinish=()=>{e||a(!1)},()=>n.cancel()},[e,i]),i?(0,W.jsx)(`div`,{ref:o,"aria-label":r,"aria-hidden":!e,inert:!e||void 0,className:`absolute bottom-full left-0 z-30 mb-2 rounded-2xl bg-popover p-2 font-sans shadow-lg ${e?``:`pointer-events-none`} ${n}`,children:t}):null}function jq({picker:e}){return(0,S.useEffect)(()=>{e.open&&document.getElementById(`${e.id}-${e.index}`)?.scrollIntoView({block:`nearest`})},[e.id,e.index,e.open]),(0,W.jsxs)(Aq,{open:e.open,label:`Plugins`,className:`w-full max-w-sm`,children:[(0,W.jsx)(`div`,{id:e.id,role:`listbox`,"aria-label":`Available plugins`,className:`max-h-[280px] overflow-y-auto overscroll-contain`,children:e.items.map((t,n)=>(0,W.jsxs)(`button`,{id:`${e.id}-${n}`,type:`button`,role:`option`,"aria-selected":n===e.index,onMouseDown:e=>e.preventDefault(),onClick:()=>e.select(t),className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors duration-100 motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-primary ${n===e.index?`bg-muted`:`hover:bg-muted/60`}`,children:[(0,W.jsx)(no,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,W.jsxs)(`span`,{className:`min-w-0`,children:[(0,W.jsx)(`span`,{className:`block truncate font-medium`,children:t.name}),t.description&&(0,W.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:t.description})]})]},t.id))}),e.items.length===0&&(0,W.jsx)(`p`,{role:`status`,className:`px-3 py-3 text-sm text-muted-foreground`,children:e.loading?`Loading plugins…`:e.error?`Couldn't load plugins.`:`No matching plugins.`}),(0,W.jsx)(vn,{to:`/plugins`,className:`mt-1 block rounded-md px-3 py-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground`,children:`Manage plugins`})]})}var Mq={selectedLabels:[],customText:``},Nq=8e3,Pq={tool:{label:`Tool use`,action:`Allow`,explanation:`Allow this one tool action.`,icon:No},scope:{label:`New targets`,action:`Allow targets`,explanation:`Let 0 reach these network targets in this conversation.`,icon:Ra},"local-scope":{label:`Folder access`,action:`Allow folder`,explanation:`Let 0 access this folder and everything in it for this conversation.`,icon:ka},"audit-escalation":{label:`Beyond code review`,action:`Allow`,explanation:`Let 0 use tools beyond reviewing your local code in this conversation. Other limits still apply.`,icon:yo},"operator-question":{label:`Question`,action:`Send answers`,explanation:`Answering doesn't grant any permissions.`,icon:Xa}};function Fq(e,t){if(t.selectedLabels.some(t=>!e.options?.some(e=>e.label===t)))return`Choose an available option.`;if(!e.multiSelect&&t.selectedLabels.length>1)return`Choose only one option.`;if(t.customText.length>Nq)return`Keep your answer under 8,000 characters.`;if(!e.allowCustom&&t.customText.trim())return`Pick one of the options.`;if(!t.selectedLabels.length&&!(e.allowCustom&&t.customText.trim()))return e.allowCustom?`Choose an option or type an answer.`:`Choose an option.`}function Iq({label:e,value:t}){return(0,W.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,W.jsx)(`h4`,{className:`text-xs font-semibold text-muted-foreground`,children:e}),(0,W.jsx)(`pre`,{className:`whitespace-pre-wrap break-all rounded-xl bg-muted/40 p-3 font-mono text-xs text-foreground`,children:typeof t==`string`?t:JSON.stringify(t,null,2)??String(t)})]})}function Lq({question:e,index:t,id:n,answer:r,disabled:i,error:a,onChange:o}){let s=`${n}-description`,c=`${n}-hint`,l=`${n}-error`;return(0,W.jsxs)(`fieldset`,{"data-question-index":t,disabled:i,tabIndex:-1,"aria-describedby":`${s} ${c}${a?` ${l}`:``}`,"aria-invalid":!!a,className:`min-w-0 space-y-3 rounded-2xl bg-muted/20 p-4 disabled:opacity-60`,children:[(0,W.jsx)(`legend`,{className:`px-1 text-sm font-semibold`,children:e.header}),(0,W.jsx)(`p`,{id:s,className:`whitespace-pre-wrap break-words text-sm`,children:e.question}),(0,W.jsxs)(`p`,{id:c,className:`text-xs text-muted-foreground`,children:[e.options?.length?e.multiSelect?`Choose one or more.`:`Choose one.`:e.allowCustom?`Type your answer.`:``,e.options?.length&&e.allowCustom?` Or type your own answer.`:``]}),e.options?.map((t,s)=>{let c=`${n}-option-${s}`,u=`${c}-description`,d=r.selectedLabels.includes(t.label);return(0,W.jsxs)(`label`,{htmlFor:c,className:`flex items-start gap-3 rounded-xl bg-muted/30 p-3 transition-colors hover:bg-muted/60 has-[:checked]:bg-primary/10 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/40`,children:[(0,W.jsx)(`input`,{id:c,name:`${n}-options`,type:e.multiSelect?`checkbox`:`radio`,value:t.label,checked:d,disabled:i,"aria-invalid":!!a,"aria-describedby":[t.description?u:``,a?l:``].filter(Boolean).join(` `)||void 0,className:`mt-0.5 size-4 shrink-0 accent-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,onChange:n=>o({...r,selectedLabels:e.multiSelect?n.target.checked?[...r.selectedLabels,t.label]:r.selectedLabels.filter(e=>e!==t.label):[t.label]})}),(0,W.jsxs)(`span`,{className:`min-w-0 space-y-1`,children:[(0,W.jsx)(`span`,{className:`block whitespace-pre-wrap break-words text-sm font-medium`,children:t.label}),t.description&&(0,W.jsx)(`span`,{id:u,className:`block whitespace-pre-wrap break-words text-xs text-muted-foreground`,children:t.description})]})]},s)}),e.allowCustom&&!e.multiSelect&&r.selectedLabels.length>0&&(0,W.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,disabled:i,onClick:()=>o({...r,selectedLabels:[]}),children:`Clear choice`}),e.allowCustom&&(0,W.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,W.jsx)(`label`,{htmlFor:`${n}-custom`,className:`text-sm font-medium`,children:`Your answer`}),(0,W.jsx)(ev,{id:`${n}-custom`,name:`${n}-custom`,value:r.customText,maxLength:Nq,rows:3,disabled:i,"aria-invalid":!!a,"aria-describedby":`${n}-limit${a?` ${l}`:``}`,onChange:e=>o({...r,customText:e.target.value})}),(0,W.jsxs)(`p`,{id:`${n}-limit`,hidden:r.customText.length<7e3,className:`text-xs text-muted-foreground`,children:[r.customText.length.toLocaleString(),` / 8,000 characters`]})]}),!e.options?.length&&!e.allowCustom&&(0,W.jsx)(`p`,{className:`text-sm text-destructive`,children:`No options to choose from. You can decline.`}),a&&(0,W.jsx)(`p`,{id:l,className:`text-sm text-destructive`,role:`alert`,children:a})]})}function Rq({decision:e,busy:t,onResolve:n}){let r=(0,S.useId)(),[i,a]=(0,S.useState)({}),[o,s]=(0,S.useState)(!1),c=Pq[e.kind],l=c.icon,u=e.questions??[],d=t||!!e.resolved,f=e.context,p=e.approved===void 0?`Closed`:e.approved?`Approved`:`Declined`;function m(e){if(e.preventDefault(),d)return;s(!0);let t=u.findIndex((e,t)=>Fq(e,i[t]??Mq));if(t!==-1){let n=e.currentTarget.querySelector(`[data-question-index="${t}"]`);(n?.querySelector(`input, textarea`)??n)?.focus();return}let r={approve:!0};u.length&&(r.answers=u.map((e,t)=>{let n=i[t]??Mq,r={header:e.header};n.selectedLabels.length&&(r.selectedLabels=[...n.selectedLabels]);let a=n.customText.trim();return e.allowCustom&&a&&(r.customText=a),r})),n(r)}return(0,W.jsxs)(`form`,{noValidate:!0,autoComplete:`off`,"aria-labelledby":`${r}-title`,"aria-busy":t&&!e.resolved,onSubmit:m,className:`space-y-4 rounded-2xl bg-card p-5 text-card-foreground`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,W.jsx)(l,{className:`mt-0.5 size-4 shrink-0 text-primary-text`,"aria-hidden":`true`}),(0,W.jsx)(`h3`,{id:`${r}-title`,className:`min-w-0 flex-1 break-words text-sm font-semibold`,children:e.title}),e.resolved&&(0,W.jsx)(I_,{variant:e.approved===void 0?`neutral`:e.approved?`success`:`danger`,children:p})]}),(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c.explanation}),e.kind!==`tool`&&e.detail&&(0,W.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-sm`,children:e.detail}),e.reason&&(0,W.jsx)(Iq,{label:`Why`,value:e.reason}),e.call&&(0,W.jsxs)(`div`,{className:`space-y-2 rounded-xl bg-muted/20 p-3`,children:[(0,W.jsx)(Iq,{label:`Tool`,value:e.call.name}),(0,W.jsx)(Iq,{label:`Input`,value:e.call.arguments})]}),e.requestedUrls&&e.requestedUrls.length>0&&(0,W.jsx)(Iq,{label:`Targets to allow`,value:e.requestedUrls}),e.unresolvedTargets&&e.unresolvedTargets.length>0&&(0,W.jsx)(Iq,{label:`Unknown destinations`,value:e.unresolvedTargets}),e.requestedPath&&(0,W.jsx)(Iq,{label:`Folder to allow`,value:e.requestedPath}),(f||e.currentScope!==void 0||e.currentScopePath!==void 0)&&(0,W.jsxs)(`details`,{"aria-label":`Current permissions`,className:`space-y-3 rounded-xl bg-muted/20 p-3`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-sm text-muted-foreground`,children:`Current permissions`}),f&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`dl`,{className:`mt-3 grid gap-2 text-sm sm:grid-cols-[max-content_minmax(0,1fr)]`,children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Target`}),(0,W.jsx)(`dd`,{className:`whitespace-pre-wrap break-all`,children:f.target}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Role`}),(0,W.jsx)(`dd`,{children:f.role}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Mode`}),(0,W.jsx)(`dd`,{children:f.autonomyMode})]}),f.localScopePath&&f.localScopePath!==e.currentScopePath&&(0,W.jsx)(Iq,{label:`Allowed folder`,value:f.localScopePath})]}),e.currentScope!==void 0&&(0,W.jsx)(Iq,{label:`Allowed targets`,value:e.currentScope??`None set.`}),e.currentScopePath!==void 0&&(0,W.jsx)(Iq,{label:`Allowed folder`,value:e.currentScopePath})]}),u.length>0&&(0,W.jsx)(`div`,{className:`space-y-3`,children:u.map((t,n)=>(0,W.jsx)(Lq,{question:t,index:n,id:`${r}-question-${n}`,answer:i[n]??Mq,disabled:d,error:o&&!e.resolved?Fq(t,i[n]??Mq):void 0,onChange:e=>a(t=>({...t,[n]:e}))},n))}),(0,W.jsx)(`p`,{role:`status`,className:`sr-only`,children:e.resolved?`${p}.`:t?`Please wait…`:`Waiting for you.`}),!e.resolved&&(0,W.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,W.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>{d||n({approve:!1})},children:`Decline`}),(0,W.jsx)(J,{type:`submit`,disabled:t,children:t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(RI,{}),`Please wait…`]}):c.action})]})]})}function zq(e){return(0,W.jsx)(Rq,{...e},e.decision.id)}function Bq({icon:e,title:t,status:n,running:r=!1,failed:i=!1,children:a}){let[o,s]=(0,S.useState)(!1),c=(0,S.useId)();return(0,W.jsxs)(`section`,{className:`console-tool-row`,"data-running":r||void 0,"data-expanded":o||void 0,children:[(0,W.jsxs)(`button`,{type:`button`,id:`${c}-trigger`,className:`console-tool-trigger`,"aria-expanded":o,"aria-controls":`${c}-details`,onClick:()=>s(e=>!e),children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`console-tool-icon`,children:e}),(0,W.jsx)(`span`,{className:`console-tool-title`,children:t}),n&&(0,W.jsx)(`span`,{className:`console-tool-status${i?` console-tool-status-error`:``}`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:n}),(0,W.jsx)(da,{"aria-hidden":`true`,className:`console-tool-chevron`})]}),(0,W.jsx)(`div`,{id:`${c}-details`,className:`console-tool-reveal`,"aria-labelledby":`${c}-trigger`,"aria-hidden":!o,inert:!o,children:(0,W.jsx)(`div`,{className:`console-tool-reveal-inner`,children:(0,W.jsx)(`div`,{className:`console-tool-details`,children:a})})})]})}var Vq=new Set([`Tool call cancelled before dispatch.`,`Tool call cancelled by operator before dispatch.`]);function Hq(e){if(e.isRunning)return`Running`;if(e.result===void 0)return`Stopped`;if(e.result&&typeof e.result==`object`){let t=e.result;if(t.success===!1||t.is_error===!0){let e=t.success===!1?t.error:t.content;return typeof e==`string`&&Vq.has(e)?`Stopped`:`Error`}}return`Done`}function Uq(e,t,n){return{id:e,user:{text:t,sequence:n},assistantText:``,reasoningText:``,toolCalls:[],decisions:[],notices:[],isComplete:!1,isWorking:!1}}function Wq(e){e.isComplete=!0,e.isWorking=!1;for(let t of e.decisions)t.resolved=!0;for(let t of e.toolCalls)t.isRunning=!1}function Gq(e,t){e.assistantText=t.assistantText,e.budget=t.budget,e.stopReason=t.stopReason,e.outputCap=t.outputCap,t.error!==void 0&&(e.error=t.error),t.usage&&(e.usage={...t.usage,turnTokensUsed:t.budget.tokensUsed,turnTokenBudget:t.budget.tokenBudget,iterations:t.budget.iterations,maxToolIterations:t.budget.maxToolIterations}),Wq(e)}function Kq(e,t){let n=t===`working`||t===`waiting`;for(let r=0;r<e.length;r++){let i=e[r];if(r!==e.length-1||!n||i.isComplete){if(t!==void 0||r!==e.length-1||i.isComplete)Wq(i);else{i.isWorking=!1;for(let e of i.toolCalls)e.isRunning=!1}}else i.isWorking=!0}}function qq(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n].toolCalls.find(e=>e.id===t);if(r)return r}}function Jq(e,t){let n=[],r,i,a=e=>(r||(r=Uq(`leading-${e}`,``,e),n.push(r)),r);for(let t of e)switch(t.type){case`session`:i=t.session.status;break;case`snapshot`:n=Xq(t.snapshot),r=n[n.length-1],i=t.snapshot.session.status;break;case`clear`:n=[],r=void 0;break;case`user`:r&&!r.isComplete&&Wq(r),r=Uq(`turn-${t.sequence}`,t.text,t.sequence),n.push(r);break;case`assistant-delta`:{let e=a(t.sequence);e.isComplete||(e.assistantText+=t.text);break}case`reasoning-delta`:a(t.sequence).reasoningText+=t.text;break;case`tool-start`:{let e=a(t.sequence),n=t.call.id??`tool-${t.sequence}`,r=e.toolCalls.find(e=>e.id===n);r?(r.name=t.call.name,r.arguments=t.call.arguments):e.toolCalls.push({id:n,name:t.call.name,arguments:t.call.arguments,isRunning:!0});break}case`tool-result`:{let e=a(t.sequence),r=t.call.id?qq(n,t.call.id):e.toolCalls.find(e=>e.name===t.call.name&&e.isRunning);r?(r.result=t.result,r.isRunning=!1):e.toolCalls.push({id:t.call.id??`tool-${t.sequence}`,name:t.call.name,arguments:t.call.arguments,result:t.result,isRunning:!1});break}case`usage`:a(t.sequence).usage=t.usage;break;case`notice`:a(t.sequence).notices.push(t.text);break;case`decision`:{let e=a(t.sequence),n=e.decisions.find(e=>e.id===t.decision.id);n?Object.assign(n,t.decision):e.decisions.push({...t.decision,resolved:!1});break}case`decision-resolved`:for(let e=n.length-1;e>=0;e--){let r=n[e].decisions.find(e=>e.id===t.decisionId);if(r){r.resolved=!0,r.approved=t.approved;break}}break;case`turn-complete`:Gq(a(t.sequence),t);break;case`error`:{let e=a(t.sequence);e.error===void 0&&(e.error=t.message);break}}return Kq(n,t??i),n}function Yq(e,t){if(!t||e.startsWith(t)||e.endsWith(t))return e;if(!e||t.startsWith(e))return t;let n=new Uint32Array(t.length);for(let e=1,r=0;e<t.length;e++){for(;r>0&&t[e]!==t[r];)r=n[r-1];t[e]===t[r]&&r++,n[e]=r}let r=0;for(let i=0;i<e.length;i++){for(;r>0&&(r===t.length||e[i]!==t[r]);)r=n[r-1];e[i]===t[r]&&r++}return e+t.slice(r)}function Xq(e){let t=[],n,r=e=>(n||(n=Uq(`leading-message-${e}`,``,e),t.push(n)),n);for(let i=0;i<e.messages.length;i++){let a=e.messages[i],o=``,s=!1;for(let e of a.content)e.type===`text`&&(s=!0,o+=e.text);a.role===`user`&&s?(n&&Wq(n),n=Uq(`message-${i}`,o,i),t.push(n)):a.role===`assistant`&&s&&(r(i).assistantText+=o);for(let e of a.content)if(e.type===`tool_use`){let t=r(i),n=t.toolCalls.find(t=>t.id===e.id);n?(n.name=e.name,n.arguments=e.input):t.toolCalls.push({id:e.id,name:e.name,arguments:e.input,isRunning:!0})}else if(e.type===`tool_result`){let n=e.is_error?{content:e.content,is_error:!0}:e.content,a=qq(t,e.tool_use_id);a?(a.result=n,a.isRunning=!1):r(i).toolCalls.push({id:e.tool_use_id,name:e.tool_use_id,arguments:null,result:n,isRunning:!1})}}let i=Jq(e.events,e.session.status);if(t.length===0)t.push(...i);else{let e=new Map,n=new Map;for(let e of t)for(let t of e.toolCalls)n.set(t.id,e);let r=t.length;for(let a=i.length-1;a>=0;a--){let o=i[a];if(!o.id.startsWith(`leading-`))for(let n=r-1;n>=0;n--){let i=t[n];if(!i.id.startsWith(`leading-`)&&i.user.text===o.user.text){e.set(o,i),r=n;break}}if(!e.has(o))for(let t of o.toolCalls){let r=n.get(t.id);if(r){e.set(o,r);break}}}for(let n=0;n<i.length;n++){let r=i[n];if(e.has(r)||!r.id.startsWith(`leading-`))continue;let a;for(let t=n+1;t<i.length&&!a;t++)a=e.get(i[t]);let o=a?t.indexOf(a):t.length;o===0?(t.unshift(r),e.set(r,r)):e.set(r,t[o-1])}for(let t of i){let n=e.get(t);if(!(!n||n===t)){t.id.startsWith(`leading-`)||(n.id=t.id,n.user.sequence=t.user.sequence),n.reasoningText+=t.reasoningText,n.notices.push(...t.notices),t.usage&&(n.usage=t.usage),t.error!==void 0&&(n.error=t.error);for(let e of t.decisions){let t=n.decisions.find(t=>t.id===e.id);t?Object.assign(t,e):n.decisions.push(e)}for(let e of t.toolCalls){let t=n.toolCalls.find(t=>t.id===e.id);t?(t.name=e.name,t.arguments=e.arguments,e.result!==void 0&&(t.result=e.result),t.isRunning=t.result===void 0&&e.isRunning):n.toolCalls.push(e)}t.stopReason===void 0?n.isComplete||(n.assistantText=Yq(n.assistantText,t.assistantText)):(n.assistantText=t.assistantText,n.budget=t.budget,n.stopReason=t.stopReason,n.outputCap=t.outputCap,Wq(n))}}}n=t[t.length-1],e.lastOutcome&&(n||(n=Uq(`leading-outcome-${e.cursor}`,``,e.cursor),t.push(n)),Gq(n,e.lastOutcome));for(let r of e.pendingDecisions){let i;for(let e=t.length-1;e>=0&&!i;e--)i=t[e].decisions.find(e=>e.id===r.id);i?Object.assign(i,r,{resolved:!1,approved:void 0}):(n||(n=Uq(`leading-decision-${e.cursor}`,``,e.cursor),t.push(n)),n.decisions.push({...r,resolved:!1}))}return Kq(t,e.session.status),t}function Zq({call:e}){let t=(0,S.useMemo)(()=>typeof e.arguments==`string`?e.arguments:JSON.stringify(e.arguments,null,2)??``,[e.arguments]),n=(0,S.useMemo)(()=>typeof e.result==`string`?e.result:JSON.stringify(e.result,null,2)??``,[e.result]),r=Hq(e);return(0,W.jsx)(Bq,{icon:(0,W.jsx)(No,{}),title:e.name,status:r,running:e.isRunning,failed:r===`Error`,children:(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-muted-foreground`,children:`Input`}),(0,W.jsx)(`pre`,{tabIndex:0,"aria-label":`${e.name} input`,className:`max-h-96 overflow-auto whitespace-pre-wrap break-words font-mono`,children:t})]}),e.result!==void 0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-muted-foreground`,children:`Output`}),(0,W.jsx)(`pre`,{tabIndex:0,"aria-label":`${e.name} output`,className:`max-h-[32rem] overflow-auto whitespace-pre-wrap break-words font-mono`,children:n})]}),e.isRunning&&(0,W.jsx)(BI,{label:`Running tool…`})]})})}function Qq({calls:e,reasoning:t,working:n=!1}){let[r,i]=(0,S.useState)(!1),a=(0,S.useRef)(n);if((0,S.useEffect)(()=>{a.current&&!n&&i(!1),a.current=n},[n]),!e.length&&!t)return null;let o=e.find(e=>e.isRunning),s=e.filter(e=>Hq(e)===`Error`).length,c=n?o?`Using ${o.name}`:`Thinking…`:e.length>1?`Used ${e.length} tools`:e.length===1?`Used ${e[0].name}`:`Thought process`;return(0,W.jsxs)(`details`,{open:r,onToggle:e=>i(e.currentTarget.open),className:`console-tool-activity rounded-xl bg-muted/20`,children:[(0,W.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 px-3 py-2 text-xs text-muted-foreground [&::-webkit-details-marker]:hidden`,children:[n?(0,W.jsx)(RI,{className:`console-loading-dots-compact`}):(0,W.jsx)(No,{className:`size-3.5`}),(0,W.jsxs)(`span`,{className:n?`console-working-label`:void 0,children:[c,s>0&&(0,W.jsxs)(`span`,{className:`text-destructive`,children:[` · `,s,` failed`]})]}),(0,W.jsx)(da,{className:`ml-auto size-3.5 transition-transform duration-150 motion-reduce:transition-none ${r?`rotate-180`:``}`})]}),(0,W.jsxs)(`div`,{className:`px-3 pb-2`,children:[t&&(0,W.jsx)(`div`,{className:`py-2 text-xs leading-6 whitespace-pre-wrap text-muted-foreground`,children:t}),e.map(e=>(0,W.jsx)(Zq,{call:e},e.id))]})]})}function $q({worker:e}){return(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsxs)(`div`,{className:`rounded-lg border border-border p-4 text-sm`,children:[(0,W.jsx)(`div`,{className:`font-medium`,children:e.name}),(0,W.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-muted-foreground`,children:e.task})]}),e.operatorMessages?.length?(0,W.jsxs)(`details`,{className:`rounded-lg border border-border p-3 text-xs`,open:!0,children:[(0,W.jsxs)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:[`Your messages to `,e.name]}),(0,W.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.operatorMessages.map(e=>(0,W.jsxs)(`div`,{className:`rounded-md bg-muted/30 p-3`,children:[(0,W.jsx)(`div`,{className:`mb-1 text-xs text-muted-foreground`,children:new Date(e.createdAt).toLocaleTimeString()}),(0,W.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:e.text})]},e.id))})]}):null,e.transcript.map(e=>(0,W.jsxs)(`article`,{className:`space-y-3`,children:[(0,W.jsx)(Qq,{calls:(e.tools??[]).map(t=>({id:t.call.id??`${e.turn}-${t.callIndex}`,name:t.call.name,arguments:t.call.arguments,result:t.result,isRunning:t.running??!1})),reasoning:e.reasoning_summary,working:!!e.tools?.some(e=>e.running)}),e.assistant&&(0,W.jsx)(Dq,{text:e.assistant})]},e.turn)),[`running`,`queued`,`parked`].includes(e.status)&&(0,W.jsx)(BI,{waiting:e.status!==`running`,label:e.status===`queued`?`Queued`:e.status===`parked`?`Waiting for you`:`Working…`}),e.summary&&(0,W.jsx)(Dq,{text:e.summary}),e.error&&(0,W.jsx)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/40 p-3 text-sm text-destructive`,children:e.error})]})}function eJ({workspace:e,worker:t,onResolve:n,onSubmit:r,onStop:i,resumeCap:a,sendBehavior:o}){let s=e.snapshot,c=(0,S.useMemo)(()=>s?Xq(s):[],[s]),l=(0,S.useRef)(null),u=(0,S.useRef)(null),d=(0,S.useRef)(!0),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(!1),v=`${s?.session.id??``}:${t?.id??`root`}`;if((0,S.useLayoutEffect)(()=>{d.current=!0,p(!1);let e=l.current;e&&(e.scrollTop=e.scrollHeight)},[v,c.length===0]),(0,S.useEffect)(()=>{let e=u.current;if(!e)return;let t=new ResizeObserver(()=>{let e=l.current;e&&(d.current?e.scrollTop=e.scrollHeight:p(!0),_(e.scrollHeight-e.scrollTop-e.clientHeight>8))});return t.observe(e),()=>t.disconnect()},[v,c.length===0]),!s)return null;let y=[`working`,`waiting`].includes(s.session.status),b=!t&&c.length===0&&s.pendingDecisions.length===0;return b?(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain`,"aria-label":`Home`,children:[(0,W.jsxs)(`section`,{className:`flex min-h-full flex-col justify-center pb-20 pt-8`,children:[(0,W.jsxs)(`div`,{className:`mx-auto w-full max-w-3xl px-3 py-5 text-center sm:px-6`,children:[(0,W.jsx)(`div`,{className:`mb-8 flex justify-center`,children:(0,W.jsx)(ML,{sessionId:s.session.id})}),(0,W.jsx)(`img`,{src:NL,width:96,height:72,alt:``,className:`mx-auto mb-4 h-auto w-24 object-contain`}),(0,W.jsx)(mc,{className:`mb-7`}),(0,W.jsx)(`h2`,{className:`font-heading text-xl`,children:`What would you like to hack and fix today?`})]}),(0,W.jsx)(rJ,{sendBehavior:o,workspace:e,snapshot:s,worker:t,onSubmit:r,onStop:i}),(0,W.jsx)(tJ,{snapshot:s,onChoose:t=>{e.setDraft(t),requestAnimationFrame(()=>document.querySelector(`.console-composer textarea`)?.focus())}})]}),(0,W.jsx)(DL,{})]}):(0,W.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col ${b?`justify-center pb-20`:``}`,children:[(0,W.jsx)(`div`,{ref:l,"data-scrolled":m,"data-more-below":g,className:`console-transcript-scroller min-h-0 overflow-y-auto overscroll-contain px-3 py-5 sm:px-6 ${b?`flex-none`:`flex-1`}`,onScroll:()=>{let e=l.current;e&&(h(e.scrollTop>8),_(e.scrollHeight-e.scrollTop-e.clientHeight>8),d.current=e.scrollHeight-e.scrollTop-e.clientHeight<100,d.current&&p(!1))},"aria-label":t?`${t.name} conversation`:`Conversation`,children:(0,W.jsxs)(`div`,{ref:u,className:`mx-auto max-w-3xl space-y-7`,children:[t?(0,W.jsx)($q,{worker:t}):c.length?c.map(t=>(0,W.jsxs)(`article`,{className:`space-y-3`,children:[t.user.text&&(0,W.jsx)(`div`,{className:`ml-auto max-w-[92%] rounded-2xl rounded-br-sm bg-muted/50 px-4 py-3 text-sm whitespace-pre-wrap break-words`,children:t.user.text}),(t.toolCalls.length>0||t.reasoningText)&&(0,W.jsx)(Qq,{calls:t.toolCalls,reasoning:t.reasoningText,working:t.isWorking&&!t.assistantText}),t.decisions.filter(e=>e.resolved).map(t=>(0,W.jsx)(Bq,{icon:(0,W.jsx)(go,{}),title:`${t.title} · ${t.approved===void 0?`closed`:t.approved?`approved`:`declined`}`,status:``,children:(0,W.jsx)(zq,{decision:t,busy:e.busy,onResolve:e=>n(t.id,e)})},t.id)),t.assistantText&&(0,W.jsx)(Dq,{text:t.assistantText,streaming:t.isWorking&&s.session.status===`working`}),t.notices.map((e,t)=>(0,W.jsx)(`p`,{className:`border-l-2 border-border pl-3 text-xs whitespace-pre-wrap text-muted-foreground`,children:e.startsWith(`Cancellation requested.`)?`Stop requested`:e},t)),t.error&&(0,W.jsxs)(`div`,{role:`alert`,className:`rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm whitespace-pre-wrap text-destructive`,children:[HI(t.error),VI(t.error)&&(0,W.jsx)(J,{asChild:!0,variant:`default`,size:`sm`,className:`mt-3 flex w-fit`,children:(0,W.jsx)(vn,{to:`/connections?session=${s.session.id}&return=${encodeURIComponent(`/console/${s.session.id}`)}`,children:`Manage connection`})})]}),t.isWorking&&(s.session.status===`waiting`||!t.assistantText&&t.toolCalls.length===0&&!t.reasoningText)&&(0,W.jsx)(BI,{waiting:s.session.status===`waiting`,label:s.session.status===`waiting`?`Waiting for your decision`:t.toolCalls.some(e=>e.isRunning)?`Running tools…`:t.assistantText?`Responding…`:`Thinking…`})]},t.id)):(0,W.jsxs)(`div`,{className:`py-4 text-center`,children:[(0,W.jsx)(`div`,{className:`mb-8 flex justify-center`,children:(0,W.jsx)(ML,{sessionId:s.session.id})}),(0,W.jsx)(`img`,{src:NL,width:96,height:72,alt:``,className:`mx-auto mb-4 h-auto w-24 object-contain`}),(0,W.jsx)(mc,{className:`mb-7`}),(0,W.jsx)(`h2`,{className:`font-heading text-xl`,children:`What would you like to hack and fix today?`})]}),s.lastOutcome?.outputCap&&!t&&(0,W.jsxs)(`div`,{role:`status`,className:`rounded-xl border border-amber-500/40 bg-amber-500/5 p-4 text-sm`,children:[(0,W.jsx)(`div`,{className:`font-medium`,children:`0 hit its output limit`}),(0,W.jsx)(J,{className:`mt-3`,size:`sm`,disabled:e.busy||y,onClick:a,children:`Keep going`})]}),s.pendingDecisions.map(t=>(0,W.jsx)(`div`,{className:`space-y-2`,children:(0,W.jsx)(zq,{decision:t,busy:e.busy,onResolve:e=>n(t.id,e)})},t.id))]})}),f&&(0,W.jsxs)(J,{variant:`secondary`,size:`sm`,className:`absolute bottom-[10rem] left-1/2 z-10 -translate-x-1/2 shadow-lg`,onClick:()=>{let e=l.current;e&&e.scrollTo({top:e.scrollHeight,behavior:document.documentElement.dataset.reducedMotion===`true`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`}),d.current=!0,p(!1)},children:[(0,W.jsx)(ta,{className:`size-3.5`}),`Latest`]}),(0,W.jsx)(rJ,{sendBehavior:o,workspace:e,snapshot:s,worker:t,onSubmit:r,onStop:i}),b&&(0,W.jsx)(tJ,{snapshot:s,onChoose:t=>{e.setDraft(t),requestAnimationFrame(()=>document.querySelector(`.console-composer textarea`)?.focus())}})]})}function tJ({snapshot:e,onChoose:t}){let n=e.localScopePath||e.session.target,r=e.focusedFinding,i=e.todos?.todos.find(e=>e.status!==`completed`&&e.status!==`cancelled`),a=r?[{icon:go,text:`Review the evidence for ${r.title}`,prompt:`Review the stored evidence for the focused finding "${r.title}" and explain what is confirmed and what needs verification.`},{icon:Ga,text:`Plan a verification`,prompt:`Propose a bounded verification plan for the focused finding. Ask for any scope or permissions needed before executing.`},{icon:Fa,text:`Explore remediation options`,prompt:`Explain remediation options for the focused finding, including a regression check. Start with a proposal.`}]:n?[{icon:Fa,text:`Review ${n}`,prompt:`Review ${n} for security issues. Start by outlining the scope and evidence to inspect.`},{icon:go,text:`Check dependencies and configuration`,prompt:`Inspect dependencies and configuration for ${n}, and distinguish verified issues from unconfirmed concerns.`},{icon:Ga,text:i?`Continue: ${i.content}`:`Create a focused review plan`,prompt:i?`Continue the pending task: ${i.content}. Use the preserved context and avoid repeating completed work.`:`Create a focused security review plan for ${n}, with explicit time and cost limits before execution.`}]:[{icon:Fa,text:`Review a codebase`,prompt:`Help me review a codebase for security issues. Ask which local directory to use and establish the scope first.`},{icon:go,text:`Investigate a security question`,prompt:`Help me investigate a security question. Ask for the relevant evidence and constraints first.`},{icon:Ga,text:`Plan an audit`,prompt:`Help me plan a security audit. Ask for the target, authorized scope, and time and cost limits.`}];return(0,W.jsx)(`div`,{"aria-label":`Suggested prompts`,className:`mx-auto w-full max-w-3xl space-y-1 px-3 pt-3 sm:px-6`,children:a.map(({icon:e,text:n,prompt:r})=>(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-3 rounded-xl px-3 py-3 text-left text-sm text-muted-foreground hover:bg-muted/40 hover:text-foreground focus-visible:outline-2 focus-visible:outline-primary`,onClick:()=>t(r),children:[(0,W.jsx)(e,{className:`size-4 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate`,children:n})]},n))})}var nJ={help:`Browse commands`,capabilities:`Explore what 0 can do`,status:`Check this conversation`,tools:`Browse available tools`,"new-chat":`Start a new conversation`,onboard:`Open guided setup`,clear:`Clear this conversation`,history:`Browse audit reports`,findings:`Review findings`,fix:`Prepare a fix for review`,copy:`Export this conversation`,sessions:`Switch conversations`,explain:`Get a simpler explanation`,feedback:`Share feedback`,settings:`Manage preferences`,keybindings:`View keyboard shortcuts`,theme:`Change appearance`,model:`Choose a model`,chat:`Return to chat`,ops:`Open dashboard`,hackstore:`Browse plugins`,connect:`Connect a provider`,usage:`Check usage and cost`,back:`Go back`,scope:`Manage approved scope`,doctor:`Check your setup`,exit:`Close this conversation`};function rJ({workspace:e,snapshot:t,worker:n,onSubmit:r,onStop:i,sendBehavior:a}){let o=rt(),s=(0,S.useRef)(null),c=(0,S.useRef)(!1),[l,u]=(0,S.useState)(e.draft.length),d=kq({draft:e.draft,caret:l,onSelect:(t,n)=>{e.setDraft(e.draft.slice(0,n.start)+n.text+e.draft.slice(n.end));let r=n.start+n.text.length;u(r),requestAnimationFrame(()=>{s.current?.focus(),s.current?.setSelectionRange(r,r)})}}),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(``),g=ni({queryKey:[`console-models`,t.runtime?.providerId],enabled:f,queryFn:({signal:e})=>G(`/api/console/models`,{signal:e})}),_=(0,S.useMemo)(()=>{let e=e=>e.provider===t.runtime?.providerId&&e.id===t.runtime?.model?0:e.provider===t.runtime?.providerId?1:e.provider===`openai`?2:e.provider===`chatgpt-codex`?3:4,n=new Map;for(let e of g.data?.models??[]){let t=`${e.provider}:${e.id}`;(!n.has(t)||e.source===`account`)&&n.set(t,e)}return[...n.values()].filter(e=>`${e.id} ${e.provider}`.toLowerCase().includes(m.toLowerCase())).sort((t,n)=>e(t)-e(n)||Number(/^gpt-[0-9]/.test(n.id))-Number(/^gpt-[0-9]/.test(t.id))||n.id.localeCompare(t.id,void 0,{numeric:!0})||t.provider.localeCompare(n.provider))},[g.data,m,t.runtime?.providerId,t.runtime?.model]),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(0),[C,w]=(0,S.useState)(!1),T=/^\/([^\s]*)$/.exec(e.draft)?.[1]?.toLowerCase(),E=(0,S.useMemo)(()=>T===void 0?[]:FI.filter(e=>e.name!==`launcher`&&(e.name.startsWith(T)||e.aliases.some(e=>e.startsWith(T)))),[T]),D=!n&&T!==void 0&&!C;(0,S.useEffect)(()=>{x(0),w(!1)},[e.draft]),(0,S.useEffect)(()=>{document.getElementById(`composer-command-${b}`)?.scrollIntoView({block:`nearest`})},[b]);let O=t=>{e.setDraft(`/${t} `),w(!0),s.current?.focus()},k=n?[`running`,`queued`,`parked`].includes(n.status):[`working`,`waiting`].includes(t.session.status),A=t.session.status===`closed`,j=!!(n&&![`running`,`queued`,`parked`].includes(n.status)),M=!!e.draft.trim()&&e.draft.length<=32e3&&!e.busy&&!A&&!j;return(0,S.useLayoutEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{e.style.height=`0px`,e.style.height=`${Math.max(32,Math.min(e.scrollHeight,240))}px`,e.style.overflowY=e.scrollHeight>240?`auto`:`hidden`};t();let n=new ResizeObserver(n=>{n.some(e=>e.contentRect.width!==r)&&(r=e.clientWidth,t())}),r=e.clientWidth;return n.observe(e),()=>n.disconnect()},[e.draft]),(0,W.jsx)(`div`,{className:`shrink-0 bg-background p-3 sm:px-6`,children:(0,W.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,W.jsxs)(`div`,{className:`relative console-composer grid grid-cols-[auto_minmax(0,1fr)_auto] items-end gap-2 p-3 focus-within:ring-2 focus-within:ring-primary/10`,children:[(0,W.jsx)(jq,{picker:d}),(0,W.jsx)(Aq,{open:D,label:`Commands`,className:`right-0`,children:(0,W.jsx)(`div`,{id:`composer-command-list`,role:`listbox`,"aria-label":`Slash commands`,className:`max-h-[280px] overflow-y-auto overscroll-contain`,children:E.length?E.map((e,t)=>(0,W.jsxs)(`button`,{id:`composer-command-${t}`,type:`button`,role:`option`,"aria-selected":t===b,className:`flex w-full items-center gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors duration-100 motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-primary ${t===b?`bg-muted`:`hover:bg-muted/60`}`,onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>x(t),onClick:()=>O(e.name),children:[(0,W.jsxs)(`span`,{className:`min-w-28 shrink-0 font-medium`,children:[`/`,e.name]}),(0,W.jsx)(`span`,{className:`truncate text-muted-foreground`,children:nJ[e.name]??e.description.replace(/ \(TUI:.*\)/,``)})]},e.name)):(0,W.jsx)(`p`,{className:`px-3 py-3 text-sm text-muted-foreground`,children:`No matching commands. Try /help.`})})}),(0,W.jsx)(`textarea`,{rows:1,autoComplete:`off`,"data-1p-ignore":!0,"data-lpignore":`true`,ref:s,"aria-autocomplete":`list`,"aria-controls":d.open?d.textareaProps[`aria-controls`]:D?`composer-command-list`:void 0,"aria-expanded":D||d.open,"aria-activedescendant":d.open?d.textareaProps[`aria-activedescendant`]:D&&E.length?`composer-command-${b}`:void 0,title:`Enter to send · Shift+Enter for a new line`,"aria-label":n?`Message ${n.name}`:`Message Zero`,className:`col-start-2 row-start-1 block min-h-8 max-h-60 w-full resize-none bg-transparent px-2 py-1 text-sm leading-6 outline-none placeholder:text-muted-foreground`,value:e.draft,disabled:A,placeholder:A?`This conversation is closed.`:n?`Message ${n.name}…`:k?`Add a message…`:`Ask Zero… / for commands`,onSelect:e=>u(e.currentTarget.selectionStart),onChange:t=>{u(t.target.selectionStart),e.setDraft(t.target.value)},onCompositionStart:()=>{c.current=!0},onCompositionEnd:()=>{c.current=!1},onKeyDown:e=>{if(!(c.current||e.nativeEvent.isComposing||e.keyCode===229)&&!d.onKeyDown(e)){if(D){if(e.key===`Escape`){e.preventDefault(),w(!0);return}if(E.length&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){e.preventDefault(),x(t=>(t+(e.key===`ArrowDown`?1:-1)+E.length)%E.length);return}if(E.length&&(e.key===`Tab`||e.key===`Enter`&&!e.shiftKey)){e.preventDefault(),O(E[b].name);return}}e.key===`Enter`&&!e.shiftKey&&!c.current&&!e.nativeEvent.isComposing&&e.keyCode!==229&&(e.preventDefault(),M&&r())}},onPaste:t=>{if(t.clipboardData.files.length)t.preventDefault(),y(`Files can't be pasted. Use + to add a file path instead.`);else{let n=t.clipboardData.getData(`text/plain`);y(n.length+e.draft.length>32e3?`Message is too long. Shorten it to under 32,000 characters.`:``)}}}),(0,W.jsxs)(`div`,{className:`contents`,children:[(0,W.jsx)(EL,{className:`col-start-1 row-start-1 self-end`,workspace:e,sessionId:t.session.id,cwd:t.workspacePath??t.scopeEnforcement.projectPath,workspaceDisabled:k||e.busy||A||t.workers.some(e=>[`queued`,`running`,`parked`].includes(e.status)),disabled:A,onAdd:t=>{e.setDraft(`${e.draft}${e.draft?`
108
+ `:``}Local path reference: ${t}`),requestAnimationFrame(()=>s.current?.focus())}}),(0,W.jsxs)(`div`,{className:`col-start-3 row-start-1 flex items-center gap-2 self-end`,children:[!n&&(0,W.jsx)(AL,{workspace:e,sessionId:t.session.id,mode:t.session.autonomyMode,disabled:k||e.busy||A}),!n&&(0,W.jsx)(TL,{workspace:e,sessionId:t.session.id,reasoning:t.runtime?.reasoning,disabled:k||e.busy||A}),!n&&(0,W.jsxs)(hP,{onOpenChange:e=>{p(e),e&&h(``)},children:[(0,W.jsx)(hP.Trigger,{"aria-label":`Choose model`,disabled:k||e.busy||A,className:`flex max-w-20 sm:max-w-40 items-center gap-1 rounded-full px-2 py-2 text-xs text-muted-foreground hover:bg-muted disabled:opacity-50`,children:(0,W.jsxs)(`button`,{type:`button`,children:[(0,W.jsx)(`span`,{className:`truncate`,children:t.runtime?.model||`Model`}),(0,W.jsx)(da,{className:`size-3 shrink-0`})]})}),(0,W.jsxs)(hP.Content,{side:`top`,align:`end`,sideOffset:10,collisionPadding:12,className:`w-[280px] max-w-[calc(100vw-24px)] max-h-[min(256px,var(--available-height))] rounded-lg flex flex-col overflow-hidden p-2 font-sans`,children:[(0,W.jsx)(`div`,{className:`shrink-0 pb-2`,children:(0,W.jsx)(af,{className:`h-8 rounded-xl px-3 text-sm`,"data-1p-ignore":!0,"data-lpignore":`true`,autoComplete:`off`,"aria-label":`Search models`,placeholder:`Search models and providers`,value:m,onChange:e=>h(e.target.value),onKeyDown:e=>{e.key!==`Escape`&&e.key!==`Tab`&&e.stopPropagation()}})}),(0,W.jsxs)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain`,children:[g.isLoading&&(0,W.jsx)(`div`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:`Loading models…`}),g.error&&(0,W.jsx)(`div`,{className:`max-w-64 px-3 py-2 text-sm text-muted-foreground`,children:HI(g.error instanceof Error?g.error.message:`Could not load models`)}),_.map(n=>(0,W.jsx)(hP.Item,{"aria-label":`${n.id} ${n.provider}`,title:`${n.id} · ${n.provider}`,icon:(0,W.jsx)(KI,{providerId:n.provider,className:`size-4 shrink-0`}),selected:n.id===t.runtime?.model&&n.provider===t.runtime?.providerId,className:`h-9 gap-2.5 rounded-xl px-3 py-2 text-sm focus-visible:ring-0 data-highlighted:bg-muted transition-colors duration-100 motion-reduce:transition-none`,onClick:()=>void e.perform(()=>Ai(t.session.id,{runtime:{providerId:n.provider,model:n.id}})),children:(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm leading-5`,children:n.id})},`${n.provider}:${n.id}`)),g.data&&g.data.models.length>0&&!g.data.models.some(e=>`${e.id} ${e.provider}`.toLowerCase().includes(m.toLowerCase()))&&(0,W.jsx)(`div`,{className:`px-3 py-3 text-sm text-muted-foreground`,children:`No models match your search.`}),!!g.data?.diagnostics.some(e=>!m||e.providerId.toLowerCase().includes(m.toLowerCase()))&&(0,W.jsx)(`div`,{role:`status`,className:`px-3 py-2 text-xs text-muted-foreground`,children:`A connection needs attention. Manage it below.`}),g.data&&g.data.models.length===0&&(0,W.jsx)(`div`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:`Connect a provider to choose a model.`}),(0,W.jsx)(hP.Item,{icon:(0,W.jsx)(ro,{className:`size-4 shrink-0`}),className:`gap-3 rounded-xl px-3 py-2 text-sm`,onClick:()=>o(`/connections?session=${t.session.id}&return=${encodeURIComponent(`/console/${t.session.id}`)}`),children:`Manage connections`}),(0,W.jsx)(hP.Item,{icon:(0,W.jsx)(No,{className:`size-4 shrink-0`}),className:`gap-3 rounded-xl px-3 py-2 text-sm`,onClick:()=>o(`/models?session=${t.session.id}&return=${encodeURIComponent(`/console/${t.session.id}`)}`),children:`Model settings`})]})]})]}),(0,W.jsxs)(`span`,{hidden:e.draft.length<3e4,className:`text-xs ${e.draft.length>32e3?`text-destructive`:`text-muted-foreground`}`,children:[e.draft.length.toLocaleString(),` / 32,000`]}),t.queuedMessages.length>0&&!n&&(0,W.jsx)(OL,{workspace:e,snapshot:t}),k&&(0,W.jsxs)(J,{variant:`outline`,size:`sm`,disabled:e.busy,onClick:i,children:[(0,W.jsx)(wo,{className:`size-3`}),`Stop`]}),(0,W.jsx)(J,{size:`icon-sm`,title:k&&!n?a===`queue`?`Send when done`:`Interrupt and send`:`Send message`,"aria-label":e.busy?`Sending message`:`Send message`,"aria-busy":e.busy,disabled:!M,onClick:r,children:e.busy?(0,W.jsx)(RI,{className:`scale-75`}):(0,W.jsx)(aa,{className:`size-4`})})]})]})]}),j&&(0,W.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`This sub-agent is done. Switch to the main conversation to continue.`}),v&&(0,W.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-amber-600 dark:text-amber-400`,children:v})]})})}var iJ={queued:`Queued`,running:`Working`,parked:`Waiting`,completed:`Done`,failed:`Failed`,stopped:`Stopped`};function aJ(e){if(e.error)return e.error;for(let t=e.transcript.length-1;t>=0;t--){let n=e.transcript[t],r=n.tools?.findLast(e=>e.running);if(r)return`Using ${r.call.name}`;if(n.assistant?.trim())return n.assistant.trim();if(n.reasoning_summary?.trim())return n.reasoning_summary.trim()}return e.summary?.trim()||e.task}function oJ({status:e}){return e===`running`?(0,W.jsx)(RI,{className:`text-primary`}):e===`parked`?(0,W.jsx)(ha,{"aria-hidden":`true`,className:`size-3.5 text-primary`}):e===`completed`?(0,W.jsx)(ua,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}):e===`failed`?(0,W.jsx)(Po,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-muted-foreground/60`})}function sJ({snapshot:e,workerId:t,onSelect:n,active:r,sendBehavior:i,onSendBehaviorChange:a}){let o=e.workers.find(e=>e.id===t),s=e.workers.filter(e=>e.status===`running`||e.status===`queued`).length,c=e.workers.filter(e=>e.status===`parked`).length,l=o?.name||(s?`${s} working`:c?`${c} waiting`:`Agents`);return(0,W.jsxs)(hP,{children:[(0,W.jsx)(hP.Trigger,{"aria-label":`Agents: ${o?.name||`Main conversation`}, ${e.workers.length} workers`,children:(0,W.jsxs)(J,{type:`button`,variant:`ghost`,size:`sm`,className:`max-w-48 gap-2 text-xs text-muted-foreground`,children:[r||s>0?(0,W.jsx)(RI,{className:`text-primary`}):(0,W.jsx)(Ao,{"aria-hidden":`true`,className:`size-3.5`}),(0,W.jsx)(`span`,{className:`truncate`,children:l}),!s&&!c&&e.workers.length>0&&(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:e.workers.length}),(0,W.jsx)(da,{"aria-hidden":`true`,className:`size-3`})]})}),(0,W.jsxs)(hP.Content,{align:`end`,sideOffset:8,collisionPadding:12,className:`w-80 max-w-[calc(100vw-24px)] rounded-2xl p-1.5 font-sans`,children:[(0,W.jsx)(hP.Item,{icon:(0,W.jsx)(Xa,{className:`size-4`}),selected:!o,onClick:()=>n(null),children:(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center justify-between gap-3`,children:[(0,W.jsx)(`span`,{children:`Main conversation`}),(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r?`Working`:`Ready`})]})}),e.workers.length>0?(0,W.jsx)(`div`,{className:`max-h-72 overflow-y-auto overscroll-contain`,children:e.workers.map(e=>(0,W.jsx)(hP.Item,{selected:e.id===t,onClick:()=>n(e.id),className:`items-start`,children:(0,W.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,W.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),(0,W.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,W.jsx)(oJ,{status:e.status}),iJ[e.status]]})]}),(0,W.jsx)(`span`,{className:`line-clamp-2 text-xs leading-5 text-muted-foreground`,children:e.task}),aJ(e)!==e.task&&(0,W.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,children:aJ(e)})]})},e.id))}):(0,W.jsx)(`p`,{className:`px-3 py-3 text-xs leading-5 text-muted-foreground`,children:`Agents appear here when 0 delegates work. Select an agent to see its progress or send it a message.`}),r&&!o&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`px-3 pt-3 pb-1 text-xs text-muted-foreground`,children:`Your next message`}),(0,W.jsx)(hP.Item,{icon:(0,W.jsx)(va,{className:`size-4`}),selected:i===`queue`,onClick:()=>a(`queue`),children:`Send when done`}),(0,W.jsx)(hP.Item,{icon:(0,W.jsx)(Ca,{className:`size-4`}),selected:i===`steer`,onClick:()=>a(`steer`),children:`Interrupt and send`})]})]})]})}function cJ({checked:e,onCheckedChange:t,className:n,disabled:r,onClick:i,...a}){return(0,W.jsx)(`button`,{...a,type:`button`,role:`switch`,"aria-checked":e,disabled:r,onClick:n=>{i?.(n),n.defaultPrevented||t(!e)},className:q(`relative inline-flex h-5 w-8 shrink-0 items-center rounded-full transition-colors duration-150 motion-reduce:transition-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-foreground/40 disabled:cursor-not-allowed disabled:opacity-50`,e?`bg-primary`:`bg-muted-foreground/35`,n),children:(0,W.jsx)(`span`,{"aria-hidden":`true`,className:q(`absolute left-0.5 top-0.5 size-4 rounded-full bg-white shadow-sm transition-transform duration-150 motion-reduce:transition-none`,e&&`translate-x-3`)})})}function lJ({snapshot:e,busy:t,stagePrompt:n,onScope:r,onDrain:i,onHarness:a}){let o=`?session=${encodeURIComponent(e.session.id)}&return=${encodeURIComponent(`/console/${e.session.id}`)}`,s=e.usage.inputTokens+e.usage.outputTokens,c=e.contextWindowTokens??e.runtime?.contextWindowTokens,l=!!(e.session.target||e.scope?.in_scope?.length||e.scope?.out_of_scope?.length),u=!!(e.harness&&(e.harness.error||e.harness.views.length||e.harness.commands.length||e.harness.settings.length));return(0,W.jsxs)(`div`,{className:`space-y-6 p-5 text-sm`,children:[e.objective&&(0,W.jsxs)(`section`,{className:`space-y-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Objective`}),(0,W.jsx)(`p`,{className:`whitespace-pre-wrap text-xs leading-5 text-muted-foreground`,children:e.objective})]}),!!e.todos?.todos.length&&(0,W.jsxs)(`section`,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Plan`}),(0,W.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.todos.done,` / `,e.todos.total]})]}),(0,W.jsx)(`ol`,{className:`space-y-3`,children:e.todos.todos.map(e=>(0,W.jsxs)(`li`,{className:`flex items-start gap-2.5 text-xs leading-5`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`,children:e.status===`completed`?(0,W.jsx)(ua,{className:`size-3.5`}):e.status===`cancelled`?(0,W.jsx)(Za,{className:`size-3.5`}):e.status===`in_progress`?(0,W.jsx)(RI,{className:`console-loading-dots-compact`}):(0,W.jsx)(_a,{className:`size-3.5`})}),(0,W.jsxs)(`span`,{className:e.status===`completed`||e.status===`cancelled`?`text-muted-foreground line-through`:``,children:[e.content,(0,W.jsxs)(`span`,{className:`sr-only`,children:[` · `,e.status.replaceAll(`_`,` `)]})]})]},e.id))})]}),(e.workspacePath||e.localScopePath)&&(0,W.jsxs)(`section`,{className:`space-y-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Workspace`}),(0,W.jsx)(`p`,{className:`break-words text-xs leading-5 text-muted-foreground`,children:e.workspacePath??e.localScopePath})]}),(0,W.jsxs)(`section`,{className:`space-y-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Session`}),(0,W.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-2 text-xs`,children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Model`}),(0,W.jsx)(`dd`,{className:`break-all`,children:e.runtime?.model??`Not set`}),!e.runtime?.configured&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Connection`}),(0,W.jsx)(`dd`,{className:`text-destructive`,children:`Not connected`})]}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Mode`}),(0,W.jsx)(`dd`,{className:`capitalize`,children:e.session.autonomyMode})]}),(0,W.jsxs)(`details`,{className:`p-3 text-xs`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`Connection details`}),(0,W.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-2`,children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Provider`}),(0,W.jsx)(`dd`,{children:e.runtime?.providerLabel??`Not set`}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Account`}),(0,W.jsx)(`dd`,{className:`break-all`,children:e.runtime?.configured?e.runtime.connectionIdentity??`Connected`:`Not connected`}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Status`}),(0,W.jsx)(`dd`,{children:e.session.status}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Role`}),(0,W.jsx)(`dd`,{children:e.session.role})]})]}),(0,W.jsx)(J,{asChild:!0,variant:`outline`,size:`sm`,children:(0,W.jsx)(vn,{to:`/models${o}`,children:`Change model`})}),e.pendingConfiguration&&(0,W.jsxs)(`div`,{role:`status`,className:`rounded-xl bg-primary/10 p-3 text-xs`,children:[`Changes apply after the current step.`,(0,W.jsxs)(`details`,{className:`mt-2`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`Pending configuration`}),(0,W.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words`,children:JSON.stringify(e.pendingConfiguration,null,2)})]})]})]}),l&&(0,W.jsxs)(`section`,{className:`space-y-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Scope`}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,disabled:t,onClick:r,children:`Edit scope`})]}),e.session.target&&(0,W.jsx)(`p`,{className:`break-words text-xs leading-5`,children:e.session.target}),!!e.scope?.in_scope?.length&&(0,W.jsxs)(`div`,{className:`text-xs`,children:[(0,W.jsx)(`p`,{className:`text-muted-foreground`,children:`Included targets`}),(0,W.jsx)(`ul`,{className:`mt-2 space-y-1`,children:e.scope.in_scope.map(e=>(0,W.jsx)(`li`,{className:`break-words`,children:e},e))})]}),!!e.scope?.out_of_scope?.length&&(0,W.jsxs)(`details`,{className:`p-3 text-xs`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`Excluded targets`}),(0,W.jsx)(`ul`,{className:`mt-2 space-y-1`,children:e.scope.out_of_scope.map(e=>(0,W.jsx)(`li`,{className:`break-words`,children:e},e))})]})]}),(0,W.jsxs)(`section`,{className:`space-y-3 pt-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Usage`}),(0,W.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-2 text-xs`,children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Tokens`}),(0,W.jsx)(`dd`,{children:s.toLocaleString()}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Cost`}),(0,W.jsx)(`dd`,{children:typeof e.usage.costUsd==`number`?`$${e.usage.costUsd.toFixed(2)}${e.usage.costUnavailable?` (partial)`:``}`:`Unknown`})]}),c&&e.contextInputTokens!==void 0&&(0,W.jsx)(`progress`,{"aria-label":`Context used`,title:`Context used`,className:`h-2 w-full accent-primary`,max:c,value:e.contextInputTokens}),(0,W.jsxs)(`details`,{className:`p-3 text-xs`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`Token and cost details`}),(0,W.jsxs)(`dl`,{className:`mt-2 grid grid-cols-[auto_1fr] gap-2`,children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Input tokens`}),(0,W.jsx)(`dd`,{children:e.usage.inputTokens.toLocaleString()}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Output tokens`}),(0,W.jsx)(`dd`,{children:e.usage.outputTokens.toLocaleString()}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Context`}),(0,W.jsxs)(`dd`,{children:[e.contextInputTokens?.toLocaleString()??`—`,c?` / ${c.toLocaleString()}`:``]}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Exact cost`}),(0,W.jsx)(`dd`,{children:typeof e.usage.costUsd==`number`?`$${e.usage.costUsd.toFixed(4)} (${e.usage.costKind??`estimated`})`:`Unknown`}),e.lastOutcome&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Last step tokens`}),(0,W.jsxs)(`dd`,{children:[e.lastOutcome.budget.tokensUsed.toLocaleString(),` / `,e.lastOutcome.budget.tokenBudget?.toLocaleString()??`unlimited`]}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Tool calls`}),(0,W.jsxs)(`dd`,{children:[e.lastOutcome.budget.iterations,` / `,e.lastOutcome.budget.maxToolIterations]}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Stopped because`}),(0,W.jsx)(`dd`,{children:e.lastOutcome.stopReason})]})]}),e.compaction!==null&&(0,W.jsxs)(`details`,{className:`mt-2`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`Summary of older messages`}),(0,W.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words`,children:JSON.stringify(e.compaction,null,2)})]})]})]}),e.workers.length>0&&(0,W.jsxs)(`section`,{className:`space-y-3 pt-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Agents`}),e.workers.map(t=>(0,W.jsxs)(vn,{className:`block rounded-xl bg-muted/30 p-3 text-xs transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,to:`/console/${e.session.id}?worker=${encodeURIComponent(t.id)}`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate font-medium`,children:t.name}),(0,W.jsx)(`span`,{className:`shrink-0 capitalize text-muted-foreground`,children:t.status})]}),(0,W.jsx)(`p`,{className:`mt-1 line-clamp-2 leading-5 text-muted-foreground`,children:t.task})]},t.id)),(0,W.jsx)(J,{size:`sm`,variant:`outline`,disabled:!e.workers.some(e=>[`running`,`queued`,`parked`].includes(e.status)),onClick:i,children:`Stop all`})]}),u&&(0,W.jsxs)(`section`,{className:`space-y-3 pt-2`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.harness?.label||`Extensions`}),e.harness?(0,W.jsxs)(W.Fragment,{children:[e.harness.error&&(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:e.harness.error}),e.harness.views.map(({providerId:e,view:t})=>(0,W.jsxs)(`div`,{className:`space-y-3 rounded-xl bg-muted/30 p-3`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium`,children:t.title}),t.blocks.map((e,t)=>(0,W.jsx)(uJ,{block:e,stagePrompt:n},t))]},e)),e.harness.commands.map(n=>(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(J,{className:`w-full justify-start`,variant:`outline`,size:`sm`,disabled:t||e.session.status!==`ready`||!e.harness?.generationId,onClick:()=>a(n.providerId,{kind:`command`,id:n.id}),children:n.label}),n.description&&(0,W.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:n.description})]},`${n.providerId}:${n.id}`)),e.harness.settings.map(n=>(0,W.jsxs)(`label`,{className:`block space-y-2 rounded-xl bg-muted/30 p-3 text-xs`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:n.label}),n.description&&(0,W.jsx)(`span`,{className:`block text-muted-foreground`,children:n.description}),n.type===`boolean`?(0,W.jsx)(cJ,{"aria-label":n.label,checked:!!n.value,disabled:t||e.session.status!==`ready`||!e.harness?.generationId,onCheckedChange:e=>a(n.providerId,{kind:`setting`,id:n.id,value:e})}):n.type===`select`?(0,W.jsx)(yI,{"aria-label":n.label,value:String(n.value),disabled:t||e.session.status!==`ready`||!e.harness?.generationId,onValueChange:e=>a(n.providerId,{kind:`setting`,id:n.id,value:e}),options:n.options??[]}):(0,W.jsx)(`input`,{className:`w-full rounded-xl border border-transparent bg-muted/40 p-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,defaultValue:String(n.value),disabled:t||e.session.status!==`ready`||!e.harness?.generationId,onBlur:e=>{e.target.value!==n.value&&a(n.providerId,{kind:`setting`,id:n.id,value:e.target.value})}})]},`${e.harness?.generationId}:${n.providerId}:${n.id}`)),(0,W.jsxs)(`details`,{className:`p-3 text-xs`,children:[(0,W.jsx)(`summary`,{className:`rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 cursor-pointer text-muted-foreground`,children:`Extension details`}),(0,W.jsxs)(`p`,{className:`mt-2 text-muted-foreground`,children:[e.harness.status,` · `,e.harness.trusted?`Trusted`:`Sandboxed`]}),(0,W.jsx)(`pre`,{className:`mt-2 max-h-96 overflow-auto whitespace-pre-wrap break-words`,children:JSON.stringify({providers:e.harness.providers,commands:e.harness.commands,settings:e.harness.settings},null,2)})]})]}):(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Not ready yet.`})]}),e.tools.length>0&&(0,W.jsxs)(`details`,{className:`space-y-2 pt-2`,children:[(0,W.jsxs)(`summary`,{className:`cursor-pointer text-sm font-semibold text-foreground`,children:[`Tools · `,e.tools.length]}),(0,W.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.tools.map(e=>(0,W.jsxs)(`details`,{className:`rounded-xl bg-muted/30 p-3 text-xs`,children:[(0,W.jsx)(`summary`,{className:`rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 cursor-pointer font-medium`,children:e.name}),(0,W.jsx)(`p`,{className:`mt-2 leading-5 text-muted-foreground`,children:e.description}),(0,W.jsx)(`pre`,{className:`mt-2 max-h-72 overflow-auto whitespace-pre-wrap break-words`,children:JSON.stringify(e.inputSchema,null,2)})]},e.name))})]})]})}function uJ({block:e,stagePrompt:t}){return e.type===`markdown`?(0,W.jsx)(Dq,{text:e.text}):e.type===`text`?(0,W.jsx)(`p`,{className:`whitespace-pre-wrap text-xs leading-5`,children:e.text}):e.type===`progress`?(0,W.jsxs)(`div`,{className:`text-xs`,children:[(0,W.jsxs)(`div`,{children:[e.label,` · `,e.value,` / `,e.max]}),(0,W.jsx)(`progress`,{className:`mt-1 h-2 w-full accent-primary`,max:e.max,value:e.value})]}):e.type===`action`?(0,W.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>t(e.prompt),children:e.label}):(0,W.jsx)(`div`,{className:`overflow-x-auto`,children:(0,W.jsxs)(`table`,{className:`w-full text-left text-xs`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsx)(`tr`,{children:e.columns.map((e,t)=>(0,W.jsx)(`th`,{className:`p-1`,children:e},t))})}),(0,W.jsx)(`tbody`,{children:e.rows.map((e,t)=>(0,W.jsx)(`tr`,{children:e.map((e,t)=>(0,W.jsx)(`td`,{className:`border-t border-border p-1`,children:e},t))},t))})]})})}function dJ({status:e}){if(e===`ready`||e===`closed`)return null;let t=e===`working`?`Responding`:e===`waiting`?`Waiting for you`:`Needs attention`;return(0,W.jsx)(`span`,{role:`status`,"aria-label":t,title:t,className:`flex size-7 shrink-0 items-center justify-center`,children:e===`working`?(0,W.jsx)(RI,{className:`console-loading-dots-compact text-muted-foreground`}):e===`waiting`?(0,W.jsx)(Ya,{"aria-hidden":`true`,className:`size-4 text-amber-400`}):(0,W.jsx)(pa,{"aria-hidden":`true`,className:`size-4 text-red-400/80`})})}function fJ({workspace:e,selectedId:t,onCreate:n,onArchiveLive:r,onArchive:i,onDeleteLive:a,onResume:o,onDelete:s,onSelect:c}){let[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(!1),p=l.trim().toLowerCase(),m=e.sessions.filter(e=>!d&&e.status!==`closed`&&((e.messageCount??0)>0||e.status!==`ready`)&&`${e.title??``} ${e.target} ${e.role} ${e.runtime?.model??``} ${e.status}`.toLowerCase().includes(p)),h=new Set(e.sessions.filter(e=>e.status!==`closed`).flatMap(e=>[e.id,...`savedId`in e&&typeof e.savedId==`string`?[e.savedId]:[]])),g=e.saved.filter(e=>e.messageCount>0&&!h.has(e.id)).filter(e=>!!e.archived===d).filter(e=>`${e.summary??``} ${e.preview} ${e.target??``} ${e.model??``}`.toLowerCase().includes(p));return(0,W.jsxs)(`div`,{className:`session-rail flex h-full min-h-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:`shrink-0 space-y-2 p-2`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`relative h-9 w-full rounded-lg pl-8 pr-3 text-left text-sm font-normal text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:opacity-50`,disabled:e.busy,onClick:n,children:[(0,W.jsx)(Co,{"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 top-2.5 size-3.5`}),`New chat`]}),(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(fo,{className:`pointer-events-none absolute left-2.5 top-2.5 size-3.5 text-muted-foreground`}),(0,W.jsx)(af,{value:l,onChange:e=>u(e.target.value),className:`h-9 pl-8 text-sm`,placeholder:`Search chats`,"aria-label":`Search chats`})]})]}),(0,W.jsxs)(`div`,{id:`chat-sidebar-list`,className:`min-h-0 flex-1 space-y-0.5 overflow-y-auto p-2`,"aria-label":d?`Archived chats`:`Chats`,children:[m.map(n=>(0,W.jsxs)(`div`,{className:q(`session-row group relative flex items-center rounded-xl`,t===n.id?`bg-muted`:`hover:bg-muted/50`),children:[(0,W.jsx)(vn,{to:`/console/${n.id}`,onClick:c,className:`min-w-0 flex-1 rounded-xl px-3 py-2.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,title:n.target||void 0,children:(0,W.jsx)(`div`,{className:`truncate text-sm`,children:n.title||n.target||`Untitled chat`})}),(0,W.jsx)(dJ,{status:n.status}),(0,W.jsxs)(`div`,{className:`session-row-actions mr-1 flex shrink-0 items-center opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 max-lg:opacity-100 [@media(hover:none)]:opacity-100`,children:[(0,W.jsx)(`button`,{type:`button`,"aria-label":`Archive ${n.title||`chat`}`,title:`Archive chat`,disabled:e.busy||!n.messageCount,onClick:()=>r(n),className:`flex size-7 items-center justify-center rounded-lg hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:opacity-50`,children:(0,W.jsx)(ea,{"aria-hidden":`true`,className:`size-4`})}),(0,W.jsx)(`button`,{type:`button`,"aria-label":`Delete ${n.title||`chat`}`,title:`Delete chat`,disabled:e.busy,onClick:()=>a(n),className:`flex size-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-red-500/10 hover:text-red-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:opacity-50`,children:(0,W.jsx)(Do,{"aria-hidden":`true`,className:`size-4`})})]})]},n.id)),g.map(t=>(0,W.jsxs)(`div`,{className:`session-row group flex items-center rounded-xl hover:bg-muted/50`,children:[(0,W.jsx)(`button`,{type:`button`,className:`min-w-0 flex-1 rounded-xl px-3 py-2.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 text-left`,title:`${new Date(t.savedAt).toLocaleDateString()} · ${t.messageCount} messages`,onClick:()=>o(t),children:(0,W.jsx)(`div`,{className:`truncate text-sm`,children:t.summary||t.target||t.preview||`Past chat`})}),(0,W.jsxs)(`div`,{className:`session-row-actions mr-1 flex shrink-0 items-center opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 max-lg:opacity-100 [@media(hover:none)]:opacity-100`,children:[(0,W.jsx)(`button`,{type:`button`,"aria-label":`${d?`Restore`:`Archive`} ${t.summary||t.target||`chat`}`,title:d?`Restore chat`:`Archive chat`,disabled:e.busy,onClick:()=>i(t,!d),className:`flex size-7 items-center justify-center rounded-lg hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:opacity-50`,children:d?(0,W.jsx)($i,{"aria-hidden":`true`,className:`size-4`}):(0,W.jsx)(ea,{"aria-hidden":`true`,className:`size-4`})}),(0,W.jsx)(`button`,{type:`button`,"aria-label":`Delete ${t.summary||t.target||`chat`}`,title:`Delete chat`,disabled:e.busy,onClick:()=>s(t),className:`flex size-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-red-500/10 hover:text-red-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 disabled:opacity-50`,children:(0,W.jsx)(Do,{"aria-hidden":`true`,className:`size-4`})})]})]},t.id)),!m.length&&!g.length&&(0,W.jsx)(`p`,{className:`px-2 py-6 text-center text-xs text-muted-foreground`,children:p?`No matching chats.`:d?`No archived chats.`:`No chats yet.`})]}),(0,W.jsx)(`div`,{className:`space-y-2 p-3 lg:hidden`,children:(0,W.jsxs)(`div`,{className:`flex items-center justify-between text-sm text-muted-foreground`,children:[(0,W.jsxs)(vn,{to:t?`/settings?session=${encodeURIComponent(t)}&return=${encodeURIComponent(`/console/${t}`)}`:`/settings`,className:`flex items-center gap-1.5 rounded-lg px-1 py-1 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,children:[(0,W.jsx)(mo,{className:`size-3.5`}),`Settings`]}),(0,W.jsxs)(vn,{to:`/findings`,className:`flex items-center gap-1.5 rounded-lg px-1 py-1 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,children:[(0,W.jsx)(go,{className:`size-3.5`}),`Findings`]})]})}),(0,W.jsx)(`div`,{className:`shrink-0 p-2 pt-1`,children:(0,W.jsxs)(`button`,{type:`button`,"aria-controls":`chat-sidebar-list`,"aria-pressed":d,onClick:()=>f(e=>!e),className:q(`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,d?`bg-muted text-foreground`:`text-muted-foreground`),children:[(0,W.jsx)(ea,{"aria-hidden":`true`,className:`size-4 shrink-0`}),d?`Back to chats`:`Archived chats`]})})]})}function pJ(e,t,n){if(t.length===0&&n===e.cursor)return e;let r=e,i=new Map(e.events.map(e=>[e.sequence,e]));for(let n of t)if(!(n.sequence<=e.cursor)){if(n.type===`snapshot`){r=n.snapshot,i.clear();for(let e of r.events)i.set(e.sequence,e);continue}switch(n.type===`clear`&&(i.clear(),r={...r,messages:[],pendingDecisions:[],lastOutcome:null,objective:``,todos:null}),i.set(n.sequence,n),n.type){case`user`:r={...r,lastOutcome:null,stagedPrompt:void 0};break;case`session`:r={...r,session:n.session,execution:n.session.execution??r.execution,title:n.session.title??r.title};break;case`decision`:r={...r,pendingDecisions:[...r.pendingDecisions.filter(e=>e.id!==n.decision.id),n.decision]};break;case`decision-resolved`:r={...r,pendingDecisions:r.pendingDecisions.filter(e=>e.id!==n.decisionId)};break;case`worker`:{let e=r.workers.find(e=>e.id===n.worker.id),t=n.worker;if(e&&`incremental`in n&&n.incremental===!0){let r=new Map(e.transcript.map(e=>[e.turn,e]));for(let e of n.worker.transcript)r.set(e.turn,e);let i=new Map((e.operatorMessages??[]).map(e=>[e.id,e]));for(let e of n.worker.operatorMessages??[])i.set(e.id,e);t={...e,...n.worker,transcript:Array.from(r.values()).sort((e,t)=>e.turn-t.turn),operatorMessages:Array.from(i.values())}}r={...r,workers:[...r.workers.filter(e=>e.id!==t.id),t]};break}case`queued`:r={...r,queuedMessages:n.messages};break;case`state`:r={...r,objective:n.objective,todos:n.todos};break;case`harness`:r={...r,harness:n.harness};break;case`compaction`:r={...r,compaction:n.compaction};break;case`turn-complete`:r={...r,lastOutcome:n}}}return{...r,cursor:n,events:Array.from(i.values()).sort((e,t)=>e.sequence-t.sequence)}}function mJ(e,t){let n=Vr(),r=ni({queryKey:[`console-sessions`],queryFn:({signal:e})=>Ci(e),refetchInterval:2e3}),i=ni({queryKey:[`console-saved`],queryFn:({signal:e})=>wi(e),refetchInterval:5e3}),[a,o]=ov(`0-console-drafts`,{}),s=a&&typeof a==`object`&&!Array.isArray(a)?a:{},[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)([]),[m,h]=(0,S.useState)(0),g=`${e??`new`}:${t??`root`}`,_=typeof s[g]==`string`?s[g]:``,v=c?.session.id===e?c:null;(0,S.useEffect)(()=>{if(!e)return;let t=new AbortController,{signal:n}=t,r=null;return(async()=>{let t=0;for(;!n.aborted;){try{if(!r||Date.now()-t>1800)r=await Ei(e,n),t=Date.now();else{let t=await Di(e,r.cursor,n);r=t.snapshot?t.snapshot:t.gap?await Ei(e,n):pJ(r,t.events,t.cursor)}if(n.aborted)break;l(r),d(t=>t?.source===`poll`&&t.sessionId===e?null:t)}catch(t){if(n.aborted)break;d({sessionId:e,source:`poll`,message:t instanceof Error?t.message:String(t)}),r=null}let{promise:i,resolve:a}=Promise.withResolvers(),o=()=>{clearTimeout(s),n.removeEventListener(`abort`,o),a()},s=setTimeout(o,r?350:1500);n.addEventListener(`abort`,o,{once:!0}),n.aborted&&o(),await i}})(),()=>t.abort()},[e,m]);let y=()=>{h(e=>e+1),n.invalidateQueries({queryKey:[`console-sessions`]}),n.invalidateQueries({queryKey:[`console-saved`]})},b=async(t,n=e)=>{let r=n??`global`;p(e=>[...e,r]),d(null);try{let e=await t();return y(),e}catch(e){d({sessionId:n,source:`action`,message:e instanceof Error?e.message:String(e)});return}finally{p(e=>{let t=e.indexOf(r);return t<0?e:e.filter((e,n)=>n!==t)})}};return{snapshot:v,sessionsLoaded:r.isSuccess,sessions:r.data??[],saved:i.data??[],loading:!!(e&&!v&&!(u&&(!u.sessionId||u.sessionId===e))),error:u&&(u.source===`action`||!u.sessionId||u.sessionId===e)?u.message:(r.error??i.error)?.message,dismissError:()=>d(null),busy:f.length>0,draft:_,setDraft:e=>o(t=>({...t,[g]:e})),setRootDraft:t=>o(n=>({...n,[`${e??`new`}:root`]:t})),forgetDrafts:e=>o(t=>Object.fromEntries(Object.entries(t).filter(([t])=>!t.startsWith(`${e}:`)))),perform:b,send:async t=>{if(!e)return!1;let n=_,r=g;return await b(()=>Oi(e,t))?(o(e=>e[r]===n?{...e,[r]:``}:e),!0):!1},create:e=>b(()=>Ti(e),void 0),refresh:y}}function hJ(){let{sessionId:e}=at(),[t,n]=wn(),r=rt(),i=t.get(`worker`),a=mJ(e,i),o=ni({queryKey:[`console-settings`],queryFn:({signal:e})=>G(`/api/console/settings`,{signal:e}),refetchInterval:5e3}),s=a.snapshot,c=s?.workers.find(e=>e.id===i),l=i?!!(c?.transcript.length||c?.operatorMessages?.length):!!s?.messages.some(e=>e.content.length>0),[u,d]=ov(`0-console-active-session`,null),f=(0,S.useRef)(!1),p=(0,S.useRef)(null),m=(0,S.useRef)(!1),h=(0,S.useRef)(!1),[g,_]=(0,S.useState)(!1),[v,y]=(0,S.useState)(!1),b=(0,S.useRef)(new Set),[x,C]=(0,S.useState)(()=>window.matchMedia(`(min-width: 1536px)`).matches),[w,T]=(0,S.useState)(!1),[E,D]=(0,S.useState)(``),[O,k]=(0,S.useState)(`queue`),[A,j]=(0,S.useState)(null),[M,N]=(0,S.useState)(``),[P,F]=(0,S.useState)(null),[I,L]=(0,S.useState)(null),[R,z]=(0,S.useState)(`root`),[ee,B]=(0,S.useState)(``),[V,H]=(0,S.useState)(!1),[te,U]=(0,S.useState)(`Continue the remaining task from the preserved conversation and plan. Do not repeat completed work.`),[ne,re]=(0,S.useState)(null),ie=(0,S.useRef)(new Set),ae=(0,S.useRef)(null),oe=t.get(`finding`),se=t.get(`intent`),ce=e?`?session=${encodeURIComponent(e)}&return=${encodeURIComponent(`/console/${e}${i?`?worker=${encodeURIComponent(i)}`:``}`)}`:`?return=/console`,le=s&&[`working`,`waiting`].includes(s.session.status),ue=a.error&&a.error!==s?.lastOutcome?.error?a.error:void 0,de=a.error&&(0,W.jsx)(`p`,{role:`alert`,className:`rounded-md border border-destructive/30 bg-destructive/5 p-3 text-xs leading-5 text-destructive`,children:a.error});(0,S.useEffect)(()=>{if(!s?.todos?.todos.length||!x)return;let e=s.session.id;b.current.has(e)||(b.current.add(e),y(!0))},[s?.session.id,s?.todos,x]),(0,S.useEffect)(()=>{document.documentElement.dataset.reducedMotion=o.data?.settings.reduceMotion===!0?`true`:`false`},[o.data?.settings.reduceMotion]),(0,S.useEffect)(()=>{let e=o.data?.settings.busyInputMode;(e===`queue`||e===`steer`)&&k(e)},[o.data?.settings.busyInputMode]),(0,S.useEffect)(()=>{let e=window.matchMedia(`(min-width: 1536px)`),t=()=>C(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,S.useEffect)(()=>{e?d(e):!oe&&t.get(`new`)!==`1`&&u&&a.sessions.some(e=>e.id===u&&e.status!==`closed`)&&r(`/console/${u}${t.get(`search`)===`1`?`?search=1`:``}`,{replace:!0})},[e,u,a.sessions,oe,r,d,t]);let fe=e=>{let t=s?.session.id===e.id?s:void 0,n=t?.session??e;return n.status!==`ready`||n.messageCount!==0?!1:!t||t.messages.length===0&&t.queuedMessages.length===0&&!t.stagedPrompt&&!t.events.some(e=>e.type===`user`)},pe=()=>a.sessions.find(t=>t.id===e&&fe(t))??a.sessions.find(fe),me=async()=>{if(f.current)return;_(!1);let n=pe();if(n){n.id===e?t.get(`new`)===`1`&&r(`/console/${n.id}`,{replace:!0}):r(`/console/${n.id}${t.get(`search`)===`1`?`?search=1`:``}`,{replace:!e}),requestAnimationFrame(()=>document.querySelector(`textarea[aria-autocomplete="list"]`)?.focus());return}f.current=!0;try{let e=await a.create({title:`New chat`,role:`audit`,autonomyMode:`standard`});e&&r(`/console/${e.id}${t.get(`search`)===`1`?`?search=1`:``}`)}finally{f.current=!1}};(0,S.useEffect)(()=>{if(e||oe||t.get(`new`)===`1`||!a.sessionsLoaded||m.current)return;m.current=!0;let n=a.sessions.find(e=>e.id===u&&e.status!==`closed`);n?r(`/console/${n.id}${t.get(`search`)===`1`?`?search=1`:``}`,{replace:!0}):me()},[e,oe,t,a.sessionsLoaded,u]),(0,S.useEffect)(()=>{if(t.get(`search`)!==`1`||!e)return;window.matchMedia(`(min-width: 1024px)`).matches?p.current?.querySelector(`input[aria-label="Search chats"]`)?.focus():_(!0);let r=new URLSearchParams(t);r.delete(`search`),n(r,{replace:!0})},[e,t,n]),(0,S.useEffect)(()=>{if(t.get(`new`)!==`1`){h.current=!1;return}h.current||!a.sessionsLoaded||(h.current=!0,me())},[t,a.sessionsLoaded]),(0,S.useEffect)(()=>{if(!oe){ae.current=null;return}let e=`${oe}:${se??`investigate`}`;if(ae.current===e)return;ae.current=e;let t=se===`verify`||se===`draft_fix`||se===`impact`?se:`investigate`;a.create({findingId:oe,findingIntent:t}).then(n=>{n&&ae.current===e&&r(`/console/${n.id}${t===`impact`?`?intent=impact`:``}`,{replace:!0})})},[oe,se]),(0,S.useEffect)(()=>{i||!s?.stagedPrompt||ie.current.has(s.session.id)||(ie.current.add(s.session.id),a.draft||a.setDraft(s.stagedPrompt))},[s?.session.id,s?.stagedPrompt,i]);let he=async(e,t=!1,n=!1,r)=>{let i=await a.perform(()=>Ri(e,t,r),e);if(i&&(L(i),z(r?`worker`:`root`),B(``),n))try{await navigator.clipboard.writeText(i.text),B(`Copied`)}catch{B(`Couldn't copy. Select the text below or download it.`)}},ge=t=>{if(!I)return;let n=new Blob([t===`json`?JSON.stringify(I.messages,null,2):I.text],{type:t===`json`?`application/json`:`text/plain;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`0-conversation-${e??`saved`}.${t}`,i.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)},_e=async()=>{let t=a.draft.trim();if(!t||a.busy)return;if(D(``),t.length>32e3){D(`Message is too long (max 32,000 characters).`);return}let n=LI(t);if(n.isSlash){if(n.isUnknown){D(`Unknown command /${n.rawName}. Type /help to see commands.`);return}let t={onboard:`/setup`,capabilities:`/tools`,tools:`/tools`,settings:`/settings`,keybindings:`/settings`,theme:`/settings`,connect:`/connections`,model:`/models`,history:`/runs`,findings:`/findings`,launcher:`/audits`,ops:`/dashboard`,hackstore:`/plugins`,scope:`/project`,doctor:`/doctor`,fix:`/fix`},c=n.command;if(i&&(c===`clear`||c===`exit`)){D(`Switch back to the main conversation to use /${c}.`);return}if(c===`help`){T(!0),a.setDraft(``);return}if(c===`new-chat`){me();return}if(c===`sessions`){_(!0),a.setDraft(``);return}if(c===`status`||c===`usage`){y(!0),a.setDraft(``);return}if(c===`chat`){r(e?`/console/${e}`:`/console`),a.setDraft(``);return}if(c===`back`){a.setDraft(``),r(-1);return}if(c===`copy`){e&&(await he(e,!1,!0,i??void 0),a.setDraft(``));return}if(c===`clear`||c===`exit`){e&&F({kind:c===`clear`?`clear`:`close`,id:e,title:s?.title??`this conversation`});return}if(c===`model`&&n.args&&e){await a.perform(()=>Ai(e,{runtime:{model:n.args}}))&&a.setDraft(``);return}if(c===`theme`&&n.args){await a.perform(async()=>{let e=await G(`/api/console/settings`,{method:`PATCH`,body:JSON.stringify({key:`theme`,value:n.args,scope:`global`})});if(e.persisted===!1)throw Error(`Couldn't save the theme.`);return await o.refetch(),e})&&(a.setDraft(``),D(`Theme set to ${n.args}.`));return}if(c===`feedback`){if(n.args===`cancel`){await a.perform(()=>G(`/api/console/feedback`,{method:`POST`,body:JSON.stringify({action:`cancel`})}))&&(re(null),a.setDraft(``),D(`Feedback cancelled.`));return}if(n.args===`send`){ne?.previewId?D(`Review your feedback in the dialog, then send it.`):D(`Use /feedback submit <message> first.`);return}let e=n.args.startsWith(`submit `),t=e?n.args.slice(7).trim():n.args;if(!t){D(`Use /feedback <message> to save it, or /feedback submit <message> to send it.`);return}let r=await a.perform(()=>G(`/api/console/feedback`,{method:`POST`,body:JSON.stringify({message:t,submit:e})}));r&&(a.setDraft(``),r.previewId?re(r):D(r.error??`Feedback saved${r.path?` to ${r.path}`:``}. Nothing was sent.`));return}if(c===`explain`){if(!e||le){D(`Wait until 0 finishes, then try again.`);return}if(!n.args&&!s?.messages.length){D(`Nothing to explain yet. Use /explain <topic>.`);return}let t=n.args?`Explain "${n.args}"`:`Explain your previous result`;await a.send({text:`${t} like I am five years old. Use 3–5 very short sentences, mostly under 12 words each. Use familiar everyday words and one simple comparison. No jargon, acronyms, code, headings, or baby talk. Say what happened, why it matters, and one thing to do next. Keep the facts accurate and say plainly what is not yet confirmed. Explain only; do not run new tests or tools.`,mode:`send`,...i?{workerId:i}:{}});return}if(t[c]){let e=c===`theme`?`&tab=appearance`:c===`keybindings`?`&tab=keybindings`:``;c===`fix`&&n.args&&(e=n.args===`cancel`?`&intent=cancel`:n.args.startsWith(`publish `)?`&finding=${encodeURIComponent(n.args.slice(8).trim())}&intent=publish`:`&finding=${encodeURIComponent(n.args)}`),a.setDraft(``),r(`${t[c]}${ce}${e}`);return}D(`/${c} isn't available here.`);return}if(!e||i&&!c){D(`Pick a conversation first.`);return}await a.send({text:t,mode:i?`send`:le?O:`send`,...i?{workerId:i}:{}})},ve=(0,W.jsx)(fJ,{workspace:a,selectedId:e,onCreate:()=>{_(!1),me()},onRename:e=>{j(e),N(e.title||e.target)},onArchiveLive:t=>{a.perform(()=>zi(t.id),t.id).then(n=>{n&&e===t.id&&(d(null),r(`/console`,{replace:!0}))})},onArchive:(e,t)=>{a.perform(()=>zi(e.id,!0,t),e.id)},onResume:e=>{a.perform(()=>Ii(e.id,{}),e.id).then(e=>{e&&(_(!1),r(`/console/${e.id}`))})},onDelete:e=>F({kind:`delete`,id:e.id,title:e.summary||e.target||`this conversation`}),onExport:(e,t)=>void he(e,t),onSelect:()=>_(!1),onDeleteLive:e=>F({kind:`delete-live`,id:e.id,title:e.title||e.target||`this conversation`})}),ye=s&&(0,W.jsx)(lJ,{snapshot:s,busy:a.busy,stagePrompt:e=>{a.setRootDraft(e),r(`/console/${s.session.id}`),D(`Added a draft message. Review it, then send.`)},onScope:()=>r(`/project${ce}`),onDrain:()=>F({kind:`drain`,id:s.session.id,title:s.title}),onHarness:(e,t)=>{let n=s.harness?.generationId;if(!n){D(`Tools aren't ready yet.`);return}a.perform(()=>G(`/api/console/sessions/${encodeURIComponent(s.session.id)}/harness`,{method:`POST`,body:JSON.stringify({generationId:n,providerId:e,event:t})})).then(e=>{e?.requestedPrompt&&(a.setRootDraft(e.requestedPrompt),r(`/console/${s.session.id}`),D(`Added a draft message. Review it, then send.`))})}});return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{"data-reduced-motion":o.data?.settings.reduceMotion===!0?`true`:void 0,className:`console-frame flex min-w-0 overflow-hidden bg-background`,children:[(0,W.jsx)(hc,{settingsHref:`/settings${ce}`}),(0,W.jsx)(`aside`,{ref:p,className:`hidden w-64 shrink-0 lg:block`,children:ve}),(0,W.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,W.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-2 px-3 py-3 sm:px-5`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,W.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open conversations`,className:`lg:hidden`,onClick:()=>_(!0),children:(0,W.jsx)(Ja,{className:`size-4`})}),(0,W.jsx)(`div`,{className:`min-w-0`,children:(0,W.jsx)(`h1`,{className:`truncate text-sm font-semibold`,children:s?.title||`Chat`})})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[s&&(0,W.jsx)(sJ,{sendBehavior:O,onSendBehaviorChange:k,snapshot:s,workerId:i,active:[`working`,`waiting`].includes(s.session.status),onSelect:e=>{let r=new URLSearchParams(t);e?r.set(`worker`,e):r.delete(`worker`),n(r)}}),(0,W.jsx)(J,{size:`icon-sm`,variant:`ghost`,className:`lg:hidden`,"aria-label":`New chat`,onClick:()=>void me(),children:(0,W.jsx)(ro,{className:`size-4`})}),s&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(hP,{children:[(0,W.jsx)(hP.Trigger,{"aria-label":`Chat actions`,className:`flex size-8 items-center justify-center rounded-full hover:bg-muted focus-visible:outline-2 focus-visible:outline-primary`,children:(0,W.jsx)(`button`,{type:`button`,children:(0,W.jsx)(Ea,{className:`size-4`})})}),(0,W.jsxs)(hP.Content,{align:`end`,children:[(0,W.jsx)(hP.Item,{icon:(0,W.jsx)(eo,{className:`size-4`}),onClick:()=>{j(s.session),N(s.title)},children:`Rename`}),(0,W.jsx)(hP.Item,{disabled:!l,icon:(0,W.jsx)(Sa,{className:`size-4`}),onClick:()=>void he(s.session.id,!1,!0,i??void 0),children:`Copy chat`}),(0,W.jsx)(hP.Item,{disabled:!l,icon:(0,W.jsx)(Ta,{className:`size-4`}),onClick:()=>void he(s.session.id,!1,!1,i??void 0),children:`Export`}),(0,W.jsx)(hP.Item,{disabled:!l,icon:(0,W.jsx)(Da,{className:`size-4`}),onClick:()=>F({kind:`clear`,id:s.session.id,title:s.title}),children:`Clear chat`}),(0,W.jsx)(hP.Item,{icon:(0,W.jsx)(Po,{className:`size-4`}),onClick:()=>F({kind:`close`,id:s.session.id,title:s.title}),children:`Close chat`}),(0,W.jsx)(hP.Item,{variant:`danger`,icon:(0,W.jsx)(Do,{className:`size-4`}),onClick:()=>F({kind:`delete-live`,id:s.session.id,title:s.title}),children:`Delete chat`})]})]}),(0,W.jsx)(J,{size:`icon-sm`,variant:v?`secondary`:`ghost`,"aria-label":`Details`,onClick:()=>y(e=>!e),children:(0,W.jsx)($a,{className:`size-4`})})]})]})]}),(ue||E)&&(0,W.jsxs)(`div`,{role:ue?`alert`:`status`,className:`flex shrink-0 items-start justify-between gap-3 px-4 py-3 text-xs leading-5 ${ue?`bg-destructive/5 text-destructive`:`bg-muted/30 text-muted-foreground`}`,children:[(0,W.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:ue?HI(ue):E}),ue&&VI(ue)&&(0,W.jsx)(J,{asChild:!0,size:`sm`,children:(0,W.jsx)(vn,{to:`/connections${ce}`,children:`Manage connection`})}),(0,W.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>{a.dismissError(),a.error&&a.refresh(),D(``)},children:`Dismiss`})]}),s?.focusedFinding&&(0,W.jsxs)(`details`,{className:`shrink-0 bg-muted/10 px-4 py-3 text-xs`,open:t.get(`intent`)===`impact`,children:[(0,W.jsxs)(`summary`,{className:`cursor-pointer font-medium`,children:[s.focusedFinding.title,` · `,s.focusedFinding.severity]}),(0,W.jsxs)(`div`,{className:`max-h-64 space-y-3 overflow-auto pt-3`,children:[(0,W.jsx)(`p`,{className:`whitespace-pre-wrap`,children:s.focusedFinding.description}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`font-medium`,children:`Impact`}),s.focusedFinding.impactAssessment?(0,W.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words`,children:JSON.stringify(s.focusedFinding.impactAssessment,null,2)}):(0,W.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Not assessed yet.`})]}),(0,W.jsx)(J,{size:`sm`,variant:`outline`,asChild:!0,children:(0,W.jsx)(vn,{to:`/fix${ce}&finding=${encodeURIComponent(s.focusedFinding.id)}`,children:`Prepare a fix`})})]})]}),a.loading||!e&&!a.error?(0,W.jsx)(zI,{}):s?i&&!c?(0,W.jsx)(`div`,{className:`grid flex-1 place-items-center p-8 text-center`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{className:`text-base font-medium`,children:`This sub-agent has ended`}),(0,W.jsx)(J,{className:`mt-4`,variant:`outline`,onClick:()=>r(`/console/${s.session.id}`),children:`Back`})]})}):(0,W.jsx)(eJ,{sendBehavior:O,workspace:a,worker:c,onSubmit:()=>void _e(),onStop:()=>void a.perform(()=>c?Ni(s.session.id,c.id):Mi(s.session.id,`cancel`)),onResolve:(e,t)=>void a.perform(()=>ji(s.session.id,e,t)),resumeCap:()=>H(!0)}):(0,W.jsx)(`div`,{className:`console-enter grid flex-1 place-items-center overflow-auto p-6`,children:(0,W.jsxs)(`div`,{className:`max-w-xl text-center`,children:[(0,W.jsx)(mc,{className:`mx-auto mb-6`}),(0,W.jsx)(`h1`,{className:`font-heading text-2xl font-medium`,children:`Hi! What do you want me to do?`}),e&&(0,W.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:`Couldn't load this conversation. Your draft is saved.`}),(0,W.jsxs)(`div`,{className:`mt-6 flex justify-center gap-3`,children:[(0,W.jsxs)(Qk,{variant:`primary`,size:`base`,className:`text-sm`,disabled:a.busy,onClick:()=>void me(),children:[(0,W.jsx)(ro,{className:`size-4`}),`New chat`]}),(0,W.jsx)(J,{variant:`ghost`,onClick:()=>_(!0),children:`History`})]})]})})]}),x&&s&&(0,W.jsx)(`aside`,{className:`console-details-panel shrink-0 overflow-hidden`,"data-open":v,"aria-hidden":!v,inert:!v,children:(0,W.jsx)(`div`,{className:`h-full w-80 overflow-y-auto`,children:ye})})]}),(0,W.jsx)(qd,{open:g,onOpenChange:_,children:(0,W.jsxs)(Xd,{side:`left`,className:`flex w-80 flex-col p-0`,children:[(0,W.jsxs)(Zd,{className:` px-4 py-4 pr-12`,children:[(0,W.jsx)(Qd,{children:`Chats`}),(0,W.jsx)($d,{className:`sr-only`,children:`Current and past chats`})]}),(0,W.jsx)(`div`,{className:`min-h-0 flex-1`,children:ve})]})}),(0,W.jsx)(qd,{open:v&&!x&&!!s,onOpenChange:y,children:(0,W.jsxs)(Xd,{side:`right`,className:`w-full overflow-y-auto p-0 sm:max-w-md`,children:[(0,W.jsxs)(Zd,{className:` px-4 py-4 pr-12`,children:[(0,W.jsx)(Qd,{children:`Details`}),(0,W.jsx)($d,{className:`sr-only`,children:`Workspace, model, usage and plan`})]}),ye]})}),(0,W.jsx)(of,{open:!!A,onOpenChange:e=>{e||j(null)},children:(0,W.jsxs)(uf,{children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:`Rename chat`}),(0,W.jsx)(mf,{className:`sr-only`,children:`Choose a new name.`}),de]}),(0,W.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),!(!A||!M.trim())&&a.perform(()=>Ai(A.id,{title:M.trim()}),A.id).then(e=>{e&&j(null)})},children:[(0,W.jsx)(af,{autoFocus:!0,value:M,onChange:e=>N(e.target.value),maxLength:200,"aria-label":`Chat name`}),(0,W.jsx)(J,{disabled:!M.trim()||a.busy,children:`Save`})]})]})}),(0,W.jsx)(of,{open:!!P,onOpenChange:e=>{e||F(null)},children:(0,W.jsxs)(uf,{children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:P?.kind===`delete-live`||P?.kind===`delete`?`Delete this conversation?`:P?.kind===`clear`?`Clear this conversation?`:P?.kind===`drain`?`Stop all sub-agents?`:`Close this conversation?`}),(0,W.jsx)(mf,{children:P?.kind===`delete-live`?`This stops it and permanently deletes its history. This can't be undone.`:P?.kind===`delete`?`This permanently deletes its history. This can't be undone.`:P?.kind===`clear`?`0 forgets the messages so far. Permissions stay the same.`:P?.kind===`drain`?`The conversation stays open.`:`This stops any running work. You can resume it later from history.`}),de]}),(0,W.jsx)(`p`,{className:`text-sm font-medium`,children:P?.title}),(0,W.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,W.jsx)(J,{variant:`outline`,onClick:()=>F(null),children:`Cancel`}),(0,W.jsx)(J,{variant:`destructive`,disabled:a.busy,onClick:()=>{if(!P)return;let t=P;a.perform(async()=>t.kind===`delete-live`?Fi(t.id):t.kind===`delete`?Li(t.id):t.kind===`close`?Pi(t.id):Mi(t.id,t.kind===`drain`?`workers/stop`:`clear`),t.id).then(n=>{n&&(F(null),t.kind===`clear`&&a.setRootDraft(``),t.kind===`delete-live`&&(a.forgetDrafts(t.id),e===t.id&&(d(null),r(`/console`,{replace:!0}))))})},children:P?.kind===`delete-live`||P?.kind===`delete`?`Delete`:P?.kind===`clear`?`Clear`:P?.kind===`drain`?`Stop`:`Close`})]})]})}),(0,W.jsx)(of,{open:!!I,onOpenChange:e=>{e||L(null)},children:(0,W.jsxs)(uf,{className:`max-h-[90dvh] sm:max-w-3xl`,children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:R===`worker`?`Export sub-agent conversation`:`Export chat`}),(0,W.jsx)(mf,{children:`May contain sensitive data. Check before sharing.`}),de]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsxs)(J,{size:`sm`,onClick:()=>{I&&navigator.clipboard.writeText(I.text).then(()=>B(`Copied`),()=>B(`Couldn't copy. Select the text below or download it.`))},children:[(0,W.jsx)(Sa,{className:`size-3`}),`Copy`]}),(0,W.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>ge(`json`),children:[(0,W.jsx)(Ta,{className:`size-3`}),`JSON`]}),(0,W.jsxs)(J,{variant:`outline`,size:`sm`,onClick:()=>ge(`txt`),children:[(0,W.jsx)(Ta,{className:`size-3`}),`Text`]})]}),ee&&(0,W.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:ee}),(0,W.jsx)(`textarea`,{className:`h-[45dvh] w-full resize-none rounded-lg border border-border bg-muted/20 p-3 font-mono text-xs leading-5`,readOnly:!0,value:I?.text??``,"aria-label":`Chat text`})]})}),(0,W.jsx)(of,{open:V,onOpenChange:H,children:(0,W.jsxs)(uf,{children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:`Keep going`}),(0,W.jsx)(mf,{children:`0 hit its output limit. Tell it what's left to do.`}),de]}),(0,W.jsx)(`textarea`,{className:`min-h-28 rounded-lg border border-border bg-background p-3 text-sm`,value:te,onChange:e=>U(e.target.value),"aria-label":`What's left to do`}),(0,W.jsx)(J,{disabled:a.busy||!te.trim()||!!le,onClick:()=>{e&&a.perform(()=>G(`/api/console/sessions/${encodeURIComponent(e)}/continue`,{method:`POST`,body:JSON.stringify({text:te.trim()})})).then(e=>{e&&H(!1)})},children:`Continue`})]})}),(0,W.jsx)(of,{open:!!ne?.previewId,onOpenChange:e=>{e||(a.perform(()=>G(`/api/console/feedback`,{method:`POST`,body:JSON.stringify({action:`cancel`})})),re(null))},children:(0,W.jsxs)(uf,{className:`max-h-[90dvh] overflow-auto`,children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:`Send feedback?`}),(0,W.jsx)(mf,{children:`Nothing has been sent yet. This is exactly what will be sent.`}),de]}),(0,W.jsx)(`pre`,{className:`max-h-[45dvh] overflow-auto whitespace-pre-wrap break-words text-xs`,children:JSON.stringify(ne?.preview,null,2)}),(0,W.jsx)(J,{disabled:a.busy,onClick:()=>{ne?.previewId&&a.perform(()=>G(`/api/console/feedback`,{method:`POST`,body:JSON.stringify({action:`send`,previewId:ne.previewId})})).then(e=>{e&&(re(null),D(e.error??(e.submitted?`Feedback sent. Thank you!`:`Feedback wasn't sent.`)))})},children:`Send feedback`})]})}),(0,W.jsx)(of,{open:w,onOpenChange:T,children:(0,W.jsxs)(uf,{className:`max-h-[85dvh] overflow-auto sm:max-w-2xl`,children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:`Commands`}),(0,W.jsx)(mf,{children:`Type / in the message box to use these.`}),de]}),(0,W.jsx)(`div`,{className:`space-y-2`,children:FI.map(e=>(0,W.jsxs)(`button`,{className:`block w-full rounded-lg border border-border p-3 text-left hover:bg-muted/30`,onClick:()=>{a.setDraft(`/${e.name}${e.name===`feedback`||e.name===`explain`?` `:``}`),T(!1)},children:[(0,W.jsxs)(`div`,{className:`font-mono text-xs`,children:[`/`,e.name]}),(0,W.jsx)(`div`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:e.description})]},e.name))})]})})]})}var gJ;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(gJ||={});var _J;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(_J||={});var vJ=gJ.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),yJ=e=>{switch(typeof e){case`undefined`:return vJ.undefined;case`string`:return vJ.string;case`number`:return Number.isNaN(e)?vJ.nan:vJ.number;case`boolean`:return vJ.boolean;case`function`:return vJ.function;case`bigint`:return vJ.bigint;case`symbol`:return vJ.symbol;case`object`:return Array.isArray(e)?vJ.array:e===null?vJ.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?vJ.promise:typeof Map<`u`&&e instanceof Map?vJ.map:typeof Set<`u`&&e instanceof Set?vJ.set:typeof Date<`u`&&e instanceof Date?vJ.date:vJ.object;default:return vJ.unknown}},Q=gJ.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),bJ=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,gJ.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};bJ.create=e=>new bJ(e);var xJ=(e,t)=>{let n;switch(e.code){case Q.invalid_type:n=e.received===vJ.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gJ.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${gJ.joinValues(e.keys,`, `)}`;break;case Q.invalid_union:n=`Invalid input`;break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gJ.joinValues(e.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${gJ.joinValues(e.options)}, received '${e.received}'`;break;case Q.invalid_arguments:n=`Invalid function arguments`;break;case Q.invalid_return_type:n=`Invalid function return type`;break;case Q.invalid_date:n=`Invalid date`;break;case Q.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:gJ.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Q.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Q.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Q.custom:n=`Invalid input`;break;case Q.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Q.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Q.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,gJ.assertNever(e)}return{message:n}},SJ=xJ;function CJ(){return SJ}var wJ=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function $(e,t){let n=CJ(),r=wJ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===xJ?void 0:xJ].filter(e=>!!e)});e.common.issues.push(r)}var TJ=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return EJ;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return EJ;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},EJ=Object.freeze({status:`aborted`}),DJ=e=>({status:`dirty`,value:e}),OJ=e=>({status:`valid`,value:e}),kJ=e=>e.status===`aborted`,AJ=e=>e.status===`dirty`,jJ=e=>e.status===`valid`,MJ=e=>typeof Promise<`u`&&e instanceof Promise,NJ;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(NJ||={});var PJ=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},FJ=(e,t)=>{if(jJ(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new bJ(e.common.issues);return this._error=t,this._error}}};function IJ(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var LJ=class{get description(){return this._def.description}_getType(e){return yJ(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:yJ(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new TJ,ctx:{common:e.parent.common,data:e.data,parsedType:yJ(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(MJ(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yJ(e)};return FJ(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yJ(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return jJ(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>jJ(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yJ(e)},r=this._parse({data:e,path:n.path,parent:n});return FJ(n,await(MJ(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Q.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new BY({schema:this,typeName:YY.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return VY.create(this,this._def)}nullable(){return HY.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xY.create(this)}promise(){return zY.create(this,this._def)}or(e){return wY.create([this,e],this._def)}and(e){return OY.create(this,e,this._def)}transform(e){return new BY({...IJ(this._def),schema:this,typeName:YY.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new UY({...IJ(this._def),innerType:this,defaultValue:t,typeName:YY.ZodDefault})}brand(){return new KY({typeName:YY.ZodBranded,type:this,...IJ(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new WY({...IJ(this._def),innerType:this,catchValue:t,typeName:YY.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return qY.create(this,e)}readonly(){return JY.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RJ=/^c[^\s-]{8,}$/i,zJ=/^[0-9a-z]+$/,BJ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,VJ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,HJ=/^[a-z0-9_-]{21}$/i,UJ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,WJ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,GJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KJ=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,qJ,JJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,YJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,XJ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ZJ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,QJ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$J=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,eY=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,tY=RegExp(`^${eY}$`);function nY(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function rY(e){return RegExp(`^${nY(e)}$`)}function iY(e){let t=`${eY}T${nY(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function aY(e,t){return!!((t===`v4`||!t)&&JJ.test(e)||(t===`v6`||!t)&&XJ.test(e))}function oY(e,t){if(!UJ.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function sY(e,t){return!!((t===`v4`||!t)&&YJ.test(e)||(t===`v6`||!t)&&ZJ.test(e))}var cY=class e extends LJ{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==vJ.string){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.string,received:t.parsedType}),EJ}let t=new TJ,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:Q.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:Q.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?$(n,{code:Q.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&$(n,{code:Q.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)GJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`email`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)qJ||=new RegExp(KJ,`u`),qJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`emoji`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)VJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`uuid`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)HJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`nanoid`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)RJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`cuid`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)zJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`cuid2`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)BJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`ulid`,code:Q.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),$(n,{validation:`url`,code:Q.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`regex`,code:Q.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?iY(r).test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?tY.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?rY(r).test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:Q.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?WJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`duration`,code:Q.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?aY(e.data,r.version)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`ip`,code:Q.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?oY(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`jwt`,code:Q.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?sY(e.data,r.version)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`cidr`,code:Q.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?QJ.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`base64`,code:Q.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?$J.test(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{validation:`base64url`,code:Q.invalid_string,message:r.message}),t.dirty()):gJ.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:Q.invalid_string,...NJ.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...NJ.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...NJ.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...NJ.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...NJ.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...NJ.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...NJ.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...NJ.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...NJ.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...NJ.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...NJ.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...NJ.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...NJ.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...NJ.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...NJ.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...NJ.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...NJ.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...NJ.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...NJ.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...NJ.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...NJ.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...NJ.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...NJ.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...NJ.errToObj(t)})}nonempty(e){return this.min(1,NJ.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};cY.create=e=>new cY({checks:[],typeName:YY.ZodString,coerce:e?.coerce??!1,...IJ(e)});function lY(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var uY=class e extends LJ{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==vJ.number){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.number,received:t.parsedType}),EJ}let t,n=new TJ;for(let r of this._def.checks)r.kind===`int`?gJ.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),$(t,{code:Q.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?lY(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),$(t,{code:Q.not_finite,message:r.message}),n.dirty()):gJ.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,NJ.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,NJ.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,NJ.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,NJ.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:NJ.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:NJ.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:NJ.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:NJ.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:NJ.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:NJ.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:NJ.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:NJ.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:NJ.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:NJ.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&gJ.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};uY.create=e=>new uY({checks:[],typeName:YY.ZodNumber,coerce:e?.coerce||!1,...IJ(e)});var dY=class e extends LJ{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==vJ.bigint)return this._getInvalidInput(e);let t,n=new TJ;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),$(t,{code:Q.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):gJ.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.bigint,received:t.parsedType}),EJ}gte(e,t){return this.setLimit(`min`,e,!0,NJ.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,NJ.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,NJ.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,NJ.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:NJ.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:NJ.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:NJ.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:NJ.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:NJ.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:NJ.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};dY.create=e=>new dY({checks:[],typeName:YY.ZodBigInt,coerce:e?.coerce??!1,...IJ(e)});var fY=class extends LJ{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==vJ.boolean){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.boolean,received:t.parsedType}),EJ}return OJ(e.data)}};fY.create=e=>new fY({typeName:YY.ZodBoolean,coerce:e?.coerce||!1,...IJ(e)});var pY=class e extends LJ{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==vJ.date){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.date,received:t.parsedType}),EJ}if(Number.isNaN(e.data.getTime()))return $(this._getOrReturnCtx(e),{code:Q.invalid_date}),EJ;let t=new TJ,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:Q.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),$(n,{code:Q.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):gJ.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:NJ.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:NJ.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};pY.create=e=>new pY({checks:[],coerce:e?.coerce||!1,typeName:YY.ZodDate,...IJ(e)});var mY=class extends LJ{_parse(e){if(this._getType(e)!==vJ.symbol){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.symbol,received:t.parsedType}),EJ}return OJ(e.data)}};mY.create=e=>new mY({typeName:YY.ZodSymbol,...IJ(e)});var hY=class extends LJ{_parse(e){if(this._getType(e)!==vJ.undefined){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.undefined,received:t.parsedType}),EJ}return OJ(e.data)}};hY.create=e=>new hY({typeName:YY.ZodUndefined,...IJ(e)});var gY=class extends LJ{_parse(e){if(this._getType(e)!==vJ.null){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.null,received:t.parsedType}),EJ}return OJ(e.data)}};gY.create=e=>new gY({typeName:YY.ZodNull,...IJ(e)});var _Y=class extends LJ{constructor(){super(...arguments),this._any=!0}_parse(e){return OJ(e.data)}};_Y.create=e=>new _Y({typeName:YY.ZodAny,...IJ(e)});var vY=class extends LJ{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OJ(e.data)}};vY.create=e=>new vY({typeName:YY.ZodUnknown,...IJ(e)});var yY=class extends LJ{_parse(e){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.never,received:t.parsedType}),EJ}};yY.create=e=>new yY({typeName:YY.ZodNever,...IJ(e)});var bY=class extends LJ{_parse(e){if(this._getType(e)!==vJ.undefined){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.void,received:t.parsedType}),EJ}return OJ(e.data)}};bY.create=e=>new bY({typeName:YY.ZodVoid,...IJ(e)});var xY=class e extends LJ{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==vJ.array)return $(t,{code:Q.invalid_type,expected:vJ.array,received:t.parsedType}),EJ;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&($(t,{code:e?Q.too_big:Q.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&($(t,{code:Q.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&($(t,{code:Q.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new PJ(t,e,t.path,n)))).then(e=>TJ.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new PJ(t,e,t.path,n)));return TJ.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:NJ.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:NJ.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:NJ.toString(n)}})}nonempty(e){return this.min(1,e)}};xY.create=(e,t)=>new xY({type:e,minLength:null,maxLength:null,exactLength:null,typeName:YY.ZodArray,...IJ(t)});function SY(e){if(e instanceof CY){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=VY.create(SY(r))}return new CY({...e._def,shape:()=>t})}return e instanceof xY?new xY({...e._def,type:SY(e.element)}):e instanceof VY?VY.create(SY(e.unwrap())):e instanceof HY?HY.create(SY(e.unwrap())):e instanceof kY?kY.create(e.items.map(e=>SY(e))):e}var CY=class e extends LJ{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=gJ.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==vJ.object){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.object,received:t.parsedType}),EJ}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof yY&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new PJ(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof yY){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&($(n,{code:Q.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new PJ(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>TJ.mergeObjectSync(t,e)):TJ.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return NJ.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:NJ.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:YY.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of gJ.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of gJ.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return SY(this)}partial(t){let n={};for(let e of gJ.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of gJ.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof VY;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return IY(gJ.objectKeys(this.shape))}};CY.create=(e,t)=>new CY({shape:()=>e,unknownKeys:`strip`,catchall:yY.create(),typeName:YY.ZodObject,...IJ(t)}),CY.strictCreate=(e,t)=>new CY({shape:()=>e,unknownKeys:`strict`,catchall:yY.create(),typeName:YY.ZodObject,...IJ(t)}),CY.lazycreate=(e,t)=>new CY({shape:e,unknownKeys:`strip`,catchall:yY.create(),typeName:YY.ZodObject,...IJ(t)});var wY=class extends LJ{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new bJ(e.ctx.common.issues));return $(t,{code:Q.invalid_union,unionErrors:n}),EJ}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new bJ(e));return $(t,{code:Q.invalid_union,unionErrors:i}),EJ}}get options(){return this._def.options}};wY.create=(e,t)=>new wY({options:e,typeName:YY.ZodUnion,...IJ(t)});var TY=e=>e instanceof PY?TY(e.schema):e instanceof BY?TY(e.innerType()):e instanceof FY?[e.value]:e instanceof LY?e.options:e instanceof RY?gJ.objectValues(e.enum):e instanceof UY?TY(e._def.innerType):e instanceof hY?[void 0]:e instanceof gY?[null]:e instanceof VY?[void 0,...TY(e.unwrap())]:e instanceof HY?[null,...TY(e.unwrap())]:e instanceof KY||e instanceof JY?TY(e.unwrap()):e instanceof WY?TY(e._def.innerType):[],EY=class e extends LJ{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==vJ.object)return $(t,{code:Q.invalid_type,expected:vJ.object,received:t.parsedType}),EJ;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):($(t,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),EJ)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=TY(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:YY.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...IJ(r)})}};function DY(e,t){let n=yJ(e),r=yJ(t);if(e===t)return{valid:!0,data:e};if(n===vJ.object&&r===vJ.object){let n=gJ.objectKeys(t),r=gJ.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=DY(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===vJ.array&&r===vJ.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=DY(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===vJ.date&&r===vJ.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var OY=class extends LJ{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(kJ(e)||kJ(r))return EJ;let i=DY(e.value,r.value);return i.valid?((AJ(e)||AJ(r))&&t.dirty(),{status:t.value,value:i.data}):($(n,{code:Q.invalid_intersection_types}),EJ)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};OY.create=(e,t,n)=>new OY({left:e,right:t,typeName:YY.ZodIntersection,...IJ(n)});var kY=class e extends LJ{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==vJ.array)return $(n,{code:Q.invalid_type,expected:vJ.array,received:n.parsedType}),EJ;if(n.data.length<this._def.items.length)return $(n,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),EJ;!this._def.rest&&n.data.length>this._def.items.length&&($(n,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new PJ(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>TJ.mergeArray(t,e)):TJ.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};kY.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new kY({items:e,typeName:YY.ZodTuple,rest:null,...IJ(t)})};var AY=class e extends LJ{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==vJ.object)return $(n,{code:Q.invalid_type,expected:vJ.object,received:n.parsedType}),EJ;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new PJ(n,e,n.path,e)),value:a._parse(new PJ(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?TJ.mergeObjectAsync(t,r):TJ.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof LJ?new e({keyType:t,valueType:n,typeName:YY.ZodRecord,...IJ(r)}):new e({keyType:cY.create(),valueType:t,typeName:YY.ZodRecord,...IJ(n)})}},jY=class extends LJ{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==vJ.map)return $(n,{code:Q.invalid_type,expected:vJ.map,received:n.parsedType}),EJ;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new PJ(n,e,n.path,[a,`key`])),value:i._parse(new PJ(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return EJ;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return EJ;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};jY.create=(e,t,n)=>new jY({valueType:t,keyType:e,typeName:YY.ZodMap,...IJ(n)});var MY=class e extends LJ{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==vJ.set)return $(n,{code:Q.invalid_type,expected:vJ.set,received:n.parsedType}),EJ;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&($(n,{code:Q.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&($(n,{code:Q.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return EJ;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new PJ(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:NJ.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:NJ.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};MY.create=(e,t)=>new MY({valueType:e,minSize:null,maxSize:null,typeName:YY.ZodSet,...IJ(t)});var NY=class e extends LJ{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==vJ.function)return $(t,{code:Q.invalid_type,expected:vJ.function,received:t.parsedType}),EJ;function n(e,n){return wJ({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,CJ(),xJ].filter(e=>!!e),issueData:{code:Q.invalid_arguments,argumentsError:n}})}function r(e,n){return wJ({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,CJ(),xJ].filter(e=>!!e),issueData:{code:Q.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof zY){let e=this;return OJ(async function(...t){let o=new bJ([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return OJ(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new bJ([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new bJ([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:kY.create(t).rest(vY.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||kY.create([]).rest(vY.create()),returns:n||vY.create(),typeName:YY.ZodFunction,...IJ(r)})}},PY=class extends LJ{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};PY.create=(e,t)=>new PY({getter:e,typeName:YY.ZodLazy,...IJ(t)});var FY=class extends LJ{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return $(t,{received:t.data,code:Q.invalid_literal,expected:this._def.value}),EJ}return{status:`valid`,value:e.data}}get value(){return this._def.value}};FY.create=(e,t)=>new FY({value:e,typeName:YY.ZodLiteral,...IJ(t)});function IY(e,t){return new LY({values:e,typeName:YY.ZodEnum,...IJ(t)})}var LY=class e extends LJ{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return $(t,{expected:gJ.joinValues(n),received:t.parsedType,code:Q.invalid_type}),EJ}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return $(t,{received:t.data,code:Q.invalid_enum_value,options:n}),EJ}return OJ(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};LY.create=IY;var RY=class extends LJ{_parse(e){let t=gJ.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==vJ.string&&n.parsedType!==vJ.number){let e=gJ.objectValues(t);return $(n,{expected:gJ.joinValues(e),received:n.parsedType,code:Q.invalid_type}),EJ}if(this._cache||=new Set(gJ.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=gJ.objectValues(t);return $(n,{received:n.data,code:Q.invalid_enum_value,options:e}),EJ}return OJ(e.data)}get enum(){return this._def.values}};RY.create=(e,t)=>new RY({values:e,typeName:YY.ZodNativeEnum,...IJ(t)});var zY=class extends LJ{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==vJ.promise&&t.common.async===!1?($(t,{code:Q.invalid_type,expected:vJ.promise,received:t.parsedType}),EJ):OJ((t.parsedType===vJ.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};zY.create=(e,t)=>new zY({type:e,typeName:YY.ZodPromise,...IJ(t)});var BY=class extends LJ{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===YY.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{$(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return EJ;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?EJ:r.status===`dirty`||t.value===`dirty`?DJ(r.value):r});{if(t.value===`aborted`)return EJ;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?EJ:r.status===`dirty`||t.value===`dirty`?DJ(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?EJ:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?EJ:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!jJ(e))return EJ;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>jJ(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):EJ)}gJ.assertNever(r)}};BY.create=(e,t,n)=>new BY({schema:e,typeName:YY.ZodEffects,effect:t,...IJ(n)}),BY.createWithPreprocess=(e,t,n)=>new BY({schema:t,effect:{type:`preprocess`,transform:e},typeName:YY.ZodEffects,...IJ(n)});var VY=class extends LJ{_parse(e){return this._getType(e)===vJ.undefined?OJ(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};VY.create=(e,t)=>new VY({innerType:e,typeName:YY.ZodOptional,...IJ(t)});var HY=class extends LJ{_parse(e){return this._getType(e)===vJ.null?OJ(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};HY.create=(e,t)=>new HY({innerType:e,typeName:YY.ZodNullable,...IJ(t)});var UY=class extends LJ{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===vJ.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};UY.create=(e,t)=>new UY({innerType:e,typeName:YY.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...IJ(t)});var WY=class extends LJ{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return MJ(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new bJ(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new bJ(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};WY.create=(e,t)=>new WY({innerType:e,typeName:YY.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...IJ(t)});var GY=class extends LJ{_parse(e){if(this._getType(e)!==vJ.nan){let t=this._getOrReturnCtx(e);return $(t,{code:Q.invalid_type,expected:vJ.nan,received:t.parsedType}),EJ}return{status:`valid`,value:e.data}}};GY.create=e=>new GY({typeName:YY.ZodNaN,...IJ(e)});var KY=class extends LJ{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},qY=class e extends LJ{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?EJ:e.status===`dirty`?(t.dirty(),DJ(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?EJ:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:YY.ZodPipeline})}},JY=class extends LJ{_parse(e){let t=this._def.innerType._parse(e),n=e=>(jJ(e)&&(e.value=Object.freeze(e.value)),e);return MJ(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};JY.create=(e,t)=>new JY({innerType:e,typeName:YY.ZodReadonly,...IJ(t)}),CY.lazycreate;var YY;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(YY||={});var XY=cY.create,ZY=uY.create;GY.create,dY.create;var QY=fY.create;pY.create,mY.create,hY.create,gY.create,_Y.create;var $Y=vY.create;yY.create,bY.create;var eX=xY.create,tX=CY.create;CY.strictCreate,wY.create,EY.create,OY.create,kY.create,AY.create,jY.create,MY.create,NY.create,PY.create;var nX=FY.create,rX=LY.create;RY.create,zY.create,BY.create,VY.create,HY.create,BY.createWithPreprocess,qY.create;var iX=Object.freeze({goal:`known-vulnerabilities`,depth:`default`,runCount:1,executionMode:`sequential`,timeCapMs:6e5,costCapUsd:5}),aX=XY().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/).refine(e=>![`__proto__`,`constructor`,`prototype`].includes(e),`Reserved identifier.`),oX=tX({goal:rX([`known-vulnerabilities`,`unknown-vulnerabilities`,`misconfigurations`]),depth:rX([`quick`,`default`,`deep`]),runCount:ZY().int().min(1).max(16),executionMode:rX([`sequential`,`parallel`]),timeCapMs:ZY().int().finite().positive().max(864e5),costCapUsd:ZY().finite().positive().max(1e3)}).strict(),sX=tX({instructions:XY().trim().max(16e3),allowedAgentTools:eX(XY().trim().min(1).max(128).regex(/^[A-Za-z0-9_.:-]+$/)).max(128).refine(e=>new Set(e).size===e.length,`Agent tool names must be unique.`).optional()}).strict(),cX=tX({id:aX,type:rX([`trigger`,`audit`,`report`]),label:XY().trim().min(1).max(160),enabled:QY(),plan:oX.optional(),execution:sX.optional()}).strict(),lX=tX({id:aX.optional(),revision:ZY().int().positive().optional(),name:XY().trim().min(1).max(160),instructions:XY().trim().max(16e3),target:XY().trim().max(4096),nodes:eX(cX).min(2).max(16),edges:eX(tX({source:aX,target:aX}).strict()).min(1).max(120)}).strict().superRefine((e,t)=>{let n=e=>t.addIssue({code:Q.custom,message:e}),r=new Set(e.nodes.map(e=>e.id));r.size!==e.nodes.length&&n(`Workflow node IDs must be unique.`);let i=e.nodes.filter(e=>e.type===`trigger`);i.length!==1&&n(`A workflow requires exactly one trigger.`),i.some(e=>!e.enabled)&&n(`The manual trigger must remain enabled.`),e.nodes.some(e=>e.type===`audit`)||n(`A workflow requires at least one audit.`),e.nodes.filter(e=>e.type===`report`).length>1&&n(`A workflow supports at most one report.`),e.nodes.some(e=>e.type!==`audit`&&(e.plan!==void 0||e.execution!==void 0))&&n(`Only audit nodes accept scan plans and execution policies.`);let a=new Set,o=new Map;for(let t of e.edges){(!r.has(t.source)||!r.has(t.target))&&n(`Edges must reference existing nodes.`);let i=`${t.source}:${t.target}`;a.has(i)&&n(`Workflow edges must be unique.`),a.add(i),o.set(t.source,[...o.get(t.source)??[],t.target]);let s=e.nodes.find(e=>e.id===t.source);(e.nodes.find(e=>e.id===t.target)?.type===`trigger`||s?.type===`report`)&&n(`Triggers must start the graph and reports must end it.`)}let s=new Set,c=new Set,l=e=>{if(s.has(e))return!1;if(c.has(e))return!0;s.add(e);for(let t of o.get(e)??[])if(!l(t))return!1;return s.delete(e),c.add(e),!0};if(e.nodes.some(e=>!l(e.id))&&n(`Workflow graphs cannot contain cycles.`),i.length===1){let t=new Set,r=e=>{if(!t.has(e)){t.add(e);for(let t of o.get(e)??[])r(t)}};r(i[0].id),e.nodes.some(e=>!t.has(e.id))&&n(`Every node must be reachable from the trigger.`)}});function uX(e){let t=lX.parse(e);return{...t,nodes:t.nodes.map(e=>e.type===`audit`?{...e,plan:e.plan??{...iX}}:e)}}var dX=tX({schemaVersion:nX(1),workflow:$Y()}).strict();function fX(e){let{name:t,instructions:n,target:r,nodes:i,edges:a}=e,o=uX({name:t,instructions:n,target:r,nodes:i,edges:a}),s=JSON.stringify({schemaVersion:1,workflow:o},null,2);if(new TextEncoder().encode(s).byteLength>65536)throw Error(`Workflow JSON must be at most 64 KiB.`);return s}function pX(e){if(typeof e==`string`){if(new TextEncoder().encode(e).byteLength>65536)throw Error(`Workflow JSON must be at most 64 KiB.`);e=JSON.parse(e)}let t=dX.parse(e);if(!t.workflow||typeof t.workflow!=`object`||Array.isArray(t.workflow))throw Error(`Workflow must be an object.`);let{id:n,revision:r,createdAt:i,updatedAt:a,...o}=t.workflow;if(new TextEncoder().encode(JSON.stringify(t)).byteLength>65536)throw Error(`Workflow JSON must be at most 64 KiB.`);return uX(o)}function mX(e,t,n,r,i=`default`){return{id:e,type:`audit`,label:t,enabled:!0,plan:{goal:n,depth:i,runCount:1,executionMode:`sequential`,timeCapMs:6e5,costCapUsd:5},execution:{instructions:r}}}function hX(e,t,n,r,i){let a=[{id:`start`,type:`trigger`,label:`Start manually`,enabled:!0},...i,{id:`report`,type:`report`,label:`Collect reports`,enabled:!0}];return{id:e,name:t,description:n,category:r,definition:uX({name:t,instructions:n,target:``,nodes:a,edges:a.slice(1).map((e,t)=>({source:a[t].id,target:e.id}))})}}var gX=[hX(`repository-review`,`Repository security review`,`Review a local repository's trust boundaries, dependency exposure, and security-sensitive code.`,`repository`,[mX(`dependencies`,`Dependency exposure`,`known-vulnerabilities`,`Inspect dependency manifests and lockfiles. Prioritize reachable vulnerable dependencies and supply-chain trust boundaries; distinguish confirmed exposure from version-only matches.`,`quick`),mX(`boundaries`,`Trust boundaries`,`unknown-vulnerabilities`,`Trace authentication, authorization, tenant isolation, and privileged entry points in the authorized repository. Follow input-to-sink paths and report only supported security findings.`,`deep`),mX(`configuration`,`Configuration and secrets`,`misconfigurations`,`Review repository configuration, credential handling, unsafe defaults, and sensitive debug surfaces. Do not expose secret values in reports.`)]),hX(`dependency-review`,`Dependency and supply-chain review`,`Assess an authorized package or repository for advisories and suspicious dependency behavior.`,`package`,[mX(`advisories`,`Advisory triage`,`known-vulnerabilities`,`Review declared and locked dependencies against supported advisory sources. Check affected versions and whether vulnerable functionality is used.`,`quick`),mX(`lifecycle`,`Lifecycle and trust`,`unknown-vulnerabilities`,`Inspect package installation hooks, dynamic downloads, credential access, and dependency trust changes. Support suspicious behavior with code evidence, without executing untrusted installation scripts.`,`deep`)]),hX(`api-security`,`API authorization review`,`Review an explicitly authorized API for authorization gaps, unsafe inputs, and exposed configuration.`,`web`,[mX(`surface`,`API surface and defaults`,`misconfigurations`,`Map documented and reachable authorized API endpoints, exposed documentation, error disclosures, and security defaults. Stay within the supplied scope and avoid destructive requests.`,`quick`),mX(`authorization`,`Authorization boundaries`,`unknown-vulnerabilities`,`Assess object ownership, role boundaries, tenant isolation, and authentication requirements using only identities and targets explicitly authorized for the engagement. Do not invent credentials.`,`deep`),mX(`inputs`,`Input handling`,`unknown-vulnerabilities`,`Review request parsing, injection boundaries, resource references, and validation. Use bounded non-destructive checks and retain evidence for confirmed impact.`)]),hX(`web-configuration`,`Web configuration review`,`Assess an authorized web target's exposure, browser security controls, and session configuration.`,`web`,[mX(`exposure`,`Public exposure`,`misconfigurations`,`Review in-scope publicly reachable files, admin/debug surfaces, transport defaults, and error disclosures using non-destructive checks.`,`quick`),mX(`sessions`,`Browser and session controls`,`misconfigurations`,`Review observed cookie attributes, cache handling of sensitive responses, cross-origin policy, redirect handling, and browser security headers. Explain practical impact rather than treating every absent header as a vulnerability.`),mX(`advisories`,`Known component exposure`,`known-vulnerabilities`,`Assess observed components against supported known-vulnerability sources. Separate inferred versions from verified affected versions and avoid unsupported exploit claims.`)]),hX(`scoped-penetration-test`,`Scoped penetration test`,`Plan and assess only an explicitly authorized target, with bounded discovery and non-destructive validation.`,`security`,[mX(`discovery`,`Scoped discovery`,`misconfigurations`,`Map only the authorized attack surface and identify exposed configuration and trust boundaries. Honor exclusions and rate limits; do not enumerate unrelated hosts.`,`quick`),mX(`known`,`Known vulnerability triage`,`known-vulnerabilities`,`Check supported known-vulnerability leads against observed target behavior. Verify applicability with bounded evidence; do not run broad third-party scanners or destructive exploit payloads.`),mX(`validation`,`Targeted validation`,`unknown-vulnerabilities`,`Investigate authorization, input handling, and sensitive state transitions within explicit scope. Prefer minimal non-destructive proof; stop before destructive actions or accessing unrelated user data.`,`deep`)]),hX(`package-behavior`,`Package behavior investigation`,`Review an authorized package's security-relevant code paths and suspicious behavior.`,`package`,[mX(`entrypoints`,`Entrypoints and advisories`,`known-vulnerabilities`,`Inspect package metadata, entrypoints, and supported advisories; identify security-sensitive or remotely reachable behavior.`,`quick`),mX(`behavior`,`Suspicious behavior`,`unknown-vulnerabilities`,`Trace filesystem and credential access, network destinations, obfuscated code, dynamic evaluation, and lifecycle hooks. Distinguish legitimate functionality from suspicious behavior with evidence; do not execute untrusted install scripts.`,`deep`)]),hX(`contract-review`,`Smart contract source review`,`Review an authorized contract source repository for access control and asset-accounting defects.`,`contracts`,[mX(`access`,`Authority and upgrade paths`,`unknown-vulnerabilities`,`Review contract source for privileged roles, initialization, upgrades, trust in external calls, and missing authorization. Identify the contract ecosystem from source; do not submit transactions or invent specialized verification results.`,`deep`),mX(`accounting`,`Asset and state invariants`,`unknown-vulnerabilities`,`Trace value transfers, balance accounting, state transitions, rounding, and reentrancy boundaries in the authorized source. Support findings with concrete call sequences; do not move assets or publish exploits.`,`deep`),mX(`configuration`,`Deployment assumptions`,`misconfigurations`,`Review source-visible deployment and initialization assumptions, privileged configuration, and dependency trust. Clearly distinguish code evidence from unverified deployed state.`)]),hX(`native-code-review`,`Native code boundary review`,`Review an authorized native source repository for parser, memory, and privilege-boundary issues.`,`repository`,[mX(`parsers`,`Parsers and memory boundaries`,`unknown-vulnerabilities`,`Trace untrusted input through parsing, length calculations, ownership, and memory operations. Prioritize reachable paths and concrete invalid-state evidence in the authorized source.`,`deep`),mX(`privileges`,`Privilege and resource boundaries`,`unknown-vulnerabilities`,`Review privilege transitions, filesystem paths, subprocess inputs, concurrency, and resource lifetime. Avoid speculative issues without a supported attacker-controlled path.`,`deep`)])];function _X(e){let t=gX.find(t=>t.id===e);if(!t)throw Error(`Unknown security workflow template.`);return uX(t.definition)}var vX={trigger:to,audit:go,report:Ma};function yX({definition:e,selectedId:t,onSelect:n,execution:r}){let i=(0,S.useRef)(null),[a,o]=(0,S.useState)(0);(0,S.useLayoutEffect)(()=>{let e=i.current;if(!e)return;let t=()=>o(e.clientWidth);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let s={};e.nodes.forEach(e=>{s[e.id]=0});for(let t=0;t<e.nodes.length;t++){let t=!1;for(let n of e.edges){if(s[n.source]===void 0||s[n.target]===void 0)continue;let r=Math.min(e.nodes.length-1,s[n.source]+1);r>s[n.target]&&(s[n.target]=r,t=!0)}if(!t)break}let c=Math.max(1,Math.floor((a-48+40)/252)),l={};e.nodes.forEach(e=>{let t=s[e.id]??0;l[t]=(l[t]??0)+1});let u={0:0},d=Math.max(0,...Object.values(s));for(let e=1;e<=Math.floor(d/c);e++){let t=1;for(let n=0;n<c;n++)t=Math.max(t,l[(e-1)*c+n]??0);u[e]=(u[e-1]??0)+t}let f={},p=Object.fromEntries(e.nodes.map(e=>{let t=s[e.id]??0,n=t%c,r=Math.floor(t/c),i=f[t]??0;return f[t]=i+1,[e.id,{x:24+n*252,y:24+((u[r]??0)+i)*140,band:r}]})),m=Math.max(260,...Object.values(p).map(e=>e.x+236)),h=Math.max(132,...Object.values(p).map(e=>e.y+108));return(0,W.jsx)(`div`,{ref:i,className:`overflow-x-auto rounded-2xl bg-muted/20 py-4`,"aria-label":`Workflow steps`,children:(0,W.jsxs)(`div`,{className:`relative mx-auto`,style:{width:m,height:h},children:[(0,W.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,width:m,height:h,children:e.edges.map((e,t)=>{let n=p[e.source],r=p[e.target];if(!n||!r)return null;let i=n.x+212,a=n.y+38,o=r.y+38,s=n.band===r.band?`M ${i} ${a} C ${i+20} ${a}, ${r.x-20} ${o}, ${r.x} ${o}`:`M ${n.x+106} ${n.y+80} C ${n.x+106} ${n.y+110}, ${r.x+106} ${r.y-30}, ${r.x+106} ${r.y}`;return(0,W.jsx)(`path`,{d:s,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,className:`text-muted-foreground/35`},`${e.source}-${e.target}-${t}`)})}),e.nodes.map(e=>{let i=vX[e.type],a=p[e.id],o=r?.nodeResults[e.id]?.status;return(0,W.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.id,"aria-label":`${e.label}, ${e.type}, ${e.enabled?`enabled`:`disabled`}`,onClick:()=>n(e.id),style:{left:a.x,top:a.y},className:q(`absolute flex min-h-20 w-[212px] items-start gap-3 rounded-2xl bg-background px-4 py-3 text-left shadow-sm transition-[background-color,box-shadow] duration-150 motion-reduce:transition-none hover:bg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary`,t===e.id&&`ring-1 ring-primary/50`,!e.enabled&&`opacity-50`),children:[(0,W.jsx)(i,{"aria-hidden":`true`,className:q(`mt-1 size-4 shrink-0`,e.enabled?`text-primary`:`text-muted-foreground`)}),(0,W.jsxs)(`span`,{className:`min-w-0`,children:[(0,W.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.label}),(0,W.jsxs)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:[e.enabled?e.type===`trigger`?`Run manually`:e.type===`report`?`Collect results`:`Security review`:`Disabled`,o&&(0,W.jsxs)(`span`,{className:`ml-2 text-foreground`,children:[`· `,o.replaceAll(`_`,` `)]})]})]})]},e.id)})]})})}var bX=`/api/console/workflow-triggers`,xX={hourly:`Every hour`,daily:`Every 24 hours`,weekly:`Every 7 days`},SX={scheduled:`Scheduled`,paused:`Paused`,starting:`Starting`,running:`Running`,completed:`Completed`,failed:`Failed`,cancelled:`Stopped`,interrupted:`Interrupted`,blocked:`Needs attention`,needs_review:`Workflow changed`,skipped_missed:`Missed run skipped`},CX=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)} ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`;function wX(e,t){let n=new Date(e);if(!Number.isFinite(n.getTime()))return`Unavailable`;try{return new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,...n.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`},hour:`numeric`,minute:`2-digit`,timeZoneName:`short`,...t?{timeZone:t}:{}}).format(n)}catch{return n.toLocaleString()}}function TX({workflow:e,disabled:t=!1}){let n=Vr(),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(`daily`),[l,u]=(0,S.useState)(()=>CX(new Date(Date.now()+36e5))),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(``),[h,g]=(0,S.useState)(``),_=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,v=ni({queryKey:[`workflow-trigger-sessions`],queryFn:({signal:e})=>Ci(e),refetchInterval:15e3}),y=ni({queryKey:[`workflow-triggers`,e.id],queryFn:({signal:t})=>G(`${bX}?workflowId=${encodeURIComponent(e.id)}`,{signal:t}),refetchInterval:5e3}),b=(v.data??[]).filter(e=>e.status!==`closed`&&e.status!==`failed`),x=b.find(e=>e.id===a),C=t||d,w=!!e.target.trim(),T=async(e,t)=>{if(!d){f(!0),m(``),g(``);try{await e(),g(t),await n.invalidateQueries({queryKey:[`workflow-triggers`]})}catch(e){m(e instanceof Error?e.message:`The schedule could not be updated.`)}finally{f(!1)}}},E=()=>{if(m(``),g(``),!w||!x)return m(`Set a workflow target and choose a conversation first.`),null;let t=new Date(l.replace(` `,`T`));return!/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(l)||!Number.isFinite(t.getTime())||CX(t)!==l?(m(`Enter a valid local date and time, such as 2026-10-03 09:00.`),null):t.getTime()<=Date.now()?(m(`Choose a first run in the future.`),null):{workflowId:e.id,workflowRevision:e.revision,sessionId:x.id,cadence:s,startAt:t.toISOString(),timezone:_}},D=()=>void T(async()=>{let t=await Ti({title:`Schedule: ${e.name}`,target:e.target,autonomyMode:`standard`});o(t.id),await n.invalidateQueries({queryKey:[`workflow-trigger-sessions`]})},`Connection ready.`),O=e=>{let t=E();t&&T(async()=>{await G(bX,{method:`POST`,body:JSON.stringify({...t,enabled:e,...e?{approval:`enable-reviewed-trigger`}:{}})}),i(!1)},e?`Schedule on.`:`Schedule saved.`)};return(0,W.jsxs)(`div`,{className:`space-y-7`,children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Run manually, on a schedule, or through the local API.`}),(0,W.jsxs)(`section`,{className:`space-y-4`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,W.jsx)(la,{"aria-hidden":`true`,className:`size-4`}),`Schedules`]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,disabled:C,onClick:()=>i(!0),children:[(0,W.jsx)(ro,{"aria-hidden":`true`}),`Add schedule`]}),(0,W.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Refresh schedules`,disabled:C||y.isFetching,onClick:()=>void y.refetch(),children:(0,W.jsx)(co,{"aria-hidden":`true`})})]})]}),y.isPending&&(0,W.jsx)(BI,{label:`Loading schedules…`}),y.isError&&(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:y.error.message}),y.data?.triggers.map(t=>{let n=t.workflowRevision!==e.revision;return(0,W.jsxs)(`article`,{className:`rounded-2xl bg-muted/35 p-4`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,W.jsx)(`div`,{children:(0,W.jsx)(`h4`,{className:`text-sm font-medium`,children:xX[t.cadence]})}),(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t.enabled?`On`:`Off`}),(0,W.jsx)(cJ,{"aria-label":`Enable ${xX[t.cadence]} schedule`,checked:t.enabled,disabled:C||!t.enabled&&(!w||n),onCheckedChange:e=>{T(()=>G(`${bX}/${encodeURIComponent(t.id)}`,{method:`PATCH`,body:JSON.stringify({enabled:e,...e?{approval:`enable-reviewed-trigger`}:{}})}),e?`Schedule on.`:`Schedule off. Active runs continue.`)}})]})]}),(0,W.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-xs sm:grid-cols-2`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:t.enabled?`Next run`:`Next scheduled time`}),(0,W.jsx)(`dd`,{className:`mt-1`,children:wX(t.nextFireAt,t.timezone)})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Last result`}),(0,W.jsx)(`dd`,{className:`mt-1`,children:t.lastStatus?SX[t.lastStatus]??t.lastStatus.replaceAll(`_`,` `):`No runs yet`})]})]}),n&&(0,W.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`The workflow changed. Create a new schedule for its current revision.`}),t.lastError&&(0,W.jsx)(`p`,{className:`mt-3 text-xs leading-5 text-destructive`,children:t.lastError})]},t.id)}),y.data&&!y.data.triggers.length&&(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No schedules yet.`})]}),(r||y.data?.triggers.length===0)&&(0,W.jsxs)(`section`,{className:`space-y-4`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Create a schedule`}),(0,W.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:`Keep the local engine open. Missed runs are skipped.`}),(0,W.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,W.jsx)(`summary`,{className:`cursor-pointer`,children:`Timing details`}),(0,W.jsx)(`p`,{className:`mt-2 leading-5`,children:`Intervals use elapsed UTC time; local times may shift with daylight saving.`})]}),!w&&(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Set a target in this workflow before scheduling it.`}),(0,W.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,W.jsx)(yI,{label:`Repeat`,value:s,options:Object.entries(xX).map(([e,t])=>({value:e,label:t})),disabled:C||!w,onValueChange:e=>c(e)}),(0,W.jsxs)(`label`,{className:`space-y-2 text-sm`,children:[(0,W.jsxs)(`span`,{className:`block font-medium`,children:[`First run · `,_]}),(0,W.jsx)(af,{"aria-label":`First scheduled run in local time`,value:l,placeholder:`YYYY-MM-DD HH:mm`,disabled:C||!w,onChange:e=>u(e.target.value)})]})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(yI,{className:`min-w-0 flex-1`,label:`Run with`,value:a,placeholder:`Choose a conversation`,disabled:C||v.isPending||!w,options:[{value:``,label:`Choose a conversation`},...b.map(e=>({value:e.id,label:`${e.title||`Conversation`} · ${e.runtime?.model||e.autonomyMode}`}))],onValueChange:o}),(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,disabled:C||!w,onClick:D,children:[(0,W.jsx)(ro,{"aria-hidden":`true`}),`New conversation`]})]}),v.isError&&(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:v.error.message}),x&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,W.jsx)(`a`,{className:`underline underline-offset-4`,href:`/console/${encodeURIComponent(x.id)}`,children:`Review conversation`})}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(J,{variant:`secondary`,size:`sm`,disabled:C||!w||!x,onClick:()=>O(!1),children:`Save off`}),(0,W.jsxs)(J,{size:`sm`,disabled:C||!w||!x,onClick:()=>O(!0),children:[(0,W.jsx)(va,{"aria-hidden":`true`}),`Enable schedule`]})]})]}),d&&(0,W.jsx)(BI,{label:`Updating schedule…`}),h&&(0,W.jsxs)(`p`,{role:`status`,className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,W.jsx)(ua,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0`}),h]}),p&&(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:p})]})}var EX={hourly:`Every hour`,daily:`Every 24 hours`,weekly:`Every 7 days`};function DX(e,t){let n=t.filter(t=>t.workflowId===e.id),r=n.filter(e=>e.enabled),i=[...r].sort((e,t)=>e.nextFireAt.localeCompare(t.nextFireAt))[0];return{own:n,active:r,next:i,enabled:r.length>0,needsReview:n.some(t=>t.workflowRevision!==e.revision||t.lastError),label:r.length>1?`${r.length} active schedules`:i?EX[i.cadence]:n.length?`Schedules paused`:`Manual · Add trigger`}}function OX({workflow:e,disabled:t=!1,onConfigureTarget:n}){let r=Vr(),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(``),u=ni({queryKey:[`workflow-triggers`,`all`],queryFn:({signal:e})=>G(`/api/console/workflow-triggers`,{signal:e}),refetchInterval:5e3}),d=DX(e,u.data?.triggers??[]),f=async()=>{s(!0),l(``);try{let e=(await Promise.allSettled(d.active.map(e=>G(`/api/console/workflow-triggers/${encodeURIComponent(e.id)}`,{method:`PATCH`,body:JSON.stringify({enabled:!1})})))).find(e=>e.status===`rejected`);if(e?.status===`rejected`)throw e.reason}catch(e){l(e instanceof Error?e.message:`Could not pause schedules.`)}finally{await r.invalidateQueries({queryKey:[`workflow-triggers`]}),s(!1)}},p=async()=>{let t=d.own.length===1?d.own[0]:void 0;if(!t||t.workflowRevision!==e.revision){a(!0);return}s(!0),l(``);try{await G(`/api/console/workflow-triggers/${encodeURIComponent(t.id)}`,{method:`PATCH`,body:JSON.stringify({enabled:!0,approval:`enable-reviewed-trigger`})})}catch(e){l(e instanceof Error?e.message:`Could not enable schedule.`)}finally{await r.invalidateQueries({queryKey:[`workflow-triggers`]}),s(!1)}},m=t||o||!u.data||u.isError;return(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsxs)(`button`,{type:`button`,disabled:t||o,onClick:()=>a(!0),className:`flex min-w-0 items-center gap-2 rounded-lg text-xs text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-primary disabled:opacity-50`,children:[d.own.length?(0,W.jsx)(la,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,W.jsx)(to,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,W.jsx)(`span`,{className:`truncate`,children:u.isPending?`Loading triggers…`:u.isError?`Triggers unavailable`:d.label}),(0,W.jsx)(fa,{"aria-hidden":`true`,className:`size-3.5 shrink-0`})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d.enabled?`On`:`Off`}),(0,W.jsx)(cJ,{"aria-label":`Automatic triggers for ${e.name}`,checked:d.enabled,disabled:m,onCheckedChange:e=>{e?p():f()}})]})]}),d.next&&(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Next · `,new Date(d.next.nextFireAt).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,timeZone:d.next.timezone})]}),d.needsReview&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Review triggers`}),c&&(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:c}),(0,W.jsx)(of,{open:i,onOpenChange:a,children:(0,W.jsxs)(uf,{className:`sm:max-w-2xl`,children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:`Triggers`}),(0,W.jsx)(mf,{children:e.name})]}),e.target.trim()?(0,W.jsx)(TX,{workflow:e,disabled:t}):(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Choose a target before setting up automatic runs.`}),(0,W.jsx)(J,{onClick:()=>{a(!1),n()},children:`Set target`})]})]})})]})}function kX({definitions:e,busy:t,onSelect:n,onTemplate:r,onImport:i,onDescribe:a}){let[o,s]=(0,S.useState)(e.length?`mine`:`templates`),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(``),[g,_]=(0,S.useState)(!1),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(``),C=e=>e.toLowerCase().includes(c.trim().toLowerCase()),w=e.filter(e=>C(`${e.name} ${e.target} ${e.instructions}`)),T=gX.filter(e=>C(`${e.name} ${e.description} ${e.category}`));return(0,W.jsxs)(`div`,{className:`space-y-7`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{className:`text-2xl font-medium tracking-tight`,children:`Workflows`}),(0,W.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Create your own custom security workflows!`})]}),(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,disabled:t,onClick:()=>{x(``),_(!0)},children:[(0,W.jsx)(Na,{"aria-hidden":`true`}),`Import definition`]})]}),(0,W.jsxs)(om,{value:o,onValueChange:s,className:`gap-5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[(0,W.jsxs)(cm,{"aria-label":`Workflow library`,children:[(0,W.jsx)(lm,{value:`mine`,children:`My workflows`}),(0,W.jsx)(lm,{value:`templates`,children:`Templates`})]}),(0,W.jsxs)(`div`,{className:`relative w-full sm:w-72`,children:[(0,W.jsx)(fo,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-3 size-4 text-muted-foreground`}),(0,W.jsx)(af,{"aria-label":`Search workflows and templates`,placeholder:`Search workflows…`,className:`pl-9`,value:c,onChange:e=>l(e.target.value)})]})]}),(0,W.jsxs)(um,{value:`mine`,children:[(0,W.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:w.map(e=>(0,W.jsxs)(`article`,{className:`flex flex-col gap-5 rounded-2xl bg-muted/35 p-5 transition-colors hover:bg-muted/50`,children:[(0,W.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>n(e.id),className:`space-y-3 rounded-lg text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary`,children:[(0,W.jsx)(Mo,{"aria-hidden":`true`,className:`size-5 text-primary`}),(0,W.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,W.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.target||`Choose a target`}),(0,W.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[e.nodes.filter(e=>e.type===`audit`).length,` phases`]})]}),(0,W.jsx)(`div`,{className:`mt-auto border-t border-border/40 pt-4`,children:(0,W.jsx)(OX,{workflow:e,disabled:t,onConfigureTarget:()=>n(e.id)})})]},e.id))}),!w.length&&(0,W.jsx)(`p`,{className:`py-12 text-center text-sm text-muted-foreground`,children:c?`No matching workflows.`:`Create your first workflow from a template or describe it below.`})]}),(0,W.jsxs)(um,{value:`templates`,children:[(0,W.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:T.map(e=>(0,W.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>{h(``),p(e)},className:`flex flex-col items-start gap-3 rounded-2xl bg-muted/35 p-5 text-left transition-colors hover:bg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary`,children:[(0,W.jsx)(go,{"aria-hidden":`true`,className:`size-5 text-primary`}),(0,W.jsx)(`span`,{className:`text-sm font-medium`,children:e.name}),(0,W.jsx)(`span`,{className:`text-xs leading-5 text-muted-foreground`,children:e.description}),(0,W.jsxs)(`span`,{className:`mt-auto flex items-center gap-1.5 pt-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(Ua,{"aria-hidden":`true`,className:`size-3.5`}),e.definition.nodes.filter(e=>e.type===`audit`).length,` phases · `,e.category]})]},e.id))}),!T.length&&(0,W.jsx)(`p`,{className:`py-12 text-center text-sm text-muted-foreground`,children:`No matching templates.`})]})]}),(0,W.jsxs)(`section`,{className:`mx-auto w-full max-w-3xl pt-3`,children:[(0,W.jsx)(`h3`,{className:`mb-3 text-sm font-medium`,children:`Create a custom workflow`}),(0,W.jsxs)(`form`,{className:`flex items-end gap-3 rounded-[28px] bg-muted px-4 py-3`,onSubmit:e=>{e.preventDefault(),u.trim()&&a(u.trim())},children:[(0,W.jsx)(`textarea`,{rows:1,"aria-label":`Describe a custom workflow`,placeholder:`Describe the phases you want 0 to build…`,disabled:t,value:u,className:`max-h-48 min-h-7 flex-1 resize-none bg-transparent px-2 py-1 text-sm leading-6 outline-none placeholder:text-muted-foreground`,onChange:e=>{d(e.target.value),e.target.style.height=`auto`,e.target.style.height=`${Math.min(e.target.scrollHeight,192)}px`},onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),u.trim()&&a(u.trim()))}}),(0,W.jsx)(J,{type:`submit`,size:`icon-sm`,"aria-label":`Create custom workflow in chat`,disabled:t||!u.trim(),children:(0,W.jsx)(aa,{"aria-hidden":`true`})})]}),t&&!f&&(0,W.jsx)(`div`,{className:`mt-3`,children:(0,W.jsx)(BI,{label:`Opening workflow…`})})]}),(0,W.jsx)(of,{open:f!==null,onOpenChange:e=>{!e&&!t&&p(null)},children:(0,W.jsxs)(uf,{showCloseButton:!t,className:`sm:max-w-lg`,children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:f?.name}),(0,W.jsx)(mf,{children:f?.description})]}),(0,W.jsx)(`ol`,{className:`space-y-3`,children:f?.definition.nodes.map((e,t)=>(0,W.jsxs)(`li`,{className:`flex gap-3 text-sm`,children:[(0,W.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs text-muted-foreground`,children:t+1}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{children:e.label}),(0,W.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.type===`trigger`?`Start manually`:e.type===`report`?`Collect results`:`${e.plan?.depth??`default`} review · ${e.plan?.runCount??1} runs`})]})]},e.id))}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Choose a target and adjust phases after saving. Nothing runs until you approve Run.`}),m&&(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:m}),(0,W.jsxs)(ff,{children:[(0,W.jsx)(J,{variant:`ghost`,disabled:t,onClick:()=>p(null),children:`Cancel`}),(0,W.jsx)(J,{disabled:t,onClick:()=>{f&&r(f.id).then(()=>p(null)).catch(e=>h(e instanceof Error?e.message:`Unable to use template.`))},children:t?`Saving…`:`Use template`})]})]})}),(0,W.jsx)(of,{open:g,onOpenChange:e=>{t||_(e)},children:(0,W.jsx)(uf,{showCloseButton:!t,className:`sm:max-w-2xl`,children:(0,W.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),x(``);try{i(pX(v)).then(()=>{_(!1),y(``)}).catch(e=>x(e instanceof Error?e.message:`Unable to import definition.`))}catch(e){x(e instanceof Error?e.message:`Invalid workflow definition.`)}},children:[(0,W.jsxs)(df,{children:[(0,W.jsx)(pf,{children:`Import definition`}),(0,W.jsx)(mf,{children:`Paste workflow JSON. Importing creates a new workflow without running it.`})]}),(0,W.jsx)(ev,{"aria-label":`Workflow JSON to import`,placeholder:`{ "schemaVersion": 1, "workflow": { … } }`,spellCheck:!1,autoComplete:`off`,rows:12,className:`max-h-[45dvh] min-h-64 resize-y rounded-2xl font-mono text-xs leading-6`,disabled:t,value:v,onChange:e=>{y(e.target.value),x(``)}}),b&&(0,W.jsx)(`p`,{role:`alert`,className:`max-h-24 overflow-y-auto whitespace-pre-wrap text-xs text-destructive`,children:b}),(0,W.jsxs)(ff,{children:[(0,W.jsx)(J,{type:`button`,variant:`ghost`,disabled:t,onClick:()=>_(!1),children:`Cancel`}),(0,W.jsx)(J,{type:`submit`,disabled:t||!v.trim(),children:t?`Importing…`:`Import workflow`})]})]})})})]})}function AX(e){let{createdAt:t,updatedAt:n,...r}=e;return r}function jX(e){let t=e.nodes.find(e=>e.type===`trigger`);if(!t||e.edges.length!==e.nodes.length-1)return null;let n=[],r=new Set,i=t;for(;i&&!r.has(i.id);){r.add(i.id),n.push(i);let t=e.edges.filter(e=>e.source===i.id);if(t.length>1||e.edges.filter(e=>e.target===i.id).length>(i.type===`trigger`?0:1))return null;i=t.length?e.nodes.find(e=>e.id===t[0].target):void 0}return n.length===e.nodes.length?n:null}function MX(e){let t=jX(e);if(!t)throw Error(`Edit the definition to add a phase to a branched graph.`);let n={id:`review_${crypto.randomUUID().replaceAll(`-`,``)}`,type:`audit`,label:`Security review`,enabled:!0,plan:{...iX}},r=t.findIndex(e=>e.type===`report`);return t.splice(r<0?t.length:r,0,n),uX({...AX(e),nodes:t,edges:t.slice(1).map((e,n)=>({source:t[n].id,target:e.id}))})}function NX(e,t){let n=jX(e);if(!n)throw Error(`Edit the definition to remove a phase from a branched graph.`);let r=n.find(e=>e.id===t);if(!r||r.type===`trigger`)throw Error(`The manual trigger must remain in the workflow.`);if(r.type===`audit`&&n.filter(e=>e.type===`audit`).length<2)throw Error(`Keep at least one review phase.`);let i=n.filter(e=>e.id!==t);return uX({...AX(e),nodes:i,edges:i.slice(1).map((e,t)=>({source:i[t].id,target:e.id}))})}var PX={"known-vulnerabilities":`Known vulnerabilities`,"unknown-vulnerabilities":`Code vulnerabilities`,misconfigurations:`Misconfigurations`};function FX({definition:e,busy:t,onSave:n}){let[r,i]=(0,S.useState)(e.name),[a,o]=(0,S.useState)(e.target),[s,c]=(0,S.useState)(e.instructions),[l,u]=(0,S.useState)(``),d=r!==e.name||a!==e.target||s!==e.instructions;return(0,W.jsxs)(`form`,{className:`space-y-4 rounded-2xl bg-muted/20 p-5`,onSubmit:t=>{t.preventDefault(),u(``);try{n(uX({...AX(e),name:r,target:a,instructions:s})).catch(e=>u(e instanceof Error?e.message:`Unable to save.`))}catch(e){u(e instanceof Error?e.message:`Invalid workflow.`)}},children:[(0,W.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,W.jsxs)(`label`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Workflow name`}),(0,W.jsx)(af,{value:r,maxLength:160,required:!0,disabled:t,onChange:e=>i(e.target.value)})]}),(0,W.jsxs)(`label`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Target`}),(0,W.jsx)(af,{value:a,maxLength:4096,placeholder:`Repository path, package, or website`,disabled:t,onChange:e=>o(e.target.value)})]})]}),(0,W.jsxs)(`label`,{className:`block space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Notes`}),(0,W.jsx)(ev,{value:s,maxLength:16e3,rows:2,disabled:t,onChange:e=>c(e.target.value)})]}),l&&(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:l}),(0,W.jsxs)(J,{type:`submit`,size:`sm`,disabled:t||!d,children:[(0,W.jsx)(uo,{"aria-hidden":`true`}),`Save details`]})]})}function IX({definition:e,phase:t,busy:n,canRemove:r,onRemove:i,onSave:a}){let[o,s]=(0,S.useState)(t.label),[c,l]=(0,S.useState)(t.enabled),[u,d]=(0,S.useState)({...t.plan??iX}),[f,p]=(0,S.useState)(t.execution?.instructions??``),[m,h]=(0,S.useState)(t.execution?.allowedAgentTools!==void 0),[g,_]=(0,S.useState)(t.execution?.allowedAgentTools??[]),v=ni({queryKey:[`workflow-tool-catalog`],queryFn:({signal:e})=>G(`/api/console/workflow-tool-catalog`,{signal:e}),enabled:t.type===`audit`}),[y,b]=(0,S.useState)(``),x=o!==t.label||c!==t.enabled||t.type===`audit`&&(JSON.stringify(u)!==JSON.stringify(t.plan)||f!==(t.execution?.instructions??``)||m!==(t.execution?.allowedAgentTools!==void 0)||JSON.stringify(g)!==JSON.stringify(t.execution?.allowedAgentTools??[])),C=(e,t)=>d(n=>({...n,[e]:t}));return(0,W.jsxs)(`form`,{"aria-label":`Phase settings`,className:`space-y-4 rounded-2xl bg-muted/20 p-5`,onSubmit:n=>{n.preventDefault(),b(``);try{let n={...t,label:o,enabled:c,...t.type===`audit`?{plan:u,execution:{instructions:f,...m?{allowedAgentTools:g}:{}}}:{}};a(uX({...AX(e),nodes:e.nodes.map(e=>e.id===t.id?n:e)})).catch(e=>b(e instanceof Error?e.message:`Unable to save phase.`))}catch(e){b(e instanceof Error?e.message:`Invalid phase.`)}},children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Phase settings`}),t.type!==`trigger`&&(0,W.jsxs)(`label`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[`Enabled`,(0,W.jsx)(cJ,{"aria-label":`Enable phase`,checked:c,disabled:n,onCheckedChange:l})]})]}),(0,W.jsxs)(`label`,{className:`block space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Phase name`}),(0,W.jsx)(af,{value:o,required:!0,maxLength:160,disabled:n,onChange:e=>s(e.target.value)})]}),t.type===`audit`?(0,W.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,W.jsxs)(`label`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Review goal`}),(0,W.jsx)(yI,{"aria-label":`Review goal`,disabled:n,value:u.goal,onValueChange:e=>C(`goal`,e),options:Object.entries(PX).map(([e,t])=>({value:e,label:t}))})]}),(0,W.jsxs)(`label`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Depth`}),(0,W.jsx)(yI,{"aria-label":`Depth`,disabled:n,value:u.depth,onValueChange:e=>C(`depth`,e),options:[`quick`,`default`,`deep`].map(e=>({value:e,label:e}))})]}),(0,W.jsxs)(`label`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Runs`}),(0,W.jsx)(af,{type:`number`,value:u.runCount,min:1,max:16,required:!0,disabled:n,onChange:e=>C(`runCount`,e.target.valueAsNumber)})]}),(0,W.jsxs)(`label`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Run execution`}),(0,W.jsx)(yI,{"aria-label":`Run execution`,disabled:n,value:u.executionMode,onValueChange:e=>C(`executionMode`,e),options:[{value:`sequential`,label:`Sequential`},{value:`parallel`,label:`Parallel`}]})]}),(0,W.jsxs)(`label`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Time limit (minutes)`}),(0,W.jsx)(af,{type:`number`,value:u.timeCapMs/6e4,min:1/6e4,max:1440,step:`any`,required:!0,disabled:n,onChange:e=>C(`timeCapMs`,Math.round(e.target.valueAsNumber*6e4))})]}),(0,W.jsxs)(`label`,{className:`space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Cost limit (USD)`}),(0,W.jsx)(af,{type:`number`,value:u.costCapUsd,min:.01,max:1e3,step:`any`,required:!0,disabled:n,onChange:e=>C(`costCapUsd`,e.target.valueAsNumber)})]})]}):(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.type===`trigger`?`Start this workflow manually with Run.`:`Collect the completed review results.`}),t.type===`audit`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`label`,{className:`block space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Phase instructions`}),(0,W.jsx)(ev,{rows:4,maxLength:16e3,value:f,placeholder:`What should the review focus on?`,disabled:n,onChange:e=>p(e.target.value)})]}),(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsxs)(`label`,{className:`block space-y-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(`span`,{children:`Agent tools`}),(0,W.jsx)(yI,{"aria-label":`Agent tools`,disabled:n,value:m?`custom`:`default`,onValueChange:e=>h(e===`custom`),options:[{value:`default`,label:`Use default tools`},{value:`custom`,label:`Choose allowed tools`}]})]}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Built-in pipeline checks run separately.`}),m&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:g.length?`${g.length} agent tools allowed`:`No agent tool calls allowed.`}),v.isError&&(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:v.error.message}),(0,W.jsx)(`div`,{className:`grid max-h-56 gap-2 overflow-y-auto rounded-xl bg-background/60 p-3 sm:grid-cols-2`,children:v.data?.tools.map(e=>(0,W.jsxs)(`label`,{title:e.description,className:`flex items-center gap-2 text-xs`,children:[(0,W.jsx)(`input`,{type:`checkbox`,disabled:n,checked:g.includes(e.name),onChange:t=>_(n=>t.target.checked?[...n,e.name]:n.filter(t=>t!==e.name)),className:`accent-primary`}),(0,W.jsx)(`span`,{children:e.name})]},e.name))})]})]})]}),y&&(0,W.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:y}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsxs)(J,{type:`submit`,size:`sm`,disabled:n||!x,children:[(0,W.jsx)(uo,{"aria-hidden":`true`}),`Save phase`]}),r&&(0,W.jsxs)(J,{type:`button`,variant:`ghost`,size:`sm`,disabled:n,onClick:i,children:[(0,W.jsx)(Do,{"aria-hidden":`true`}),`Remove phase`]})]})]})}function LX({definition:e,busy:t,onSave:n}){let[r]=(0,S.useState)(()=>{try{return{source:fX(e),error:``}}catch(t){let{name:n,instructions:r,target:i,nodes:a,edges:o}=e;return{source:JSON.stringify({schemaVersion:1,workflow:{name:n,instructions:r,target:i,nodes:a,edges:o}},null,2),error:t instanceof Error?t.message:`Unable to export this definition.`}}}),[i,a]=(0,S.useState)(r.source),[o,s]=(0,S.useState)(r.error);return(0,W.jsxs)(`form`,{className:`space-y-4`,onSubmit:t=>{t.preventDefault(),s(``);try{n({...pX(i),id:e.id,revision:e.revision}).catch(e=>s(e instanceof Error?e.message:`Unable to save definition.`))}catch(e){s(e instanceof Error?e.message:`Invalid workflow definition.`)}},children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Portable JSON defines phases, links and review settings.`}),(0,W.jsxs)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>{try{let t=fX(pX(i)),n=URL.createObjectURL(new Blob([t],{type:`application/json`})),r=document.createElement(`a`);r.href=n,r.download=`${e.name.replace(/[^A-Za-z0-9_-]/g,`_`)||`workflow`}.json`,r.click(),URL.revokeObjectURL(n)}catch(e){s(e instanceof Error?e.message:`Invalid workflow definition.`)}},children:[(0,W.jsx)(Ta,{"aria-hidden":`true`}),`Download JSON`]})]}),(0,W.jsx)(ev,{"aria-label":`Workflow JSON definition`,spellCheck:!1,autoComplete:`off`,rows:22,className:`min-h-96 resize-y rounded-2xl bg-muted/30 p-5 font-mono text-xs leading-6`,value:i,disabled:t,onChange:e=>a(e.target.value)}),o&&(0,W.jsx)(`p`,{role:`alert`,className:`whitespace-pre-wrap text-xs text-destructive`,children:o}),(0,W.jsxs)(J,{type:`submit`,size:`sm`,disabled:t||i===r.source,children:[(0,W.jsx)(uo,{"aria-hidden":`true`}),`Save definition`]})]})}function RX({workflowId:e,busy:t,onAction:n}){let r=rt(),i=ni({queryKey:[`workflow-executions`,e],queryFn:({signal:t})=>G(`/api/console/workflow-executions?workflowId=${encodeURIComponent(e)}`,{signal:t}),refetchInterval:3e3});return i.isError?(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:i.error.message}):i.isLoading?(0,W.jsx)(BI,{label:`Loading runs…`}):i.data?.executions.length?(0,W.jsx)(`div`,{className:`space-y-3`,children:i.data.executions.map(e=>(0,W.jsxs)(`article`,{className:`rounded-2xl bg-muted/25 p-5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`span`,{className:`text-sm capitalize`,children:e.status}),(0,W.jsxs)(`span`,{className:`ml-3 text-xs text-muted-foreground`,children:[new Date(e.createdAt).toLocaleString(),` · v`,e.workflowRevision]})]}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>r(`/console/${e.sessionId}`),children:`Open conversation`}),[`queued`,`running`].includes(e.status)&&(0,W.jsx)(J,{variant:`ghost`,size:`sm`,disabled:t,onClick:()=>void n(async()=>{await G(`/api/console/workflow-executions/${e.id}/cancel`,{method:`POST`,body:JSON.stringify({sessionId:e.sessionId})}),await i.refetch()}).catch(()=>{}),children:`Stop`})]})]}),e.error&&(0,W.jsx)(`p`,{className:`mt-3 text-xs text-destructive`,children:e.error}),(0,W.jsx)(`div`,{className:`mt-3 space-y-2`,children:Object.entries(e.nodeResults).map(([t,n])=>(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.workflow.nodes.find(e=>e.id===t)?.label??t,` · `,n.status,n.error?` · ${n.error}`:``]},t))})]},e.id))}):(0,W.jsx)(`p`,{className:`py-10 text-center text-sm text-muted-foreground`,children:`No runs yet. Review your phases, then select Run.`})}var zX=`/api/console/workflow-definitions`;function BX(){let e=rt(),t=Vr(),[n,r]=wn(),i=n.get(`workflow`),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(`graph`),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(``),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(null),_=(0,S.useRef)(null),v=(0,S.useRef)(null),y=(0,S.useRef)(null),b=ni({queryKey:[`workflow-definitions`],queryFn:({signal:e})=>G(zX,{signal:e}),refetchInterval:5e3}),x=b.data?.definitions.find(e=>e.id===i),C=x?.nodes.find(e=>e.id===a),w=e=>{r(t=>{let n=new URLSearchParams(t);return e?n.set(`workflow`,e):n.delete(`workflow`),n}),o(null),c(`graph`),f(``)},T=async e=>{if(l)throw Error(`Wait for the current update to finish.`);u(!0),f(``);try{await e()}catch(e){throw f(e instanceof Error?e.message:`Unable to update the workflow.`),e}finally{u(!1)}},E=e=>T(async()=>{let n=uX(e),r=await G(`${zX}/${encodeURIComponent(n.id)}`,{method:`PATCH`,body:JSON.stringify(n)});t.setQueryData([`workflow-definitions`],e=>({definitions:(e?.definitions??[]).map(e=>e.id===r.definition.id?r.definition:e)})),await t.invalidateQueries({queryKey:[`workflow-definitions`]})}),D=e=>T(async()=>{let n=await G(zX,{method:`POST`,body:JSON.stringify(_X(e))});t.setQueryData([`workflow-definitions`],e=>({definitions:[n.definition,...e?.definitions??[]]})),w(n.definition.id),await t.invalidateQueries({queryKey:[`workflow-definitions`]})}),O=e=>T(async()=>{let n=await G(zX,{method:`POST`,body:JSON.stringify(uX(e))});t.setQueryData([`workflow-definitions`],e=>({definitions:[n.definition,...e?.definitions??[]]})),w(n.definition.id),await t.invalidateQueries({queryKey:[`workflow-definitions`]})}),k=(t,n)=>void T(async()=>{let r=await Ti({title:n?`Update ${n.name}`:`Create a security workflow`}),i=n?`Help me revise saved security workflow ${n.id}, revision ${n.revision}, named ${n.name}. Use the workflow tools to read its current definition. Discuss the changes and save with console_save_workflow when ready. Do not execute it.\n\n${t}`:`Help me create a reusable security workflow from this request. Ask for missing target or details. Use console_save_workflow to save a real definition with a manual trigger, typed review plans, per-phase execution instructions and a report. Workflow notes are descriptive; phase instructions guide actual reviews. Do not run it.\n\n${t}`;await Oi(r.id,{text:i}),e(`/console/${r.id}`)}).catch(()=>{}),A=x?.nodes.filter(e=>e.type===`audit`&&e.enabled)??[],j=!!(x?.target.trim()&&A.length),M=p?.nodes.filter(e=>e.type===`audit`&&e.enabled)??[],N=()=>{if(!p)return;let e=p;T(async()=>{let n=await Ti({title:e.name,target:e.target});await G(`${zX}/${encodeURIComponent(e.id)}/run`,{method:`POST`,body:JSON.stringify({sessionId:n.id,revision:e.revision,approval:`launch-authorized-run`})}),m(null),c(`runs`),await t.invalidateQueries({queryKey:[`workflow-executions`,e.id]})}).catch(()=>{})},P=x?jX(x)!==null:!1;return(0,W.jsxs)(`div`,{ref:y,tabIndex:-1,className:`mx-auto w-full max-w-7xl space-y-6 px-4 py-6 outline-none sm:px-8`,children:[d&&(0,W.jsx)(`p`,{role:`alert`,className:`rounded-xl bg-destructive/10 px-4 py-3 text-sm text-destructive`,children:d}),b.isError&&(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:b.error.message}),b.isLoading?(0,W.jsx)(`div`,{className:`py-16`,children:(0,W.jsx)(BI,{label:`Loading workflows…`})}):x?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>w(null),children:[(0,W.jsx)(na,{"aria-hidden":`true`}),`Back to workflows`]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{className:`text-2xl font-medium`,children:x.name}),(0,W.jsx)(`p`,{className:`mt-2 break-all text-sm text-muted-foreground`,children:x.target||`Choose a target below before running.`})]}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,disabled:l,onClick:()=>k(`I want to update this workflow.`,x),children:[(0,W.jsx)(Xa,{"aria-hidden":`true`}),`Edit in chat`]}),(0,W.jsxs)(J,{ref:_,size:`sm`,disabled:l||!j,onClick:()=>{f(``),m(structuredClone(x))},children:[(0,W.jsx)(to,{"aria-hidden":`true`}),`Run`]}),(0,W.jsx)(J,{ref:v,variant:`ghost`,size:`icon-sm`,"aria-label":`Delete workflow`,disabled:l,onClick:()=>{f(``),g(structuredClone(x))},children:(0,W.jsx)(Do,{"aria-hidden":`true`})})]})]}),(0,W.jsx)(`div`,{className:`max-w-md rounded-2xl bg-muted/35 p-4`,children:(0,W.jsx)(OX,{workflow:x,disabled:l,onConfigureTarget:()=>c(`graph`)})}),(0,W.jsxs)(om,{value:s,onValueChange:c,className:`gap-6`,children:[(0,W.jsxs)(cm,{"aria-label":`Workflow editor`,children:[(0,W.jsx)(lm,{value:`graph`,children:`Graph`}),(0,W.jsx)(lm,{value:`definition`,children:`Definition`}),(0,W.jsx)(lm,{value:`triggers`,children:`Triggers`}),(0,W.jsx)(lm,{value:`runs`,children:`Runs`})]}),(0,W.jsxs)(um,{value:`graph`,className:`space-y-5`,children:[(0,W.jsx)(FX,{definition:x,busy:l,onSave:E},`${x.id}:${x.revision}`),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Phases`}),(0,W.jsxs)(J,{variant:`ghost`,size:`sm`,disabled:l||!P||x.nodes.length>=16,onClick:()=>void E(MX(x)).catch(()=>{}),children:[(0,W.jsx)(ro,{"aria-hidden":`true`}),`Add phase`]})]}),!P&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This graph has branches. Add or remove phases in Definition to keep its connections intact.`}),(0,W.jsx)(yX,{definition:x,selectedId:a,onSelect:o}),C?(0,W.jsx)(IX,{definition:x,phase:C,busy:l,onSave:E,canRemove:P&&C.type!==`trigger`&&(C.type!==`audit`||x.nodes.filter(e=>e.type===`audit`).length>1),onRemove:()=>void E(NX(x,C.id)).then(()=>o(null)).catch(()=>{})},`${x.id}:${x.revision}:${C.id}`):(0,W.jsx)(`p`,{className:`text-center text-xs text-muted-foreground`,children:`Select a phase to edit its instructions, tools and review settings.`})]}),(0,W.jsx)(um,{value:`definition`,children:(0,W.jsx)(LX,{definition:x,busy:l,onSave:E},`${x.id}:${x.revision}`)}),(0,W.jsx)(um,{value:`triggers`,children:(0,W.jsx)(TX,{workflow:x,disabled:l})}),(0,W.jsx)(um,{value:`runs`,children:(0,W.jsx)(RX,{workflowId:x.id,busy:l,onAction:T})})]})]}):(0,W.jsx)(kX,{definitions:b.data?.definitions??[],busy:l,onSelect:w,onTemplate:D,onImport:O,onDescribe:k}),(0,W.jsx)(of,{open:p!==null,onOpenChange:e=>{!e&&!l&&m(null)},children:(0,W.jsxs)(uf,{showCloseButton:!l,onCloseAutoFocus:e=>{e.preventDefault(),_.current?.focus()},className:`max-h-[85dvh] overflow-y-auto sm:max-w-lg`,children:[(0,W.jsxs)(df,{children:[(0,W.jsxs)(pf,{children:[`Run `,p?.name,`?`]}),(0,W.jsx)(mf,{children:`Run these enabled phases in a new conversation.`})]}),(0,W.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,W.jsxs)(`p`,{className:`break-all`,children:[(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:`Target: `}),p?.target]}),(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Reviewed revision `,p?.revision]}),M.map(e=>(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`p`,{children:e.label}),e.execution?.instructions&&(0,W.jsx)(`p`,{className:`whitespace-pre-wrap text-xs text-muted-foreground`,children:e.execution.instructions}),e.plan&&(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.plan.goal.replaceAll(`-`,` `),` · `,e.plan.runCount,` `,e.plan.executionMode,` runs · `,e.plan.depth,` · `,Math.round(e.plan.timeCapMs/6e4),` minutes · $`,e.plan.costCapUsd,` per phase`]}),e.execution?.allowedAgentTools!==void 0&&(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Agent tools: `,e.execution.allowedAgentTools.join(`, `)||`None`,`. Built-in pipeline checks run separately.`]})]},e.id)),d&&(0,W.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:d})]}),(0,W.jsxs)(ff,{children:[(0,W.jsx)(J,{variant:`ghost`,disabled:l,onClick:()=>m(null),children:`Cancel`}),(0,W.jsx)(J,{disabled:l||!M.length,onClick:N,children:l?`Starting…`:`Run workflow`})]})]})}),(0,W.jsx)(of,{open:h!==null,onOpenChange:e=>{!e&&!l&&g(null)},children:(0,W.jsxs)(uf,{showCloseButton:!l,onCloseAutoFocus:e=>{e.preventDefault(),v.current?.isConnected?v.current.focus():y.current?.focus()},className:`sm:max-w-sm`,children:[(0,W.jsxs)(df,{children:[(0,W.jsxs)(pf,{children:[`Delete `,h?.name,`?`]}),(0,W.jsx)(mf,{children:`The saved workflow will be removed. Prior run records remain available.`})]}),d&&(0,W.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:d}),(0,W.jsxs)(ff,{children:[(0,W.jsx)(J,{variant:`ghost`,disabled:l,onClick:()=>g(null),children:`Cancel`}),(0,W.jsx)(J,{variant:`destructive`,disabled:l,onClick:()=>{if(!h)return;let e=h;T(async()=>{await G(`${zX}/${e.id}?revision=${e.revision}`,{method:`DELETE`}),g(null),w(null),await t.invalidateQueries({queryKey:[`workflow-definitions`]})}).catch(()=>{})},children:`Delete workflow`})]})]})})]})}function VX({title:e,children:t,className:n,...r}){return(0,W.jsxs)(`details`,{...r,className:q(`group/disclosure overflow-hidden rounded-xl bg-muted/20`,n),children:[(0,W.jsxs)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 rounded-xl bg-muted/40 px-4 py-3 text-sm font-medium text-foreground transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/50 [&::-webkit-details-marker]:hidden`,children:[(0,W.jsx)(`span`,{className:`min-w-0`,children:e}),(0,W.jsx)(da,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/disclosure:rotate-180 motion-reduce:transition-none`})]}),(0,W.jsx)(`div`,{className:`border-t border-border/30 px-4 pb-4 pt-1`,children:t})]})}function HX({title:e,description:t,children:n,className:r}){return(0,W.jsxs)(sp,{className:q(`control-section`,r),children:[(0,W.jsxs)(cp,{children:[(0,W.jsx)(lp,{children:e}),t&&(0,W.jsx)(up,{children:t})]}),(0,W.jsx)(dp,{className:`space-y-4`,children:n})]})}function UX({label:e,hint:t,children:n}){return(0,W.jsxs)(`label`,{className:`grid gap-2 text-sm`,children:[(0,W.jsx)(`span`,{className:`font-medium`,children:e}),n,t&&(0,W.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:t})]})}function WX({label:e,hint:t,...n}){let r=(0,S.useId)();return(0,W.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,W.jsx)(`label`,{htmlFor:r,className:`font-medium`,children:e}),(0,W.jsx)(af,{...n,id:r,"aria-describedby":t?`${r}-hint`:void 0}),t&&(0,W.jsx)(`p`,{id:`${r}-hint`,className:`text-xs leading-relaxed text-muted-foreground`,children:t})]})}function GX({children:e,checked:t,onChange:n,disabled:r}){return(0,W.jsxs)(`label`,{className:q(`flex items-start gap-3 rounded-xl bg-muted/30 p-3 text-sm leading-relaxed`,r&&`opacity-60`),children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:t,onChange:e=>n(e.target.checked),disabled:r,className:`mt-1 size-4 shrink-0 accent-primary`}),(0,W.jsx)(`span`,{children:e})]})}function KX({error:e,message:t}){return e?(0,W.jsxs)(`div`,{role:`alert`,className:`flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive`,children:[(0,W.jsx)(pa,{className:`mt-0.5 size-4 shrink-0`}),(0,W.jsx)(`span`,{className:`break-words`,children:e instanceof Error?e.message:String(e)})]}):t?(0,W.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 rounded-md border border-primary/20 bg-primary/5 p-3 text-sm`,children:[(0,W.jsx)(ma,{className:`mt-0.5 size-4 shrink-0 text-primary-text`}),(0,W.jsx)(`span`,{children:t})]}):null}function qX({pending:e,error:t,retry:n}){return t?(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(KX,{error:t}),(0,W.jsxs)(J,{variant:`outline`,onClick:()=>void n(),children:[(0,W.jsx)(so,{className:`size-4`}),`Try again`]})]}):e?(0,W.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,children:[(0,W.jsx)(qa,{className:`size-4 animate-spin`}),`Loading…`]}):null}function JX({pending:e,children:t,...n}){return(0,W.jsxs)(J,{...n,disabled:e||n.disabled,children:[e&&(0,W.jsx)(qa,{className:`size-4 animate-spin`}),t]})}function YX({entries:e}){return(0,W.jsx)(`dl`,{className:`grid gap-x-6 gap-y-3 sm:grid-cols-2`,children:e.map(([e,t])=>(0,W.jsxs)(`div`,{className:`min-w-0`,children:[(0,W.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,W.jsx)(`dd`,{className:`mt-1 break-words text-sm`,children:t??`Not available`})]},e))})}function XX({children:e}){return(0,W.jsx)(`div`,{className:`rounded-md border border-dashed border-border bg-muted/20 p-6 text-sm text-muted-foreground`,children:e})}function ZX(e){return{method:`POST`,body:JSON.stringify(e)}}function QX(e){let t=new URLSearchParams(e),n=t.get(`return`);if(n&&/^\/console(?:\/[a-zA-Z0-9_-]+)?(?:\?[^#]*)?$/.test(n))return n;let r=t.get(`session`);return r?`/console/${encodeURIComponent(r)}`:`/console`}function $X(){return ni({queryKey:[`console-github-publication`],queryFn:async({signal:e})=>(await G(`/api/console/github`,{signal:e})).github,refetchInterval:e=>e.state.data?.deviceAuth.phase===`running`&&1e3})}function eZ(){let e=Vr(),t=$X(),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(null),o=t.data?.deviceAuth.phase===`running`,s=null;if(t.data?.deviceAuth.verificationUrl)try{let e=new URL(t.data.deviceAuth.verificationUrl);e.protocol===`https:`&&e.hostname===`github.com`&&!e.username&&!e.password&&!e.port&&/^\/login\/device\/?$/.test(e.pathname)&&(s=e.href)}catch{}let c=ri({mutationFn:async e=>{if(e===`connect`){let e=n.trim();if(r(``),!e||e.length>16384||/\s/.test(e))throw Error(`Enter a GitHub token without whitespace.`);return G(`/api/console/github/connect`,ZX({token:e}))}return G(`/api/console/github/device-auth`,{method:e===`cancel`?`DELETE`:`POST`,body:`{}`})},onSuccess:(t,n)=>{e.setQueryData([`console-github-publication`],t.github),a(n===`connect`?t.github.connected?`GitHub connected.`:`GitHub isn't connected yet. Check the status below.`:t.github.deviceAuth.message)},onSettled:()=>{r(``)}});return(0,W.jsxs)(HX,{title:`GitHub`,description:`Optional. Needed only to open pull requests.`,children:[(0,W.jsx)(qX,{pending:t.isPending,error:t.error,retry:t.refetch}),t.data&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,W.jsx)(La,{className:`size-4`}),t.data.account??`GitHub.com`]}),(0,W.jsx)(I_,{variant:t.data.connected?`secondary`:`outline`,children:t.data.connected?`Connected`:`Not connected`})]}),t.data.connected&&t.data.scopes.length>0&&(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Permissions: `,t.data.scopes.join(`, `)]}),t.data.deviceAuth.phase!==`idle`&&t.data.deviceAuth.phase!==`connected`&&(0,W.jsx)(`p`,{role:`status`,className:`text-sm leading-relaxed text-muted-foreground`,children:t.data.deviceAuth.message}),!t.data.available&&(0,W.jsxs)(`p`,{className:`rounded-md border border-border bg-muted/20 p-3 text-sm`,children:[`GitHub isn't available on this computer. `,(0,W.jsx)(vn,{to:`/doctor`,className:`underline`,children:`Check requirements`}),`.`]}),(0,W.jsxs)(`section`,{className:`space-y-3`,children:[t.data.deviceAuth.userCode&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your code`}),(0,W.jsx)(`code`,{className:`mt-1 inline-block rounded-md border border-border px-3 py-2 text-lg tracking-widest`,children:t.data.deviceAuth.userCode})]}),s&&(0,W.jsx)(J,{asChild:!0,variant:`outline`,children:(0,W.jsxs)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,children:[`Open GitHub`,(0,W.jsx)(Oa,{className:`size-4`})]})}),t.data.deviceAuth.verificationUrl&&!s&&(0,W.jsx)(KX,{error:`This sign-in link looks unsafe, so it wasn't opened.`}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[o?(0,W.jsx)(JX,{variant:`outline`,pending:c.isPending&&c.variables===`cancel`,disabled:c.isPending,onClick:()=>c.mutate(`cancel`),children:`Cancel sign-in`}):(0,W.jsx)(JX,{pending:c.isPending&&c.variables===`device`,disabled:c.isPending||!t.data.available,onClick:()=>{a(null),c.mutate(`device`)},children:t.data.connected?`Use another account`:`Sign in with GitHub`}),(0,W.jsxs)(J,{variant:`ghost`,disabled:t.isFetching||c.isPending,onClick:()=>void t.refetch(),children:[(0,W.jsx)(so,{className:`size-4`}),`Refresh`]})]})]}),(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Use a token instead`}),children:(0,W.jsxs)(`form`,{className:`mt-3 space-y-4`,onSubmit:e=>{e.preventDefault(),a(null),c.mutate(`connect`)},children:[(0,W.jsx)(WX,{label:`GitHub token`,type:`password`,autoComplete:`off`,spellCheck:!1,value:n,required:!0,maxLength:16384,disabled:c.isPending||o||!t.data.available,onChange:e=>r(e.target.value),hint:`Stored locally on this computer.`}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(JX,{type:`submit`,pending:c.isPending&&c.variables===`connect`,disabled:!n.trim()||c.isPending||o||!t.data.available,children:`Connect`}),(0,W.jsx)(J,{type:`button`,variant:`outline`,disabled:c.isPending,onClick:()=>{r(``),a(null),c.reset()},children:`Clear`})]})]})})]}),(0,W.jsx)(KX,{error:c.error,message:i})]})}var tZ={"chatgpt-codex":[`auth.openai.com`],codex:[`auth.openai.com`],copilot:[`github.com`],xai:[`auth.x.ai`],kimi:[`auth.kimi.com`],openrouter:[`openrouter.ai`],google:[`accounts.google.com`]},nZ={deepseek:!0,anthropic:!0,azure:!0,openai:!0,"z-ai":!0,kimi:!0,qwen:!0,xai:!0,opencode:!0,copilot:!0};function rZ(e,t){if(!t)return null;try{let n=new URL(t);return n.protocol===`https:`&&!n.username&&!n.password&&!n.port&&tZ[e]?.includes(n.hostname)?n.href:null}catch{return null}}function iZ(){return ni({queryKey:[`console-providers`],queryFn:({signal:e})=>G(`/api/console/providers`,{signal:e}),refetchInterval:e=>e.state.data?.providers.some(e=>e.auth.phase===`running`)?1e3:!1})}function aZ({onConnected:e}){let t=Vr(),n=iZ(),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(``),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(null),_=n.data?.providers.find(e=>e.id===r),v=_?rZ(_.id,_.auth.verificationUrl):null;(0,S.useEffect)(()=>{!r&&n.data&&i(n.data.preference?.providerId??n.data.providers.find(e=>e.configured)?.id??n.data.providers[0]?.id??``)},[n.data,r]),(0,S.useEffect)(()=>{o(``),c(_?.configuration?.baseUrl??``),u(_?.configuration?.model??``),f(_?.configuration?.projectId??``),m(null),g(null)},[r]);let y=ri({mutationFn:async e=>{if(!_)throw Error(`Choose a provider first.`);if(e.action===`connect`&&!a.trim())throw Error(`Enter an API key.`);if(s.trim()){let e=new URL(s.trim());if(e.username||e.password||e.search||e.hash||e.protocol!==`https:`&&!(e.protocol===`http:`&&[`localhost`,`127.0.0.1`,`[::1]`].includes(e.hostname)))throw Error(`Enter a plain https:// URL (or http://localhost).`)}return G(`/api/console/connections`,ZX({providerId:_.id,...e,...e.action===`connect`?{apiKey:a.trim()}:{},...[`connect`,`configure`].includes(e.action)?{...nZ[_.id]&&s.trim()?{baseUrl:s.trim()}:{},..._.id===`azure`&&l.trim()?{model:l.trim()}:{},...e.action===`configure`&&_.id===`google`&&d.trim()?{projectId:d.trim()}:{}}:{}}))},onSuccess:async(n,r)=>{t.setQueryData([`console-providers`],n),o(``),m(null),g(r.action===`connect`?`Connected. Now choose a model.`:r.action===`configure`?`Saved.`:r.action===`activate`?`Account activated.`:`Account removed.`),await t.invalidateQueries({queryKey:[`console-models`]}),r.action===`connect`&&e?.()},onSettled:()=>{o(``)}}),b=ri({mutationFn:e=>G(`/api/console/providers/${encodeURIComponent(r)}/device-auth`,{method:e?`DELETE`:`POST`,body:`{}`}),onSuccess:async()=>{await n.refetch()}});return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsx)(qX,{pending:n.isPending,error:n.error,retry:n.refetch}),n.data&&(0,W.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-[minmax(12rem,0.7fr)_minmax(0,1.3fr)]`,children:[(0,W.jsx)(HX,{title:`Providers`,children:(0,W.jsx)(`div`,{className:`space-y-2`,children:[...n.data.providers].sort((e,t)=>Number(t.configured)-Number(e.configured)).map(e=>(0,W.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),"aria-pressed":r===e.id,className:`flex w-full items-center justify-between gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 ${r===e.id?`bg-muted`:`hover:bg-muted/60`}`,children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[(0,W.jsx)(KI,{providerId:e.id}),(0,W.jsx)(`span`,{className:`truncate`,children:e.label})]}),e.configured&&(0,W.jsx)(I_,{variant:`secondary`,children:`Connected`})]},e.id))})}),_&&(0,W.jsxs)(HX,{title:_.label,children:[_.configured&&!_.diagnostics.valid&&(0,W.jsx)(KX,{error:_.diagnostics.message??`This connection needs attention.`}),_.accounts.length>0&&(0,W.jsx)(`div`,{className:`space-y-3`,children:_.accounts.map(e=>(0,W.jsxs)(`div`,{className:`rounded-xl bg-muted/40 p-3`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-sm font-medium`,children:e.label}),(0,W.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.kind===`oauth`?`Signed in`:`API key`,` · `,e.active?`Active`:`Inactive`]})]}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[!e.active&&(0,W.jsx)(J,{size:`sm`,variant:`outline`,disabled:y.isPending,onClick:()=>y.mutate({action:`activate`,accountId:e.accountId}),children:`Activate`}),(0,W.jsx)(J,{size:`sm`,variant:`ghost`,disabled:y.isPending,onClick:()=>m(e.accountId),children:`Disconnect`})]})]}),p===e.accountId&&(0,W.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,W.jsx)(`p`,{className:`text-sm`,children:`Remove this account from this computer? It stays active with the provider.`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(JX,{size:`sm`,variant:`destructive`,pending:y.isPending,onClick:()=>y.mutate({action:`disconnect`,accountId:e.accountId}),children:`Remove`}),(0,W.jsx)(J,{size:`sm`,variant:`outline`,onClick:()=>m(null),children:`Cancel`})]})]})]},e.accountId))}),_.methods.includes(`oauth`)&&(0,W.jsxs)(`section`,{className:`space-y-3 rounded-2xl bg-muted/40 p-4`,children:[(0,W.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,W.jsx)(go,{className:`size-4`}),`Sign in`]}),(0,W.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:_.auth.message}),_.auth.userCode&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your code`}),(0,W.jsx)(`code`,{className:`mt-1 inline-block rounded border border-border px-3 py-2 text-lg tracking-widest`,children:_.auth.userCode})]}),v&&(0,W.jsx)(J,{asChild:!0,variant:`outline`,children:(0,W.jsxs)(`a`,{href:v,target:`_blank`,rel:`noopener noreferrer`,children:[`Open sign-in page`,(0,W.jsx)(Oa,{className:`size-4`})]})}),_.auth.verificationUrl&&!v&&(0,W.jsx)(KX,{error:`This sign-in link looks unsafe, so it wasn't opened.`}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[_.auth.phase===`running`?(0,W.jsx)(JX,{pending:b.isPending,variant:`outline`,onClick:()=>b.mutate(!0),children:`Cancel sign-in`}):(0,W.jsx)(JX,{pending:b.isPending,disabled:!_.auth.available,onClick:()=>b.mutate(!1),children:_.configured?`Connect another account`:`Sign in`}),_.auth.phase===`connected`&&e&&(0,W.jsx)(J,{variant:`outline`,onClick:e,children:`Continue`})]})]}),(nZ[_.id]||_.id===`google`)&&(0,W.jsx)(VX,{open:_.id===`azure`||_.id===`google`||void 0,className:`pt-2`,title:(0,W.jsx)(W.Fragment,{children:_.id===`azure`||_.id===`google`?`Settings`:`Advanced`}),children:(0,W.jsxs)(`form`,{className:`mt-3 space-y-4`,onSubmit:e=>{e.preventDefault(),y.mutate({action:`configure`})},children:[nZ[_.id]&&(0,W.jsx)(WX,{label:_.id===`azure`?`Azure endpoint`:`Custom endpoint`,type:`url`,value:s,onChange:e=>c(e.target.value),required:_.id===`azure`,placeholder:`https://…`}),_.id===`azure`&&(0,W.jsx)(WX,{label:`Azure model`,value:l,onChange:e=>u(e.target.value),required:!0,maxLength:256}),_.id===`google`&&(0,W.jsx)(WX,{label:`Google Cloud project ID`,value:d,onChange:e=>f(e.target.value),required:!0,maxLength:64}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(JX,{type:`submit`,pending:y.isPending,children:`Save`}),(0,W.jsx)(J,{type:`button`,variant:`outline`,disabled:y.isPending,onClick:()=>{c(_.configuration?.baseUrl??``),u(_.configuration?.model??``),f(_.configuration?.projectId??``),y.reset()},children:`Cancel`})]})]})},_.id),_.methods.includes(`api-key`)&&(0,W.jsxs)(`form`,{className:`space-y-4 pt-4`,onSubmit:e=>{e.preventDefault(),y.mutate({action:`connect`})},children:[(0,W.jsx)(WX,{label:`API key`,type:`password`,value:a,autoComplete:`off`,spellCheck:!1,required:!0,disabled:y.isPending,onChange:e=>o(e.target.value),hint:`Stored locally on this computer.`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(JX,{type:`submit`,pending:y.isPending,disabled:!a.trim()||_.id===`azure`&&(!s.trim()||!l.trim()),children:`Connect`}),(0,W.jsx)(J,{type:`button`,variant:`outline`,disabled:y.isPending,onClick:()=>{o(``),y.reset()},children:`Clear`})]})]}),(0,W.jsx)(KX,{error:y.error??b.error,message:h})]})]}),(0,W.jsx)(eZ,{})]})}function oZ({sessionId:e,onApplied:t}){let n=iZ(),r=rt(),i=Vr(),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)({}),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!0),[h,g]=(0,S.useState)(null),_=ni({queryKey:[`console-control-session`,e],enabled:!!e,queryFn:async({signal:t})=>(await G(`/api/console/sessions/${encodeURIComponent(e)}`,{signal:t})).snapshot,refetchInterval:2e3}),v=_.data?.session.runtime??_.data?.runtime,y=ni({queryKey:[`console-models`,a],enabled:!!a,queryFn:({signal:e})=>G(`/api/console/models?providerId=${encodeURIComponent(a)}`,{signal:e})});(0,S.useEffect)(()=>{!a&&n.data&&(!e||_.data)&&(o(v?.providerId??n.data.preference?.providerId??n.data.providers.find(e=>e.configured)?.id??``),c(v?.model??n.data.preference?.model??``),u(v?.agentModels??{}),f(v?.singleModel??!1),m(v?.autoRoute??!0))},[n.data,v,a,e,_.data]);let b=n.data?.providers.find(e=>e.id===a),x=ri({mutationFn:async()=>{if(!b?.configured)throw Error(`Connect this provider first.`);if(!s.trim())throw Error(`Choose a model.`);let t={providerId:a,model:s,agentModels:l,singleModel:d,autoRoute:p},n=e??(await G(`/api/console/sessions`,ZX({}))).session.id;return(await G(`/api/console/sessions/${encodeURIComponent(n)}/configuration`,{method:`PATCH`,body:JSON.stringify({runtime:t})})).session},onSuccess:async a=>{g(a.pendingConfiguration?`Saved. Takes effect after the current step.`:`Model updated.`),await Promise.all([i.invalidateQueries({queryKey:[`console-control-session`]}),i.invalidateQueries({queryKey:[`console-sessions`]}),n.refetch()]),t?t(a):e||r(`/models?session=${encodeURIComponent(a.id)}&return=${encodeURIComponent(`/console/${a.id}`)}`,{replace:!0})}});return(0,W.jsxs)(HX,{title:`Model`,children:[(0,W.jsx)(qX,{pending:n.isPending,error:n.error??_.error,retry:()=>{n.refetch(),_.refetch()}}),v&&(0,W.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,W.jsx)(KI,{providerId:v.providerId}),(0,W.jsx)(`span`,{children:v.providerLabel}),(0,W.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,v.model]}),!!(_.data?.session.pendingConfiguration||_.data?.pendingConfiguration)&&(0,W.jsx)(`span`,{className:`text-muted-foreground`,children:`· change pending`})]}),n.data&&!n.data.providers.some(e=>e.configured)&&(0,W.jsxs)(XX,{children:[`No provider connected. `,(0,W.jsx)(vn,{to:`/connections`,className:`underline`,children:`Connect one`}),` first.`]}),(0,W.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),x.mutate()},children:[(0,W.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,W.jsx)(UX,{label:`Provider`,children:(0,W.jsx)(yI,{"aria-label":`Provider`,value:a,onValueChange:e=>{o(e),c(``),u({}),x.reset()},options:[{value:``,label:`Choose a provider`},...n.data?.providers.map(e=>({value:e.id,label:`${e.label}${e.configured?``:` — not connected`}`,disabled:!e.configured}))??[]]})}),(0,W.jsx)(UX,{label:`Model`,children:(0,W.jsx)(yI,{"aria-label":`Model`,value:s,onValueChange:c,disabled:y.isPending||!a,required:!0,options:[{value:``,label:`Choose a model`},...y.data?.models.map(e=>({value:e.id,label:`${e.id} · ${e.price}`}))??[]]})})]}),(0,W.jsx)(qX,{pending:!!a&&y.isPending,error:y.error,retry:y.refetch}),y.data?.diagnostics.map(e=>(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.message},e.providerId)),(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Advanced`}),children:(0,W.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[(0,W.jsxs)(`label`,{className:`flex items-center justify-between gap-4 text-sm`,children:[(0,W.jsx)(`span`,{children:`Use one model for everything`}),(0,W.jsx)(cJ,{"aria-label":`Use one model for everything`,checked:d,onCheckedChange:f})]}),(0,W.jsxs)(`label`,{className:`flex items-center justify-between gap-4 text-sm`,children:[(0,W.jsx)(`span`,{children:`Pick models per task automatically`}),(0,W.jsx)(cJ,{"aria-label":`Pick models per task automatically`,checked:p,onCheckedChange:m,disabled:d})]}),!d&&(0,W.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:y.data?.roles.map(e=>(0,W.jsx)(UX,{label:`${e[0]?.toUpperCase()}${e.slice(1)} model`,children:(0,W.jsx)(yI,{"aria-label":`${e} model`,value:l[e]??`auto`,onValueChange:t=>u(n=>({...n,[e]:t})),options:[{value:`auto`,label:`Auto`},...y.data.models.map(e=>({value:e.id,label:e.id}))]})},e))})]})}),(0,W.jsx)(KX,{error:x.error,message:h}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(JX,{type:`submit`,pending:x.isPending,disabled:!b?.configured||!s,children:e?`Save`:`Start`}),(0,W.jsx)(J,{type:`button`,variant:`outline`,disabled:x.isPending,onClick:()=>{o(v?.providerId??n.data?.preference?.providerId??``),c(v?.model??n.data?.preference?.model??``),u(v?.agentModels??{}),f(v?.singleModel??!1),m(v?.autoRoute??!0),x.reset(),g(null)},children:`Reset`})]})]})]})}function sZ(){return ni({queryKey:[`console-settings`],queryFn:({signal:e})=>G(`/api/console/settings`,{signal:e})})}var cZ=[{id:`general`,label:`General`},{id:`appearance`,label:`Appearance`},{id:`conversation`,label:`Conversation`},{id:`agents`,label:`Agents & execution`},{id:`privacy`,label:`Data & privacy`}],lZ=new Set(`showStatusBar.showComposerHints.composerSuggestions.mouseSupport.showLogo.showRuntimeNotices.showTurnSummary.showSubagents.showTimestamps.showObjective.showScope.density.composerStyle.transcriptStyle.roleLabelStyle.toolCardStyle.richToolCards.transcriptDetail.showTokenUsage.showCost.showContextMeter.modelDisplay.elapsedTimer.logoAnimation.symbolPreset.rosterSort.leaderKey`.split(`.`));function uZ(e){return e.group===`Privacy`?`privacy`:e.group===`Security`?`agents`:e.group===`Updates`?`general`:e.group===`Transcript`||e.group===`Context`||e.group===`Telemetry`||e.key===`busyInputMode`||e.key===`rosterSort`?`conversation`:`appearance`}function dZ(e){return{analyticsLevel:`Usage metrics`,busyInputMode:`Messages while working`}[e.key]??e.label}function fZ({definition:e,value:t,scope:n,pending:r,apply:i}){let a=dZ(e),o={updatePolicy:`Check for updates when 0 starts.`,reduceMotion:`Reduce animations.`,busyInputMode:`Interrupt with your next message, or queue it until the current turn ends.`,autoCompaction:`Summarize older messages when context fills up.`,compactionThreshold:`When to summarize older messages.`}[e.key]??e.description.replace(/\s*Applies to this computer\.?/g,``),s=e.kind===`enum`&&e.choices?.length===2&&e.choices.includes(`off`)?e.choices.find(e=>e!==`off`):void 0,c=e.kind===`boolean`||s!==void 0,l=t=>i(e.key,t,e.operatorOnly?`global`:n);return(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-6 py-4`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:a}),(0,W.jsx)(`p`,{className:`max-w-lg text-xs leading-5 text-muted-foreground`,children:o})]}),(0,W.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c?(0,W.jsx)(cJ,{"aria-label":a,checked:e.kind===`boolean`?t===!0:t===s,disabled:r,onCheckedChange:t=>l(e.kind===`boolean`?t:t?s:`off`)}):(0,W.jsx)(yI,{"aria-label":a,className:`max-w-48`,value:typeof t==`string`?t:``,onValueChange:l,disabled:r,options:e.choices?.map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))??[]})})]})}function pZ(){let e=ni({queryKey:[`console-execution`],queryFn:({signal:e})=>G(`/api/console/execution`,{signal:e}),refetchInterval:5e3}),t=e.data;return(0,W.jsxs)(`section`,{className:`rounded-2xl border border-foreground/10 p-4`,children:[(0,W.jsx)(`h2`,{className:`mb-3 text-sm font-medium`,children:`Execution`}),(0,W.jsx)(qX,{pending:e.isPending,error:e.error,retry:e.refetch}),t&&(0,W.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,W.jsxs)(`p`,{children:[`Selected backend: `,(0,W.jsx)(`span`,{className:`font-medium`,children:t.profile===`smolvm`?`SmolVM`:`Local`})]}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`The runtime and an approved image must both be configured before a chat can use SmolVM.`}),t.profile===`smolvm`&&(!t.configured||!t.imageApproved||!t.runtimeReady)&&(0,W.jsxs)(`div`,{role:`status`,className:`space-y-2 rounded-xl bg-amber-500/10 p-3 text-sm`,children:[(0,W.jsx)(`p`,{className:`font-medium`,children:`SmolVM needs setup`}),(0,W.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:t.configured?t.runtimeReady?`The configured VM image is not approved or is unavailable. Run workbench setup with your image archive.`:`The configured VM runtime is unavailable. Run workbench setup to repair it.`:`SmolVM is selected, but no workbench image or provider grant has been configured. Installing the runtime alone does not finish setup.`}),(0,W.jsx)(`code`,{className:`block break-all text-xs`,children:`0 workbench setup --image /path/to/workbench.tar --provider chatgpt-codex`})]}),(0,W.jsxs)(`dl`,{className:`grid gap-x-4 gap-y-2 sm:grid-cols-[8rem_minmax(0,1fr)]`,children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`VM setup`}),(0,W.jsx)(`dd`,{children:t.configured?`Configured`:`Not configured`}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`VM runtime`}),(0,W.jsx)(`dd`,{children:t.runtimeReady?`Available`:`Unavailable`}),(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`VM image`}),(0,W.jsx)(`dd`,{children:t.imageApproved?`Approved`:`Not approved`}),t.workspace&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Workspace setting`}),(0,W.jsx)(`dd`,{className:`break-all`,children:t.workspace})]}),t.imageDigest&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Image digest`}),(0,W.jsx)(`dd`,{className:`break-all`,children:t.imageDigest})]}),t.resources&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{className:`text-muted-foreground`,children:`Resources`}),(0,W.jsxs)(`dd`,{children:[t.resources.cpus,` CPUs · `,t.resources.memoryMb,` MiB memory · `,t.resources.storageGb,` GiB storage`]})]})]}),(t.error||t.message)&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.error||t.message})]})]})}function mZ({presentationOnly:e=!1,category:t=`general`}){let n=sZ(),r=Vr(),[i,a]=(0,S.useState)(``),[o,s]=(0,S.useState)(`global`),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(null),d=e=>{h.reset(),u.current=document.activeElement instanceof HTMLElement?document.activeElement:null,l(e)},[f,p]=(0,S.useState)(null);(0,S.useEffect)(()=>{n.data&&s(n.data.defaultWriteLayer)},[n.data?.defaultWriteLayer]);let m=ri({mutationFn:async e=>{let t=await G(`/api/console/settings`,{method:`PATCH`,body:JSON.stringify(e)});if(t.persisted===!1)throw Error(`Couldn't save this setting.`);return t},onSuccess:e=>{r.setQueryData([`console-settings`],e),p(`Saved.`)}}),h=ri({mutationFn:async()=>{let e=await G(`/api/console/settings/reset`,ZX({keys:c?.length?c:g.map(e=>e.key)}));if(e.persisted===!1)throw Error(`Couldn't reset settings.`);return e},onSuccess:e=>{r.setQueryData([`console-settings`],e),l(null),p(`Reset to defaults.`)}}),g=n.data?.definitions.filter(t=>!lZ.has(t.key)&&t.key!==`theme`&&(!e||t.key===`reduceMotion`))??[],_=g.filter(n=>`${dZ(n)} ${n.label} ${n.description} ${n.key} ${n.group}`.toLowerCase().includes(i.toLowerCase())&&(i.trim()||e||uZ(n)===t));return(0,W.jsxs)(`div`,{className:`space-y-4`,children:[!e&&t===`agents`&&(0,W.jsx)(pZ,{}),(0,W.jsx)(qX,{pending:n.isPending,error:n.error,retry:n.refetch}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(WX,{label:`Search settings`,type:`search`,value:i,onChange:e=>a(e.target.value),placeholder:`Search settings`})}),(0,W.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,W.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Save changes to`}),(0,W.jsx)(yI,{"aria-label":`Save changes to`,value:o,onValueChange:e=>s(e),options:[{value:`global`,label:`All projects`},{value:`project`,label:`This project`}]})]})]}),(0,W.jsx)(KX,{error:m.error??(c===null?h.error:null),message:f}),(0,W.jsx)(of,{open:c!==null,onOpenChange:e=>{!e&&!h.isPending&&l(null)},children:(0,W.jsxs)(uf,{showCloseButton:!h.isPending,onCloseAutoFocus:e=>{e.preventDefault(),u.current?.focus()},children:[(0,W.jsxs)(df,{children:[(0,W.jsxs)(pf,{children:[`Reset `,c?.length?n.data?.definitions.find(e=>e.key===c[0])?.label??`this setting`:`all settings`,`?`]}),(0,W.jsx)(mf,{children:`Restore defaults and remove saved overrides for this computer and project.`})]}),(0,W.jsx)(KX,{error:h.error}),(0,W.jsxs)(ff,{children:[(0,W.jsx)(J,{variant:`ghost`,onClick:()=>l(null),disabled:h.isPending,children:`Cancel`}),(0,W.jsx)(JX,{variant:`destructive`,pending:h.isPending,onClick:()=>h.mutate(),children:`Reset`})]})]})}),(0,W.jsx)(`section`,{className:`divide-y divide-foreground/5 rounded-2xl border border-foreground/10 px-4`,children:_.map(e=>(0,W.jsx)(fZ,{definition:e,value:n.data.settings[e.key],scope:o,pending:m.isPending||h.isPending,apply:(e,t,n)=>m.mutate({key:e,value:t,scope:n})},e.key))}),n.data&&_.length===0&&(i.trim()||t!==`general`)&&(0,W.jsx)(XX,{children:`No matching settings.`}),!e&&t===`general`&&!i.trim()&&(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Reset settings`}),(0,W.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Restore web settings to defaults.`})]}),(0,W.jsx)(J,{variant:`outline`,disabled:m.isPending||h.isPending,onClick:()=>d([]),children:`Reset all`})]})]})}function hZ({id:e}){let t=`size-6`;if(e===`github`)return(0,W.jsx)(Fk,{"aria-hidden":`true`,className:t,weight:`fill`});if(e===`slack`)return(0,W.jsx)(Vk,{"aria-hidden":`true`,className:t});if(e===`teams`)return(0,W.jsx)(zk,{"aria-hidden":`true`,className:t,weight:`fill`});let n={elastic:wa,semgrep:ba,snyk:go,linear:jo,jira:Ua,cloudflare:ya}[e]??no;return(0,W.jsx)(n,{"aria-hidden":`true`,className:t})}function gZ({filter:e=``}){let t=Vr(),n=ni({queryKey:[`console-service-plugins`],queryFn:({signal:e})=>G(`/api/console/service-plugins`,{signal:e}),refetchInterval:15e3}),[r,i]=(0,S.useState)(`all`),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)({}),l=(0,S.useRef)(null),u=async()=>{await Promise.all([t.invalidateQueries({queryKey:[`console-service-plugins`]}),t.invalidateQueries({queryKey:[`console-tools`]}),t.invalidateQueries({queryKey:[`workflow-tool-catalog`]})])},d=ri({mutationFn:({id:e,fields:t})=>G(`/api/console/service-plugins/${encodeURIComponent(e)}/connect`,{method:`POST`,body:JSON.stringify({fields:t,approved:!0})}),onSuccess:async()=>{await u(),o(null),c({})}}),f=ri({mutationFn:({id:e,enabled:t})=>G(`/api/console/service-plugins/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({enabled:t})}),onSuccess:u,onError:()=>{n.refetch()}}),p=(e,t)=>{l.current=t,d.reset(),c({...e.values}),o(e)},m=()=>{d.isPending||(o(null),c({}),d.reset())},h=n.data?.items.filter(e=>e.configured).length??0,g=n.data?.items.filter(t=>(r===`all`||t.configured)&&`${t.name} ${t.description} ${t.category}`.toLowerCase().includes(e.toLowerCase()))??[];return(0,W.jsxs)(`section`,{className:`space-y-5`,"aria-label":`Service plugins`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,W.jsx)(`h2`,{className:`text-base font-medium`,children:`Service plugins`}),(0,W.jsxs)(`div`,{className:`flex gap-1 rounded-full bg-muted/50 p-1`,role:`group`,"aria-label":`Filter service plugins`,children:[(0,W.jsx)(J,{variant:r===`all`?`secondary`:`ghost`,size:`sm`,"aria-pressed":r===`all`,onClick:()=>i(`all`),children:`All`}),(0,W.jsxs)(J,{variant:r===`connected`?`secondary`:`ghost`,size:`sm`,"aria-pressed":r===`connected`,onClick:()=>i(`connected`),children:[`Connected`,h>0?` · ${h}`:``]})]})]}),n.isPending&&(0,W.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 py-8 text-sm text-muted-foreground`,children:[(0,W.jsx)(RI,{className:`console-loading-dots-compact`}),`Loading service plugins…`]}),n.error&&(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(KX,{error:n.error}),(0,W.jsx)(J,{variant:`secondary`,onClick:()=>void n.refetch(),disabled:n.isFetching,children:`Try again`})]}),n.data&&g.length===0&&(0,W.jsx)(`p`,{className:`py-8 text-sm text-muted-foreground`,children:e.trim()?`No service plugins match your search.`:`Connect a service to see it here.`}),(0,W.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:g.map(e=>(0,W.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-4 rounded-2xl bg-muted/35 p-5 transition-colors duration-150 motion-reduce:transition-none hover:bg-muted/55`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-background/60 text-foreground`,children:(0,W.jsx)(hZ,{id:e.id})}),(0,W.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium`,children:e.name}),e.configured&&(0,W.jsx)(cJ,{checked:e.enabled,"aria-label":`Enable ${e.name}`,disabled:f.isPending&&f.variables?.id===e.id,onCheckedChange:t=>f.mutate({id:e.id,enabled:t})})]}),(0,W.jsx)(`p`,{className:`flex-1 text-sm leading-6 text-muted-foreground`,children:e.description}),(0,W.jsx)(`div`,{className:`flex items-center justify-between gap-3`,children:e.configured?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[e.enabled&&(0,W.jsx)(ua,{"aria-hidden":`true`,className:`size-3.5 text-primary-text`}),e.enabled?`Connected`:`Off`]}),(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:t=>p(e,t.currentTarget),children:`Manage`})]}):(0,W.jsx)(J,{variant:`secondary`,size:`sm`,onClick:t=>p(e,t.currentTarget),children:`Connect`})}),e.error&&(0,W.jsx)(KX,{error:e.error}),f.variables?.id===e.id&&f.error&&(0,W.jsx)(KX,{error:f.error})]},e.id))}),(0,W.jsx)(of,{open:!!a,onOpenChange:e=>{e||m()},children:(0,W.jsxs)(uf,{showCloseButton:!d.isPending,onCloseAutoFocus:e=>{e.preventDefault(),l.current?.focus()},onEscapeKeyDown:e=>{d.isPending&&e.preventDefault()},onInteractOutside:e=>{d.isPending&&e.preventDefault()},children:[(0,W.jsxs)(df,{children:[(0,W.jsxs)(pf,{children:[a?.configured?`Manage`:`Connect`,` `,a?.name]}),(0,W.jsx)(mf,{children:a?.description})]}),a&&(0,W.jsxs)(`form`,{id:`service-plugin-connect`,className:`space-y-4`,onSubmit:e=>{e.preventDefault(),d.mutate({id:a.id,fields:s})},children:[a.fields.map(e=>(0,W.jsxs)(`div`,{className:`grid gap-2`,children:[(0,W.jsx)(`label`,{htmlFor:`service-${a.id}-${e.key}`,className:`text-sm font-medium`,children:e.label}),(0,W.jsx)(af,{id:`service-${a.id}-${e.key}`,type:e.type===`secret`?`password`:e.type===`url`?`url`:`text`,value:s[e.key]??``,onChange:t=>c(n=>({...n,[e.key]:t.target.value})),required:e.required&&!(a.configured&&e.type===`secret`),placeholder:e.type===`secret`&&a.configured?`Saved · leave blank to keep`:void 0,disabled:d.isPending,autoComplete:`off`,"data-1p-ignore":!0,"data-lpignore":`true`,spellCheck:!1})]},e.key)),a.credentialNote&&(0,W.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:a.credentialNote}),a.configured&&a.tools.length>0&&(0,W.jsxs)(`details`,{className:`text-sm`,children:[(0,W.jsxs)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:[a.tools.length,` available tools`]}),(0,W.jsx)(`ul`,{className:`mt-3 space-y-3`,children:a.tools.map(e=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`p`,{className:`font-medium`,children:e.name}),(0,W.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-muted-foreground`,children:e.description})]},e.name))})]}),(0,W.jsx)(KX,{error:d.error})]}),(0,W.jsxs)(ff,{className:`items-center sm:justify-between`,children:[(0,W.jsx)(J,{variant:`link`,asChild:!0,children:(0,W.jsxs)(`a`,{href:a?.docsUrl,target:`_blank`,rel:`noopener noreferrer`,children:[`Setup instructions`,(0,W.jsx)(ia,{className:`size-3.5`})]})}),(0,W.jsx)(J,{type:`submit`,form:`service-plugin-connect`,disabled:d.isPending,children:d.isPending?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(RI,{className:`console-loading-dots-compact`}),`Connecting…`]}):a?.configured?`Save and reconnect`:`Connect`})]})]})})]})}function _Z({sessionId:e}){let t=(0,S.useRef)(null),n=Vr(),r=ni({queryKey:[`console-plugins`],queryFn:({signal:e})=>G(`/api/console/plugins`,{signal:e}),refetchInterval:5e3}),i=r.data?.executionProfile===`smolvm`,[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)(null),p=ri({mutationFn:async({action:e,target:t,approved:n=!1})=>{if(e===`theme`){if((await G(`/api/console/settings`,{method:`PATCH`,body:JSON.stringify({key:`theme`,value:t.id,scope:`global`})})).persisted===!1)throw Error(`Couldn't save the theme.`);return{ok:!0,message:`Theme applied.`}}if((e===`enable`||e===`run`||e===`install`)&&!n)throw Error(`Confirm this action first.`);let r=e===`install`?{id:t.id,kind:t.kind}:e===`enable`?{id:t.id,approved:!0,capabilities:t.capabilities,version:t.version}:{id:t.id},a=await G(`/api/console/plugins/${e}`,ZX(r));if(!a.ok&&!(e===`run`&&a.deferred))throw Error(a.message);if(e===`enable`&&!i){let e=await G(`/api/console/plugins/run`,ZX({id:t.id}));if(!e.ok&&!e.deferred)throw Error(e.message);return e}return a},onSuccess:async(e,{action:t})=>{await Promise.all([r.refetch(),n.invalidateQueries({queryKey:[`console-themes`]}),n.invalidateQueries({queryKey:[`console-settings`]}),n.invalidateQueries({queryKey:[`console-tools`]})]),c(null),u(e.message),f(t===`enable`?e.deferred?`Enabled. Loading after the current response finishes.`:`Enabled.`:t===`disable`?`Disabled for new sessions.`:t===`install`?`Installed.`:t===`theme`?`Theme applied.`:e.deferred?`Loading is waiting for the current response to finish.`:`Loaded.`)},onError:()=>{r.refetch()}}),m=(e,t)=>{p.reset(),c({action:e,item:t})},h=r.data?.items.filter(e=>`${e.name} ${e.id} ${e.description}`.toLowerCase().includes(a.toLowerCase()))??[];return(0,W.jsxs)(`div`,{className:`space-y-6`,children:[(0,W.jsx)(`div`,{className:`space-y-3`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,W.jsx)(fo,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,W.jsx)(af,{"data-1p-ignore":!0,"data-lpignore":`true`,autoComplete:`off`,"aria-label":`Search plugins`,type:`search`,placeholder:`Search plugins`,value:a,onChange:e=>o(e.target.value),className:`pl-9`})]}),(0,W.jsx)(J,{variant:`ghost`,size:`icon`,onClick:()=>{r.refetch(),n.invalidateQueries({queryKey:[`console-service-plugins`]})},disabled:r.isFetching||p.isPending,"aria-label":`Refresh plugins`,title:`Refresh plugins`,children:(0,W.jsx)(so,{className:`size-4`})})]})}),(0,W.jsx)(gZ,{filter:a}),(0,W.jsxs)(`div`,{className:`space-y-3 border-t border-foreground/5 pt-6`,children:[(0,W.jsx)(`h2`,{className:`text-base font-medium`,children:`Installed plugins & themes`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i?`Approved plugins are copied into each new SmolVM chat and run inside its VM. Plugin changes apply to new chats.`:e?`Plugin changes apply to new sessions, not this one.`:`Plugin changes apply to new sessions.`})]}),r.isPending&&(0,W.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 py-6 text-sm text-muted-foreground`,children:[(0,W.jsx)(RI,{className:`console-loading-dots-compact`}),`Loading plugins and themes…`]}),r.error&&(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(KX,{error:r.error}),(0,W.jsx)(J,{variant:`outline`,disabled:r.isFetching,onClick:()=>void r.refetch(),children:`Try again`})]}),r.data&&(0,W.jsxs)(W.Fragment,{children:[r.data.registry.error?(0,W.jsx)(KX,{error:r.data.registry.error}):!r.data.registry.available&&(0,W.jsx)(KX,{error:`The plugin registry is offline. Installed plugins are still listed below.`}),h.length===0?(0,W.jsxs)(`div`,{className:`space-y-2 py-8 text-sm text-muted-foreground`,children:[(0,W.jsx)(`p`,{children:a.trim()?`No installed plugins or themes match your search.`:`No plugins or themes available.`}),a&&(0,W.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>o(``),children:`Clear search`})]}):(0,W.jsx)(`div`,{className:`space-y-4`,"aria-label":`Plugins and themes`,children:h.map(e=>{let n=e.kind===`theme`?Qa:sa,a=e.kind===`plugin`?[[i?`Enabled for new VM chats`:`Loaded in current host`,(i?e.state===`enabled`:e.loaded)?`Yes`:`No`]]:[],o=p.variables?.target.id===e.id&&p.variables?.target.kind===e.kind,s=e?.description&&!r.data?.host.tools.some(t=>t.name===e.description)&&!/^[a-z][a-z0-9_]*(?:, [a-z][a-z0-9_]*)+$/.test(e.description)&&!/^[a-z][a-z0-9]*_[a-z0-9_]+$/.test(e.description)?e.description:``;return(0,W.jsxs)(`section`,{className:`min-w-0 space-y-4 rounded-2xl border border-foreground/10 p-4`,"aria-label":e.name,children:[(0,W.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,W.jsx)(n,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-muted-foreground`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:e.name}),(0,W.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.kind===`theme`?`Theme`:`Plugin`,` · `,e.version]})]}),(0,W.jsx)(I_,{variant:`outline`,className:`shrink-0 text-xs`,children:e.state})]}),s&&(0,W.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:s}),e.error&&(0,W.jsx)(KX,{error:e.error}),e.state===`available`&&(0,W.jsxs)(JX,{pending:p.isPending,disabled:!r.data.registry.available||!!e.error,onClick:n=>{t.current=n.currentTarget,m(`install`,e)},children:[`Install `,e.kind]}),e.kind===`plugin`&&e.state!==`available`&&(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-t border-foreground/5 pt-4`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-sm font-medium`,children:`Enable plugin`}),(0,W.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:i?e.state===`enabled`?`Loads automatically inside new SmolVM chats.`:`Off for new SmolVM chats.`:e.state===`enabled`?r.data.deferred.includes(e.id)?`Loading when the current response finishes.`:e.loaded?`Ready for new sessions.`:`Enabled for new sessions.`:`Off for new sessions.`})]}),(0,W.jsx)(cJ,{onClick:e=>{t.current=e.currentTarget},"aria-label":`Enable ${e.name}`,checked:e.state===`enabled`,disabled:p.isPending||!!e.error&&e.state!==`enabled`,onCheckedChange:t=>t?m(`enable`,e):p.mutate({action:`disable`,target:e})})]}),e.kind===`theme`&&e.state===`installed`&&(0,W.jsx)(JX,{pending:p.isPending,onClick:()=>p.mutate({action:`theme`,target:e}),children:`Use theme`}),e.kind===`theme`&&e.state===`active`&&(0,W.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`In use. Change it in Settings.`}),o&&(0,W.jsx)(KX,{error:p.error,message:d}),(0,W.jsx)(VX,{title:e.kind===`theme`?`Theme details`:`Permissions and details`,children:(0,W.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,W.jsx)(YX,{entries:[[`ID`,e.id],[`Version`,e.version],[`Signature`,e.signature],[`Status`,e.state],...a]}),e.kind===`plugin`&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Permissions`}),e.capabilities.length?(0,W.jsx)(`ul`,{className:`mt-2 list-inside list-disc space-y-1 text-sm break-words`,children:e.capabilities.map(e=>(0,W.jsx)(`li`,{children:e},e))}):(0,W.jsx)(`p`,{className:`mt-1 text-sm`,children:`No extra permissions.`})]}),e.kind===`plugin`&&e.state===`enabled`&&!e.loaded&&!i&&(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:`Enabling saves your preference. Loading executes plugin code in the local host; an active response may defer it.`}),(0,W.jsx)(J,{variant:`secondary`,disabled:p.isPending,onClick:n=>{t.current=n.currentTarget,m(`run`,e)},children:`Load plugin`})]}),o&&l&&(0,W.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:l})]})})]},`${e.kind}:${e.id}`)})}),(0,W.jsx)(VX,{title:`Registry details`,children:(0,W.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,W.jsx)(YX,{entries:[[`Registry`,r.data.registry.url],...i?[]:[[`Loaded plugins`,r.data.host.loadedPluginIds.length?r.data.host.loadedPluginIds.join(`, `):`None`],[`Waiting to load`,r.data.deferred.length?r.data.deferred.join(`, `):`None`]]]}),!i&&r.data.host.tools.length>0&&(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Plugin tools`}),(0,W.jsx)(`ul`,{className:`space-y-3`,children:r.data.host.tools.map(e=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,W.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-muted-foreground`,children:e.description})]},e.name))})]})]})})]}),(0,W.jsx)(of,{open:!!s,onOpenChange:e=>{!e&&!p.isPending&&(c(null),p.reset())},children:(0,W.jsxs)(uf,{showCloseButton:!p.isPending,onCloseAutoFocus:e=>{e.preventDefault(),t.current?.focus()},onEscapeKeyDown:e=>{p.isPending&&e.preventDefault()},onInteractOutside:e=>{p.isPending&&e.preventDefault()},children:[(0,W.jsxs)(df,{children:[(0,W.jsxs)(pf,{children:[s?.action===`enable`?`Enable`:s?.action===`run`?`Load`:`Install`,` `,s?.item.name]}),(0,W.jsx)(mf,{children:s?.action===`enable`?i?`Approve this version and its permissions for new SmolVM chats. Its files will be copied and its code loaded inside the VM automatically. Existing chats keep their current tools.`:`Approve this version and its permissions, and allow its code to load in the local host. Existing sessions keep their current tools.`:s?.action===`run`?`This runs the plugin's code in the local host. An active response may defer loading.`:`Install this artifact from the configured registry.`})]}),s&&(0,W.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,W.jsxs)(`p`,{className:`text-muted-foreground`,children:[s.item.name,` `,s.item.version]}),s.action===`install`&&s.item.signature===`unverified`&&(0,W.jsx)(`p`,{className:`leading-6`,children:`The signature is unverified. Only install if you trust this source.`}),s.item.kind===`plugin`&&s.action!==`run`&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`p`,{className:`font-medium`,children:`Permissions`}),s.item.capabilities.length?(0,W.jsx)(`ul`,{className:`mt-2 list-inside list-disc space-y-1 break-words`,children:s.item.capabilities.map(e=>(0,W.jsx)(`li`,{children:e},e))}):(0,W.jsx)(`p`,{className:`mt-2 text-muted-foreground`,children:`No extra permissions.`})]}),(0,W.jsx)(KX,{error:p.error})]}),(0,W.jsxs)(ff,{children:[(0,W.jsx)(J,{variant:`ghost`,disabled:p.isPending,onClick:()=>{c(null),p.reset()},children:`Cancel`}),(0,W.jsx)(JX,{pending:p.isPending,onClick:()=>{s&&p.mutate({action:s.action,target:s.item,approved:!0})},children:s?.action===`enable`?`Approve and enable`:s?.action===`run`?`Allow and load`:`Install`})]})]})})]})}function vZ(){let[e,t]=(0,S.useState)(``),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(null),c=ri({mutationFn:async t=>{if(t===`send`&&(!o?.previewId||!i))throw Error(`Review the report and confirm sending first.`);if(t===`save`&&!e.trim())throw Error(`Enter some feedback first.`);return G(`/api/console/feedback`,ZX(t===`save`?{message:e.trim(),submit:n}:t===`send`?{action:t,previewId:o?.previewId}:{action:t}))},onSuccess:e=>{s(e),a(!1),e.submitted&&t(``)}});return(0,W.jsxs)(HX,{title:`Feedback`,children:[(0,W.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),c.mutate(`save`)},children:[(0,W.jsx)(UX,{label:`What happened?`,hint:`Don't paste passwords or keys.`,children:(0,W.jsx)(ev,{value:e,maxLength:16e3,required:!0,rows:4,disabled:c.isPending,onChange:e=>{t(e.target.value),s(null),a(!1),c.reset()}})}),(0,W.jsx)(GX,{checked:n,onChange:e=>{r(e),s(null),a(!1)},disabled:c.isPending,children:`Also prepare a report to send (nothing is sent yet).`}),(0,W.jsx)(JX,{type:`submit`,pending:c.isPending&&c.variables===`save`,disabled:!e.trim()||c.isPending,children:n?`Save & preview`:`Save`})]}),o?.path&&(0,W.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[`Saved to `,o.path]}),o?.preview&&(0,W.jsxs)(`section`,{className:`space-y-4 border-t border-border pt-4`,children:[(0,W.jsx)(YX,{entries:[[`Sends to`,o.preview.url]]}),o.preview.warnings.map((e,t)=>(0,W.jsx)(`p`,{className:`rounded-md border border-border bg-muted/20 p-3 text-sm`,children:e},t)),(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Headers`}),children:(0,W.jsx)(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded-md border border-border bg-muted/20 p-3 text-xs`,children:JSON.stringify(o.preview.headers,null,2)})}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`mb-2 text-sm font-medium`,children:`Report contents`}),(0,W.jsx)(`pre`,{className:`max-h-96 overflow-auto rounded-md border border-border bg-muted/20 p-3 text-xs`,children:o.preview.body})]}),(0,W.jsx)(GX,{checked:i,onChange:a,disabled:c.isPending,children:`I reviewed this report and want to send it now (just this once).`}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(JX,{pending:c.isPending&&c.variables===`send`,disabled:!i||c.isPending,onClick:()=>c.mutate(`send`),children:`Send`}),(0,W.jsx)(J,{variant:`outline`,disabled:c.isPending,onClick:()=>c.mutate(`cancel`),children:`Don't send`})]})]}),(0,W.jsx)(KX,{error:c.error,message:o?.submitted?`Report sent.`:o?.cancelled?`Not sent. Your feedback is still saved.`:o?.saved&&!o.preview?`Saved. Nothing was sent.`:null})]})}var yZ={standard:`Asks you before each action.`,recon:`Read-only. Active and exploit tools are blocked.`,copilot:`Doesn't ask per action. May add related targets; asks before new ones.`,yolo:`Never asks. Your exclusions, private networks and credentials stay protected.`};function bZ({item:e,busy:t,mutate:n}){let[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(e.prompt),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(!1);return(0,S.useEffect)(()=>{o(e.prompt),c(!1),i(!1)},[e.revision,e.prompt]),(0,W.jsxs)(`article`,{className:`space-y-3 rounded-md border border-border p-4`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:e.name}),e.enabled&&e.approvedRevision!==e.revision&&(0,W.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,children:`Changed since approval`})]}),(0,W.jsx)(I_,{variant:e.enabled?`secondary`:`outline`,children:e.enabled?`On`:`Off`})]}),r?(0,W.jsxs)(`form`,{className:`space-y-3`,onSubmit:t=>{t.preventDefault(),n({action:`set`,id:e.id,prompt:a.trim(),approved:s,expectedRevision:e.revision})},children:[(0,W.jsx)(UX,{label:`Check prompt`,children:(0,W.jsx)(ev,{value:a,onChange:e=>o(e.target.value),required:!0,maxLength:2e3,disabled:t})}),e.enabled&&(0,W.jsx)(GX,{checked:s,onChange:c,children:`I approve this new prompt.`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(JX,{pending:t,type:`submit`,disabled:!a.trim()||e.enabled&&!s,children:`Save`}),(0,W.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>{i(!1),o(e.prompt),c(!1)},children:`Cancel`})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed`,children:e.prompt}),!e.enabled&&(0,W.jsx)(GX,{checked:s,onChange:c,disabled:t,children:`I approve this prompt.`}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.enabled?(0,W.jsx)(J,{size:`sm`,variant:`outline`,disabled:t,onClick:()=>n({action:`disable`,id:e.id}),children:`Disable`}):(0,W.jsx)(J,{size:`sm`,disabled:t||!s,onClick:()=>n({action:`enable`,id:e.id,approved:!0,expectedRevision:e.revision}),children:`Turn on`}),(0,W.jsx)(J,{size:`sm`,variant:`outline`,disabled:t,onClick:()=>{i(!0),c(!1)},children:`Edit`}),(0,W.jsx)(J,{size:`sm`,variant:`ghost`,disabled:t,onClick:()=>u(!0),children:`Remove`})]})]}),l&&(0,W.jsxs)(`div`,{className:`space-y-2 border-t border-border pt-3`,children:[(0,W.jsx)(`p`,{className:`text-sm`,children:`Delete this check? This can't be undone.`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(J,{variant:`destructive`,size:`sm`,disabled:t,onClick:()=>n({action:`remove`,id:e.id}),children:`Delete`}),(0,W.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>u(!1),children:`Cancel`})]})]})]})}function xZ({sessionId:e,onApplied:t}){let n=Vr(),r=rt(),i=et(),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(`standard`),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(!1),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(``),[O,k]=(0,S.useState)(!1),A=ni({queryKey:[`console-project`,s],queryFn:({signal:e})=>G(`/api/console/project?path=${encodeURIComponent(s)}`,{signal:e})}),j=ni({queryKey:[`console-checks`,A.data?.path],enabled:!!A.data,queryFn:({signal:e})=>G(`/api/console/checks?path=${encodeURIComponent(A.data.path)}`,{signal:e})}),M=ni({queryKey:[`console-control-session`,e],enabled:!!e,queryFn:async({signal:t})=>(await G(`/api/console/sessions/${encodeURIComponent(e)}`,{signal:t})).snapshot});(0,S.useEffect)(()=>{M.data&&(u(M.data.session.target),f(M.data.session.autonomyMode),T(M.data.scope?.in_scope?.join(`
109
+ `)??``),D(M.data.scope?.out_of_scope?.join(`
110
+ `)??``))},[M.data?.session.id]);let N=ri({mutationFn:async()=>{if([`copilot`,`yolo`].includes(d)&&!p)throw Error(`Confirm the autonomy mode first.`);if(!O)throw Error(`Review and approve the scope first.`);let t=e??(await G(`/api/console/sessions`,ZX({target:l.trim(),autonomyMode:d}))).session.id;return(await G(`/api/console/sessions/${encodeURIComponent(t)}/configuration`,{method:`PATCH`,body:JSON.stringify({target:l.trim(),autonomyMode:d,scope:{in_scope:w.split(`
111
+ `).map(e=>e.trim()).filter(Boolean),out_of_scope:E.split(`
112
+ `).map(e=>e.trim()).filter(Boolean)}})})).session},onSuccess:async a=>{if(C(a.pendingConfiguration?`Saved. Takes effect after the current step.`:`Saved.`),await n.invalidateQueries({queryKey:[`console-control-session`]}),t)t(a);else if(!e){let e=new URLSearchParams(i.search);e.set(`session`,a.id),e.set(`return`,`/console/${a.id}`),r(`${i.pathname}?${e}`,{replace:!0})}}}),P=ri({mutationFn:e=>G(`/api/console/checks`,ZX({path:A.data.path,mutation:e})),onSuccess:e=>{n.setQueryData([`console-checks`,A.data.path],e),g(``),v(``),b(!1),C(`Checks updated.`)}});return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(HX,{title:`Project`,children:[(0,W.jsxs)(`form`,{className:`flex flex-col items-end gap-3 sm:flex-row`,onSubmit:e=>{e.preventDefault(),c(a.trim())},children:[(0,W.jsx)(`div`,{className:`w-full`,children:(0,W.jsx)(WX,{label:`Project folder`,value:a,onChange:e=>o(e.target.value),placeholder:`/path/to/project`})}),(0,W.jsx)(JX,{type:`submit`,pending:A.isFetching,children:`Open`})]}),(0,W.jsx)(qX,{pending:A.isPending,error:A.error,retry:A.refetch}),A.data&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(YX,{entries:[[`Project`,(0,W.jsx)(`span`,{title:A.data.path,children:A.data.name})],[`Branch`,A.data.git.branch??`Not a Git repo`],[`Changes`,A.data.git.dirty?`Uncommitted changes`:`Clean`]]}),A.data.git.error&&(0,W.jsx)(KX,{error:A.data.git.error}),(0,W.jsx)(J,{variant:`outline`,onClick:()=>u(`source:${A.data.path}`),children:`Use as target`})]})]}),(0,W.jsxs)(HX,{title:`Scope & autonomy`,children:[(0,W.jsx)(qX,{pending:!!e&&M.isPending,error:M.error,retry:M.refetch}),M.data&&!M.data.scopeEnforcement.enabled&&(0,W.jsx)(KX,{error:M.data.scopeEnforcement.message||`Scope checks are off.`}),M.data?.localScopePath&&(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Allowed folder: `,(0,W.jsx)(`span`,{className:`break-all`,children:M.data.localScopePath})]}),(0,W.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),N.mutate()},children:[(0,W.jsx)(WX,{label:`Target (optional)`,value:l,onChange:e=>{u(e.target.value),k(!1)},maxLength:4096,placeholder:`https://example.com or source:/path/to/project`}),(0,W.jsx)(VX,{open:!!(M.data?.scope?.in_scope?.length||M.data?.scope?.out_of_scope?.length)||void 0,title:(0,W.jsx)(W.Fragment,{children:`Scope rules`}),children:(0,W.jsxs)(`div`,{className:`mt-3 grid gap-4 sm:grid-cols-2`,children:[(0,W.jsx)(UX,{label:`In scope`,hint:`One per line.`,children:(0,W.jsx)(ev,{rows:4,value:w,onChange:e=>{T(e.target.value),k(!1)}})}),(0,W.jsx)(UX,{label:`Out of scope`,hint:`One per line.`,children:(0,W.jsx)(ev,{rows:4,value:E,onChange:e=>{D(e.target.value),k(!1)}})})]})},M.data?.session.id??`new`),(0,W.jsx)(UX,{label:`Autonomy mode`,hint:yZ[d],children:(0,W.jsx)(yI,{"aria-label":`Autonomy mode`,value:d,onValueChange:e=>{f(e),m(!1)},options:Object.keys(yZ).map(e=>({value:e,label:e}))})}),[`copilot`,`yolo`].includes(d)&&(0,W.jsx)(GX,{checked:p,onChange:m,children:`I understand this mode won't ask before each action.`}),(0,W.jsx)(GX,{checked:O,onChange:k,children:`I reviewed this target and scope.`}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(JX,{type:`submit`,pending:N.isPending,disabled:!O||[`copilot`,`yolo`].includes(d)&&!p,children:e?`Save`:`Start`}),(0,W.jsx)(J,{type:`button`,variant:`outline`,onClick:()=>{u(M.data?.session.target??``),f(M.data?.session.autonomyMode??`standard`),T(M.data?.scope?.in_scope?.join(`
113
+ `)??``),D(M.data?.scope?.out_of_scope?.join(`
114
+ `)??``),k(!1),m(!1),N.reset()},children:`Reset`})]})]}),(0,W.jsx)(KX,{error:N.error,message:x})]}),A.data&&(0,W.jsxs)(HX,{title:`Review checks`,children:[(0,W.jsx)(qX,{pending:j.isPending,error:j.error,retry:j.refetch}),j.data?.checks.length===0&&(0,W.jsx)(XX,{children:`No checks yet.`}),j.data?.checks.map(e=>(0,W.jsx)(bZ,{item:e,busy:P.isPending,mutate:e=>P.mutate(e)},e.id)),(0,W.jsx)(VX,{className:`border-t border-border pt-4`,open:j.data?.checks.length===0||void 0,title:(0,W.jsx)(W.Fragment,{children:`Add a check`}),children:(0,W.jsxs)(`form`,{className:`mt-4 space-y-4`,onSubmit:e=>{e.preventDefault(),P.mutate({action:y?`add`:`propose`,name:h.trim(),prompt:_.trim(),...y?{approved:!0}:{}})},children:[(0,W.jsx)(WX,{label:`New check name`,value:h,onChange:e=>g(e.target.value),required:!0,maxLength:120}),(0,W.jsx)(UX,{label:`What to check`,children:(0,W.jsx)(ev,{value:_,onChange:e=>v(e.target.value),required:!0,maxLength:2e3,rows:4})}),(0,W.jsx)(GX,{checked:y,onChange:b,children:`Turn on now (otherwise saved as a draft).`}),(0,W.jsx)(JX,{type:`submit`,pending:P.isPending,disabled:!h.trim()||!_.trim(),children:y?`Add check`:`Save draft`})]})}),(0,W.jsx)(KX,{error:P.error})]})]})}function SZ(){let e=ni({queryKey:[`console-doctor`],queryFn:({signal:e})=>G(`/api/console/doctor`,{signal:e})});return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsxs)(HX,{title:`Health`,children:[(0,W.jsx)(qX,{pending:e.isPending,error:e.error,retry:e.refetch}),e.data&&(()=>{let t=e.data,n=t.providers.filter(e=>e.configured&&!e.diagnostics.valid),r=t.prerequisites.filter(e=>e.required&&!e.available),i=t.availability.apiRuntime.valid&&t.runtime.nodeSupported&&n.length===0&&r.length===0;return(0,W.jsxs)(W.Fragment,{children:[i?(0,W.jsx)(KX,{message:`All good · ${t.availability.apiRuntime.providerLabel} · v${t.version}`}):(0,W.jsxs)(W.Fragment,{children:[!t.availability.apiRuntime.valid&&(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(KX,{error:t.availability.apiRuntime.error??`No provider connected.`}),(0,W.jsx)(vn,{to:`/connections`,className:`block text-sm underline`,children:`Connect a provider`})]}),!t.runtime.nodeSupported&&(0,W.jsx)(KX,{error:`Node ${t.runtime.node} is not supported. Install Node 24+.`}),n.map(e=>(0,W.jsx)(KX,{error:`${e.label}: ${e.diagnostics.message??`needs attention`}`},e.id)),r.length>0&&(0,W.jsx)(KX,{error:`Missing: ${r.map(e=>e.id).join(`, `)}`})]}),(0,W.jsxs)(J,{variant:`outline`,onClick:()=>void e.refetch(),disabled:e.isFetching,children:[(0,W.jsx)(so,{className:`size-4`}),`Check again`]}),(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Details`}),children:(0,W.jsxs)(`div`,{className:`mt-4 space-y-5`,children:[(0,W.jsx)(YX,{entries:[[`Version`,t.version],[`Engine`,`${t.runtime.engine} ${t.runtime.engineVersion}`],[`Node`,t.runtime.node],[`Platform`,`${t.runtime.platform} · ${t.runtime.arch}`],[`Other providers`,t.availability.availableRuntimes.join(`, `)||`None`],[`Execution profile`,t.settings.executionProfile],[`Release channel`,t.runtime.releaseChannel],[`Usage sharing`,t.settings.analyticsLevel],[`Problem reporting`,t.settings.diagnosticReporting]]}),(0,W.jsx)(vn,{to:`/settings`,className:`block text-sm underline`,children:`Change sharing in Settings`}),(0,W.jsx)(`ul`,{className:`divide-y divide-border`,children:t.providers.map(e=>(0,W.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-3 py-2`,children:[(0,W.jsx)(`p`,{className:`text-sm`,children:e.label}),(0,W.jsx)(I_,{variant:`outline`,children:e.diagnostics.valid?`OK`:e.configured?`Needs attention`:`Not connected`})]},e.id))}),(0,W.jsx)(`ul`,{className:`divide-y divide-border`,children:t.prerequisites.map(e=>(0,W.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-3 py-2`,children:[(0,W.jsxs)(`p`,{className:`text-sm`,children:[e.id,e.required?``:` (optional)`]}),(0,W.jsx)(I_,{variant:e.available?`secondary`:`outline`,children:e.available?`Installed`:e.required?`Missing`:`Not installed`})]},e.id))})]})})]})})()]}),(0,W.jsx)(vZ,{})]})}function CZ({sessionId:e}){let[t,n]=(0,S.useState)(``),[r,i]=(0,S.useState)(``),a=ni({queryKey:[`console-tools`],queryFn:({signal:e})=>G(`/api/console/tools`,{signal:e})}),o=ni({queryKey:[`console-control-session`,e],enabled:!!e,queryFn:async({signal:t})=>(await G(`/api/console/sessions/${encodeURIComponent(e)}`,{signal:t})).snapshot,refetchInterval:3e3}),s=a.data?.tools.filter(e=>(!r||e.roles.includes(r))&&`${e.name} ${e.description}`.toLowerCase().includes(t.toLowerCase()))??[],c=o.data?.harness;return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsx)(HX,{title:`Session tools`,children:e?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(qX,{pending:o.isPending,error:o.error,retry:o.refetch}),o.data&&(o.data.tools.length?(0,W.jsx)(VX,{title:(0,W.jsxs)(W.Fragment,{children:[o.data.tools.length,` tools loaded`]}),children:(0,W.jsx)(`ul`,{className:`mt-2 divide-y divide-border`,children:o.data.tools.map(e=>(0,W.jsxs)(`li`,{className:`space-y-2 py-3`,children:[(0,W.jsx)(`h3`,{className:`font-medium text-sm`,children:e.name}),(0,W.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.description}),(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Input schema`}),children:(0,W.jsx)(`pre`,{className:`mt-2 max-h-64 overflow-auto rounded-md border border-border bg-muted/20 p-3 text-xs`,children:JSON.stringify(e.inputSchema,null,2)})})]},e.name))})}):(0,W.jsx)(XX,{children:`No tools loaded yet.`}))]}):(0,W.jsxs)(XX,{children:[`Open a session to see its tools. `,(0,W.jsx)(vn,{to:`/console`,className:`underline`,children:`Go to chat`}),`.`]})}),(0,W.jsx)(HX,{title:`Tool setup`,children:c?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`text-sm`,children:[c.label,` · `,c.status,c.pendingGenerationId?` · update pending`:``]}),!c.trusted&&(0,W.jsx)(KX,{error:`This tool setup isn't trusted.`}),c.error&&(0,W.jsx)(KX,{error:c.error}),(0,W.jsxs)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Details`}),children:[(0,W.jsx)(YX,{entries:[[`Version`,c.generationId??`Built-in`],[`Pending update`,c.pendingGenerationId??`None`]]}),(0,W.jsx)(`ul`,{className:`mt-3 space-y-2`,children:c.providers.map(e=>(0,W.jsxs)(`li`,{className:`rounded-md border border-border p-3 text-sm`,children:[(0,W.jsx)(`p`,{className:`font-medium`,children:e.id}),(0,W.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.kind,` · `,e.services.join(` · `)]})]},e.id))}),(0,W.jsx)(VX,{className:`mt-3`,title:(0,W.jsx)(W.Fragment,{children:`Raw`}),children:(0,W.jsx)(`pre`,{className:`mt-2 max-h-96 overflow-auto rounded-md border border-border bg-muted/20 p-3 text-xs`,children:JSON.stringify(c,null,2)})})]}),e&&(0,W.jsx)(vn,{to:`/console/${encodeURIComponent(e)}`,className:`block text-sm underline`,children:`Manage in chat`})]}):(0,W.jsx)(XX,{children:e?`Nothing reported yet.`:`Open a session to see its tool setup.`})}),(0,W.jsxs)(HX,{title:`All tools`,children:[(0,W.jsx)(qX,{pending:a.isPending,error:a.error,retry:a.refetch}),(0,W.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,W.jsx)(WX,{label:`Find a tool`,type:`search`,value:t,onChange:e=>n(e.target.value)}),(0,W.jsx)(UX,{label:`Role`,children:(0,W.jsx)(yI,{"aria-label":`Role`,value:r,onValueChange:i,options:[{value:``,label:`All roles`},...a.data?.roles.map(e=>({value:e,label:e}))??[]]})})]}),a.data&&s.length===0&&(0,W.jsx)(XX,{children:`No tools match these filters.`}),(0,W.jsx)(`ul`,{className:`divide-y divide-border`,children:s.map(e=>(0,W.jsxs)(`li`,{className:`space-y-1 py-3`,children:[(0,W.jsx)(`h3`,{className:`font-medium text-sm`,children:e.name}),(0,W.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.description})]},e.name))})]}),a.data?.plugins.length?(0,W.jsx)(HX,{title:`Plugin tools`,children:(0,W.jsx)(`ul`,{className:`space-y-3`,children:a.data.plugins.map(e=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`p`,{className:`font-medium text-sm`,children:e.name}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]},e.name))})}):null]})}function wZ(e){if(!Number.isInteger(e.runCount)||e.runCount<1)throw Error(`Scan plan runCount must be a positive integer`);if(e.depth!==`quick`&&e.depth!=="default"&&e.depth!==`deep`)throw Error(`Unknown scan depth "${String(e.depth)}"`);if(!Number.isFinite(e.timeCapMs)||e.timeCapMs<=0)throw Error(`Scan plan timeCapMs must be a positive finite number`);if(!Number.isFinite(e.costCapUsd)||e.costCapUsd<=0)throw Error(`Scan plan costCapUsd must be a positive finite number`);if(e.executionMode!==`sequential`&&e.executionMode!==`parallel`)throw Error(`Unknown scan execution mode "${String(e.executionMode)}"`);if(e.goal!==`known-vulnerabilities`&&e.goal!==`unknown-vulnerabilities`&&e.goal!==`misconfigurations`)throw Error(`Unknown scan goal "${String(e.goal)}"`)}var TZ={queued:!0,running:!0,cancelling:!0};function EZ(e){let t=et(),n=rt(),r=Vr(),i=e??new URLSearchParams(t.search).get(`session`)??``,a=iZ(),o=ni({queryKey:[`console-sessions`],queryFn:({signal:e})=>Ci(e),refetchInterval:3e3}),s=e=>{let r=new URLSearchParams(t.search);r.set(`session`,e),r.set(`return`,`/console/${e}`),n(`${t.pathname}?${r}`,{replace:!0})};return{owner:i,providers:a,sessions:o,select:s,create:ri({mutationFn:()=>G(`/api/console/sessions`,ZX({})),onSuccess:async e=>{await r.invalidateQueries({queryKey:[`console-sessions`]}),s(e.session.id)}}),snapshot:ni({queryKey:[`console-control-session`,i],enabled:!!i,queryFn:async({signal:e})=>(await G(`/api/console/sessions/${encodeURIComponent(i)}`,{signal:e})).snapshot,refetchInterval:3e3}),connected:a.data?.providers.some(e=>e.configured)??!1}}function DZ({state:e}){return(0,W.jsxs)(HX,{title:`Session`,children:[(0,W.jsx)(qX,{pending:e.sessions.isPending||e.providers.isPending,error:e.sessions.error??e.providers.error,retry:()=>{e.sessions.refetch(),e.providers.refetch()}}),(0,W.jsxs)(`div`,{className:`flex flex-col items-end gap-3 sm:flex-row`,children:[(0,W.jsx)(`div`,{className:`w-full`,children:(0,W.jsx)(UX,{label:`Session`,children:(0,W.jsx)(yI,{"aria-label":`Session`,value:e.owner,onValueChange:e.select,options:[{value:``,label:`Choose a session`},...e.sessions.data?.filter(e=>e.status!==`closed`).map(e=>({value:e.id,label:`${e.title??e.target??e.id} · ${e.status}`}))??[]]})})}),(0,W.jsx)(JX,{pending:e.create.isPending,disabled:!e.connected,onClick:()=>e.create.mutate(),children:`New session`})]}),(0,W.jsx)(KX,{error:e.create.error??e.snapshot.error}),e.snapshot.data&&(0,W.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.snapshot.data.runtime?.providerLabel??`No provider`,` · `,e.snapshot.data.runtime?.model??`Default model`,` · `,e.snapshot.data.session.autonomyMode]}),e.snapshot.data&&!e.snapshot.data.scopeEnforcement.enabled&&(0,W.jsx)(KX,{error:e.snapshot.data.scopeEnforcement.message||`Scope checks are off.`}),e.owner&&(0,W.jsxs)(vn,{to:`/console/${encodeURIComponent(e.owner)}`,className:`inline-flex items-center gap-1 text-sm underline`,children:[`Open session`,(0,W.jsx)(ia,{className:`size-3`})]})]})}function OZ({title:e,value:t}){return(0,W.jsx)(VX,{className:`rounded-md border border-border`,title:(0,W.jsx)(W.Fragment,{children:e}),children:(0,W.jsx)(`pre`,{className:`max-h-[32rem] overflow-auto border-t border-border bg-muted/20 p-4 text-xs`,children:typeof t==`string`?t:JSON.stringify(t,null,2)})})}function kZ({workflow:e,cancel:t,cancelling:n}){let r=e.outcome?.estimatedCostUsd??e.outcome?.cost_usd;return(0,W.jsxs)(`article`,{className:`space-y-4 rounded-lg border border-border p-4 sm:p-5`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:e.request.target??e.kind}),(0,W.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.kind,` · `,new Date(e.createdAt).toLocaleString()]})]}),(0,W.jsx)(I_,{variant:e.status===`failed`?`destructive`:`outline`,children:e.status})]}),(0,W.jsx)(YX,{entries:[[`Result`,e.outcome?.exit_reason??(TZ[e.status]?`Running`:e.status)],[`Findings`,e.outcome?.summary?.totalFindings===void 0?`—`:String(e.outcome.summary.totalFindings)],[`Cost`,r===void 0?`Unknown`:`$${r.toFixed(4)}`]]}),e.error&&(0,W.jsx)(KX,{error:e.error}),e.outcome?.ok===!1&&(0,W.jsx)(KX,{error:e.outcome.error??`The scan failed. Results may be incomplete.`}),(0,W.jsx)(VX,{className:`rounded-md border border-border`,title:(0,W.jsx)(W.Fragment,{children:`Details`}),children:(0,W.jsxs)(`div`,{className:`space-y-4 border-t border-border p-4`,children:[(0,W.jsx)(YX,{entries:[[`Target type`,e.request.resolved?.kind??(e.kind===`run`?`—`:`Source fix`)],[`Ecosystem`,e.request.resolved?.ecosystem??`—`],[`Target`,e.request.resolved?.target??e.request.target],[`Provider`,e.runtime.providerId],[`Model`,e.runtime.model],[`Exit code`,e.outcome?.exitCode===void 0?`—`:String(e.outcome.exitCode)],[`Runs done`,e.outcome?.completedRuns===void 0?`—`:`${e.outcome.completedRuns} / ${e.outcome.plannedRuns??`?`}`]]}),e.outcome?.attempts?.length?(0,W.jsxs)(`section`,{className:`space-y-2`,children:[(0,W.jsx)(`h4`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Runs`}),e.outcome.attempts.map((e,t)=>(0,W.jsxs)(`div`,{className:`rounded-md border border-border p-3 text-sm`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,W.jsxs)(`span`,{children:[`Run `,e.runIndex]}),(0,W.jsx)(I_,{variant:e.status===`completed`?`secondary`:`outline`,children:e.status})]}),(0,W.jsxs)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:[(e.durationMs/1e3).toFixed(1),`s · `,e.costUsd===void 0?`Cost unknown`:`$${e.costUsd.toFixed(4)}`]}),e.error&&(0,W.jsx)(`p`,{className:`mt-2 text-sm text-destructive`,children:e.error})]},`${e.runIndex}:${t}`))]}):null,e.outcome?.usage&&(0,W.jsx)(YX,{entries:[[`Input tokens`,e.outcome.usage.inputTokens.toLocaleString()],[`Output tokens`,e.outcome.usage.outputTokens.toLocaleString()]]}),(0,W.jsx)(OZ,{title:`Scan plan`,value:e.request})]})}),e.report!==void 0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(OZ,{title:`Report`,value:e.report}),(0,W.jsxs)(J,{size:`sm`,variant:`outline`,onClick:()=>{let t=new Blob([JSON.stringify(e.report,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`0-report-${e.id}.json`,r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)},children:[(0,W.jsx)(Ta,{className:`size-4`}),`Download report`]})]}),!e.reportRetained&&e.kind===`run`&&!TZ[e.status]&&(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.reportRetentionReason??`No report was saved for this audit. Check the result and findings above.`}),e.events.length>0&&(0,W.jsxs)(VX,{className:`rounded-md border border-border`,title:(0,W.jsxs)(W.Fragment,{children:[`Activity (`,e.events.length,` events)`]}),children:[e.eventsTruncated&&(0,W.jsxs)(`p`,{className:`px-3 text-xs text-muted-foreground`,children:[`Older events were dropped. Showing from #`,e.oldestSequence,`.`]}),(0,W.jsx)(`ol`,{className:`max-h-[32rem] space-y-3 overflow-auto border-t border-border p-3`,children:e.events.map(e=>(0,W.jsxs)(`li`,{className:`space-y-2 rounded-md border border-border p-3`,children:[(0,W.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`#`,e.sequence,` · `,e.type,` · `,new Date(e.timestamp).toLocaleTimeString()]}),(0,W.jsx)(`pre`,{className:`text-xs`,children:JSON.stringify(e.data,null,2)})]},e.sequence))})]}),TZ[e.status]&&(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(JX,{pending:n,variant:`outline`,disabled:e.status===`cancelling`,onClick:t,children:e.status===`cancelling`?`Stopping…`:`Stop`}),(0,W.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Stopping doesn't undo actions already taken.`})]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-4 text-xs`,children:[(0,W.jsx)(vn,{to:`/runs`,className:`underline`,children:`Audit reports`}),(0,W.jsx)(vn,{to:`/findings`,className:`underline`,children:`Findings`})]})]})}function AZ({sessionId:e}){let t=EZ(e),n=Vr(),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)({goal:`known-vulnerabilities`,depth:`default`,runCount:1,executionMode:`sequential`,timeCapMs:6e5,costCapUsd:5}),[s,c]=(0,S.useState)(!1),l=ni({queryKey:[`console-workflows`,t.owner],enabled:!!t.owner,queryFn:({signal:e})=>G(`/api/console/workflows?sessionId=${encodeURIComponent(t.owner)}`,{signal:e}),refetchInterval:1500}),u=ri({mutationFn:async()=>{if(wZ(a),!t.owner)throw Error(`Choose a session first.`);if(!s)throw Error(`Confirm the audit first.`);if(!r.trim())throw Error(`Enter a target.`);if(!t.connected)throw Error(`Connect a provider first.`);return G(`/api/console/workflows`,ZX({sessionId:t.owner,target:r.trim(),plan:a,approval:`launch-authorized-run`}))},onSuccess:async()=>{c(!1),await n.invalidateQueries({queryKey:[`console-workflows`,t.owner]})}}),d=ri({mutationFn:e=>G(`/api/console/workflows/${encodeURIComponent(e)}/cancel`,ZX({sessionId:t.owner})),onSuccess:async()=>{await l.refetch()}}),f=e=>{o(t=>({...t,...e})),c(!1),u.reset()};return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsx)(DZ,{state:t}),!t.connected&&!t.providers.isPending&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(XX,{children:`Connect a provider below to start an audit.`}),(0,W.jsx)(aZ,{})]}),(0,W.jsx)(HX,{title:`Audit`,children:(0,W.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),u.mutate()},children:[(0,W.jsx)(WX,{label:`Target`,value:r,onChange:e=>{i(e.target.value),c(!1)},required:!0,maxLength:4096,placeholder:`https://…, source:/project, npm:package, pypi:package, cargo:crate, oci:image`}),(0,W.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,W.jsx)(UX,{label:`Goal`,children:(0,W.jsx)(yI,{"aria-label":`Goal`,value:a.goal,onValueChange:e=>f({goal:e}),options:[{value:`known-vulnerabilities`,label:`Known vulnerabilities`},{value:`unknown-vulnerabilities`,label:`Unknown vulnerabilities`},{value:`misconfigurations`,label:`Misconfigurations`}]})}),(0,W.jsx)(UX,{label:`Depth`,children:(0,W.jsx)(yI,{"aria-label":`Depth`,value:a.depth,onValueChange:e=>f({depth:e}),options:[{value:`quick`,label:`Quick`},{value:`default`,label:`Default`},{value:`deep`,label:`Deep`}]})}),(0,W.jsx)(WX,{label:`Time limit (minutes)`,type:`number`,min:.01,max:1440,step:`any`,value:Number.isFinite(a.timeCapMs)?a.timeCapMs/6e4:``,required:!0,onChange:e=>f({timeCapMs:e.target.valueAsNumber*6e4})}),(0,W.jsx)(WX,{label:`Cost limit (USD)`,type:`number`,min:.01,max:1e3,step:`any`,value:Number.isFinite(a.costCapUsd)?a.costCapUsd:``,required:!0,onChange:e=>f({costCapUsd:e.target.valueAsNumber})})]}),(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Advanced`}),children:(0,W.jsxs)(`div`,{className:`mt-3 grid gap-4 sm:grid-cols-2`,children:[(0,W.jsx)(WX,{label:`Number of runs`,type:`number`,min:1,max:16,step:1,value:a.runCount,required:!0,onChange:e=>f({runCount:e.target.valueAsNumber})}),(0,W.jsx)(UX,{label:`Run order`,children:(0,W.jsx)(yI,{"aria-label":`Run order`,value:a.executionMode,onValueChange:e=>f({executionMode:e}),options:[{value:`sequential`,label:`Sequential`},{value:`parallel`,label:`Parallel`}]})})]})}),(0,W.jsx)(GX,{checked:s,onChange:c,disabled:u.isPending,children:`I'm authorized to audit this target with these settings.`}),(0,W.jsx)(KX,{error:u.error}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsx)(JX,{type:`submit`,pending:u.isPending,disabled:!s||!t.owner||!t.connected||!r.trim(),children:`Start audit`}),(0,W.jsx)(J,{type:`button`,variant:`outline`,disabled:u.isPending,onClick:()=>{c(!1),u.reset()},children:`Cancel`})]})]})}),(0,W.jsxs)(HX,{title:`Audits`,children:[(0,W.jsx)(qX,{pending:!!t.owner&&l.isPending,error:l.error??d.error,retry:l.refetch}),t.owner?l.data?.workflows.filter(e=>e.kind===`run`).length===0?(0,W.jsx)(XX,{children:`No audits yet.`}):(0,W.jsx)(`div`,{className:`space-y-4`,children:l.data?.workflows.filter(e=>e.kind===`run`).map(e=>(0,W.jsx)(kZ,{workflow:e,cancel:()=>d.mutate(e.id),cancelling:d.isPending&&d.variables===e.id},e.id))}):(0,W.jsx)(XX,{children:`Choose a session to see its audits.`})]})]})}function jZ({result:e,title:t}){return(0,W.jsxs)(HX,{title:t,children:[(0,W.jsx)(YX,{entries:[[`Result`,e.status],[`File`,e.sourceFile]]}),e.error&&(0,W.jsx)(KX,{error:e.error}),e.rationale&&(0,W.jsx)(`p`,{className:`text-sm leading-relaxed`,children:e.rationale}),e.diff?(0,W.jsx)(OZ,{title:`Diff`,value:e.diff}):(0,W.jsx)(XX,{children:`No diff.`}),e.precondition!==void 0&&(0,W.jsx)(OZ,{title:`Before`,value:e.precondition}),e.postcondition!==void 0&&(0,W.jsx)(OZ,{title:`After`,value:e.postcondition}),e.test&&(0,W.jsxs)(`section`,{className:`space-y-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-medium`,children:`Tests`}),(0,W.jsx)(YX,{entries:[[`Exit code`,e.test.exitCode===null?`None`:String(e.test.exitCode)],[`Duration`,`${(e.test.durationMs/1e3).toFixed(1)}s`]]}),e.test.timedOut&&(0,W.jsx)(KX,{error:`Tests timed out.`}),(0,W.jsx)(OZ,{title:`Output`,value:e.test.stdout}),(0,W.jsx)(OZ,{title:`Errors`,value:e.test.stderr})]}),e.attempts.length>0&&(0,W.jsx)(`ol`,{className:`space-y-2 text-sm`,children:e.attempts.map(e=>(0,W.jsxs)(`li`,{children:[`Attempt `,e.attempt,`: `,e.reason]},e.attempt))})]})}function MZ({sessionId:e}){let t=et(),n=EZ(e),r=$X(),i=new URLSearchParams(t.search).get(`intent`),[a,o]=(0,S.useState)(new URLSearchParams(t.search).get(`finding`)??``),[s,c]=(0,S.useState)(``),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(null),[p,m]=(0,S.useState)(``),[h,g]=(0,S.useState)({}),_=ni({queryKey:[`console-workflows`,n.owner],enabled:!!n.owner,queryFn:({signal:e})=>G(`/api/console/workflows?sessionId=${encodeURIComponent(n.owner)}`,{signal:e}),refetchInterval:2e3}),v=ni({queryKey:[`console-workflow`,n.owner,p],enabled:!!n.owner&&!!p,queryFn:({signal:e})=>G(`/api/console/workflows/${encodeURIComponent(p)}?sessionId=${encodeURIComponent(n.owner)}`,{signal:e}),refetchInterval:e=>e.state.data&&!TZ[e.state.data.workflow.status]?!1:1e3});(0,S.useEffect)(()=>{v.data?.workflow.result?.fix&&f(v.data.workflow.result.fix)},[v.data?.workflow.updatedAt]),(0,S.useEffect)(()=>{f(null),m(``),g({})},[n.owner]);let y=d?JSON.stringify([d.id,d.reviewToken,d.candidateId,d.publication?.publicationToken,r.data?.connected,r.data?.account,r.data?.scopes]):``;(0,S.useEffect)(()=>{g({})},[y]);let b=!!d?.activeWorkflowId||!!_.data?.workflows.some(e=>TZ[e.status])||!!(v.data&&TZ[v.data.workflow.status]),x=ri({mutationFn:async()=>{if(!n.owner)throw Error(`Choose a session first.`);if(!a.trim())throw Error(`Enter a finding ID.`);return G(`/api/console/fixes/prepare`,ZX({sessionId:n.owner,findingId:a.trim(),...s.trim()?{repoRoot:s.trim()}:{},...l.trim()?{testCommand:l.trim()}:{}}))},onSuccess:e=>{f(e.fix),u(e.fix.testCommand??``),c(e.fix.repoRoot),m(``),g({})}}),C=ri({mutationFn:async e=>{if(!d||d.sessionId!==n.owner)throw Error(`Load a finding first.`);if(e!==`inspect`&&!h[e])throw Error(`Tick the approval box first.`);if(e===`publish`&&(!r.data?.connected||!r.data?.available||r.isError))throw Error(`Connect GitHub first.`);let t={sessionId:n.owner,fixId:d.id,...e===`propose`?{reviewToken:d.reviewToken,approval:`generate-and-test`}:{candidateId:d.candidateId},...e===`verify`?{approval:`run-regression`}:{},...e===`apply`?{approval:`apply-to-repository`}:{},...e===`publish`?{publicationToken:d.publication?.publicationToken,approval:`publish-draft-pr`}:{}};return G(`/api/console/fixes/${e===`inspect`?`publish`:e}`,ZX(t))},onSuccess:async e=>{f(e.fix),g({}),e.workflow&&m(e.workflow.id),await _.refetch()}}),w=ri({mutationFn:e=>G(`/api/console/workflows/${encodeURIComponent(e)}/cancel`,ZX({sessionId:n.owner})),onSuccess:async()=>{await Promise.all([v.refetch(),_.refetch()])}}),T=()=>{f(null),g({}),x.reset(),C.reset()},E=_.data?.workflows.filter(e=>e.kind.startsWith(`fix-`)&&e.result?.fix)??[],D=null;if(d?.published?.prUrl)try{let e=new URL(d.published.prUrl);e.protocol===`https:`&&!e.username&&!e.password&&(D=e.href)}catch{}return(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsx)(DZ,{state:n}),(0,W.jsxs)(HX,{title:`Finding`,children:[(0,W.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),x.mutate()},children:[(0,W.jsx)(WX,{label:`Finding ID`,value:a,onChange:e=>{o(e.target.value),T()},required:!0,disabled:b||x.isPending}),(0,W.jsx)(WX,{label:`Test command`,value:l,onChange:e=>{u(e.target.value),T()},disabled:b||x.isPending,placeholder:`npm test`}),(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Advanced`}),children:(0,W.jsx)(`div`,{className:`mt-3`,children:(0,W.jsx)(WX,{label:`Project folder`,value:s,onChange:e=>{c(e.target.value),T()},disabled:b||x.isPending,placeholder:`/path/to/project`,hint:`Defaults to the session's folder.`})})}),(0,W.jsx)(JX,{type:`submit`,pending:x.isPending,disabled:!n.owner||!a.trim()||b,children:`Load finding`})]}),(0,W.jsx)(KX,{error:x.error}),E.length>0&&(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Resume a previous fix`}),children:(0,W.jsx)(`div`,{className:`mt-3 space-y-2`,children:E.map(e=>(0,W.jsxs)(J,{variant:`outline`,className:`h-auto justify-start whitespace-normal text-left`,disabled:b,onClick:()=>{f(e.result.fix),m(e.id),g({})},children:[`Finding `,e.result.fix.finding.id,` · `,e.kind,` · `,e.status]},e.id))})})]}),i===`publish`&&(0,W.jsx)(`div`,{role:`status`,className:`rounded-md border border-primary/20 bg-primary/5 p-4 text-sm`,children:`To open a pull request, load the finding, review the plan, then approve it below. Nothing has been published yet.`}),i===`cancel`&&(0,W.jsx)(`div`,{role:`status`,className:`rounded-md border border-primary/20 bg-primary/5 p-4 text-sm`,children:`Pick the running fix below and press Stop. Nothing has been stopped yet.`}),!d?.publication&&!r.data?.connected&&(0,W.jsx)(eZ,{}),d&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(HX,{title:d.finding.title,children:[(0,W.jsx)(YX,{entries:[[`Severity & status`,`${d.finding.severity} · ${d.finding.status}`],[`Test command`,d.testCommand||`Missing — add one and load again`]]}),(0,W.jsx)(VX,{title:(0,W.jsx)(W.Fragment,{children:`Details`}),children:(0,W.jsx)(`div`,{className:`mt-3`,children:(0,W.jsx)(YX,{entries:[[`Finding`,d.finding.id],[`Project`,d.repoRoot],[`Commit`,d.baseCommit],[`Review ID`,d.reviewToken]]})})}),(0,W.jsx)(vn,{to:d.finding.fingerprint?`/findings/${encodeURIComponent(d.finding.fingerprint)}`:`/findings`,className:`text-sm underline`,children:`View finding`}),!d.eligible&&(0,W.jsx)(KX,{error:d.reason??`This finding can't be fixed automatically.`}),!d.result&&d.eligible&&(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(GX,{checked:h.propose??!1,onChange:e=>g(t=>({...t,propose:e})),disabled:b||C.isPending,children:`Generate a fix and run the test command above in a separate copy. Your project isn't changed.`}),(0,W.jsx)(JX,{pending:C.isPending&&C.variables===`propose`,disabled:!h.propose||!d.testCommand||b||!n.connected,onClick:()=>C.mutate(`propose`),children:`Generate & test fix`})]})]}),d.result&&(0,W.jsx)(jZ,{result:d.result,title:`Proposed fix`}),d.verification&&(0,W.jsx)(jZ,{result:d.verification,title:`Re-test`}),d.application&&(0,W.jsx)(jZ,{result:d.application,title:`Applied to project`}),d.applied&&(0,W.jsx)(`p`,{role:`status`,className:`rounded-md border border-border p-4 text-sm`,children:`Fix applied and tested. Load the finding again before doing anything else.`}),d.candidateId&&!d.applied&&(0,W.jsxs)(HX,{title:`Next steps`,children:[(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(GX,{checked:h.verify??!1,onChange:e=>g(t=>({...t,verify:e})),disabled:b||C.isPending,children:`Run the test command again on this fix.`}),(0,W.jsx)(JX,{pending:C.isPending&&C.variables===`verify`,disabled:!h.verify||b||C.isPending,onClick:()=>C.mutate(`verify`),children:`Re-test`})]}),(0,W.jsxs)(`div`,{className:`space-y-3 border-t border-border pt-4`,children:[(0,W.jsx)(GX,{checked:h.apply??!1,onChange:e=>g(t=>({...t,apply:e})),disabled:b||C.isPending,children:`I reviewed the diff and test results. Apply this fix to my project.`}),(0,W.jsx)(JX,{pending:C.isPending&&C.variables===`apply`,disabled:!h.apply||b||C.isPending,onClick:()=>C.mutate(`apply`),children:`Apply fix`})]}),(0,W.jsx)(`div`,{className:`border-t border-border pt-4`,children:(0,W.jsx)(JX,{variant:`outline`,pending:C.isPending&&C.variables===`inspect`,disabled:b||C.isPending,onClick:()=>C.mutate(`inspect`),children:`Preview pull request`})})]}),d.publication&&!d.applied&&(0,W.jsxs)(HX,{title:`Pull request preview`,children:[(0,W.jsx)(YX,{entries:[[`Remote`,d.publication.remote],[`Branch`,`${d.publication.branch} → ${d.publication.baseBranch}`],[`Title`,d.publication.title]]}),(0,W.jsx)(OZ,{title:`Diff`,value:d.publication.diff}),(0,W.jsx)(eZ,{}),(0,W.jsx)(GX,{checked:h.publish??!1,onChange:e=>g(t=>({...t,publish:e})),disabled:b||C.isPending||!r.data?.connected||!r.data?.available||r.isError,children:`Push this branch to the remote above and open a draft pull request.`}),(0,W.jsx)(JX,{pending:C.isPending&&C.variables===`publish`,disabled:!h.publish||b||C.isPending||!!d.published||!r.data?.connected||!r.data?.available||r.isError,onClick:()=>C.mutate(`publish`),children:`Open draft pull request`})]}),d.published&&(0,W.jsxs)(HX,{title:`Pull request opened`,children:[(0,W.jsx)(YX,{entries:[[`Branch`,d.published.branch]]}),D?(0,W.jsx)(J,{asChild:!0,variant:`outline`,children:(0,W.jsxs)(`a`,{href:D,target:`_blank`,rel:`noopener noreferrer`,children:[`Open pull request`,(0,W.jsx)(ia,{className:`size-4`})]})}):(0,W.jsx)(KX,{error:`The pull request link looks unsafe, so it wasn't opened.`})]})]}),(0,W.jsx)(KX,{error:C.error??w.error??v.error}),v.data&&(0,W.jsx)(kZ,{workflow:v.data.workflow,cancel:()=>w.mutate(v.data.workflow.id),cancelling:w.isPending&&w.variables===v.data.workflow.id}),(0,W.jsxs)(HX,{title:`Fixes`,children:[(0,W.jsx)(qX,{pending:!!n.owner&&_.isPending,error:_.error,retry:_.refetch}),n.owner?_.data?.workflows.filter(e=>e.kind.startsWith(`fix-`)).length===0?(0,W.jsx)(XX,{children:`No fixes yet.`}):(0,W.jsx)(`div`,{className:`space-y-4`,children:_.data?.workflows.filter(e=>e.kind.startsWith(`fix-`)&&e.id!==p).map(e=>(0,W.jsxs)(`div`,{className:`space-y-2`,children:[(0,W.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>{m(e.id),e.result?.fix&&f(e.result.fix),g({})},children:`Select`}),(0,W.jsx)(kZ,{workflow:e,cancel:()=>w.mutate(e.id),cancelling:w.isPending&&w.variables===e.id})]},e.id))}):(0,W.jsx)(XX,{children:`Choose a session to see its fixes.`})]}),!n.connected&&!n.providers.isPending&&(0,W.jsx)(aZ,{})]})}var NZ=[{id:`welcome`,label:`Welcome`,title:`Welcome to 0`},{id:`connect`,label:`Connect`,title:`Connect a provider`},{id:`model`,label:`Model`,title:`Choose a model`},{id:`privacy`,label:`Privacy`,title:`Privacy`}],PZ={welcome:`Your security teammate, ready to explore.`,connect:`Bring the provider you already use.`,model:`Pick the model that fits your work.`,privacy:`Choose what you share. You stay in control.`};function FZ({sessionId:e,returnTo:t}){let n=rt(),[r,i]=wn(),a=Vr(),o=iZ(),s=sZ(),c=r.get(`step`),l=c===`scope`||c===`look`,u=NZ.findIndex(e=>e.id===(l?`privacy`:c)),d=u<0?0:u,f=NZ[d],p=e=>{let t=new URLSearchParams(r);t.set(`step`,NZ[Math.max(0,Math.min(e,NZ.length-1))].id),i(t,{replace:!0})};(0,S.useEffect)(()=>{if(!l)return;let e=new URLSearchParams(r);e.set(`step`,`privacy`),i(e,{replace:!0})},[l,r,i]);let m=ni({queryKey:[`setup-session`,e],enabled:!!e,retry:!1,staleTime:1/0,queryFn:async({signal:t})=>{let n=await ci(`/api/console/sessions/${encodeURIComponent(e)}`,{signal:t});if(n.status===404)return!1;if(!n.ok)throw Error(`The current session could not be loaded (${n.status} ${n.statusText}).`);return!0}}),[h,g]=(0,S.useState)(),_=h??(m.data===!0?e:void 0),v=_?_===e?t:`/console/${encodeURIComponent(_)}`:m.data===!1?`/console`:t,y=e&&!m.isSuccess&&(0,W.jsx)(qX,{pending:m.isPending,error:m.error,retry:m.refetch}),[b,x]=(0,S.useState)(`off`),[C,w]=(0,S.useState)(`ask`),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(0,S.useRef)(null),M=(0,S.useRef)(null),N=(0,S.useRef)(!1);(0,S.useEffect)(()=>{M.current?.querySelector(`[aria-current=step]`)?.scrollIntoView({block:`nearest`,inline:`nearest`}),N.current&&j.current?.focus(),N.current=!0},[d]),(0,S.useEffect)(()=>{s.data&&(T||x(String(s.data.settings.analyticsLevel??`off`)),D||w(String(s.data.settings.diagnosticReporting??`ask`)),A(!0))},[s.data,T,D]);let P=ri({mutationFn:async()=>{if(!s.data||!k)throw Error(`Load the server's current sharing preferences before completing setup.`);let e=await G(`/api/console/settings`),t=[];T&&b!==e.settings.analyticsLevel&&t.push([`analyticsLevel`,b]),D&&C!==e.settings.diagnosticReporting&&t.push([`diagnosticReporting`,C]),t.push([`diagnosticReportingPrompted`,!0],[`onboardingCompleted`,!0]);let n=e;for(let[e,r]of t)if(n=await G(`/api/console/settings`,{method:`PATCH`,body:JSON.stringify({key:e,value:r,scope:`global`})}),n.persisted===!1)throw Error(`Could not save ${e}. Setup has not been marked complete.`);return n},onSuccess:e=>{a.setQueryData([`console-settings`],e),n(v)}}),F=e=>{g(e.id),p(d+1)},I=o.data?.providers.filter(e=>e.configured)??[],L=o.data?.preference??null,R={welcome:d>0||s.data?.settings.onboardingCompleted===!0,connect:I.length>0,model:!!L?.model,privacy:s.data?.settings.diagnosticReportingPrompted===!0};return(0,W.jsxs)(`div`,{className:`mx-auto grid min-h-[calc(100dvh-160px)] w-full max-w-5xl items-center gap-8 py-6 lg:grid-cols-[280px_minmax(0,1fr)] lg:gap-16`,children:[(0,W.jsxs)(`aside`,{className:`text-center lg:sticky lg:top-12 lg:self-center`,children:[(0,W.jsx)(mc,{className:`mx-auto mb-6`}),(0,W.jsxs)(`div`,{className:q(`relative mx-auto w-40 lg:w-56`,f.id!==`welcome`&&`hidden lg:block`),children:[(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-5 rounded-full bg-primary/10 blur-3xl`}),(0,W.jsx)(`img`,{src:NL,alt:``,width:224,height:168,className:`relative h-auto w-full`})]}),(0,W.jsx)(`p`,{className:`mx-auto mt-6 max-w-64 text-sm leading-6 text-muted-foreground`,children:PZ[f.id]}),(0,W.jsxs)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:[`Step `,d+1,` of `,NZ.length]})]}),(0,W.jsxs)(`div`,{className:`min-w-0 space-y-6`,children:[(0,W.jsx)(`ol`,{ref:M,"aria-label":`Setup progress`,className:`flex gap-1.5 overflow-x-auto pb-1`,children:NZ.map((e,t)=>{let n=t===d,r=R[e.id]&&!n;return(0,W.jsx)(`li`,{className:`min-w-[5rem] flex-1`,children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>p(t),"aria-current":n?`step`:void 0,className:q(`flex w-full flex-col gap-2 rounded-lg px-1 pb-1 text-left text-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,n?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,W.jsx)(`span`,{className:q(`h-1 w-full rounded-full transition-colors`,n?`bg-primary`:r?`bg-primary opacity-50`:`bg-muted`)}),(0,W.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[r&&(0,W.jsx)(ua,{className:`size-3.5 shrink-0 text-primary-text`,"aria-label":`Done`}),(0,W.jsx)(`span`,{className:q(`truncate`,n&&`font-medium`),children:e.label})]})]})},e.id)})}),(0,W.jsx)(`h2`,{ref:j,tabIndex:-1,className:`text-2xl font-medium tracking-tight outline-none`,children:f.title}),f.id===`welcome`&&(o.isPending||s.isPending||o.error||s.error?(0,W.jsx)(qX,{pending:o.isPending||s.isPending,error:o.error??s.error,retry:()=>{o.refetch(),s.refetch()}}):R.welcome||I.length>0?(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsx)(YX,{entries:[[`Provider`,L?o.data?.providers.find(e=>e.id===L.providerId)?.label??L.providerId:I.map(e=>e.label).join(`, `)||`None`],[`Model`,L?.model??`Not chosen`]]}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsxs)(J,{onClick:()=>n(v),children:[`Open chat`,(0,W.jsx)(ra,{className:`size-4`})]}),(0,W.jsx)(J,{variant:`outline`,onClick:()=>p(1),children:`Review setup`})]})]}):(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a provider and pick a model. `}),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsxs)(J,{onClick:()=>p(1),children:[`Get started`,(0,W.jsx)(ra,{className:`size-4`})]}),(0,W.jsx)(J,{variant:`ghost`,onClick:()=>n(v),children:`Later`})]})]})),f.id===`connect`&&(0,W.jsx)(aZ,{onConnected:()=>p(d+1)}),f.id===`model`&&(y||(0,W.jsx)(IZ,{owner:_,onApplied:F})),f.id===`privacy`&&(0,W.jsxs)(`div`,{className:`space-y-5`,children:[(0,W.jsx)(qX,{pending:s.isPending,error:s.error,retry:s.refetch}),(0,W.jsxs)(`div`,{className:`divide-y divide-border/50`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-6 py-4`,children:[(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(`label`,{htmlFor:`setup-usage-metrics`,className:`text-sm font-medium`,children:`Usage metrics`}),(0,W.jsx)(`p`,{id:`setup-usage-metrics-hint`,className:`text-xs leading-5 text-muted-foreground`,children:`Anonymous counts and timing. Never code or prompts.`})]}),(0,W.jsx)(cJ,{id:`setup-usage-metrics`,"aria-label":`Usage metrics`,"aria-describedby":`setup-usage-metrics-hint`,checked:b===`usage`,onCheckedChange:e=>{x(e?`usage`:`off`),E(!0)},disabled:!k||P.isPending})]}),(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-6 py-4`,children:[(0,W.jsxs)(`div`,{className:`space-y-1`,children:[(0,W.jsx)(`label`,{htmlFor:`setup-diagnostic-reports`,className:`text-sm font-medium`,children:`Diagnostic reports`}),(0,W.jsx)(`p`,{id:`setup-diagnostic-reports-hint`,className:`text-xs leading-5 text-muted-foreground`,children:C===`automatic`?`Reports send automatically. Change this in Settings.`:`Ask before sending. You review each report first.`})]}),(0,W.jsx)(cJ,{id:`setup-diagnostic-reports`,"aria-label":`Diagnostic reports`,"aria-describedby":`setup-diagnostic-reports-hint`,checked:C!==`off`,onCheckedChange:e=>{w(e?`ask`:`off`),O(!0)},disabled:!k||P.isPending})]})]}),(0,W.jsx)(KX,{error:P.error}),(0,W.jsxs)(JX,{pending:P.isPending,disabled:!k||s.isError,onClick:()=>P.mutate(),children:[`Finish setup`,(0,W.jsx)(ra,{className:`size-4`})]})]}),d>0&&(0,W.jsxs)(`div`,{className:`sticky bottom-0 z-10 -mx-1 flex items-center justify-between gap-3 bg-background/95 px-1 py-3 backdrop-blur`,children:[(0,W.jsxs)(J,{variant:`ghost`,disabled:P.isPending,onClick:()=>p(d-1),children:[(0,W.jsx)(na,{className:`size-4`}),`Back`]}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(J,{variant:`ghost`,disabled:P.isPending,onClick:()=>n(v),children:`Exit`}),d<NZ.length-1&&(0,W.jsxs)(J,{variant:R[f.id]?`default`:`outline`,onClick:()=>p(d+1),children:[R[f.id]?`Continue`:`Skip`,(0,W.jsx)(ra,{className:`size-4`})]})]})]})]})]})}function IZ({owner:e,onApplied:t}){let n=iZ(),r=Vr(),i=ni({queryKey:[`console-control-session`,e],enabled:!!e,queryFn:async({signal:t})=>(await G(`/api/console/sessions/${encodeURIComponent(e)}`,{signal:t})).snapshot}),a=i.data?.session.runtime??i.data?.runtime??void 0,[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(``);(0,S.useEffect)(()=>{!o&&n.data&&(!e||i.data)&&(s(a?.providerId??n.data.preference?.providerId??n.data.providers.find(e=>e.configured)?.id??``),l(a?.model??n.data.preference?.model??``))},[n.data,i.data,e,o,a]);let u=ni({queryKey:[`console-models`,o],enabled:!!o,queryFn:({signal:e})=>G(`/api/console/models?providerId=${encodeURIComponent(o)}`,{signal:e})}),d=n.data?.providers.filter(e=>e.configured)??[],f=ri({mutationFn:async()=>{let t=e??(await G(`/api/console/sessions`,ZX({}))).session.id,n=a?{agentModels:a.agentModels,singleModel:a.singleModel,autoRoute:a.autoRoute}:{};return(await G(`/api/console/sessions/${encodeURIComponent(t)}/configuration`,{method:`PATCH`,body:JSON.stringify({runtime:{providerId:o,model:c,...n}})})).session},onSuccess:async e=>{await Promise.all([r.invalidateQueries({queryKey:[`console-control-session`]}),r.invalidateQueries({queryKey:[`console-sessions`]}),n.refetch()]),t(e)}});return n.isPending||n.error||e&&(i.isPending||i.error)?(0,W.jsx)(qX,{pending:n.isPending||i.isPending,error:n.error??i.error,retry:()=>{n.refetch(),i.refetch()}}):d.length===0?(0,W.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a provider first.`}):(0,W.jsxs)(`form`,{className:`space-y-5`,onSubmit:e=>{e.preventDefault(),f.mutate()},children:[(0,W.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,W.jsx)(UX,{label:`Provider`,children:(0,W.jsx)(yI,{"aria-label":`Provider`,value:o,onValueChange:e=>{s(e),l(``),f.reset()},options:d.map(e=>({value:e.id,label:e.label}))})}),(0,W.jsx)(UX,{label:`Model`,children:(0,W.jsx)(yI,{"aria-label":`Model`,value:c,onValueChange:l,disabled:u.isPending,required:!0,options:[{value:``,label:u.isPending?`Loading…`:`Choose a model`},...u.data?.models.map(e=>({value:e.id,label:`${e.id}${e.price?` · ${e.price}`:``}`}))??[]]})})]}),(0,W.jsx)(KX,{error:f.error??u.error}),(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,W.jsx)(JX,{type:`submit`,pending:f.isPending,disabled:!c,children:`Use this model`}),(0,W.jsx)(vn,{to:`/models`,className:`text-sm text-muted-foreground underline-offset-4 hover:text-foreground hover:underline`,children:`Advanced routing`})]})]})}var LZ=[{mode:`onboarding`,path:`/setup`,label:`Setup`,icon:So,description:`Get started in a few steps. You can change everything later.`},{mode:`connections`,path:`/connections`,label:`Connections`,icon:Ha,description:``},{mode:`models`,path:`/models`,label:`Models`,icon:So,description:``},{mode:`project`,path:`/project`,label:`Workspace`,icon:Pa,description:``},{mode:`settings`,path:`/settings`,label:`General`,icon:po,description:``},{mode:`plugins`,path:`/plugins`,label:`Plugins`,icon:sa,description:``},{mode:`doctor`,path:`/doctor`,label:`Health`,icon:Va,description:``},{mode:`tools`,path:`/tools`,label:`Tools`,icon:No,description:``},{mode:`launch`,path:`/audits`,label:`Audits`,icon:lo,description:`Plan and track security audits. Limits apply to the whole audit.`},{mode:`fix`,path:`/fix`,label:`Fixes`,icon:No,description:``}];function RZ({mode:e}){let t=et(),n=(0,S.useRef)(null),r=t.pathname.replace(/^\/console\//,`/`).replace(/\/$/,``),i=e??([`/launch`,`/launcher`].includes(r)?`launch`:LZ.find(e=>e.path===r)?.mode)??`settings`,a=LZ.find(e=>e.mode===i),o=new URLSearchParams(t.search),s=o.get(`session`)??void 0,c=cZ.find(e=>e.id===o.get(`section`))?.id??`general`,l=QX(t.search),u=new URLSearchParams;s&&u.set(`session`,s),u.set(`return`,l);let d=`?${u}`;(0,S.useEffect)(()=>{n.current?.focus()},[i]);let f=i===`onboarding`?(0,W.jsx)(FZ,{sessionId:s,returnTo:l}):i===`connections`?(0,W.jsx)(aZ,{}):i===`models`?(0,W.jsx)(oZ,{sessionId:s}):i===`settings`?(0,W.jsx)(mZ,{category:c}):i===`plugins`?(0,W.jsx)(_Z,{sessionId:s}):i===`doctor`?(0,W.jsx)(SZ,{}):i===`tools`?(0,W.jsx)(CZ,{sessionId:s}):i===`project`?(0,W.jsx)(xZ,{sessionId:s}):i===`launch`?(0,W.jsx)(AZ,{sessionId:s}):(0,W.jsx)(MZ,{sessionId:s});if(i===`plugins`)return(0,W.jsxs)(`main`,{"aria-label":`Plugins`,className:`console-controls mx-auto w-full max-w-6xl space-y-7 px-5 py-8 sm:px-8 lg:px-10`,children:[(0,W.jsx)(`div`,{ref:n,tabIndex:-1,className:`outline-none`,children:(0,W.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Plugins`})}),f]});if(i===`launch`)return(0,W.jsx)(`main`,{"aria-label":`Audits`,className:`mx-auto w-full max-w-5xl space-y-6 px-5 py-6 sm:px-8 lg:px-10`,children:f});let p=i===`onboarding`;return(0,W.jsxs)(`div`,{className:q(`console-controls mx-auto w-full space-y-6 px-5 py-6 sm:px-8 lg:px-10`,p?`max-w-5xl`:`max-w-4xl`),children:[!p&&(0,W.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:(0,W.jsx)(J,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,W.jsxs)(vn,{to:l,children:[(0,W.jsx)(na,{className:`size-4`}),`Back to chat`]})})}),!p&&(0,W.jsxs)(`div`,{ref:n,tabIndex:-1,className:`outline-none`,children:[(0,W.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:i===`settings`?cZ.find(e=>e.id===c)?.label:a.label}),!p&&a.description&&(0,W.jsx)(`p`,{className:`mt-2 max-w-2xl text-sm leading-6 text-muted-foreground`,children:a.description})]}),p?(0,W.jsx)(`main`,{className:`min-w-0 space-y-6`,"aria-label":a.label,children:f}):(0,W.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-[13rem_minmax(0,1fr)]`,children:[(0,W.jsxs)(`nav`,{"aria-label":`Sections`,className:`flex gap-1 overflow-x-auto pb-2 lg:block lg:space-y-1 lg:overflow-visible`,children:[cZ.map(e=>{let t={general:po,appearance:Qa,conversation:Xa,agents:Ao,privacy:yo}[e.id];return(0,W.jsxs)(vn,{to:`/settings${d}&section=${e.id}`,"aria-current":i===`settings`&&c===e.id?`page`:void 0,className:q(`flex shrink-0 items-center gap-3 whitespace-nowrap rounded-xl px-3 py-2.5 text-sm transition-colors focus-visible:outline focus-visible:outline-offset-2`,i===`settings`&&c===e.id?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,W.jsx)(t,{className:`size-4 shrink-0`}),e.label]},e.id)}),(0,W.jsx)(`div`,{className:`hidden py-2 lg:block`}),LZ.filter(e=>e.mode!==`launch`&&e.mode!==`settings`).map(e=>(0,W.jsxs)(vn,{to:`${e.path}${d}`,"aria-current":i===e.mode?`page`:void 0,className:q(`flex shrink-0 items-center gap-2 whitespace-nowrap rounded-xl px-3 py-2.5 text-sm transition-colors focus-visible:outline-none focus-visible:outline focus-visible:outline-offset-2`,i===e.mode?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,W.jsx)(e.icon,{className:`size-4 shrink-0`}),e.label]},e.mode))]}),(0,W.jsx)(`main`,{className:`min-w-0 space-y-6`,"aria-label":a.label,children:f})]})]})}function zZ(e){let t=e;return!!(t&&([`INPUT`,`TEXTAREA`,`SELECT`].includes(t.tagName)||t.isContentEditable))}function BZ(){let e=et(),t=/^\/(?:dashboard|operations|threads|findings|runs|scans|live)(?:\/|$)/.test(e.pathname),[n,r]=(0,S.useState)(!1),i=ni({queryKey:[`dashboard`],queryFn:li,enabled:t||n,refetchInterval:5e3}),a=ni({queryKey:[`scans`],queryFn:ui,enabled:t||n,refetchInterval:5e3}),o=ni({queryKey:[`console-themes`],queryFn:({signal:e})=>G(`/api/console/themes`,{signal:e}),refetchInterval:5e3});(0,S.useEffect)(()=>{let e=o.data?.themes.find(e=>e.name===o.data?.active);if(!e)return;let t=document.documentElement,n=e.mode!==`light`;t.classList.toggle(`dark`,n),t.dataset.mode=n?`dark`:`light`,t.style.colorScheme=n?`dark`:`light`;let r={"--background":n?`#0b0b0c`:`#ffffff`,"--foreground":n?`#f4f4f5`:`#18181b`,"--card":n?`#141415`:`#ffffff`,"--card-foreground":n?`#f4f4f5`:`#18181b`,"--popover":n?`#19191b`:`#ffffff`,"--popover-foreground":n?`#f4f4f5`:`#18181b`,"--primary":`#f97316`,"--primary-text":n?`#fb923c`:`#c2410c`,"--primary-foreground":`#ffffff`,"--secondary":n?`#1b1b1e`:`#f4f4f5`,"--secondary-foreground":n?`#f4f4f5`:`#18181b`,"--muted":n?`#1b1b1e`:`#f4f4f5`,"--muted-foreground":n?`#a1a1aa`:`#62626a`,"--accent":n?`#222225`:`#f4f4f5`,"--accent-foreground":n?`#f4f4f5`:`#18181b`,"--border":n?`#29292d`:`#e4e4e7`,"--input":n?`#343439`:`#d4d4d8`,"--ring":`#f97316`,"--destructive":e.palette.ERROR,"--sidebar":n?`#111113`:`#fafafa`,"--sidebar-foreground":n?`#f4f4f5`:`#18181b`,"--sidebar-border":n?`#29292d`:`#e4e4e7`};for(let[e,n]of Object.entries(r))n&&CSS.supports(`color`,n)&&t.style.setProperty(e,n)},[o.data]);let s=(0,S.useEffectEvent)(e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`?(e.preventDefault(),r(e=>!e)):!n&&e.key===`/`&&!zZ(e.target)&&(e.preventDefault(),r(!0))});(0,S.useEffect)(()=>{let e=e=>s(e);return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s]);let c=e=>{if(i.isLoading||a.isLoading)return(0,W.jsx)(gp,{label:`Loading`});let t=i.error??a.error;return t?(0,W.jsx)(vp,{error:t}):e},l=i.data,u=a.data??[],d=(0,W.jsx)(J,{asChild:!0,variant:`accent`,size:`sm`,children:(0,W.jsx)(yn,{to:`/console`,children:`Start a chat`})}),f=c(l?(0,W.jsx)(mv,{dashboard:l}):(0,W.jsx)(_p,{title:`No findings yet`,action:d}));return(0,W.jsx)(Vi,{children:(0,W.jsxs)(rf,{onOpenPalette:()=>r(!0),children:[(0,W.jsx)(op,{open:n,onOpenChange:r,dashboard:l,scans:a.data}),(0,W.jsxs)(At,{children:[(0,W.jsx)(Ot,{path:`/`,element:(0,W.jsx)(Dt,{to:`/console`,replace:!0})}),(0,W.jsx)(Ot,{path:`/console`,element:(0,W.jsx)(hJ,{})}),(0,W.jsx)(Ot,{path:`/console/:sessionId`,element:(0,W.jsx)(hJ,{})}),[`setup`,`connections`,`models`,`settings`,`plugins`,`doctor`,`tools`,`project`,`fix`].map(e=>(0,W.jsx)(Ot,{path:`/${e}`,element:(0,W.jsx)(RZ,{})},e)),[`workflows`,`audits`,`launcher`,`launch`].map(e=>(0,W.jsx)(Ot,{path:`/${e}`,element:(0,W.jsx)(BX,{})},e)),(0,W.jsx)(Ot,{path:`/dashboard`,element:c(l?(0,W.jsx)(bI,{data:l}):(0,W.jsx)(_p,{title:`Nothing here yet`,action:d}))}),(0,W.jsx)(Ot,{path:`/operations`,element:(0,W.jsx)(Dt,{to:`/dashboard`,replace:!0})}),(0,W.jsx)(Ot,{path:`/threads`,element:f}),(0,W.jsx)(Ot,{path:`/threads/:fingerprint`,element:f}),(0,W.jsx)(Ot,{path:`/findings`,element:f}),(0,W.jsx)(Ot,{path:`/findings/:fingerprint`,element:f}),(0,W.jsx)(Ot,{path:`/runs`,element:c((0,W.jsx)(MI,{scans:u}))}),(0,W.jsx)(Ot,{path:`/runs/:scanId`,element:c((0,W.jsx)(MI,{scans:u}))}),(0,W.jsx)(Ot,{path:`/scans`,element:c((0,W.jsx)(MI,{scans:u}))}),(0,W.jsx)(Ot,{path:`/scans/:scanId`,element:c((0,W.jsx)(MI,{scans:u}))}),(0,W.jsx)(Ot,{path:`/live`,element:(0,W.jsx)(Kv,{})}),(0,W.jsx)(Ot,{path:`*`,element:(0,W.jsx)(_p,{title:`Page not found`,body:`Press Cmd+K to find a page.`})})]})]})})}function VZ(){return(0,W.jsx)(BZ,{})}document.documentElement.classList.add(`dark`),document.documentElement.style.colorScheme=`dark`,document.documentElement.dataset.mode=`dark`;var HZ=new Rr({defaultOptions:{queries:{staleTime:15e3,refetchOnWindowFocus:!0}}});ii.createRoot(document.getElementById(`root`)).render((0,W.jsx)(S.StrictMode,{children:(0,W.jsx)(Hr,{client:HZ,children:(0,W.jsx)(_n,{children:(0,W.jsx)(VZ,{})})})}));